diff debug.c @ 2413:64cf80e683aa

Initial support for Colecovision emulation
author Michael Pavone <pavone@retrodev.com>
date Thu, 04 Jan 2024 22:56:35 -0800
parents c97609fe8315
children 1978bd770023
line wrap: on
line diff
--- a/debug.c	Thu Jan 04 22:14:29 2024 -0800
+++ b/debug.c	Thu Jan 04 22:56:35 2024 -0800
@@ -17,6 +17,7 @@
 #include "z80inst.h"
 #ifndef NO_Z80
 #include "sms.h"
+#include "coleco.h"
 #endif
 
 #ifdef NEW_CORE
@@ -1815,6 +1816,9 @@
 static debug_val debug_vram_get(debug_array *array, uint32_t index)
 {
 	vdp_context *vdp = array->base;
+	if (!(vdp->regs[REG_MODE_2] & BIT_MODE_5)) {
+		index = mode4_address_map[index & 0x3FFF] ^ 1;
+	}
 	return debug_int(vdp->vdpmem[index]);
 }
 
@@ -1826,6 +1830,9 @@
 		return;
 	}
 	vdp_context *vdp = array->base;
+	if (!(vdp->regs[REG_MODE_2] & BIT_MODE_5)) {
+		index = mode4_address_map[index & 0x3FFF] ^ 1;
+	}
 	vdp->vdpmem[index] = ival;
 }
 
@@ -5178,6 +5185,7 @@
 		z80_names(root);
 		genesis_context *gen;
 		sms_context *sms;
+		coleco_context *coleco;
 		debug_var *var;
 		//TODO: populate names
 		switch (current_system->type)
@@ -5199,6 +5207,11 @@
 			var->ptr = sms->vdp;
 			root->variables = tern_insert_ptr(root->variables, "frame", var);
 			break;
+		case SYSTEM_COLECOVISION:
+			coleco = context->system;
+			root->other_roots = tern_insert_ptr(root->other_roots, "vdp", find_vdp_root(coleco->vdp));
+			root->other_roots = tern_insert_ptr(root->other_roots, "psg", find_psg_root(coleco->psg));
+			break;
 		//default:
 			//root->resolve = resolve_z80;
 		}