Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
dbeef committed May 26, 2018
1 parent 338a6b0 commit c291259
Show file tree
Hide file tree
Showing 94 changed files with 1,144 additions and 869 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
build/
cmake-build-debug/
.idea/
nitrofiles/
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -35,4 +35,4 @@ add_executable(spelunkyds
source/game_loop.h
includes/TextBackgrounds.h
Makefile
README.md source/sprites/main_dude/main_dude.cpp source/sprites/main_dude/main_dude.h source/sprites/sprite_state.h source/tiles/screen_positions.h source/globals_declarations.h source/game_loop.h source/tiles/level_generator.cpp source/tiles/level_generator.h source/tiles/map_utils.cpp source/tiles/map_utils.h source/tiles/map_tile.cpp source/tiles/map_tile.h source/collisions/collisions.cpp source/collisions/collisions.h source/hud/hud.cpp source/hud/hud.h source/sprites/sprite_info.cpp source/sprites/sprite_info.h source/camera/camera.cpp source/camera/camera.h source/memory/oam_manager.cpp source/memory/oam_manager.h source/input/input_handler.cpp source/input/input_handler.h source/sprites/spritesheet_type.h source/memory/oam_type.h source/sprites/items/rock.h source/sprites/items/jar.cpp source/sprites/items/jar.h source/sprites/enemies/snake.cpp source/sprites/enemies/snake.h source/sprites/collectibles/moniez.cpp source/sprites/collectibles/moniez.h source/tiles/map_tile_type.h source/sprites/animations/blood.cpp source/sprites/animations/blood.h source/sprites/animations/blood_element.cpp source/sprites/animations/blood_element.h source/sprites/non_interactive/spelunky_title.cpp source/sprites/non_interactive/spelunky_title.h source/tiles/tile_orientation.h source/sprites/non_interactive/title_menu_sign.cpp source/sprites/non_interactive/title_menu_sign.h source/sprites/menu_sign_type.h source/tiles/splash_screen_type.h source/rooms/left_right_rooms.h source/rooms/left_right_down_rooms.h source/rooms/left_right_up_rooms.h source/rooms/closed_rooms.h source/rooms/splash_screens.h source/rooms/entrance_rooms.h source/rooms/exit_rooms.h source/rooms/room_type.h source/sprites/enemies/bat.cpp source/sprites/enemies/bat.h source/sprites/enemies/spider.cpp source/sprites/enemies/spider.h source/sprites/sprite_type.h source/globals_definitions.h source/sound/sound_utils.h source/console/console_utils.h source/time/time_utils.h source/time/time_utils.cpp source/memory/oam_utils.cpp source/memory/oam_utils.h source/sprites/main_dude/whip.cpp source/sprites/main_dude/whip.h source/sprites/traps/spikes.cpp source/sprites/traps/spikes.h source/sprites/collectibles/chest.cpp source/sprites/collectibles/chest.h source/sprites/collectibles/crate.h source/sprites/collectibles/crate.cpp source/sprites/collectibles/shotgun.h source/sprites/collectibles/shotgun.cpp source/sprites/collectibles/bullet.h source/sprites/collectibles/bullet.cpp source/sprites/collectibles/pistol.h source/sprites/collectibles/pistol.cpp source/sprites/collectibles/spring_shoes.h source/sprites/collectibles/spring_shoes.cpp source/sprites/collectibles/mitt.h source/sprites/collectibles/mitt.cpp source/sprites/collectibles/glove.h source/sprites/collectibles/glove.cpp source/sprites/collectibles/compass.h source/sprites/collectibles/compass.cpp source/sprites/animations/got_collectible.h source/sprites/animations/got_collectible.cpp)
README.md source/sprites/main_dude/main_dude.cpp source/sprites/main_dude/main_dude.h source/sprites/sprite_state.h source/tiles/screen_positions.h source/globals_declarations.h source/game_loop.h source/tiles/level_generator.cpp source/tiles/level_generator.h source/tiles/map_utils.cpp source/tiles/map_utils.h source/tiles/map_tile.cpp source/tiles/map_tile.h source/collisions/collisions.cpp source/collisions/collisions.h source/hud/hud.cpp source/hud/hud.h source/sprites/sprite_info.cpp source/sprites/sprite_info.h source/camera/camera.cpp source/camera/camera.h source/memory/oam_manager.cpp source/memory/oam_manager.h source/input/input_handler.cpp source/input/input_handler.h source/sprites/spritesheet_type.h source/memory/oam_type.h source/sprites/items/rock.h source/sprites/items/jar.cpp source/sprites/items/jar.h source/sprites/enemies/snake.cpp source/sprites/enemies/snake.h source/sprites/collectibles/moniez.cpp source/sprites/collectibles/moniez.h source/tiles/map_tile_type.h source/sprites/animations/blood.cpp source/sprites/animations/blood.h source/sprites/animations/blood_element.cpp source/sprites/animations/blood_element.h source/sprites/non_interactive/spelunky_title.cpp source/sprites/non_interactive/spelunky_title.h source/tiles/tile_orientation.h source/sprites/non_interactive/title_menu_sign.cpp source/sprites/non_interactive/title_menu_sign.h source/sprites/menu_sign_type.h source/tiles/splash_screen_type.h source/rooms/left_right_rooms.h source/rooms/left_right_down_rooms.h source/rooms/left_right_up_rooms.h source/rooms/closed_rooms.h source/rooms/splash_screens.h source/rooms/entrance_rooms.h source/rooms/exit_rooms.h source/rooms/room_type.h source/sprites/enemies/bat.cpp source/sprites/enemies/bat.h source/sprites/enemies/spider.cpp source/sprites/enemies/spider.h source/sprites/sprite_type.h source/globals_definitions.h source/sound/sound_utils.h source/console/console_utils.h source/time/time_utils.h source/time/time_utils.cpp source/memory/oam_utils.cpp source/memory/oam_utils.h source/sprites/main_dude/whip.cpp source/sprites/main_dude/whip.h source/sprites/traps/spikes.cpp source/sprites/traps/spikes.h source/sprites/collectibles/chest.cpp source/sprites/collectibles/chest.h source/sprites/collectibles/crate.h source/sprites/collectibles/crate.cpp source/sprites/collectibles/shotgun.h source/sprites/collectibles/shotgun.cpp source/sprites/collectibles/bullet.h source/sprites/collectibles/bullet.cpp source/sprites/collectibles/pistol.h source/sprites/collectibles/pistol.cpp source/sprites/collectibles/spring_shoes.h source/sprites/collectibles/spring_shoes.cpp source/sprites/collectibles/mitt.h source/sprites/collectibles/mitt.cpp source/sprites/collectibles/glove.h source/sprites/collectibles/glove.cpp source/sprites/collectibles/compass.h source/sprites/collectibles/compass.cpp source/sprites/animations/got_collectible.h source/sprites/animations/got_collectible.cpp source/camera/layer_level.h source/sprites/enemies/shopkeeper.h source/sprites/enemies/shopkeeper.cpp)
8 changes: 7 additions & 1 deletion Makefile
Expand Up @@ -38,6 +38,7 @@ GAME_ICON := ../gfx/icon/icon.bmp
GAME_TITLE := SpelunkyDS
GAME_SUBTITLE1 := github.com/dbeef/spelunky-ds
GAME_SUBTITLE2 :=
NITRODATA := nitrofiles

#---------------------------------------------------------------------------------
# options for code generation
Expand All @@ -58,7 +59,7 @@ LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS := -lnds9 -lmm9
LIBS := -lfilesystem -lfat -lnds9 -lmm9


#---------------------------------------------------------------------------------
Expand Down Expand Up @@ -87,6 +88,10 @@ export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \

export DEPSDIR := $(CURDIR)/$(BUILD)

ifneq ($(strip $(NITRODATA)),)
export NITRO_FILES := $(CURDIR)/$(NITRODATA)
endif

CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
Expand Down Expand Up @@ -149,6 +154,7 @@ DEPENDS := $(OFILES:.o=.d)
# main targets
#---------------------------------------------------------------------------------
$(OUTPUT).nds : $(OUTPUT).elf
$(OUTPUT).nds : $(shell find $(TOPDIR)/$(NITRODATA))
$(OUTPUT).elf : $(OFILES)
%.s %.h : ../gfx/fonts/%.png
grit $< -ff../gfx/fonts/font.grit -o$*
Expand Down
Empty file modified gfx/icon/icon.bmp 100644 → 100755
Empty file.
Empty file modified gfx/icon/readme.txt 100644 → 100755
Empty file.
Binary file modified gfx/sprites/16x16/gfx_saleable.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified gfx/sprites/16x16/gfx_shopkeeper.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified gfx/sprites/16x16/gfx_spelunker.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified gfx/sprites/16x16/gfx_spike_collectibles.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified gfx/sprites/32x32/gfx_got_collectible.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified gfx/sprites/8x8/gfx_blood_rock_rope.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gfx/sprites/8x8/gfx_rubies.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed gfx/sprites/8x8/gfx_rubies_big.png
Binary file not shown.
Binary file added readme/gameplay.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readme/title_bg.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified sounds/xbat.wav 100644 → 100755
Empty file.
Empty file modified sounds/xchestopen.wav 100644 → 100755
Empty file.
Empty file modified sounds/xclimb1.wav 100644 → 100755
Empty file.
Empty file modified sounds/xclimb2.wav 100644 → 100755
Empty file.
Empty file modified sounds/xdie.wav 100644 → 100755
Empty file.
Empty file modified sounds/xhit.wav 100644 → 100755
Empty file.
Empty file modified sounds/xhurt.wav 100644 → 100755
Empty file.
Empty file modified sounds/xpickup.wav 100644 → 100755
Empty file.
Empty file modified sounds/xshotgun.wav 100644 → 100755
Empty file.
Empty file modified sounds/xspiderjump.wav 100644 → 100755
Empty file.
19 changes: 19 additions & 0 deletions source/camera/layer_level.h
@@ -0,0 +1,19 @@
//
// Created by xdbeef on 24.05.18.
//

#ifndef SPELUNKYDS_LAYER_TYPES_H
#define SPELUNKYDS_LAYER_TYPES_H

//lie
//sprite priority level 0 - highest.
//sprite priority level 3 - lowest.

enum LAYER_LEVEL {
TOP,
MIDDLE_TOP,
MIDDLE_BOT,
BOTTOM,
};

#endif //SPELUNKYDS_LAYER_TYPES_H
4 changes: 2 additions & 2 deletions source/collisions/collisions.cpp
Expand Up @@ -308,10 +308,10 @@ bool Collisions::checkCollisionWithMainDudeWidthBoundary(int x, int y, int width

bool Collisions::checkCollisionWithMainDudeWhip(int x, int y, int width, int height) {
if (global::main_dude->state == SpriteState::W_LEFT) {
return x + width >= global::main_dude->x - 10 && x + width < global::main_dude->x + MAIN_DUDE_PHYSICAL_WIDTH &&
return x + width >= global::main_dude->x - WHIP_WIDTH && x + width < global::main_dude->x + MAIN_DUDE_PHYSICAL_WIDTH &&
y + height > global::main_dude->y && y < global::main_dude->y + MAIN_DUDE_PHYSICAL_HEIGHT;
} else if (global::main_dude->state == SpriteState::W_RIGHT) {
return x + width >= global::main_dude->x && x + width < global::main_dude->x + MAIN_DUDE_PHYSICAL_WIDTH + 20 &&
return x + width >= global::main_dude->x && x + width < global::main_dude->x + MAIN_DUDE_PHYSICAL_WIDTH + WHIP_WIDTH*2 &&
y + height > global::main_dude->y && y < global::main_dude->y + MAIN_DUDE_PHYSICAL_HEIGHT;
} else return false;

Expand Down
3 changes: 2 additions & 1 deletion source/console/console_utils.h 100644 → 100755
Expand Up @@ -8,6 +8,7 @@
#include <nds/arm9/console.h>
#include "../../build/font.h"
#include "../globals_definitions.h"
#include "../camera/layer_level.h"

namespace console {

Expand All @@ -17,7 +18,7 @@ namespace console {

//The default instance utilizes the sub display, approximatly 15KiB of vram C starting
//at tile base 0 and 2KiB of map at map base 30.
consoleInit(global::printConsole, 0, BgType_Text4bpp, BgSize_T_256x256, map_base, tile_base, true, false);
consoleInit(global::printConsole, OBJPRIORITY_0, BgType_Text4bpp, BgSize_T_256x256, map_base, tile_base, true, false);

ConsoleFont font;

Expand Down
2 changes: 1 addition & 1 deletion source/game_loop.cpp
Expand Up @@ -162,7 +162,7 @@ void gameloop::populate_cave_moniez() {
if (loot_type == 2 && rubies_left > 0 && r == 1) {
Moniez *moniez = new Moniez();

moniez->spriteType = MONIEZ_RUBY_BIG;
moniez->spriteType = MONIEZ_RUBY;
moniez->value = 1200;
moniez->init();
global::sprites.push_back(moniez);
Expand Down
3 changes: 3 additions & 0 deletions source/globals_declarations.h
Expand Up @@ -38,7 +38,10 @@ namespace global {
extern Hud *hud;
extern int bg_main_address;
extern int bg_sub_address;

extern std::vector<MovingObject *> sprites;
//make sprites_layer_1, sprites_layer2, etc

extern std::vector<SpriteInfo *> spriteInfos;
extern bool bombed;
extern double *timer;
Expand Down
16 changes: 8 additions & 8 deletions source/hud/hud.cpp
Expand Up @@ -52,12 +52,12 @@ void Hud::show() {

void Hud::initSprites() {

heartSpriteInfo = global::main_oam_manager->initSprite(gfx_hudPal, gfx_hudPalLen, nullptr, 16 * 16, 16, HUD, true, false);
dollarSpriteInfo = global::main_oam_manager->initSprite(gfx_hudPal, gfx_hudPalLen, nullptr, 16 * 16, 16, HUD, true, false);
bombSpriteInfo = global::main_oam_manager->initSprite(gfx_hudPal, gfx_hudPalLen, nullptr, 16 * 16, 16, HUD, true, false);
ropeSpriteInfo = global::main_oam_manager->initSprite(gfx_hudPal, gfx_hudPalLen, nullptr, 16 * 16, 16, HUD, true, false);
heartSpriteInfo = global::main_oam_manager->initSprite(gfx_hudPal, gfx_hudPalLen, nullptr, 16 * 16, 16, HUD, true, false,LAYER_LEVEL::TOP);
dollarSpriteInfo = global::main_oam_manager->initSprite(gfx_hudPal, gfx_hudPalLen, nullptr, 16 * 16, 16, HUD, true, false,LAYER_LEVEL::TOP);
bombSpriteInfo = global::main_oam_manager->initSprite(gfx_hudPal, gfx_hudPalLen, nullptr, 16 * 16, 16, HUD, true, false,LAYER_LEVEL::TOP);
ropeSpriteInfo = global::main_oam_manager->initSprite(gfx_hudPal, gfx_hudPalLen, nullptr, 16 * 16, 16, HUD, true, false,LAYER_LEVEL::TOP);
holdingItemSpriteInfo = global::main_oam_manager->initSprite(gfx_hudPal, gfx_hudPalLen, nullptr, 16 * 16, 16, HUD, true,
false);
false,LAYER_LEVEL::TOP);

u8 *frameGfxHeart = (u8 *) gfx_hudTiles + 0 * 16 * 16 / 2;
heartSpriteInfo->updateFrame(frameGfxHeart, 16 * 16);
Expand Down Expand Up @@ -212,7 +212,7 @@ void Hud::draw_on_level_done() {
Moniez *moniez = new Moniez();
moniez->sprite_height = 8;
moniez->sprite_width = 8;
moniez->spriteType = MONIEZ_RUBY_BIG;
moniez->spriteType = MONIEZ_RUBY;
moniez->value = 1200;
moniez->ruby_type = 0;
moniez->initSprite();
Expand All @@ -227,7 +227,7 @@ void Hud::draw_on_level_done() {
Moniez *moniez = new Moniez();
moniez->sprite_height = 8;
moniez->sprite_width = 8;
moniez->spriteType = MONIEZ_RUBY_BIG;
moniez->spriteType = MONIEZ_RUBY;
moniez->value = 1200;
moniez->ruby_type = 1;
moniez->initSprite();
Expand All @@ -243,7 +243,7 @@ void Hud::draw_on_level_done() {
Moniez *moniez = new Moniez();
moniez->sprite_height = 8;
moniez->sprite_width = 8;
moniez->spriteType = MONIEZ_RUBY_BIG;
moniez->spriteType = MONIEZ_RUBY;
moniez->value = 1200;
moniez->ruby_type = 2;
moniez->initSprite();
Expand Down
167 changes: 160 additions & 7 deletions source/main.cpp
Expand Up @@ -5,12 +5,83 @@
#include "../build/gfx_cavebg.h"
#include "globals_declarations.h"
#include "globals_definitions.h"
#include "tiles/map_utils.h"
#include "tiles/splash_screen_type.h"
#include "game_loop.h"
#include "sound/sound_utils.h"
#include "time/time_utils.h"
#include "console/console_utils.h"
#include "camera/layer_level.h"

/*
bool done = false;
FILE *pFile;
//---------------------------------------------------------------------------------
void dirlist(const char *path) {
//---------------------------------------------------------------------------------
DIR *pdir = opendir(path);
if (pdir != NULL) {
while (true) {
struct dirent *pent = readdir(pdir);
if (pent == NULL) break;
if (strcmp(".", pent->d_name) != 0 && strcmp("..", pent->d_name) != 0) {
if (pent->d_type == DT_DIR) {
printf("%s/%s <DIR>\n", (strcmp("/", path) == 0) ? "" : path, pent->d_name);
char *dnbuf = (char *) malloc(strlen(pent->d_name) + strlen(path) + 2);
sprintf(dnbuf, "%s/%s", (strcmp("/", path) == 0) ? "" : path, pent->d_name);
dirlist(dnbuf);
free(dnbuf);
} else {
printf("%s/%s\n", (strcmp("/", path) == 0) ? "" : path, pent->d_name);
}
}
}
closedir(pdir);
} else {
printf("OPENDIR() FAILIURE.\n");
}
}
mm_word stream(mm_word length, mm_addr dest, mm_stream_formats format) {
size_t samplesize;
switch (format) {
case MM_STREAM_8BIT_MONO:
samplesize = 1;
break;
case MM_STREAM_8BIT_STEREO:
samplesize = 2;
break;
case MM_STREAM_16BIT_MONO:
samplesize = 2;
break;
case MM_STREAM_16BIT_STEREO:
samplesize = 4;
break;
}
int res = fread(dest, samplesize, length, pFile);
if (res) {
length = res;
std::cout << length << '\n';
} else {
//End of file
std::cout << "END OF FILE" << '\n';
length = 0;
done = true;
}
return length; //Return the number of samples read
}
*/


int main() {

Expand All @@ -19,34 +90,116 @@ int main() {

time::start();

videoSetMode(MODE_0_2D);
videoSetModeSub(MODE_0_2D);
/* Set the video mode on the main screen. */
videoSetMode(MODE_0_2D | // Set the graphics mode to Mode 5
DISPLAY_BG0_ACTIVE | // Enable BG2 for display
DISPLAY_BG1_ACTIVE | // Enable BG2 for display
DISPLAY_BG2_ACTIVE | // Enable BG2 for display
DISPLAY_BG3_ACTIVE); //Enable BG3 for display
/* Set the video mode on the main screen. */
videoSetModeSub(MODE_0_2D | // Set the graphics mode to Mode 5
DISPLAY_BG0_ACTIVE | // Enable BG2 for display
DISPLAY_BG1_ACTIVE | // Enable BG2 for display
DISPLAY_BG2_ACTIVE | // Enable BG2 for display
DISPLAY_BG3_ACTIVE); //Enable BG3 for display

// videoSetMode(MODE_0_2D);
// videoSetModeSub(MODE_0_2D);

vramSetBankA(VRAM_A_MAIN_BG_0x06000000);
//vram c is used by the console (by default):
vramSetBankC(VRAM_C_SUB_BG_0x06200000);


vramSetBankE(VRAM_E_MAIN_SPRITE);
vramSetBankD(VRAM_D_SUB_SPRITE);

oamInit(&oamMain, SpriteMapping_1D_64, false);
oamInit(&oamSub, SpriteMapping_1D_64, false);

global::bg_main_address = bgInit(2, BgType_Text8bpp, BgSize_B8_512x512, 22, 4);
global::bg_sub_address = bgInitSub(3, BgType_Text8bpp, BgSize_B8_512x512, 18, 4);
global::bg_main_address = bgInit(OBJPRIORITY_3, BgType_Text8bpp, BgSize_B8_512x512, 22, 4);
global::bg_sub_address = bgInitSub(OBJPRIORITY_3, BgType_Text8bpp, BgSize_B8_512x512, 18, 4);

dmaCopy(gfx_cavebgTiles, bgGetGfxPtr(global::bg_main_address), sizeof(gfx_cavebgTiles));
dmaCopy(gfx_cavebgTiles, bgGetGfxPtr(global::bg_sub_address), sizeof(gfx_cavebgTiles));


global::level_generator->newLayout(timerElapsed(0));
global::level_generator->generate_splash_screen(SplashScreenType::MAIN_MENU_UPPER);
global::level_generator->generate_splash_screen(SplashScreenType::MAIN_MENU_LOWER);
global::level_generator->render_tiles_on_base_map();

console::init();

/*
if (nitroFSInit(NULL)) {
dirlist("/");
{
// now, try reading a file to make sure things are working OK.
FILE *inf = fopen("file1.txt", "rb");
if (inf) {
int len;
fseek(inf, 0, SEEK_END);
len = ftell(inf);
fseek(inf, 0, SEEK_SET);
printf("\nTHE FOLLOWING %d BYTES MESSAGE\nfrom file1.txt is\nbrought to you by fread:\n", len);
{
char *entireFile = (char *) malloc(len + 1);
entireFile[len] = 0;
if (fread(entireFile, 1, len, inf) != len)
printf("SAVAGE ERROR READING BYTES FROM THE FILE!\n");
else
printf("%s\n-DONE-\n", entireFile);
free(entireFile);
}
fclose(inf);
}
}
printf("HERE IS THE DIRLIST ONCE MORE:\n");
dirlist("/");
} else {
printf("NITROFSINIT FAILIURE: TERMINATIONG\n");
}
timerStart(0, ClockDivider_1024, 1000, 0);
mm_stream mystream;
mystream.buffer_length = 4096 * 4; //16kb
mystream.callback = stream;
mystream.timer = MM_TIMER1;
mystream.manual = false;
mystream.sampling_rate = 16000;
mystream.format = MM_STREAM_8BIT_MONO;
pFile = fopen("xpause.raw", "rb");
mmStreamOpen(&mystream);
int timer = 0;
while (1) {
// mmStreamUpdate();
swiWaitForVBlank();
if (done) {
mmStreamClose();
fclose(pFile);
}
// timer += (timerElapsed(0) / TICKS_PER_SECOND);
// if(timer > 100 * 1000) {
// timer = 0;
//
// }
}
*/
dmaCopy(gfx_cavebgPal, BG_PALETTE, gfx_cavebgPalLen);
dmaCopy(gfx_cavebgPal, BG_PALETTE_SUB, gfx_cavebgPalLen);

Expand Down

0 comments on commit c291259

Please sign in to comment.