diff bindings.c @ 2243:0d1d5dccdd28

Initial implementation of oscilloscope debug view
author Michael Pavone <pavone@retrodev.com>
date Tue, 22 Nov 2022 17:57:02 -0800
parents 0c723b8b637c
children 3ef80963c2a7
line wrap: on
line diff
--- a/bindings.c	Wed Sep 21 23:16:39 2022 -0700
+++ b/bindings.c	Tue Nov 22 17:57:02 2022 -0800
@@ -42,7 +42,8 @@
 	UI_PLANE_DEBUG,
 	UI_VRAM_DEBUG,
 	UI_CRAM_DEBUG,
-	UI_COMPOSITE_DEBUG
+	UI_COMPOSITE_DEBUG,
+	UI_OSCILLOSCOPE_DEBUG,
 } ui_action;
 
 typedef struct {
@@ -432,7 +433,10 @@
 		case UI_VRAM_DEBUG:
 		case UI_CRAM_DEBUG:
 		case UI_COMPOSITE_DEBUG:
-			if (allow_content_binds) {
+		case UI_OSCILLOSCOPE_DEBUG:
+			if (allow_content_binds && current_system->toggle_debug_view) {
+				current_system->toggle_debug_view(current_system, binding->subtype_a - UI_PLANE_DEBUG + DEBUG_PLANE);
+				/*
 				vdp_context *vdp = NULL;
 				if (current_system->type == SYSTEM_GENESIS || current_system->type == SYSTEM_SEGACD) {
 					genesis_context *gen = (genesis_context *)current_system;
@@ -452,7 +456,7 @@
 					default: return;
 					}
 					vdp_toggle_debug_view(vdp, debug_type);
-				}
+				}*/
 				break;
 			}
 		}
@@ -671,6 +675,8 @@
 			*subtype_a = UI_CRAM_DEBUG;
 		} else if (!strcmp(target + 3, "compositing_debug")) {
 			*subtype_a = UI_COMPOSITE_DEBUG;
+		} else if (!strcmp(target + 3, "oscilloscope")) {
+			*subtype_a = UI_OSCILLOSCOPE_DEBUG;
 		} else {
 			warning("Unreconized UI binding type %s\n", target);
 			return 0;