示例#1
0
文件: vic.c 项目: martinpiper/VICE
static int init_raster(void)
{
    raster_t *raster;

    raster = &vic.raster;
    video_color_set_canvas(raster->canvas);

    raster->sprite_status = NULL;
    raster_line_changes_init(raster);

    if (raster_init(raster, VIC_NUM_VMODES) < 0)
        return -1;

    update_pixel_tables(raster);

    raster_modes_set_idle_mode(raster->modes, VIC_IDLE_MODE);
    resources_touch("VICVideoCache");

    vic_set_geometry();

    vic_color_update_palette(raster->canvas);

    raster_set_title(raster, machine_name);

    if (raster_realize(raster) < 0)
        return -1;

    raster->display_ystart = vic.first_displayed_line;
    raster->display_ystop = vic.first_displayed_line + 1;
    raster->display_xstart = 0;
    raster->display_xstop = 1;

    return 0;
}
示例#2
0
static int init_raster(void)
{
    raster_t *raster;

    raster = &ted.raster;

    raster->sprite_status = NULL;
    raster_line_changes_init(raster);

    if (raster_init(raster, TED_NUM_VMODES) < 0) {
        return -1;
    }

    raster_modes_set_idle_mode(raster->modes, TED_IDLE_MODE);
    resources_touch("TEDVideoCache");

    ted_set_geometry();

    if (ted_color_update_palette(raster->canvas) < 0) {
        log_error(ted.log, "Cannot load palette.");
        return -1;
    }

    raster_set_title(raster, machine_name);

    if (raster_realize(raster) < 0) {
        return -1;
    }

    raster->display_ystart = raster->display_ystop = -1;
    raster->display_xstart = TED_40COL_START_PIXEL;
    raster->display_xstop = TED_40COL_STOP_PIXEL;

    return 0;
}
示例#3
0
文件: vdc.c 项目: martinpiper/VICE
/* Initialize the VDC emulation. */
raster_t *vdc_init(void)
{
    vdc.initialized = 0;

#ifdef GP2X
    vicii_setup_delay=1;
#endif

    vdc.log = log_open("VDC");

    vdc.raster_draw_alarm = alarm_new(maincpu_alarm_context, "VdcRasterDraw",
                                      vdc_raster_draw_alarm_handler, NULL);

    vdc_powerup();

    if (init_raster() < 0)
        return NULL;

    vdc.force_resize = 0;
    vdc.force_repaint = 0;

    vdc_draw_init();

    vdc.initialized = 1;

    /*vdc_set_geometry();*/
    resources_touch("VDCDoubleSize");

    return &vdc.raster;
}
示例#4
0
文件: vdc.c 项目: martinpiper/VICE
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;
}
示例#5
0
static int set_stretch(int val, void *param)
{
    DBG(("set_stretch"));
    crtc_stretchy = val;
    crtc_update_renderer();
    resources_touch("CrtcDoubleSize");
    return 0;
}
示例#6
0
void iec_drive_idling_method(unsigned int dnr)
{
    char *tmp;

    tmp = lib_msprintf("Drive%iIdleMethod", dnr + 8);

    resources_touch(tmp);

    lib_free(tmp);
}
示例#7
0
文件: crtc.c 项目: SMTDDR/droidsound
void crtc_set_screen_options(int num_cols, int rasterlines)
{
    crtc.screen_width = (num_cols + CRTC_EXTRA_COLS) * 8 + 2 * CRTC_SCREEN_BORDERWIDTH;
    crtc.screen_height = rasterlines + CRTC_EXTRA_RASTERLINES + 2 * CRTC_SCREEN_BORDERHEIGHT;

    DBG(("crtc_set_screen_options: cols=%d, rl=%d -> w=%d, h=%d",
              num_cols, rasterlines, crtc.screen_width, crtc.screen_height));

    crtc_update_window();
    resources_touch("CrtcDoubleSize");

    if (crtc.raster.canvas != NULL) {
        video_viewport_resize(crtc.raster.canvas, 1);
    }
}
示例#8
0
文件: vic.c 项目: martinpiper/VICE
/* Initialization. */
raster_t *vic_init(void)
{
    vic.log = log_open("VIC");

    vic.raster_draw_alarm = alarm_new(maincpu_alarm_context, "VicIRasterDraw",
                                      vic_raster_draw_alarm_handler, NULL);

    clk_guard_add_callback(maincpu_clk_guard, clk_overflow_callback, NULL);

    vic_change_timing();

    if (init_raster() < 0)
        return NULL;

    vic.auxiliary_color = 0;
    vic.mc_border_color = 0;

    vic.color_ptr = mem_ram;
    vic.screen_ptr = mem_ram;
    vic.chargen_ptr = vic20memrom_chargen_rom + 0x400;

    /* FIXME: Where do these values come from? */
    vic.light_pen.triggered = 0;
    vic.light_pen.x = 87;
    vic.light_pen.y = 234;

    /* FIXME */
    vic.char_height = 8;
    vic.row_increase_line = 8;
    vic.text_cols = 22;
    vic.text_lines = 23;

    vic_reset();

    vic_draw_init();

    vic_update_memory_ptrs();

    vic.initialized = 1;

    resources_touch("VICDoubleSize");
    /*vic_resize();*/

    return &vic.raster;
}
示例#9
0
文件: crtc.c 项目: SMTDDR/droidsound
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;
}
示例#10
0
static void uiperipheral_dialog(HWND hwnd)
{
    PROPSHEETPAGE psp[8];
    PROPSHEETHEADER psh;
    int i, no_of_drives, no_of_printers;

    for (i = 0; i < 3; i++ ) {
        printertextdevice[i] = lib_malloc(MAX_PATH);
        strcpy(printertextdevice[i], "");
    }

    no_of_drives = 4;
    no_of_printers = 3;

    if (have_printer_userport < 0) {
        have_printer_userport = (resources_touch("PrinterUserport")) < 0 ? 0 : 1;
    }
    if (have_printer_userport) {
        no_of_printers++;
    }

    for (i = 0; i < no_of_printers; i++) {
        psp[i].dwSize = sizeof(PROPSHEETPAGE);
        psp[i].dwFlags = PSP_USETITLE /*| PSP_HASHELP*/ ;
        psp[i].hInstance = winmain_instance;
#ifdef _ANONYMOUS_UNION
        psp[i].pszTemplate = MAKEINTRESOURCE(IDD_PRINTER_SETTINGS_DIALOG);
        psp[i].pszIcon = NULL;
#else
        psp[i].DUMMYUNIONNAME.pszTemplate
            = MAKEINTRESOURCE(IDD_PRINTER_SETTINGS_DIALOG);
        psp[i].u2.pszIcon = NULL;
#endif
        psp[i].lParam = 0;
        psp[i].pfnCallback = NULL;
    }

    for (i = 0; i < no_of_drives; i++) {
        psp[no_of_printers + i].dwSize = sizeof(PROPSHEETPAGE);
        psp[no_of_printers + i].dwFlags = PSP_USETITLE /*| PSP_HASHELP*/ ;
        psp[no_of_printers + i].hInstance = winmain_instance;
#ifdef _ANONYMOUS_UNION
#ifdef HAVE_OPENCBM
        if (opencbmlib_is_available()) {
            psp[no_of_printers + i].pszTemplate = MAKEINTRESOURCE(IDD_DISKDEVICE_OPENCBM_DIALOG);
        } else
#endif
        {
            psp[no_of_printers + i].pszTemplate = MAKEINTRESOURCE(IDD_DISKDEVICE_DIALOG);
        }
        psp[no_of_printers + i].pszIcon = NULL;
#else
#ifdef HAVE_OPENCBM
        if (opencbmlib_is_available()) {
            psp[no_of_printers + i].DUMMYUNIONNAME.pszTemplate = MAKEINTRESOURCE(IDD_DISKDEVICE_OPENCBM_DIALOG);
        } else 
#endif
        {
            psp[no_of_printers + i].DUMMYUNIONNAME.pszTemplate = MAKEINTRESOURCE(IDD_DISKDEVICE_DIALOG);
        }
        psp[no_of_printers + i].u2.pszIcon = NULL;
#endif
        psp[no_of_printers + i].lParam = 0;
        psp[no_of_printers + i].pfnCallback = NULL;
    }

    if (have_printer_userport) {
        psp[0].pfnDlgProc = callback_0;
        psp[0].pszTitle = translate_text(IDS_PRINTER_USERPORT);
        i = 1;
    } else
        i = 0;

    psp[i + 0].pfnDlgProc = callback_4;
    psp[i + 0].pszTitle = translate_text(IDS_PRINTER_4);
    psp[i + 1].pfnDlgProc = callback_5;
    psp[i + 1].pszTitle = translate_text(IDS_PRINTER_5);
    psp[i + 2].pfnDlgProc = callback_6;
    psp[i + 2].pszTitle = translate_text(IDS_PRINTER_6);
    psp[i + 3].pfnDlgProc = callback_8;
    psp[i + 3].pszTitle = translate_text(IDS_DRIVE_8);
    psp[i + 4].pfnDlgProc = callback_9;
    psp[i + 4].pszTitle = translate_text(IDS_DRIVE_9);
    psp[i + 5].pfnDlgProc = callback_10;
    psp[i + 5].pszTitle = translate_text(IDS_DRIVE_10);
    psp[i + 6].pfnDlgProc = callback_11;
    psp[i + 6].pszTitle = translate_text(IDS_DRIVE_11);

    psh.dwSize = sizeof(PROPSHEETHEADER);
    psh.dwFlags = PSH_PROPSHEETPAGE | PSH_NOAPPLYNOW;
    psh.hwndParent = hwnd;
    psh.hInstance = winmain_instance;
    psh.pszCaption = translate_text(IDS_PERIPHERAL_SETTINGS);
    psh.nPages = no_of_drives + no_of_printers;
#ifdef _ANONYMOUS_UNION
    psh.pszIcon = NULL;
    psh.nStartPage = i + 2;
    psh.ppsp = psp;
#else
    psh.DUMMYUNIONNAME.pszIcon = NULL;
    psh.u2.nStartPage = i + 2;
    psh.u3.ppsp = psp;
#endif
    psh.pfnCallback = NULL;

    PropertySheet(&psh);

    for (i = 0; i < 3; i++) {
        lib_free(printertextdevice[i]);
    }
}