sgb_8h.html (32207B)
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/sgb.h File Reference</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('sgb_8h.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="summary"> 90<a href="#define-members">Macros</a> | 91<a href="#func-members">Functions</a> | 92<a href="#var-members">Variables</a> </div> 93 <div class="headertitle"> 94<div class="title">sgb.h File Reference</div> </div> 95</div><!--header--> 96<div class="contents"> 97<div class="textblock"><code>#include <types.h></code><br /> 98<code>#include <<a class="el" href="stdint_8h_source.html">stdint.h</a>></code><br /> 99</div> 100<p><a href="sgb_8h_source.html">Go to the source code of this file.</a></p> 101<table class="memberdecls"> 102<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a> 103Macros</h2></td></tr> 104<tr class="memitem:a70bdb512d109fbcaeb95efa32e9dcaf5"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a70bdb512d109fbcaeb95efa32e9dcaf5">SGB_PAL_01</a>   0x00U</td></tr> 105<tr class="separator:a70bdb512d109fbcaeb95efa32e9dcaf5"><td class="memSeparator" colspan="2"> </td></tr> 106<tr class="memitem:acaa2f1ac9949189896582fc5ad0823b1"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#acaa2f1ac9949189896582fc5ad0823b1">SGB_PAL_23</a>   0x01U</td></tr> 107<tr class="separator:acaa2f1ac9949189896582fc5ad0823b1"><td class="memSeparator" colspan="2"> </td></tr> 108<tr class="memitem:af9e1ca804555fad619db3f38b62a49e8"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#af9e1ca804555fad619db3f38b62a49e8">SGB_PAL_03</a>   0x02U</td></tr> 109<tr class="separator:af9e1ca804555fad619db3f38b62a49e8"><td class="memSeparator" colspan="2"> </td></tr> 110<tr class="memitem:a8d633d52d4a7adfaef516953d5e8552a"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a8d633d52d4a7adfaef516953d5e8552a">SGB_PAL_12</a>   0x03U</td></tr> 111<tr class="separator:a8d633d52d4a7adfaef516953d5e8552a"><td class="memSeparator" colspan="2"> </td></tr> 112<tr class="memitem:a6437bd5982922fffdbc7c5d8c643e357"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a6437bd5982922fffdbc7c5d8c643e357">SGB_ATTR_BLK</a>   0x04U</td></tr> 113<tr class="separator:a6437bd5982922fffdbc7c5d8c643e357"><td class="memSeparator" colspan="2"> </td></tr> 114<tr class="memitem:ade5ba9723a9964e55cff72108149037a"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#ade5ba9723a9964e55cff72108149037a">SGB_ATTR_LIN</a>   0x05U</td></tr> 115<tr class="separator:ade5ba9723a9964e55cff72108149037a"><td class="memSeparator" colspan="2"> </td></tr> 116<tr class="memitem:adcb3f50616813637283f88bfd4d53e22"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#adcb3f50616813637283f88bfd4d53e22">SGB_ATTR_DIV</a>   0x06U</td></tr> 117<tr class="separator:adcb3f50616813637283f88bfd4d53e22"><td class="memSeparator" colspan="2"> </td></tr> 118<tr class="memitem:a41981a213b67bdc45bf8ed78f07e7bba"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a41981a213b67bdc45bf8ed78f07e7bba">SGB_ATTR_CHR</a>   0x07U</td></tr> 119<tr class="separator:a41981a213b67bdc45bf8ed78f07e7bba"><td class="memSeparator" colspan="2"> </td></tr> 120<tr class="memitem:a42e0fbc58e65874e0a76d7f33a322ce8"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a42e0fbc58e65874e0a76d7f33a322ce8">SGB_SOUND</a>   0x08U</td></tr> 121<tr class="separator:a42e0fbc58e65874e0a76d7f33a322ce8"><td class="memSeparator" colspan="2"> </td></tr> 122<tr class="memitem:a82a976ea6a32ae0078a27e3c06143bcf"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a82a976ea6a32ae0078a27e3c06143bcf">SGB_SOU_TRN</a>   0x09U</td></tr> 123<tr class="separator:a82a976ea6a32ae0078a27e3c06143bcf"><td class="memSeparator" colspan="2"> </td></tr> 124<tr class="memitem:ad9023ed1d8dd4a2eebc55a376207f3d2"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#ad9023ed1d8dd4a2eebc55a376207f3d2">SGB_PAL_SET</a>   0x0AU</td></tr> 125<tr class="separator:ad9023ed1d8dd4a2eebc55a376207f3d2"><td class="memSeparator" colspan="2"> </td></tr> 126<tr class="memitem:ac490ce8566f869727e8b00fabb1c9fc6"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#ac490ce8566f869727e8b00fabb1c9fc6">SGB_PAL_TRN</a>   0x0BU</td></tr> 127<tr class="separator:ac490ce8566f869727e8b00fabb1c9fc6"><td class="memSeparator" colspan="2"> </td></tr> 128<tr class="memitem:a3d81b1e455d60d760ee58e2685953775"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a3d81b1e455d60d760ee58e2685953775">SGB_ATRC_EN</a>   0x0CU</td></tr> 129<tr class="separator:a3d81b1e455d60d760ee58e2685953775"><td class="memSeparator" colspan="2"> </td></tr> 130<tr class="memitem:a8e644a43af63932283e9c78a472881dc"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a8e644a43af63932283e9c78a472881dc">SGB_TEST_EN</a>   0x0DU</td></tr> 131<tr class="separator:a8e644a43af63932283e9c78a472881dc"><td class="memSeparator" colspan="2"> </td></tr> 132<tr class="memitem:a46440df1df1597852a286d56c1a68a48"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a46440df1df1597852a286d56c1a68a48">SGB_ICON_EN</a>   0x0EU</td></tr> 133<tr class="separator:a46440df1df1597852a286d56c1a68a48"><td class="memSeparator" colspan="2"> </td></tr> 134<tr class="memitem:ae4fe10a0c9eca38d126f3a8701e3c9a2"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#ae4fe10a0c9eca38d126f3a8701e3c9a2">SGB_DATA_SND</a>   0x0FU</td></tr> 135<tr class="separator:ae4fe10a0c9eca38d126f3a8701e3c9a2"><td class="memSeparator" colspan="2"> </td></tr> 136<tr class="memitem:a862a450451cfccf138311089b85292fc"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a862a450451cfccf138311089b85292fc">SGB_DATA_TRN</a>   0x10U</td></tr> 137<tr class="separator:a862a450451cfccf138311089b85292fc"><td class="memSeparator" colspan="2"> </td></tr> 138<tr class="memitem:a70aad9e5786ca8a4753c47583e88f8a2"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a70aad9e5786ca8a4753c47583e88f8a2">SGB_MLT_REQ</a>   0x11U</td></tr> 139<tr class="separator:a70aad9e5786ca8a4753c47583e88f8a2"><td class="memSeparator" colspan="2"> </td></tr> 140<tr class="memitem:aac4217b88053614f70af5b1f32e72870"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#aac4217b88053614f70af5b1f32e72870">SGB_JUMP</a>   0x12U</td></tr> 141<tr class="separator:aac4217b88053614f70af5b1f32e72870"><td class="memSeparator" colspan="2"> </td></tr> 142<tr class="memitem:af4d8b611dfdda33039038375ee95f424"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#af4d8b611dfdda33039038375ee95f424">SGB_CHR_TRN</a>   0x13U</td></tr> 143<tr class="separator:af4d8b611dfdda33039038375ee95f424"><td class="memSeparator" colspan="2"> </td></tr> 144<tr class="memitem:ac0bf9d5dc54d711fd14f44bf58eaa5db"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#ac0bf9d5dc54d711fd14f44bf58eaa5db">SGB_PCT_TRN</a>   0x14U</td></tr> 145<tr class="separator:ac0bf9d5dc54d711fd14f44bf58eaa5db"><td class="memSeparator" colspan="2"> </td></tr> 146<tr class="memitem:a1762d2df2599cf864400bac4934a5d61"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a1762d2df2599cf864400bac4934a5d61">SGB_ATTR_TRN</a>   0x15U</td></tr> 147<tr class="separator:a1762d2df2599cf864400bac4934a5d61"><td class="memSeparator" colspan="2"> </td></tr> 148<tr class="memitem:abf8d94c42e97e1ce640340657df70640"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#abf8d94c42e97e1ce640340657df70640">SGB_ATTR_SET</a>   0x16U</td></tr> 149<tr class="separator:abf8d94c42e97e1ce640340657df70640"><td class="memSeparator" colspan="2"> </td></tr> 150<tr class="memitem:a20477d5772564b63de2d151e062dd5a7"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a20477d5772564b63de2d151e062dd5a7">SGB_MASK_EN</a>   0x17U</td></tr> 151<tr class="separator:a20477d5772564b63de2d151e062dd5a7"><td class="memSeparator" colspan="2"> </td></tr> 152<tr class="memitem:a3b76bf1e9ac81da97c533fa3ab12096c"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a3b76bf1e9ac81da97c533fa3ab12096c">SGB_OBJ_TRN</a>   0x18U</td></tr> 153<tr class="separator:a3b76bf1e9ac81da97c533fa3ab12096c"><td class="memSeparator" colspan="2"> </td></tr> 154</table><table class="memberdecls"> 155<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> 156Functions</h2></td></tr> 157<tr class="memitem:a48bc560ec2455bf97002e03c0a6055f0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a48bc560ec2455bf97002e03c0a6055f0">sgb_check</a> () <a class="el" href="asm_2types_8h.html#a0971918860055db2e50dacea4da8f3bc">OLDCALL</a> <a class="el" href="asm_2types_8h.html#acb825e83a33fcc06482c59b4ab2cf961">PRESERVES_REGS</a>(<a class="el" href="gb_8h.html#a4c2e4adef74067fdbb49005bc73de937">b</a></td></tr> 158<tr class="separator:a48bc560ec2455bf97002e03c0a6055f0"><td class="memSeparator" colspan="2"> </td></tr> 159<tr class="memitem:a84e1f2ab7dce1faabd3d271b6bf8df8c"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a84e1f2ab7dce1faabd3d271b6bf8df8c">sgb_transfer</a> (<a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *packet) <a class="el" href="asm_2types_8h.html#a0971918860055db2e50dacea4da8f3bc">OLDCALL</a> <a class="el" href="asm_2types_8h.html#acb825e83a33fcc06482c59b4ab2cf961">PRESERVES_REGS</a>(<a class="el" href="gb_8h.html#a4c2e4adef74067fdbb49005bc73de937">b</a></td></tr> 160<tr class="separator:a84e1f2ab7dce1faabd3d271b6bf8df8c"><td class="memSeparator" colspan="2"> </td></tr> 161</table><table class="memberdecls"> 162<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a> 163Variables</h2></td></tr> 164<tr class="memitem:a0b3366755f3276b0243c1e0497471b7a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="sgb_8h.html#a0b3366755f3276b0243c1e0497471b7a">c</a></td></tr> 165<tr class="separator:a0b3366755f3276b0243c1e0497471b7a"><td class="memSeparator" colspan="2"> </td></tr> 166</table> 167<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> 168<div class="textblock"><p>Super Gameboy definitions.</p> 169<p>See the example SGB project for additional details. </p> 170</div><h2 class="groupheader">Macro Definition Documentation</h2> 171<a id="a70bdb512d109fbcaeb95efa32e9dcaf5"></a> 172<h2 class="memtitle"><span class="permalink"><a href="#a70bdb512d109fbcaeb95efa32e9dcaf5">◆ </a></span>SGB_PAL_01</h2> 173 174<div class="memitem"> 175<div class="memproto"> 176 <table class="memname"> 177 <tr> 178 <td class="memname">#define SGB_PAL_01   0x00U</td> 179 </tr> 180 </table> 181</div><div class="memdoc"> 182<p>SGB Command: Set SGB Palettes 0 & 1 </p> 183 184</div> 185</div> 186<a id="acaa2f1ac9949189896582fc5ad0823b1"></a> 187<h2 class="memtitle"><span class="permalink"><a href="#acaa2f1ac9949189896582fc5ad0823b1">◆ </a></span>SGB_PAL_23</h2> 188 189<div class="memitem"> 190<div class="memproto"> 191 <table class="memname"> 192 <tr> 193 <td class="memname">#define SGB_PAL_23   0x01U</td> 194 </tr> 195 </table> 196</div><div class="memdoc"> 197<p>SGB Command: Set SGB Palettes 2 & 3 </p> 198 199</div> 200</div> 201<a id="af9e1ca804555fad619db3f38b62a49e8"></a> 202<h2 class="memtitle"><span class="permalink"><a href="#af9e1ca804555fad619db3f38b62a49e8">◆ </a></span>SGB_PAL_03</h2> 203 204<div class="memitem"> 205<div class="memproto"> 206 <table class="memname"> 207 <tr> 208 <td class="memname">#define SGB_PAL_03   0x02U</td> 209 </tr> 210 </table> 211</div><div class="memdoc"> 212<p>SGB Command: Set SGB Palettes 0 & 3 </p> 213 214</div> 215</div> 216<a id="a8d633d52d4a7adfaef516953d5e8552a"></a> 217<h2 class="memtitle"><span class="permalink"><a href="#a8d633d52d4a7adfaef516953d5e8552a">◆ </a></span>SGB_PAL_12</h2> 218 219<div class="memitem"> 220<div class="memproto"> 221 <table class="memname"> 222 <tr> 223 <td class="memname">#define SGB_PAL_12   0x03U</td> 224 </tr> 225 </table> 226</div><div class="memdoc"> 227<p>SGB Command: Set SGB Palettes 1 & 2 </p> 228 229</div> 230</div> 231<a id="a6437bd5982922fffdbc7c5d8c643e357"></a> 232<h2 class="memtitle"><span class="permalink"><a href="#a6437bd5982922fffdbc7c5d8c643e357">◆ </a></span>SGB_ATTR_BLK</h2> 233 234<div class="memitem"> 235<div class="memproto"> 236 <table class="memname"> 237 <tr> 238 <td class="memname">#define SGB_ATTR_BLK   0x04U</td> 239 </tr> 240 </table> 241</div><div class="memdoc"> 242<p>SGB Command: Set color attributes for rectangular regions </p> 243 244</div> 245</div> 246<a id="ade5ba9723a9964e55cff72108149037a"></a> 247<h2 class="memtitle"><span class="permalink"><a href="#ade5ba9723a9964e55cff72108149037a">◆ </a></span>SGB_ATTR_LIN</h2> 248 249<div class="memitem"> 250<div class="memproto"> 251 <table class="memname"> 252 <tr> 253 <td class="memname">#define SGB_ATTR_LIN   0x05U</td> 254 </tr> 255 </table> 256</div><div class="memdoc"> 257<p>SGB Command: Set color attributes for horizontal or vertical character lines </p> 258 259</div> 260</div> 261<a id="adcb3f50616813637283f88bfd4d53e22"></a> 262<h2 class="memtitle"><span class="permalink"><a href="#adcb3f50616813637283f88bfd4d53e22">◆ </a></span>SGB_ATTR_DIV</h2> 263 264<div class="memitem"> 265<div class="memproto"> 266 <table class="memname"> 267 <tr> 268 <td class="memname">#define SGB_ATTR_DIV   0x06U</td> 269 </tr> 270 </table> 271</div><div class="memdoc"> 272<p>SGB Command: Split screen in half and assign separate color attribes to each side and the divider </p> 273 274</div> 275</div> 276<a id="a41981a213b67bdc45bf8ed78f07e7bba"></a> 277<h2 class="memtitle"><span class="permalink"><a href="#a41981a213b67bdc45bf8ed78f07e7bba">◆ </a></span>SGB_ATTR_CHR</h2> 278 279<div class="memitem"> 280<div class="memproto"> 281 <table class="memname"> 282 <tr> 283 <td class="memname">#define SGB_ATTR_CHR   0x07U</td> 284 </tr> 285 </table> 286</div><div class="memdoc"> 287<p>SGB Command: Set color attributes for separate charactersSet SGB Palette 0,1 Data </p> 288 289</div> 290</div> 291<a id="a42e0fbc58e65874e0a76d7f33a322ce8"></a> 292<h2 class="memtitle"><span class="permalink"><a href="#a42e0fbc58e65874e0a76d7f33a322ce8">◆ </a></span>SGB_SOUND</h2> 293 294<div class="memitem"> 295<div class="memproto"> 296 <table class="memname"> 297 <tr> 298 <td class="memname">#define SGB_SOUND   0x08U</td> 299 </tr> 300 </table> 301</div><div class="memdoc"> 302<p>SGB Command: Start and stop a internal sound effect, and sounds using internal tone data </p> 303 304</div> 305</div> 306<a id="a82a976ea6a32ae0078a27e3c06143bcf"></a> 307<h2 class="memtitle"><span class="permalink"><a href="#a82a976ea6a32ae0078a27e3c06143bcf">◆ </a></span>SGB_SOU_TRN</h2> 308 309<div class="memitem"> 310<div class="memproto"> 311 <table class="memname"> 312 <tr> 313 <td class="memname">#define SGB_SOU_TRN   0x09U</td> 314 </tr> 315 </table> 316</div><div class="memdoc"> 317<p>SGB Command: Transfer sound code or data to the SNES APU RAM </p> 318 319</div> 320</div> 321<a id="ad9023ed1d8dd4a2eebc55a376207f3d2"></a> 322<h2 class="memtitle"><span class="permalink"><a href="#ad9023ed1d8dd4a2eebc55a376207f3d2">◆ </a></span>SGB_PAL_SET</h2> 323 324<div class="memitem"> 325<div class="memproto"> 326 <table class="memname"> 327 <tr> 328 <td class="memname">#define SGB_PAL_SET   0x0AU</td> 329 </tr> 330 </table> 331</div><div class="memdoc"> 332<p>SGB Command: Apply (previously transferred) SGB system color palettes to actual SNES palettes </p> 333 334</div> 335</div> 336<a id="ac490ce8566f869727e8b00fabb1c9fc6"></a> 337<h2 class="memtitle"><span class="permalink"><a href="#ac490ce8566f869727e8b00fabb1c9fc6">◆ </a></span>SGB_PAL_TRN</h2> 338 339<div class="memitem"> 340<div class="memproto"> 341 <table class="memname"> 342 <tr> 343 <td class="memname">#define SGB_PAL_TRN   0x0BU</td> 344 </tr> 345 </table> 346</div><div class="memdoc"> 347<p>SGB Command: Transfer palette data into SGB system color palettes </p> 348 349</div> 350</div> 351<a id="a3d81b1e455d60d760ee58e2685953775"></a> 352<h2 class="memtitle"><span class="permalink"><a href="#a3d81b1e455d60d760ee58e2685953775">◆ </a></span>SGB_ATRC_EN</h2> 353 354<div class="memitem"> 355<div class="memproto"> 356 <table class="memname"> 357 <tr> 358 <td class="memname">#define SGB_ATRC_EN   0x0CU</td> 359 </tr> 360 </table> 361</div><div class="memdoc"> 362<p>SGB Command: Enable/disable Attraction mode. It is enabled by default </p> 363 364</div> 365</div> 366<a id="a8e644a43af63932283e9c78a472881dc"></a> 367<h2 class="memtitle"><span class="permalink"><a href="#a8e644a43af63932283e9c78a472881dc">◆ </a></span>SGB_TEST_EN</h2> 368 369<div class="memitem"> 370<div class="memproto"> 371 <table class="memname"> 372 <tr> 373 <td class="memname">#define SGB_TEST_EN   0x0DU</td> 374 </tr> 375 </table> 376</div><div class="memdoc"> 377<p>SGB Command: Enable/disable test mode for "SGB-CPU variable clock speed function" </p> 378 379</div> 380</div> 381<a id="a46440df1df1597852a286d56c1a68a48"></a> 382<h2 class="memtitle"><span class="permalink"><a href="#a46440df1df1597852a286d56c1a68a48">◆ </a></span>SGB_ICON_EN</h2> 383 384<div class="memitem"> 385<div class="memproto"> 386 <table class="memname"> 387 <tr> 388 <td class="memname">#define SGB_ICON_EN   0x0EU</td> 389 </tr> 390 </table> 391</div><div class="memdoc"> 392<p>SGB Command: Enable/disable ICON functionality </p> 393 394</div> 395</div> 396<a id="ae4fe10a0c9eca38d126f3a8701e3c9a2"></a> 397<h2 class="memtitle"><span class="permalink"><a href="#ae4fe10a0c9eca38d126f3a8701e3c9a2">◆ </a></span>SGB_DATA_SND</h2> 398 399<div class="memitem"> 400<div class="memproto"> 401 <table class="memname"> 402 <tr> 403 <td class="memname">#define SGB_DATA_SND   0x0FU</td> 404 </tr> 405 </table> 406</div><div class="memdoc"> 407<p>SGB Command: Write one or more bytes into SNES Work RAM </p> 408 409</div> 410</div> 411<a id="a862a450451cfccf138311089b85292fc"></a> 412<h2 class="memtitle"><span class="permalink"><a href="#a862a450451cfccf138311089b85292fc">◆ </a></span>SGB_DATA_TRN</h2> 413 414<div class="memitem"> 415<div class="memproto"> 416 <table class="memname"> 417 <tr> 418 <td class="memname">#define SGB_DATA_TRN   0x10U</td> 419 </tr> 420 </table> 421</div><div class="memdoc"> 422<p>SGB Command: Transfer code or data into SNES RAM </p> 423 424</div> 425</div> 426<a id="a70aad9e5786ca8a4753c47583e88f8a2"></a> 427<h2 class="memtitle"><span class="permalink"><a href="#a70aad9e5786ca8a4753c47583e88f8a2">◆ </a></span>SGB_MLT_REQ</h2> 428 429<div class="memitem"> 430<div class="memproto"> 431 <table class="memname"> 432 <tr> 433 <td class="memname">#define SGB_MLT_REQ   0x11U</td> 434 </tr> 435 </table> 436</div><div class="memdoc"> 437<p>SGB Command: Request multiplayer mode (input from more than one joypad) </p> 438 439</div> 440</div> 441<a id="aac4217b88053614f70af5b1f32e72870"></a> 442<h2 class="memtitle"><span class="permalink"><a href="#aac4217b88053614f70af5b1f32e72870">◆ </a></span>SGB_JUMP</h2> 443 444<div class="memitem"> 445<div class="memproto"> 446 <table class="memname"> 447 <tr> 448 <td class="memname">#define SGB_JUMP   0x12U</td> 449 </tr> 450 </table> 451</div><div class="memdoc"> 452<p>SGB Command: Set the SNES program counter and NMI (vblank interrupt) handler to specific addresses </p> 453 454</div> 455</div> 456<a id="af4d8b611dfdda33039038375ee95f424"></a> 457<h2 class="memtitle"><span class="permalink"><a href="#af4d8b611dfdda33039038375ee95f424">◆ </a></span>SGB_CHR_TRN</h2> 458 459<div class="memitem"> 460<div class="memproto"> 461 <table class="memname"> 462 <tr> 463 <td class="memname">#define SGB_CHR_TRN   0x13U</td> 464 </tr> 465 </table> 466</div><div class="memdoc"> 467<p>SGB Command: Transfer tile data (characters) to SNES Tile memory </p> 468 469</div> 470</div> 471<a id="ac0bf9d5dc54d711fd14f44bf58eaa5db"></a> 472<h2 class="memtitle"><span class="permalink"><a href="#ac0bf9d5dc54d711fd14f44bf58eaa5db">◆ </a></span>SGB_PCT_TRN</h2> 473 474<div class="memitem"> 475<div class="memproto"> 476 <table class="memname"> 477 <tr> 478 <td class="memname">#define SGB_PCT_TRN   0x14U</td> 479 </tr> 480 </table> 481</div><div class="memdoc"> 482<p>SGB Command: Transfer tile map and palette data to SNES BG Map memory </p> 483 484</div> 485</div> 486<a id="a1762d2df2599cf864400bac4934a5d61"></a> 487<h2 class="memtitle"><span class="permalink"><a href="#a1762d2df2599cf864400bac4934a5d61">◆ </a></span>SGB_ATTR_TRN</h2> 488 489<div class="memitem"> 490<div class="memproto"> 491 <table class="memname"> 492 <tr> 493 <td class="memname">#define SGB_ATTR_TRN   0x15U</td> 494 </tr> 495 </table> 496</div><div class="memdoc"> 497<p>SGB Command: Transfer data to (color) Attribute Files (ATFs) in SNES RAM </p> 498 499</div> 500</div> 501<a id="abf8d94c42e97e1ce640340657df70640"></a> 502<h2 class="memtitle"><span class="permalink"><a href="#abf8d94c42e97e1ce640340657df70640">◆ </a></span>SGB_ATTR_SET</h2> 503 504<div class="memitem"> 505<div class="memproto"> 506 <table class="memname"> 507 <tr> 508 <td class="memname">#define SGB_ATTR_SET   0x16U</td> 509 </tr> 510 </table> 511</div><div class="memdoc"> 512<p>SGB Command: Transfer attributes from (color) Attribute Files (ATF) to the Game Boy window </p> 513 514</div> 515</div> 516<a id="a20477d5772564b63de2d151e062dd5a7"></a> 517<h2 class="memtitle"><span class="permalink"><a href="#a20477d5772564b63de2d151e062dd5a7">◆ </a></span>SGB_MASK_EN</h2> 518 519<div class="memitem"> 520<div class="memproto"> 521 <table class="memname"> 522 <tr> 523 <td class="memname">#define SGB_MASK_EN   0x17U</td> 524 </tr> 525 </table> 526</div><div class="memdoc"> 527<p>SGB Command: Modify Game Boy window mask settings </p> 528 529</div> 530</div> 531<a id="a3b76bf1e9ac81da97c533fa3ab12096c"></a> 532<h2 class="memtitle"><span class="permalink"><a href="#a3b76bf1e9ac81da97c533fa3ab12096c">◆ </a></span>SGB_OBJ_TRN</h2> 533 534<div class="memitem"> 535<div class="memproto"> 536 <table class="memname"> 537 <tr> 538 <td class="memname">#define SGB_OBJ_TRN   0x18U</td> 539 </tr> 540 </table> 541</div><div class="memdoc"> 542<p>SGB Command: Transfer OBJ attributes to SNES OAM memory </p> 543 544</div> 545</div> 546<h2 class="groupheader">Function Documentation</h2> 547<a id="a48bc560ec2455bf97002e03c0a6055f0"></a> 548<h2 class="memtitle"><span class="permalink"><a href="#a48bc560ec2455bf97002e03c0a6055f0">◆ </a></span>sgb_check()</h2> 549 550<div class="memitem"> 551<div class="memproto"> 552 <table class="memname"> 553 <tr> 554 <td class="memname"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> sgb_check </td> 555 <td>(</td> 556 <td class="paramname"></td><td>)</td> 557 <td></td> 558 </tr> 559 </table> 560</div><div class="memdoc"> 561<p>Returns a non-null value if running on Super GameBoy </p> 562 563</div> 564</div> 565<a id="a84e1f2ab7dce1faabd3d271b6bf8df8c"></a> 566<h2 class="memtitle"><span class="permalink"><a href="#a84e1f2ab7dce1faabd3d271b6bf8df8c">◆ </a></span>sgb_transfer()</h2> 567 568<div class="memitem"> 569<div class="memproto"> 570 <table class="memname"> 571 <tr> 572 <td class="memname">void sgb_transfer </td> 573 <td>(</td> 574 <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> * </td> 575 <td class="paramname"><em>packet</em></td><td>)</td> 576 <td></td> 577 </tr> 578 </table> 579</div><div class="memdoc"> 580<p>Transfer a SGB packet</p> 581<dl class="params"><dt>Parameters</dt><dd> 582 <table class="params"> 583 <tr><td class="paramname">packet</td><td>Pointer to buffer with SGB packet data.</td></tr> 584 </table> 585 </dd> 586</dl> 587<p>The first byte of <b>packet</b> should be a SGB command, then up to 15 bytes of command parameter data.</p> 588<p>See the <code>sgb_border</code> GBDK example project for a demo of how to use these the sgb functions.</p> 589<p>When using the SGB with a PAL SNES, a delay should be added just after program startup such as:</p> 590<div class="fragment"><div class="line"><span class="comment">// Wait 4 frames</span></div> 591<div class="line"><span class="comment">// For PAL SNES this delay is required on startup</span></div> 592<div class="line"><span class="keywordflow">for</span> (<a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> i = 4; i != 0; i--) <a class="code" href="gb_8h.html#acd186eb292d441f9389e77b545a55619">wait_vbl_done</a>();</div> 593</div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><a class="el" href="sgb_8h.html#a48bc560ec2455bf97002e03c0a6055f0">sgb_check()</a> </dd></dl> 594 595</div> 596</div> 597<h2 class="groupheader">Variable Documentation</h2> 598<a id="a0b3366755f3276b0243c1e0497471b7a"></a> 599<h2 class="memtitle"><span class="permalink"><a href="#a0b3366755f3276b0243c1e0497471b7a">◆ </a></span>c</h2> 600 601<div class="memitem"> 602<div class="memproto"> 603 <table class="memname"> 604 <tr> 605 <td class="memname">void c</td> 606 </tr> 607 </table> 608</div><div class="memdoc"> 609 610</div> 611</div> 612</div><!-- contents --> 613</div><!-- doc-content --> 614<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> 615<div class="ttc" id="agb_8h_html_acd186eb292d441f9389e77b545a55619"><div class="ttname"><a href="gb_8h.html#acd186eb292d441f9389e77b545a55619">wait_vbl_done</a></div><div class="ttdeci">void wait_vbl_done() PRESERVES_REGS(b</div></div> 616<!-- HTML footer for doxygen 1.8.14--> 617<!-- start footer part --> 618<div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> 619</div> 620</body> 621</html>