comparison nuklear_ui/debug_ui.c @ 2701:5ca4e0fd761b

Update debug views while paused in the debug (except on Windows... for now)
author Michael Pavone <pavone@retrodev.com>
date Fri, 04 Jul 2025 19:35:50 -0700
parents 1cfd000dc750
children
comparison
equal deleted inserted replaced
2700:1cfd000dc750 2701:5ca4e0fd761b
27 } 27 }
28 } 28 }
29 } 29 }
30 30
31 #ifndef DISABLE_OPENGL 31 #ifndef DISABLE_OPENGL
32 vdp_context *get_vdp(void)
33 {
34 if (!current_system) {
35 return NULL;
36 }
37 switch (current_system->type)
38 {
39 case SYSTEM_GENESIS:
40 case SYSTEM_SEGACD:
41 case SYSTEM_PICO:
42 case SYSTEM_COPERA:
43 return ((genesis_context *)current_system)->vdp;
44 case SYSTEM_SMS:
45 case SYSTEM_GAME_GEAR:
46 case SYSTEM_SG1000:
47 case SYSTEM_SC3000:
48 return ((sms_context *)current_system)->vdp;
49 case SYSTEM_COLECOVISION:
50 return ((coleco_context *)current_system)->vdp;
51 default:
52 return NULL;
53 }
54 }
55 32
56 static void plane_debug_ui(void) 33 static void plane_debug_ui(void)
57 { 34 {
58 vdp_context *vdp = get_vdp(); 35 if (!current_system || !current_system->get_vdp) {
36 return;
37 }
38 vdp_context *vdp = current_system->get_vdp(current_system);
59 if (!vdp) { 39 if (!vdp) {
60 return; 40 return;
61 } 41 }
62 struct nk_context *context = windows[DEBUG_PLANE].context; 42 struct nk_context *context = windows[DEBUG_PLANE].context;
63 nk_input_end(context); 43 nk_input_end(context);
147 } 127 }
148 128
149 void write_cram_internal(vdp_context * context, uint16_t addr, uint16_t value); 129 void write_cram_internal(vdp_context * context, uint16_t addr, uint16_t value);
150 static void cram_debug_ui(void) 130 static void cram_debug_ui(void)
151 { 131 {
152 vdp_context *vdp = get_vdp(); 132 if (!current_system || !current_system->get_vdp) {
133 return;
134 }
135 vdp_context *vdp = current_system->get_vdp(current_system);
153 if (!vdp) { 136 if (!vdp) {
154 return; 137 return;
155 } 138 }
156 struct nk_context *context = windows[DEBUG_CRAM].context; 139 struct nk_context *context = windows[DEBUG_CRAM].context;
157 nk_input_end(context); 140 nk_input_end(context);