static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) { int offs; /* Draw the sprites. */ for (offs = spriteram_size - 4;offs >= 0;offs -= 4) { int attr = buffered_spriteram[offs+1]; int sx = buffered_spriteram[offs + 3] - ((attr & 0x10) << 4); int sy = buffered_spriteram[offs + 2]; int code = buffered_spriteram[offs] | ((attr & 0xe0) << 3); int color = attr & 0x07; int flipx = attr & 0x08; if (flip_screen_get(machine)) { sx = 240 - sx; sy = 240 - sy; flipx = !flipx; } drawgfx_transpen(bitmap,cliprect,machine->gfx[2], code, color, flipx,flip_screen_get(machine), sx,sy,15); } }
static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect ) { // blktiger_state *state = machine.driver_data<blktiger_state>(); UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8; int offs; /* Draw the sprites. */ for (offs = machine.generic.spriteram_size - 4;offs >= 0;offs -= 4) { int attr = buffered_spriteram[offs+1]; int sx = buffered_spriteram[offs + 3] - ((attr & 0x10) << 4); int sy = buffered_spriteram[offs + 2]; int code = buffered_spriteram[offs] | ((attr & 0xe0) << 3); int color = attr & 0x07; int flipx = attr & 0x08; if (flip_screen_get(machine)) { sx = 240 - sx; sy = 240 - sy; flipx = !flipx; } drawgfx_transpen(bitmap,cliprect,machine.gfx[2], code, color, flipx,flip_screen_get(machine), sx,sy,15); } }
static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect ) { citycon_state *state = machine.driver_data<citycon_state>(); int offs; for (offs = state->m_spriteram_size - 4; offs >= 0; offs -= 4) { int sx, sy, flipx; sx = state->m_spriteram[offs + 3]; sy = 239 - state->m_spriteram[offs]; flipx = ~state->m_spriteram[offs + 2] & 0x10; if (flip_screen_get(machine)) { sx = 240 - sx; sy = 238 - sy; flipx = !flipx; } drawgfx_transpen(bitmap, cliprect, machine.gfx[state->m_spriteram[offs + 1] & 0x80 ? 2 : 1], state->m_spriteram[offs + 1] & 0x7f, state->m_spriteram[offs + 2] & 0x0f, flipx,flip_screen_get(machine), sx, sy, 0); } }
static void draw_background(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int skew) { zaxxon_state *state = machine.driver_data<zaxxon_state>(); /* only draw if enabled */ if (state->m_bg_enable) { bitmap_ind16 &pixmap = state->m_bg_tilemap->pixmap(); int colorbase = state->m_bg_color + (state->m_congo_color_bank << 8); int xmask = pixmap.width() - 1; int ymask = pixmap.height() - 1; int flipmask = flip_screen_get(machine) ? 0xff : 0x00; int flipoffs = flip_screen_get(machine) ? 0x38 : 0x40; int x, y; /* the starting X value is offset by 1 pixel (normal) or 7 pixels */ /* (flipped) due to a delay in the loading */ if (!flip_screen_get(machine)) flipoffs -= 1; else flipoffs += 7; /* loop over visible rows */ for (y = cliprect.min_y; y <= cliprect.max_y; y++) { UINT16 *dst = &bitmap.pix16(y); int srcx, srcy, vf; UINT16 *src; /* VF = flipped V signals */ vf = y ^ flipmask; /* base of the source row comes from VF plus the scroll value */ /* this is done by the 3 4-bit adders at U56, U74, U75 */ srcy = vf + ((state->m_bg_position << 1) ^ 0xfff) + 1; src = &pixmap.pix16(srcy & ymask); /* loop over visible columns */ for (x = cliprect.min_x; x <= cliprect.max_x; x++) { /* start with HF = flipped H signals */ srcx = x ^ flipmask; if (skew) { /* position within source row is a two-stage addition */ /* first stage is HF plus half the VF, done by the 2 4-bit */ /* adders at U53, U54 */ srcx += ((vf >> 1) ^ 0xff) + 1; /* second stage is first stage plus a constant based on the flip */ /* value is 0x40 for non-flipped, or 0x38 for flipped */ srcx += flipoffs; } /* store the pixel, offset by the color offset */ dst[x] = src[srcx & xmask] + colorbase; } } }
static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect ) { olibochu_state *state = machine.driver_data<olibochu_state>(); UINT8 *spriteram = state->m_spriteram; UINT8 *spriteram_2 = state->m_spriteram2; int offs; /* 16x16 sprites */ for (offs = 0; offs < state->m_spriteram_size; offs += 4) { int attr = spriteram[offs + 1]; int code = spriteram[offs]; int color = attr & 0x3f; int flipx = attr & 0x40; int flipy = attr & 0x80; int sx = spriteram[offs + 3]; int sy = ((spriteram[offs + 2] + 8) & 0xff) - 8; if (flip_screen_get(machine)) { sx = 240 - sx; sy = 240 - sy; flipx = !flipx; flipy = !flipy; } drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, color, flipx, flipy, sx, sy, 0); } /* 8x8 sprites */ for (offs = 0; offs < state->m_spriteram2_size; offs += 4) { int attr = spriteram_2[offs + 1]; int code = spriteram_2[offs]; int color = attr & 0x3f; int flipx = attr & 0x40; int flipy = attr & 0x80; int sx = spriteram_2[offs + 3]; int sy = spriteram_2[offs + 2]; if (flip_screen_get(machine)) { sx = 248 - sx; sy = 248 - sy; flipx = !flipx; flipy = !flipy; } drawgfx_transpen(bitmap, cliprect, machine.gfx[0], code, color, flipx, flipy, sx, sy, 0); } }
static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority, int pri_mask) { acommand_state *state = machine.driver_data<acommand_state>(); UINT16 *spriteram16 = state->m_spriteram; int offs; for (offs = 0;offs < state->m_spriteram_size/2;offs += 8) { if (!(spriteram16[offs+0] & 0x1000)) { int sx = (spriteram16[offs+3] & 0x0ff); int code = spriteram16[offs+6]; int color = spriteram16[offs+7]; int w = (spriteram16[offs+0] & 0x0f); int h = ((spriteram16[offs+0] & 0xf0) >> 4); int sy = (spriteram16[offs+4] & 0x0ff) - ((h+1)*0x10); /**/ int pri = spriteram16[offs+5]; /**/ int flipy = ((spriteram16[offs+1] & 0x0200) >> 9); /**/ int flipx = ((spriteram16[offs+1] & 0x0100) >> 8); int xx,yy,x; int delta = 16; flipx ^= flip_screen_get(machine); flipy ^= flip_screen_get(machine); if ((pri&pri_mask)!=priority) continue; if (flip_screen_get(machine)) { sx = 368 - sx; sy = 240 - sy; delta = -16; } yy = h; do { x = sx; xx = w; do { drawgfx_transpen(bitmap,cliprect,machine.gfx[2], code, color, flipx, flipy, ((x + 16) & 0x1ff) - 16,sy & 0x1ff,15); code++; x += delta; } while (--xx >= 0); sy += delta; } while (--yy >= 0); } }
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) { spdodgeb_state *state = machine.driver_data<spdodgeb_state>(); UINT8 *spriteram = state->m_spriteram; const gfx_element *gfx = machine.gfx[1]; UINT8 *src; int i; src = spriteram; /* 240-SY Z|F|CLR|WCH WHICH SX xxxxxxxx x|x|xxx|xxx xxxxxxxx xxxxxxxx */ for (i = 0;i < state->m_spriteram_size;i += 4) { int attr = src[i+1]; int which = src[i+2]+((attr & 0x07)<<8); int sx = src[i+3]; int sy = 240 - src[i]; int size = (attr & 0x80) >> 7; int color = (attr & 0x38) >> 3; int flipx = ~attr & 0x40; int flipy = 0; int dy = -16; int cy; if (flip_screen_get(machine)) { sx = 240 - sx; sy = 240 - sy; flipx = !flipx; flipy = !flipy; dy = -dy; } if (sx < -8) sx += 256; else if (sx > 248) sx -= 256; switch (size) { case 0: /* normal */ if (sy < -8) sy += 256; else if (sy > 248) sy -= 256; DRAW_SPRITE(0,sx,sy); break; case 1: /* double y */ if (flip_screen_get(machine)) { if (sy > 240) sy -= 256; } else { if (sy < 0) sy += 256; } cy = sy + dy; which &= ~1; DRAW_SPRITE(0,sx,cy); DRAW_SPRITE(1,sx,sy); break; } } }
static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect) { renegade_state *state = machine.driver_data<renegade_state>(); UINT8 *source = state->m_spriteram; UINT8 *finish = source + 96 * 4; while (source < finish) { int sy = 240 - source[0]; if (sy >= 16) { int attributes = source[1]; /* SFCCBBBB */ int sx = source[3]; int sprite_number = source[2]; int sprite_bank = 9 + (attributes & 0xf); int color = (attributes >> 4) & 0x3; int xflip = attributes & 0x40; if (sx > 248) sx -= 256; if (flip_screen_get(machine)) { sx = 240 - sx; sy = 240 - sy; xflip = !xflip; } if (attributes & 0x80) /* big sprite */ { sprite_number &= ~1; drawgfx_transpen(bitmap, cliprect, machine.gfx[sprite_bank], sprite_number + 1, color, xflip, flip_screen_get(machine), sx, sy + (flip_screen_get(machine) ? -16 : 16), 0); } else { sy += (flip_screen_get(machine) ? -16 : 16); } drawgfx_transpen(bitmap, cliprect, machine.gfx[sprite_bank], sprite_number, color, xflip, flip_screen_get(machine), sx, sy, 0); } source += 4; }
static void nmk16_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority) { nmk16_state *state = machine.driver_data<nmk16_state>(); int offs; for (offs = 0; offs < 0x1000/2; offs += 8) { if ((state->m_spriteram_old2[offs] & 0x0001)) { int sx = (state->m_spriteram_old2[offs+4] & 0x1ff) + state->m_videoshift; int sy = (state->m_spriteram_old2[offs+6] & 0x1ff); int code = state->m_spriteram_old2[offs+3]; int color = state->m_spriteram_old2[offs+7]; int w = (state->m_spriteram_old2[offs+1] & 0x0f); int h = ((state->m_spriteram_old2[offs+1] & 0xf0) >> 4); int pri = (state->m_spriteram_old2[offs] & 0xc0) >> 6; int xx,yy,x; int delta = 16; if(pri != priority) continue; if (flip_screen_get(machine)) { sx = 368 - sx; sy = 240 - sy; delta = -16; } yy = h; do { x = sx; xx = w; do { drawgfx_transpen(bitmap,cliprect,machine.gfx[2], code, color, flip_screen_get(machine), flip_screen_get(machine), ((x + 16) & 0x1ff) - 16,sy & 0x1ff,15); code++; x += delta; } while (--xx >= 0); sy += delta; } while (--yy >= 0); } }
static void draw_columns( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) { funkybee_state *state = (funkybee_state *)machine->driver_data; int offs; for (offs = 0x1f; offs >= 0; offs--) { int const flip = flip_screen_get(machine); int code = state->videoram[0x1c00 + offs]; int color = state->colorram[0x1f10] & 0x03; int sx = flip ? state->videoram[0x1f1f] : state->videoram[0x1f10]; int sy = offs * 8; if (flip) sy = 248 - sy; drawgfx_transpen(bitmap,cliprect,machine->gfx[state->gfx_bank], code, color, flip, flip, sx, sy,0); code = state->videoram[0x1d00 + offs]; color = state->colorram[0x1f11] & 0x03; sx = flip ? state->videoram[0x1f1e] : state->videoram[0x1f11]; sy = offs * 8; if (flip) sy = 248 - sy; drawgfx_transpen(bitmap,cliprect,machine->gfx[state->gfx_bank], code, color, flip, flip, sx, sy,0); } }
static WRITE8_HANDLER( pacland_flipscreen_w ) { int bit = !BIT(offset,11); /* can't use flip_screen_set(space->machine, ) because the visible area is asymmetrical */ flip_screen_set_no_update(space->machine, bit); tilemap_set_flip_all(space->machine,flip_screen_get(space->machine) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); }
static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) { espial_state *state = (espial_state *)machine->driver_data; int offs; for (offs = state->spriteram_size - 4; offs >= 0; offs -= 4) { int flipx, flipy, sx, sy, spritecode; sx = 240 - state->spriteram[offs + 3]; sy = 240 - state->spriteram[offs]; flipx = !(state->spriteram[offs + 1] & 0x40); flipy = state->spriteram[offs + 1] & 0x80; spritecode = state->spriteram[offs + 1] & 0x3f; if (flip_screen_get(machine) && state->percuss_hardware) { sy = 240 - sy; flipy = !flipy; } drawgfx_transpen(bitmap,cliprect,machine->gfx[1], spritecode, state->spriteram[offs + 2] & 0x07, flipx, flipy, sx, sy, 0); } }
static void draw_bullets( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) { espial_state *state = (espial_state *)machine->driver_data; int offs; for (offs = 0; offs < state->bulletsram_size; offs += 4) { int x, y; x = state->bulletsram[offs + 3] + 7; y = 255 - state->bulletsram[offs + 1]; if (flip_screen_get(machine) && state->percuss_hardware) { y = 255 - y; } drawgfx_transpen( bitmap, cliprect,machine->gfx[2], 0, /* this is just a dot, generated by the hardware */ 0, 0,0, x,y,0); } }
static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) { UINT8 *buffered_spriteram = machine->generic.buffered_spriteram.u8; const gfx_element *gfx = machine->gfx[2]; int offs; for (offs = machine->generic.spriteram_size - 4; offs >= 0; offs -= 4) { UINT8 attributes = buffered_spriteram[offs + 1]; int sx = buffered_spriteram[offs + 3] - 0x100 * (attributes & 0x01); int sy = buffered_spriteram[offs + 2]; int flipx = attributes & 0x04; int flipy = attributes & 0x08; if (flip_screen_get(machine)) { sx = 240 - sx; sy = 240 - sy; flipx = !flipx; flipy = !flipy; } drawgfx_transpen(bitmap,cliprect,gfx, buffered_spriteram[offs] + ((attributes << 2) & 0x300), (attributes >> 4) & 3, flipx,flipy, sx,sy,15); } }
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) { UINT8 *spriteram = machine->generic.spriteram.u8; int offs; for (offs = machine->generic.spriteram_size - 4; offs >= 0; offs -= 4) { int code = spriteram[offs] + 16 * (spriteram[offs + 1] & 0x10); int color = (spriteram[offs + 1] & 0x0e) >> 1; int flipx = spriteram[offs + 1] & 0x40; int flipy = spriteram[offs + 1] & 0x80; int sx = spriteram[offs + 3]; int sy = 241 - spriteram[offs + 2]; if (flip_screen_get(machine)) { sx = 240 - sx; sy = 242 - sy; flipx = !flipx; flipy = !flipy; } drawgfx_transpen(bitmap, cliprect, machine->gfx[2], code, color, flipx, flipy, sx, sy, 0); } }
void zodiack_state::draw_sprites( bitmap_t *bitmap, const rectangle *cliprect ) { for (int offs = m_spriteram_size - 4; offs >= 0; offs -= 4) { int flipx, flipy, sx, sy, spritecode; sx = 240 - m_spriteram[offs + 3]; sy = 240 - m_spriteram[offs]; flipx = !(m_spriteram[offs + 1] & 0x40); flipy = m_spriteram[offs + 1] & 0x80; spritecode = m_spriteram[offs + 1] & 0x3f; if (flip_screen_get(machine()) && m_percuss_hardware) { sy = 240 - sy; flipy = !flipy; } drawgfx_transpen(bitmap,cliprect,machine().gfx[1], spritecode, m_spriteram[offs + 2] & 0x07, flipx, flipy, sx, sy, 0); } }
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) { UINT8 *spriteram = machine.generic.spriteram.u8; UINT8 *spriteram_2 = machine.generic.spriteram2.u8; int offs; for (offs = 0;offs < machine.generic.spriteram_size;offs += 2) { int sx = spriteram[offs + 1] - 1; int sy = 240 - spriteram_2[offs]; int flipx = spriteram[offs] & 1; int flipy = spriteram[offs] & 2; int color = spriteram_2[offs + 1] & 0x3f; if (flip_screen_get(machine)) { sx += 128-2; sy += 8; } drawgfx_transmask(bitmap,cliprect,machine.gfx[1], (spriteram[offs] & 0xfc) >> 2, color, flipx,flipy, sx,sy, colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, 0x0f)); } }
static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect ) { yiear_state *state = machine.driver_data<yiear_state>(); UINT8 *spriteram = state->m_spriteram; UINT8 *spriteram_2 = state->m_spriteram2; int offs; for (offs = state->m_spriteram_size - 2; offs >= 0; offs -= 2) { int attr = spriteram[offs]; int code = spriteram_2[offs + 1] + 256 * (attr & 0x01); int color = 0; int flipx = ~attr & 0x40; int flipy = attr & 0x80; int sy = 240 - spriteram[offs + 1]; int sx = spriteram_2[offs]; if (flip_screen_get(machine)) { sy = 240 - sy; flipy = !flipy; } if (offs < 0x26) { sy++; /* fix title screen & garbage at the bottom of the screen */ } drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, color, flipx, flipy, sx, sy, 0); } }
static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect ) { dacholer_state *state = machine.driver_data<dacholer_state>(); int offs, code, attr, sx, sy, flipx, flipy; for (offs = 0; offs < state->m_spriteram_size; offs += 4) { code = state->m_spriteram[offs + 1]; attr = state->m_spriteram[offs + 2]; flipx = attr & 0x10; flipy = attr & 0x20; sx = (state->m_spriteram[offs + 3] - 128) + 256 * (attr & 0x01); sy = 248 - state->m_spriteram[offs]; if (flip_screen_get(machine)) { sx = 240 - sx; sy = 240 - sy; flipx = !flipx; flipy = !flipy; } drawgfx_transpen(bitmap, cliprect, machine.gfx[2], code, 0, flipx,flipy, sx,sy,0); } }
static void kchampvs_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect ) { kchamp_state *state = machine.driver_data<kchamp_state>(); UINT8 *spriteram = state->m_spriteram; int offs; for (offs = 0; offs < 0x100; offs += 4) { int attr = spriteram[offs + 2]; int bank = 1 + ((attr & 0x60) >> 5); int code = spriteram[offs + 1] + ((attr & 0x10) << 4); int color = attr & 0x0f; int flipx = 0; int flipy = attr & 0x80; int sx = spriteram[offs + 3]; int sy = 240 - spriteram[offs]; if (flip_screen_get(machine)) { sx = 240 - sx; sy = 240 - sy; flipx = !flipx; flipy = !flipy; } drawgfx_transpen(bitmap, cliprect, machine.gfx[bank], code, color, flipx, flipy, sx, sy, 0); } }
static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect ) { sbasketb_state *state = machine.driver_data<sbasketb_state>(); UINT8 *spriteram = state->m_spriteram; int offs = (*state->m_spriteram_select & 0x01) * 0x100; int i; for (i = 0; i < 64; i++, offs += 4) { int sx = spriteram[offs + 2]; int sy = spriteram[offs + 3]; if (sx || sy) { int code = spriteram[offs + 0] | ((spriteram[offs + 1] & 0x20) << 3); int color = (spriteram[offs + 1] & 0x0f) + 16 * *state->m_palettebank; int flipx = spriteram[offs + 1] & 0x40; int flipy = spriteram[offs + 1] & 0x80; if (flip_screen_get(machine)) { sx = 240 - sx; sy = 240 - sy; flipx = !flipx; flipy = !flipy; } drawgfx_transpen(bitmap,cliprect, machine.gfx[1], code, color, flipx, flipy, sx, sy, 0); } } }
static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) { funkybee_state *state = (funkybee_state *)machine->driver_data; int offs; for (offs = 0x0f; offs >= 0; offs--) { int offs2 = offs + 0x1e00; int attr = state->videoram[offs2]; int code = (attr >> 2) | ((attr & 2) << 5); int color = state->colorram[offs2 + 0x10]; int flipx = 0; int flipy = attr & 0x01; int sx = state->videoram[offs2 + 0x10]; int sy = 224 - state->colorram[offs2]; if (flip_screen_get(machine)) { sy += 32; flipx = !flipx; } drawgfx_transpen(bitmap,cliprect, machine->gfx[2 + state->gfx_bank], code, color, flipx, flipy, sx, sy, 0); } }
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) { int offs; for (offs = 0; offs < spriteram_size; offs += 4) { if (spriteram[offs] & 0x01) { int code = spriteram[offs + 1] + ((spriteram[offs] & 0xf0) << 4); int color = (spriteram[offs] & 0x08) >> 3; int flipx = spriteram[offs] & 0x04; int flipy = spriteram[offs] & 0x02; int sx = 239 - spriteram[offs + 3]; int sy = (240 - spriteram[offs + 2]) & 0xff; if (flip_screen_get()) { sx = 240 - sx; sy = 240 - sy; flipx = !flipx; flipy = !flipy; } drawgfx(bitmap, machine->gfx[2], code, color, flipx, flipy, sx, sy, cliprect, TRANSPARENCY_PEN, 0); } }
static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect ) { solomon_state *state = machine.driver_data<solomon_state>(); UINT8 *spriteram = state->m_spriteram; int offs; for (offs = state->m_spriteram_size - 4; offs >= 0; offs -= 4) { int code = spriteram[offs] + 16 * (spriteram[offs + 1] & 0x10); int color = (spriteram[offs + 1] & 0x0e) >> 1; int flipx = spriteram[offs + 1] & 0x40; int flipy = spriteram[offs + 1] & 0x80; int sx = spriteram[offs + 3]; int sy = 241 - spriteram[offs + 2]; if (flip_screen_get(machine)) { sx = 240 - sx; sy = 242 - sy; flipx = !flipx; flipy = !flipy; } drawgfx_transpen(bitmap, cliprect, machine.gfx[2], code, color, flipx, flipy, sx, sy, 0); } }
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) { UINT8 *spriteram = machine->generic.spriteram.u8; int offs; for (offs = 0; offs < machine->generic.spriteram_size; offs += 4) { if (spriteram[offs] & 0x01) { int code = spriteram[offs + 1] + ((spriteram[offs] & 0xf0) << 4); int color = (spriteram[offs] & 0x08) >> 3; int flipx = spriteram[offs] & 0x04; int flipy = spriteram[offs] & 0x02; int sx = 239 - spriteram[offs + 3]; int sy = (240 - spriteram[offs + 2]) & 0xff; if (flip_screen_get(machine)) { sx = 240 - sx; sy = 240 - sy; flipx = !flipx; flipy = !flipy; } drawgfx_transpen(bitmap, cliprect, machine->gfx[2], code, color, flipx, flipy, sx, sy, 0); } }
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect) { clshroad_state *state = machine.driver_data<clshroad_state>(); UINT8 *spriteram = state->m_spriteram; int i; for (i = 0; i < state->m_spriteram_size ; i += 8) { int y = 240 - spriteram[i+1]; int code = (spriteram[i+3] & 0x3f) + (spriteram[i+2] << 6); int x = spriteram[i+5] + (spriteram[i+6] << 8); int attr = spriteram[i+7]; int flipx = 0; int flipy = 0; x -= 0x4a/2; if (flip_screen_get(machine)) { y = 240 - y; flipx = !flipx; flipy = !flipy; } drawgfx_transpen(bitmap,cliprect,machine.gfx[0], code, attr & 0x0f, flipx,flipy, x,y,15 ); } }
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) { int x,y,code,color,offset,flipx,flipy; /* Drawing sprites: 64 in total */ for (offset = 0;offset < spriteram_size;offset += 4) { if(!(spriteram[offset + 2] & 0x80)) continue; x = 243 - spriteram[offset + 3]; y = 239 - spriteram[offset + 0]; code = BITSWAP8(spriteram[offset + 1],0,1,2,3,4,5,6,7) | ((spriteram[offset + 2] & 0x40) << 2); color = spriteram[offset + 2] & 0x0f; flipx = flipy = 0; if(flip_screen_get(machine)) { x = 246 - x; y = 238 - y; flipx = flipy = 1; } drawgfx_transpen (bitmap,cliprect,machine->gfx[2], code, color, flipx,flipy, x,y,0); } }
static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) { gunsmoke_state *state = machine->driver_data<gunsmoke_state>(); UINT8 *spriteram = state->spriteram; int offs; for (offs = state->spriteram_size - 32; offs >= 0; offs -= 32) { int attr = spriteram[offs + 1]; int bank = (attr & 0xc0) >> 6; int code = spriteram[offs]; int color = attr & 0x0f; int flipx = 0; int flipy = attr & 0x10; int sx = spriteram[offs + 3] - ((attr & 0x20) << 3); int sy = spriteram[offs + 2]; if (bank == 3) bank += state->sprite3bank; code += 256 * bank; if (flip_screen_get(machine)) { sx = 240 - sx; sy = 240 - sy; flipx = !flipx; flipy = !flipy; } drawgfx_transpen(bitmap, cliprect, machine->gfx[2], code, color, flipx, flipy, sx, sy, 0); } }
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect ) { dogfgt_state *state = machine.driver_data<dogfgt_state>(); int offs; for (offs = 0; offs < state->m_spriteram_size; offs += 4) { if (state->m_spriteram[offs] & 0x01) { int sx, sy, flipx, flipy; sx = state->m_spriteram[offs + 3]; sy = (240 - state->m_spriteram[offs + 2]) & 0xff; flipx = state->m_spriteram[offs] & 0x04; flipy = state->m_spriteram[offs] & 0x02; if (flip_screen_get(machine)) { sx = 240 - sx; sy = 240 - sy; flipx = !flipx; flipy = !flipy; } drawgfx_transpen(bitmap,cliprect,machine.gfx[1], state->m_spriteram[offs + 1] + ((state->m_spriteram[offs] & 0x30) << 4), (state->m_spriteram[offs] & 0x08) >> 3, flipx,flipy, sx,sy,0); } }
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect) { pcktgal_state *state = machine.driver_data<pcktgal_state>(); UINT8 *spriteram = state->m_spriteram; int offs; for (offs = 0;offs < state->m_spriteram_size;offs += 4) { if (spriteram[offs] != 0xf8) { int sx,sy,flipx,flipy; sx = 240 - spriteram[offs+2]; sy = 240 - spriteram[offs]; flipx = spriteram[offs+1] & 0x04; flipy = spriteram[offs+1] & 0x02; if (flip_screen_get(machine)) { sx=240-sx; sy=240-sy; if (flipx) flipx=0; else flipx=1; if (flipy) flipy=0; else flipy=1; } drawgfx_transpen(bitmap,cliprect,machine.gfx[1], spriteram[offs+3] + ((spriteram[offs+1] & 1) << 8), (spriteram[offs+1] & 0x70) >> 4, flipx,flipy, sx,sy,0); } }