diff --git a/system/client-functions/BlueBurstExclusive/ClassicMainWarpBehavior.59NL.patch.s b/system/client-functions/BlueBurstExclusive/ClassicMainWarpBehavior.59NL.patch.s new file mode 100644 index 00000000..d86bfb14 --- /dev/null +++ b/system/client-functions/BlueBurstExclusive/ClassicMainWarpBehavior.59NL.patch.s @@ -0,0 +1,32 @@ +# This patch disables the logic that causes all unlockable areas to be open by +# default for all players, instead restoring the logic that checks quest flags +# to open areas (as previous PSO versions used). + +# This patch is intended to be used in the BBRequiredPatches field in +# config.json if you want the classic behavior, hence the presence of the +# hide_from_patches_menu directive here. + +.meta name="Classic main warp behavior" +.meta description="" +.meta hide_from_patches_menu + +entry_ptr: +reloc0: + .offsetof start +start: + .include WriteCodeBlocksBB + .data 0x0064A5DE # Episode 1 + .data 1 + .binary 01 + .data 0x0064A448 # Episode 2 + .data 2 + .binary 0100 + .data 0x0064A529 # Episode 4 + .data 1 + .binary 01 + .data 0x0064A658 # Non-Normal difficulty check + .data 2 + nop + nop + .data 0 + .data 0 diff --git a/system/client-functions/DrawDistance/DrawDistance.4OED.patch.s b/system/client-functions/DrawDistance/DrawDistance.4OED.patch.s index c74276f1..e014f36a 100644 --- a/system/client-functions/DrawDistance/DrawDistance.4OED.patch.s +++ b/system/client-functions/DrawDistance/DrawDistance.4OED.patch.s @@ -20,7 +20,7 @@ p1_1e: .data 0x00173A42 .deltaof p1_2s, p1_2e p1_2s: - fld st0, dword [esp + 0x20] + fld st0, dword [esp + 0x1C] fadd st0, st0 fchs st0 ret diff --git a/system/client-functions/DrawDistance/DrawDistance.4OEU.patch.s b/system/client-functions/DrawDistance/DrawDistance.4OEU.patch.s index 89cec106..e7b67b60 100644 --- a/system/client-functions/DrawDistance/DrawDistance.4OEU.patch.s +++ b/system/client-functions/DrawDistance/DrawDistance.4OEU.patch.s @@ -20,7 +20,7 @@ p1_1e: .data 0x00173A52 .deltaof p1_2s, p1_2e p1_2s: - fld st0, dword [esp + 0x20] + fld st0, dword [esp + 0x1C] fadd st0, st0 fchs st0 ret diff --git a/system/client-functions/DrawDistance/DrawDistance.4OJB.patch.s b/system/client-functions/DrawDistance/DrawDistance.4OJB.patch.s index dff06c1d..7e424dad 100644 --- a/system/client-functions/DrawDistance/DrawDistance.4OJB.patch.s +++ b/system/client-functions/DrawDistance/DrawDistance.4OJB.patch.s @@ -20,7 +20,7 @@ p1_1e: .data 0x00173912 .deltaof p1_2s, p1_2e p1_2s: - fld st0, dword [esp + 0x20] + fld st0, dword [esp + 0x1C] fadd st0, st0 fchs st0 ret diff --git a/system/client-functions/DrawDistance/DrawDistance.4OJD.patch.s b/system/client-functions/DrawDistance/DrawDistance.4OJD.patch.s index 1d5215ff..ea13a938 100644 --- a/system/client-functions/DrawDistance/DrawDistance.4OJD.patch.s +++ b/system/client-functions/DrawDistance/DrawDistance.4OJD.patch.s @@ -20,7 +20,7 @@ p1_1e: .data 0x00173A02 .deltaof p1_2s, p1_2e p1_2s: - fld st0, dword [esp + 0x20] + fld st0, dword [esp + 0x1C] fadd st0, st0 fchs st0 ret diff --git a/system/client-functions/DrawDistance/DrawDistance.4OJU.patch.s b/system/client-functions/DrawDistance/DrawDistance.4OJU.patch.s index ae3dbe4a..29d33488 100644 --- a/system/client-functions/DrawDistance/DrawDistance.4OJU.patch.s +++ b/system/client-functions/DrawDistance/DrawDistance.4OJU.patch.s @@ -20,7 +20,7 @@ p1_1e: .data 0x00173AE2 .deltaof p1_2s, p1_2e p1_2s: - fld st0, dword [esp + 0x20] + fld st0, dword [esp + 0x1C] fadd st0, st0 fchs st0 ret diff --git a/system/client-functions/DrawDistance/DrawDistance.4OPD.patch.s b/system/client-functions/DrawDistance/DrawDistance.4OPD.patch.s index 4b0abfce..9655ba90 100644 --- a/system/client-functions/DrawDistance/DrawDistance.4OPD.patch.s +++ b/system/client-functions/DrawDistance/DrawDistance.4OPD.patch.s @@ -20,7 +20,7 @@ p1_1e: .data 0x00173A62 .deltaof p1_2s, p1_2e p1_2s: - fld st0, dword [esp + 0x20] + fld st0, dword [esp + 0x1C] fadd st0, st0 fchs st0 ret diff --git a/system/client-functions/DrawDistance/DrawDistance.4OPU.patch.s b/system/client-functions/DrawDistance/DrawDistance.4OPU.patch.s index 8d68b2cc..6c057ed7 100644 --- a/system/client-functions/DrawDistance/DrawDistance.4OPU.patch.s +++ b/system/client-functions/DrawDistance/DrawDistance.4OPU.patch.s @@ -20,7 +20,7 @@ p1_1e: .data 0x00173A12 .deltaof p1_2s, p1_2e p1_2s: - fld st0, dword [esp + 0x20] + fld st0, dword [esp + 0x1C] fadd st0, st0 fchs st0 ret diff --git a/system/client-functions/EnemyHPBars/EnemyHPBars-TextHandlerXB.x86.inc.s b/system/client-functions/EnemyHPBars/EnemyHPBars-TextHandlerXB.x86.inc.s index 6ea32c46..02bfd097 100644 --- a/system/client-functions/EnemyHPBars/EnemyHPBars-TextHandlerXB.x86.inc.s +++ b/system/client-functions/EnemyHPBars/EnemyHPBars-TextHandlerXB.x86.inc.s @@ -1,3 +1,7 @@ +# WARNING: FlickeringStatusIcons patch starts immediately after this; if the +# size of this is changed, that patch will have to be changed too + + # Replacement for handle_0E (do nothing) ret # Call table: 2 functions (on_window_created, on_hp_updated) diff --git a/system/client-functions/FlickeringStatusIcons/FlickeringStatusIcons.4OED.patch.s b/system/client-functions/FlickeringStatusIcons/FlickeringStatusIcons.4OED.patch.s new file mode 100644 index 00000000..5f75ac52 --- /dev/null +++ b/system/client-functions/FlickeringStatusIcons/FlickeringStatusIcons.4OED.patch.s @@ -0,0 +1,60 @@ +.meta name="Blinking SD" +.meta description="Makes the Shifta\nand Deband status\nicons flicker when\nthey are about\nto run out" +# Original code by Ralf @ GC-Forever and Aleron Ives +# https://www.gc-forever.com/forums/viewtopic.php?t=2050 +# https://www.gc-forever.com/forums/viewtopic.php?t=2049 +# Xbox port by fuzziqersoftware + +entry_ptr: +reloc0: + .offsetof start +start: + .include WriteCodeBlocksXB + + .data 0x00277C0A + .data 5 + .binary E897340600 + + .data 0x002DB0A6 + .deltaof code_start, code_end +code_start: + push eax + mov ecx, [esp + 0x20] + test cl, 0x02 # Slot 2 or 3 + jz skip + mov eax, [eax + 0x28] + test eax, eax + jz skip + mov eax, [eax] + test eax, eax + jz skip + + mov edx, [esp + 0x24] # client ID + mov edx, dword [0x006322BC + edx * 4] + imul ecx, ecx, 0x0C + mov edx, [edx + ecx + 0x264] + cmp edx, 450 + jb decr_alpha + + mov byte [eax + 0x002F], 0xFF + jmp skip + +decr_alpha: + xor edx, edx + lea ecx, [edx - 1] + mov dl, [eax + 0x002F] + sub edx, 8 + cmovl edx, ecx + mov [eax + 0x002F], dl + +skip: + pop eax + pop edx + lea ecx, [edx + 0x20] + cmp dword [eax + 0x6C], ebp + cmovz edx, ecx + jmp edx +code_end: + + .data 0 + .data 0 diff --git a/system/client-functions/FlickeringStatusIcons/FlickeringStatusIcons.4OEU.patch.s b/system/client-functions/FlickeringStatusIcons/FlickeringStatusIcons.4OEU.patch.s new file mode 100644 index 00000000..c717f919 --- /dev/null +++ b/system/client-functions/FlickeringStatusIcons/FlickeringStatusIcons.4OEU.patch.s @@ -0,0 +1,60 @@ +.meta name="Blinking SD" +.meta description="Makes the Shifta\nand Deband status\nicons flicker when\nthey are about\nto run out" +# Original code by Ralf @ GC-Forever and Aleron Ives +# https://www.gc-forever.com/forums/viewtopic.php?t=2050 +# https://www.gc-forever.com/forums/viewtopic.php?t=2049 +# Xbox port by fuzziqersoftware + +entry_ptr: +reloc0: + .offsetof start +start: + .include WriteCodeBlocksXB + + .data 0x00277D2A + .data 5 + .binary E877380600 + + .data 0x002DB5A6 + .deltaof code_start, code_end +code_start: + push eax + mov ecx, [esp + 0x20] + test cl, 0x02 # Slot 2 or 3 + jz skip + mov eax, [eax + 0x28] + test eax, eax + jz skip + mov eax, [eax] + test eax, eax + jz skip + + mov edx, [esp + 0x24] # client ID + mov edx, dword [0x00631B54 + edx * 4] + imul ecx, ecx, 0x0C + mov edx, [edx + ecx + 0x264] + cmp edx, 450 + jb decr_alpha + + mov byte [eax + 0x002F], 0xFF + jmp skip + +decr_alpha: + xor edx, edx + lea ecx, [edx - 1] + mov dl, [eax + 0x002F] + sub edx, 8 + cmovl edx, ecx + mov [eax + 0x002F], dl + +skip: + pop eax + pop edx + lea ecx, [edx + 0x20] + cmp dword [eax + 0x6C], ebp + cmovz edx, ecx + jmp edx +code_end: + + .data 0 + .data 0 diff --git a/system/client-functions/FlickeringStatusIcons/FlickeringStatusIcons.4OJB.patch.s b/system/client-functions/FlickeringStatusIcons/FlickeringStatusIcons.4OJB.patch.s new file mode 100644 index 00000000..f2190e98 --- /dev/null +++ b/system/client-functions/FlickeringStatusIcons/FlickeringStatusIcons.4OJB.patch.s @@ -0,0 +1,60 @@ +.meta name="Blinking SD" +.meta description="Makes the Shifta\nand Deband status\nicons flicker when\nthey are about\nto run out" +# Original code by Ralf @ GC-Forever and Aleron Ives +# https://www.gc-forever.com/forums/viewtopic.php?t=2050 +# https://www.gc-forever.com/forums/viewtopic.php?t=2049 +# Xbox port by fuzziqersoftware + +entry_ptr: +reloc0: + .offsetof start +start: + .include WriteCodeBlocksXB + + .data 0x0027782A + .data 5 + .binary E807190600 + + .data 0x002D9136 + .deltaof code_start, code_end +code_start: + push eax + mov ecx, [esp + 0x20] + test cl, 0x02 # Slot 2 or 3 + jz skip + mov eax, [eax + 0x28] + test eax, eax + jz skip + mov eax, [eax] + test eax, eax + jz skip + + mov edx, [esp + 0x24] # client ID + mov edx, dword [0x0062CCFC + edx * 4] + imul ecx, ecx, 0x0C + mov edx, [edx + ecx + 0x264] + cmp edx, 450 + jb decr_alpha + + mov byte [eax + 0x002F], 0xFF + jmp skip + +decr_alpha: + xor edx, edx + lea ecx, [edx - 1] + mov dl, [eax + 0x002F] + sub edx, 8 + cmovl edx, ecx + mov [eax + 0x002F], dl + +skip: + pop eax + pop edx + lea ecx, [edx + 0x20] + cmp dword [eax + 0x6C], ebp + cmovz edx, ecx + jmp edx +code_end: + + .data 0 + .data 0 diff --git a/system/client-functions/FlickeringStatusIcons/FlickeringStatusIcons.4OJD.patch.s b/system/client-functions/FlickeringStatusIcons/FlickeringStatusIcons.4OJD.patch.s new file mode 100644 index 00000000..2a7fae00 --- /dev/null +++ b/system/client-functions/FlickeringStatusIcons/FlickeringStatusIcons.4OJD.patch.s @@ -0,0 +1,60 @@ +.meta name="Blinking SD" +.meta description="Makes the Shifta\nand Deband status\nicons flicker when\nthey are about\nto run out" +# Original code by Ralf @ GC-Forever and Aleron Ives +# https://www.gc-forever.com/forums/viewtopic.php?t=2050 +# https://www.gc-forever.com/forums/viewtopic.php?t=2049 +# Xbox port by fuzziqersoftware + +entry_ptr: +reloc0: + .offsetof start +start: + .include WriteCodeBlocksXB + + .data 0x00277ADA + .data 5 + .binary E827220600 + + .data 0x002D9D06 + .deltaof code_start, code_end +code_start: + push eax + mov ecx, [esp + 0x20] + test cl, 0x02 # Slot 2 or 3 + jz skip + mov eax, [eax + 0x28] + test eax, eax + jz skip + mov eax, [eax] + test eax, eax + jz skip + + mov edx, [esp + 0x24] # client ID + mov edx, dword [0x0062D29C + edx * 4] + imul ecx, ecx, 0x0C + mov edx, [edx + ecx + 0x264] + cmp edx, 450 + jb decr_alpha + + mov byte [eax + 0x002F], 0xFF + jmp skip + +decr_alpha: + xor edx, edx + lea ecx, [edx - 1] + mov dl, [eax + 0x002F] + sub edx, 8 + cmovl edx, ecx + mov [eax + 0x002F], dl + +skip: + pop eax + pop edx + lea ecx, [edx + 0x20] + cmp dword [eax + 0x6C], ebp + cmovz edx, ecx + jmp edx +code_end: + + .data 0 + .data 0 diff --git a/system/client-functions/FlickeringStatusIcons/FlickeringStatusIcons.4OJU.patch.s b/system/client-functions/FlickeringStatusIcons/FlickeringStatusIcons.4OJU.patch.s new file mode 100644 index 00000000..67c3f18c --- /dev/null +++ b/system/client-functions/FlickeringStatusIcons/FlickeringStatusIcons.4OJU.patch.s @@ -0,0 +1,60 @@ +.meta name="Blinking SD" +.meta description="Makes the Shifta\nand Deband status\nicons flicker when\nthey are about\nto run out" +# Original code by Ralf @ GC-Forever and Aleron Ives +# https://www.gc-forever.com/forums/viewtopic.php?t=2050 +# https://www.gc-forever.com/forums/viewtopic.php?t=2049 +# Xbox port by fuzziqersoftware + +entry_ptr: +reloc0: + .offsetof start +start: + .include WriteCodeBlocksXB + + .data 0x00277EEA + .data 5 + .binary E8E7360600 + + .data 0x002DB5D6 + .deltaof code_start, code_end +code_start: + push eax + mov ecx, [esp + 0x20] + test cl, 0x02 # Slot 2 or 3 + jz skip + mov eax, [eax + 0x28] + test eax, eax + jz skip + mov eax, [eax] + test eax, eax + jz skip + + mov edx, [esp + 0x24] # client ID + mov edx, dword [0x00634DD4 + edx * 4] + imul ecx, ecx, 0x0C + mov edx, [edx + ecx + 0x264] + cmp edx, 450 + jb decr_alpha + + mov byte [eax + 0x002F], 0xFF + jmp skip + +decr_alpha: + xor edx, edx + lea ecx, [edx - 1] + mov dl, [eax + 0x002F] + sub edx, 8 + cmovl edx, ecx + mov [eax + 0x002F], dl + +skip: + pop eax + pop edx + lea ecx, [edx + 0x20] + cmp dword [eax + 0x6C], ebp + cmovz edx, ecx + jmp edx +code_end: + + .data 0 + .data 0 diff --git a/system/client-functions/FlickeringStatusIcons/FlickeringStatusIcons.4OPD.patch.s b/system/client-functions/FlickeringStatusIcons/FlickeringStatusIcons.4OPD.patch.s new file mode 100644 index 00000000..95ecea2a --- /dev/null +++ b/system/client-functions/FlickeringStatusIcons/FlickeringStatusIcons.4OPD.patch.s @@ -0,0 +1,60 @@ +.meta name="Blinking SD" +.meta description="Makes the Shifta\nand Deband status\nicons flicker when\nthey are about\nto run out" +# Original code by Ralf @ GC-Forever and Aleron Ives +# https://www.gc-forever.com/forums/viewtopic.php?t=2050 +# https://www.gc-forever.com/forums/viewtopic.php?t=2049 +# Xbox port by fuzziqersoftware + +entry_ptr: +reloc0: + .offsetof start +start: + .include WriteCodeBlocksXB + + .data 0x00277C2A + .data 5 + .binary E8A7340600 + + .data 0x002DB0D6 + .deltaof code_start, code_end +code_start: + push eax + mov ecx, [esp + 0x20] + test cl, 0x02 # Slot 2 or 3 + jz skip + mov eax, [eax + 0x28] + test eax, eax + jz skip + mov eax, [eax] + test eax, eax + jz skip + + mov edx, [esp + 0x24] # client ID + mov edx, dword [0x006322BC + edx * 4] + imul ecx, ecx, 0x0C + mov edx, [edx + ecx + 0x264] + cmp edx, 450 + jb decr_alpha + + mov byte [eax + 0x002F], 0xFF + jmp skip + +decr_alpha: + xor edx, edx + lea ecx, [edx - 1] + mov dl, [eax + 0x002F] + sub edx, 8 + cmovl edx, ecx + mov [eax + 0x002F], dl + +skip: + pop eax + pop edx + lea ecx, [edx + 0x20] + cmp dword [eax + 0x6C], ebp + cmovz edx, ecx + jmp edx +code_end: + + .data 0 + .data 0 diff --git a/system/client-functions/FlickeringStatusIcons/FlickeringStatusIcons.4OPU.patch.s b/system/client-functions/FlickeringStatusIcons/FlickeringStatusIcons.4OPU.patch.s new file mode 100644 index 00000000..4b1387cf --- /dev/null +++ b/system/client-functions/FlickeringStatusIcons/FlickeringStatusIcons.4OPU.patch.s @@ -0,0 +1,60 @@ +.meta name="Blinking SD" +.meta description="Makes the Shifta\nand Deband status\nicons flicker when\nthey are about\nto run out" +# Original code by Ralf @ GC-Forever and Aleron Ives +# https://www.gc-forever.com/forums/viewtopic.php?t=2050 +# https://www.gc-forever.com/forums/viewtopic.php?t=2049 +# Xbox port by fuzziqersoftware + +entry_ptr: +reloc0: + .offsetof start +start: + .include WriteCodeBlocksXB + + .data 0x00277DFA + .data 5 + .binary E827380600 + + .data 0x002DB626 + .deltaof code_start, code_end +code_start: + push eax + mov ecx, [esp + 0x20] + test cl, 0x02 # Slot 2 or 3 + jz skip + mov eax, [eax + 0x28] + test eax, eax + jz skip + mov eax, [eax] + test eax, eax + jz skip + + mov edx, [esp + 0x24] # client ID + mov edx, dword [0x00632654 + edx * 4] + imul ecx, ecx, 0x0C + mov edx, [edx + ecx + 0x264] + cmp edx, 450 + jb decr_alpha + + mov byte [eax + 0x002F], 0xFF + jmp skip + +decr_alpha: + xor edx, edx + lea ecx, [edx - 1] + mov dl, [eax + 0x002F] + sub edx, 8 + cmovl edx, ecx + mov [eax + 0x002F], dl + +skip: + pop eax + pop edx + lea ecx, [edx + 0x20] + cmp dword [eax + 0x6C], ebp + cmovz edx, ecx + jmp edx +code_end: + + .data 0 + .data 0