/* * gui_init() * * This is called from the main UAE thread to tell the GUI to initialize. * To indicate failure to initialize, return -1. */ int32_t gui_init (void) { init_comm_pipe (&from_gui_pipe, 8192 /* size */, 1 /* chunks */); uae_sem_init (&gui_sem, 0, 1); gui_initialized = 1; return 0; }
static int32_t start_thread (struct devstruct *dev) { init_comm_pipe (&dev->requests, 100, 1); uae_sem_init (&dev->sync_sem, 0, 0); uae_start_thread (_T("uaeserial"), dev_thread, dev, NULL); uae_sem_wait (&dev->sync_sem); return dev->thread_running; }
void native2amiga_install (void) { if(native2amiga_pending.size != 300) init_comm_pipe (&native2amiga_pending, 300, 2); if(n2asem != 0) uae_sem_destroy(&n2asem); n2asem = 0; uae_sem_init (&n2asem, 0, 1); }
/* We need a thread for this, since communication between finish_sound_buffer * and the callback works through semaphores. In theory, this is unnecessary, * since SDL uses a sound thread internally, and the callback runs in its * context. But we don't want to depend on SDL's internals too much. */ static void init_sound_thread(void) { write_log("init_sound_thread\n"); uae_thread_id tid; init_comm_pipe (&to_sound_pipe, 20, 1); uae_sem_init (&data_available_sem, 0, 0); uae_sem_init (&callback_done_sem, 0, 0); uae_sem_init (&sound_init_sem, 0, 0); uae_start_thread ("Sound", sound_thread, NULL, &tid); }
static int start_thread (struct s2devstruct *dev) { if (dev->thread_running) return 1; init_comm_pipe (&dev->requests, 100, 1); uae_sem_init (&dev->sync_sem, 0, 0); uae_start_thread (SANA2NAME, dev_thread, dev, NULL); uae_sem_wait (&dev->sync_sem); return dev->thread_running; }
/* * Initialize trap mechanism. */ void init_traps(void) { trap_count = 0; if (!trap_thread_id[0] && trap_is_indirect()) { for (int i = 0; i < TRAP_THREADS; i++) { init_comm_pipe(&trap_thread_pipe[i], 100, 1); hardware_trap_kill[i] = 1; uae_start_thread_fast(hardware_trap_thread, (void *)i, &trap_thread_id[i]); } } }
static int start_thread (struct scsidevdata *sdd) { #ifdef UAE_SCSIDEV_THREADS if (sdd->thread_running) return 1; init_comm_pipe (&sdd->requests, 10, 1); uae_sem_init (&sdd->sync_sem, 0, 0); uae_start_thread (scsidev_thread, sdd, &sdd->tid); uae_sem_wait (&sdd->sync_sem); return sdd->thread_running; #else return 1; #endif }
int graphics_setup(void) { #ifdef PICASSO96 picasso_InitResolutions(); InitPicasso96(); #endif VCHI_INSTANCE_T vchi_instance; VCHI_CONNECTION_T *vchi_connection; TV_DISPLAY_STATE_T tvstate; if(vchi_initialise(&vchi_instance) == 0) { if(vchi_connect(NULL, 0, vchi_instance) == 0) { vc_vchi_tv_init(vchi_instance, &vchi_connection, 1); if(vc_tv_get_display_state(&tvstate) == 0) { HDMI_PROPERTY_PARAM_T property; property.property = HDMI_PROPERTY_PIXEL_CLOCK_TYPE; vc_tv_hdmi_get_property(&property); float frame_rate = property.param1 == HDMI_PIXEL_CLOCK_TYPE_NTSC ? tvstate.display.hdmi.frame_rate * (1000.0f/1001.0f) : tvstate.display.hdmi.frame_rate; host_hz = (int)frame_rate; time_per_host_frame = time_for_host_hz_frames / host_hz; } vc_vchi_tv_stop(); vchi_disconnect(vchi_instance); } } if(display_pipe == 0) { display_pipe = xmalloc (smp_comm_pipe, 1); init_comm_pipe(display_pipe, 20, 1); } if(display_sem == 0) { uae_sem_init (&display_sem, 0, 0); } if(display_tid == 0 && display_pipe != 0 && display_sem != 0) { uae_start_thread(_T("render"), display_thread, NULL, &display_tid); } write_comm_pipe_u32(display_pipe, DISPLAY_SIGNAL_SETUP, 1); return 1; }
void native2amiga_install (void) { init_comm_pipe (&native2amiga_pending, 100, 2); uae_sem_init (&n2asem, 0, 1); }
void native2amiga_install (void) { init_comm_pipe (&native2amiga_pending, 10, 2); }