docs_example_programs.html (9887B)
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: Example Programs</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_example_programs.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">Example Programs </div> </div> 91</div><!--header--> 92<div class="contents"> 93<div class="textblock"><p>GBDK includes several example programs both in C and in assembly. They are located in the examples directory, and in its subdirectories. They can be built by typing <code>make</code> in the correnponding directory.</p> 94<h1><a class="anchor" id="autotoc_md139"></a> 95banks (various projects)</h1> 96<p>There are several different projects showing how to use ROM banking with GBDK.</p> 97<h1><a class="anchor" id="autotoc_md140"></a> 98comm</h1> 99<p>Illustrates how to use communication routines.</p> 100<h1><a class="anchor" id="autotoc_md141"></a> 101crash</h1> 102<p>Demonstrates how to use the optional GBDK crash handler which dumps debug info to the Game Boy screen in the event of a program crash.</p> 103<h1><a class="anchor" id="autotoc_md142"></a> 104colorbar</h1> 105<p>The colorbar program, written by Mr. N.U. of TeamKNOx, illustrates the use of colors on a Color GameBoy.</p> 106<h1><a class="anchor" id="autotoc_md143"></a> 107dscan</h1> 108<p>Deep Scan is a game written by Mr. N.U. of TeamKNOx that supports the Color GameBoy. Your aim is to destroy the submarines from your boat, and to avoid the projectiles that they send to you. The game should be self-explanatory. The following keys are used: </p><pre class="fragment">RIGHT/LEFT : Move your boat 109A/B : Send a bomb from one side of your boat 110START : Start game or pause game 111 112When game is paused: 113 114SELECT : Invert A and B buttons 115RIGHT/LEFT : Change speed 116UP/DOWN : Change level 117</pre><h1><a class="anchor" id="autotoc_md144"></a> 118filltest</h1> 119<p>Demonstrates various graphics routines.</p> 120<h1><a class="anchor" id="autotoc_md145"></a> 121fonts</h1> 122<p>Examples of how to work with the built in font and printing features.</p> 123<h1><a class="anchor" id="autotoc_md146"></a> 124galaxy</h1> 125<p>A C translation of the space.s assembly program.</p> 126<h1><a class="anchor" id="autotoc_md147"></a> 127gb-dtmf</h1> 128<p>The gb-dtmf, written by Osamu Ohashi, is a Dual Tone Multi-Frequency (DTMF) generator.</p> 129<h1><a class="anchor" id="autotoc_md148"></a> 130gbdecompress</h1> 131<p>Demonstrates using gbdecompress to load a compressed tile set into vram.</p> 132<h1><a class="anchor" id="autotoc_md149"></a> 133irq</h1> 134<p>Illustrates how to install interrupt handlers.</p> 135<h1><a class="anchor" id="autotoc_md150"></a> 136large map</h1> 137<p>Shows how to scroll with maps larger than 32 x 32 tiles using <a class="el" href="gb_8h.html#adb21d1c7d533a7133bab36a845489780">set_bkg_submap()</a>. It fills rows and columns at the edges of the visible viewport (of the hardware Background Map) with the desired sub-region of the large map as it scrolls.</p> 138<h1><a class="anchor" id="autotoc_md151"></a> 139metasprites</h1> 140<p>Demonstrates using the metasprite features to move and animate a large sprite.</p><ul> 141<li>Press A button to show / hide the metasprite</li> 142<li>Press B button to cycle through the metasprite animations</li> 143<li>Press SELECT button to cycle the metasprite through Normal / Flip-Y / Flip-XY / Flip-X</li> 144<li>Up / Down / Left / Right to move the metasprite</li> 145</ul> 146<h1><a class="anchor" id="autotoc_md152"></a> 147lcd isr wobble</h1> 148<p>An example of how to use the LCD ISR for visual special effects</p> 149<h1><a class="anchor" id="autotoc_md153"></a> 150paint</h1> 151<p>The paint example is a painting program. It supports different painting tools, drawing modes, and colors. At the moment, it only paints individual pixels. This program illustrates the use of the full-screen drawing library. It also illustrates the use of generic structures and big sprites. </p><pre class="fragment">Arrow keys : Move the cursor 152SELECT : Display/hide the tools palette 153A : Select tool 154</pre><h1><a class="anchor" id="autotoc_md154"></a> 155rand</h1> 156<p>The rand program, written by Luc Van den Borre, illustrates the use of the GBDK random generator.</p> 157<h1><a class="anchor" id="autotoc_md155"></a> 158ram_fn</h1> 159<p>The ram_fn example illustrates how to copy functions to RAM or HIRAM, and how to call them from C.</p> 160<h1><a class="anchor" id="autotoc_md156"></a> 161rpn</h1> 162<p>A basic RPN calculator. Try entering expressions like 12 134* and then 1789+.</p> 163<h1><a class="anchor" id="autotoc_md157"></a> 164samptest</h1> 165<p>Demonstration of playing a sound sample.</p> 166<h1><a class="anchor" id="autotoc_md158"></a> 167sgb (various)</h1> 168<p>A collection of examples showing how to use the Super Game Boy API features.</p> 169<p><a class="anchor" id="examples_sound_sample"></a></p> 170<h1><a class="anchor" id="autotoc_md159"></a> 171sound</h1> 172<p>The sound example is meant for experimenting with the soung generator of the GameBoy (to use on a real GameBoy). The four different sound modes of the GameBoy are available. It also demonstrates the use of bit fields in C (it's a quick hack, so don't expect too much from the code). The following keys are used: </p><pre class="fragment">UP/DOWN : Move the cursor 173RIGHT/LEFT : Increment/decrement the value 174RIGHT/LEFT+A : Increment/decrement the value by 10 175RIGHT/LEFT+B : Set the value to maximum/minimum 176START : Play the current mode's sound (or all modes if in control screen) 177START+A : Play a little music with the current mode's sound 178SELECT : Change the sound mode (1, 2, 3, 4 and control) 179SELECT+A : Dump the sound registers to the screen 180</pre><h1><a class="anchor" id="autotoc_md160"></a> 181space</h1> 182<p>The space example is an assembly program that demonstrates the use of sprites, window, background, fixed-point values and more. The following keys are used: </p><pre class="fragment">Arrow keys : Change the speed (and direction) of the sprite 183Arrow keys + A : Change the speed (and direction) of the window 184Arrow keys + B : Change the speed (and direction) of the background 185START : Open/close the door 186SELECT : Basic fading effect 187</pre><h1><a class="anchor" id="autotoc_md161"></a> 188templates</h1> 189<p>Two basic template examples are provided as a starting place for writing your GBDK programs. </p> 190</div></div><!-- contents --> 191</div><!-- PageDoc --> 192</div><!-- doc-content --> 193<!-- HTML footer for doxygen 1.8.14--> 194<!-- start footer part --> 195<div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> 196</div> 197</body> 198</html>