cscg22-gearboy

CSCG 2022 Challenge 'Gearboy'
git clone https://git.sinitax.com/sinitax/cscg22-gearboy
Log | Files | Refs | sfeed.txt

docs_faq.html (13237B)


      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: Frequently Asked Questions (FAQ)</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   &#160;<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&amp;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&amp;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&amp;dn=gpl-2.0.txt GPL-v2 */
     70$(document).ready(function(){initNavTree('docs_faq.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="PageDoc"><div class="header">
     89  <div class="headertitle">
     90<div class="title">Frequently Asked Questions (FAQ) </div>  </div>
     91</div><!--header-->
     92<div class="contents">
     93<div class="textblock"><p><a class="anchor" id="toolchain_faq"></a></p>
     94<h1><a class="anchor" id="autotoc_md162"></a>
     95General</h1>
     96<ul>
     97<li>How can sound effects be made?<ul>
     98<li>The simplest way is to use the Game Boy sound hardware directly. See the <a class="el" href="docs_example_programs.html#examples_sound_sample">Sound Example</a> for a way to test out sounds on the hardware.</li>
     99<li>Further discussion on using the Sound Example rom can be found in the ZGB wiki. Note that some example code there is ZGB specific and not part of the base GBDK API: <a href="https://github.com/Zal0/ZGB/wiki/Sounds">https://github.com/Zal0/ZGB/wiki/Sounds</a></li>
    100</ul>
    101</li>
    102</ul>
    103<h1><a class="anchor" id="autotoc_md163"></a>
    104Graphics and Resources</h1>
    105<ul>
    106<li>How do I use a tile map when it's tiles don't start at index zero?<ul>
    107<li>The two main options are:<ul>
    108<li>Use <a class="el" href="gb_8h.html#a811c386cac0df2d260aacb5a43608be5">set_bkg_based_tiles()</a>, <a class="el" href="gb_8h.html#abc8bc5808620a9717263b8c9ec2237f0">set_bkg_based_submap()</a>, <a class="el" href="gb_8h.html#a739a212609ae60c9c56c095f96b4ea80">set_win_based_tiles()</a>, <a class="el" href="gb_8h.html#a1b8a1026983cb2b2c0bd46334b4692a0">set_win_based_submap()</a> and provide a tile origin offset.</li>
    109<li>Use <a class="el" href="docs_toolchain.html#utility_png2asset">utility_png2asset</a> with <code>-tile_origin</code> to create a map with the tile index offsets built in.</li>
    110</ul>
    111</li>
    112</ul>
    113</li>
    114</ul>
    115<p><br  />
    116</p>
    117<h1><a class="anchor" id="autotoc_md164"></a>
    118ROM Header Settings</h1>
    119<ul>
    120<li>How do I set the ROM's title?<ul>
    121<li>Use the <a class="el" href="docs_toolchain.html#makebin">makebin</a> <code>-yn</code> flag. For example with <a class="el" href="docs_toolchain.html#lcc">lcc</a> <code>-Wm-yn"MYTITLE"</code> or with <a class="el" href="docs_toolchain.html#makebin">makebin</a> directly <code>-yn "MYTITLE"</code>. The maximum length is up to 15 characters, but may be shorter.</li>
    122<li>See "0134-0143 - Title" in <a class="el" href="docs_links_and_tools.html#Pandocs">Pandocs</a> for more details. <br  />
    123</li>
    124</ul>
    125</li>
    126</ul>
    127<p><a class="anchor" id="faq_gb_type_header_setting"></a></p><ul>
    128<li>How do I set SGB, Color only and Color compatibility in the ROM header?<ul>
    129<li>Use the following <a class="el" href="docs_toolchain.html#makebin">makebin</a> flags. Prefix them with <code>-Wm</code> if using <a class="el" href="docs_toolchain.html#lcc">lcc</a>.<ul>
    130<li><code>-yc</code> : GameBoy Color compatible</li>
    131<li><code>-yC</code> : GameBoy Color only</li>
    132<li><code>-ys</code> : Super GameBoy compatible <br  />
    133</li>
    134</ul>
    135</li>
    136</ul>
    137</li>
    138<li>How do I set the ROM <a class="el" href="docs_rombanking_mbcs.html#MBC">MBC</a> type, and what MBC values are available to use with the <code>-yt</code> <a class="el" href="docs_toolchain.html#makebin">makebin</a> flag?<ul>
    139<li>See <a class="el" href="docs_rombanking_mbcs.html#setting_mbc_and_rom_ram_banks">setting_mbc_and_rom_ram_banks</a> <br  />
    140</li>
    141</ul>
    142</li>
    143</ul>
    144<h1><a class="anchor" id="autotoc_md165"></a>
    145Errors / Compiling / Toolchain</h1>
    146<p><a class="anchor" id="faq_sdcc_peephole_instruction_error"></a></p><ul>
    147<li>What does <code>z80instructionSize() failed to parse line node, assuming 999 bytes</code> mean?<ul>
    148<li>This is a known issue with SDCC Peephole Optimizer parsing and can be ignored. A bug report has been filed for it. <br  />
    149</li>
    150</ul>
    151</li>
    152</ul>
    153<p><a class="anchor" id="faq_bank_overflow_errors"></a></p><ul>
    154<li>What do these kinds of warnings / errors mean? <code>WARNING: possibly wrote twice at addr 4000 (93-&gt;3E)</code> <code>Warning: Write from one bank spans into the next. 7ff7 -&gt; 8016 (bank 1 -&gt; 2)</code><ul>
    155<li><p class="startli">You may have a overflow in one of your ROM banks. If there is more data allocated to a bank than it can hold it then will spill over into the next bank. The warnings are generated by <a class="el" href="docs_toolchain.html#ihxcheck">ihxcheck</a> during conversion of an .ihx file into a ROM file.</p>
    156<p class="startli">See the section <a class="el" href="docs_rombanking_mbcs.html">ROM/RAM Banking and MBCs</a> for more details about how banks work and what their size is. You may want to use a tool such as <a class="el" href="docs_links_and_tools.html#romusage">romusage</a> to calculate the amount of free and used space. <br  />
    157</p>
    158</li>
    159</ul>
    160</li>
    161</ul>
    162<p><a class="anchor" id="faq_error_mbc_size"></a></p><ul>
    163<li>What does <code>error: size of the buffer is too small</code> mean?<ul>
    164<li><p class="startli">Your program is using more banks than you have configured in the toolchain. Either the MBC type was not set, or the number of banks or MBC type should be changed to provide more banks.</p>
    165<p class="startli">See the section <a class="el" href="docs_rombanking_mbcs.html#setting_mbc_and_rom_ram_banks">setting_mbc_and_rom_ram_banks</a> for more details. <br  />
    166</p>
    167</li>
    168</ul>
    169</li>
    170<li>Why is the compiler so slow, or why did it suddenly get much slower?<ul>
    171<li>This may happen if you have large initialized arrays declared without the <code>const</code> keyword. It's important to use the const keyword for read-only data. See <a class="el" href="docs_coding_guidelines.html#const_gbtd_gbmb">const_gbtd_gbmb</a> and <a class="el" href="docs_coding_guidelines.html#const_array_data">const_array_data</a> <br  />
    172</li>
    173</ul>
    174</li>
    175<li>What flags should be enabled for debugging?<ul>
    176<li>You can use the <a class="el" href="docs_toolchain.html#lcc_debug">lcc debug flag</a> <br  />
    177</li>
    178</ul>
    179</li>
    180<li>Is it possible to generate a debug symbol file (<code>.sym</code>) compatible with the <a class="el" href="docs_links_and_tools.html#bgb">bgb</a> emulator?<ul>
    181<li>Yes, turn on <code>.noi</code> output (LCC argument: <code>-Wl-j</code> or <code>-debug</code> and then use <code>-Wm-yS</code> with LCC (or <code>-yS</code> with makebin directly). <br  />
    182</li>
    183</ul>
    184</li>
    185<li>How do I move the start of the <code>DATA</code> section and the <code>Shadow OAM</code> location?<ul>
    186<li>The default locations are: <code>_shadow_OAM=0xC000</code> and 240 bytes after it <code>_DATA=0xC0A0</code></li>
    187<li>So, for example, if you wanted to move them both to start 256(0x100) bytes later, use these command line arguments for LCC:<ul>
    188<li>To change the Shadow OAM address: <code>-Wl-g_shadow_OAM=0xC100</code></li>
    189<li>To change the DATA address (again, 240 bytes after the Shadow OAM): <code>-Wl-b_DATA=0xc1a0</code></li>
    190</ul>
    191</li>
    192</ul>
    193</li>
    194</ul>
    195<p><br  />
    196</p>
    197<h1><a class="anchor" id="autotoc_md166"></a>
    198API / Utilities</h1>
    199<ul>
    200<li>Is there a list of all functions in the API?<ul>
    201<li><a href="globals_func.html">Functions</a></li>
    202<li><a href="globals_vars.html">Variables</a> <br  />
    203</li>
    204</ul>
    205</li>
    206<li>Can I use the <code>float</code> type to do floating point math?<ul>
    207<li>There is no support for 'float' in GBDK-2020.</li>
    208<li>Instead consider some form of <code>fixed point</code> math (including the <a class="el" href="docs_coding_guidelines.html#fixed_point_type">fixed</a> type included in GBDK) <br  />
    209</li>
    210</ul>
    211</li>
    212<li>Why are 8 bit numbers not printing correctly with <a class="el" href="stdio_8h.html#ab403fa700816f08631ba75bc536f74d4">printf()</a>?<ul>
    213<li>To correctly pass chars/uint8s for printing, they must be explicitly re-cast as such when calling the function. See docs_chars_varargs for more details. <br  />
    214</li>
    215</ul>
    216</li>
    217<li>How can maps larger than 32x32 tiles be scrolled? &amp; Why is the map wrapping around to the left side when setting a map wider than 32 tiles with <a class="el" href="gb_8h.html#a1f5101f2b7bb0123c26a3e257f843626">set_bkg_data()</a>?<ul>
    218<li>The hardware Background map is 32 x 32 tiles. The screen viewport that can be scrolled around that map is 20 x 18 tiles. In order to scroll around within a much larger map, new tiles must be loaded at the edges of the screen viewport in the direction that it is being scrolled. <a class="el" href="sms_8h.html#a0cfd261bc7a94b1f6093f423bad30298">set_bkg_submap</a> can be used to load those rows and columns of tiles from the desired sub-region of the large map.</li>
    219<li>See the "Large Map" example program and <a class="el" href="gb_8h.html#adb21d1c7d533a7133bab36a845489780">set_bkg_submap()</a></li>
    220<li>Writes that exceed coordinate 31 of the Background tile map on the x or y axis will wrap around to the Left and Top edges. <br  />
    221</li>
    222</ul>
    223</li>
    224<li>When using gbt_player with music in banks, how can the current bank be restored after calling gbt_update()? (since it changes the currently active bank without restoring it).<ul>
    225<li>See <a class="el" href="docs_rombanking_mbcs.html#banking_current_bank">restoring the current bank</a> <br  />
    226</li>
    227</ul>
    228</li>
    229<li>How can CGB palettes and other sprite properties be used with metasprites?<ul>
    230<li>See <a class="el" href="gb_2metasprites_8h.html#metasprite_and_sprite_properties">Metasprites and sprite properties</a> <br  />
    231</li>
    232</ul>
    233</li>
    234<li>Weird things are happening to my sprite colors when I use png2asset and metasprites. What's going on and how does it work?<ul>
    235<li>See <a class="el" href="docs_toolchain.html#utility_png2asset">utility_png2asset</a> for details of how the conversion process works. </li>
    236</ul>
    237</li>
    238</ul>
    239</div></div><!-- contents -->
    240</div><!-- PageDoc -->
    241</div><!-- doc-content -->
    242<!-- HTML footer for doxygen 1.8.14-->
    243<!-- start footer part -->
    244<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
    245</div>
    246</body>
    247</html>