cgb_8h_source.html (19194B)
1<!-- HTML header for doxygen 1.8.14--> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3<html xmlns="http://www.w3.org/1999/xhtml"> 4<head> 5<meta http-equiv="cache-control" content="max-age=86400"/> 6<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> 7<meta http-equiv="X-UA-Compatible" content="IE=9"/> 8<meta name="generator" content="Doxygen 1.8.20"/> 9<meta name="viewport" content="width=device-width, initial-scale=1"/> 10<title>GBDK 2020 Docs: gb/cgb.h Source File</title> 11<link href="tabs.css" rel="stylesheet" type="text/css"/> 12<script type="text/javascript" src="jquery.js"></script> 13<script type="text/javascript" src="dynsections.js"></script> 14<link href="navtree.css" rel="stylesheet" type="text/css"/> 15<script type="text/javascript" src="resize.js"></script> 16<script type="text/javascript" src="navtreedata.js"></script> 17<script type="text/javascript" src="navtree.js"></script> 18<link href="search/search.css" rel="stylesheet" type="text/css"/> 19<script type="text/javascript" src="search/searchdata.js"></script> 20<script type="text/javascript" src="search/search.js"></script> 21<link href="doxygen.css" rel="stylesheet" type="text/css" /> 22<link href="doxygen_extra.css" rel="stylesheet" type="text/css"/> 23</head> 24<body> 25<div id="top"><!-- do not remove this div, it is closed by doxygen! --> 26<div id="titlearea"> 27<table cellspacing="0" cellpadding="0"> 28 <tbody> 29 <tr style="height: 56px;"> 30 <td id="projectalign" style="padding-left: 0.5em;"> 31 <div id="projectname">GBDK 2020 Docs 32  <span id="projectnumber">4.0.6</span> 33 </div> 34 <div id="projectbrief">API Documentation for GBDK 2020</div> 35 </td> 36 </tr> 37 </tbody> 38</table> 39</div> 40<!-- end header part --> 41<!-- Generated by Doxygen 1.8.20 --> 42<script type="text/javascript"> 43/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ 44var searchBox = new SearchBox("searchBox", "search",false,'Search'); 45/* @license-end */ 46</script> 47<script type="text/javascript" src="menudata.js"></script> 48<script type="text/javascript" src="menu.js"></script> 49<script type="text/javascript"> 50/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ 51$(function() { 52 initMenu('',true,false,'search.php','Search'); 53 $(document).ready(function() { init_search(); }); 54}); 55/* @license-end */</script> 56<div id="main-nav"></div> 57</div><!-- top --> 58<div id="side-nav" class="ui-resizable side-nav-resizable"> 59 <div id="nav-tree"> 60 <div id="nav-tree-contents"> 61 <div id="nav-sync" class="sync"></div> 62 </div> 63 </div> 64 <div id="splitbar" style="-moz-user-select:none;" 65 class="ui-resizable-handle"> 66 </div> 67</div> 68<script type="text/javascript"> 69/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ 70$(document).ready(function(){initNavTree('cgb_8h_source.html',''); initResizable(); }); 71/* @license-end */ 72</script> 73<div id="doc-content"> 74<!-- window showing the filter options --> 75<div id="MSearchSelectWindow" 76 onmouseover="return searchBox.OnSearchSelectShow()" 77 onmouseout="return searchBox.OnSearchSelectHide()" 78 onkeydown="return searchBox.OnSearchSelectKey(event)"> 79</div> 80 81<!-- iframe showing the search results (closed by default) --> 82<div id="MSearchResultsWindow"> 83<iframe src="javascript:void(0)" frameborder="0" 84 name="MSearchResults" id="MSearchResults"> 85</iframe> 86</div> 87 88<div class="header"> 89 <div class="headertitle"> 90<div class="title">cgb.h</div> </div> 91</div><!--header--> 92<div class="contents"> 93<a href="cgb_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>  </div> 94<div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="preprocessor">#ifndef _CGB_H</span></div> 95<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#define _CGB_H</span></div> 96<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>  </div> 97<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#include <types.h></span></div> 98<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include <<a class="code" href="stdint_8h.html">stdint.h</a>></span></div> 99<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>  </div> 100<div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="cgb_8h.html#a4a118ad3ee36468a3fa616977a64864e"> 33</a></span> <span class="preprocessor">#define RGB(r, g, b) ((((uint16_t)(b) & 0x1f) << 10) | (((uint16_t)(g) & 0x1f) << 5) | (((uint16_t)(r) & 0x1f) << 0))</span></div> 101<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  </div> 102<div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="cgb_8h.html#a7d2ed0f10b2b74123a544327bbfd7564"> 47</a></span> <span class="preprocessor">#define RGB8(r, g, b) ((uint16_t)((r) >> 3) | ((uint16_t)((g) >> 3) << 5) | ((uint16_t)((b) >> 3) << 10))</span></div> 103<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  </div> 104<div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="cgb_8h.html#ab5a6e450fcf10402278fe585a421dbbd"> 59</a></span> <span class="preprocessor">#define RGBHTML(RGB24bit) (RGB8((((RGB24bit) >> 16) & 0xFF), (((RGB24bit) >> 8) & 0xFF), ((RGB24bit) & 0xFF)))</span></div> 105<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  </div> 106<div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="cgb_8h.html#aa039288455af8a3812a35aa1e7b903e4"> 63</a></span> <span class="preprocessor">#define RGB_RED RGB(31, 0, 0)</span></div> 107<div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="cgb_8h.html#ae29b6947ac7dca7db513e59f1cfcbf51"> 64</a></span> <span class="preprocessor">#define RGB_DARKRED RGB(15, 0, 0)</span></div> 108<div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="cgb_8h.html#ab6c97468034c02fe204fd37036d9be15"> 65</a></span> <span class="preprocessor">#define RGB_GREEN RGB( 0, 31, 0)</span></div> 109<div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="cgb_8h.html#a1ee7a5d8fd635e9132a2820a60f9789d"> 66</a></span> <span class="preprocessor">#define RGB_DARKGREEN RGB( 0, 15, 0)</span></div> 110<div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="cgb_8h.html#a0eff802f1ca228046476209dc01c76ad"> 67</a></span> <span class="preprocessor">#define RGB_BLUE RGB( 0, 0, 31)</span></div> 111<div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="cgb_8h.html#ad44385fc245bbabf6da787dcc8930385"> 68</a></span> <span class="preprocessor">#define RGB_DARKBLUE RGB( 0, 0, 15)</span></div> 112<div class="line"><a name="l00069"></a><span class="lineno"><a class="line" href="cgb_8h.html#ad74a18fca945f257dc9d1b99f9edbd40"> 69</a></span> <span class="preprocessor">#define RGB_YELLOW RGB(31, 31, 0)</span></div> 113<div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="cgb_8h.html#a2727da9f8c0b09a67375575a00186e2a"> 70</a></span> <span class="preprocessor">#define RGB_DARKYELLOW RGB(21, 21, 0)</span></div> 114<div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="cgb_8h.html#a2ce30ac984869b55594447722b9d0579"> 71</a></span> <span class="preprocessor">#define RGB_CYAN RGB( 0, 31, 31)</span></div> 115<div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="cgb_8h.html#ae4fe0c6cfa46b0c4804425f23bb48f4c"> 72</a></span> <span class="preprocessor">#define RGB_AQUA RGB(28, 5, 22)</span></div> 116<div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="cgb_8h.html#a59fb596d3d65cfc4d3cb7e5044b8b10a"> 73</a></span> <span class="preprocessor">#define RGB_PINK RGB(31, 0, 31)</span></div> 117<div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="cgb_8h.html#a9d5a5f880df6bd4b64e6546839d41101"> 74</a></span> <span class="preprocessor">#define RGB_PURPLE RGB(21, 0, 21)</span></div> 118<div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="cgb_8h.html#ae168f0f9864d4ed4be7807b9783f17f1"> 75</a></span> <span class="preprocessor">#define RGB_BLACK RGB( 0, 0, 0)</span></div> 119<div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="cgb_8h.html#a29b47e2361025eabcdc3bcbff2308044"> 76</a></span> <span class="preprocessor">#define RGB_DARKGRAY RGB(10, 10, 10)</span></div> 120<div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="cgb_8h.html#a80efbf7b13421922fb174f3e6a3e235c"> 77</a></span> <span class="preprocessor">#define RGB_LIGHTGRAY RGB(21, 21, 21)</span></div> 121<div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="cgb_8h.html#ac1771f95d9887118764bd8a074e537e1"> 78</a></span> <span class="preprocessor">#define RGB_WHITE RGB(31, 31, 31)</span></div> 122<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  </div> 123<div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="cgb_8h.html#a90ef6e9a3d95516b1fef15076b1b4999"> 80</a></span> <span class="preprocessor">#define RGB_LIGHTFLESH RGB(30, 20, 15)</span></div> 124<div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="cgb_8h.html#a7c2a437dfb89d663a1c2f0a7a9256474"> 81</a></span> <span class="preprocessor">#define RGB_BROWN RGB(10, 10, 0)</span></div> 125<div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="cgb_8h.html#a0a85d8d0da8edc5cce98f48701f903f7"> 82</a></span> <span class="preprocessor">#define RGB_ORANGE RGB(30, 20, 0)</span></div> 126<div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="cgb_8h.html#a9c8c3710151b2258ea8269850498703f"> 83</a></span> <span class="preprocessor">#define RGB_TEAL RGB(15, 15, 0)</span></div> 127<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  </div> 128<div class="line"><a name="l00085"></a><span class="lineno"><a class="line" href="cgb_8h.html#af868d7cdbd052c6b972ef137e02f6495"> 85</a></span> <span class="keyword">typedef</span> <a class="code" href="stdint_8h.html#adf4d876453337156dde61095e1f20223">uint16_t</a> <a class="code" href="cgb_8h.html#af868d7cdbd052c6b972ef137e02f6495">palette_color_t</a>; </div> 129<div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="cgb_8h.html#aa8851ca1f515ca55cbf9f6ff53b08e8a"> 102</a></span> <span class="keywordtype">void</span> <a class="code" href="cgb_8h.html#aa8851ca1f515ca55cbf9f6ff53b08e8a">set_bkg_palette</a>(<a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> first_palette, <a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> nb_palettes, <a class="code" href="cgb_8h.html#af868d7cdbd052c6b972ef137e02f6495">palette_color_t</a> *rgb_data) <a class="code" href="asm_2types_8h.html#a0971918860055db2e50dacea4da8f3bc">OLDCALL</a>;</div> 130<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  </div> 131<div class="line"><a name="l00119"></a><span class="lineno"><a class="line" href="cgb_8h.html#a9ca9f825284da0db522d15aa2e42a4af"> 119</a></span> <span class="keywordtype">void</span> <a class="code" href="cgb_8h.html#a9ca9f825284da0db522d15aa2e42a4af">set_sprite_palette</a>(<a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> first_palette, <a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> nb_palettes, <a class="code" href="cgb_8h.html#af868d7cdbd052c6b972ef137e02f6495">palette_color_t</a> *rgb_data) <a class="code" href="asm_2types_8h.html#a0971918860055db2e50dacea4da8f3bc">OLDCALL</a>;</div> 132<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  </div> 133<div class="line"><a name="l00130"></a><span class="lineno"><a class="line" href="cgb_8h.html#aa8881ff123f364f2e7d1e88c18f9fbca"> 130</a></span> <span class="keywordtype">void</span> <a class="code" href="cgb_8h.html#aa8881ff123f364f2e7d1e88c18f9fbca">set_bkg_palette_entry</a>(<a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> palette, <a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> entry, <a class="code" href="stdint_8h.html#adf4d876453337156dde61095e1f20223">uint16_t</a> rgb_data) <a class="code" href="asm_2types_8h.html#a0971918860055db2e50dacea4da8f3bc">OLDCALL</a>;</div> 134<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  </div> 135<div class="line"><a name="l00140"></a><span class="lineno"><a class="line" href="cgb_8h.html#aebeb7431ebd400baed34796a8f50ea58"> 140</a></span> <span class="keywordtype">void</span> <a class="code" href="cgb_8h.html#aebeb7431ebd400baed34796a8f50ea58">set_sprite_palette_entry</a>(<a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> palette, <a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> entry, <a class="code" href="stdint_8h.html#adf4d876453337156dde61095e1f20223">uint16_t</a> rgb_data) <a class="code" href="asm_2types_8h.html#a0971918860055db2e50dacea4da8f3bc">OLDCALL</a>;</div> 136<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  </div> 137<div class="line"><a name="l00152"></a><span class="lineno"><a class="line" href="cgb_8h.html#a6a36fb9584e4a123f6164530a3b1e5e2"> 152</a></span> <span class="keywordtype">void</span> <a class="code" href="cgb_8h.html#a6a36fb9584e4a123f6164530a3b1e5e2">cpu_slow</a>();</div> 138<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  </div> 139<div class="line"><a name="l00166"></a><span class="lineno"> 166</span> <span class="keywordtype">void</span> <a class="code" href="cgb_8h.html#a884a743919b234cd9c37789380784d08">cpu_fast</a>();</div> 140<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  </div> 141<div class="line"><a name="l00176"></a><span class="lineno"><a class="line" href="cgb_8h.html#abd34836339579013c097ae4dea10c014"> 176</a></span> <span class="keywordtype">void</span> <a class="code" href="cgb_8h.html#abd34836339579013c097ae4dea10c014">set_default_palette</a>();</div> 142<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  </div> 143<div class="line"><a name="l00180"></a><span class="lineno"><a class="line" href="cgb_8h.html#ac2dd234782ac786758952496b017ab97"> 180</a></span> <span class="keywordtype">void</span> <a class="code" href="cgb_8h.html#ac2dd234782ac786758952496b017ab97">cgb_compatibility</a>();</div> 144<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  </div> 145<div class="line"><a name="l00182"></a><span class="lineno"> 182</span> <span class="preprocessor">#endif </span><span class="comment">/* _CGB_H */</span><span class="preprocessor"></span></div> 146</div><!-- fragment --></div><!-- contents --> 147</div><!-- doc-content --> 148<div class="ttc" id="astdint_8h_html_aba7bc1797add20fe3efdf37ced1182c5"><div class="ttname"><a href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a></div><div class="ttdeci">unsigned char uint8_t</div><div class="ttdef"><b>Definition:</b> stdint.h:51</div></div> 149<div class="ttc" id="acgb_8h_html_a6a36fb9584e4a123f6164530a3b1e5e2"><div class="ttname"><a href="cgb_8h.html#a6a36fb9584e4a123f6164530a3b1e5e2">cpu_slow</a></div><div class="ttdeci">void cpu_slow()</div></div> 150<div class="ttc" id="astdint_8h_html_adf4d876453337156dde61095e1f20223"><div class="ttname"><a href="stdint_8h.html#adf4d876453337156dde61095e1f20223">uint16_t</a></div><div class="ttdeci">unsigned short int uint16_t</div><div class="ttdef"><b>Definition:</b> stdint.h:52</div></div> 151<div class="ttc" id="acgb_8h_html_ac2dd234782ac786758952496b017ab97"><div class="ttname"><a href="cgb_8h.html#ac2dd234782ac786758952496b017ab97">cgb_compatibility</a></div><div class="ttdeci">void cgb_compatibility()</div></div> 152<div class="ttc" id="acgb_8h_html_aa8851ca1f515ca55cbf9f6ff53b08e8a"><div class="ttname"><a href="cgb_8h.html#aa8851ca1f515ca55cbf9f6ff53b08e8a">set_bkg_palette</a></div><div class="ttdeci">void set_bkg_palette(uint8_t first_palette, uint8_t nb_palettes, palette_color_t *rgb_data) OLDCALL</div></div> 153<div class="ttc" id="acgb_8h_html_aebeb7431ebd400baed34796a8f50ea58"><div class="ttname"><a href="cgb_8h.html#aebeb7431ebd400baed34796a8f50ea58">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> 154<div class="ttc" id="astdint_8h_html"><div class="ttname"><a href="stdint_8h.html">stdint.h</a></div></div> 155<div class="ttc" id="acgb_8h_html_af868d7cdbd052c6b972ef137e02f6495"><div class="ttname"><a href="cgb_8h.html#af868d7cdbd052c6b972ef137e02f6495">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> 156<div class="ttc" id="acgb_8h_html_a884a743919b234cd9c37789380784d08"><div class="ttname"><a href="cgb_8h.html#a884a743919b234cd9c37789380784d08">cpu_fast</a></div><div class="ttdeci">void cpu_fast()</div><div class="ttdef"><b>Definition:</b> sms.h:506</div></div> 157<div class="ttc" id="aasm_2types_8h_html_a0971918860055db2e50dacea4da8f3bc"><div class="ttname"><a href="asm_2types_8h.html#a0971918860055db2e50dacea4da8f3bc">OLDCALL</a></div><div class="ttdeci">#define OLDCALL</div><div class="ttdef"><b>Definition:</b> types.h:19</div></div> 158<div class="ttc" id="acgb_8h_html_aa8881ff123f364f2e7d1e88c18f9fbca"><div class="ttname"><a href="cgb_8h.html#aa8881ff123f364f2e7d1e88c18f9fbca">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> 159<div class="ttc" id="acgb_8h_html_a9ca9f825284da0db522d15aa2e42a4af"><div class="ttname"><a href="cgb_8h.html#a9ca9f825284da0db522d15aa2e42a4af">set_sprite_palette</a></div><div class="ttdeci">void set_sprite_palette(uint8_t first_palette, uint8_t nb_palettes, palette_color_t *rgb_data) OLDCALL</div></div> 160<div class="ttc" id="acgb_8h_html_abd34836339579013c097ae4dea10c014"><div class="ttname"><a href="cgb_8h.html#abd34836339579013c097ae4dea10c014">set_default_palette</a></div><div class="ttdeci">void set_default_palette()</div></div> 161<!-- HTML footer for doxygen 1.8.14--> 162<!-- start footer part --> 163<div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> 164</div> 165</body> 166</html>