static VIDEO_UPDATE( laserbat ) { laserbat_state *state = (laserbat_state *)screen->machine->driver_data; int y; bitmap_t *s2636_1_bitmap; bitmap_t *s2636_2_bitmap; bitmap_t *s2636_3_bitmap; tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0); /* update the S2636 chips */ s2636_1_bitmap = s2636_update(state->s2636_1, cliprect); s2636_2_bitmap = s2636_update(state->s2636_2, cliprect); s2636_3_bitmap = s2636_update(state->s2636_3, cliprect); /* copy the S2636 images into the main bitmap */ for (y = cliprect->min_y; y <= cliprect->max_y; y++) { int x; for (x = cliprect->min_x; x <= cliprect->max_x; x++) { int pixel1 = *BITMAP_ADDR16(s2636_1_bitmap, y, x); int pixel2 = *BITMAP_ADDR16(s2636_2_bitmap, y, x); int pixel3 = *BITMAP_ADDR16(s2636_3_bitmap, y, x); if (S2636_IS_PIXEL_DRAWN(pixel1)) *BITMAP_ADDR16(bitmap, y, x) = S2636_PIXEL_COLOR(pixel1); if (S2636_IS_PIXEL_DRAWN(pixel2)) *BITMAP_ADDR16(bitmap, y, x) = S2636_PIXEL_COLOR(pixel2); if (S2636_IS_PIXEL_DRAWN(pixel3)) *BITMAP_ADDR16(bitmap, y, x) = S2636_PIXEL_COLOR(pixel3); } } if (state->sprite_enable) drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1], state->sprite_code, state->sprite_color, 0,0, state->sprite_x - 6,state->sprite_y,0); return 0; }
/* VIDEO GOODS */ static void gpworld_draw_tiles(running_machine &machine, bitmap_rgb32 &bitmap,const rectangle &cliprect) { gpworld_state *state = machine.driver_data<gpworld_state>(); UINT8 characterX, characterY; /* Temporarily set to 64 wide to accommodate two screens */ for (characterX = 0; characterX < 64; characterX++) { for (characterY = 0; characterY < 32; characterY++) { int current_screen_character = (characterY*64) + characterX; drawgfx_transpen(bitmap, cliprect, machine.gfx[0], state->m_tile_ram[current_screen_character], characterY, 0, 0, characterX*8, characterY*8, 0); } } }
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect) { starshp1_state *state = machine.driver_data<starshp1_state>(); int i; for (i = 0; i < 14; i++) { int code = (state->m_obj_ram[i] & 0xf) ^ 0xf; drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code % 8, code / 8, 0, 0, get_sprite_hpos(state, i), get_sprite_vpos(state, i), 0); } }
static void funystrp_draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect) { int i; const gfx_element *gfx = machine->gfx[1]; for (i = 0; i < 0x400; i += 4){ int sx = splash_spriteram[i+2] & 0x1ff; int sy = (240 - (splash_spriteram[i+1] & 0xff)) & 0xff; int attr = splash_spriteram[i+3] & 0xff; int attr2 = splash_spriteram[i+0x400] >> splash_sprite_attr2_shift; int number = (splash_spriteram[i] & 0xff) + (attr & 0xf)*256; drawgfx_transpen(bitmap,cliprect,gfx,number, (attr2 & 0x7f),attr & 0x40,attr & 0x80, sx-8,sy,0); } }
UINT32 sbrkout_state::screen_update_sbrkout(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { UINT8 *videoram = m_videoram; int ball; m_bg_tilemap->draw(bitmap, cliprect, 0, 0); for (ball = 2; ball >= 0; ball--) { int code = ((videoram[0x380 + 0x18 + ball * 2 + 1] & 0x80) >> 7); int sx = 31 * 8 - videoram[0x380 + 0x10 + ball * 2]; int sy = 30 * 8 - videoram[0x380 + 0x18 + ball * 2]; drawgfx_transpen(bitmap, cliprect, machine().gfx[1], code, 0, 0, 0, sx, sy, 0); } return 0; }
UINT32 trvmadns_state::screen_update_trvmadns(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y,count; gfx_element *gfx = machine().gfx[0]; bitmap.fill(0xd, cliprect); count = 0; for (y=0;y<32;y++) { for (x=0;x<32;x++) { int attr = m_tileram[count*2+0]; int tile = m_tileram[count*2+1] | ((attr & 0x01) << 8); int color = (attr & 0x18) >> 3; int flipx = attr & 4; int flipy = attr & 2; if(!(attr & 0x20)) drawgfx_opaque(bitmap,cliprect,gfx,tile,color,flipx,flipy,(x*8),(y*8)); count++; } } count = 0; for (y=0;y<32;y++) { for (x=0;x<32;x++) { int attr = m_tileram[count*2+0]; int tile = m_tileram[count*2+1] | ((attr & 0x01) << 8); int color = (attr & 0x18) >> 3; int flipx = attr & 4; int flipy = attr & 2; if(attr & 0x20) drawgfx_transpen(bitmap,cliprect,gfx,tile,color,flipx,flipy,(x*8),(y*8),1); count++; } } return 0; }
static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect) { travrusa_state *state = machine.driver_data<travrusa_state>(); int offs; static const rectangle spritevisiblearea = { 1*8, 31*8-1, 0*8, 24*8-1 }; static const rectangle spritevisibleareaflip = { 1*8, 31*8-1, 8*8, 32*8-1 }; rectangle clip = *cliprect; if (flip_screen_get(machine)) sect_rect(&clip, &spritevisibleareaflip); else sect_rect(&clip, &spritevisiblearea); for (offs = state->m_spriteram_size - 4; offs >= 0; offs -= 4) { int sx = ((state->m_spriteram[offs + 3] + 8) & 0xff) - 8; int sy = 240 - state->m_spriteram[offs]; int code = state->m_spriteram[offs + 2]; int attr = state->m_spriteram[offs + 1]; int flipx = attr & 0x40; int flipy = attr & 0x80; if (flip_screen_get(machine)) { sx = 240 - sx; sy = 240 - sy; flipx = !flipx; flipy = !flipy; } drawgfx_transpen(bitmap, &clip, machine.gfx[1], code, attr & 0x0f, flipx, flipy, sx, sy, 0); } }
void drgnmst_state::draw_sprites( bitmap_ind16 &bitmap,const rectangle &cliprect ) { gfx_element *gfx = machine().gfx[0]; UINT16 *source = m_spriteram; UINT16 *finish = source + 0x800 / 2; while (source < finish) { int xpos, ypos, number, flipx, flipy, wide, high; int x, y; int incx, incy; int colr; number = source[2]; xpos = source[0]; ypos = source[1]; flipx = source[3] & 0x0020; flipy = source[3] & 0x0040; wide = (source[3] & 0x0f00) >> 8; high = (source[3] & 0xf000) >> 12; colr = (source[3] & 0x001f); if ((source[3] & 0xff00) == 0xff00) break; if (!flipx) { incx = 16;} else { incx = -16; xpos += 16 * wide; } if (!flipy) { incy = 16;} else { incy = -16; ypos += 16 * high; } for (y = 0; y <= high; y++) { for (x = 0; x <= wide; x++) { int realx, realy, realnumber; realx = xpos + incx * x; realy = ypos + incy * y; realnumber = number + x + y * 16; drawgfx_transpen(bitmap, cliprect, gfx, realnumber, colr, flipx, flipy, realx, realy, 15); } } source += 4; } }
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect) { UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8; int offs; /* Draw the sprites. */ for (offs = machine.generic.spriteram_size-4; offs>=0;offs -= 4) { /* SPRITES ===== Attribute 0x80 Code MSB 0x40 Code MSB 0x20 Code MSB 0x10 Colour 0x08 Colour 0x04 Colour 0x02 y Flip 0x01 X MSB */ int code,colour,sx,sy,flipy; int attr = buffered_spriteram[offs+1]; code = buffered_spriteram[offs]; code += ( (attr&0xe0) << 3 ); colour = (attr & 0x1c)>>2; sy = buffered_spriteram[offs + 2]; sx = buffered_spriteram[offs + 3] + 0x100 * ( attr & 0x01); flipy = attr & 0x02; if (flip_screen_get(machine)) { sx = 496 - sx; sy = 240 - sy; flipy = !flipy; } drawgfx_transpen(bitmap,cliprect,machine.gfx[2], code, colour, flip_screen_get(machine),flipy, sx, sy,15); } }
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &clip) { meadows_state *state = machine.driver_data<meadows_state>(); UINT8 *spriteram = state->m_spriteram; int i; for (i = 0; i < 4; i++) { int x = spriteram[i+0] + SPR_ADJUST_X; int y = spriteram[i+4] + SPR_ADJUST_Y; int code = spriteram[i+8] & 0x0f; /* bit #0 .. #3 select sprite */ /* int bank = (spriteram[i+8] >> 4) & 1; bit #4 selects prom ??? */ int bank = i; /* that fixes it for now :-/ */ int flip = spriteram[i+8] >> 5; /* bit #5 flip vertical flag */ drawgfx_transpen(bitmap, clip, machine.gfx[bank + 1], code, 0, flip, 0, x, y, 0); } }
static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) { drtomy_state *state = machine->driver_data<drtomy_state>(); int i, x, y, ex, ey; const gfx_element *gfx = machine->gfx[0]; static const int x_offset[2] = {0x0, 0x2}; static const int y_offset[2] = {0x0, 0x1}; for (i = 3; i < 0x1000 / 2; i += 4) { int sx = state->spriteram[i + 2] & 0x01ff; int sy = (240 - (state->spriteram[i] & 0x00ff)) & 0x00ff; int number = state->spriteram[i + 3]; int color = (state->spriteram[i + 2] & 0x1e00) >> 9; int attr = (state->spriteram[i] & 0xfe00) >> 9; int xflip = attr & 0x20; int yflip = attr & 0x40; int spr_size; if (attr & 0x04) spr_size = 1; else { spr_size = 2; number &= (~3); } for (y = 0; y < spr_size; y++) { for (x = 0; x < spr_size; x++) { ex = xflip ? (spr_size - 1 - x) : x; ey = yflip ? (spr_size - 1 - y) : y; drawgfx_transpen(bitmap,cliprect,gfx,number + x_offset[ex] + y_offset[ey], color,xflip,yflip, sx-0x09+x*8,sy+y*8,0); } } } }
static void draw_sprites( running_machine* machine, bitmap_t *bitmap, const rectangle *cliprect ) { ddragon3_state *state = (ddragon3_state *)machine->driver_data; UINT16 *source = state->spriteram; UINT16 *finish = source + 0x800; while (source < finish) { UINT16 attr = source[1]; if (attr & 0x01) /* enable */ { int i; int bank = source[3] & 0xff; int code = (source[2] & 0xff) + (bank * 256); int color = source[4] & 0xf; int flipx = attr & 0x10; int flipy = attr & 0x08; int sx = source[5] & 0xff; int sy = source[0] & 0xff; int height = (attr >> 5) & 0x07; if (attr & 0x04) sx |= 0x100; if (attr & 0x02) sy = 239 + (0x100 - sy); else sy = 240 - sy; if (sx > 0x17f) sx = 0 - (0x200 - sx); if (flip_screen_get(machine)) { sx = 304 - sx; sy = 224 - sy; flipx = !flipx; flipy = !flipy; } for (i = 0; i <= height; i++) { drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code + i, color, flipx, flipy, sx, sy + (flip_screen_get(machine) ? (i * 16) : (-i * 16)), 0); } } source += 8; }
static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri) { thoop2_state *state = machine.driver_data<thoop2_state>(); int j, x, y, ex, ey; const gfx_element *gfx = machine.gfx[0]; static const int x_offset[2] = {0x0,0x2}; static const int y_offset[2] = {0x0,0x1}; for (j = 0; j < state->m_sprite_count[pri]; j++) { int i = state->m_sprite_table[pri][j]; int sx = state->m_spriteram[i+2] & 0x01ff; int sy = (240 - (state->m_spriteram[i] & 0x00ff)) & 0x00ff; int number = state->m_spriteram[i+3]; int color = (state->m_spriteram[i+2] & 0x7e00) >> 9; int attr = (state->m_spriteram[i] & 0xfe00) >> 9; int xflip = attr & 0x20; int yflip = attr & 0x40; int spr_size; number |= ((number & 0x03) << 16); if (attr & 0x04) { spr_size = 1; } else { spr_size = 2; number &= (~3); } for (y = 0; y < spr_size; y++) { for (x = 0; x < spr_size; x++) { ex = xflip ? (spr_size-1-x) : x; ey = yflip ? (spr_size-1-y) : y; drawgfx_transpen(bitmap,cliprect,gfx,number + x_offset[ex] + y_offset[ey], color,xflip,yflip, sx-0x0f+x*8,sy+y*8,0); } } } }
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) { bsktball_state *state = machine.driver_data<bsktball_state>(); int mot; for (mot = 0; mot < 16; mot++) { int pic = state->m_motion[mot * 4]; int sy = 28 * 8 - state->m_motion[mot * 4 + 1]; int sx = state->m_motion[mot * 4 + 2]; int color = state->m_motion[mot * 4 + 3]; int flipx = (pic & 0x80) >> 7; pic = (pic & 0x3f); color = (color & 0x3f); drawgfx_transpen(bitmap, cliprect, machine.gfx[1], pic, color, flipx, 0, sx, sy, 0); } }
static SCREEN_UPDATE(pturn) { pturn_state *state = screen->machine().driver_data<pturn_state>(); UINT8 *spriteram = state->m_spriteram; int offs; int sx, sy; int flipx, flipy; bitmap_fill(bitmap, cliprect, state->m_bgcolor); tilemap_draw(bitmap,cliprect,state->m_bgmap,0,0); for ( offs = 0x80-4 ; offs >=0 ; offs -= 4) { sy=256-spriteram[offs]-16 ; sx=spriteram[offs+3]-16 ; flipx=spriteram[offs+1]&0x40; flipy=spriteram[offs+1]&0x80; if (flip_screen_x_get(screen->machine())) { sx = 224 - sx; flipx ^= 0x40; } if (flip_screen_y_get(screen->machine())) { flipy ^= 0x80; sy = 224 - sy; } if(sx|sy) { drawgfx_transpen(bitmap, cliprect,screen->machine().gfx[2], spriteram[offs+1] & 0x3f , (spriteram[offs+2] & 0x1f), flipx, flipy, sx,sy,0); } } tilemap_draw(bitmap,cliprect,state->m_fgmap,0,0); return 0; }
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) { funybubl_state *state = machine.driver_data<funybubl_state>(); UINT8 *source = &state->m_banked_vram[0x2000 - 0x20]; UINT8 *finish = source - 0x1000; while (source > finish) { int xpos, ypos, tile; /* the sprites are in the sprite list twice the first format (in comments) appears to be a buffer, if you use this list you get garbage sprites in 2 player mode the second format (used) seems correct */ /* ypos = 0xff - source[1 + 0x10]; xpos = source[2 + 0x10]; tile = source[0 + 0x10] | ( (source[3 + 0x10] & 0x0f) <<8); if (source[3 + 0x10] & 0x80) tile += 0x1000; if (source[3 + 0x10] & 0x20) xpos += 0x100; // bits 0x40 (not used?) and 0x10 (just set during transition period of x co-ord 0xff and 0x00) ... xpos -= 8; ypos -= 14; */ ypos = source[2]; xpos = source[3]; tile = source[0] | ( (source[1] & 0x0f) << 8); if (source[1] & 0x80) tile += 0x1000; if (source[1] & 0x20) { if (xpos < 0xe0) xpos += 0x100; } // bits 0x40 and 0x10 not used?... drawgfx_transpen(bitmap, cliprect, machine.gfx[1], tile, 0, 0, 0, xpos, ypos, 255); source -= 0x20; } }
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority ) { tigeroad_state *state = machine.driver_data<tigeroad_state>(); UINT16 *source = &state->m_spriteram->buffer()[state->m_spriteram->bytes()/2] - 4; UINT16 *finish = state->m_spriteram->buffer(); // TODO: The Track Map should probably be drawn on top of the background tilemap... // Also convert the below into a for loop! while (source >= finish) { int tile_number = source[0]; if (tile_number != 0xfff) { int attr = source[1]; int sy = source[2] & 0x1ff; int sx = source[3] & 0x1ff; int flipx = attr & 0x02; int flipy = attr & 0x01; int color = (attr >> 2) & 0x0f; if (sx > 0x100) sx -= 0x200; if (sy > 0x100) sy -= 0x200; if (state->flip_screen()) { sx = 240 - sx; sy = 240 - sy; flipx = !flipx; flipy = !flipy; } drawgfx_transpen(bitmap, cliprect, machine.gfx[2], tile_number, color, flipx, flipy, sx, 240 - sy, 15); } source -= 4; }
inline void nmk16_state::nmk16_draw_sprite(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority, UINT16 *spr) { if ((spr[0] & 0x0001)) { int sx = (spr[4] & 0x1FF) + m_videoshift; int sy = spr[6] & 0x1FF; int code = spr[3]; int color = spr[7]; int w = spr[1] & 0x00F; int h = (spr[1] & 0x0F0) >> 4; int pri = (spr[0] & 0x0C0) >> 6; int xx,yy,x; int delta = 16; if(pri != priority) return; if (flip_screen()) { 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(), flip_screen(), ((x + 16) & 0x1FF) - 16,sy & 0x1FF,15); code++; x += delta; } while (--xx >= 0); sy += delta; } while (--yy >= 0); }
static SCREEN_UPDATE_IND16( laserbat ) { laserbat_state *state = screen.machine().driver_data<laserbat_state>(); int y; state->m_bg_tilemap->draw(bitmap, cliprect, 0, 0); /* update the S2636 chips */ bitmap_ind16 &s2636_1_bitmap = s2636_update(state->m_s2636_1, cliprect); bitmap_ind16 &s2636_2_bitmap = s2636_update(state->m_s2636_2, cliprect); bitmap_ind16 &s2636_3_bitmap = s2636_update(state->m_s2636_3, cliprect); /* copy the S2636 images into the main bitmap */ for (y = cliprect.min_y; y <= cliprect.max_y; y++) { int x; for (x = cliprect.min_x; x <= cliprect.max_x; x++) { int pixel1 = s2636_1_bitmap.pix16(y, x); int pixel2 = s2636_2_bitmap.pix16(y, x); int pixel3 = s2636_3_bitmap.pix16(y, x); if (S2636_IS_PIXEL_DRAWN(pixel1)) bitmap.pix16(y, x) = S2636_PIXEL_COLOR(pixel1); if (S2636_IS_PIXEL_DRAWN(pixel2)) bitmap.pix16(y, x) = S2636_PIXEL_COLOR(pixel2); if (S2636_IS_PIXEL_DRAWN(pixel3)) bitmap.pix16(y, x) = S2636_PIXEL_COLOR(pixel3); } } if (state->m_sprite_enable) drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1], state->m_sprite_code, state->m_sprite_color, 0,0, state->m_sprite_x - 6,state->m_sprite_y,0); return 0; }
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority ) { UINT16 *source = &buffered_spriteram16[spriteram_size/2] - 4; UINT16 *finish = buffered_spriteram16; // TODO: The Track Map should probably be drawn on top of the background tilemap... // Also convert the below into a for loop! while (source >= finish) { int tile_number = source[0]; if (tile_number != 0xfff) { int attr = source[1]; int sy = source[2] & 0x1ff; int sx = source[3] & 0x1ff; int flipx = attr & 0x02; int flipy = attr & 0x01; int color = (attr >> 2) & 0x0f; if (sx > 0x100) sx -= 0x200; if (sy > 0x100) sy -= 0x200; if (flip_screen_get(machine)) { sx = 240 - sx; sy = 240 - sy; flipx = !flipx; flipy = !flipy; } drawgfx_transpen(bitmap, cliprect, machine->gfx[2], tile_number, color, flipx, flipy, sx, 240 - sy, 15); } source -= 4; }
UINT32 sprint2_state::screen_update_sprint2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { UINT8 *video_ram = m_video_ram; int i; m_bg_tilemap->draw(bitmap, cliprect, 0, 0); /* draw the sprites */ for (i = 0; i < 4; i++) { drawgfx_transpen(bitmap, cliprect, machine().gfx[1], get_sprite_code(video_ram, i), i, 0, 0, get_sprite_x(video_ram, i), get_sprite_y(video_ram, i), 0); } return 0; }
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) { int i; const gfx_element *gfx = machine->gfx[0]; for (i = 3; i < (0x1000 - 6)/2; i += 4){ int sx = targeth_spriteram[i+2] & 0x03ff; int sy = (240 - (targeth_spriteram[i] & 0x00ff)) & 0x00ff; int number = targeth_spriteram[i+3] & 0x3fff; int color = (targeth_spriteram[i+2] & 0x7c00) >> 10; int attr = (targeth_spriteram[i] & 0xfe00) >> 9; int xflip = attr & 0x20; int yflip = attr & 0x40; drawgfx_transpen(bitmap,cliprect,gfx,number, 0x20 + color,xflip,yflip, sx - 0x0f,sy,0); } }
static void splash_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect) { splash_state *state = machine.driver_data<splash_state>(); int i; const gfx_element *gfx = machine.gfx[1]; for (i = 0; i < 0x400; i += 4){ int sx = state->m_spriteram[i+2] & 0xff; int sy = (240 - (state->m_spriteram[i+1] & 0xff)) & 0xff; int attr = state->m_spriteram[i+3] & 0xff; int attr2 = state->m_spriteram[i+0x400] >> state->m_sprite_attr2_shift; int number = (state->m_spriteram[i] & 0xff) + (attr & 0xf)*256; if (attr2 & 0x80) sx += 256; drawgfx_transpen(bitmap,cliprect,gfx,number, 0x10 + (attr2 & 0x0f),attr & 0x40,attr & 0x80, sx-8,sy,0); } }
static VIDEO_UPDATE(jackpool) { const device_config *left_screen = devtag_get_device(screen->machine, "lscreen"); const device_config *right_screen = devtag_get_device(screen->machine, "rscreen"); const gfx_element *gfx = screen->machine->gfx[0]; int count;// = 0x00000/2; int y,x; if(screen == left_screen) { count = 0x0000/2; for (y=0;y<32;y++) { for (x=0;x<64;x++) { int tile = (sc1_vram[count] & 0x7fff); int attr = (sc1_vram[count+0x800] & 0x1f00)>>8; //int t_pen = (sc1_vram[count+0x800] & 0x2000); //int colour = tile>>12; drawgfx_opaque(bitmap,cliprect,gfx,tile,attr,0,0,x*8,y*8); count++; } } count = 0x0000/2; for (y=0;y<32;y++) { for (x=0;x<64;x++) { int tile = (sc0_vram[count] & 0x7fff); int attr = (sc0_vram[count+0x800] & 0x1f00)>>8; /*might just be sloppy coding,colors are enabled as 0x20-0x3f*/ int t_pen = (sc0_vram[count+0x800] & 0x2000); //int colour = tile>>12; drawgfx_transpen(bitmap,cliprect,gfx,tile,attr,0,0,x*8,y*8,(t_pen) ? -1 : 0); count++; } } }
static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect) { int flipscreen = 0; int offs,sx,sy; for (offs = 0x1000-0x40; offs >= 0; offs -= 0x20) { int code = egghunt_spram[offs]; int attr = egghunt_spram[offs+1]; int color = attr & 0x0f; sx = egghunt_spram[offs+3] + ((attr & 0x10) << 4); sy = ((egghunt_spram[offs+2] + 8) & 0xff) - 8; code += (attr & 0xe0) << 3; if(attr & 0xe0) { switch(egghunt_gfx_banking & 0x30) { // case 0x00: // case 0x10: code += 0; break; case 0x20: code += 0x400; break; case 0x30: code += 0x800; break; } } if (flipscreen) { sx = 496 - sx; sy = 240 - sy; } drawgfx_transpen(bitmap,cliprect,machine->gfx[1], code, color, flipscreen,flipscreen, sx,sy,15); } }
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) { rectangle clip = *cliprect; const gfx_element *gfx = machine->gfx[1]; const rectangle &visarea = machine->primary_screen->visible_area(); UINT8 *spriteram = machine->generic.spriteram.u8; int offs; for (offs = 0;offs < machine->generic.spriteram_size;offs += 4) { int sy = 240-spriteram[offs]; int sx = 240-spriteram[offs+3]; int code = spriteram[offs+2]; int attr = spriteram[offs+1]; int color = (attr & 0xe0)>>5; if (sy == 240) continue; code+=(attr&0x0c)<<6; if ((control_byte & 0xa)) clip.max_y = visarea.max_y; else if (flip_screen_get(machine)) clip.min_y = visarea.min_y + 56; else clip.max_y = visarea.max_y - 56; if (flip_screen_get(machine)) { sx = 240 - sx; sy = 240 - sy; } drawgfx_transpen(bitmap,&clip,gfx, code, color, flip_screen_get(machine),flip_screen_get(machine), sx,sy,0); } }
static SCREEN_UPDATE_IND16(jackpool) { jackpool_state *state = screen.machine().driver_data<jackpool_state>(); const gfx_element *gfx = screen.machine().gfx[0]; int count;// = 0x00000/2; int y,x; { count = state->m_map_vreg*(0x4000/2); for (y=0;y<32;y++) { for (x=0;x<64;x++) { int tile = (state->m_vram[count+(0x2000/2)] & 0x7fff); int attr = (state->m_vram[count+(0x2000/2)+0x800] & 0x1f00)>>8; drawgfx_opaque(bitmap,cliprect,gfx,tile,attr,0,0,x*8,y*8); count++; } } count = state->m_map_vreg*(0x4000/2); for (y=0;y<32;y++) { for (x=0;x<64;x++) { int tile = (state->m_vram[count] & 0x7fff); if(tile != 0) { int attr = (state->m_vram[count+0x800] & 0x1f00)>>8; int t_pen = (state->m_vram[count+0x800] & 0x1000); drawgfx_transpen(bitmap,cliprect,gfx,tile,attr,0,0,x*8,y*8,(t_pen) ? 0 : -1); } count++; } } }
/*------------------------------------------------- drawgfx_alphastore - render a gfx element with a single transparent pen, storing the alpha value in alpha field of ARGB32, negative alpha implies alphatable -------------------------------------------------*/ static void drawgfx_alphastore(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, int fixedalpha) { psikyosh_state *state = gfx->machine().driver_data<psikyosh_state>(); UINT8 *alphatable = state->m_alphatable; bitmap_t *priority = NULL; /* dummy, no priority in this case */ const pen_t *paldata; assert(dest != NULL); assert(dest->bpp == 32); assert(dest->format == BITMAP_FORMAT_ARGB32); assert(gfx != NULL); assert(alphatable != NULL); /* if we have a fixed alpha, call the standard drawgfx_transpen */ if (fixedalpha == 0xff) { drawgfx_transpen(dest, cliprect, gfx, code, color, flipx, flipy, destx, desty, 0); return; } /* get final code and color, and grab lookup tables */ code %= gfx->total_elements; color %= gfx->total_colors; paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color]; /* early out if completely transparent */ if (gfx->pen_usage != NULL && (gfx->pen_usage[code] & ~(1 << 0)) == 0) return; if (fixedalpha >= 0) { UINT8 alpha = fixedalpha; DRAWGFX_CORE(UINT32, PIXEL_OP_REMAP_TRANS0_ALPHASTORE32, NO_PRIORITY); } else { DRAWGFX_CORE(UINT32, PIXEL_OP_REMAP_TRANS0_ALPHATABLESTORE32, NO_PRIORITY); } }
void tankbust_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) { UINT8 *spriteram = m_spriteram; int offs; for (offs = 0; offs < m_spriteram.bytes(); offs += 4) { int code,color,sx,sy,flipx,flipy; code = spriteram[offs+0] & 0x3f; flipy = spriteram[offs+0] & 0x40; flipx = spriteram[offs+0] & 0x80; sy = (240- spriteram[offs+1]) - 14; sx = (spriteram[offs+2] & 0x01) * 256 + spriteram[offs+3] - 7; color = 0; //0x02 - dont know (most of the time this bit is set in tank sprite and others but not all and not always) //0x04 - not used //0x08 - not used //0x10 - not used //0x20 - not used //0x40 - not used //0x80 - not used #if 0 if ((spriteram[offs+2] & 0x02)) { code = ((int)rand()) & 63; } #endif if ((spriteram[offs+1]!=4)) //otherwise - ghost sprites { 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 offs; for (offs = 0x3e;offs >= 0x10;offs -= 2) { int sx = spriteram[offs]; int sy = 241 - spriteram_2[offs + 1]; int code = spriteram[offs + 1]; int color = spriteram_2[offs] & 0x3f; int flipx = ~spriteram_2[offs] & 0x40; int flipy = spriteram_2[offs] & 0x80; drawgfx_transpen(bitmap,cliprect,machine->gfx[1], code, color, flipx,flipy, sx,sy,0); } }