Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase buffer size of usb util game name #484

Merged
merged 1 commit into from
Aug 10, 2021
Merged

Increase buffer size of usb util game name #484

merged 1 commit into from
Aug 10, 2021

Conversation

KrahJohlito
Copy link
Member

Pull Request checklist

Note: these are not necessarily requirements

  • I reformatted the code with clang-format
  • I checked to make sure my submission worked
  • I am the author of submission or have permission from the original author
  • Requires update of the PS2SDK
  • Requires update of the gsKit
  • Others (please specify below)

Pull Request description

@AKuHAK
Copy link
Member

AKuHAK commented Aug 10, 2021

That was easy :)

@AKuHAK
Copy link
Member

AKuHAK commented Aug 10, 2021

BTW does it handle startup properly when startup is maximum size?
as
memcpy(g->startup, &GameEntry.startup[3], GAME_STARTUP_MAX);
maybe startup also can be synced with
char startup[GAME_STARTUP_MAX + 3];
I am not sure if buffer is enough for startup too.

@KrahJohlito
Copy link
Member Author

I’m not familiar with the format I’ve only used ISO’s but if it’s the same ie SLUS_123.45 then 15 is plenty but it’s still better to have them all unified..

I think it’s just different contributors with different coding styles because GAME_STARTUP_MAX seems to include null where as the others don’t.. I prefer the +1 method personally cause it’s easy to look and see that’s for null.

Only reason the name was bugged for so long is because no one reported it so no one checked it.

@AKuHAK AKuHAK merged commit f21deb1 into ps2homebrew:master Aug 10, 2021
@KrahJohlito
Copy link
Member Author

Lol! No one tested before merge? I said I hadn’t tested it.. start up and name is messed up, strange.. anyway if it is also a USB util side issue there may be no choice but to revert and just keep the character limit at 31 as it would need to be updated there also.. maybe I’ll try contact the developer and look into fixing it both sides later on.. for now probably just revert @AKuHAK I’m on phone as usual so can’t do much at the moment.

@AKuHAK
Copy link
Member

AKuHAK commented Aug 11, 2021

@KrahJohlito the funniest thing is that report was false - I just tested 32 character long games with the previous beta and everything was fine.

@AKuHAK
Copy link
Member

AKuHAK commented Aug 11, 2021

Anyway I am working on some ul.cfg improvements, will fix it as well.

@KrahJohlito
Copy link
Member Author

Wow that’s… terrible, ok sounds good thanks @AKuHAK!

@KrahJohlito KrahJohlito deleted the KrahJohlito-patch-1-2 branch August 11, 2021 01:35
@blckbearx
Copy link

blckbearx commented Aug 11, 2021

@KrahJohlito the funniest thing is that report was false - I just tested 32 character long games with the previous beta and everything was fine.

So it works for you with the bigger buffer size? I'll try your CI builds and see, but in my case building locally leads to that issue with the increased buffer whereas building OPL without that commit works completely fine. Will edit this comment after testing.

Edit: or you mean a previous report and not mine, meaning the change was pointless? Kinda confused rn but I'm gonna test anyways just to be sure lol

Edit 2: tested your latest CI build, same issue as with my build, USB Util games still broken. The CI build previous to the commit works completely fine.

@KrahJohlito
Copy link
Member Author

Edit: or you mean a previous report and not mine, meaning the change was pointless? Kinda confused rn but I'm gonna test anyways just to be sure lol

There was a report on discord that usb util games with 32 characters was broken and need to be 31 or less hence the change, however it was working fine with 32 characters so the change was pointless to begin with.

@AKuHAK
Copy link
Member

AKuHAK commented Aug 11, 2021

@KrahJohlito this function is failing when gamename = 32

unsigned int USBA_crc32(const char *string)
{
int crc, table, count, byte;
for (table = 0; table < 256; table++) {
crc = table << 24;
for (count = 8; count > 0; count--) {
if (crc < 0)
crc = crc << 1;
else
crc = (crc << 1) ^ 0x04C11DB7;
}
crctab[255 - table] = crc;
}
do {
byte = string[count++];
crc = crctab[byte ^ ((crc >> 24) & 0xFF)] ^ ((crc << 8) & 0xFFFFFF00);
} while (string[count - 1] != 0);
return crc;
}

Ps2esdl has workaround:

} while ((string[count - 1] != 0) && (count <= 32));

will try it - maybe it helps

@AKuHAK
Copy link
Member

AKuHAK commented Aug 11, 2021

No, this function is correct - tested with the previous beta - didn't found any issues with 32 chars - game can be launched just fine without any problems.

AKuHAK added a commit that referenced this pull request Sep 30, 2021
Increase buffer size of usb util game name
citronalco pushed a commit to citronalco/OPL-Daily-Builds that referenced this pull request Sep 10, 2023
…-1-2

Increase buffer size of usb util game name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants