From 85dbe449fe94f8cb4d4b88eaa4acbbba2d52b153 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Sun, 4 Nov 2018 22:51:50 -0800 Subject: WIP new VDP plane debug view and support for detached VDP debug views generally --- bindings.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'bindings.c') diff --git a/bindings.c b/bindings.c index 6b45800..8ab1b61 100644 --- a/bindings.c +++ b/bindings.c @@ -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 @@ typedef enum { UI_RELOAD, UI_SMS_PAUSE, UI_SCREENSHOT, - UI_EXIT + UI_EXIT, + UI_PLANE_DEBUG } ui_action; typedef struct { @@ -372,6 +374,20 @@ void handle_binding_up(keybinding * binding) } #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 @@ int parse_binding_target(int device_num, char * target, tern_node * padbuttons, *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; -- cgit v1.2.3