Files
gbdk-2020/docs/api/gbdk_2emu__debug_8h.html
2025-12-27 17:53:11 -08:00

557 lines
28 KiB
HTML

<!-- HTML header for doxygen 1.8.14-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="cache-control" content="max-age=86400"/>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>GBDK 2020 Docs: gbdk-lib/include/gbdk/emu_debug.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
<link href="doxygen-awesome-sidebar-only.css" rel="stylesheet" type="text/css"/>
<link href="doxygen-awesome-sidebar-only-darkmode-toggle.css" rel="stylesheet" type="text/css"/>
<!-- BEGIN: doxygen-awesome-css -->
<script type="text/javascript" src="doxygen-awesome-darkmode-toggle.js"></script>
<script type="text/javascript">
DoxygenAwesomeDarkModeToggle.init()
</script>
<script type="text/javascript" src="doxygen-awesome-paragraph-link.js"></script>
<script type="text/javascript">
DoxygenAwesomeParagraphLink.init()
</script>
<!-- END: doxygen-awesome-css -->
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">GBDK 2020 Docs
&#160;<span id="projectnumber">4.5.0</span>
</div>
<div id="projectbrief">API Documentation for GBDK 2020</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('gbdk_2emu__debug_8h.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a> </div>
<div class="headertitle"><div class="title">emu_debug.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;types.h&gt;</code><br />
</div>
<p><a href="gbdk_2emu__debug_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:EMU_MESSAGE"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#EMU_MESSAGE">EMU_MESSAGE</a>(message_text)&#160;&#160;&#160;EMU_MESSAGE1(EMU_MACRONAME(__LINE__), message_text)</td></tr>
<tr class="separator:EMU_MESSAGE"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:BGB_MESSAGE"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#BGB_MESSAGE">BGB_MESSAGE</a>(message_text)&#160;&#160;&#160;<a class="el" href="gbdk_2emu__debug_8h.html#EMU_MESSAGE">EMU_MESSAGE</a>(message_text)</td></tr>
<tr class="separator:BGB_MESSAGE"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:EMU_PROFILE_BEGIN"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#EMU_PROFILE_BEGIN">EMU_PROFILE_BEGIN</a>(MSG)&#160;&#160;&#160;EMU_MESSAGE_SUFFIX(MSG, &quot;%ZEROCLKS%&quot;);</td></tr>
<tr class="separator:EMU_PROFILE_BEGIN"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:BGB_PROFILE_BEGIN"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#BGB_PROFILE_BEGIN">BGB_PROFILE_BEGIN</a>(MSG)&#160;&#160;&#160;<a class="el" href="gbdk_2emu__debug_8h.html#EMU_PROFILE_BEGIN">EMU_PROFILE_BEGIN</a>(MSG)</td></tr>
<tr class="separator:BGB_PROFILE_BEGIN"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:EMU_PROFILE_END"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#EMU_PROFILE_END">EMU_PROFILE_END</a>(MSG)&#160;&#160;&#160;EMU_MESSAGE_SUFFIX(MSG,&quot;%-8+LASTCLKS%&quot;);</td></tr>
<tr class="separator:EMU_PROFILE_END"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:BGB_PROFILE_END"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#BGB_PROFILE_END">BGB_PROFILE_END</a>(MSG)&#160;&#160;&#160;<a class="el" href="gbdk_2emu__debug_8h.html#EMU_PROFILE_END">EMU_PROFILE_END</a>(MSG)</td></tr>
<tr class="separator:BGB_PROFILE_END"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:EMU_TEXT"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#EMU_TEXT">EMU_TEXT</a>(MSG)&#160;&#160;&#160;<a class="el" href="gbdk_2emu__debug_8h.html#EMU_MESSAGE">EMU_MESSAGE</a>(MSG)</td></tr>
<tr class="separator:EMU_TEXT"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:BGB_TEXT"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#BGB_TEXT">BGB_TEXT</a>(MSG)&#160;&#160;&#160;<a class="el" href="gbdk_2emu__debug_8h.html#EMU_TEXT">EMU_TEXT</a>(MSG)</td></tr>
<tr class="separator:BGB_TEXT"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:BGB_profiler_message"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#BGB_profiler_message">BGB_profiler_message</a>&#160;&#160;&#160;<a class="el" href="gbdk_2emu__debug_8h.html#EMU_profiler_message">EMU_profiler_message</a>()</td></tr>
<tr class="separator:BGB_profiler_message"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:BGB_printf"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#BGB_printf">BGB_printf</a>(...)&#160;&#160;&#160;<a class="el" href="gbdk_2emu__debug_8h.html#EMU_printf">EMU_printf</a>(__VA_ARGS__)</td></tr>
<tr class="separator:BGB_printf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:EMU_BREAKPOINT"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#EMU_BREAKPOINT">EMU_BREAKPOINT</a>&#160;&#160;&#160;__asm__(&quot;ld <a class="el" href="sms_8h.html#b">b</a>, <a class="el" href="sms_8h.html#b">b</a>&quot;);</td></tr>
<tr class="separator:EMU_BREAKPOINT"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:BGB_BREAKPOINT"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#BGB_BREAKPOINT">BGB_BREAKPOINT</a>&#160;&#160;&#160;<a class="el" href="gbdk_2emu__debug_8h.html#EMU_BREAKPOINT">EMU_BREAKPOINT</a></td></tr>
<tr class="separator:BGB_BREAKPOINT"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:EMU_profiler_message"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#EMU_profiler_message">EMU_profiler_message</a> (void)</td></tr>
<tr class="separator:EMU_profiler_message"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:EMU_printf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#EMU_printf">EMU_printf</a> (const char *format,...) <a class="el" href="asm_2types_8h.html#PRESERVES_REGS">PRESERVES_REGS</a>(a</td></tr>
<tr class="separator:EMU_printf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:EMU_fmtbuf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#EMU_fmtbuf">EMU_fmtbuf</a> (const unsigned char *format, void *data) <a class="el" href="asm_2types_8h.html#PRESERVES_REGS">PRESERVES_REGS</a>(a</td></tr>
<tr class="separator:EMU_fmtbuf"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="var-members" name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#b">b</a></td></tr>
<tr class="separator:b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="gbdk_2emu__debug_8h.html#c">c</a></td></tr>
<tr class="separator:c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >Debug window logging and profiling support for emulators (BGB, Emulicious, etc).</p>
<p >Also see the <code>emu_debug</code> example project included with gbdk.</p>
<p >See the BGB Manual for more information ("expressions, breakpoint conditions, and debug messages") <a href="http://bgb.bircd.org/manual.html#expressions">http://bgb.bircd.org/manual.html#expressions</a> </p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="EMU_MESSAGE" name="EMU_MESSAGE"></a>
<h2 class="memtitle"><span class="permalink"><a href="#EMU_MESSAGE">&#9670;&nbsp;</a></span>EMU_MESSAGE</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define EMU_MESSAGE</td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname">message_text</td><td>)</td>
<td>&#160;&#160;&#160;EMU_MESSAGE1(EMU_MACRONAME(__LINE__), message_text)</td>
</tr>
</table>
</div><div class="memdoc">
<p >Macro to display a message in the emulator debug message window</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">message_text</td><td>Quoted text string to display in the debug message window</td></tr>
</table>
</dd>
</dl>
<p>The following special parameters can be used when bracketed with "%" characters. </p><ul>
<li>CPU registers: AF, BC, DE, HL, SP, PC, B, C, D, E, H, L, A, ZERO, ZF, Z, CARRY, CY, IME, ALLREGS </li>
<li>Other state values: ROMBANK, XRAMBANK, SRAMBANK, WRAMBANK, VRAMBANK, TOTALCLKS, LASTCLKS, CLKS2VBLANK</li>
</ul>
<p>Example: print a message along with the currently active ROM bank. </p><div class="fragment"><div class="line"><a class="code hl_define" href="gbdk_2emu__debug_8h.html#EMU_MESSAGE">EMU_MESSAGE</a>(<span class="stringliteral">&quot;Current ROM Bank is: %ROMBANK%&quot;</span>);</div>
<div class="ttc" id="agbdk_2emu__debug_8h_html_EMU_MESSAGE"><div class="ttname"><a href="gbdk_2emu__debug_8h.html#EMU_MESSAGE">EMU_MESSAGE</a></div><div class="ttdeci">#define EMU_MESSAGE(message_text)</div><div class="ttdef"><b>Definition:</b> emu_debug.h:46</div></div>
</div><!-- fragment --><p >See the BGB Manual for more information ("expressions, breakpoint conditions, and debug messages") <a href="http://bgb.bircd.org/manual.html#expressions">http://bgb.bircd.org/manual.html#expressions</a></p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="gbdk_2emu__debug_8h.html#EMU_PROFILE_BEGIN">EMU_PROFILE_BEGIN()</a>, <a class="el" href="gbdk_2emu__debug_8h.html#EMU_PROFILE_END">EMU_PROFILE_END()</a> </dd></dl>
</div>
</div>
<a id="BGB_MESSAGE" name="BGB_MESSAGE"></a>
<h2 class="memtitle"><span class="permalink"><a href="#BGB_MESSAGE">&#9670;&nbsp;</a></span>BGB_MESSAGE</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define BGB_MESSAGE</td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname">message_text</td><td>)</td>
<td>&#160;&#160;&#160;<a class="el" href="gbdk_2emu__debug_8h.html#EMU_MESSAGE">EMU_MESSAGE</a>(message_text)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="EMU_PROFILE_BEGIN" name="EMU_PROFILE_BEGIN"></a>
<h2 class="memtitle"><span class="permalink"><a href="#EMU_PROFILE_BEGIN">&#9670;&nbsp;</a></span>EMU_PROFILE_BEGIN</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define EMU_PROFILE_BEGIN</td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname">MSG</td><td>)</td>
<td>&#160;&#160;&#160;EMU_MESSAGE_SUFFIX(MSG, &quot;%ZEROCLKS%&quot;);</td>
</tr>
</table>
</div><div class="memdoc">
<p >Macro to <b>Start</b> a profiling block for the emulator (BGB, Emulicious, etc)</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">MSG</td><td>Quoted text string to display in the debug message window along with the result</td></tr>
</table>
</dd>
</dl>
<p>To complete the profiling block and print the result call <a class="el" href="gbdk_2emu__debug_8h.html#EMU_PROFILE_END">EMU_PROFILE_END</a>.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="gbdk_2emu__debug_8h.html#EMU_PROFILE_END">EMU_PROFILE_END()</a>, <a class="el" href="gbdk_2emu__debug_8h.html#EMU_MESSAGE">EMU_MESSAGE()</a> </dd></dl>
</div>
</div>
<a id="BGB_PROFILE_BEGIN" name="BGB_PROFILE_BEGIN"></a>
<h2 class="memtitle"><span class="permalink"><a href="#BGB_PROFILE_BEGIN">&#9670;&nbsp;</a></span>BGB_PROFILE_BEGIN</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define BGB_PROFILE_BEGIN</td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname">MSG</td><td>)</td>
<td>&#160;&#160;&#160;<a class="el" href="gbdk_2emu__debug_8h.html#EMU_PROFILE_BEGIN">EMU_PROFILE_BEGIN</a>(MSG)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="EMU_PROFILE_END" name="EMU_PROFILE_END"></a>
<h2 class="memtitle"><span class="permalink"><a href="#EMU_PROFILE_END">&#9670;&nbsp;</a></span>EMU_PROFILE_END</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define EMU_PROFILE_END</td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname">MSG</td><td>)</td>
<td>&#160;&#160;&#160;EMU_MESSAGE_SUFFIX(MSG,&quot;%-8+LASTCLKS%&quot;);</td>
</tr>
</table>
</div><div class="memdoc">
<p >Macro to <b>End</b> a profiling block and print the results in the emulator debug message window</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">MSG</td><td>Quoted text string to display in the debug message window along with the result</td></tr>
</table>
</dd>
</dl>
<p>This should only be called after a previous call to <a class="el" href="gbdk_2emu__debug_8h.html#EMU_PROFILE_BEGIN">EMU_PROFILE_BEGIN()</a></p>
<p >The results are in Emulator clock units, which are "1 nop in [CGB] doublespeed mode".</p>
<p >So when running in Normal Speed mode (i.e. non-CGB doublespeed) the printed result should be <b>divided by 2</b> to get the actual ellapsed cycle count.</p>
<p >If running in CB Double Speed mode use the below call instead, it correctly compensates for the speed difference. In this scenario, the result does <b>not need to be divided by 2</b> to get the ellapsed cycle count. </p><div class="fragment"><div class="line"><a class="code hl_define" href="gbdk_2emu__debug_8h.html#EMU_MESSAGE">EMU_MESSAGE</a>(<span class="stringliteral">&quot;NOP TIME: %-4+LASTCLKS%&quot;</span>);</div>
</div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><a class="el" href="gbdk_2emu__debug_8h.html#EMU_PROFILE_BEGIN">EMU_PROFILE_BEGIN()</a>, <a class="el" href="gbdk_2emu__debug_8h.html#EMU_MESSAGE">EMU_MESSAGE()</a> </dd></dl>
</div>
</div>
<a id="BGB_PROFILE_END" name="BGB_PROFILE_END"></a>
<h2 class="memtitle"><span class="permalink"><a href="#BGB_PROFILE_END">&#9670;&nbsp;</a></span>BGB_PROFILE_END</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define BGB_PROFILE_END</td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname">MSG</td><td>)</td>
<td>&#160;&#160;&#160;<a class="el" href="gbdk_2emu__debug_8h.html#EMU_PROFILE_END">EMU_PROFILE_END</a>(MSG)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="EMU_TEXT" name="EMU_TEXT"></a>
<h2 class="memtitle"><span class="permalink"><a href="#EMU_TEXT">&#9670;&nbsp;</a></span>EMU_TEXT</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define EMU_TEXT</td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname">MSG</td><td>)</td>
<td>&#160;&#160;&#160;<a class="el" href="gbdk_2emu__debug_8h.html#EMU_MESSAGE">EMU_MESSAGE</a>(MSG)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="BGB_TEXT" name="BGB_TEXT"></a>
<h2 class="memtitle"><span class="permalink"><a href="#BGB_TEXT">&#9670;&nbsp;</a></span>BGB_TEXT</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define BGB_TEXT</td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname">MSG</td><td>)</td>
<td>&#160;&#160;&#160;<a class="el" href="gbdk_2emu__debug_8h.html#EMU_TEXT">EMU_TEXT</a>(MSG)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="BGB_profiler_message" name="BGB_profiler_message"></a>
<h2 class="memtitle"><span class="permalink"><a href="#BGB_profiler_message">&#9670;&nbsp;</a></span>BGB_profiler_message</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define BGB_profiler_message&#160;&#160;&#160;<a class="el" href="gbdk_2emu__debug_8h.html#EMU_profiler_message">EMU_profiler_message</a>()</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="BGB_printf" name="BGB_printf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#BGB_printf">&#9670;&nbsp;</a></span>BGB_printf</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define BGB_printf</td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>...</em></td><td>)</td>
<td>&#160;&#160;&#160;<a class="el" href="gbdk_2emu__debug_8h.html#EMU_printf">EMU_printf</a>(__VA_ARGS__)</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="EMU_BREAKPOINT" name="EMU_BREAKPOINT"></a>
<h2 class="memtitle"><span class="permalink"><a href="#EMU_BREAKPOINT">&#9670;&nbsp;</a></span>EMU_BREAKPOINT</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define EMU_BREAKPOINT&#160;&#160;&#160;__asm__(&quot;ld <a class="el" href="sms_8h.html#b">b</a>, <a class="el" href="sms_8h.html#b">b</a>&quot;);</td>
</tr>
</table>
</div><div class="memdoc">
<p >The Emulator will break into debugger when encounters this line </p>
</div>
</div>
<a id="BGB_BREAKPOINT" name="BGB_BREAKPOINT"></a>
<h2 class="memtitle"><span class="permalink"><a href="#BGB_BREAKPOINT">&#9670;&nbsp;</a></span>BGB_BREAKPOINT</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define BGB_BREAKPOINT&#160;&#160;&#160;<a class="el" href="gbdk_2emu__debug_8h.html#EMU_BREAKPOINT">EMU_BREAKPOINT</a></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="EMU_profiler_message" name="EMU_profiler_message"></a>
<h2 class="memtitle"><span class="permalink"><a href="#EMU_profiler_message">&#9670;&nbsp;</a></span>EMU_profiler_message()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void EMU_profiler_message </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p >Display preset debug information in the Emulator debug messages window.</p>
<p >This function is equivalent to: </p><div class="fragment"><div class="line"><a class="code hl_define" href="gbdk_2emu__debug_8h.html#EMU_MESSAGE">EMU_MESSAGE</a>(<span class="stringliteral">&quot;PROFILE,%(SP+$0)%,%(SP+$1)%,%A%,%TOTALCLKS%,%ROMBANK%,%WRAMBANK%&quot;</span>);</div>
</div><!-- fragment -->
</div>
</div>
<a id="EMU_printf" name="EMU_printf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#EMU_printf">&#9670;&nbsp;</a></span>EMU_printf()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void EMU_printf </td>
<td>(</td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>format</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>...</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p >Print the string and arguments given by format to the emulator debug message window</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">format</td><td>The format string as per printf</td></tr>
</table>
</dd>
</dl>
<p>Does not return the number of characters printed. Currently supported: </p><ul>
<li>%hx (char as hex) </li>
<li>%hu (unsigned char) </li>
<li>%hd (signed char) </li>
<li>%c (character) <br />
</li>
<li>%u (unsigned int) </li>
<li>%d (signed int) </li>
<li>%x (unsigned int as hex) </li>
<li>%s (string)</li>
</ul>
<dl class="section note"><dt>Note</dt><dd>Variables for the following 8-bit formats <b>MUST</b> be cast to their type when passed to <a class="el" href="gbdk_2emu__debug_8h.html#EMU_printf">EMU_printf()</a> <ul>
<li>%hx (char) </li>
<li>%hu (unsigned char) </li>
<li>%hd (signed char)</li>
</ul>
However variables for the following 8-bit format <b>MUST NOT</b> be cast to their type when passed to <a class="el" href="gbdk_2emu__debug_8h.html#EMU_printf">EMU_printf()</a> <ul>
<li>%c (char)</li>
</ul>
This behavior is <b>different</b> than for <a class="el" href="stdio_8h.html#sprintf">sprintf()</a>, which does require %c format char variables to be explicitly cast.</dd></dl>
<p>Currently supported in the Emulicious emulator, may be supported by bgb </p>
</div>
</div>
<a id="EMU_fmtbuf" name="EMU_fmtbuf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#EMU_fmtbuf">&#9670;&nbsp;</a></span>EMU_fmtbuf()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void EMU_fmtbuf </td>
<td>(</td>
<td class="paramtype">const unsigned char *&#160;</td>
<td class="paramname"><em>format</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&#160;</td>
<td class="paramname"><em>data</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p >Print the string and arguments in the buffer buffer by the pointer given by format to the emulator debug message window</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">format</td><td>The format string as per printf </td></tr>
<tr><td class="paramname">data</td><td>Buffer containing arguments, for example some struct</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="gbdk_2emu__debug_8h.html#EMU_printf">EMU_printf</a> for the format string description</dd></dl>
<p>Currently supported in the Emulicious emulator </p>
</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a id="b" name="b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#b">&#9670;&nbsp;</a></span>b</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void b</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="c" name="c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#c">&#9670;&nbsp;</a></span>c</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void c</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_8bd3092e915ccc8a773a74e0a10d4d15.html">gbdk-lib</a></li><li class="navelem"><a class="el" href="dir_a9f896cff747ba031115e41245385c17.html">include</a></li><li class="navelem"><a class="el" href="dir_aedcfcf321a7f13aa34b51e3093299b2.html">gbdk</a></li><li class="navelem"><a class="el" href="gbdk_2emu__debug_8h.html">emu_debug.h</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2 </li>
</ul>
</div>
</body>
</html>