Skip to content

Commit

Permalink
Adjust NAND dir entry name size.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpd002 committed May 9, 2024
1 parent 6e58181 commit ba17810
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Source/iop/namco_sys147/Iop_NamcoNANDDevice.cpp
Expand Up @@ -29,13 +29,15 @@ Framework::CStream* CNamcoNANDDevice::GetFile(uint32 flags, const char* path)
for(unsigned int i = 0; i < sections.size(); i++)
{
auto dir = m_nandReader.ReadDirectory(currEntry.sector);
const auto& section = sections[i];
//Strangely, filesystem only saves 16 characters for entry name but some games
//will request files with more characters (ex.: Umimonogatari)... Cut the excess.
auto section = sections[i].substr(0, 16);

bool found = false;
for(unsigned int j = 0; j < dir.size(); j++)
{
const auto& dirEntry = dir[j];
if(!strcmp(dirEntry.name, section.c_str()))
if(!strncmp(dirEntry.name, section.c_str(), 16))
{
uint32 baseSector = currEntry.sector;
currEntry = dirEntry;
Expand Down
3 changes: 2 additions & 1 deletion Source/iop/namco_sys147/NamcoSys147NANDReader.h
Expand Up @@ -22,7 +22,8 @@ namespace Namco

struct DIRENTRY
{
char name[0x14];
char name[0x10];
uint32 unknown;
uint32 type;
uint32 size;
uint32 sector;
Expand Down

0 comments on commit ba17810

Please sign in to comment.