本文整理汇总了C++中BITMAP_ADDR16函数的典型用法代码示例。如果您正苦于以下问题:C++ BITMAP_ADDR16函数的具体用法?C++ BITMAP_ADDR16怎么用?C++ BITMAP_ADDR16使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了BITMAP_ADDR16函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
}
}
开发者ID:cdenix,项目名称:psmame,代码行数:31,代码来源:zx8301.c
示例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);
}
}
}
}
开发者ID:TheProjecter,项目名称:pockemul,代码行数:35,代码来源:hd44352.cpp
示例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;
}
开发者ID:poliva,项目名称:mame-rr,代码行数:28,代码来源:vegaeo.c
示例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;
}
开发者ID:AltimorTASDK,项目名称:shmupmametgm,代码行数:27,代码来源:vegaeo.c
示例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;
}
}
}
}
开发者ID:DarrenBranford,项目名称:MAME4iOS,代码行数:33,代码来源:madalien.c
示例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;
}
开发者ID:cdenix,项目名称:psmame,代码行数:11,代码来源:scv.c
示例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;
}
开发者ID:Paulodx,项目名称:sdl-mame-wii,代码行数:33,代码来源:getrivia.c
示例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;
}
开发者ID:cdenix,项目名称:psmame,代码行数:32,代码来源:gmaster.c
示例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;
}
}
}
}
}
开发者ID:bdidier,项目名称:MAME-OS-X,代码行数:30,代码来源:tms9928a.c
示例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;
}
}
开发者ID:cdenix,项目名称:psmame,代码行数:15,代码来源:scv.c
示例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;
}
开发者ID:AltimorTASDK,项目名称:shmupmametgm,代码行数:48,代码来源:bmcbowl.c
示例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;
}
}
}
开发者ID:rogerjowett,项目名称:ClientServerMAME,代码行数:35,代码来源:v1050.c
示例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;
}
}
}
}
}
开发者ID:nitrologic,项目名称:emu,代码行数:32,代码来源:bosco.c
示例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;
}
}
开发者ID:cdenix,项目名称:psmame,代码行数:34,代码来源:h19.c
示例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
{
开发者ID:AltimorTASDK,项目名称:shmupmametgm,代码行数:28,代码来源:mos6560.c
示例16: VIDEO_UPDATE
static VIDEO_UPDATE(hotblock)
{
int y,x,count;
int i;
static int xxx=320,yyy=204;
fillbitmap(bitmap, get_black_pen(machine), 0);
for (i=0;i<256;i++)
{
int dat=(hotblock_pal[i*2+1]<<8)|hotblock_pal[i*2];
palette_set_color_rgb(machine,i,pal5bit(dat>>0),pal5bit(dat>>5),pal5bit(dat>>10));
}
count=0;
for (y=0;y<yyy;y++)
{
for(x=0;x<xxx;x++)
{
if(hotblock_port0&0x40) *BITMAP_ADDR16(bitmap, y, x) = hotblock_ram[count];
count++;
}
}
return 0;
}
开发者ID:broftkd,项目名称:historic-mame,代码行数:28,代码来源:hotblock.c
示例17: ssystem3_draw_7segment
static void ssystem3_draw_7segment(bitmap_t *bitmap,int value, int x, int y)
{
int i, xi, yi, mask, color;
for (i=0, xi=0, yi=0; led[i]; i++) {
mask=0;
switch (led[i]) {
case 'a': mask=0x80; break;
case 'b': mask=0x40; break;
case 'c': mask=0x20; break;
case 'd': mask=0x10; break;
case 'e': mask=8; break;
case 'f': mask=4; break;
case 'g': mask=2; break;
case 'h':
// this is more likely wired to the separate leds
mask=1;
break;
}
if (mask!=0) {
color=(value&mask)?1:0;
*BITMAP_ADDR16(bitmap, y+yi, x+xi) = color;
}
if (led[i]!='\r') xi++;
else { yi++, xi=0; }
}
}
开发者ID:cdenix,项目名称:psmame,代码行数:28,代码来源:ssystem3.c
示例18: draw_torpedo
static void draw_torpedo(running_machine *machine, bitmap_t* bitmap, const rectangle* cliprect)
{
int count = 0;
int x;
int y;
drawgfx_transpen(bitmap, cliprect,
machine->gfx[3],
wolfpack_torpedo_pic,
0,
0, 0,
2 * (244 - wolfpack_torpedo_h),
224 - wolfpack_torpedo_v, 0);
for (y = 16; y < 224 - wolfpack_torpedo_v; y++)
{
int x1;
int x2;
if (y % 16 == 1)
count = (count - 1) & 7;
x1 = 248 - wolfpack_torpedo_h - count;
x2 = 248 - wolfpack_torpedo_h + count;
for (x = 2 * x1; x < 2 * x2; x++)
if (LFSR[(current_index + 0x300 * y + x) % 0x8000])
*BITMAP_ADDR16(bitmap, y, x) = 1;
}
}
开发者ID:Paulodx,项目名称:sdl-mame-wii,代码行数:31,代码来源:wolfpack.c
示例19: SCREEN_UPDATE
static SCREEN_UPDATE(hotblock)
{
hotblock_state *state = screen->machine().driver_data<hotblock_state>();
int y, x, count;
int i;
static const int xxx = 320, yyy = 204;
bitmap_fill(bitmap, 0, get_black_pen(screen->machine()));
for (i = 0; i < 256; i++)
{
int dat = (state->m_pal[i * 2 + 1] << 8) | state->m_pal[i * 2];
palette_set_color_rgb(screen->machine(), i, pal5bit(dat >> 0), pal5bit(dat >> 5), pal5bit(dat >> 10));
}
count = 0;
for (y = 0; y < yyy; y++)
{
for(x = 0; x < xxx; x++)
{
if (state->m_port0 & 0x40)
*BITMAP_ADDR16(bitmap, y, x) = state->m_vram[count];
count++;
}
}
return 0;
}
开发者ID:esn3s,项目名称:mame-rr,代码行数:28,代码来源:hotblock.c
示例20: draw_mode12
static void draw_mode12 (device_t *screen, bitmap_t *bitmap, const rectangle *cliprect) {
int pattern,x,y,yy,xx,name,charcode;
UINT8 fg,bg,*patternptr;
const pen_t *pens;
rectangle rt;
pens = screen->machine().pens;
fg = pens[tms.Regs[7] / 16];
bg = pens[tms.Regs[7] & 15];
/* colours at sides must be reset */
rt.min_y = 0; rt.max_y = 191;
rt.min_x = 0; rt.max_x = 7;
bitmap_fill (bitmap, &rt, bg);
rt.min_y = 0; rt.max_y = 191;
rt.min_x = 248; rt.max_x = 255;
bitmap_fill (bitmap, &rt, bg);
name = 0;
for (y=0;y<24;y++) {
for (x=0;x<40;x++) {
charcode = (tms.vMem[tms.nametbl+name]+(y/8)*256)&tms.patternmask;
name++;
patternptr = tms.vMem + tms.pattern + (charcode*8);
for (yy=0;yy<8;yy++) {
pattern = *patternptr++;
for (xx=0;xx<6;xx++) {
*BITMAP_ADDR16(bitmap, y*8+yy, 8+x*6+xx) = (pattern & 0x80) ? fg : bg;
pattern *= 2;
}
}
}
}
}
开发者ID:bdidier,项目名称:MAME-OS-X,代码行数:34,代码来源:tms9928a.c
注:本文中的BITMAP_ADDR16函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论