Skip to content

Instantly share code, notes, and snippets.

@TheOfficialFloW
Created June 17, 2017 10:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheOfficialFloW/cac193b9baf1a6be8d987258db66352f to your computer and use it in GitHub Desktop.
Save TheOfficialFloW/cac193b9baf1a6be8d987258db66352f to your computer and use it in GitHub Desktop.
Get titleid value. Used in ScePspemu for specific title adjustment
uint32_t getTitleIdValue(const char *titleid) {
uint32_t titleid_number = strtol(titleid+4, 0, 16);
uint32_t titleid_prefix = titleid[3] | (titleid[2] << 8) | (titleid[1] << 16) | (titleid[0] << 24);
uint32_t titleid_value = (titleid_number + (titleid_number << 12)) ^ titleid_prefix;
return titleid_value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment