From bc22327361e87ec5ea53a6f7fe2278d2efd6535c Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Tue, 3 Oct 2023 17:56:50 -0700 Subject: [PATCH] add support for all DC versions --- README.md | 27 +++++++++++++-------------- src/ReceiveCommands.cc | 2 +- src/Version.cc | 7 ++++--- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index c46e2220..b18131fb 100644 --- a/README.md +++ b/README.md @@ -56,26 +56,25 @@ See TODO.md for a list of known issues and future work. newserv supports several versions of PSO. Specifically: | Version | Login | Lobbies | Games | Proxy | |----------------|--------------|--------------|--------------|--------------| -| DC Trial | Yes (4) | Yes (4) | Yes (4) | No | -| DC Prototype | Yes (4) | Yes (4) | Yes (4) | No | -| DC V1 | Yes (1) | Yes | Yes | Yes | -| DC V2 | Yes (1) | Yes | Yes | Yes | +| DC Trial | Yes (3) | Yes (3) | Yes (3) | No | +| DC Prototype | Yes (3) | Yes (3) | Yes (3) | No | +| DC V1 | Yes | Yes | Yes | Yes | +| DC V2 | Yes | Yes | Yes | Yes | | PC | Yes | Yes | Yes | Yes | -| GC Ep1&2 Trial | Untested (2) | Untested (2) | Untested (2) | Untested (2) | +| GC Ep1&2 Trial | Untested (1) | Untested (1) | Untested (1) | Untested (1) | | GC Ep1&2 | Yes | Yes | Yes | Yes | | GC Ep1&2 Plus | Yes | Yes | Yes | Yes | -| GC Ep3 Trial | Yes | Yes | Partial (5) | Yes | +| GC Ep3 Trial | Yes | Yes | Partial (4) | Yes | | GC Ep3 | Yes | Yes | Yes | Yes | -| XBOX Ep1&2 | Untested (2) | Untested (2) | Untested (2) | Untested (2) | -| BB (vanilla) | Yes | Yes | Yes (3) | Yes | -| BB (Tethealla) | Yes | Yes | Yes (3) | Yes | +| XBOX Ep1&2 | Untested (1) | Untested (1) | Untested (1) | Untested (1) | +| BB (vanilla) | Yes | Yes | Yes (2) | Yes | +| BB (Tethealla) | Yes | Yes | Yes (2) | Yes | *Notes:* -1. *DC support has only been tested with the US versions of PSO DC. Other versions probably don't work, but will be easy to add support for. Please submit a GitHub issue if you have a non-US DC version, and can provide a log from a connection attempt.* -2. *newserv's implementations of these versions are based on disassembly of the client executables and have never been tested.* -3. *BB games are mostly playable, but there are still some unimplemented features (for example, some quests that use rare commands may not work). Please submit a GitHub issue if you find something that doesn't work.* -4. *Support for PSO Dreamcast Trial Edition and the December 2000 prototype is somewhat incomplete and probably never will be complete. These versions are rather unstable and seem to crash often, but it's not obvious whether it's because they're prototypes or because newserv sends data they can't handle.* -5. *Creating a game works and battle setup behaves mostly normally, but starting a battle doesn't work.* +1. *newserv's implementations of these versions are based on disassembly of the client executables and have never been tested.* +2. *BB games are mostly playable, but there are still some unimplemented features (for example, some quests that use rare commands may not work). Please submit a GitHub issue if you find something that doesn't work.* +3. *Support for PSO Dreamcast Trial Edition and the December 2000 prototype is somewhat incomplete and probably never will be complete. These versions are rather unstable and seem to crash often, but it's not obvious whether it's because they're prototypes or because newserv sends data they can't handle.* +4. *Creating a game works and battle setup behaves mostly normally, but starting a battle doesn't work.* ## Setup diff --git a/src/ReceiveCommands.cc b/src/ReceiveCommands.cc index 88cea03d..529163c4 100644 --- a/src/ReceiveCommands.cc +++ b/src/ReceiveCommands.cc @@ -306,7 +306,7 @@ void on_disconnect(shared_ptr c) { static void set_console_client_flags(shared_ptr c, uint32_t sub_version) { if (c->channel.crypt_in->type() == PSOEncryption::Type::V2) { - if (sub_version < 0x28) { + if (sub_version <= 0x28) { c->channel.version = GameVersion::DC; c->log.info("Game version changed to DC"); } else if (c->version() == GameVersion::GC) { diff --git a/src/Version.cc b/src/Version.cc index 10ea5009..e9bb122f 100644 --- a/src/Version.cc +++ b/src/Version.cc @@ -40,20 +40,21 @@ uint32_t flags_for_version(GameVersion version, int64_t sub_version) { } break; - // TODO: Which other sub_versions of DC v1 and v2 exist? - case 0x20: // DCNTE + case 0x20: // DCNTE, possibly also DCv1 JP case 0x21: // DCv1 US // In the case of DCNTE, the IS_DC_TRIAL_EDITION flag is already set when // we get here, so the remaining flags are the same as DCv1 return Client::Flag::IS_DC_V1 | Client::Flag::NO_D6 | Client::Flag::NO_SEND_FUNCTION_CALL; - case 0x23: // DCv1 EU? + case 0x23: // DCv1 EU return Client::Flag::IS_DC_V1 | Client::Flag::NO_D6 | Client::Flag::NO_SEND_FUNCTION_CALL; + case 0x25: // DCv2 JP case 0x26: // DCv2 US + case 0x28: // DCv2 EU return Client::Flag::NO_D6 | Client::Flag::SEND_FUNCTION_CALL_NO_CACHE_PATCH;