diff options
author | Zsolt Vasvari <zsoltvas@mamedev.org> | 2008-03-10 02:16:06 +0000 |
---|---|---|
committer | Zsolt Vasvari <zsoltvas@mamedev.org> | 2008-03-10 02:16:06 +0000 |
commit | 198f401cf544c3148f650e1447a49feb9ccdcc09 (patch) | |
tree | dc9a83eec9e122f6f3c17e2305c4154519a419a4 | |
parent | 9b3ac2606efb11fe7dcbd5df687d9e7547170a48 (diff) |
Changes TMS34010 to take a screen tag instead of the screen number
Everything appears to work, except X The Ball, which sets horz the resolution twice as wide as it should -- no clue why
36 files changed, 154 insertions, 107 deletions
diff --git a/src/emu/cpu/tms34010/34010gfx.c b/src/emu/cpu/tms34010/34010gfx.c index ab14442c0d1..ffe03c8cb7f 100644 --- a/src/emu/cpu/tms34010/34010gfx.c +++ b/src/emu/cpu/tms34010/34010gfx.c @@ -24,7 +24,7 @@ static void line(void) state.st |= STBIT_P; TEMP = (state.op & 0x80) ? 1 : 0; /* boundary value depends on the algorithm */ - LOGGFX(("%08X(%3d):LINE (%d,%d)-(%d,%d)\n", PC, video_screen_get_vpos_scrnum(state.config->scrnum), DADDR_X, DADDR_Y, DADDR_X + DYDX_X, DADDR_Y + DYDX_Y)); + LOGGFX(("%08X(%3d):LINE (%d,%d)-(%d,%d)\n", PC, video_screen_get_vpos(state.screen), DADDR_X, DADDR_Y, DADDR_X + DYDX_X, DADDR_Y + DYDX_Y)); } if (COUNT > 0) @@ -902,7 +902,7 @@ static void pixblt_b_l(void) int trans = (IOREG(REG_CONTROL) & 0x20) >> 5; int rop = (IOREG(REG_CONTROL) >> 10) & 0x1f; int ix = trans | (rop << 1) | (psize << 6); - if (!P_FLAG) LOGGFX(("%08X(%3d):PIXBLT B,L (%dx%d) depth=%d\n", PC, video_screen_get_vpos_scrnum(state.config->scrnum), DYDX_X, DYDX_Y, IOREG(REG_PSIZE) ? IOREG(REG_PSIZE) : 32)); + if (!P_FLAG) LOGGFX(("%08X(%3d):PIXBLT B,L (%dx%d) depth=%d\n", PC, video_screen_get_vpos(state.screen), DYDX_X, DYDX_Y, IOREG(REG_PSIZE) ? IOREG(REG_PSIZE) : 32)); pixel_op = pixel_op_table[rop]; pixel_op_timing = pixel_op_timing_table[rop]; (*pixblt_b_op_table[ix])(1); @@ -914,7 +914,7 @@ static void pixblt_b_xy(void) int trans = (IOREG(REG_CONTROL) & 0x20) >> 5; int rop = (IOREG(REG_CONTROL) >> 10) & 0x1f; int ix = trans | (rop << 1) | (psize << 6); - if (!P_FLAG) LOGGFX(("%08X(%3d):PIXBLT B,XY (%d,%d) (%dx%d) depth=%d\n", PC, video_screen_get_vpos_scrnum(state.config->scrnum), DADDR_X, DADDR_Y, DYDX_X, DYDX_Y, IOREG(REG_PSIZE) ? IOREG(REG_PSIZE) : 32)); + if (!P_FLAG) LOGGFX(("%08X(%3d):PIXBLT B,XY (%d,%d) (%dx%d) depth=%d\n", PC, video_screen_get_vpos(state.screen), DADDR_X, DADDR_Y, DYDX_X, DYDX_Y, IOREG(REG_PSIZE) ? IOREG(REG_PSIZE) : 32)); pixel_op = pixel_op_table[rop]; pixel_op_timing = pixel_op_timing_table[rop]; (*pixblt_b_op_table[ix])(0); @@ -927,7 +927,7 @@ static void pixblt_l_l(void) int rop = (IOREG(REG_CONTROL) >> 10) & 0x1f; int pbh = (IOREG(REG_CONTROL) >> 8) & 1; int ix = trans | (rop << 1) | (psize << 6); - if (!P_FLAG) LOGGFX(("%08X(%3d):PIXBLT L,L (%dx%d) depth=%d\n", PC, video_screen_get_vpos_scrnum(state.config->scrnum), DYDX_X, DYDX_Y, IOREG(REG_PSIZE) ? IOREG(REG_PSIZE) : 32)); + if (!P_FLAG) LOGGFX(("%08X(%3d):PIXBLT L,L (%dx%d) depth=%d\n", PC, video_screen_get_vpos(state.screen), DYDX_X, DYDX_Y, IOREG(REG_PSIZE) ? IOREG(REG_PSIZE) : 32)); pixel_op = pixel_op_table[rop]; pixel_op_timing = pixel_op_timing_table[rop]; if (!pbh) @@ -943,7 +943,7 @@ static void pixblt_l_xy(void) int rop = (IOREG(REG_CONTROL) >> 10) & 0x1f; int pbh = (IOREG(REG_CONTROL) >> 8) & 1; int ix = trans | (rop << 1) | (psize << 6); - if (!P_FLAG) LOGGFX(("%08X(%3d):PIXBLT L,XY (%d,%d) (%dx%d) depth=%d\n", PC, video_screen_get_vpos_scrnum(state.config->scrnum), DADDR_X, DADDR_Y, DYDX_X, DYDX_Y, IOREG(REG_PSIZE) ? IOREG(REG_PSIZE) : 32)); + if (!P_FLAG) LOGGFX(("%08X(%3d):PIXBLT L,XY (%d,%d) (%dx%d) depth=%d\n", PC, video_screen_get_vpos(state.screen), DADDR_X, DADDR_Y, DYDX_X, DYDX_Y, IOREG(REG_PSIZE) ? IOREG(REG_PSIZE) : 32)); pixel_op = pixel_op_table[rop]; pixel_op_timing = pixel_op_timing_table[rop]; if (!pbh) @@ -959,7 +959,7 @@ static void pixblt_xy_l(void) int rop = (IOREG(REG_CONTROL) >> 10) & 0x1f; int pbh = (IOREG(REG_CONTROL) >> 8) & 1; int ix = trans | (rop << 1) | (psize << 6); - if (!P_FLAG) LOGGFX(("%08X(%3d):PIXBLT XY,L (%dx%d) depth=%d\n", PC, video_screen_get_vpos_scrnum(state.config->scrnum), DYDX_X, DYDX_Y, IOREG(REG_PSIZE) ? IOREG(REG_PSIZE) : 32)); + if (!P_FLAG) LOGGFX(("%08X(%3d):PIXBLT XY,L (%dx%d) depth=%d\n", PC, video_screen_get_vpos(state.screen), DYDX_X, DYDX_Y, IOREG(REG_PSIZE) ? IOREG(REG_PSIZE) : 32)); pixel_op = pixel_op_table[rop]; pixel_op_timing = pixel_op_timing_table[rop]; if (!pbh) @@ -975,7 +975,7 @@ static void pixblt_xy_xy(void) int rop = (IOREG(REG_CONTROL) >> 10) & 0x1f; int pbh = (IOREG(REG_CONTROL) >> 8) & 1; int ix = trans | (rop << 1) | (psize << 6); - if (!P_FLAG) LOGGFX(("%08X(%3d):PIXBLT XY,XY (%dx%d) depth=%d\n", PC, video_screen_get_vpos_scrnum(state.config->scrnum), DYDX_X, DYDX_Y, IOREG(REG_PSIZE) ? IOREG(REG_PSIZE) : 32)); + if (!P_FLAG) LOGGFX(("%08X(%3d):PIXBLT XY,XY (%dx%d) depth=%d\n", PC, video_screen_get_vpos(state.screen), DYDX_X, DYDX_Y, IOREG(REG_PSIZE) ? IOREG(REG_PSIZE) : 32)); pixel_op = pixel_op_table[rop]; pixel_op_timing = pixel_op_timing_table[rop]; if (!pbh) @@ -990,7 +990,7 @@ static void fill_l(void) int trans = (IOREG(REG_CONTROL) & 0x20) >> 5; int rop = (IOREG(REG_CONTROL) >> 10) & 0x1f; int ix = trans | (rop << 1) | (psize << 6); - if (!P_FLAG) LOGGFX(("%08X(%3d):FILL L (%dx%d) depth=%d\n", PC, video_screen_get_vpos_scrnum(state.config->scrnum), DYDX_X, DYDX_Y, IOREG(REG_PSIZE) ? IOREG(REG_PSIZE) : 32)); + if (!P_FLAG) LOGGFX(("%08X(%3d):FILL L (%dx%d) depth=%d\n", PC, video_screen_get_vpos(state.screen), DYDX_X, DYDX_Y, IOREG(REG_PSIZE) ? IOREG(REG_PSIZE) : 32)); pixel_op = pixel_op_table[rop]; pixel_op_timing = pixel_op_timing_table[rop]; (*fill_op_table[ix])(1); @@ -1002,7 +1002,7 @@ static void fill_xy(void) int trans = (IOREG(REG_CONTROL) & 0x20) >> 5; int rop = (IOREG(REG_CONTROL) >> 10) & 0x1f; int ix = trans | (rop << 1) | (psize << 6); - if (!P_FLAG) LOGGFX(("%08X(%3d):FILL XY (%d,%d) (%dx%d) depth=%d\n", PC, video_screen_get_vpos_scrnum(state.config->scrnum), DADDR_X, DADDR_Y, DYDX_X, DYDX_Y, IOREG(REG_PSIZE) ? IOREG(REG_PSIZE) : 32)); + if (!P_FLAG) LOGGFX(("%08X(%3d):FILL XY (%d,%d) (%dx%d) depth=%d\n", PC, video_screen_get_vpos(state.screen), DADDR_X, DADDR_Y, DYDX_X, DYDX_Y, IOREG(REG_PSIZE) ? IOREG(REG_PSIZE) : 32)); pixel_op = pixel_op_table[rop]; pixel_op_timing = pixel_op_timing_table[rop]; (*fill_op_table[ix])(0); diff --git a/src/emu/cpu/tms34010/34010ops.c b/src/emu/cpu/tms34010/34010ops.c index d7087fc96ec..29e4faa23f6 100644 --- a/src/emu/cpu/tms34010/34010ops.c +++ b/src/emu/cpu/tms34010/34010ops.c @@ -97,7 +97,7 @@ static void unimpl(void) /* extra check to prevent bad things */ if (PC == 0 || opcode_table[cpu_readop16(TOBYTE(PC)) >> 4] == unimpl) { - cpunum_set_input_line(Machine, cpu_getactivecpu(), INPUT_LINE_HALT, ASSERT_LINE); + cpunum_set_input_line(state.screen->machine, cpu_getactivecpu(), INPUT_LINE_HALT, ASSERT_LINE); DEBUGGER_BREAK; } } diff --git a/src/emu/cpu/tms34010/tms34010.c b/src/emu/cpu/tms34010/tms34010.c index 48bb334bb95..f772fdd955d 100644 --- a/src/emu/cpu/tms34010/tms34010.c +++ b/src/emu/cpu/tms34010/tms34010.c @@ -7,7 +7,6 @@ ***************************************************************************/ -#include <stddef.h> #include "debugger.h" #include "deprecat.h" #include "osd_cpu.h" @@ -62,6 +61,7 @@ typedef struct tms34010_regs UINT8 hblank_stable; int (*irq_callback)(int irqline); const tms34010_config *config; + const device_config *screen; emu_timer *scantimer; /* A registers 0-15 map to regs[0]-regs[15] */ @@ -89,10 +89,10 @@ typedef struct tms34010_regs static int tms34010_ICount; /* internal state */ -static tms34010_regs state; -static UINT8 external_host_access; -static UINT8 screen_to_cpu[MAX_SCREENS]; -static UINT8 executing_cpu = 0xff; +static tms34010_regs state; +static UINT8 external_host_access; +static const device_config *screen_to_cpu[MAX_CPU]; +static UINT8 executing_cpu = 0xff; /* default configuration */ static const tms34010_config default_config = @@ -638,10 +638,20 @@ static void tms34010_init(int index, int clock, const void *_config, int (*irqca state.config = config; state.irq_callback = irqcallback; + state.screen = device_list_find_by_tag(Machine->config->devicelist, VIDEO_SCREEN, config->screen_tag); /* if we have a scanline callback, make us the owner of this screen */ if (config->scanline_callback != NULL) - screen_to_cpu[config->scrnum] = index; + { + int i; + + for (i = 0; i < MAX_CPU; i++) + if (screen_to_cpu[i] == NULL) + break; + + assert(i != MAX_CPU); + screen_to_cpu[i] = state.screen; + } /* allocate a scanline timer and set it to go off at the start */ state.scantimer = timer_alloc(scanline_callback, NULL); @@ -667,19 +677,18 @@ static void tms34010_init(int index, int clock, const void *_config, int (*irqca static void tms34010_reset(void) { - const tms34010_config *config; - emu_timer *save_scantimer; - int (*save_irqcallback)(int); - UINT16 *shiftreg; - /* zap the state and copy in the config pointer */ - config = state.config; - shiftreg = state.shiftreg; - save_irqcallback = state.irq_callback; - save_scantimer = state.scantimer; + const tms34010_config *config = state.config; + const device_config *screen = state.screen; + UINT16 *shiftreg = state.shiftreg; + int (*save_irqcallback)(int) = state.irq_callback; + emu_timer *save_scantimer = state.scantimer; + memset(&state, 0, sizeof(state)); - state.shiftreg = shiftreg; + state.config = config; + state.screen = screen; + state.shiftreg = shiftreg; state.irq_callback = save_irqcallback; state.scantimer = save_scantimer; @@ -834,9 +843,8 @@ static int tms34010_execute(int cycles) check_interrupt(); do { - #ifdef ENABLE_DEBUGGER - if (Machine->debug_mode) { state.st = GET_ST(); mame_debug_hook(PC); } + if (state.screen->machine->debug_mode) { state.st = GET_ST(); mame_debug_hook(PC); } #endif state.op = ROPCODE(); (*opcode_table[state.op >> 4])(); @@ -931,7 +939,7 @@ static void set_raster_op(void) static TIMER_CALLBACK( scanline_callback ) { - const screen_state *screen; + const rectangle *current_visarea; int vsblnk, veblnk, vtotal; int vcount = param >> 8; int cpunum = param & 0xff; @@ -940,9 +948,9 @@ static TIMER_CALLBACK( scanline_callback ) /* set the CPU context */ cpuintrf_push_context(cpunum); - screen = &machine->screen[state.config->scrnum]; /* fetch the core timing parameters */ + current_visarea = video_screen_get_visible_area(state.screen); enabled = SMART_IOREG(DPYCTL) & 0x8000; master = (state.is_34020 || (SMART_IOREG(DPYCTL) & 0x2000)); vsblnk = SMART_IOREG(VSBLNK); @@ -950,8 +958,8 @@ static TIMER_CALLBACK( scanline_callback ) vtotal = SMART_IOREG(VTOTAL); if (!master) { - vtotal = MIN(screen->height - 1, vtotal); - vcount = video_screen_get_vpos_scrnum(state.config->scrnum); + vtotal = MIN(video_screen_get_height(state.screen) - 1, vtotal); + vcount = video_screen_get_vpos(state.screen); } /* update the VCOUNT */ @@ -1009,10 +1017,13 @@ static TIMER_CALLBACK( scanline_callback ) /* because many games play with the HEBLNK/HSBLNK for effects, we don't change if they are the only thing that has changed, unless they are stable for a couple of frames */ - if (width != screen->width || height != screen->height || visarea.min_y != screen->visarea.min_y || visarea.max_y != screen->visarea.max_y || - (state.hblank_stable > 2 && (visarea.min_x != screen->visarea.min_x || visarea.max_x != screen->visarea.max_x))) + int current_width = video_screen_get_width(state.screen); + int current_height = video_screen_get_height(state.screen); + + if (width != current_width || height != current_height || visarea.min_y != current_visarea->min_y || visarea.max_y != current_visarea->max_y || + (state.hblank_stable > 2 && (visarea.min_x != current_visarea->min_x || visarea.max_x != current_visarea->max_x))) { - video_screen_configure_scrnum(state.config->scrnum, width, height, &visarea, refresh); + video_screen_configure(state.screen, width, height, &visarea, refresh); } state.hblank_stable++; } @@ -1028,8 +1039,8 @@ static TIMER_CALLBACK( scanline_callback ) } /* force a partial update within the visible area */ - if (vcount >= screen->visarea.min_y && vcount <= screen->visarea.max_y && state.config->scanline_callback != NULL) - video_screen_update_partial_scrnum(state.config->scrnum, vcount); + if (vcount >= current_visarea->min_y && vcount <= current_visarea->max_y && state.config->scanline_callback != NULL) + video_screen_update_partial(state.screen, vcount); /* if we are in the visible area, increment DPYADR by DUDATE */ if (vcount >= veblnk && vcount < vsblnk) @@ -1065,7 +1076,7 @@ static TIMER_CALLBACK( scanline_callback ) /* note that we add !master (0 or 1) as a attoseconds value; this makes no practical difference */ /* but helps ensure that masters are updated first before slaves */ - timer_adjust_oneshot(state.scantimer, attotime_add_attoseconds(video_screen_get_time_until_pos_scrnum(state.config->scrnum, vcount, 0), !master), cpunum | (vcount << 8)); + timer_adjust_oneshot(state.scantimer, attotime_add_attoseconds(video_screen_get_time_until_pos(state.screen, vcount, 0), !master), cpunum | (vcount << 8)); /* restore the context */ cpuintrf_pop_context(); @@ -1112,17 +1123,25 @@ VIDEO_UPDATE( tms340x0 ) { pen_t blackpen = get_black_pen(screen->machine); tms34010_display_params params; + int cpunum = -1; int x; + /* find the owning CPU */ + for (cpunum = 0; cpunum < MAX_CPU; cpunum++) + if (screen_to_cpu[cpunum] == screen) + break; + + assert(cpunum >= 0); + /* get the display parameters for the screen */ - tms34010_get_display_params(screen_to_cpu[scrnum], ¶ms); + tms34010_get_display_params(cpunum, ¶ms); /* if the display is enabled, call the scanline callback */ if (params.enabled) { /* call through to the callback */ LOG((" Update: scan=%3d ROW=%04X COL=%04X\n", cliprect->min_y, params.rowaddr, params.coladdr)); - (*state.config->scanline_callback)(screen->machine, scrnum, bitmap, cliprect->min_y, ¶ms); + (*state.config->scanline_callback)(screen, bitmap, cliprect->min_y, ¶ms); } /* otherwise, just blank the current scanline */ @@ -1209,7 +1228,7 @@ WRITE16_HANDLER( tms34010_io_register_w ) /* if the CPU is halting itself, stop execution right away */ if ((data & 0x8000) && !external_host_access) tms34010_ICount = 0; - cpunum_set_input_line(Machine, cpunum, INPUT_LINE_HALT, (data & 0x8000) ? ASSERT_LINE : CLEAR_LINE); + cpunum_set_input_line(state.screen->machine, cpunum, INPUT_LINE_HALT, (data & 0x8000) ? ASSERT_LINE : CLEAR_LINE); /* NMI issued? */ if (data & 0x0100) @@ -1283,7 +1302,7 @@ WRITE16_HANDLER( tms34010_io_register_w ) } if (LOG_CONTROL_REGS) - logerror("CPU#%d@%08X: %s = %04X (%d)\n", cpunum, activecpu_get_pc(), ioreg_name[offset], IOREG(offset), video_screen_get_vpos_scrnum(state.config->scrnum)); + logerror("CPU#%d@%08X: %s = %04X (%d)\n", cpunum, activecpu_get_pc(), ioreg_name[offset], IOREG(offset), video_screen_get_vpos(state.screen)); } @@ -1320,7 +1339,7 @@ WRITE16_HANDLER( tms34020_io_register_w ) IOREG(offset) = data; if (LOG_CONTROL_REGS) - logerror("CPU#%d@%08X: %s = %04X (%d)\n", cpunum, activecpu_get_pc(), ioreg020_name[offset], IOREG(offset), video_screen_get_vpos_scrnum(state.config->scrnum)); + logerror("CPU#%d@%08X: %s = %04X (%d)\n", cpunum, activecpu_get_pc(), ioreg020_name[offset], IOREG(offset), video_screen_get_vpos(state.screen)); switch (offset) { @@ -1360,7 +1379,7 @@ WRITE16_HANDLER( tms34020_io_register_w ) /* if the CPU is halting itself, stop execution right away */ if ((data & 0x8000) && !external_host_access) tms34010_ICount = 0; - cpunum_set_input_line(Machine, cpunum, INPUT_LINE_HALT, (data & 0x8000) ? ASSERT_LINE : CLEAR_LINE); + cpunum_set_input_line(state.screen->machine, cpunum, INPUT_LINE_HALT, (data & 0x8000) ? ASSERT_LINE : CLEAR_LINE); /* NMI issued? */ if (data & 0x0100) @@ -1485,9 +1504,9 @@ READ16_HANDLER( tms34010_io_register_r ) { case REG_HCOUNT: /* scale the horizontal position from screen width to HTOTAL */ - result = video_screen_get_hpos_scrnum(state.config->scrnum); + result = video_screen_get_hpos(state.screen); total = IOREG(REG_HTOTAL) + 1; - result = result * total / Machine->screen[state.config->scrnum].width; + result = result * total / video_screen_get_width(state.screen); /* offset by the HBLANK end */ result += IOREG(REG_HEBLNK); @@ -1528,9 +1547,9 @@ READ16_HANDLER( tms34020_io_register_r ) { case REG020_HCOUNT: /* scale the horizontal position from screen width to HTOTAL */ - result = video_screen_get_hpos_scrnum(state.config->scrnum); + result = video_screen_get_hpos(state.screen); total = IOREG(REG020_HTOTAL) + 1; - result = result * total / Machine->screen[state.config->scrnum].width; + result = result * total / video_screen_get_width(state.screen); /* offset by the HBLANK end */ result += IOREG(REG020_HEBLNK); @@ -1653,8 +1672,8 @@ void tms34010_host_w(int cpunum, int reg, int data) /* control register */ case TMS34010_HOST_CONTROL: external_host_access = TRUE; - tms34010_io_register_w(Machine, REG_HSTCTLH, data & 0xff00, 0); - tms34010_io_register_w(Machine, REG_HSTCTLL, data & 0x00ff, 0); + tms34010_io_register_w(state.screen->machine, REG_HSTCTLH, data & 0xff00, 0); + tms34010_io_register_w(state.screen->machine, REG_HSTCTLL, data & 0x00ff, 0); external_host_access = FALSE; break; diff --git a/src/emu/cpu/tms34010/tms34010.h b/src/emu/cpu/tms34010/tms34010.h index 88e6ea31f7c..92c56503ddf 100644 --- a/src/emu/cpu/tms34010/tms34010.h +++ b/src/emu/cpu/tms34010/tms34010.h @@ -70,10 +70,10 @@ typedef struct _tms34010_config tms34010_config; struct _tms34010_config { UINT8 halt_on_reset; /* /HCS pin, which determines HALT state after reset */ - UINT8 scrnum; /* the screen operated on */ + const char *screen_tag; /* the screen operated on */ UINT32 pixclock; /* the pixel clock (0 means don't adjust screen size) */ int pixperclock; /* pixels per clock */ - void (*scanline_callback)(running_machine *machine, int screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); + void (*scanline_callback)(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); void (*output_int)(int state); /* output interrupt callback */ void (*to_shiftreg)(offs_t, UINT16 *); /* shift register write */ void (*from_shiftreg)(offs_t, UINT16 *); /* shift register read */ diff --git a/src/emu/video.c b/src/emu/video.c index 70a9e9d20a5..90f3f5b5576 100644 --- a/src/emu/video.c +++ b/src/emu/video.c @@ -1034,8 +1034,30 @@ int video_screen_get_hblank(const device_config *screen) /*------------------------------------------------- + video_screen_get_width - returns the width + of a given screen +-------------------------------------------------*/ +int video_screen_get_width(const device_config *screen) +{ + screen_state *state = get_safe_token(screen); + return state->width; +} + + +/*------------------------------------------------- + video_screen_get_height - returns the height + of a given screen +-------------------------------------------------*/ +int video_screen_get_height(const device_config *screen) +{ + screen_state *state = get_safe_token(screen); + return state->height; +} + + +/*------------------------------------------------- video_screen_get_visible_area - returns the - visible area a given screen + visible area of a given screen -------------------------------------------------*/ const rectangle *video_screen_get_visible_area(const device_config *screen) { diff --git a/src/emu/video.h b/src/emu/video.h index 27cd94270b3..c8232746c84 100644 --- a/src/emu/video.h +++ b/src/emu/video.h @@ -139,6 +139,12 @@ int video_screen_get_hpos_scrnum(int scrnum); int video_screen_get_vblank(const device_config *screen); int video_screen_get_hblank(const device_config *screen); +/* return the current width for a screen */ +int video_screen_get_width(const device_config *screen); + +/* return the current height for a screen */ +int video_screen_get_height(const device_config *screen); + /* return the current visible area for a screen */ const rectangle *video_screen_get_visible_area(const device_config *screen); diff --git a/src/mame/drivers/artmagic.c b/src/mame/drivers/artmagic.c index 6b1af9a97f3..33c711c05b2 100644 --- a/src/mame/drivers/artmagic.c +++ b/src/mame/drivers/artmagic.c @@ -459,7 +459,7 @@ ADDRESS_MAP_END static const tms34010_config tms_config = { TRUE, /* halt on reset */ - 0, /* the screen operated on */ + "main", /* the screen operated on */ MASTER_CLOCK_40MHz/6, /* pixel clock */ 1, /* pixels per clock */ artmagic_scanline, /* scanline update */ diff --git a/src/mame/drivers/btoads.c b/src/mame/drivers/btoads.c index 7accba44b72..e5151272f87 100644 --- a/src/mame/drivers/btoads.c +++ b/src/mame/drivers/btoads.c @@ -319,7 +319,7 @@ INPUT_PORTS_END static const tms34010_config tms_config = { FALSE, /* halt on reset */ - 0, /* the screen operated on */ + "main", /* the screen operated on */ VIDEO_CLOCK/2, /* pixel clock */ 1, /* pixels per clock */ btoads_scanline_update, /* scanline callback */ diff --git a/src/mame/drivers/coolpool.c b/src/mame/drivers/coolpool.c index 246ca9d26fc..9f872aa6a07 100644 --- a/src/mame/drivers/coolpool.c +++ b/src/mame/drivers/coolpool.c @@ -76,7 +76,7 @@ static TIMER_CALLBACK( nvram_write_timeout ); * *************************************/ -static void amerdart_scanline(running_machine *machine, int screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +static void amerdart_scanline(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { UINT16 *vram = &vram_base[(params->rowaddr << 8) & 0xff00]; UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0); @@ -103,7 +103,7 @@ static void amerdart_scanline(running_machine *machine, int screen, bitmap_t *bi } -static void coolpool_scanline(running_machine *machine, int screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +static void coolpool_scanline(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { UINT16 *vram = &vram_base[(params->rowaddr << 8) & 0x1ff00]; UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0); @@ -652,7 +652,7 @@ INPUT_PORTS_END static const tms34010_config tms_config_amerdart = { FALSE, /* halt on reset */ - 0, /* the screen operated on */ + "main", /* the screen operated on */ 40000000/12, /* pixel clock */ 2, /* pixels per clock */ amerdart_scanline, /* scanline callback */ @@ -665,7 +665,7 @@ static const tms34010_config tms_config_amerdart = static const tms34010_config tms_config_coolpool = { FALSE, /* halt on reset */ - 0, /* the screen operated on */ + "main", /* the screen operated on */ 40000000/6, /* pixel clock */ 1, /* pixels per clock */ coolpool_scanline, /* scanline callback */ diff --git a/src/mame/drivers/exterm.c b/src/mame/drivers/exterm.c index 1bfb5f8522f..ccb3dda7492 100644 --- a/src/mame/drivers/exterm.c +++ b/src/mame/drivers/exterm.c @@ -445,7 +445,7 @@ INPUT_PORTS_END static const tms34010_config master_config = { FALSE, /* halt on reset */ - 0, /* the screen operated on */ + "main", /* the screen operated on */ 40000000/8, /* pixel clock */ 1, /* pixels per clock */ exterm_scanline_update, /* scanline updater */ @@ -457,7 +457,7 @@ static const tms34010_config master_config = static const tms34010_config slave_config = { TRUE, /* halt on reset */ - 0, /* the screen operated on */ + "main", /* the screen operated on */ 40000000/8, /* pixel clock */ 1, /* pixels per clock */ NULL, /* scanline updater */ diff --git a/src/mame/drivers/harddriv.c b/src/mame/drivers/harddriv.c index f3ea0c0b469..7fda5a49085 100644 --- a/src/mame/drivers/harddriv.c +++ b/src/mame/drivers/harddriv.c @@ -193,7 +193,7 @@ void slapstic_init(int chip); static const tms34010_config gsp_config_driver = { TRUE, /* halt on reset */ - 0, /* the screen operated on */ + "main", /* the screen operated on */ 4000000, /* pixel clock */ 4, /* pixels per clock */ harddriv_scanline_driver, /* scanline callback */ @@ -207,7 +207,7 @@ static const tms34010_config gsp_config_driver = static const tms34010_config gsp_config_multisync = { TRUE, /* halt on reset */ - 0, /* the screen operated on */ + "main", /* the screen operated on */ 6000000, /* pixel clock */ 2, /* pixels per clock */ harddriv_scanline_multisync, /* scanline callback */ @@ -221,7 +221,7 @@ static const tms34010_config gsp_config_multisync = static const tms34010_config gsp_config_multisync_stunrun = { TRUE, /* halt on reset */ - 0, /* the screen operated on */ + "main", /* the screen operated on */ 5000000, /* pixel clock */ 2, /* pixels per clock */ harddriv_scanline_multisync, /* scanline callback */ @@ -234,7 +234,7 @@ static const tms34010_config gsp_config_multisync_stunrun = static const tms34010_config msp_config = { TRUE, /* halt on reset */ - 0, /* the screen operated on */ + "main", /* the screen operated on */ 5000000, /* pixel clock */ 2, /* pixels per clock */ NULL, /* scanline callback */ diff --git a/src/mame/drivers/jpmimpct.c b/src/mame/drivers/jpmimpct.c index 4cb322e2729..7a676e48f71 100644 --- a/src/mame/drivers/jpmimpct.c +++ b/src/mame/drivers/jpmimpct.c @@ -821,7 +821,7 @@ static void jpmimpct_tms_irq(int state) static const tms34010_config tms_config = { TRUE, /* halt on reset */ - 0, /* the screen operated on */ + "main", /* the screen operated on */ 40000000/16, /* pixel clock */ 4, /* pixels per clock */ jpmimpct_scanline_update, /* scanline updater */ diff --git a/src/mame/drivers/lethalj.c b/src/mame/drivers/lethalj.c index 86c63708857..6ee3f926445 100644 --- a/src/mame/drivers/lethalj.c +++ b/src/mame/drivers/lethalj.c @@ -488,7 +488,7 @@ INPUT_PORTS_END static const tms34010_config tms_config = { FALSE, /* halt on reset */ - 0, /* the screen operated on */ + "main", /* the screen operated on */ VIDEO_CLOCK, /* pixel clock */ 1, /* pixels per clock */ lethalj_scanline_update, /* scanline update */ @@ -500,7 +500,7 @@ static const tms34010_config tms_config = static const tms34010_config tms_config_lethalj = { FALSE, /* halt on reset */ - 0, /* the screen operated on */ + "main", /* the screen operated on */ VIDEO_CLOCK_LETHALJ, /* pixel clock */ 1, /* pixels per clock */ lethalj_scanline_update, /* scanline update */ diff --git a/src/mame/drivers/micro3d.c b/src/mame/drivers/micro3d.c index 53f1b0793a1..da1f3b168b4 100644 --- a/src/mame/drivers/micro3d.c +++ b/src/mame/drivers/micro3d.c @@ -137,7 +137,7 @@ static WRITE16_HANDLER( paletteram16_BBBBBRRRRRGGGGGG_word_w ) } -static void micro3d_scanline_update(running_machine *machine, int screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +static void micro3d_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { UINT16 *src = µ3d_sprite_vram[(params->rowaddr << 8) & 0x7fe00]; UINT16 *dest = BITMAP_ADDR16(bitmap, scanline, 0); @@ -848,7 +848,7 @@ static const struct upd7759_interface upd7759_interface = static const tms34010_config vgb_config = { FALSE, /* halt on reset ????? - check this */ - 0, /* the screen operated on */ + "main", /* the screen operated on */ 40000000/8, /* pixel clock */ 4, /* pixels per clock */ micro3d_scanline_update, /* scanline updater */ diff --git a/src/mame/drivers/midtunit.c b/src/mame/drivers/midtunit.c index 5870bdd9442..e28cb68ab0c 100644 --- a/src/mame/drivers/midtunit.c +++ b/src/mame/drivers/midtunit.c @@ -583,7 +583,7 @@ INPUT_PORTS_END static const tms34010_config tms_config = { FALSE, /* halt on reset */ - 0, /* the screen operated on */ + "main", /* the screen operated on */ PIXEL_CLOCK, /* pixel clock */ 2, /* pixels per clock */ midtunit_scanline_update, /* scanline updater */ diff --git a/src/mame/drivers/midwunit.c b/src/mame/drivers/midwunit.c index 1e50c03cba9..dfff6a483a5 100644 --- a/src/mame/drivers/midwunit.c +++ b/src/mame/drivers/midwunit.c @@ -614,7 +614,7 @@ INPUT_PORTS_END static const tms34010_config tms_config = { FALSE, /* halt on reset */ - 0, /* the screen operated on */ + "main", /* the screen operated on */ PIXEL_CLOCK, /* pixel clock */ 1, /* pixels per clock */ midtunit_scanline_update, /* scanline updater */ diff --git a/src/mame/drivers/midxunit.c b/src/mame/drivers/midxunit.c index 2c4b84f25cd..e2134345af6 100644 --- a/src/mame/drivers/midxunit.c +++ b/src/mame/drivers/midxunit.c @@ -172,7 +172,7 @@ INPUT_PORTS_END static const tms34010_config tms_config = { FALSE, /* halt on reset */ - 0, /* the screen operated on */ + "main", /* the screen operated on */ PIXEL_CLOCK, /* pixel clock */ 1, /* pixels per clock */ midxunit_scanline_update, /* scanline updater */ diff --git a/src/mame/drivers/midyunit.c b/src/mame/drivers/midyunit.c index 0fbb6e38148..50c03d6057a 100644 --- a/src/mame/drivers/midyunit.c +++ b/src/mame/drivers/midyunit.c @@ -977,7 +977,7 @@ INPUT_PORTS_END static const tms34010_config zunit_tms_config = { FALSE, /* halt on reset */ - 0, /* the screen operated on */ + "main", /* the screen operated on */ MEDRES_PIXEL_CLOCK, /* pixel clock */ 2, /* pixels per clock */ midyunit_scanline_update, /* scanline updater */ @@ -989,7 +989,7 @@ static const tms34010_config zunit_tms_config = static const tms34010_config yunit_tms_config = { FALSE, /* halt on reset */ - 0, /* the screen operated on */ + "main", /* the screen operated on */ STDRES_PIXEL_CLOCK, /* pixel clock */ 2, /* pixels per clock */ midyunit_scanline_update, /* scanline updater */ diff --git a/src/mame/drivers/tickee.c b/src/mame/drivers/tickee.c index d4a8d662147..153b5d94c2c 100644 --- a/src/mame/drivers/tickee.c +++ b/src/mame/drivers/tickee.c @@ -112,7 +112,7 @@ static VIDEO_START( tickee ) * *************************************/ -static void scanline_update(running_machine *machine, int screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +static void scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { UINT16 *src = &tickee_vram[(params->rowaddr << 8) & 0x3ff00]; UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0); @@ -395,7 +395,7 @@ static const struct AY8910interface ay8910_interface_2 = static const tms34010_config tms_config = { FALSE, /* halt on reset */ - 0, /* the screen operated on */ + "main", /* the screen operated on */ VIDEO_CLOCK/2, /* pixel clock */ 1, /* pixels per clock */ scanline_update, /* scanline callback */ diff --git a/src/mame/drivers/xtheball.c b/src/mame/drivers/xtheball.c index 2bc1862c626..10659d596ea 100644 --- a/src/mame/drivers/xtheball.c +++ b/src/mame/drivers/xtheball.c @@ -45,7 +45,7 @@ static MACHINE_RESET( xtheball ) * *************************************/ -static void xtheball_scanline_update(running_machine *machine, int screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +static void xtheball_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { UINT16 *srcbg = &vram_bg[(params->rowaddr << 8) & 0xff00]; UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0); @@ -337,7 +337,7 @@ INPUT_PORTS_END static const tms34010_config tms_config = { FALSE, /* halt on reset */ - 0, /* the screen operated on */ + "main", /* the screen operated on */ 5000000, /* pixel clock */ 2, /* pixels per clock */ xtheball_scanline_update, /* scanline callback */ diff --git a/src/mame/includes/artmagic.h b/src/mame/includes/artmagic.h index dd5362cc424..0cc872b3263 100644 --- a/src/mame/includes/artmagic.h +++ b/src/mame/includes/artmagic.h @@ -19,4 +19,4 @@ void artmagic_from_shiftreg(offs_t address, UINT16 *data); READ16_HANDLER( artmagic_blitter_r ); WRITE16_HANDLER( artmagic_blitter_w ); -void artmagic_scanline(running_machine *machine, int screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); +void artmagic_scanline(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); diff --git a/src/mame/includes/btoads.h b/src/mame/includes/btoads.h index 15882c7cc8b..3d04338086c 100644 --- a/src/mame/includes/btoads.h +++ b/src/mame/includes/btoads.h @@ -37,4 +37,4 @@ READ16_HANDLER( btoads_vram_fg_draw_r ); void btoads_to_shiftreg(UINT32 address, UINT16 *shiftreg); void btoads_from_shiftreg(UINT32 address, UINT16 *shiftreg); -void btoads_scanline_update(running_machine *machine, int screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); +void btoads_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); diff --git a/src/mame/includes/exterm.h b/src/mame/includes/exterm.h index 97b8689f630..ab29fd209a9 100644 --- a/src/mame/includes/exterm.h +++ b/src/mame/includes/exterm.h @@ -10,7 +10,7 @@ extern UINT16 *exterm_master_videoram; extern UINT16 *exterm_slave_videoram; PALETTE_INIT( exterm ); -void exterm_scanline_update(running_machine *machine, int screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); +void exterm_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); void exterm_to_shiftreg_master(UINT32 address, UINT16* shiftreg); void exterm_from_shiftreg_master(UINT32 address, UINT16* shiftreg); diff --git a/src/mame/includes/harddriv.h b/src/mame/includes/harddriv.h index f164ddd6f3d..2d97686e1a6 100644 --- a/src/mame/includes/harddriv.h +++ b/src/mame/includes/harddriv.h @@ -241,5 +241,5 @@ WRITE16_HANDLER( hdgsp_paletteram_lo_w ); READ16_HANDLER( hdgsp_paletteram_hi_r ); WRITE16_HANDLER( hdgsp_paletteram_hi_w ); -void harddriv_scanline_driver(running_machine *machine, int screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); -void harddriv_scanline_multisync(running_machine *machine, int screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); +void harddriv_scanline_driver(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); +void harddriv_scanline_multisync(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); diff --git a/src/mame/includes/jpmimpct.h b/src/mame/includes/jpmimpct.h index 5c8b3549d84..598a5be5fa6 100644 --- a/src/mame/includes/jpmimpct.h +++ b/src/mame/includes/jpmimpct.h @@ -13,6 +13,6 @@ WRITE16_HANDLER( bt477_w ); void jpmimpct_to_shiftreg(UINT32 address, UINT16 *shiftreg); void jpmimpct_from_shiftreg(UINT32 address, UINT16 *shiftreg); -void jpmimpct_scanline_update(running_machine *machine, int screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); +void jpmimpct_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); VIDEO_START( jpmimpct ); diff --git a/src/mame/includes/lethalj.h b/src/mame/includes/lethalj.h index 35778fd8111..7d25c9a86ca 100644 --- a/src/mame/includes/lethalj.h +++ b/src/mame/includes/lethalj.h @@ -12,4 +12,4 @@ VIDEO_START( lethalj ); WRITE16_HANDLER( lethalj_blitter_w ); -void lethalj_scanline_update(running_machine *machine, int screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); +void lethalj_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); diff --git a/src/mame/includes/midtunit.h b/src/mame/includes/midtunit.h index a218422a8e6..dc3f92801ce 100644 --- a/src/mame/includes/midtunit.h +++ b/src/mame/includes/midtunit.h @@ -60,5 +60,5 @@ READ16_HANDLER( midxunit_paletteram_r ); READ16_HANDLER( midtunit_dma_r ); WRITE16_HANDLER( midtunit_dma_w ); -void midtunit_scanline_update(running_machine *machine, int screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); -void midxunit_scanline_update(running_machine *machine, int screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); +void midtunit_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); +void midxunit_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); diff --git a/src/mame/includes/midyunit.h b/src/mame/includes/midyunit.h index e5738dc6ad4..720c8031e58 100644 --- a/src/mame/includes/midyunit.h +++ b/src/mame/includes/midyunit.h @@ -61,4 +61,4 @@ WRITE16_HANDLER( midyunit_paletteram_w ); READ16_HANDLER( midyunit_dma_r ); WRITE16_HANDLER( midyunit_dma_w ); -void midyunit_scanline_update(running_machine *machine, int screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); +void midyunit_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); diff --git a/src/mame/video/artmagic.c b/src/mame/video/artmagic.c index 2302d080cc7..eb845f48ca9 100644 --- a/src/mame/video/artmagic.c +++ b/src/mame/video/artmagic.c @@ -346,7 +346,7 @@ WRITE16_HANDLER( artmagic_blitter_w ) * *************************************/ -void artmagic_scanline(running_machine *machine, int screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +void artmagic_scanline(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { offs_t offset = (params->rowaddr << 12) & 0x7ff000; UINT16 *vram = address_to_vram(&offset); diff --git a/src/mame/video/btoads.c b/src/mame/video/btoads.c index 9bfbf10b7b3..41df2b3bb90 100644 --- a/src/mame/video/btoads.c +++ b/src/mame/video/btoads.c @@ -342,7 +342,7 @@ void btoads_from_shiftreg(UINT32 address, UINT16 *shiftreg) * *************************************/ -void btoads_scanline_update(running_machine *machine, int screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +void btoads_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { UINT32 fulladdr = ((params->rowaddr << 16) | params->coladdr) >> 4; UINT16 *bg0_base = &btoads_vram_bg0[(fulladdr + (yscroll0 << 10)) & 0x3fc00]; diff --git a/src/mame/video/exterm.c b/src/mame/video/exterm.c index 3a4a5d4c24f..1f937d1a0b5 100644 --- a/src/mame/video/exterm.c +++ b/src/mame/video/exterm.c @@ -67,7 +67,7 @@ void exterm_from_shiftreg_slave(UINT32 address, UINT16 *shiftreg) * *************************************/ -void exterm_scanline_update(running_machine *machine, int screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +void exterm_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { UINT16 *bgsrc = &exterm_master_videoram[(params->rowaddr << 8) & 0xff00]; UINT16 *fgsrc = NULL; diff --git a/src/mame/video/harddriv.c b/src/mame/video/harddriv.c index fac8d1fb39d..aded862a76f 100644 --- a/src/mame/video/harddriv.c +++ b/src/mame/video/harddriv.c @@ -454,7 +454,7 @@ static void display_speedups(void) } -void harddriv_scanline_driver(running_machine *machine, int screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +void harddriv_scanline_driver(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { UINT8 *vram_base = &hdgsp_vram[(params->rowaddr << 12) & vram_mask]; UINT16 *dest = BITMAP_ADDR16(bitmap, scanline, 0); @@ -464,12 +464,12 @@ void harddriv_scanline_driver(running_machine *machine, int screen, bitmap_t *bi for (x = params->heblnk; x < params->hsblnk; x++) dest[x] = gfx_palettebank * 256 + vram_base[BYTE_XOR_LE(coladdr++ & 0xfff)]; - if (scanline == machine->screen[screen].visarea.max_y) + if (scanline == video_screen_get_visible_area(screen)->max_y) display_speedups(); } -void harddriv_scanline_multisync(running_machine *machine, int screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +void harddriv_scanline_multisync(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { UINT8 *vram_base = &hdgsp_vram[(params->rowaddr << 11) & vram_mask]; UINT16 *dest = BITMAP_ADDR16(bitmap, scanline, 0); @@ -479,6 +479,6 @@ void harddriv_scanline_multisync(running_machine *machine, int screen, bitmap_t for (x = params->heblnk; x < params->hsblnk; x++) dest[x] = gfx_palettebank * 256 + vram_base[BYTE_XOR_LE(coladdr++ & 0x7ff)]; - if (scanline == machine->screen[screen].visarea.max_y) + if (scanline == video_screen_get_visible_area(screen)->max_y) display_speedups(); } diff --git a/src/mame/video/jpmimpct.c b/src/mame/video/jpmimpct.c index 7cfb2562ca3..4b6fdd09a6b 100644 --- a/src/mame/video/jpmimpct.c +++ b/src/mame/video/jpmimpct.c @@ -116,7 +116,7 @@ void jpmimpct_from_shiftreg(UINT32 address, UINT16 *shiftreg) * *************************************/ -void jpmimpct_scanline_update(running_machine *machine, int screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +void jpmimpct_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { UINT16 *vram = &tms_vram[(params->rowaddr << 8) & 0x3ff00]; UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0); @@ -126,8 +126,8 @@ void jpmimpct_scanline_update(running_machine *machine, int screen, bitmap_t *bi for (x = params->heblnk; x < params->hsblnk; x += 2) { UINT16 pixels = vram[coladdr++ & 0xff]; - dest[x + 0] = machine->pens[pixels & 0xff]; - dest[x + 1] = machine->pens[pixels >> 8]; + dest[x + 0] = screen->machine->pens[pixels & 0xff]; + dest[x + 1] = screen->machine->pens[pixels >> 8]; } } diff --git a/src/mame/video/lethalj.c b/src/mame/video/lethalj.c index 8db1d76d3a2..7629b3f1c74 100644 --- a/src/mame/video/lethalj.c +++ b/src/mame/video/lethalj.c @@ -179,7 +179,7 @@ WRITE16_HANDLER( lethalj_blitter_w ) * *************************************/ -void lethalj_scanline_update(running_machine *machine, int screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +void lethalj_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { UINT16 *src = &screenram[(vispage << 17) | ((params->rowaddr << 9) & 0x3fe00)]; UINT16 *dest = BITMAP_ADDR16(bitmap, scanline, 0); @@ -191,7 +191,7 @@ void lethalj_scanline_update(running_machine *machine, int screen, bitmap_t *bit { for (x = params->heblnk; x < params->hsblnk; x++) dest[x] = 0x7fff; - if (scanline == machine->screen[0].visarea.max_y) + if (scanline == video_screen_get_visible_area(screen)->max_y) blank_palette = 0; return; } diff --git a/src/mame/video/midtunit.c b/src/mame/video/midtunit.c index 2f185d76e67..38868cc671b 100644 --- a/src/mame/video/midtunit.c +++ b/src/mame/video/midtunit.c @@ -808,7 +808,7 @@ skipdma: * *************************************/ -void midtunit_scanline_update(running_machine *machine, int screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +void midtunit_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { UINT16 *src = &local_videoram[(params->rowaddr << 9) & 0x3fe00]; UINT16 *dest = BITMAP_ADDR16(bitmap, scanline, 0); @@ -820,7 +820,7 @@ void midtunit_scanline_update(running_machine *machine, int screen, bitmap_t *bi dest[x] = src[coladdr++ & 0x1ff] & 0x7fff; } -void midxunit_scanline_update(running_machine *machine, int screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +void midxunit_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { UINT32 fulladdr = ((params->rowaddr << 16) | params->coladdr) >> 3; UINT16 *src = &local_videoram[fulladdr & 0x3fe00]; diff --git a/src/mame/video/midyunit.c b/src/mame/video/midyunit.c index d29a8b92a56..171d7f3a71d 100644 --- a/src/mame/video/midyunit.c +++ b/src/mame/video/midyunit.c @@ -565,7 +565,7 @@ static TIMER_CALLBACK( autoerase_line ) } -void midyunit_scanline_update(running_machine *machine, int screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +void midyunit_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { UINT16 *src = &local_videoram[(params->rowaddr << 9) & 0x3fe00]; UINT16 *dest = BITMAP_ADDR16(bitmap, scanline, 0); @@ -577,10 +577,10 @@ void midyunit_scanline_update(running_machine *machine, int screen, bitmap_t *bi dest[x] = pen_map[src[coladdr++ & 0x1ff]]; /* handle autoerase on the previous line */ - autoerase_line(machine, NULL, params->rowaddr - 1); + autoerase_line(screen->machine, NULL, params->rowaddr - 1); /* if this is the last update of the screen, set a timer to clear out the final line */ /* (since we update one behind) */ - if (scanline == machine->screen[0].visarea.max_y) - timer_set(video_screen_get_time_until_pos(machine->primary_screen, scanline + 1, 0), NULL, params->rowaddr, autoerase_line); + if (scanline == video_screen_get_visible_area(screen)->max_y) + timer_set(video_screen_get_time_until_pos(screen, scanline + 1, 0), NULL, params->rowaddr, autoerase_line); } |