static void mo_render_callback(const UINT16 *data, const struct rectangle *clip, void *param) { const struct GfxElement *gfx = Machine->gfx[1]; struct osd_bitmap *bitmap = (struct osd_bitmap *)param; struct rectangle pf_clip; /* extract data from the various words */ int code = data[1] & 0x0fff; int xpos = data[2] >> 7; int ypos = 512 - (data[3] >> 7); int color = data[2] & 0x000f; int hsize = ((data[3] >> 4) & 7) + 1; int hflip = data[3] & 0x0008; int vsize = (data[3] & 7) + 1; /* adjust for height */ ypos -= vsize * 8; /* adjust the final coordinates */ xpos &= 0x1ff; ypos &= 0x1ff; if (xpos >= XDIM) xpos -= 0x200; if (ypos >= YDIM) ypos -= 0x200; /* determine the bounding box */ atarigen_mo_compute_clip_8x8(pf_clip, xpos, ypos, hsize, vsize, clip); /* draw the motion object */ atarigen_mo_draw_8x8(bitmap, gfx, code, color, hflip, 0, xpos, ypos, hsize, vsize, clip, TRANSPARENCY_PEN, 0); /* overrender the playfield */ atarigen_pf_process(pf_overrender_callback, bitmap, &pf_clip); }
void offtwall_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh) { /* remap if necessary */ if (update_palette()) memset(atarigen_pf_dirty, 0xff, atarigen_playfieldram_size / 4); /* update playfield */ atarigen_pf_process(pf_render_callback, bitmap, &Machine->visible_area); /* render the motion objects */ atarigen_mo_process(mo_render_callback, bitmap); /* update onscreen messages */ atarigen_update_messages(); }
static const UINT8 *update_palette(void) { UINT16 mo_map[16], pf_map[48]; int i, j; /* reset color tracking */ memset(mo_map, 0, sizeof(mo_map)); memset(pf_map, 0, sizeof(pf_map)); palette_init_used_colors(); /* update color usage for the playfields */ atarigen_pf_process(pf_color_callback, pf_map, &Machine->drv->visible_area); atarigen_pf2_process(pf2_color_callback, pf_map, &Machine->drv->visible_area); /* update color usage for the mo's */ atarigen_mo_process(mo_color_callback, mo_map); /* rebuild the playfield palettes */ for (i = 0; i < 48; i++) { UINT16 used = pf_map[i]; if (used) { if (i < 16) palette_used_colors[0x000 + i * 16 + 0] = PALETTE_COLOR_TRANSPARENT; else if (used & 0x0001) palette_used_colors[0x000 + i * 16 + 0] = PALETTE_COLOR_USED; for (j = 1; j < 16; j++) if (used & (1 << j)) palette_used_colors[0x000 + i * 16 + j] = PALETTE_COLOR_USED; } } /* rebuild the motion object palette */ for (i = 0; i < 16; i++) { UINT16 used = mo_map[i]; if (used) { palette_used_colors[0x100 + i * 16 + 0] = PALETTE_COLOR_TRANSPARENT; for (j = 1; j < 16; j++) if (used & (1 << j)) palette_used_colors[0x100 + i * 16 + j] = PALETTE_COLOR_USED; } } return palette_recalc(); }
void relief_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh) { int i; #if DEBUG_VIDEO debug(); #endif /* update the palette */ if (update_palette()) { memset(atarigen_pf_dirty, 1, atarigen_playfieldram_size / 2); memset(atarigen_pf2_dirty, 1, atarigen_playfield2ram_size / 2); } /* set up the all-transparent overrender palette */ for (i = 0; i < 16; i++) atarigen_overrender_colortable[i] = palette_transparent_pen; /* render the playfield */ memset(atarigen_pf_visit, 0, 64*64); #if DEBUG_VIDEO if (show_colors == 2) osd_clearbitmap(bitmap); else #endif atarigen_pf_process(pf_render_callback, bitmap, &Machine->drv->visible_area); /* render the playfield */ memset(atarigen_pf2_visit, 0, 64*64); #if DEBUG_VIDEO if (show_colors != 1) #endif atarigen_pf2_process(pf2_render_callback, bitmap, &Machine->drv->visible_area); /* render the motion objects */ atarigen_mo_process(mo_render_callback, bitmap); /* update onscreen messages */ atarigen_update_messages(); }
void badlands_vh_screenrefresh(struct osd_bitmap *bitmap, int full_refresh) { int i; /* remap if necessary */ if (palette_recalc()) memset(atarigen_pf_dirty, 0xff, atarigen_playfieldram_size / 2); /* set up the all-transparent overrender palette */ for (i = 0; i < 16; i++) atarigen_overrender_colortable[i] = palette_transparent_pen; /* draw the playfield */ atarigen_pf_process(pf_render_callback, bitmap, &Machine->drv->visible_area); /* render the motion objects */ atarigen_mo_process(mo_render_callback, bitmap); /* update onscreen messages */ atarigen_update_messages(); }
void xybots_vh_screenrefresh(struct osd_bitmap *bitmap, int full_refresh) { int i; /* update the palette */ if (update_palette()) memset(atarigen_pf_dirty, 1, atarigen_playfieldram_size / 2); /* set up the all-transparent overrender palette */ for (i = 0; i < 16; i++) atarigen_overrender_colortable[i] = palette_transparent_pen; /* render the playfield */ atarigen_pf_process(pf_render_callback, bitmap, &Machine->visible_area); /* render the motion objects */ atarigen_mo_process(mo_render_callback, bitmap); /* redraw the alpha layer completely */ { const struct GfxElement *gfx = Machine->gfx[2]; int sx, sy, offs; for (sy = 0; sy < YCHARS; sy++) for (sx = 0, offs = sy * 64; sx < XCHARS; sx++, offs++) { int data = READ_WORD(&atarigen_alpharam[offs * 2]); int code = data & 0x3ff; int opaque = data & 0x8000; if (code || opaque) { int color = (data >> 12) & 7; drawgfx(bitmap, gfx, code, color, 0, 0, 8 * sx, 8 * sy, 0, opaque ? TRANSPARENCY_NONE : TRANSPARENCY_PEN, 0); } } }