/* init callback for auto-configuration model -- overriding the default init */ static int via_auto_init(struct hda_codec *codec) { via_init(codec); via_auto_init_multi_out(codec); via_auto_init_hp_out(codec); via_auto_init_analog_input(codec); return 0; }
int main (int argc, char **argv) { FILE *vias_file; via_t *via; char *a_via; char *dest; char *res; vias_file = fopen (argv[1], "r"); if (vias_file == NULL) { fprintf (stdout, "Failed to open %s file.\nUsage: tvia vias.txt\n", argv[1]); exit (0); } a_via = (char *) smalloc (200); res = fgets (a_via, 200, vias_file); /* lines are under 200 */ while (res != NULL) { int errcode; /* remove the last '\n' before parsing */ sstrncpy (a_via + strlen (a_via) - 1, "\0", 1); if (0 != strncmp (a_via, "#", 1)) { /* allocate & init via */ via_init (&via); printf ("=================================================\n"); printf ("VIA TO PARSE: |%s|\n", a_via); errcode = via_parse (via, a_via); if (errcode != -1) { if (via_2char (via, &dest) != -1) { printf ("result: |%s|\n", dest); sfree (dest); } } else printf ("Bad via format: %s\n", a_via); via_free (via); sfree (via); printf ("=================================================\n"); } res = fgets (a_via, 200, vias_file); /* lines are under 200 */ } sfree (a_via); return 0; }
/* PET-specific initialization. */ int machine_specific_init(void) { pet_log = log_open("PET"); pet_init_ok = 1; /* used in pet_set_model() */ /* Setup trap handling - must be before mem_load() */ traps_init(); if (mem_load() < 0) { return -1; } log_message(pet_log, "Initializing IEEE488 bus..."); rs232drv_init(); /* initialize print devices */ printer_init(); /* Initialize autostart. FIXME: We could probably use smaller values. */ /* moved to mem_load() as it is kernal-dependant AF 30jun1998 autostart_init(1 * PET_PAL_RFSH_PER_SEC * PET_PAL_CYCLES_PER_RFSH, 0); */ /* Initialize the CRTC emulation. */ if (crtc_init() == NULL) { return -1; } crtc_set_retrace_type(petres.crtc); crtc_set_retrace_callback(pet_crtc_signal); pet_crtc_set_screen(); petcolour_init(); via_init(machine_context.via); pia1_init(); pia2_init(); acia1_init(); #ifndef COMMON_KBD /* Initialize the keyboard. */ if (pet_kbd_init() < 0) { return -1; } #endif /* Initialize the datasette emulation. */ datasette_init(); /* Fire up the hardware-level 1541 emulation. */ drive_init(); pet_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 the sidcart first */ sidcart_sound_chip_init(); /* Initialize native sound chip */ pet_sound_chip_init(); /* Initialize cartridge based sound chips */ userport_dac_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. FIXME: Is this correct? */ /* moved to mem_load() because it's model specific... AF 30jun1998 kbdbuf_init(631, 198, 10, PET_PAL_CYCLES_PER_RFSH * PET_PAL_RFSH_PER_SEC); */ /* Initialize the PET-specific part of the UI. */ petui_init(); /* Initialize the PET Ram and Expansion Unit. */ petreu_init(); /* Initialize the PET Double-W Hi-Res graphics card. */ petdww_init(); /* Initialize the PET Hi-Res Emulator graphics card. */ pethre_init(); petiec_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; }
/* PET-specific initialization. */ int machine_specific_init(void) { pet_log = log_open("PET"); pet_init_ok = 1; /* used in petmodel_set() */ 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(); log_message(pet_log, "Initializing IEEE488 bus..."); rs232drv_init(); /* initialize print devices */ printer_init(); #ifdef USE_BEOS_UI /* Pre-init PET-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+... */ petui_init_early(); #endif /* Initialize the CRTC emulation. */ if (crtc_init() == NULL) { return -1; } crtc_set_retrace_type(petres.crtc); crtc_set_retrace_callback(pet_crtc_signal); pet_crtc_set_screen(); petcolour_init(); via_init(machine_context.via); pia1_init(); pia2_init(); acia1_init(); #ifndef COMMON_KBD /* Initialize the keyboard. */ if (pet_kbd_init() < 0) { return -1; } #endif /* Initialize the datasette emulation. */ datasette_init(); /* Fire up the hardware-level 1541 emulation. */ drive_init(); disk_image_init(); pet_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 the sidcart first */ sidcart_sound_chip_init(); /* Initialize native sound chip */ pet_sound_chip_init(); /* Initialize userport based sound chips */ userport_dac_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. FIXME: Is this correct? */ /* moved to mem_load() because it's model specific... AF 30jun1998 kbdbuf_init(631, 198, 10, PET_PAL_CYCLES_PER_RFSH * PET_PAL_RFSH_PER_SEC); */ /* Initialize the PET-specific part of the UI. */ petui_init(); /* Initialize the PET Ram and Expansion Unit. */ petreu_init(); /* Initialize the PET Double-W Hi-Res graphics card. */ petdww_init(); /* Initialize the PET Hi-Res Emulator graphics card. */ pethre_init(); petiec_init(); #ifdef HAVE_MOUSE /* Initialize mouse support (if present). */ mouse_init(); #endif 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; }