git.y1.nz

gbdk-2020

GameBoy Development Kit
download: https://git.y1.nz/archives/gbdk.tar.gz
README | Files | Log | Refs | LICENSE

docs/pages/07_sample_programs.md

      1 @page docs_example_programs Example Programs
      2 
      3 
      4 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 `make` in the correnponding directory.
      5 
      6 
      7 # banks (various projects)
      8 There are several different projects showing how to use ROM banking with GBDK.
      9 
     10 
     11 # comm
     12 Illustrates how to use communication routines.
     13 
     14 
     15 # crash
     16 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.
     17 
     18 
     19 # colorbar
     20 The colorbar program, written by Mr. N.U. of TeamKNOx, illustrates the use of colors on a Color GameBoy.
     21 
     22 
     23 # dscan
     24 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:
     25 
     26     RIGHT/LEFT   : Move your boat
     27     A/B          : Send a bomb from one side of your boat
     28     START        : Start game or pause game
     29 
     30     When game is paused:
     31 
     32     SELECT       : Invert A and B buttons
     33     RIGHT/LEFT   : Change speed
     34     UP/DOWN      : Change level
     35 
     36 
     37 # filltest
     38 Demonstrates various graphics routines.
     39 
     40 
     41 # fonts
     42 Examples of how to work with the built in font and printing features.
     43 
     44 
     45 # galaxy
     46 A C translation of the space.s assembly program.
     47 
     48 
     49 # gb-dtmf
     50 The gb-dtmf, written by Osamu Ohashi, is a Dual Tone Multi-Frequency (DTMF) generator.
     51 
     52 
     53 # gbdecompress
     54 Demonstrates using gbdecompress to load a compressed tile set into VRAM.
     55 
     56 
     57 # irq
     58 Illustrates how to install interrupt handlers.
     59 
     60 
     61 # large map
     62 Shows how to scroll with maps larger than 32 x 32 tiles using set_bkg_submap(). 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.
     63 
     64 
     65 # metasprites
     66 Demonstrates using the metasprite features to move and animate a large sprite.
     67 * Press A button to show / hide the metasprite
     68 * Press B button to cycle through the metasprite animations
     69 * Press SELECT button to cycle the metasprite through Normal / Flip-Y / Flip-XY / Flip-X
     70 * Up / Down / Left / Right to move the metasprite
     71 
     72 
     73 # lcd isr wobble
     74 An example of how to use the LCD ISR for visual special effects.
     75 
     76 
     77 # paint
     78 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.
     79 
     80     Arrow keys : Move the cursor
     81     SELECT     : Display/hide the tools palette
     82     A          : Select tool
     83 
     84 
     85 # rand
     86 The rand program, written by Luc Van den Borre, illustrates the use of the GBDK random generator.
     87 
     88 
     89 # ram_fn
     90 The ram_fn example illustrates how to copy functions to RAM or HIRAM, and how to call them from C.
     91 
     92 
     93 # rpn
     94 A basic RPN calculator. Try entering expressions like 12 134* and then 1789+.
     95 
     96 
     97 # samptest
     98 Demonstration of playing a sound sample.
     99 
    100 
    101 # sgb (various)
    102 A collection of examples showing how to use the Super Game Boy API features.
    103 
    104 
    105 @anchor examples_sound_sample
    106 # sound
    107 The sound example is meant for experimenting with the sound 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:
    108 
    109     UP/DOWN      : Move the cursor
    110     RIGHT/LEFT   : Increment/decrement the value
    111     RIGHT/LEFT+A : Increment/decrement the value by 10
    112     RIGHT/LEFT+B : Set the value to maximum/minimum
    113     START        : Play the current mode's sound (or all modes if in control screen)
    114     START+A      : Play a little music with the current mode's sound
    115     SELECT       : Change the sound mode (1, 2, 3, 4 and control)
    116     SELECT+A     : Dump the sound registers to the screen
    117 
    118 
    119 # space
    120 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:
    121 
    122     Arrow keys     : Change the speed (and direction) of the sprite
    123     Arrow keys + A : Change the speed (and direction) of the window
    124     Arrow keys + B : Change the speed (and direction) of the background
    125     START          : Open/close the door
    126     SELECT         : Basic fading effect
    127 
    128 
    129 # templates
    130 Two basic template examples are provided as a starting place for writing your GBDK programs.
    131 

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.