diff bindings.c @ 1631:c4ba3177b72d

WIP new VDP plane debug view and support for detached VDP debug views generally
author Michael Pavone <pavone@retrodev.com>
date Sun, 04 Nov 2018 22:51:50 -0800
parents 18a946ec74c8
children e397766c3028
line wrap: on
line diff
--- a/bindings.c	Sun Nov 04 11:45:41 2018 -0800
+++ b/bindings.c	Sun Nov 04 22:51:50 2018 -0800
@@ -6,6 +6,7 @@
 #include "saves.h"
 #include "util.h"
 #include "genesis.h"
+#include "sms.h"
 #include "menu.h"
 #include "bindings.h"
 #include "controller_info.h"
@@ -35,7 +36,8 @@
 	UI_RELOAD,
 	UI_SMS_PAUSE,
 	UI_SCREENSHOT,
-	UI_EXIT
+	UI_EXIT,
+	UI_PLANE_DEBUG
 } ui_action;
 
 typedef struct {
@@ -372,6 +374,20 @@
 			}
 #endif
 			break;
+		case UI_PLANE_DEBUG: {
+			vdp_context *vdp = NULL;
+			if (current_system->type == SYSTEM_GENESIS) {
+				genesis_context *gen = (genesis_context *)current_system;
+				vdp = gen->vdp;
+			} else if (current_system->type == SYSTEM_SMS) {
+				sms_context *sms = (sms_context *)current_system;
+				vdp = sms->vdp;
+			}
+			if (vdp) {
+				vdp_toggle_debug_view(vdp, VDP_DEBUG_PLANE);
+			}
+			break;
+		}
 		}
 		break;
 	}
@@ -575,6 +591,8 @@
 			*subtype_a = UI_SCREENSHOT;
 		} else if(!strcmp(target + 3, "exit")) {
 			*subtype_a = UI_EXIT;
+		} else if (!strcmp(target + 3, "plane_debug")) {
+			*subtype_a = UI_PLANE_DEBUG;
 		} else {
 			warning("Unreconized UI binding type %s\n", target);
 			return 0;