本文整理匯總了C++中BITMAP_ADDR16函數的典型用法代碼示例。如果您正苦於以下問題:C++ BITMAP_ADDR16函數的具體用法?C++ BITMAP_ADDR16怎麽用?C++ BITMAP_ADDR16使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了BITMAP_ADDR16函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: readbyte
void zx8301_device::draw_line_mode8(bitmap_t *bitmap, int y, UINT16 da)
{
int x = 0;
for (int word = 0; word < 64; word++)
{
UINT8 byte_high = readbyte(da++);
UINT8 byte_low = readbyte(da++);
for (int pixel = 0; pixel < 4; pixel++)
{
int red = BIT(byte_low, 7);
int green = BIT(byte_high, 7);
int blue = BIT(byte_low, 6);
int flash = BIT(byte_high, 6);
int color = (green << 2) | (red << 1) | blue;
if (flash && m_flash)
{
color = 0;
}
*BITMAP_ADDR16(bitmap, y, x++) = color;
*BITMAP_ADDR16(bitmap, y, x++) = color;
byte_high <<= 2;
byte_low <<= 2;
}
}
}
示例2: bitmap_fill
int CHD44352::video_update(bitmap_t &bitmap, const rectangle &cliprect)
{
UINT8 cw = info.m_char_width;
bitmap_fill(&bitmap, &cliprect, 0);
if (info.m_control_lines&0x80 && info.m_lcd_on)
{
for (int a=0; a<2; a++)
for (int py=0; py<4; py++)
for (int px=0; px<16; px++)
if (BIT(info.m_cursor_status, 4) && px == info.m_cursor_x && py == info.m_cursor_y && a == info.m_cursor_lcd)
{
//draw the cursor
for (int c=0; c<cw; c++)
{
UINT8 d = compute_newval((info.m_cursor_status>>5) & 0x07, info.m_video_ram[a][py*16*cw + px*cw + c + info.m_scroll * 48], info.m_cursor[c]);
for (int b=0; b<8; b++)
{
*BITMAP_ADDR16(&bitmap, py*8 + b, a*cw*16 + px*cw + c) = BIT(d, 7-b);
}
}
}
else
{
for (int c=0; c<cw; c++)
{
UINT8 d = info.m_video_ram[a][py*16*cw + px*cw + c + info.m_scroll * 48];
for (int b=0; b<8; b++)
{
*BITMAP_ADDR16(&bitmap, py*8 + b, a*cw*16 + px*cw + c) = BIT(d, 7-b);
}
}
}
}
示例3: SCREEN_UPDATE
static SCREEN_UPDATE( vega )
{
vegaeo_state *state = screen->machine().driver_data<vegaeo_state>();
int x,y,count;
int color;
count = 0;
for (y=0;y < 240;y++)
{
for (x=0;x < 320/4;x++)
{
color = state->m_vega_vram[count + (0x14000/4) * (state->m_vega_vbuffer ^ 1)] & 0xff;
*BITMAP_ADDR16(bitmap, y, x*4 + 3) = color;
color = (state->m_vega_vram[count + (0x14000/4) * (state->m_vega_vbuffer ^ 1)] & 0xff00) >> 8;
*BITMAP_ADDR16(bitmap, y, x*4 + 2) = color;
color = (state->m_vega_vram[count + (0x14000/4) * (state->m_vega_vbuffer ^ 1)] & 0xff0000) >> 16;
*BITMAP_ADDR16(bitmap, y, x*4 + 1) = color;
color = (state->m_vega_vram[count + (0x14000/4) * (state->m_vega_vbuffer ^ 1)] & 0xff000000) >> 24;
*BITMAP_ADDR16(bitmap, y, x*4 + 0) = color;
count++;
}
}
return 0;
}
示例4: VIDEO_UPDATE
static VIDEO_UPDATE( vega )
{
int x,y,count;
int color;
count = 0;
for (y=0;y < 240;y++)
{
for (x=0;x < 320/4;x++)
{
color = vega_vram[count + (0x14000/4) * (vega_vbuffer ^ 1)] & 0xff;
*BITMAP_ADDR16(bitmap, y, x*4 + 3) = color;
color = (vega_vram[count + (0x14000/4) * (vega_vbuffer ^ 1)] & 0xff00) >> 8;
*BITMAP_ADDR16(bitmap, y, x*4 + 2) = color;
color = (vega_vram[count + (0x14000/4) * (vega_vbuffer ^ 1)] & 0xff0000) >> 16;
*BITMAP_ADDR16(bitmap, y, x*4 + 1) = color;
color = (vega_vram[count + (0x14000/4) * (vega_vbuffer ^ 1)] & 0xff000000) >> 24;
*BITMAP_ADDR16(bitmap, y, x*4 + 0) = color;
count++;
}
}
return 0;
}
示例5: draw_headlight
static void draw_headlight(bitmap_t *bitmap, const rectangle *cliprect, int flip)
{
if (BIT(*madalien_video_flags, 0))
{
UINT8 y;
for (y = 0; y < 0x80; y++)
{
UINT8 x;
UINT8 hy = y - *madalien_headlight_pos;
if (flip)
hy = ~hy;
if ((hy < cliprect->min_y) || (hy > cliprect->max_y))
continue;
for (x = 0; x < 0x80; x++)
{
UINT8 hx = x;
if (flip)
hx = ~hx;
if ((hx < cliprect->min_x) || (hx > cliprect->max_x))
continue;
if (*BITMAP_ADDR16(headlight_bitmap, y, x) != 0)
*BITMAP_ADDR16(bitmap, hy, hx) |= 8;
}
}
}
}
示例6: plot_sprite_part
INLINE void plot_sprite_part( bitmap_t *bitmap, UINT8 x, UINT8 y, UINT8 pat, UINT8 col )
{
if ( pat & 0x08 )
*BITMAP_ADDR16( bitmap, y, x ) = col;
if ( pat & 0x04 && x < 255 )
*BITMAP_ADDR16( bitmap, y, x + 1 ) = col;
if ( pat & 0x02 && x < 254 )
*BITMAP_ADDR16( bitmap, y, x + 2 ) = col;
if ( pat & 0x01 && x < 253 )
*BITMAP_ADDR16( bitmap, y, x + 3 ) = col;
}
示例7: WRITE8_HANDLER
static WRITE8_HANDLER( getrivia_bitmap_w )
{
int sx,sy;
int fg,bg,mask,bits;
static int prevoffset, yadd;
videoram[offset] = data;
yadd = (offset==prevoffset) ? (yadd+1):0;
prevoffset = offset;
fg = drawctrl[0] & 7;
bg = 2;
mask = 0xff;//drawctrl[2];
bits = drawctrl[1];
sx = 8 * (offset % 64);
sy = offset / 64;
sy = (sy + yadd) & 0xff;
//if (mask != bits)
// popmessage("color %02x bits %02x mask %02x\n",fg,bits,mask);
if (mask & 0x80) *BITMAP_ADDR16(tmpbitmap, sy, sx+0) = (bits & 0x80) ? fg : bg;
if (mask & 0x40) *BITMAP_ADDR16(tmpbitmap, sy, sx+1) = (bits & 0x40) ? fg : bg;
if (mask & 0x20) *BITMAP_ADDR16(tmpbitmap, sy, sx+2) = (bits & 0x20) ? fg : bg;
if (mask & 0x10) *BITMAP_ADDR16(tmpbitmap, sy, sx+3) = (bits & 0x10) ? fg : bg;
if (mask & 0x08) *BITMAP_ADDR16(tmpbitmap, sy, sx+4) = (bits & 0x08) ? fg : bg;
if (mask & 0x04) *BITMAP_ADDR16(tmpbitmap, sy, sx+5) = (bits & 0x04) ? fg : bg;
if (mask & 0x02) *BITMAP_ADDR16(tmpbitmap, sy, sx+6) = (bits & 0x02) ? fg : bg;
if (mask & 0x01) *BITMAP_ADDR16(tmpbitmap, sy, sx+7) = (bits & 0x01) ? fg : bg;
}
示例8: SCREEN_UPDATE
static SCREEN_UPDATE( gmaster )
{
gmaster_state *state = screen->machine().driver_data<gmaster_state>();
int x,y;
// plot_box(bitmap, 0, 0, 64/*bitmap->width*/, bitmap->height, 0); //xmess rounds up to 64 pixel
for (y = 0; y < ARRAY_LENGTH(state->m_video.pixels); y++)
{
for (x = 0; x < ARRAY_LENGTH(state->m_video.pixels[0]); x++)
{
UINT8 d = state->m_video.pixels[y][x];
UINT16 *line;
line = BITMAP_ADDR16(bitmap, (y * 8), x);
line[0] = BIT(d, 0);
line = BITMAP_ADDR16(bitmap, (y * 8 + 1), x);
line[0] = BIT(d, 1);
line = BITMAP_ADDR16(bitmap, (y * 8 + 2), x);
line[0] = BIT(d, 2);
line = BITMAP_ADDR16(bitmap, (y * 8 + 3), x);
line[0] = BIT(d, 3);
line = BITMAP_ADDR16(bitmap, (y * 8 + 4), x);
line[0] = BIT(d, 4);
line = BITMAP_ADDR16(bitmap, (y * 8 + 5), x);
line[0] = BIT(d, 5);
line = BITMAP_ADDR16(bitmap, (y * 8 + 6), x);
line[0] = BIT(d, 6);
line = BITMAP_ADDR16(bitmap, (y * 8 + 7), x);
line[0] = BIT(d, 7);
}
}
return 0;
}
示例9: draw_mode23
static void draw_mode23 (device_t *screen, bitmap_t *bitmap, const rectangle *cliprect) {
int x,y,yy,yyy,name,charcode;
UINT8 fg,bg,*patternptr;
const pen_t *pens;
pens = screen->machine().pens;
name = 0;
for (y=0;y<24;y++) {
for (x=0;x<32;x++) {
charcode = tms.vMem[tms.nametbl+name];
name++;
patternptr = tms.vMem + tms.pattern +
((charcode+(y&3)*2+(y/8)*256)&tms.patternmask)*8;
for (yy=0;yy<2;yy++) {
fg = pens[(*patternptr / 16)];
bg = pens[((*patternptr++) & 15)];
for (yyy=0;yyy<4;yyy++) {
*BITMAP_ADDR16(bitmap, y*8+yy*4+yyy, x*8+0) = fg;
*BITMAP_ADDR16(bitmap, y*8+yy*4+yyy, x*8+1) = fg;
*BITMAP_ADDR16(bitmap, y*8+yy*4+yyy, x*8+2) = fg;
*BITMAP_ADDR16(bitmap, y*8+yy*4+yyy, x*8+3) = fg;
*BITMAP_ADDR16(bitmap, y*8+yy*4+yyy, x*8+4) = bg;
*BITMAP_ADDR16(bitmap, y*8+yy*4+yyy, x*8+5) = bg;
*BITMAP_ADDR16(bitmap, y*8+yy*4+yyy, x*8+6) = bg;
*BITMAP_ADDR16(bitmap, y*8+yy*4+yyy, x*8+7) = bg;
}
}
}
}
}
示例10: draw_semi_graph
INLINE void draw_semi_graph( bitmap_t *bitmap, UINT8 x, UINT8 y, UINT8 data, UINT8 fg )
{
int i;
if ( ! data )
return;
for ( i = 0; i < 4; i++ )
{
*BITMAP_ADDR16(bitmap, y + i, x + 0) = fg;
*BITMAP_ADDR16(bitmap, y + i, x + 1) = fg;
*BITMAP_ADDR16(bitmap, y + i, x + 2) = fg;
*BITMAP_ADDR16(bitmap, y + i, x + 3) = fg;
}
}
示例11: VIDEO_UPDATE
static VIDEO_UPDATE( bmcbowl )
{
/*
280x230,4 bitmap layers, 8bpp,
missing scroll and priorities (maybe fixed ones)
*/
int x,y,z,pixdat;
bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
z=0;
for (y=0;y<230;y++)
{
for (x=0;x<280;x+=2)
{
pixdat = bmcbowl_vid2[0x8000+z];
if(pixdat&0xff)
*BITMAP_ADDR16(bitmap, y, x+1) = (pixdat&0xff);
if(pixdat>>8)
*BITMAP_ADDR16(bitmap, y, x) = (pixdat>>8);
pixdat = bmcbowl_vid2[z];
if(pixdat&0xff)
*BITMAP_ADDR16(bitmap, y, x+1) = (pixdat&0xff);
if(pixdat>>8)
*BITMAP_ADDR16(bitmap, y, x) = (pixdat>>8);
pixdat = bmcbowl_vid1[0x8000+z];
if(pixdat&0xff)
*BITMAP_ADDR16(bitmap, y, x+1) = (pixdat&0xff);
if(pixdat>>8)
*BITMAP_ADDR16(bitmap, y, x) = (pixdat>>8);
pixdat = bmcbowl_vid1[z];
if(pixdat&0xff)
*BITMAP_ADDR16(bitmap, y, x+1) = (pixdat&0xff);
if(pixdat>>8)
*BITMAP_ADDR16(bitmap, y, x) = (pixdat>>8);
z++;
}
}
return 0;
}
示例12: MC6845_UPDATE_ROW
static MC6845_UPDATE_ROW( v1050_update_row )
{
v1050_state *state = device->machine().driver_data<v1050_state>();
int column, bit;
for (column = 0; column < x_count; column++)
{
UINT16 address = (((ra & 0x03) + 1) << 13) | ((ma & 0x1fff) + column);
UINT8 data = state->m_video_ram[address & V1050_VIDEORAM_MASK];
UINT8 attr = (state->m_attr & 0xfc) | (state->m_attr_ram[address] & 0x03);
for (bit = 0; bit < 8; bit++)
{
int x = (column * 8) + bit;
int color = BIT(data, 7);
/* blinking */
if ((attr & V1050_ATTR_BLINKING) && !(attr & V1050_ATTR_BLINK)) color = 0;
/* reverse video */
color ^= BIT(attr, 4);
/* bright */
if (color && (!(attr & V1050_ATTR_BOLD) ^ (attr & V1050_ATTR_BRIGHT))) color = 2;
/* display blank */
if (attr & V1050_ATTR_BLANK) color = 0;
*BITMAP_ADDR16(bitmap, y, x) = color;
data <<= 1;
}
}
}
示例13: draw_stars
static void draw_stars(bitmap_t *bitmap, const rectangle *cliprect, int flip)
{
if (1)
{
int star_cntr;
int set_a, set_b;
/* two sets of stars controlled by these bits */
set_a = bosco_starblink[0];
set_b = bosco_starblink[1] |0x2;
for (star_cntr = 0;star_cntr < MAX_STARS;star_cntr++)
{
int x,y;
if ( (set_a == star_seed_tab[star_cntr].set) || ( set_b == star_seed_tab[star_cntr].set) )
{
x = ( star_seed_tab[star_cntr].x + stars_scrollx) % 256;
y = ( star_seed_tab[star_cntr].y + stars_scrolly) % 256;
/* dont draw the stars that are off the screen */
if ( x < 224 && y < 224 )
{
if (flip) x += 64;
if (y >= cliprect->min_y && y <= cliprect->max_y)
*BITMAP_ADDR16(bitmap, y, x) = STARS_COLOR_BASE + star_seed_tab[star_cntr].col;
}
}
}
}
}
示例14: MC6845_UPDATE_ROW
static MC6845_UPDATE_ROW( h19_update_row )
{
h19_state *state = device->machine().driver_data<h19_state>();
UINT8 chr,gfx;
UINT16 mem,x;
UINT16 *p = BITMAP_ADDR16(bitmap, y, 0);
for (x = 0; x < x_count; x++)
{
UINT8 inv=0;
if (x == cursor_x) inv=0xff;
mem = (ma + x) & 0x7ff;
chr = state->m_videoram[mem];
if (chr & 0x80)
{
inv ^= 0xff;
chr &= 0x7f;
}
/* get pattern of pixels for that character scanline */
gfx = state->m_charrom[(chr<<4) | ra] ^ inv;
/* Display a scanline of a character (8 pixels) */
*p++ = ( gfx & 0x80 ) ? 1 : 0;
*p++ = ( gfx & 0x40 ) ? 1 : 0;
*p++ = ( gfx & 0x20 ) ? 1 : 0;
*p++ = ( gfx & 0x10 ) ? 1 : 0;
*p++ = ( gfx & 0x08 ) ? 1 : 0;
*p++ = ( gfx & 0x04 ) ? 1 : 0;
*p++ = ( gfx & 0x02 ) ? 1 : 0;
*p++ = ( gfx & 0x01 ) ? 1 : 0;
}
}
示例15: mos6560_drawlines
static void mos6560_drawlines( running_device *device, int first, int last )
{
mos6560_state *mos6560 = get_safe_token(device);
int line, vline;
int offs, yoff, xoff, ybegin, yend, i, j;
int attr, ch;
mos6560->lastline = last;
if (first >= last)
return;
for (line = first; (line < mos6560->ypos) && (line < last); line++)
{
for (j = 0; j < mos6560->total_xsize; j++)
*BITMAP_ADDR16(mos6560->bitmap, line, j) = mos6560->framecolor;
}
for (vline = line - mos6560->ypos; (line < last) && (line < mos6560->ypos + mos6560->ysize);)
{
if (mos6560->matrix8x16)
{
offs = (vline >> 4) * mos6560->chars_x;
yoff = (vline & ~0xf) + mos6560->ypos;
ybegin = vline & 0xf;
yend = (vline + 0xf < last - mos6560->ypos) ? 0xf : ((last - line) & 0xf) + ybegin;
}
else
{