/** * Parse a string for a crtc. * \param crtc Crtc to write. * \param begin Start of the string to parse. * \param end End of the string to parse. * \return * - ==0 on success * - !=0 on error */ adv_error crtc_parse(adv_crtc* crtc, const char* begin, const char* end) { crtc_reset(crtc); crtc_user_reset(crtc); parse_separator(" \t", &begin, end); if (begin != end && *begin == '"') { if (parse_quote(crtc->name, CRTC_NAME_MAX, &begin, end)) return -1; } else { if (parse_token(crtc->name, CRTC_NAME_MAX, " \t", &begin, end)) return -1; } parse_separator(" \t", &begin, end); if (begin == end) { snprintf(video_mode_parse_error_buffer, sizeof(video_mode_parse_error_buffer), "Missing modeline data"); return -1; } if (parse_crtc(crtc, begin, end) != 0) return -1; return 0; }
/* CBM-II-specific initialization. */ void machine_specific_reset(void) { ciacore_reset(machine_context.cia1); tpicore_reset(machine_context.tpi1); tpicore_reset(machine_context.tpi2); acia1_reset(); sid_reset(); if (!cbm2_isC500) { crtc_reset(); } else { c500_powerline_clk = maincpu_clk + C500_POWERLINE_CYCLES_PER_IRQ; alarm_set(c500_powerline_clk_alarm, c500_powerline_clk); vicii_reset(); } printer_reset(); rs232drv_reset(); drive_reset(); datasette_reset(); mem_reset(); }
/* PET-specific initialization. */ void machine_specific_reset(void) { pia1_reset(); pia2_reset(); viacore_reset(machine_context.via); acia1_reset(); crtc_reset(); sid_reset(); petmem_reset(); rs232drv_reset(); printer_reset(); drive_reset(); datasette_reset(); petreu_reset(); petdww_reset(); pethre_reset(); }
/* CBM-II-specific initialization. */ void machine_specific_reset(void) { ciacore_reset(machine_context.cia1); tpicore_reset(machine_context.tpi1); tpicore_reset(machine_context.tpi2); acia1_reset(); sid_reset(); crtc_reset(); printer_reset(); rs232drv_reset(); drive_reset(); datasette_reset(); mem_reset(); }
void main_reset() { m6502_reset(); crtc_reset(); video_reset(); sysvia_reset(); uservia_reset(); serial_reset(); acia_reset(&sysacia); wd1770_reset(); i8271_reset(); scsi_reset(); vdfs_reset(); sid_reset(); music4000_reset(); music5000_reset(); sn_init(); if (curtube != -1) tubes[curtube].reset(); else tube_exec = NULL; tube_reset(); memset(ram, 0, 64 * 1024); }
raster_t *crtc_init(void) { raster_t *raster; DBG(("crtc_init")); crtc.log = log_open("CRTC"); crtc.raster_draw_alarm = alarm_new(maincpu_alarm_context, "CrtcRasterDraw", crtc_raster_draw_alarm_handler, NULL); clk_guard_add_callback(maincpu_clk_guard, clk_overflow_callback, NULL); raster = &crtc.raster; raster->sprite_status = NULL; raster_line_changes_init(raster); if (raster_init(raster, CRTC_NUM_VMODES) < 0) { return NULL; } raster_modes_set_idle_mode(raster->modes, CRTC_IDLE_MODE); resources_touch("CrtcVideoCache"); if (crtc_color_update_palette(raster->canvas) < 0) { log_error(crtc.log, "Cannot load palette."); return NULL; } if (!crtc.regs[0]) crtc.regs[0] = 49; if (!crtc.regs[1]) crtc.regs[1] = 40; if (!crtc.regs[2]) crtc.regs[2] = 45; if (!crtc.regs[4]) crtc.regs[4] = 30; if (!crtc.regs[6]) crtc.regs[6] = 25; if (!crtc.regs[9]) crtc.regs[9] = 7; /* FIXME */ crtc.screen_xoffset = 0; crtc.screen_yoffset = CRTC_SCREEN_BORDERHEIGHT; crtc.retrace_callback = NULL; crtc.hires_draw_callback = NULL; #if 0 log_debug("scr_width=%d, scr_height=%d", crtc.screen_width, crtc.screen_height); log_debug("tcols=%d, tlines=%d, bwidth=%d, bheight=%d", CRTC_SCREEN_TEXTCOLS(), CRTC_SCREEN_TEXTLINES(), CRTC_SCREEN_BORDERWIDTH, CRTC_SCREEN_BORDERHEIGHT); log_debug("displayed lines: first=%d, last=%d", CRTC_FIRST_DISPLAYED_LINE, CRTC_LAST_DISPLAYED_LINE); #endif crtc.initialized = 1; crtc_update_window(); raster_set_title(raster, machine_name); if (raster_realize(raster) < 0) { return NULL; } crtc_update_chargen_rel(); crtc_update_disp_char(); crtc_reset_screen_ptr(); crtc_draw_init(); crtc_reset(); /* raster->display_ystart = CRTC_SCREEN_BORDERHEIGHT; raster->display_ystop = crtc.screen_height - 2 * CRTC_SCREEN_BORDERHEIGHT; raster->display_xstart = CRTC_SCREEN_BORDERWIDTH; raster->display_xstop = crtc.screen_width - 2 * CRTC_SCREEN_BORDERWIDTH; */ resources_touch("CrtcDoubleSize"); return &crtc.raster; }