summaryrefslogtreecommitdiffstats
path: root/gbdk/docs/api/docs_migrating_versions.html
blob: bbadd99fce7a848e703c2687c3e978090ec73641 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<!-- HTML header for doxygen 1.8.14-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="cache-control" content="max-age=86400"/>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.20"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>GBDK 2020 Docs: Migrating to new GBDK Versions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen_extra.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">GBDK 2020 Docs
   &#160;<span id="projectnumber">4.0.6</span>
   </div>
   <div id="projectbrief">API Documentation for GBDK 2020</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.20 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('docs_migrating_versions.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="PageDoc"><div class="header">
  <div class="headertitle">
<div class="title">Migrating to new GBDK Versions </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>This section contains information that may be useful to know or important when upgrading to a newer GBDK release.</p>
<h1><a class="anchor" id="autotoc_md167"></a>
GBDK 2020 versions</h1>
<h2><a class="anchor" id="autotoc_md168"></a>
Porting to GBDK 2020 4.0.6</h2>
<ul>
<li>Renamed <code>bgb_emu.h</code> to <code>emu_debug.h</code> and BGB_* functions to EMU_*<ul>
<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>
</ul>
</li>
</ul>
<h2><a class="anchor" id="autotoc_md169"></a>
Porting to GBDK 2020 4.0.5</h2>
<ul>
<li>GBDK now requires SDCC 12259 or higher with GBDK-2020 patches</li>
<li><a class="el" href="docs_toolchain.html#utility_png2asset">png2asset</a> is the new name for the <code>png2mtspr</code> utility</li>
<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>
<li>The <code>_BSS</code> area is deprecated (use <code>_DATA</code> instead)</li>
<li>The <code>_BASE</code> area is renamed to <code>_HOME</code></li>
<li>Variables in static storage are now initialized to zero per C standard (but remaining WRAM is not cleared)</li>
<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>
<li>set_bkg_1bit_data has been renamed to <a class="el" href="sms_8h.html#a4d5f74eed0489ebfdc2410ee3f9f7f04">set_bkg_1bpp_data</a></li>
<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>
<li>When including them use <code>#include &lt;gbdk/...&gt;</code> instead of <code>#include &lt;gb/&gt;</code></li>
</ul>
</li>
</ul>
<h2><a class="anchor" id="autotoc_md170"></a>
Porting to GBDK 2020 4.0.4</h2>
<ul>
<li>GBDK now requires SDCC 12238 or higher</li>
<li>Made sample.h, cgb.h and sgb.h independent from gb.h</li>
</ul>
<h2><a class="anchor" id="autotoc_md171"></a>
Porting to GBDK 2020 4.0.3</h2>
<ul>
<li>No significant changes required</li>
</ul>
<h2><a class="anchor" id="autotoc_md172"></a>
Porting to GBDK 2020 4.0.2</h2>
<ul>
<li>The default font has been reduced from 256 to 96 characters.<ul>
<li>Code using special characters may need to be updated.</li>
<li>The off-by-1 character index offset was removed for fonts. Old fonts with the offset need to be re-adjusted.</li>
</ul>
</li>
</ul>
<h2><a class="anchor" id="autotoc_md173"></a>
Porting to GBDK 2020 4.0.1</h2>
<ul>
<li><b>Important!</b> : The <code>WRAM</code> memory region is no longer automatically initialized to zeros during startup.<ul>
<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>
<li>Check your code for variables that are not initialized before use.</li>
<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>
</ul>
</li>
<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>
<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>
</ul>
<h2><a class="anchor" id="autotoc_md174"></a>
Porting to GBDK 2020 4.0</h2>
<ul>
<li>GBDK now requires SDCC 4.0.3 or higher</li>
<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>
<li>Due to the linker change, there are no longer warnings about multiple writes to the same ROM address.</li>
</ul>
</li>
<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>
<li>Setting ROM bytes directly with <code>-Wl-yp0x&lt;address&gt;=0x&lt;value&gt;</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>
<li>OAM symbol has been renamed to <code>_shadow_OAM</code>, that allows accessing shadow OAM directly from C code</li>
</ul>
<h2><a class="anchor" id="autotoc_md175"></a>
Porting to GBDK 2020 3.2</h2>
<ul>
<li>No significant changes required</li>
</ul>
<h2><a class="anchor" id="autotoc_md176"></a>
Porting to GBDK 2020 3.1.1</h2>
<ul>
<li>No significant changes required</li>
</ul>
<h2><a class="anchor" id="autotoc_md177"></a>
Porting to GBDK 2020 3.1</h2>
<ul>
<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>
</ul>
<h2><a class="anchor" id="autotoc_md178"></a>
Porting to GBDK 2020 3.0.1</h2>
<ul>
<li>LCC was upgraded to use SDCC v4.0. Makefile changes may be required<ul>
<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>
<li>?? Suggested: With LCC argument: <code>-Wa-l</code> (sdasgb:<code>-a All user symbols made global</code>)</li>
<li>In SDCC 3.6.0, the default for char changed from signed to unsigned.<ul>
<li>If you want the old behavior use <code>--fsigned-char</code>.</li>
<li>lcc includes <code>--fsigned-char</code> by default</li>
<li>Explicit declaration of unsigned vars is encouraged (for example, '15U' instead of '15')</li>
</ul>
</li>
<li><code>.init</code> address has been removed</li>
</ul>
</li>
</ul>
<hr  />
<h1><a class="anchor" id="autotoc_md180"></a>
Historical GBDK versions</h1>
<h2><a class="anchor" id="autotoc_md181"></a>
GBDK 1.1 to GBDK 2.0</h2>
<ul>
<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>
<li>If your application uses the delay function, you'll have to adapt your delay values.</li>
<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>
<li>You will probably have to change the name of the header files that you include. </li>
</ul>
</div></div><!-- contents -->
</div><!-- PageDoc -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.14-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
</div>
</body>
</html>