Mercurial > repos > blastem
comparison debug.c @ 2681:c4256ce2c45a
Updated Android port using gradle toolchain and with basic Storage Access Framework support for Android 11+ support
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 26 Mar 2025 01:20:55 -0700 |
parents | 7e86ec94c899 |
children |
comparison
equal
deleted
inserted
replaced
2680:e3394457427e | 2681:c4256ce2c45a |
---|---|
27 #endif | 27 #endif |
28 | 28 |
29 static debug_func *funcs; | 29 static debug_func *funcs; |
30 static uint32_t num_funcs, func_storage; | 30 static uint32_t num_funcs, func_storage; |
31 | 31 |
32 static debug_func* alloc_func(void) | 32 static debug_func* alloc_dfunc(void) |
33 { | 33 { |
34 if (num_funcs == func_storage) { | 34 if (num_funcs == func_storage) { |
35 func_storage = func_storage ? func_storage * 2 : 4; | 35 func_storage = func_storage ? func_storage * 2 : 4; |
36 funcs = realloc(funcs, sizeof(debug_func) * func_storage); | 36 funcs = realloc(funcs, sizeof(debug_func) * func_storage); |
37 } | 37 } |
38 return funcs + num_funcs++; | 38 return funcs + num_funcs++; |
39 } | 39 } |
40 | 40 |
41 static debug_val new_native_func(debug_native_func impl, int max_args, int min_args) | 41 static debug_val new_native_func(debug_native_func impl, int max_args, int min_args) |
42 { | 42 { |
43 debug_func *f = alloc_func(); | 43 debug_func *f = alloc_dfunc(); |
44 f->impl.native = impl; | 44 f->impl.native = impl; |
45 f->max_args = max_args; | 45 f->max_args = max_args; |
46 f->min_args = min_args; | 46 f->min_args = min_args; |
47 f->is_native = 1; | 47 f->is_native = 1; |
48 return (debug_val) { | 48 return (debug_val) { |
53 }; | 53 }; |
54 } | 54 } |
55 | 55 |
56 static debug_val new_user_func(command_block *block, char **args, int num_args) | 56 static debug_val new_user_func(command_block *block, char **args, int num_args) |
57 { | 57 { |
58 debug_func *f = alloc_func(); | 58 debug_func *f = alloc_dfunc(); |
59 f->impl.block = *block; | 59 f->impl.block = *block; |
60 f->arg_names = args; | 60 f->arg_names = args; |
61 f->max_args = f->min_args = num_args; | 61 f->max_args = f->min_args = num_args; |
62 f->is_native = 0; | 62 f->is_native = 0; |
63 return (debug_val) { | 63 return (debug_val) { |