add findings from psox disassembly

This commit is contained in:
Martin Michelsen
2022-07-25 22:06:53 -07:00
parent d61c65cf16
commit ec205062ad
26 changed files with 1124 additions and 642 deletions
+18 -2
View File
@@ -27,6 +27,8 @@ uint16_t PSOCommandHeader::command(GameVersion version) const {
return this->dc.command;
case GameVersion::GC:
return this->gc.command;
case GameVersion::XB:
return this->xb.command;
case GameVersion::PC:
case GameVersion::PATCH:
return this->pc.command;
@@ -45,6 +47,9 @@ void PSOCommandHeader::set_command(GameVersion version, uint16_t command) {
case GameVersion::GC:
this->gc.command = command;
break;
case GameVersion::XB:
this->xb.command = command;
break;
case GameVersion::PC:
case GameVersion::PATCH:
this->pc.command = command;
@@ -63,6 +68,8 @@ uint16_t PSOCommandHeader::size(GameVersion version) const {
return this->dc.size;
case GameVersion::GC:
return this->gc.size;
case GameVersion::XB:
return this->xb.size;
case GameVersion::PC:
case GameVersion::PATCH:
return this->pc.size;
@@ -81,6 +88,9 @@ void PSOCommandHeader::set_size(GameVersion version, uint32_t size) {
case GameVersion::GC:
this->gc.size = size;
break;
case GameVersion::XB:
this->xb.size = size;
break;
case GameVersion::PC:
case GameVersion::PATCH:
this->pc.size = size;
@@ -99,6 +109,8 @@ uint32_t PSOCommandHeader::flag(GameVersion version) const {
return this->dc.flag;
case GameVersion::GC:
return this->gc.flag;
case GameVersion::XB:
return this->xb.flag;
case GameVersion::PC:
case GameVersion::PATCH:
return this->pc.flag;
@@ -117,6 +129,9 @@ void PSOCommandHeader::set_flag(GameVersion version, uint32_t flag) {
case GameVersion::GC:
this->gc.flag = flag;
break;
case GameVersion::XB:
this->xb.flag = flag;
break;
case GameVersion::PC:
case GameVersion::PATCH:
this->pc.flag = flag;
@@ -157,9 +172,10 @@ std::string prepend_command_header(
const std::string& data) {
StringWriter ret;
switch (version) {
case GameVersion::DC:
case GameVersion::GC:
case GameVersion::DC: {
PSOCommandHeaderDCGC header;
case GameVersion::XB: {
PSOCommandHeaderDCV3 header;
if (encryption_enabled) {
header.size = (sizeof(header) + data.size() + 3) & ~3;
} else {