13 #ifndef __GBDK_EMU_DEBUG_H_INCLUDE
14 #define __GBDK_EMU_DEBUG_H_INCLUDE
18 #if defined(__TARGET_gb) || defined(__TARGET_ap) || defined(__TARGET_sms) || defined(__TARGET_gg)
43 #define EMU_MESSAGE(message_text) EMU_MESSAGE1(EMU_MACRONAME(__LINE__), message_text)
44 #define BGB_MESSAGE(message_text) EMU_MESSAGE(message_text)
47 #define EMU_MACRONAME(A) EMU_MACRONAME1(A)
48 #define EMU_MACRONAME1(A) EMULOG##A
50 #define EMU_MESSAGE1(name, message_text) \
52 .MACRO name msg_t, ?llbl\
60 name ^/message_text/ \
63 #define EMU_MESSAGE_SUFFIX(message_text, message_suffix) EMU_MESSAGE3(EMU_MACRONAME(__LINE__), message_text, message_suffix)
64 #define EMU_MESSAGE3(name, message_text, message_suffix) \
66 .MACRO name msg_t, msg_s, ?llbl\
75 name ^/message_text/, ^/message_suffix/ \
89 #define EMU_PROFILE_BEGIN(MSG) EMU_MESSAGE_SUFFIX(MSG, "%ZEROCLKS%");
90 #define BGB_PROFILE_BEGIN(MSG) EMU_PROFILE_BEGIN(MSG)
116 #if defined(NINTENDO)
117 #define EMU_PROFILE_END(MSG) EMU_MESSAGE_SUFFIX(MSG,"%-8+LASTCLKS%");
118 #define BGB_PROFILE_END(MSG) EMU_PROFILE_END(MSG)
120 #define EMU_PROFILE_END(MSG) EMU_MESSAGE_SUFFIX(MSG,"%-16+LASTCLKS%");
121 #define BGB_PROFILE_END(MSG) EMU_PROFILE_END(MSG)
124 #define EMU_TEXT(MSG) EMU_MESSAGE(MSG)
125 #define BGB_TEXT(MSG) EMU_TEXT(MSG)
135 #if defined(NINTENDO)
136 void EMU_profiler_message(
void);
137 #define BGB_profiler_message EMU_profiler_message()
162 #define BGB_printf(...) EMU_printf(__VA_ARGS__)
165 static void * __EMU_PROFILER_INIT = &EMU_profiler_message;
170 #define EMU_BREAKPOINT __asm__("ld b, b");
171 #define BGB_BREAKPOINT EMU_BREAKPOINT
173 #elif defined(__TARGET_duck)
174 #error Not implemented yet
176 #error Unrecognized port
#define OLDCALL
Definition: types.h:21
void EMU_printf(const char *format,...) OLDCALL