Mercurial > repos > blastem
comparison bindings.c @ 1638:f27142c48567
Initial stab at CRAM debug in a detached window
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 14 Nov 2018 22:16:35 -0800 |
parents | e397766c3028 |
children | bc9bb4e5856f |
comparison
equal
deleted
inserted
replaced
1637:95880d947257 | 1638:f27142c48567 |
---|---|
36 UI_RELOAD, | 36 UI_RELOAD, |
37 UI_SMS_PAUSE, | 37 UI_SMS_PAUSE, |
38 UI_SCREENSHOT, | 38 UI_SCREENSHOT, |
39 UI_EXIT, | 39 UI_EXIT, |
40 UI_PLANE_DEBUG, | 40 UI_PLANE_DEBUG, |
41 UI_VRAM_DEBUG | 41 UI_VRAM_DEBUG, |
42 UI_CRAM_DEBUG, | |
42 } ui_action; | 43 } ui_action; |
43 | 44 |
44 typedef struct { | 45 typedef struct { |
45 uint8_t bind_type; | 46 uint8_t bind_type; |
46 uint8_t subtype_a; | 47 uint8_t subtype_a; |
373 } | 374 } |
374 #ifndef DISABLE_NUKLEAR | 375 #ifndef DISABLE_NUKLEAR |
375 } | 376 } |
376 #endif | 377 #endif |
377 break; | 378 break; |
378 case UI_PLANE_DEBUG: { | 379 case UI_PLANE_DEBUG: |
380 case UI_VRAM_DEBUG: | |
381 case UI_CRAM_DEBUG: { | |
379 vdp_context *vdp = NULL; | 382 vdp_context *vdp = NULL; |
380 if (current_system->type == SYSTEM_GENESIS) { | 383 if (current_system->type == SYSTEM_GENESIS) { |
381 genesis_context *gen = (genesis_context *)current_system; | 384 genesis_context *gen = (genesis_context *)current_system; |
382 vdp = gen->vdp; | 385 vdp = gen->vdp; |
383 } else if (current_system->type == SYSTEM_SMS) { | 386 } else if (current_system->type == SYSTEM_SMS) { |
384 sms_context *sms = (sms_context *)current_system; | 387 sms_context *sms = (sms_context *)current_system; |
385 vdp = sms->vdp; | 388 vdp = sms->vdp; |
386 } | 389 } |
387 if (vdp) { | 390 if (vdp) { |
388 vdp_toggle_debug_view(vdp, VDP_DEBUG_PLANE); | 391 uint8_t debug_type; |
389 } | 392 switch(binding->subtype_a) |
390 break; | 393 { |
391 } | 394 case UI_PLANE_DEBUG: debug_type = VDP_DEBUG_PLANE; break; |
392 case UI_VRAM_DEBUG: { | 395 case UI_VRAM_DEBUG: debug_type = VDP_DEBUG_VRAM; break; |
393 vdp_context *vdp = NULL; | 396 case UI_CRAM_DEBUG: debug_type = VDP_DEBUG_CRAM; break; |
394 if (current_system->type == SYSTEM_GENESIS) { | 397 default: return; |
395 genesis_context *gen = (genesis_context *)current_system; | 398 } |
396 vdp = gen->vdp; | 399 vdp_toggle_debug_view(vdp, debug_type); |
397 } else if (current_system->type == SYSTEM_SMS) { | |
398 sms_context *sms = (sms_context *)current_system; | |
399 vdp = sms->vdp; | |
400 } | |
401 if (vdp) { | |
402 vdp_toggle_debug_view(vdp, VDP_DEBUG_VRAM); | |
403 } | 400 } |
404 break; | 401 break; |
405 } | 402 } |
406 } | 403 } |
407 break; | 404 break; |
608 *subtype_a = UI_EXIT; | 605 *subtype_a = UI_EXIT; |
609 } else if (!strcmp(target + 3, "plane_debug")) { | 606 } else if (!strcmp(target + 3, "plane_debug")) { |
610 *subtype_a = UI_PLANE_DEBUG; | 607 *subtype_a = UI_PLANE_DEBUG; |
611 } else if (!strcmp(target + 3, "vram_debug")) { | 608 } else if (!strcmp(target + 3, "vram_debug")) { |
612 *subtype_a = UI_VRAM_DEBUG; | 609 *subtype_a = UI_VRAM_DEBUG; |
613 } else { | 610 } else if (!strcmp(target + 3, "cram_debug")) { |
611 *subtype_a = UI_CRAM_DEBUG; | |
612 } else { | |
614 warning("Unreconized UI binding type %s\n", target); | 613 warning("Unreconized UI binding type %s\n", target); |
615 return 0; | 614 return 0; |
616 } | 615 } |
617 return BIND_UI; | 616 return BIND_UI; |
618 } else { | 617 } else { |