docs_migrating_versions.html (11238B)
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: Migrating to new GBDK Versions</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('docs_migrating_versions.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">Migrating to new GBDK Versions </div> </div> 91</div><!--header--> 92<div class="contents"> 93<div class="textblock"><p>This section contains information that may be useful to know or important when upgrading to a newer GBDK release.</p> 94<h1><a class="anchor" id="autotoc_md167"></a> 95GBDK 2020 versions</h1> 96<h2><a class="anchor" id="autotoc_md168"></a> 97Porting to GBDK 2020 4.0.6</h2> 98<ul> 99<li>Renamed <code>bgb_emu.h</code> to <code>emu_debug.h</code> and BGB_* functions to EMU_*<ul> 100<li>Aliases for the BGB_* ones and a <code>bgb_emu.h</code> shim are present for backward compatibility, but updating to the new naming is recommended</li> 101</ul> 102</li> 103</ul> 104<h2><a class="anchor" id="autotoc_md169"></a> 105Porting to GBDK 2020 4.0.5</h2> 106<ul> 107<li>GBDK now requires SDCC 12259 or higher with GBDK-2020 patches</li> 108<li><a class="el" href="docs_toolchain.html#utility_png2asset">png2asset</a> is the new name for the <code>png2mtspr</code> utility</li> 109<li><a class="el" href="docs_toolchain.html#lcc">lcc</a> : Changed default output format when not specified from <code>.ihx</code> to <code>.gb</code> (or other active rom extension)</li> 110<li>The <code>_BSS</code> area is deprecated (use <code>_DATA</code> instead)</li> 111<li>The <code>_BASE</code> area is renamed to <code>_HOME</code></li> 112<li>Variables in static storage are now initialized to zero per C standard (but remaining WRAM is not cleared)</li> 113<li><a class="el" href="stdlib_8h.html#aac2ea595a9ea8f5ebd883a0bc05eba5c">itoa()</a>, <a class="el" href="stdlib_8h.html#a38c070016cb06132360cfa5bacc2ed19">uitoa()</a>, <a class="el" href="stdlib_8h.html#a6374e62474a5a76c7ace9a59fb1cc829">ltoa()</a>, <a class="el" href="stdlib_8h.html#ac22b79fe0c1279eabc3daf57328008d2">ultoa()</a> all now require a radix value (base) argument to be passed. On the Game Boy and Analogue Pocket the parameter is required but not utilized.</li> 114<li>set_bkg_1bit_data has been renamed to <a class="el" href="sms_8h.html#a4d5f74eed0489ebfdc2410ee3f9f7f04">set_bkg_1bpp_data</a></li> 115<li>The following header files which are now cross platform were moved from <code>gb/</code> to <code>gbdk/</code>: <code>bcd.h</code>, <code>console.h</code>, <code>far_ptr.h</code>, <code>font.h</code>, <code>gbdecompress.h</code>, <code>gbdk-lib.h</code>, <code>incbin.h</code>, <code>metasprites.h</code>, <code>platform.h</code>, <code>version.h</code><ul> 116<li>When including them use <code>#include <gbdk/...></code> instead of <code>#include <gb/></code></li> 117</ul> 118</li> 119</ul> 120<h2><a class="anchor" id="autotoc_md170"></a> 121Porting to GBDK 2020 4.0.4</h2> 122<ul> 123<li>GBDK now requires SDCC 12238 or higher</li> 124<li>Made sample.h, cgb.h and sgb.h independent from gb.h</li> 125</ul> 126<h2><a class="anchor" id="autotoc_md171"></a> 127Porting to GBDK 2020 4.0.3</h2> 128<ul> 129<li>No significant changes required</li> 130</ul> 131<h2><a class="anchor" id="autotoc_md172"></a> 132Porting to GBDK 2020 4.0.2</h2> 133<ul> 134<li>The default font has been reduced from 256 to 96 characters.<ul> 135<li>Code using special characters may need to be updated.</li> 136<li>The off-by-1 character index offset was removed for fonts. Old fonts with the offset need to be re-adjusted.</li> 137</ul> 138</li> 139</ul> 140<h2><a class="anchor" id="autotoc_md173"></a> 141Porting to GBDK 2020 4.0.1</h2> 142<ul> 143<li><b>Important!</b> : The <code>WRAM</code> memory region is no longer automatically initialized to zeros during startup.<ul> 144<li>Any variables which are declared without being initialized may have <b>indeterminate values instead of 0</b> on startup. This might reveal previously hidden bugs in your code.</li> 145<li>Check your code for variables that are not initialized before use.</li> 146<li>In BGB you can turn on triggering exceptions (options panel) reading from unitialized RAM. This allows for some additional runtime detection of uninitialized vars.</li> 147</ul> 148</li> 149<li>In .ihx files, multiple writes to the same ROM address are now warned about using <a class="el" href="docs_toolchain.html#ihxcheck">ihxcheck</a>.</li> 150<li><code>set_*_tiles()</code> now wrap maps around horizontal and vertical boundaries correctly. Code relying on it not wrapping correctly may be affected.</li> 151</ul> 152<h2><a class="anchor" id="autotoc_md174"></a> 153Porting to GBDK 2020 4.0</h2> 154<ul> 155<li>GBDK now requires SDCC 4.0.3 or higher</li> 156<li>The old linker <code>link-gbz80</code> has been REMOVED, the linker <a class="el" href="docs_toolchain.html#sdldgb">sdldgb</a> from SDCC is used.<ul> 157<li>Due to the linker change, there are no longer warnings about multiple writes to the same ROM address.</li> 158</ul> 159</li> 160<li>GBDK now generates .ihx files, those are converted to a ROM using <a class="el" href="docs_toolchain.html#makebin">makebin</a> (lcc can do this automatically in some use cases)</li> 161<li>Setting ROM bytes directly with <code>-Wl-yp0x<address>=0x<value></code> is no longer supported. Instead use <a class="el" href="docs_toolchain.html#makebin">makebin</a> flags. For example, use <code>-Wm-yC</code> instead of <code>-Wl-yp0x143=0xC0</code>. See <a class="el" href="docs_faq.html#faq_gb_type_header_setting">faq_gb_type_header_setting</a>.</li> 162<li>OAM symbol has been renamed to <code>_shadow_OAM</code>, that allows accessing shadow OAM directly from C code</li> 163</ul> 164<h2><a class="anchor" id="autotoc_md175"></a> 165Porting to GBDK 2020 3.2</h2> 166<ul> 167<li>No significant changes required</li> 168</ul> 169<h2><a class="anchor" id="autotoc_md176"></a> 170Porting to GBDK 2020 3.1.1</h2> 171<ul> 172<li>No significant changes required</li> 173</ul> 174<h2><a class="anchor" id="autotoc_md177"></a> 175Porting to GBDK 2020 3.1</h2> 176<ul> 177<li>Behavior formerly enabled by USE_SFR_FOR_REG is on by default now (no need to specify it, it isn't a tested <code>#ifdef</code> anymore). check here why: <a href="https://gbdev.gg8.se/forums/viewtopic.php?id=697">https://gbdev.gg8.se/forums/viewtopic.php?id=697</a></li> 178</ul> 179<h2><a class="anchor" id="autotoc_md178"></a> 180Porting to GBDK 2020 3.0.1</h2> 181<ul> 182<li>LCC was upgraded to use SDCC v4.0. Makefile changes may be required<ul> 183<li>The symbol format changed. To get bgb compatible symbols turn on <code>.noi</code> output (LCC argument: <code>-Wl-j</code> or <code>-debug</code>) and use <code>-Wm-yS</code></li> 184<li>?? Suggested: With LCC argument: <code>-Wa-l</code> (sdasgb:<code>-a All user symbols made global</code>)</li> 185<li>In SDCC 3.6.0, the default for char changed from signed to unsigned.<ul> 186<li>If you want the old behavior use <code>--fsigned-char</code>.</li> 187<li>lcc includes <code>--fsigned-char</code> by default</li> 188<li>Explicit declaration of unsigned vars is encouraged (for example, '15U' instead of '15')</li> 189</ul> 190</li> 191<li><code>.init</code> address has been removed</li> 192</ul> 193</li> 194</ul> 195<hr /> 196<h1><a class="anchor" id="autotoc_md180"></a> 197Historical GBDK versions</h1> 198<h2><a class="anchor" id="autotoc_md181"></a> 199GBDK 1.1 to GBDK 2.0</h2> 200<ul> 201<li>Change your int variables to long if they have to be bigger than 255. If they should only contain values between 0 and 255, use an unsigned int.</li> 202<li>If your application uses the delay function, you'll have to adapt your delay values.</li> 203<li>Several functions have new names. In particular some of them have been changed to macros (e.g. show_bkg() is now SHOW_BKG).</li> 204<li>You will probably have to change the name of the header files that you include. </li> 205</ul> 206</div></div><!-- contents --> 207</div><!-- PageDoc --> 208</div><!-- doc-content --> 209<!-- HTML footer for doxygen 1.8.14--> 210<!-- start footer part --> 211<div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> 212</div> 213</body> 214</html>