-
-
Save videlais/65f53a14c34adc90abb65baef83dcf13 to your computer and use it in GitHub Desktop.
GBDK Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <gb/gb.h> | |
void init(); | |
void checkInput(); | |
void main() { | |
init(); | |
while(1) { | |
checkInput(); | |
// Game code here | |
} | |
} | |
void init() { | |
DISPLAY_ON; // Turn on the display | |
NR52_REG = 0x8F; // Turn on the sound | |
NR51_REG = 0x11; // Enable the sound channels | |
NR50_REG = 0x77; // Increase the volume to its max | |
} | |
void checkInput() { | |
if (joypad() & J_B) { | |
// The B button was pressed! | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment