diff --git a/src/game.h b/src/game.h index 5ffe29f..1e58f67 100644 --- a/src/game.h +++ b/src/game.h @@ -34,6 +34,11 @@ extern game_state_t game_state; */ void title(void); +/** + * @brief Render the current game level. + */ +void level(void); + /** * @brief Enable interrupts. */ diff --git a/src/level.c b/src/level.c new file mode 100644 index 0000000..3c736be --- /dev/null +++ b/src/level.c @@ -0,0 +1,12 @@ +#include "game.h" +#include "sdk/hardware.h" +#include "sdk/joypad.h" + +void level(void) { + while (1) { + joypad_update(); + + HALT(); + rIF = 0; + } +} diff --git a/src/main.c b/src/main.c index 8e8894d..c8dc35e 100644 --- a/src/main.c +++ b/src/main.c @@ -29,6 +29,10 @@ void main() { case GAME_STATE_TITLE: title(); break; + + case GAME_STATE_LEVEL: + level(); + break; } } } diff --git a/src/title.c b/src/title.c index 13e2276..1b7778f 100644 --- a/src/title.c +++ b/src/title.c @@ -16,7 +16,6 @@ void title(void) { // Copy title screen to VRAM memcpy((uint8_t *)_VRAM, &bg_tiles[0], bg_tiles_end - bg_tiles); - // vram_memcpy(_VRAM, &bg_tiles[0], bg_tiles_end - bg_tiles); uint8_t *vram_ptr = (uint8_t *)_SCRN0; const uint8_t *map_ptr = &bg_map[0];