gb_2metasprites_8h.html (41326B)
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/metasprites.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('gb_2metasprites_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="#nested-classes">Data Structures</a> | 91<a href="#define-members">Macros</a> | 92<a href="#typedef-members">Typedefs</a> | 93<a href="#func-members">Functions</a> | 94<a href="#var-members">Variables</a> </div> 95 <div class="headertitle"> 96<div class="title">metasprites.h File Reference</div> </div> 97</div><!--header--> 98<div class="contents"> 99<div class="textblock"><code>#include <<a class="el" href="gb_2hardware_8h_source.html">gb/hardware.h</a>></code><br /> 100<code>#include <types.h></code><br /> 101<code>#include <<a class="el" href="stdint_8h_source.html">stdint.h</a>></code><br /> 102</div> 103<p><a href="gb_2metasprites_8h_source.html">Go to the source code of this file.</a></p> 104<table class="memberdecls"> 105<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a> 106Data Structures</h2></td></tr> 107<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structmetasprite__t.html">metasprite_t</a></td></tr> 108<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr> 109</table><table class="memberdecls"> 110<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a> 111Macros</h2></td></tr> 112<tr class="memitem:a9f9f390a57460914e27c7604b7d8379a"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="gb_2metasprites_8h.html#a9f9f390a57460914e27c7604b7d8379a">metasprite_end</a>   -128</td></tr> 113<tr class="separator:a9f9f390a57460914e27c7604b7d8379a"><td class="memSeparator" colspan="2"> </td></tr> 114<tr class="memitem:aa88dc4d5e35045509b8955a4a23a30aa"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="gb_2metasprites_8h.html#aa88dc4d5e35045509b8955a4a23a30aa">METASPR_ITEM</a>(dy, dx, dt, a)   {(dy),(dx),(dt),(a)}</td></tr> 115<tr class="separator:aa88dc4d5e35045509b8955a4a23a30aa"><td class="memSeparator" colspan="2"> </td></tr> 116<tr class="memitem:aa1d425dcce3cd104751744535b6a389a"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="gb_2metasprites_8h.html#aa1d425dcce3cd104751744535b6a389a">METASPR_TERM</a>   {<a class="el" href="sms_2metasprites_8h.html#a9f9f390a57460914e27c7604b7d8379a">metasprite_end</a>}</td></tr> 117<tr class="separator:aa1d425dcce3cd104751744535b6a389a"><td class="memSeparator" colspan="2"> </td></tr> 118</table><table class="memberdecls"> 119<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a> 120Typedefs</h2></td></tr> 121<tr class="memitem:aba6401cc8173158a9f37ee22094c03d3"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structmetasprite__t.html">metasprite_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="gb_2metasprites_8h.html#aba6401cc8173158a9f37ee22094c03d3">metasprite_t</a></td></tr> 122<tr class="separator:aba6401cc8173158a9f37ee22094c03d3"><td class="memSeparator" colspan="2"> </td></tr> 123</table><table class="memberdecls"> 124<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> 125Functions</h2></td></tr> 126<tr class="memitem:a77bb622fa362f2e04be1bafaa099a709"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="gb_2metasprites_8h.html#a77bb622fa362f2e04be1bafaa099a709">hide_sprites_range</a> (<a class="el" href="asm_2gbz80_2types_8h.html#ab27e9918b538ce9d8ca692479b375b6a">UINT8</a> from, <a class="el" href="asm_2gbz80_2types_8h.html#ab27e9918b538ce9d8ca692479b375b6a">UINT8</a> to) <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> 127<tr class="separator:a77bb622fa362f2e04be1bafaa099a709"><td class="memSeparator" colspan="2"> </td></tr> 128<tr class="memitem:a77475e913bf0a19df28bdbf9d1cf392b"><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="gb_2metasprites_8h.html#a77475e913bf0a19df28bdbf9d1cf392b">move_metasprite</a> (const <a class="el" href="structmetasprite__t.html">metasprite_t</a> *metasprite, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> base_tile, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> base_sprite, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> x, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> y)</td></tr> 129<tr class="separator:a77475e913bf0a19df28bdbf9d1cf392b"><td class="memSeparator" colspan="2"> </td></tr> 130<tr class="memitem:aa8ff2df0679ebb0b6e0a8f6d83127e1a"><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="gb_2metasprites_8h.html#aa8ff2df0679ebb0b6e0a8f6d83127e1a">move_metasprite_vflip</a> (const <a class="el" href="structmetasprite__t.html">metasprite_t</a> *metasprite, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> base_tile, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> base_sprite, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> x, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> y)</td></tr> 131<tr class="separator:aa8ff2df0679ebb0b6e0a8f6d83127e1a"><td class="memSeparator" colspan="2"> </td></tr> 132<tr class="memitem:a27e3bb17d0458b60b1f0433f66301f46"><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="gb_2metasprites_8h.html#a27e3bb17d0458b60b1f0433f66301f46">move_metasprite_hflip</a> (const <a class="el" href="structmetasprite__t.html">metasprite_t</a> *metasprite, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> base_tile, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> base_sprite, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> x, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> y)</td></tr> 133<tr class="separator:a27e3bb17d0458b60b1f0433f66301f46"><td class="memSeparator" colspan="2"> </td></tr> 134<tr class="memitem:a32a61acd4a76d1de5814f7b94c8bc23f"><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="gb_2metasprites_8h.html#a32a61acd4a76d1de5814f7b94c8bc23f">move_metasprite_hvflip</a> (const <a class="el" href="structmetasprite__t.html">metasprite_t</a> *metasprite, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> base_tile, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> base_sprite, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> x, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> y)</td></tr> 135<tr class="separator:a32a61acd4a76d1de5814f7b94c8bc23f"><td class="memSeparator" colspan="2"> </td></tr> 136<tr class="memitem:af8de5a888d65448b9d34027a0e1ce906"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="gb_2metasprites_8h.html#af8de5a888d65448b9d34027a0e1ce906">hide_metasprite</a> (const <a class="el" href="structmetasprite__t.html">metasprite_t</a> *metasprite, <a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> base_sprite)</td></tr> 137<tr class="separator:af8de5a888d65448b9d34027a0e1ce906"><td class="memSeparator" colspan="2"> </td></tr> 138</table><table class="memberdecls"> 139<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a> 140Variables</h2></td></tr> 141<tr class="memitem:aae51f066cc5436457f62351847bfc64b"><td class="memItemLeft" align="right" valign="top">const void * </td><td class="memItemRight" valign="bottom"><a class="el" href="gb_2metasprites_8h.html#aae51f066cc5436457f62351847bfc64b">__current_metasprite</a></td></tr> 142<tr class="separator:aae51f066cc5436457f62351847bfc64b"><td class="memSeparator" colspan="2"> </td></tr> 143<tr class="memitem:a345fa52509387bd18a4092178a18286f"><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="gb_2metasprites_8h.html#a345fa52509387bd18a4092178a18286f">__current_base_tile</a></td></tr> 144<tr class="separator:a345fa52509387bd18a4092178a18286f"><td class="memSeparator" colspan="2"> </td></tr> 145<tr class="memitem:a4bfe4d95031b67951cf6bc342110db39"><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="gb_2metasprites_8h.html#a4bfe4d95031b67951cf6bc342110db39">__render_shadow_OAM</a></td></tr> 146<tr class="separator:a4bfe4d95031b67951cf6bc342110db39"><td class="memSeparator" colspan="2"> </td></tr> 147<tr class="memitem:a0b3366755f3276b0243c1e0497471b7a"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="gb_2metasprites_8h.html#a0b3366755f3276b0243c1e0497471b7a">c</a></td></tr> 148<tr class="separator:a0b3366755f3276b0243c1e0497471b7a"><td class="memSeparator" colspan="2"> </td></tr> 149</table> 150<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> 151<div class="textblock"><h1><a class="anchor" id="autotoc_md1"></a> 152Metasprite support</h1> 153<p>A metasprite is a larger sprite made up from a collection of smaller individual hardware sprites. Different frames of the same metasprites can share tile data.</p> 154<p>The api supports metasprites in both <a class="el" href="sms_8h.html#aa87bec0d134136fdb727f52cb773b792">SPRITES_8x8</a> and <a class="el" href="sms_8h.html#af91d252f07f4764996154820f970c101">SPRITES_8x16</a> mode. If 8x16 mode is used then the height of the metasprite must be a multiple of 16.</p> 155<p>The origin (pivot) for the metasprite is not required to be in the upper left-hand corner as with regular hardware sprites.</p> 156<p>Use the <a class="el" href="docs_toolchain.html#utility_png2asset">utility_png2asset</a> tool to convert single or multiple frames of graphics into metasprite structured data for use with the ...metasprite...() functions.</p> 157<h1><a class="anchor" id="autotoc_md2"></a> 158Metasprites composed of variable numbers of sprites</h1> 159<p>When using png2asset, it's common for the output of different frames to be composed of different numbers of hardware sprites (since it's trying to create each frame as efficiently as possible). Due to that, it's good practice to clear out (hide) unused sprites in the shadow_OAM that have been set by previous frames.</p> 160<div class="fragment"><div class="line"><span class="comment">// Example:</span></div> 161<div class="line"><span class="comment">// Hide rest of the hardware sprites, because amount</span></div> 162<div class="line"><span class="comment">// of sprites differ between animation frames.</span></div> 163<div class="line"><span class="comment">// (where hiwater == last hardware sprite used + 1)</span></div> 164<div class="line"><span class="keywordflow">for</span> (<a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> i = hiwater; i < 40; i++) <a class="code" href="gb_8h.html#a3619f9cb1e3c92238a033ead79a0c551">shadow_OAM</a>[i].y = 0;</div> 165</div><!-- fragment --><p><a class="anchor" id="metasprite_and_sprite_properties"></a></p> 166<h1><a class="anchor" id="autotoc_md3"></a> 167Metasprites and sprite properties (including cgb palette)</h1> 168<p>When the move_metasprite_*() functions are called they update all properties for the affected sprites in the Shadow OAM. This means any existing property flags set for a sprite (CGB palette, BG/WIN priority, Tile VRAM Bank) will get overwritten.</p> 169<p>How to use sprite property flags with metasprites:</p><ul> 170<li>Metsaprite structures can be copied into RAM so their property flags can be modified at runtime.</li> 171<li>The metasprite structures can have the property flags modified before compilation (such as with <code>-sp <props></code> in the <a class="el" href="docs_toolchain.html#utility_png2asset">png2asset</a> tool).</li> 172<li>Update properties for the affected sprites after calling a move_metasprite_*() function.</li> 173</ul> 174<p>The following functions are only available for Game Boy and related clone consoles due to lack of hardware support for sprite flipping in other consoles. See <a class="el" href="docs_supported_consoles.html#docs_consoles_supported_list">docs_consoles_supported_list</a></p><ul> 175<li><a class="el" href="gb_2metasprites_8h.html#aa8ff2df0679ebb0b6e0a8f6d83127e1a">move_metasprite_vflip()</a></li> 176<li><a class="el" href="gb_2metasprites_8h.html#a27e3bb17d0458b60b1f0433f66301f46">move_metasprite_hflip()</a></li> 177<li><a class="el" href="gb_2metasprites_8h.html#a32a61acd4a76d1de5814f7b94c8bc23f">move_metasprite_hvflip()</a> </li> 178</ul> 179</div><h2 class="groupheader">Macro Definition Documentation</h2> 180<a id="a9f9f390a57460914e27c7604b7d8379a"></a> 181<h2 class="memtitle"><span class="permalink"><a href="#a9f9f390a57460914e27c7604b7d8379a">◆ </a></span>metasprite_end</h2> 182 183<div class="memitem"> 184<div class="memproto"> 185 <table class="memname"> 186 <tr> 187 <td class="memname">#define metasprite_end   -128</td> 188 </tr> 189 </table> 190</div><div class="memdoc"> 191 192</div> 193</div> 194<a id="aa88dc4d5e35045509b8955a4a23a30aa"></a> 195<h2 class="memtitle"><span class="permalink"><a href="#aa88dc4d5e35045509b8955a4a23a30aa">◆ </a></span>METASPR_ITEM</h2> 196 197<div class="memitem"> 198<div class="memproto"> 199 <table class="memname"> 200 <tr> 201 <td class="memname">#define METASPR_ITEM</td> 202 <td>(</td> 203 <td class="paramtype"> </td> 204 <td class="paramname">dy, </td> 205 </tr> 206 <tr> 207 <td class="paramkey"></td> 208 <td></td> 209 <td class="paramtype"> </td> 210 <td class="paramname">dx, </td> 211 </tr> 212 <tr> 213 <td class="paramkey"></td> 214 <td></td> 215 <td class="paramtype"> </td> 216 <td class="paramname">dt, </td> 217 </tr> 218 <tr> 219 <td class="paramkey"></td> 220 <td></td> 221 <td class="paramtype"> </td> 222 <td class="paramname">a </td> 223 </tr> 224 <tr> 225 <td></td> 226 <td>)</td> 227 <td></td><td>   {(dy),(dx),(dt),(a)}</td> 228 </tr> 229 </table> 230</div><div class="memdoc"> 231 232</div> 233</div> 234<a id="aa1d425dcce3cd104751744535b6a389a"></a> 235<h2 class="memtitle"><span class="permalink"><a href="#aa1d425dcce3cd104751744535b6a389a">◆ </a></span>METASPR_TERM</h2> 236 237<div class="memitem"> 238<div class="memproto"> 239 <table class="memname"> 240 <tr> 241 <td class="memname">#define METASPR_TERM   {<a class="el" href="sms_2metasprites_8h.html#a9f9f390a57460914e27c7604b7d8379a">metasprite_end</a>}</td> 242 </tr> 243 </table> 244</div><div class="memdoc"> 245 246</div> 247</div> 248<h2 class="groupheader">Typedef Documentation</h2> 249<a id="aba6401cc8173158a9f37ee22094c03d3"></a> 250<h2 class="memtitle"><span class="permalink"><a href="#aba6401cc8173158a9f37ee22094c03d3">◆ </a></span>metasprite_t</h2> 251 252<div class="memitem"> 253<div class="memproto"> 254 <table class="memname"> 255 <tr> 256 <td class="memname">typedef struct <a class="el" href="structmetasprite__t.html">metasprite_t</a> <a class="el" href="structmetasprite__t.html">metasprite_t</a></td> 257 </tr> 258 </table> 259</div><div class="memdoc"> 260<p>Metasprite sub-item structure </p><dl class="params"><dt>Parameters</dt><dd> 261 <table class="params"> 262 <tr><td class="paramname">dy</td><td>(int8_t) Y coordinate of the sprite relative to the metasprite origin (pivot) </td></tr> 263 <tr><td class="paramname">dx</td><td>(int8_t) X coordinate of the sprite relative to the metasprite origin (pivot) </td></tr> 264 <tr><td class="paramname">dtile</td><td>(uint8_t) Start tile relative to the metasprites own set of tiles </td></tr> 265 <tr><td class="paramname">props</td><td>(uint8_t) Property Flags</td></tr> 266 </table> 267 </dd> 268</dl> 269<p>Metasprites are built from multiple <a class="el" href="structmetasprite__t.html">metasprite_t</a> items (one for each sub-sprite) and a pool of tiles they reference. If a metasprite has multiple frames then each frame will be built from some number of <a class="el" href="structmetasprite__t.html">metasprite_t</a> items (which may vary based on how many sprites are required for that particular frame).</p> 270<p>A metasprite frame is terminated with a {metasprite_end} entry. </p> 271 272</div> 273</div> 274<h2 class="groupheader">Function Documentation</h2> 275<a id="a77bb622fa362f2e04be1bafaa099a709"></a> 276<h2 class="memtitle"><span class="permalink"><a href="#a77bb622fa362f2e04be1bafaa099a709">◆ </a></span>hide_sprites_range()</h2> 277 278<div class="memitem"> 279<div class="memproto"> 280 <table class="memname"> 281 <tr> 282 <td class="memname">void hide_sprites_range </td> 283 <td>(</td> 284 <td class="paramtype"><a class="el" href="asm_2gbz80_2types_8h.html#ab27e9918b538ce9d8ca692479b375b6a">UINT8</a> </td> 285 <td class="paramname"><em>from</em>, </td> 286 </tr> 287 <tr> 288 <td class="paramkey"></td> 289 <td></td> 290 <td class="paramtype"><a class="el" href="asm_2gbz80_2types_8h.html#ab27e9918b538ce9d8ca692479b375b6a">UINT8</a> </td> 291 <td class="paramname"><em>to</em> </td> 292 </tr> 293 <tr> 294 <td></td> 295 <td>)</td> 296 <td></td><td></td> 297 </tr> 298 </table> 299</div><div class="memdoc"> 300<p>Hides all hardware sprites in range from <= X < to </p><dl class="params"><dt>Parameters</dt><dd> 301 <table class="params"> 302 <tr><td class="paramname">from</td><td>start OAM index </td></tr> 303 <tr><td class="paramname">to</td><td>finish OAM index </td></tr> 304 </table> 305 </dd> 306</dl> 307 308</div> 309</div> 310<a id="a77475e913bf0a19df28bdbf9d1cf392b"></a> 311<h2 class="memtitle"><span class="permalink"><a href="#a77475e913bf0a19df28bdbf9d1cf392b">◆ </a></span>move_metasprite()</h2> 312 313<div class="memitem"> 314<div class="memproto"> 315<table class="mlabels"> 316 <tr> 317 <td class="mlabels-left"> 318 <table class="memname"> 319 <tr> 320 <td class="memname"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> move_metasprite </td> 321 <td>(</td> 322 <td class="paramtype">const <a class="el" href="structmetasprite__t.html">metasprite_t</a> * </td> 323 <td class="paramname"><em>metasprite</em>, </td> 324 </tr> 325 <tr> 326 <td class="paramkey"></td> 327 <td></td> 328 <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> </td> 329 <td class="paramname"><em>base_tile</em>, </td> 330 </tr> 331 <tr> 332 <td class="paramkey"></td> 333 <td></td> 334 <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> </td> 335 <td class="paramname"><em>base_sprite</em>, </td> 336 </tr> 337 <tr> 338 <td class="paramkey"></td> 339 <td></td> 340 <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> </td> 341 <td class="paramname"><em>x</em>, </td> 342 </tr> 343 <tr> 344 <td class="paramkey"></td> 345 <td></td> 346 <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> </td> 347 <td class="paramname"><em>y</em> </td> 348 </tr> 349 <tr> 350 <td></td> 351 <td>)</td> 352 <td></td><td></td> 353 </tr> 354 </table> 355 </td> 356 <td class="mlabels-right"> 357<span class="mlabels"><span class="mlabel">inline</span></span> </td> 358 </tr> 359</table> 360</div><div class="memdoc"> 361<p>Moves metasprite to the absolute position x and y</p> 362<dl class="params"><dt>Parameters</dt><dd> 363 <table class="params"> 364 <tr><td class="paramname">metasprite</td><td>Pointer to the first struct of the metasprite (for the desired frame) </td></tr> 365 <tr><td class="paramname">base_tile</td><td>Number of the first tile where the metasprite's tiles start </td></tr> 366 <tr><td class="paramname">base_sprite</td><td>Number of the first hardware sprite to be used by the metasprite </td></tr> 367 <tr><td class="paramname">x</td><td>Absolute x coordinate of the sprite </td></tr> 368 <tr><td class="paramname">y</td><td>Absolute y coordinate of the sprite</td></tr> 369 </table> 370 </dd> 371</dl> 372<p>Moves <b>metasprite</b> to the absolute position <b>x</b> and <b>y</b> (with <b>no flip</b> on the X or Y axis). Hardware sprites are allocated starting from <b>base_sprite</b>, using tiles starting from <b>base_tile</b>.</p> 373<p>Sets: </p><ul> 374<li>__current_metasprite = metasprite; </li> 375<li>__current_base_tile = base_tile;</li> 376</ul> 377<p>Note: Overwrites OAM sprite properties (such as CGB Palette), see <a class="el" href="gb_2metasprites_8h.html#metasprite_and_sprite_properties">Metasprites and sprite properties</a>.</p> 378<dl class="section return"><dt>Returns</dt><dd>Number of hardware sprites used to draw this metasprite </dd></dl> 379 380</div> 381</div> 382<a id="aa8ff2df0679ebb0b6e0a8f6d83127e1a"></a> 383<h2 class="memtitle"><span class="permalink"><a href="#aa8ff2df0679ebb0b6e0a8f6d83127e1a">◆ </a></span>move_metasprite_vflip()</h2> 384 385<div class="memitem"> 386<div class="memproto"> 387<table class="mlabels"> 388 <tr> 389 <td class="mlabels-left"> 390 <table class="memname"> 391 <tr> 392 <td class="memname"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> move_metasprite_vflip </td> 393 <td>(</td> 394 <td class="paramtype">const <a class="el" href="structmetasprite__t.html">metasprite_t</a> * </td> 395 <td class="paramname"><em>metasprite</em>, </td> 396 </tr> 397 <tr> 398 <td class="paramkey"></td> 399 <td></td> 400 <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> </td> 401 <td class="paramname"><em>base_tile</em>, </td> 402 </tr> 403 <tr> 404 <td class="paramkey"></td> 405 <td></td> 406 <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> </td> 407 <td class="paramname"><em>base_sprite</em>, </td> 408 </tr> 409 <tr> 410 <td class="paramkey"></td> 411 <td></td> 412 <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> </td> 413 <td class="paramname"><em>x</em>, </td> 414 </tr> 415 <tr> 416 <td class="paramkey"></td> 417 <td></td> 418 <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> </td> 419 <td class="paramname"><em>y</em> </td> 420 </tr> 421 <tr> 422 <td></td> 423 <td>)</td> 424 <td></td><td></td> 425 </tr> 426 </table> 427 </td> 428 <td class="mlabels-right"> 429<span class="mlabels"><span class="mlabel">inline</span></span> </td> 430 </tr> 431</table> 432</div><div class="memdoc"> 433<p>Moves metasprite to the absolute position x and y, <b>flipped on the Y axis</b></p> 434<dl class="params"><dt>Parameters</dt><dd> 435 <table class="params"> 436 <tr><td class="paramname">metasprite</td><td>Pointer to the first struct of the metasprite (for the desired frame) </td></tr> 437 <tr><td class="paramname">base_tile</td><td>Number of the first tile where the metasprite's tiles start </td></tr> 438 <tr><td class="paramname">base_sprite</td><td>Number of the first hardware sprite to be used by the metasprite </td></tr> 439 <tr><td class="paramname">x</td><td>Absolute x coordinate of the sprite </td></tr> 440 <tr><td class="paramname">y</td><td>Absolute y coordinate of the sprite</td></tr> 441 </table> 442 </dd> 443</dl> 444<p>Same as <a class="el" href="gb_2metasprites_8h.html#a77475e913bf0a19df28bdbf9d1cf392b">move_metasprite()</a>, but with the metasprite flipped on the Y axis only.</p> 445<p>Sets: </p><ul> 446<li>__current_metasprite = metasprite; </li> 447<li>__current_base_tile = base_tile;</li> 448</ul> 449<p>Note: Overwrites OAM sprite properties (such as CGB palette), see <a class="el" href="gb_2metasprites_8h.html#metasprite_and_sprite_properties">Metasprites and sprite properties</a>.</p> 450<p>This function is only available on Game Boy and related clone consoles.</p> 451<dl class="section return"><dt>Returns</dt><dd>Number of hardware sprites used to draw this metasprite</dd></dl> 452<dl class="section see"><dt>See also</dt><dd><a class="el" href="gb_2metasprites_8h.html#a77475e913bf0a19df28bdbf9d1cf392b">move_metasprite()</a> </dd></dl> 453 454</div> 455</div> 456<a id="a27e3bb17d0458b60b1f0433f66301f46"></a> 457<h2 class="memtitle"><span class="permalink"><a href="#a27e3bb17d0458b60b1f0433f66301f46">◆ </a></span>move_metasprite_hflip()</h2> 458 459<div class="memitem"> 460<div class="memproto"> 461<table class="mlabels"> 462 <tr> 463 <td class="mlabels-left"> 464 <table class="memname"> 465 <tr> 466 <td class="memname"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> move_metasprite_hflip </td> 467 <td>(</td> 468 <td class="paramtype">const <a class="el" href="structmetasprite__t.html">metasprite_t</a> * </td> 469 <td class="paramname"><em>metasprite</em>, </td> 470 </tr> 471 <tr> 472 <td class="paramkey"></td> 473 <td></td> 474 <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> </td> 475 <td class="paramname"><em>base_tile</em>, </td> 476 </tr> 477 <tr> 478 <td class="paramkey"></td> 479 <td></td> 480 <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> </td> 481 <td class="paramname"><em>base_sprite</em>, </td> 482 </tr> 483 <tr> 484 <td class="paramkey"></td> 485 <td></td> 486 <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> </td> 487 <td class="paramname"><em>x</em>, </td> 488 </tr> 489 <tr> 490 <td class="paramkey"></td> 491 <td></td> 492 <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> </td> 493 <td class="paramname"><em>y</em> </td> 494 </tr> 495 <tr> 496 <td></td> 497 <td>)</td> 498 <td></td><td></td> 499 </tr> 500 </table> 501 </td> 502 <td class="mlabels-right"> 503<span class="mlabels"><span class="mlabel">inline</span></span> </td> 504 </tr> 505</table> 506</div><div class="memdoc"> 507<p>Moves metasprite to the absolute position x and y, <b>flipped on the X axis</b></p> 508<dl class="params"><dt>Parameters</dt><dd> 509 <table class="params"> 510 <tr><td class="paramname">metasprite</td><td>Pointer to the first struct of the metasprite (for the desired frame) </td></tr> 511 <tr><td class="paramname">base_tile</td><td>Number of the first tile where the metasprite's tiles start </td></tr> 512 <tr><td class="paramname">base_sprite</td><td>Number of the first hardware sprite to be used by the metasprite </td></tr> 513 <tr><td class="paramname">x</td><td>Absolute x coordinate of the sprite </td></tr> 514 <tr><td class="paramname">y</td><td>Absolute y coordinate of the sprite</td></tr> 515 </table> 516 </dd> 517</dl> 518<p>Same as <a class="el" href="gb_2metasprites_8h.html#a77475e913bf0a19df28bdbf9d1cf392b">move_metasprite()</a>, but with the metasprite flipped on the X axis only.</p> 519<p>Sets: </p><ul> 520<li>__current_metasprite = metasprite; </li> 521<li>__current_base_tile = base_tile;</li> 522</ul> 523<p>Note: Overwrites OAM sprite properties (such as CGB palette), see <a class="el" href="gb_2metasprites_8h.html#metasprite_and_sprite_properties">Metasprites and sprite properties</a>.</p> 524<p>This function is only available on Game Boy and related clone consoles.</p> 525<dl class="section return"><dt>Returns</dt><dd>Number of hardware sprites used to draw this metasprite</dd></dl> 526<dl class="section see"><dt>See also</dt><dd><a class="el" href="gb_2metasprites_8h.html#a77475e913bf0a19df28bdbf9d1cf392b">move_metasprite()</a> </dd></dl> 527 528</div> 529</div> 530<a id="a32a61acd4a76d1de5814f7b94c8bc23f"></a> 531<h2 class="memtitle"><span class="permalink"><a href="#a32a61acd4a76d1de5814f7b94c8bc23f">◆ </a></span>move_metasprite_hvflip()</h2> 532 533<div class="memitem"> 534<div class="memproto"> 535<table class="mlabels"> 536 <tr> 537 <td class="mlabels-left"> 538 <table class="memname"> 539 <tr> 540 <td class="memname"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> move_metasprite_hvflip </td> 541 <td>(</td> 542 <td class="paramtype">const <a class="el" href="structmetasprite__t.html">metasprite_t</a> * </td> 543 <td class="paramname"><em>metasprite</em>, </td> 544 </tr> 545 <tr> 546 <td class="paramkey"></td> 547 <td></td> 548 <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> </td> 549 <td class="paramname"><em>base_tile</em>, </td> 550 </tr> 551 <tr> 552 <td class="paramkey"></td> 553 <td></td> 554 <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> </td> 555 <td class="paramname"><em>base_sprite</em>, </td> 556 </tr> 557 <tr> 558 <td class="paramkey"></td> 559 <td></td> 560 <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> </td> 561 <td class="paramname"><em>x</em>, </td> 562 </tr> 563 <tr> 564 <td class="paramkey"></td> 565 <td></td> 566 <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> </td> 567 <td class="paramname"><em>y</em> </td> 568 </tr> 569 <tr> 570 <td></td> 571 <td>)</td> 572 <td></td><td></td> 573 </tr> 574 </table> 575 </td> 576 <td class="mlabels-right"> 577<span class="mlabels"><span class="mlabel">inline</span></span> </td> 578 </tr> 579</table> 580</div><div class="memdoc"> 581<p>Moves metasprite to the absolute position x and y, <b>flipped on the X and Y axis</b></p> 582<dl class="params"><dt>Parameters</dt><dd> 583 <table class="params"> 584 <tr><td class="paramname">metasprite</td><td>Pointer to the first struct of the metasprite (for the desired frame) </td></tr> 585 <tr><td class="paramname">base_tile</td><td>Number of the first tile where the metasprite's tiles start </td></tr> 586 <tr><td class="paramname">base_sprite</td><td>Number of the first hardware sprite to be used by the metasprite </td></tr> 587 <tr><td class="paramname">x</td><td>Absolute x coordinate of the sprite </td></tr> 588 <tr><td class="paramname">y</td><td>Absolute y coordinate of the sprite</td></tr> 589 </table> 590 </dd> 591</dl> 592<p>Same as <a class="el" href="gb_2metasprites_8h.html#a77475e913bf0a19df28bdbf9d1cf392b">move_metasprite()</a>, but with the metasprite flipped on both the X and Y axis.</p> 593<p>Sets: </p><ul> 594<li>__current_metasprite = metasprite; </li> 595<li>__current_base_tile = base_tile;</li> 596</ul> 597<p>Note: Overwrites OAM sprite properties (such as CGB palette), see <a class="el" href="gb_2metasprites_8h.html#metasprite_and_sprite_properties">Metasprites and sprite properties</a>.</p> 598<p>This function is only available on Game Boy and related clone consoles.</p> 599<dl class="section return"><dt>Returns</dt><dd>Number of hardware sprites used to draw this metasprite</dd></dl> 600<dl class="section see"><dt>See also</dt><dd><a class="el" href="gb_2metasprites_8h.html#a77475e913bf0a19df28bdbf9d1cf392b">move_metasprite()</a> </dd></dl> 601 602</div> 603</div> 604<a id="af8de5a888d65448b9d34027a0e1ce906"></a> 605<h2 class="memtitle"><span class="permalink"><a href="#af8de5a888d65448b9d34027a0e1ce906">◆ </a></span>hide_metasprite()</h2> 606 607<div class="memitem"> 608<div class="memproto"> 609<table class="mlabels"> 610 <tr> 611 <td class="mlabels-left"> 612 <table class="memname"> 613 <tr> 614 <td class="memname">void hide_metasprite </td> 615 <td>(</td> 616 <td class="paramtype">const <a class="el" href="structmetasprite__t.html">metasprite_t</a> * </td> 617 <td class="paramname"><em>metasprite</em>, </td> 618 </tr> 619 <tr> 620 <td class="paramkey"></td> 621 <td></td> 622 <td class="paramtype"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> </td> 623 <td class="paramname"><em>base_sprite</em> </td> 624 </tr> 625 <tr> 626 <td></td> 627 <td>)</td> 628 <td></td><td></td> 629 </tr> 630 </table> 631 </td> 632 <td class="mlabels-right"> 633<span class="mlabels"><span class="mlabel">inline</span></span> </td> 634 </tr> 635</table> 636</div><div class="memdoc"> 637<p>Hides a metasprite from the screen</p> 638<dl class="params"><dt>Parameters</dt><dd> 639 <table class="params"> 640 <tr><td class="paramname">metasprite</td><td>Pointer to first struct of the desired metasprite frame </td></tr> 641 <tr><td class="paramname">base_sprite</td><td>Number of hardware sprite to start with</td></tr> 642 </table> 643 </dd> 644</dl> 645<p>Sets: </p><ul> 646<li>__current_metasprite = metasprite; </li> 647</ul> 648 649</div> 650</div> 651<h2 class="groupheader">Variable Documentation</h2> 652<a id="aae51f066cc5436457f62351847bfc64b"></a> 653<h2 class="memtitle"><span class="permalink"><a href="#aae51f066cc5436457f62351847bfc64b">◆ </a></span>__current_metasprite</h2> 654 655<div class="memitem"> 656<div class="memproto"> 657<table class="mlabels"> 658 <tr> 659 <td class="mlabels-left"> 660 <table class="memname"> 661 <tr> 662 <td class="memname">const void* __current_metasprite</td> 663 </tr> 664 </table> 665 </td> 666 <td class="mlabels-right"> 667<span class="mlabels"><span class="mlabel">extern</span></span> </td> 668 </tr> 669</table> 670</div><div class="memdoc"> 671 672</div> 673</div> 674<a id="a345fa52509387bd18a4092178a18286f"></a> 675<h2 class="memtitle"><span class="permalink"><a href="#a345fa52509387bd18a4092178a18286f">◆ </a></span>__current_base_tile</h2> 676 677<div class="memitem"> 678<div class="memproto"> 679<table class="mlabels"> 680 <tr> 681 <td class="mlabels-left"> 682 <table class="memname"> 683 <tr> 684 <td class="memname"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> __current_base_tile</td> 685 </tr> 686 </table> 687 </td> 688 <td class="mlabels-right"> 689<span class="mlabels"><span class="mlabel">extern</span></span> </td> 690 </tr> 691</table> 692</div><div class="memdoc"> 693 694</div> 695</div> 696<a id="a4bfe4d95031b67951cf6bc342110db39"></a> 697<h2 class="memtitle"><span class="permalink"><a href="#a4bfe4d95031b67951cf6bc342110db39">◆ </a></span>__render_shadow_OAM</h2> 698 699<div class="memitem"> 700<div class="memproto"> 701<table class="mlabels"> 702 <tr> 703 <td class="mlabels-left"> 704 <table class="memname"> 705 <tr> 706 <td class="memname"><a class="el" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> __render_shadow_OAM</td> 707 </tr> 708 </table> 709 </td> 710 <td class="mlabels-right"> 711<span class="mlabels"><span class="mlabel">extern</span></span> </td> 712 </tr> 713</table> 714</div><div class="memdoc"> 715 716</div> 717</div> 718<a id="a0b3366755f3276b0243c1e0497471b7a"></a> 719<h2 class="memtitle"><span class="permalink"><a href="#a0b3366755f3276b0243c1e0497471b7a">◆ </a></span>c</h2> 720 721<div class="memitem"> 722<div class="memproto"> 723 <table class="memname"> 724 <tr> 725 <td class="memname">void c</td> 726 </tr> 727 </table> 728</div><div class="memdoc"> 729 730</div> 731</div> 732</div><!-- contents --> 733</div><!-- doc-content --> 734<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> 735<div class="ttc" id="agb_8h_html_a3619f9cb1e3c92238a033ead79a0c551"><div class="ttname"><a href="gb_8h.html#a3619f9cb1e3c92238a033ead79a0c551">shadow_OAM</a></div><div class="ttdeci">volatile struct OAM_item_t shadow_OAM[]</div></div> 736<!-- HTML footer for doxygen 1.8.14--> 737<!-- start footer part --> 738<div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> 739</div> 740</body> 741</html>