Mercurial > repos > blastem
comparison bindings.c @ 2083:372625dd9590
Persist BRAM to file. Load BIOS relative to blastem directory
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 03 Feb 2022 23:41:53 -0800 |
parents | 81df9aa2de9b |
children | 1270fe86eb89 |
comparison
equal
deleted
inserted
replaced
2082:485834c0fea7 | 2083:372625dd9590 |
---|---|
420 } | 420 } |
421 #ifndef DISABLE_NUKLEAR | 421 #ifndef DISABLE_NUKLEAR |
422 } | 422 } |
423 #endif | 423 #endif |
424 break; | 424 break; |
425 case UI_PLANE_DEBUG: | 425 case UI_PLANE_DEBUG: |
426 case UI_VRAM_DEBUG: | 426 case UI_VRAM_DEBUG: |
427 case UI_CRAM_DEBUG: | 427 case UI_CRAM_DEBUG: |
428 case UI_COMPOSITE_DEBUG: | 428 case UI_COMPOSITE_DEBUG: |
429 if (allow_content_binds) { | 429 if (allow_content_binds) { |
430 vdp_context *vdp = NULL; | 430 vdp_context *vdp = NULL; |
431 if (current_system->type == SYSTEM_GENESIS) { | 431 if (current_system->type == SYSTEM_GENESIS || current_system->type == SYSTEM_SEGACD) { |
432 genesis_context *gen = (genesis_context *)current_system; | 432 genesis_context *gen = (genesis_context *)current_system; |
433 vdp = gen->vdp; | 433 vdp = gen->vdp; |
434 } else if (current_system->type == SYSTEM_SMS) { | 434 } else if (current_system->type == SYSTEM_SMS) { |
435 sms_context *sms = (sms_context *)current_system; | 435 sms_context *sms = (sms_context *)current_system; |
436 vdp = sms->vdp; | 436 vdp = sms->vdp; |
531 if (current_system->mouse_motion_absolute) { | 531 if (current_system->mouse_motion_absolute) { |
532 float scale_x = (render_emulated_width() * 2.0f) / ((float)render_width()); | 532 float scale_x = (render_emulated_width() * 2.0f) / ((float)render_width()); |
533 float scale_y = (render_emulated_height() * 2.0f) / ((float)render_height()); | 533 float scale_y = (render_emulated_height() * 2.0f) / ((float)render_height()); |
534 int32_t adj_x = x * scale_x + 2 * render_overscan_left() - 2 * BORDER_LEFT; | 534 int32_t adj_x = x * scale_x + 2 * render_overscan_left() - 2 * BORDER_LEFT; |
535 int32_t adj_y = y * scale_y + 2 * render_overscan_top() - 4; | 535 int32_t adj_y = y * scale_y + 2 * render_overscan_top() - 4; |
536 | 536 |
537 current_system->mouse_motion_absolute(current_system, target_mouse, adj_x, adj_y); | 537 current_system->mouse_motion_absolute(current_system, target_mouse, adj_x, adj_y); |
538 } | 538 } |
539 break; | 539 break; |
540 } | 540 } |
541 case MOUSE_RELATIVE: { | 541 case MOUSE_RELATIVE: { |
1088 special = tern_insert_int(special, "np.", RENDERKEY_NP_STOP); | 1088 special = tern_insert_int(special, "np.", RENDERKEY_NP_STOP); |
1089 | 1089 |
1090 tern_node *padbuttons = get_pad_buttons(); | 1090 tern_node *padbuttons = get_pad_buttons(); |
1091 | 1091 |
1092 tern_node *mousebuttons = get_mouse_buttons(); | 1092 tern_node *mousebuttons = get_mouse_buttons(); |
1093 | 1093 |
1094 tern_node * keys = tern_find_path(config, "bindings\0keys\0", TVAL_NODE).ptrval; | 1094 tern_node * keys = tern_find_path(config, "bindings\0keys\0", TVAL_NODE).ptrval; |
1095 process_keys(keys, special, padbuttons, mousebuttons, NULL); | 1095 process_keys(keys, special, padbuttons, mousebuttons, NULL); |
1096 tern_free(special); | 1096 tern_free(special); |
1097 | 1097 |
1098 memset(mice, 0, sizeof(mice)); | 1098 memset(mice, 0, sizeof(mice)); |
1099 tern_node * mice = tern_find_path(config, "bindings\0mice\0", TVAL_NODE).ptrval; | 1099 tern_node * mice = tern_find_path(config, "bindings\0mice\0", TVAL_NODE).ptrval; |
1100 if (mice) { | 1100 if (mice) { |
1101 tern_node *buttonmaps[2] = {padbuttons, mousebuttons}; | 1101 tern_node *buttonmaps[2] = {padbuttons, mousebuttons}; |
1102 tern_foreach(mice, process_mouse, buttonmaps); | 1102 tern_foreach(mice, process_mouse, buttonmaps); |