/* CBM-II-specific initialization. */ int machine_specific_init(void) { cbm2_log = log_open("CBM2"); cbm2_init_ok = 1; event_init(); /* Setup trap handling - must be before mem_load() */ traps_init(); if (mem_load() < 0) { return -1; } if (!video_disabled_mode) { joystick_init(); } gfxoutput_init(); rs232drv_init(); /* initialize print devices */ printer_init(); if (vicii_init(VICII_STANDARD) == NULL) { return -1; } /* c500_set_phi1_bank(15); c500_set_phi2_bank(15); */ c500_powerline_clk_alarm = alarm_new(maincpu_alarm_context, "C500PowerlineClk", c500_powerline_clk_alarm_handler, NULL); clk_guard_add_callback(maincpu_clk_guard, c500_powerline_clk_overflow_callback, NULL); machine_timing.cycles_per_sec = C500_PAL_CYCLES_PER_SEC; machine_timing.rfsh_per_sec = C500_PAL_RFSH_PER_SEC; machine_timing.cycles_per_rfsh = C500_PAL_CYCLES_PER_RFSH; cia1_init(machine_context.cia1); acia1_init(); tpi1_init(machine_context.tpi1); tpi2_init(machine_context.tpi2); #ifndef COMMON_KBD /* Initialize the keyboard. */ if (cbm2_kbd_init() < 0) { return -1; } #endif /* Initialize the datasette emulation. */ datasette_init(); /* Fire up the hardware-level 1541 emulation. */ drive_init(); disk_image_init(); cbm2_monitor_init(); /* Initialize vsync and register our hook function. */ vsync_init(machine_vsync_hook); vsync_set_machine_parameter(machine_timing.rfsh_per_sec, machine_timing.cycles_per_sec); /* Initialize native sound chip */ sid_sound_chip_init(); drive_sound_init(); video_sound_init(); /* Initialize sound. Notice that this does not really open the audio device yet. */ sound_init(machine_timing.cycles_per_sec, machine_timing.cycles_per_rfsh); /* Initialize keyboard buffer. This appears to work but doesn't account for banking. */ kbdbuf_init(939, 209, 10, (CLOCK)(machine_timing.rfsh_per_sec * machine_timing.cycles_per_rfsh)); /* Initialize the CBM-II-specific part of the UI. */ cbm5x0ui_init(); cbm2iec_init(); machine_drive_stub(); #if defined (USE_XF86_EXTENSIONS) && (defined(USE_XF86_VIDMODE_EXT) || defined (HAVE_XRANDR)) { /* set fullscreen if user used `-fullscreen' on cmdline */ int fs; resources_get_int("UseFullscreen", &fs); if (fs) { resources_set_int("VICIIFullscreen", 1); } } #endif return 0; }
/* CBM-II-specific initialization. */ int machine_specific_init(void) { cbm2_log = log_open("CBM2"); cbm2_init_ok = 1; /* Setup trap handling - must be before mem_load() */ traps_init(); if (mem_load() < 0) { return -1; } rs232drv_init(); /* initialize print devices */ printer_init(); if (crtc_init() == NULL) { return -1; } crtc_set_retrace_callback(cbm2_crtc_signal); crtc_set_retrace_type(0); crtc_set_hw_options(1, 0x7ff, 0x1000, 512, -0x2000); cia1_init(machine_context.cia1); acia1_init(); tpi1_init(machine_context.tpi1); tpi2_init(machine_context.tpi2); #ifndef COMMON_KBD /* Initialize the keyboard. */ if (cbm2_kbd_init() < 0) { return -1; } #endif /* Initialize the datasette emulation. */ datasette_init(); /* Fire up the hardware-level 1541 emulation. */ drive_init(); cbm2_monitor_init(); /* Initialize vsync and register our hook function. */ vsync_init(machine_vsync_hook); vsync_set_machine_parameter(machine_timing.rfsh_per_sec, machine_timing.cycles_per_sec); /* Initialize native sound chip */ sid_sound_chip_init(); drive_sound_init(); video_sound_init(); /* Initialize sound. Notice that this does not really open the audio device yet. */ sound_init(machine_timing.cycles_per_sec, machine_timing.cycles_per_rfsh); /* Initialize keyboard buffer. This appears to work but doesn't account for banking. */ kbdbuf_init(939, 209, 10, (CLOCK)(machine_timing.rfsh_per_sec * machine_timing.cycles_per_rfsh)); /* Initialize the CBM-II-specific part of the UI. */ cbm2ui_init(); cbm2iec_init(); machine_drive_stub(); #if defined (USE_XF86_EXTENSIONS) && \ (defined(USE_XF86_VIDMODE_EXT) || defined (HAVE_XRANDR)) { /* set fullscreen if user used `-fullscreen' on cmdline */ int fs; resources_get_int("UseFullscreen", &fs); if (fs) { resources_set_int("CRTCFullscreen", 1); } } #endif return 0; }
/* CBM-II-specific initialization. */ int machine_specific_init(void) { cbm2_log = log_open("CBM2"); cbm2_init_ok = 1; event_init(); /* Setup trap handling - must be before mem_load() */ traps_init(); if (mem_load() < 0) { return -1; } if (!video_disabled_mode) { joystick_init(); } gfxoutput_init(); rs232drv_init(); /* initialize print devices */ printer_init(); #ifdef USE_BEOS_UI /* Pre-init CBM-II-specific parts of the menus before crtc_init() creates a canvas window with a menubar at the top. This could also be used by other ports, e.g. GTK+... */ cbm2ui_init_early(); #endif if (crtc_init() == NULL) { return -1; } crtc_set_retrace_callback(cbm2_crtc_signal); crtc_set_retrace_type(0); crtc_set_hw_options(1, 0x7ff, 0x1000, 512, -0x2000); cia1_init(machine_context.cia1); acia1_init(); tpi1_init(machine_context.tpi1); tpi2_init(machine_context.tpi2); #ifndef COMMON_KBD /* Initialize the keyboard. */ if (cbm2_kbd_init() < 0) { return -1; } #endif /* Initialize the datasette emulation. */ datasette_init(); /* Fire up the hardware-level 1541 emulation. */ drive_init(); disk_image_init(); cbm2_monitor_init(); /* Initialize vsync and register our hook function. */ vsync_init(machine_vsync_hook); vsync_set_machine_parameter(machine_timing.rfsh_per_sec, machine_timing.cycles_per_sec); /* Initialize native sound chip */ sid_sound_chip_init(); /* Initialize userport based sound chips */ userport_dac_sound_chip_init(); userport_digimax_sound_chip_init(); drive_sound_init(); video_sound_init(); /* Initialize sound. Notice that this does not really open the audio device yet. */ sound_init(machine_timing.cycles_per_sec, machine_timing.cycles_per_rfsh); /* Initialize keyboard buffer. This appears to work but doesn't account for banking. */ kbdbuf_init(939, 209, 10, (CLOCK)(machine_timing.rfsh_per_sec * machine_timing.cycles_per_rfsh)); /* Initialize the CBM-II-specific part of the UI. */ cbm2ui_init(); cbm2iec_init(); #ifdef HAVE_MOUSE /* Initialize mouse support (if present). */ mouse_init(); #endif machine_drive_stub(); /* Initialize the CBM2-specific I/O */ cbm2io_init(); #if defined (USE_XF86_EXTENSIONS) && (defined(USE_XF86_VIDMODE_EXT) || defined (HAVE_XRANDR)) { /* set fullscreen if user used `-fullscreen' on cmdline */ int fs; resources_get_int("UseFullscreen", &fs); if (fs) { resources_set_int("CRTCFullscreen", 1); } } #endif return 0; }
/* CBM-II-specific initialization. */ int machine_specific_init(void) { cbm2_log = log_open("CBM2"); cbm2_init_ok = 1; /* Setup trap handling - must be before mem_load() */ traps_init(); if (mem_load() < 0) return -1; rs232drv_init(); /* initialize print devices */ printer_init(); if (!cbm2_isC500) { if (crtc_init() == NULL) return -1; crtc_set_retrace_callback(cbm2_crtc_signal); crtc_set_retrace_type(0); crtc_set_hw_options(1, 0x7ff, 0x1000, 512, -0x2000); } else { if (vicii_init(VICII_STANDARD) == NULL) return -1; /* c500_set_phi1_bank(15); c500_set_phi2_bank(15); */ c500_powerline_clk_alarm = alarm_new(maincpu_alarm_context, "C500PowerlineClk", c500_powerline_clk_alarm_handler, NULL); clk_guard_add_callback(maincpu_clk_guard, c500_powerline_clk_overflow_callback, NULL); machine_timing.cycles_per_sec = C500_PAL_CYCLES_PER_SEC; machine_timing.rfsh_per_sec = C500_PAL_RFSH_PER_SEC; machine_timing.cycles_per_rfsh = C500_PAL_CYCLES_PER_RFSH; } cia1_init(machine_context.cia1); acia1_init(); tpi1_init(machine_context.tpi1); tpi2_init(machine_context.tpi2); #ifndef COMMON_KBD /* Initialize the keyboard. */ if (cbm2_kbd_init() < 0) return -1; #endif /* Initialize the datasette emulation. */ datasette_init(); /* Fire up the hardware-level 1541 emulation. */ drive_init(); cbm2_monitor_init(); /* Initialize vsync and register our hook function. */ vsync_init(machine_vsync_hook); vsync_set_machine_parameter(machine_timing.rfsh_per_sec, machine_timing.cycles_per_sec); /* Initialize sound. Notice that this does not really open the audio device yet. */ sound_init(machine_timing.cycles_per_sec, machine_timing.cycles_per_rfsh); /* Initialize the CBM-II-specific part of the UI. */ cbm2ui_init(); cbm2iec_init(); machine_drive_stub(); return 0; }