diff debug.h @ 2665:54ac5fe14cf9

Allow calling functions directly as if they were commands
author Michael Pavone <pavone@retrodev.com>
date Fri, 07 Mar 2025 21:45:53 -0800
parents d74d3998482c
children 7e86ec94c899
line wrap: on
line diff
--- a/debug.h	Thu Mar 06 01:47:49 2025 -0800
+++ b/debug.h	Fri Mar 07 21:45:53 2025 -0800
@@ -111,8 +111,21 @@
 	int            num_commands;
 } command_block;
 
+typedef debug_val (*debug_native_func)(debug_val *args, int num_args);
+typedef struct {
+	union {
+		debug_native_func native;
+		command_block     block;
+	} impl;
+	char     **arg_names;
+	int      max_args;
+	int      min_args;
+	uint8_t  is_native;
+} debug_func;
+
 struct parsed_command {
 	command_def   *def;
+	uint32_t      func;
 	char          *format;
 	char          *raw;
 	command_arg   *args;
@@ -154,18 +167,6 @@
 	uint32_t           storage;
 };
 
-typedef debug_val (*debug_native_func)(debug_val *args, int num_args);
-typedef struct {
-	union {
-		debug_native_func native;
-		command_block     block;
-	} impl;
-	char     **arg_names;
-	int      max_args;
-	int      min_args;
-	uint8_t  is_native;
-} debug_func;
-
 typedef struct {
 	char     *buffer;
 	uint32_t size;