Difference between revisions of "Code Examples"

From GbdevWiki
Jump to: navigation, search
(GBDK C examples)
(GBDK C examples)
(2 intermediate revisions by 2 users not shown)
Line 12: Line 12:
  
 
== GBDK C examples ==
 
== GBDK C examples ==
 +
[https://github.com/mrombout/gbdk_playground GBDK Playground] - Simplified GBDK Examples
 +
 
[[Simple paint program]]
 
[[Simple paint program]]
  
Line 17: Line 19:
  
 
[[Convert string to integer]]
 
[[Convert string to integer]]
 +
 +
[[Send byte across link cable]]
 +
 +
[[receive byte across link cable]]
  
 
== Simple GBDK example ==
 
== Simple GBDK example ==
Line 36: Line 42:
 
* [[ASM Init| GB Initialization]]
 
* [[ASM Init| GB Initialization]]
 
* [[ASM Joypad| Reading the joypad]]
 
* [[ASM Joypad| Reading the joypad]]
 +
* [[ASM Snippets]]

Revision as of 14:35, 28 March 2019

Simple GBBasic 2.10 example

10 rem Simple example
20 for i=1 to 16
30 u=rnd(1)*16
40 print u
50 delay 20
60 next i
70 end

GBDK C examples

GBDK Playground - Simplified GBDK Examples

Simple paint program

Tic Tac Toe

Convert string to integer

Send byte across link cable

receive byte across link cable

Simple GBDK example


#include <gb/gb.h>
#include <stdio.h>

void main()
{
printf("nHello World!");
}

Assembler examples