static void tdfever_draw_bg(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int xscroll, int yscroll ) { const UINT8 *source = snk_rambase + 0x000; const gfx_element *gfx = machine->gfx[1]; int tile_number, attributes, color, sx, sy; int offs, x, y; for(x = 0; x < 32; x++) for(y = 0; y < 32; y++) { offs = (x<<6)+(y<<1); tile_number = source[offs]; attributes = source[offs+1]; tile_number |= (attributes & 0xf) << 8; color = attributes >> 4; sx = x << 4; sy = y << 4; // intercept overflown tile indices if(tile_number >= gfx->total_elements) plot_box(tmpbitmap, sx, sy, gfx->width, gfx->height, get_black_pen(machine)); else drawgfx(tmpbitmap,gfx,tile_number,color,0,0,sx,sy,0,TRANSPARENCY_NONE,0); } copyscrollbitmap(bitmap,tmpbitmap,1,&xscroll,1,&yscroll,cliprect); }
static void draw_led(bitmap_t *bitmap, int x, int y,UINT8 value) { plot_box(bitmap, x, y, 6, 10, 0x00000000); /*a*/ *BITMAP_ADDR16(bitmap, y+0, x+1) = ((value & 0x01) ? LED_ON : LED_OFF); *BITMAP_ADDR16(bitmap, y+0, x+2) = ((value & 0x01) ? LED_ON : LED_OFF); *BITMAP_ADDR16(bitmap, y+0, x+3) = ((value & 0x01) ? LED_ON : LED_OFF); /*b*/ *BITMAP_ADDR16(bitmap, y+1, x+4) = ((value & 0x02) ? LED_ON : LED_OFF); *BITMAP_ADDR16(bitmap, y+2, x+4) = ((value & 0x02) ? LED_ON : LED_OFF); *BITMAP_ADDR16(bitmap, y+3, x+4) = ((value & 0x02) ? LED_ON : LED_OFF); /*c*/ *BITMAP_ADDR16(bitmap, y+5, x+4) = ((value & 0x04) ? LED_ON : LED_OFF); *BITMAP_ADDR16(bitmap, y+6, x+4) = ((value & 0x04) ? LED_ON : LED_OFF); *BITMAP_ADDR16(bitmap, y+7, x+4) = ((value & 0x04) ? LED_ON : LED_OFF); /*d*/ *BITMAP_ADDR16(bitmap, y+8, x+1) = ((value & 0x08) ? LED_ON : LED_OFF); *BITMAP_ADDR16(bitmap, y+8, x+2) = ((value & 0x08) ? LED_ON : LED_OFF); *BITMAP_ADDR16(bitmap, y+8, x+3) = ((value & 0x08) ? LED_ON : LED_OFF); /*e*/ *BITMAP_ADDR16(bitmap, y+5, x+0) = ((value & 0x10) ? LED_ON : LED_OFF); *BITMAP_ADDR16(bitmap, y+6, x+0) = ((value & 0x10) ? LED_ON : LED_OFF); *BITMAP_ADDR16(bitmap, y+7, x+0) = ((value & 0x10) ? LED_ON : LED_OFF); /*f*/ *BITMAP_ADDR16(bitmap, y+1, x+0) = ((value & 0x20) ? LED_ON : LED_OFF); *BITMAP_ADDR16(bitmap, y+2, x+0) = ((value & 0x20) ? LED_ON : LED_OFF); *BITMAP_ADDR16(bitmap, y+3, x+0) = ((value & 0x20) ? LED_ON : LED_OFF); /*g*/ *BITMAP_ADDR16(bitmap, y+4, x+1) = ((value & 0x40) ? LED_ON : LED_OFF); *BITMAP_ADDR16(bitmap, y+4, x+2) = ((value & 0x40) ? LED_ON : LED_OFF); *BITMAP_ADDR16(bitmap, y+4, x+3) = ((value & 0x40) ? LED_ON : LED_OFF); /*"point" (just for debugging)*/ *BITMAP_ADDR16(bitmap, y+9, x+4) = ((value & 0x80) ? LED_ON : LED_OFF); }
/* draw the operator control panel (fixed backdrop) */ static void pdp1_draw_panel_backdrop(mame_bitmap *bitmap) { /* fill with black */ fillbitmap(panel_bitmap, Machine->pens[pen_panel_bg], &panel_bitmap_bounds); /* column 1: registers, test word, test address */ pdp1_draw_string(bitmap, "program counter", x_panel_col1_offset, y_panel_pc_offset, color_panel_caption); pdp1_draw_string(bitmap, "memory address", x_panel_col1_offset, y_panel_ma_offset, color_panel_caption); pdp1_draw_string(bitmap, "memory buffer", x_panel_col1_offset, y_panel_mb_offset, color_panel_caption); pdp1_draw_string(bitmap, "accumulator", x_panel_col1_offset, y_panel_ac_offset, color_panel_caption); pdp1_draw_string(bitmap, "in-out", x_panel_col1_offset, y_panel_io_offset, color_panel_caption); pdp1_draw_string(bitmap, "extend address", x_panel_col1_offset-8, y_panel_ta_offset, color_panel_caption); pdp1_draw_string(bitmap, "test word", x_panel_col1_offset, y_panel_tw_offset, color_panel_caption); /* column separator */ plot_box(bitmap, x_panel_col2_offset-4, panel_window_offset_y+8, 1, 96, pen_panel_caption); /* column 2: 1-bit indicators */ pdp1_draw_string(bitmap, "run", x_panel_col2_offset+8, y_panel_run_offset, color_panel_caption); pdp1_draw_string(bitmap, "cycle", x_panel_col2_offset+8, y_panel_cyc_offset, color_panel_caption); pdp1_draw_string(bitmap, "defer", x_panel_col2_offset+8, y_panel_defer_offset, color_panel_caption); pdp1_draw_string(bitmap, "h. s. cycle", x_panel_col2_offset+8, y_panel_hs_cyc_offset, color_panel_caption); pdp1_draw_string(bitmap, "brk. ctr. 1", x_panel_col2_offset+8, y_panel_brk_ctr_1_offset, color_panel_caption); pdp1_draw_string(bitmap, "brk. ctr. 2", x_panel_col2_offset+8, y_panel_brk_ctr_2_offset, color_panel_caption); pdp1_draw_string(bitmap, "overflow", x_panel_col2_offset+8, y_panel_ov_offset, color_panel_caption); pdp1_draw_string(bitmap, "read in", x_panel_col2_offset+8, y_panel_rim_offset, color_panel_caption); pdp1_draw_string(bitmap, "seq. break", x_panel_col2_offset+8, y_panel_sbm_offset, color_panel_caption); pdp1_draw_string(bitmap, "extend", x_panel_col2_offset+8, y_panel_exd_offset, color_panel_caption); pdp1_draw_string(bitmap, "i-o halt", x_panel_col2_offset+8, y_panel_ioh_offset, color_panel_caption); pdp1_draw_string(bitmap, "i-o com'ds", x_panel_col2_offset+8, y_panel_ioc_offset, color_panel_caption); pdp1_draw_string(bitmap, "i-o sync", x_panel_col2_offset+8, y_panel_ios_offset, color_panel_caption); /* column separator */ plot_box(bitmap, x_panel_col3_offset-4, panel_window_offset_y+8, 1, 96, pen_panel_caption); /* column 3: power, single step, single inst, sense, flags, instr... */ pdp1_draw_string(bitmap, "power", x_panel_col3_offset+16, y_panel_power_offset, color_panel_caption); pdp1_draw_string(bitmap, "single step", x_panel_col3_offset+16, y_panel_sngl_step_offset, color_panel_caption); pdp1_draw_string(bitmap, "single inst.", x_panel_col3_offset+16, y_panel_sngl_inst_offset, color_panel_caption); /* separator */ plot_box(bitmap, x_panel_col3_offset+8, y_panel_sep1_offset+4, 96, 1, pen_panel_caption); pdp1_draw_string(bitmap, "sense switches", x_panel_col3_offset, y_panel_ss_offset, color_panel_caption); /* separator */ plot_box(bitmap, x_panel_col3_offset+8, y_panel_sep2_offset+4, 96, 1, pen_panel_caption); pdp1_draw_string(bitmap, "program flags", x_panel_col3_offset, y_panel_pf_offset, color_panel_caption); pdp1_draw_string(bitmap, "instruction", x_panel_col3_offset, y_panel_ir_offset, color_panel_caption); }
void draw_16seg(mame_bitmap *bitmap,int x,int y,int vfd, int col_on, int col_off ) { int cursor; int i; for (cursor = 0; cursor < 16; cursor++) { plot_box(bitmap, x+(7*cursor), y+1, 1, 9.5, (vfd_get_segments(vfd)[cursor] & 0x0001) ? col_on : col_off);/*0 */ plot_box(bitmap, x+4+(7*cursor), y+1, 1, 9.5, (vfd_get_segments(vfd)[cursor] & 0x0002) ? col_on : col_off);/*1 */ plot_box(bitmap, x+(7*cursor), y, 4, 1, (vfd_get_segments(vfd)[cursor] & 0x0004) ? col_on : col_off);/*2 */ plot_box(bitmap, x+2+(7*cursor), y+1, 1, 9.5, (vfd_get_segments(vfd)[cursor] & 0x0008) ? col_on : col_off);/*3 */ plot_box(bitmap, x+4+(7*cursor), y+10.5, 1, 9.5, (vfd_get_segments(vfd)[cursor] & 0x0020) ? col_on : col_off);/*5 */ for (i = 0; i < 11; i++) { plot_box(bitmap, x+0+(i/5)+(7*cursor), y+20-(i*0.95), 1, 1, (vfd_get_segments(vfd)[cursor] & 0x0010) ? col_on : col_off);/*4 */ plot_box(bitmap, x+2-(i/5)+(7*cursor), y+10.5-(i*0.95), 1, 1, (vfd_get_segments(vfd)[cursor] & 0x0040) ? col_on : col_off);/*6 */ plot_box(bitmap, x+2+(i/5)+(7*cursor), y+10.5-(i*0.95), 1, 1, (vfd_get_segments(vfd)[cursor] & 0x0080) ? col_on : col_off);/*7 */ plot_box(bitmap, x+4-(i/5)+(7*cursor), y+20-(i*0.95), 1, 1, (vfd_get_segments(vfd)[cursor] & 0x0800) ? col_on : col_off);/*11 */ } plot_box(bitmap, x+(7*cursor), y+20, 4, 1, (vfd_get_segments(vfd)[cursor] & 0x0200) ? col_on : col_off);/*8 */ plot_box(bitmap, x+2+(7*cursor), y+11.5, 1, 9.5, (vfd_get_segments(vfd)[cursor] & 0x0400) ? col_on : col_off);/*10 */ plot_box(bitmap, x+5+(7*cursor), y+18, 1, 3, (vfd_get_segments(vfd)[cursor] & 0x1000) ? col_on : col_off);/*12 */ plot_box(bitmap, x+6+(7*cursor), y+19, 1, 3, (vfd_get_segments(vfd)[cursor] & 0x1000) ? col_on : col_off);/*12 */ plot_box(bitmap, x+7+(7*cursor), y+22, 1, 1, (vfd_get_segments(vfd)[cursor] & 0x1000) ? col_on : col_off);/*12 */ plot_box(bitmap, x+(7*cursor), y+10.5, 1, 9.5, (vfd_get_segments(vfd)[cursor] & 0x2000) ? col_on : col_off);/*13 */ plot_box(bitmap, x+2+(7*cursor), y+10.5, 2, 1, (vfd_get_segments(vfd)[cursor] & 0x4000) ? col_on : col_off);/*14 */ plot_box(bitmap, x+(7*cursor), y+10.5, 2, 1, (vfd_get_segments(vfd)[cursor] & 0x8000) ? col_on : col_off);/*15 */ if (vfd_get_segments(vfd)[cursor] & 0x0100) { /*activate flashing (unimplemented) */ } else { /*deactivate flashing (unimplemented) */ } } }
void draw_16seg(mame_bitmap *bitmap,int x,int y,int vfd, int col_on, int col_off ) { int cursor; int i; for (cursor = 0; cursor < 16; cursor++) { plot_box(bitmap, x+(7*cursor), y+1, 1, 9.5, (vfd_get_segments(vfd)[cursor] & 0x0001) ? col_on : col_off);//0 plot_box(bitmap, x+4+(7*cursor), y+1, 1, 9.5, (vfd_get_segments(vfd)[cursor] & 0x0002) ? col_on : col_off);//1 plot_box(bitmap, x+(7*cursor), y, 4, 1, (vfd_get_segments(vfd)[cursor] & 0x0004) ? col_on : col_off);//2 plot_box(bitmap, x+2+(7*cursor), y+1, 1, 9.5, (vfd_get_segments(vfd)[cursor] & 0x0008) ? col_on : col_off);//3 plot_box(bitmap, x+4+(7*cursor), y+10.5, 1, 9.5, (vfd_get_segments(vfd)[cursor] & 0x0020) ? col_on : col_off);//5 for (i = 0; i < 11; i++) { plot_box(bitmap, x+0+(i/5)+(7*cursor), y+20-(i*0.95), 1, 1, (vfd_get_segments(vfd)[cursor] & 0x0010) ? col_on : col_off);//4 plot_box(bitmap, x+2-(i/5)+(7*cursor), y+10.5-(i*0.95), 1, 1, (vfd_get_segments(vfd)[cursor] & 0x0040) ? col_on : col_off);//6 plot_box(bitmap, x+2+(i/5)+(7*cursor), y+10.5-(i*0.95), 1, 1, (vfd_get_segments(vfd)[cursor] & 0x0080) ? col_on : col_off);//7 plot_box(bitmap, x+4-(i/5)+(7*cursor), y+20-(i*0.95), 1, 1, (vfd_get_segments(vfd)[cursor] & 0x0800) ? col_on : col_off);//11 } plot_box(bitmap, x+(7*cursor), y+20, 4, 1, (vfd_get_segments(vfd)[cursor] & 0x0200) ? col_on : col_off);//8 plot_box(bitmap, x+2+(7*cursor), y+11.5, 1, 9.5, (vfd_get_segments(vfd)[cursor] & 0x0400) ? col_on : col_off);//10 plot_box(bitmap, x+5+(7*cursor), y+18, 1, 3, (vfd_get_segments(vfd)[cursor] & 0x1000) ? col_on : col_off);//12 plot_box(bitmap, x+6+(7*cursor), y+19, 1, 3, (vfd_get_segments(vfd)[cursor] & 0x1000) ? col_on : col_off);//12 plot_box(bitmap, x+7+(7*cursor), y+22, 1, 1, (vfd_get_segments(vfd)[cursor] & 0x1000) ? col_on : col_off);//12 plot_box(bitmap, x+(7*cursor), y+10.5, 1, 9.5, (vfd_get_segments(vfd)[cursor] & 0x2000) ? col_on : col_off);//13 plot_box(bitmap, x+2+(7*cursor), y+10.5, 2, 1, (vfd_get_segments(vfd)[cursor] & 0x4000) ? col_on : col_off);//14 plot_box(bitmap, x+(7*cursor), y+10.5, 2, 1, (vfd_get_segments(vfd)[cursor] & 0x8000) ? col_on : col_off);//15 if (vfd_get_segments(vfd)[cursor] & 0x0100) { //activate flashing (unimplemented) } else { //deactivate flashing (unimplemented) } } }