14 #pragma disable_warning 218
16 #ifndef __GBDK_EMU_DEBUG_H_INCLUDE
17 #define __GBDK_EMU_DEBUG_H_INCLUDE
21 #if defined(__TARGET_gb) || defined(__TARGET_ap) || defined(__TARGET_sms) || defined(__TARGET_gg)
46 #define EMU_MESSAGE(message_text) EMU_MESSAGE1(EMU_MACRONAME(__LINE__), message_text)
47 #define BGB_MESSAGE(message_text) EMU_MESSAGE(message_text)
50 #define EMU_MACRONAME(A) EMU_MACRONAME1(A)
51 #define EMU_MACRONAME1(A) EMULOG##A
53 #define EMU_MESSAGE1(name, message_text) \
55 .MACRO name msg_t, ?llbl \
63 name ^/message_text/ \
66 #define EMU_MESSAGE_SUFFIX(message_text, message_suffix) EMU_MESSAGE3(EMU_MACRONAME(__LINE__), message_text, message_suffix)
67 #define EMU_MESSAGE3(name, message_text, message_suffix) \
69 .MACRO name msg_t, msg_s, ?llbl \
78 name ^/message_text/, ^/message_suffix/ \
92 #define EMU_PROFILE_BEGIN(MSG) EMU_MESSAGE_SUFFIX(MSG, "%ZEROCLKS%");
93 #define BGB_PROFILE_BEGIN(MSG) EMU_PROFILE_BEGIN(MSG)
119 #if defined(NINTENDO)
120 #define EMU_PROFILE_END(MSG) EMU_MESSAGE_SUFFIX(MSG,"%-8+LASTCLKS%");
121 #define BGB_PROFILE_END(MSG) EMU_PROFILE_END(MSG)
123 #define EMU_PROFILE_END(MSG) EMU_MESSAGE_SUFFIX(MSG,"%-16+LASTCLKS%");
124 #define BGB_PROFILE_END(MSG) EMU_PROFILE_END(MSG)
127 #define EMU_TEXT(MSG) EMU_MESSAGE(MSG)
128 #define BGB_TEXT(MSG) EMU_TEXT(MSG)
130 #if defined(NINTENDO)
140 #define BGB_profiler_message EMU_profiler_message()
165 #define BGB_printf(...) EMU_printf(__VA_ARGS__)
184 #define EMU_BREAKPOINT __asm__("ld b, b");
185 #define BGB_BREAKPOINT EMU_BREAKPOINT
187 #elif defined(__TARGET_duck)
188 #error Not implemented yet
190 #error Unrecognized port
#define PRESERVES_REGS(...)
Definition: types.h:32
void c
Definition: emu_debug.h:164
void EMU_fmtbuf(const unsigned char *format, void *data) PRESERVES_REGS(a
void b
Definition: emu_debug.h:164
void EMU_printf(const char *format,...) PRESERVES_REGS(a
void EMU_profiler_message(void)