static int init_raster(void) { raster_t *raster; raster = &vdc.raster; raster->sprite_status = NULL; raster_line_changes_init(raster); if (raster_init(raster, VDC_NUM_VMODES) < 0) return -1; raster_modes_set_idle_mode(raster->modes, VDC_IDLE_MODE); resources_touch("VDCVideoCache"); vdc_set_geometry(); video_color_palette_internal(vdc.raster.canvas, &vdc_palette); if (video_color_update_palette(vdc.raster.canvas) < 0) { log_error(vdc.log, "Cannot load palette."); return -1; } raster_set_title(raster, machine_name); if (raster_realize(raster) < 0) return -1; raster->border_color = 0; return 0; }
int ted_color_update_palette(struct video_canvas_s *canvas) { int col,lum,cl; float tedlum; video_cbm_color_t *vc; cl = 0; for (lum = 0; lum < 8; lum++) { tedlum = ted_luminances[lum] * 0.867f; for (col = 0; col < 16; col++) { vc = &ted_colors_with_lum[cl]; if (col) vc->luminance = tedlum; else vc->luminance = 0.0f; vc->angle = ted_colors[col].angle; vc->direction = ted_colors[col].direction; vc->name = ted_colors[col].name; cl++; } } video_color_palette_internal(canvas, &ted_palette); return video_color_update_palette(canvas); }
int crtc_color_update_palette(struct video_canvas_s *canvas) { video_color_palette_internal(canvas, &crtc_palette); return 0; }