From 4416579210ebbba2a729d2fa9943870877973c96 Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Mon, 17 Jun 2024 00:42:31 -0700 Subject: [PATCH] add 11/2000 item loss patch --- src/SaveFileFormats.hh | 16 ++++++++++++++++ .../ItemLossPrevention.1OJ2.patch.s | 17 +++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 system/client-functions/ItemLossPrevention/ItemLossPrevention.1OJ2.patch.s diff --git a/src/SaveFileFormats.hh b/src/SaveFileFormats.hh index ed4befb0..a45d599f 100644 --- a/src/SaveFileFormats.hh +++ b/src/SaveFileFormats.hh @@ -306,6 +306,22 @@ struct PSOBBFullSystemFile { //////////////////////////////////////////////////////////////////////////////// // Character files +struct PSODC112000CharacterFile { + // See PSOGCCharacterFile::Character for descriptions of fields' meanings. + /* 0000:---- */ PlayerInventory inventory; + /* 034C:---- */ PlayerDispDataDCPCV3 disp; + /* 041C:0000 */ le_uint32_t flags = 0; + /* 0420:0004 */ le_uint32_t creation_timestamp = 0; + /* 0424:0008 */ le_uint32_t signature = 0xA205B064; + /* 0428:000C */ le_uint32_t play_time_seconds = 0; + /* 042C:0010 */ le_uint32_t option_flags = 0x00040058; + /* 0430:0014 */ le_uint16_t save_count_since_last_inventory_erasure = 1; + /* 0432:0016 */ le_uint16_t inventory_erasure_count = 0; + // TODO: Fill out the rest of this structure. + /* 0434:0018 */ parray unknown_a1; + /* 13D4:0FB8 */ +} __packed_ws__(PSODC112000CharacterFile, 0x13D4); + struct PSODCV1CharacterFile { // See PSOGCCharacterFile::Character for descriptions of fields' meanings. /* 0000:---- */ PlayerInventory inventory; diff --git a/system/client-functions/ItemLossPrevention/ItemLossPrevention.1OJ2.patch.s b/system/client-functions/ItemLossPrevention/ItemLossPrevention.1OJ2.patch.s new file mode 100644 index 00000000..2a0286b5 --- /dev/null +++ b/system/client-functions/ItemLossPrevention/ItemLossPrevention.1OJ2.patch.s @@ -0,0 +1,17 @@ +.meta name="No item loss" +.meta description="Don't lose items if\nyou don't log off\nnormally" + +entry_ptr: +reloc0: + .offsetof start +start: + .include WriteCodeBlocksDC + + .align 4 + .data 0x8C14C71A + .data 2 + nop + + .align 4 + .data 0x00000000 + .data 0x00000000