Skip to content

Commit

Permalink
No longer crashes hard, when an SPS file or rom file fails to open my…
Browse files Browse the repository at this point in the history
…steriously, despite previous success of that file.
  • Loading branch information
CaitSith2 committed Sep 9, 2011
1 parent c61dcdc commit 65e27e1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Binary file modified NDS_Music_Player.nds
Binary file not shown.
10 changes: 10 additions & 0 deletions arm9/source/template.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,11 @@ void ReadSPS()
consoleClear();

FILE* f = fopen(CurrentSPS, "rb");
if(!f)
{
iprintf("%s failed to open\n",CurrentSPS);
return;
}

fseek(f, 0x0C, SEEK_SET);
iprintf("Reading NDS path length.\n");
Expand Down Expand Up @@ -559,6 +564,11 @@ void ReadSSEQ()

//Opens file
FILE* f = fopen(CurrentSPS, "rb");
if(!f)
{
iprintf("%s failed to open\n",CurrentSPS);
return;
}

//Reads SSEQDataOffset
fseek(f, 0x08, SEEK_SET);
Expand Down

0 comments on commit 65e27e1

Please sign in to comment.