MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / inputdevice_hsync

Function inputdevice_hsync

src/inputdevice.cpp:4374–4469  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4372}
4373
4374void inputdevice_hsync(bool forceread)
4375{
4376
4377#ifdef CATWEASEL
4378 catweasel_hsync ();
4379#endif
4380
4381 int cnt = 0;
4382 struct delayed_event *de = delayed_events, *prev = NULL;
4383 while (de) {
4384 if (de->delay < 0)
4385 cnt++;
4386 if (de->delay > 0)
4387 de->delay--;
4388 if (de->delay == 0) {
4389 de->delay = -1;
4390 if (de->event_string) {
4391 TCHAR *s = de->event_string;
4392 de->event_string = NULL;
4393 handle_custom_event (s, 0);
4394 xfree (s);
4395 }
4396 }
4397 prev = de;
4398 de = de->next;
4399 }
4400 if (cnt > 4) {
4401 // too many, delete some
4402 struct delayed_event *de_prev = NULL;
4403 de = delayed_events;
4404 while (de) {
4405 if (de->delay < 0 && de != delayed_events) {
4406 struct delayed_event *next = de->next;
4407 de_prev->next = next;
4408 xfree(de->event_string);
4409 xfree(de);
4410 de = next;
4411 } else {
4412 de_prev = de;
4413 de = de->next;
4414 }
4415 }
4416 }
4417
4418 for (int i = 0; i < INPUT_QUEUE_SIZE; i++) {
4419 struct input_queue_struct *iq = &input_queue[i];
4420 if (iq->linecnt > 0) {
4421 iq->linecnt--;
4422 if (iq->linecnt == 0) {
4423 if (iq->state)
4424 iq->state = 0;
4425 else
4426 iq->state = iq->storedstate;
4427 if (iq->custom)
4428 handle_custom_event (iq->custom, 0);
4429 if (iq->evt)
4430 handle_input_event (iq->evt, iq->state, iq->max, HANDLE_IE_FLAG_PLAYBACKEVENT);
4431 iq->linecnt = iq->nextlinecnt;

Callers 2

do_display_sliceFunction · 0.85
hsync_handler_postFunction · 0.85

Calls 10

catweasel_hsyncFunction · 0.85
handle_custom_eventFunction · 0.85
handle_input_eventFunction · 0.85
get_cyclesFunction · 0.85
inputdevice_readFunction · 0.85
inputdevice_playeventsFunction · 0.85
handle_msgpumpFunction · 0.85
maybe_read_inputFunction · 0.85
draco_keyboard_get_rateFunction · 0.85
draco_keycodeFunction · 0.85

Tested by

no test coverage detected