diff options
author | Michael Pavone <pavone@retrodev.com> | 2018-11-14 22:16:35 -0800 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2018-11-14 22:16:35 -0800 |
commit | c4d4fb343ea0c125febe578585b79cf0d3c09a7f (patch) | |
tree | 7cad2ed81248df898a0f4286d28451e84a754ec4 /bindings.c | |
parent | e1a275cbd9a8b620040cf06f24879926dbaf2065 (diff) |
Initial stab at CRAM debug in a detached window
Diffstat (limited to 'bindings.c')
-rw-r--r-- | bindings.c | 35 |
1 files changed, 17 insertions, 18 deletions
@@ -38,7 +38,8 @@ typedef enum { UI_SCREENSHOT, UI_EXIT, UI_PLANE_DEBUG, - UI_VRAM_DEBUG + UI_VRAM_DEBUG, + UI_CRAM_DEBUG, } ui_action; typedef struct { @@ -375,7 +376,9 @@ void handle_binding_up(keybinding * binding) } #endif break; - case UI_PLANE_DEBUG: { + case UI_PLANE_DEBUG: + case UI_VRAM_DEBUG: + case UI_CRAM_DEBUG: { vdp_context *vdp = NULL; if (current_system->type == SYSTEM_GENESIS) { genesis_context *gen = (genesis_context *)current_system; @@ -385,21 +388,15 @@ void handle_binding_up(keybinding * binding) vdp = sms->vdp; } if (vdp) { - vdp_toggle_debug_view(vdp, VDP_DEBUG_PLANE); - } - break; - } - case UI_VRAM_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_VRAM); + uint8_t debug_type; + switch(binding->subtype_a) + { + case UI_PLANE_DEBUG: debug_type = VDP_DEBUG_PLANE; break; + case UI_VRAM_DEBUG: debug_type = VDP_DEBUG_VRAM; break; + case UI_CRAM_DEBUG: debug_type = VDP_DEBUG_CRAM; break; + default: return; + } + vdp_toggle_debug_view(vdp, debug_type); } break; } @@ -610,7 +607,9 @@ int parse_binding_target(int device_num, char * target, tern_node * padbuttons, *subtype_a = UI_PLANE_DEBUG; } else if (!strcmp(target + 3, "vram_debug")) { *subtype_a = UI_VRAM_DEBUG; - } else { + } else if (!strcmp(target + 3, "cram_debug")) { + *subtype_a = UI_CRAM_DEBUG; + } else { warning("Unreconized UI binding type %s\n", target); return 0; } |