本文整理汇总了C++中drawgfx_transpen函数的典型用法代码示例。如果您正苦于以下问题:C++ drawgfx_transpen函数的具体用法?C++ drawgfx_transpen怎么用?C++ drawgfx_transpen使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了drawgfx_transpen函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: VIDEO_UPDATE
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;
}
示例2: gpworld_draw_tiles
/* 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);
}
}
}
示例3: draw_sprites
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);
}
}
示例4: funystrp_draw_sprites
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);
}
}
示例5: drawgfx_transpen
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;
}
示例6: machine
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;
}
示例7: draw_sprites
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);
}
}
示例8: machine
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;
}
}
示例9: draw_sprites
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);
}
}
示例10: draw_sprites
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);
}
}
示例11: draw_sprites
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;
}
示例12: draw_sprites
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);
}
}
}
}
示例13: draw_sprites
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);
}
}
示例14: draw_sprites
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;
}
}
示例15: draw_sprites
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;
}