Skip to content

Instantly share code, notes, and snippets.

@videlais

videlais/bank1.c Secret

Created July 9, 2016 06:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save videlais/834df1afc434d74ed3780a45b34927e0 to your computer and use it in GitHub Desktop.
Save videlais/834df1afc434d74ed3780a45b34927e0 to your computer and use it in GitHub Desktop.
bank1.c example
#include <gb/gb.h>
// These are our extern(ally) defined functions we use in bank1
extern void checkInput();
extern void updateSwitches();
extern UINT8 collisionCheck(UINT8, UINT8, UINT8, UINT8, UINT8, UINT8, UINT8, UINT8);
void update() {
while(1) {
checkInput(); // Check for user input (and act on it)
updateSwitches(); // Make sure the SHOW_SPRITES and SHOW_BKG switches are on each loop
wait_vbl_done(); // Wait until VBLANK to avoid corrupting memory
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment