comparison bindings.c @ 2528:90a40be940f7

Implement read-only SC-3000 cassette support
author Michael Pavone <pavone@retrodev.com>
date Mon, 25 Nov 2024 22:26:45 -0800
parents f8ce89498e11
children f973651b48d7
comparison
equal deleted inserted replaced
2524:25e40370e0e4 2528:90a40be940f7
17 17
18 enum { 18 enum {
19 BIND_NONE, 19 BIND_NONE,
20 BIND_UI, 20 BIND_UI,
21 BIND_GAMEPAD, 21 BIND_GAMEPAD,
22 BIND_MOUSE 22 BIND_MOUSE,
23 BIND_CASSETTE
23 }; 24 };
24 25
25 typedef enum { 26 typedef enum {
26 UI_DEBUG_MODE_INC, 27 UI_DEBUG_MODE_INC,
27 UI_ENTER_DEBUGGER, 28 UI_ENTER_DEBUGGER,
310 } 311 }
311 break; 312 break;
312 case BIND_MOUSE: 313 case BIND_MOUSE:
313 if (allow_content_binds && current_system->mouse_up) { 314 if (allow_content_binds && current_system->mouse_up) {
314 current_system->mouse_up(current_system, binding->subtype_a, binding->subtype_b); 315 current_system->mouse_up(current_system, binding->subtype_a, binding->subtype_b);
316 }
317 break;
318 case BIND_CASSETTE:
319 if (allow_content_binds && current_system->cassette_action) {
320 current_system->cassette_action(current_system, binding->subtype_a);
315 } 321 }
316 break; 322 break;
317 case BIND_UI: 323 case BIND_UI:
318 switch (binding->subtype_a) 324 switch (binding->subtype_a)
319 { 325 {
647 } 653 }
648 } 654 }
649 } else { 655 } else {
650 warning("Gamepad mapping string '%s' refers to an invalid mouse number %c\n", target, target[mouselen]); 656 warning("Gamepad mapping string '%s' refers to an invalid mouse number %c\n", target, target[mouselen]);
651 } 657 }
658 } else if (startswith(target, "cassette.")) {
659 if (!strcmp(target + 9, "play")) {
660 *subtype_a = CASSETTE_PLAY;
661 } else if (!strcmp(target + 9, "record")) {
662 *subtype_a = CASSETTE_RECORD;
663 } else if (!strcmp(target + 9, "stop")) {
664 *subtype_a = CASSETTE_STOP;
665 } else if (!strcmp(target + 9, "rewind")) {
666 *subtype_a = CASSETTE_REWIND;
667 } else {
668 warning("Cassette mapping string '%s' refers to an invalid action\n", target);
669 return BIND_NONE;
670 }
671 return BIND_CASSETTE;
652 } else if(startswith(target, "ui.")) { 672 } else if(startswith(target, "ui.")) {
653 if (!strcmp(target + 3, "vdp_debug_mode")) { 673 if (!strcmp(target + 3, "vdp_debug_mode")) {
654 *subtype_a = UI_DEBUG_MODE_INC; 674 *subtype_a = UI_DEBUG_MODE_INC;
655 } else if(!strcmp(target + 3, "vdp_debug_pal")) { 675 } else if(!strcmp(target + 3, "vdp_debug_pal")) {
656 //legacy binding, ignore 676 //legacy binding, ignore