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

182 lines
19 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/gb/cgb.h Source File</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('cgb_8h_source.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="headertitle"><div class="title">cgb.h</div></div>
</div><!--header-->
<div class="contents">
<a href="cgb_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="preprocessor">#ifndef _CGB_H</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#define _CGB_H</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> </div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="preprocessor">#include &lt;types.h&gt;</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#include &lt;<a class="code" href="stdint_8h.html">stdint.h</a>&gt;</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> </div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"><a class="line" href="cgb_8h.html#RGB"> 33</a></span><span class="preprocessor">#define RGB(r, g, b) ((uint16_t)((((b) &amp; 0x1f) &lt;&lt; 10) | ((uint16_t)(((g) &amp; 0x1f) &lt;&lt; 5)) | ((r) &amp; 0x1f)))</span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> </div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="cgb_8h.html#RGB8"> 47</a></span><span class="preprocessor">#define RGB8(r, g, b) (((uint16_t)((((b) &gt;&gt; 3) &amp; 0x1f) &lt;&lt; 10)) | ((uint16_t)((((g) &gt;&gt; 3) &amp; 0x1f) &lt;&lt; 5)) | (((r) &gt;&gt; 3) &amp; 0x1f))</span></div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> </div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"><a class="line" href="cgb_8h.html#RGBHTML"> 59</a></span><span class="preprocessor">#define RGBHTML(RGB24bit) (RGB8((((RGB24bit) &gt;&gt; 16) &amp; 0xff), (((RGB24bit) &gt;&gt; 8) &amp; 0xff), ((RGB24bit) &amp; 0xff)))</span></div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> </div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"><a class="line" href="cgb_8h.html#RGB_RED"> 63</a></span><span class="preprocessor">#define RGB_RED RGB(31, 0, 0)</span></div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"><a class="line" href="cgb_8h.html#RGB_DARKRED"> 64</a></span><span class="preprocessor">#define RGB_DARKRED RGB(15, 0, 0)</span></div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"><a class="line" href="cgb_8h.html#RGB_GREEN"> 65</a></span><span class="preprocessor">#define RGB_GREEN RGB( 0, 31, 0)</span></div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"><a class="line" href="cgb_8h.html#RGB_DARKGREEN"> 66</a></span><span class="preprocessor">#define RGB_DARKGREEN RGB( 0, 15, 0)</span></div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"><a class="line" href="cgb_8h.html#RGB_BLUE"> 67</a></span><span class="preprocessor">#define RGB_BLUE RGB( 0, 0, 31)</span></div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"><a class="line" href="cgb_8h.html#RGB_DARKBLUE"> 68</a></span><span class="preprocessor">#define RGB_DARKBLUE RGB( 0, 0, 15)</span></div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"><a class="line" href="cgb_8h.html#RGB_YELLOW"> 69</a></span><span class="preprocessor">#define RGB_YELLOW RGB(31, 31, 0)</span></div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"><a class="line" href="cgb_8h.html#RGB_DARKYELLOW"> 70</a></span><span class="preprocessor">#define RGB_DARKYELLOW RGB(21, 21, 0)</span></div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"><a class="line" href="cgb_8h.html#RGB_CYAN"> 71</a></span><span class="preprocessor">#define RGB_CYAN RGB( 0, 31, 31)</span></div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"><a class="line" href="cgb_8h.html#RGB_AQUA"> 72</a></span><span class="preprocessor">#define RGB_AQUA RGB(28, 5, 22)</span></div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"><a class="line" href="cgb_8h.html#RGB_PINK"> 73</a></span><span class="preprocessor">#define RGB_PINK RGB(31, 0, 31)</span></div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"><a class="line" href="cgb_8h.html#RGB_PURPLE"> 74</a></span><span class="preprocessor">#define RGB_PURPLE RGB(21, 0, 21)</span></div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"><a class="line" href="cgb_8h.html#RGB_BLACK"> 75</a></span><span class="preprocessor">#define RGB_BLACK RGB( 0, 0, 0)</span></div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"><a class="line" href="cgb_8h.html#RGB_DARKGRAY"> 76</a></span><span class="preprocessor">#define RGB_DARKGRAY RGB(10, 10, 10)</span></div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"><a class="line" href="cgb_8h.html#RGB_LIGHTGRAY"> 77</a></span><span class="preprocessor">#define RGB_LIGHTGRAY RGB(21, 21, 21)</span></div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"><a class="line" href="cgb_8h.html#RGB_WHITE"> 78</a></span><span class="preprocessor">#define RGB_WHITE RGB(31, 31, 31)</span></div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> </div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"><a class="line" href="cgb_8h.html#RGB_LIGHTFLESH"> 80</a></span><span class="preprocessor">#define RGB_LIGHTFLESH RGB(30, 20, 15)</span></div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"><a class="line" href="cgb_8h.html#RGB_BROWN"> 81</a></span><span class="preprocessor">#define RGB_BROWN RGB(10, 10, 0)</span></div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"><a class="line" href="cgb_8h.html#RGB_ORANGE"> 82</a></span><span class="preprocessor">#define RGB_ORANGE RGB(30, 20, 0)</span></div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"><a class="line" href="cgb_8h.html#RGB_TEAL"> 83</a></span><span class="preprocessor">#define RGB_TEAL RGB(15, 15, 0)</span></div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> </div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"><a class="line" href="cgb_8h.html#palette_color_t"> 85</a></span><span class="keyword">typedef</span> <a class="code hl_typedef" href="stdint_8h.html#uint16_t">uint16_t</a> <a class="code hl_typedef" href="cgb_8h.html#palette_color_t">palette_color_t</a>; </div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"><a class="line" href="cgb_8h.html#set_bkg_palette"> 104</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="cgb_8h.html#set_bkg_palette">set_bkg_palette</a>(<a class="code hl_typedef" href="stdint_8h.html#uint8_t">uint8_t</a> first_palette, <a class="code hl_typedef" href="stdint_8h.html#uint8_t">uint8_t</a> nb_palettes, <span class="keyword">const</span> <a class="code hl_typedef" href="cgb_8h.html#palette_color_t">palette_color_t</a> *rgb_data) <a class="code hl_define" href="asm_2types_8h.html#OLDCALL">OLDCALL</a>;</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> </div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"><a class="line" href="cgb_8h.html#set_sprite_palette"> 123</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="cgb_8h.html#set_sprite_palette">set_sprite_palette</a>(<a class="code hl_typedef" href="stdint_8h.html#uint8_t">uint8_t</a> first_palette, <a class="code hl_typedef" href="stdint_8h.html#uint8_t">uint8_t</a> nb_palettes, <span class="keyword">const</span> <a class="code hl_typedef" href="cgb_8h.html#palette_color_t">palette_color_t</a> *rgb_data) <a class="code hl_define" href="asm_2types_8h.html#OLDCALL">OLDCALL</a>;</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> </div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"><a class="line" href="cgb_8h.html#set_bkg_palette_entry"> 136</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="cgb_8h.html#set_bkg_palette_entry">set_bkg_palette_entry</a>(<a class="code hl_typedef" href="stdint_8h.html#uint8_t">uint8_t</a> palette, <a class="code hl_typedef" href="stdint_8h.html#uint8_t">uint8_t</a> entry, <a class="code hl_typedef" href="stdint_8h.html#uint16_t">uint16_t</a> rgb_data) <a class="code hl_define" href="asm_2types_8h.html#OLDCALL">OLDCALL</a>;</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> </div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"><a class="line" href="cgb_8h.html#set_sprite_palette_entry"> 148</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="cgb_8h.html#set_sprite_palette_entry">set_sprite_palette_entry</a>(<a class="code hl_typedef" href="stdint_8h.html#uint8_t">uint8_t</a> palette, <a class="code hl_typedef" href="stdint_8h.html#uint8_t">uint8_t</a> entry, <a class="code hl_typedef" href="stdint_8h.html#uint16_t">uint16_t</a> rgb_data) <a class="code hl_define" href="asm_2types_8h.html#OLDCALL">OLDCALL</a>;</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> </div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"><a class="line" href="cgb_8h.html#cpu_slow"> 160</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="cgb_8h.html#cpu_slow">cpu_slow</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> </div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span><span class="keywordtype">void</span> <a class="code hl_function" href="cgb_8h.html#cpu_fast">cpu_fast</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> </div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"><a class="line" href="cgb_8h.html#set_default_palette"> 184</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="cgb_8h.html#set_default_palette">set_default_palette</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> </div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span><span class="keywordtype">void</span> <a class="code hl_function" href="cgb_8h.html#cgb_compatibility">cgb_compatibility</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> </div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span><span class="preprocessor">#endif </span><span class="comment">/* _CGB_H */</span><span class="preprocessor"></span></div>
<div class="ttc" id="aasm_2types_8h_html_OLDCALL"><div class="ttname"><a href="asm_2types_8h.html#OLDCALL">OLDCALL</a></div><div class="ttdeci">#define OLDCALL</div><div class="ttdef"><b>Definition:</b> types.h:21</div></div>
<div class="ttc" id="acgb_8h_html_cgb_compatibility"><div class="ttname"><a href="cgb_8h.html#cgb_compatibility">cgb_compatibility</a></div><div class="ttdeci">void cgb_compatibility(void)</div><div class="ttdef"><b>Definition:</b> sms.h:588</div></div>
<div class="ttc" id="acgb_8h_html_cpu_fast"><div class="ttname"><a href="cgb_8h.html#cpu_fast">cpu_fast</a></div><div class="ttdeci">void cpu_fast(void)</div><div class="ttdef"><b>Definition:</b> msx.h:551</div></div>
<div class="ttc" id="acgb_8h_html_cpu_slow"><div class="ttname"><a href="cgb_8h.html#cpu_slow">cpu_slow</a></div><div class="ttdeci">void cpu_slow(void)</div></div>
<div class="ttc" id="acgb_8h_html_palette_color_t"><div class="ttname"><a href="cgb_8h.html#palette_color_t">palette_color_t</a></div><div class="ttdeci">uint16_t palette_color_t</div><div class="ttdef"><b>Definition:</b> cgb.h:85</div></div>
<div class="ttc" id="acgb_8h_html_set_bkg_palette"><div class="ttname"><a href="cgb_8h.html#set_bkg_palette">set_bkg_palette</a></div><div class="ttdeci">void set_bkg_palette(uint8_t first_palette, uint8_t nb_palettes, const palette_color_t *rgb_data) OLDCALL</div></div>
<div class="ttc" id="acgb_8h_html_set_bkg_palette_entry"><div class="ttname"><a href="cgb_8h.html#set_bkg_palette_entry">set_bkg_palette_entry</a></div><div class="ttdeci">void set_bkg_palette_entry(uint8_t palette, uint8_t entry, uint16_t rgb_data) OLDCALL</div></div>
<div class="ttc" id="acgb_8h_html_set_default_palette"><div class="ttname"><a href="cgb_8h.html#set_default_palette">set_default_palette</a></div><div class="ttdeci">void set_default_palette(void)</div></div>
<div class="ttc" id="acgb_8h_html_set_sprite_palette"><div class="ttname"><a href="cgb_8h.html#set_sprite_palette">set_sprite_palette</a></div><div class="ttdeci">void set_sprite_palette(uint8_t first_palette, uint8_t nb_palettes, const palette_color_t *rgb_data) OLDCALL</div></div>
<div class="ttc" id="acgb_8h_html_set_sprite_palette_entry"><div class="ttname"><a href="cgb_8h.html#set_sprite_palette_entry">set_sprite_palette_entry</a></div><div class="ttdeci">void set_sprite_palette_entry(uint8_t palette, uint8_t entry, uint16_t rgb_data) OLDCALL</div></div>
<div class="ttc" id="astdint_8h_html"><div class="ttname"><a href="stdint_8h.html">stdint.h</a></div></div>
<div class="ttc" id="astdint_8h_html_uint16_t"><div class="ttname"><a href="stdint_8h.html#uint16_t">uint16_t</a></div><div class="ttdeci">unsigned short int uint16_t</div><div class="ttdef"><b>Definition:</b> stdint.h:52</div></div>
<div class="ttc" id="astdint_8h_html_uint8_t"><div class="ttname"><a href="stdint_8h.html#uint8_t">uint8_t</a></div><div class="ttdeci">unsigned char uint8_t</div><div class="ttdef"><b>Definition:</b> stdint.h:51</div></div>
</div><!-- fragment --></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_bdfe001eb73b667f67d57fb851301eb1.html">gb</a></li><li class="navelem"><a class="el" href="cgb_8h.html">cgb.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>