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; } } }
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); } } } }
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; }
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; }
static void draw_headlight(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int flip) { madalien_state *state = machine->driver_data<madalien_state>(); if (BIT(*state->video_flags, 0)) { UINT8 y; for (y = 0; y < 0x80; y++) { UINT8 x; UINT8 hy = y - *state->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(state->headlight_bitmap, y, x) != 0) *BITMAP_ADDR16(bitmap, hy, hx) |= 8; } } } }
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; } } } }
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; }
static int check_collision( device_t *device, int spriteno1, int spriteno2, const rectangle *cliprect ) { s2636_state *s2636 = get_safe_token(device); int checksum = 0; UINT8* attr1 = &s2636->work_ram[sprite_offsets[spriteno1]]; UINT8* attr2 = &s2636->work_ram[sprite_offsets[spriteno2]]; /* TODO: does not check shadow sprites yet */ bitmap_fill(s2636->collision_bitmap, cliprect, 0); if ((attr1[0x0a] != 0xff) && (attr2[0x0a] != 0xff)) { int x, y; int x1 = attr1[0x0a] + s2636->x_offset; int y1 = attr1[0x0c] + s2636->y_offset; int x2 = attr2[0x0a] + s2636->x_offset; int y2 = attr2[0x0c] + s2636->y_offset; int expand1 = (s2636->work_ram[0xc0] >> (spriteno1 << 1)) & 0x03; int expand2 = (s2636->work_ram[0xc0] >> (spriteno2 << 1)) & 0x03; /* draw first sprite */ draw_sprite(attr1, 1, y1, x1, expand1, FALSE, s2636->collision_bitmap, cliprect); /* get fingerprint */ for (x = x1; x < x1 + SPRITE_WIDTH; x++) for (y = y1; y < y1 + SPRITE_HEIGHT; y++) { if ((x < cliprect->min_x) || (x > cliprect->max_x) || (y < cliprect->min_y) || (y > cliprect->max_y)) continue; checksum = checksum + *BITMAP_ADDR16(s2636->collision_bitmap, y, x); } /* black out second sprite */ draw_sprite(attr2, 0, y2, x2, expand2, FALSE, s2636->collision_bitmap, cliprect); /* remove fingerprint */ for (x = x1; x < x1 + SPRITE_WIDTH; x++) for (y = y1; y < y1 + SPRITE_HEIGHT; y++) { if ((x < cliprect->min_x) || (x > cliprect->max_x) || (y < cliprect->min_y) || (y > cliprect->max_y)) continue; checksum = checksum - *BITMAP_ADDR16(s2636->collision_bitmap, y, x); } }
static void draw_phasor(starshp1_state *state, bitmap_t* bitmap) { int i; for (i = 128; i < 240; i++) if (i >= get_sprite_vpos(state, 13)) { *BITMAP_ADDR16(bitmap, i, 2 * i + 0) = 0x10; *BITMAP_ADDR16(bitmap, i, 2 * i + 1) = 0x10; *BITMAP_ADDR16(bitmap, i, 2 * (255 - i) + 0) = 0x10; *BITMAP_ADDR16(bitmap, i, 2 * (255 - i) + 1) = 0x10; } }
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; }
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; }
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; } } } } }
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; } }
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; }
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; } } }
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; } } } } }
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; } }
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 {
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; }
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; } } }
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; } }
static void draw_circle_line(running_machine *machine, bitmap_t *bitmap, int x, int y, int l) { starshp1_state *state = machine->driver_data<starshp1_state>(); if (y >= 0 && y <= bitmap->height - 1) { const UINT16* p = state->LSFR + (UINT16) (512 * y); UINT16* pLine = BITMAP_ADDR16(bitmap, y, 0); int h1 = x - 2 * l; int h2 = x + 2 * l; if (h1 < 0) h1 = 0; if (h2 > bitmap->width - 1) h2 = bitmap->width - 1; for (x = h1; x <= h2; x++) if (state->circle_mod) { if (p[x] & 1) pLine[x] = 0x11; } else pLine[x] = 0x12; } }
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; }
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; } } } } }
static MC6845_UPDATE_ROW( apricot_update_row ) { apricot_state *state = device->machine().driver_data<apricot_state>(); UINT8 *ram = ram_get_ptr(device->machine().device(RAM_TAG)); int i, x; if (state->m_video_mode) { /* text mode */ for (i = 0; i < x_count; i++) { UINT16 code = state->m_screen_buffer[(ma + i) & 0x7ff]; UINT16 offset = ((code & 0x7ff) << 5) | (ra << 1); UINT16 data = ram[offset + 1] << 8 | ram[offset]; int fill = 0; if (BIT(code, 12) && BIT(data, 14)) fill = 1; /* strike-through? */ if (BIT(code, 13) && BIT(data, 15)) fill = 1; /* underline? */ /* draw 10 pixels of the character */ for (x = 0; x <= 10; x++) { int color = fill ? 1 : BIT(data, x); if (BIT(code, 15)) color = !color; /* reverse? */ *BITMAP_ADDR16(bitmap, y, x + i*10) = color ? 1 + BIT(code, 14) : 0; } } } else { /* graphics mode */ fatalerror("Graphics mode not implemented!"); } }
static SCREEN_UPDATE( flyball ) { flyball_state *state = screen->machine().driver_data<flyball_state>(); int pitcherx = state->m_pitcher_horz; int pitchery = state->m_pitcher_vert - 31; int ballx = state->m_ball_horz - 1; int bally = state->m_ball_vert - 17; int x; int y; tilemap_mark_all_tiles_dirty(state->m_tmap); /* draw playfield */ tilemap_draw(bitmap, cliprect, state->m_tmap, 0, 0); /* draw pitcher */ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1], state->m_pitcher_pic ^ 0xf, 0, 1, 0, pitcherx, pitchery, 1); /* draw ball */ for (y = bally; y < bally + 2; y++) for (x = ballx; x < ballx + 2; x++) if (x >= cliprect->min_x && x <= cliprect->max_x && y >= cliprect->min_y && y <= cliprect->max_y) *BITMAP_ADDR16(bitmap, y, x) = 1; return 0; }
static void draw_mode0 (device_t *screen, bitmap_t *bitmap, const rectangle *cliprect) { int pattern,x,y,yy,xx,name,charcode,colour; 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*8; colour = tms.vMem[tms.colour+charcode/8]; fg = pens[colour / 16]; bg = pens[colour & 15]; for (yy=0;yy<8;yy++) { pattern=*patternptr++; for (xx=0;xx<8;xx++) { *BITMAP_ADDR16(bitmap, y*8+yy, x*8+xx) = (pattern & 0x80) ? fg : bg; pattern *= 2; } } } } }
static void draw_mode2 (device_t *screen, bitmap_t *bitmap, const rectangle *cliprect) { int colour,name,x,y,yy,pattern,xx,charcode; UINT8 fg,bg; const pen_t *pens; UINT8 *colourptr,*patternptr; pens = screen->machine().pens; name = 0; for (y=0;y<24;y++) { for (x=0;x<32;x++) { charcode = tms.vMem[tms.nametbl+name]+(y/8)*256; name++; colour = (charcode&tms.colourmask); pattern = (charcode&tms.patternmask); patternptr = tms.vMem+tms.pattern+colour*8; colourptr = tms.vMem+tms.colour+pattern*8; for (yy=0;yy<8;yy++) { pattern = *patternptr++; colour = *colourptr++; fg = pens[colour / 16]; bg = pens[colour & 15]; for (xx=0;xx<8;xx++) { *BITMAP_ADDR16(bitmap, y*8+yy, x*8+xx) = (pattern & 0x80) ? fg : bg; pattern *= 2; } } } } }
static void plot_pixel_pal(running_machine &machine, int x, int y, int addr) { sliver_state *state = machine.driver_data<sliver_state>(); UINT32 r,g,b; UINT16 color; if (y < 0 || x < 0 || x > 383 || y > 255) return; addr*=3; b=state->m_colorram[addr] << 2; g=state->m_colorram[addr+1] << 2; r=state->m_colorram[addr+2] << 2; if (state->m_bitmap_fg->bpp == 32) { *BITMAP_ADDR32(state->m_bitmap_fg, y, x) = r | (g<<8) | (b<<16); } else { r>>=3; g>>=3; b>>=3; color = r|(g<<5)|(b<<10); *BITMAP_ADDR16(state->m_bitmap_fg, y, x) = color; } }
static void plot_pixel_pal(int x, int y, int addr) { UINT32 r,g,b; UINT16 color; if(y<0 ||x<0 || x>383 || y> 255) return; addr*=3; b=colorram[addr]<<2; g=colorram[addr+1]<<2; r=colorram[addr+2]<<2; if (sliver_bitmap_fg->bpp == 32) { *BITMAP_ADDR32(sliver_bitmap_fg, y, x) = r | (g<<8) | (b<<16); } else { r>>=3; g>>=3; b>>=3; color = r|(g<<5)|(b<<10); *BITMAP_ADDR16(sliver_bitmap_fg, y, x) = color; } }