diff --git a/README.md b/README.md index b718516a..db0bfc30 100644 --- a/README.md +++ b/README.md @@ -489,6 +489,7 @@ The specific versions are: | PSO Xbox US TU | 4OEU | x86 | | PSO Xbox EU Disc | 4OPD | x86 | | PSO Xbox EU TU | 4OPU | x86 | +| PSO BB US 1.24.3 | 50YJ | x86 | | PSO BB JP 1.25.11 | 59NJ | x86 | | PSO BB JP 1.25.13 | 59NL | x86 | | PSO BB Tethealla | 59NL | x86 | diff --git a/notes/ar-codes.txt b/notes/ar-codes.txt index 6a6a2790..052d3c4a 100644 --- a/notes/ar-codes.txt +++ b/notes/ar-codes.txt @@ -41,6 +41,7 @@ Version codes (from README.md): 4OEU: PSO Xbox US TU 4OPD: PSO Xbox EU Disc 4OPU: PSO Xbox EU TU + 50YJ: PSO BB US 1.24.3 59NJ: PSO BB JP 1.25.11 59NL: PSO BB JP 1.25.13 (including the Tethealla client) @@ -81,6 +82,7 @@ Disable item equip restrictions ("God of equip") 3OJ5 => 041050D4 38000005 3OJT => 0415BF50 38000005 3OP0 => 041052D4 38000005 +5OYJ => 005C8C8F E9A7000000 59NJ => 005C9F35 E9A7000000 59NL => 005C9F31 E9A7000000 @@ -88,6 +90,7 @@ All items visible in Pioneer 2 3OE1 => 04102D88 38600000 Mags visible in Pioneer 2 +5OYJ => 005D7053 EB04 59NJ => 005D8F27 EB04 59NL => 005D8F4B EB04 @@ -96,6 +99,9 @@ Disable pause menu background + offset 0428735C 4800000C 3OE2 => 0424CED8 48000370 042887D8 4800000C +5OYJ => 00713758 9090 + 0072D417 9090 + 0072D27E 90E9 59NJ => 00719C58 9090 00733C57 9090 00733ABE 90E9 @@ -642,6 +648,8 @@ Fast tekker (skips wind-up jingle) 0023EF77 jmp +0x0A 4OPU => 0023F14C mov dword [ebp + 0x14C], 1 0023F167 jmp +0x0A +5OYJ => 006D3F7B mov dword [edi + 0x14C], 1 + 006D3F98 jmp +0x0B 59NJ => 006DA14B mov dword [edi + 0x14C], 1 006DA168 jmp +0x0B 59NL => 006DA113 mov dword [edi + 0x14C], 1 @@ -980,6 +988,8 @@ Override Challenge mode random enemy location tables limit 4OEU => 002E742C XXXXXXXX (count as little-endian dword) 4OPD => 002E720C XXXXXXXX (count as little-endian dword) 4OPU => 002E745C XXXXXXXX (count as little-endian dword) +5OYJ => 008075C3 XXXXXXXX (count * 4 as little-endian dword) + 008075DC XXXXXXXX (count as little-endian dword) 59NJ => 0080FA3F XXXXXXXX (count * 4 as little-endian dword) 0080FA58 XXXXXXXX (count as little-endian dword) 59NL => 0080ECB7 XXXXXXXX (count * 4 as little-endian dword) diff --git a/src/CommandFormats.hh b/src/CommandFormats.hh index 8d70cf97..a146eb06 100644 --- a/src/CommandFormats.hh +++ b/src/CommandFormats.hh @@ -5747,7 +5747,7 @@ struct G_ChangeLobbyMusic_Ep3_6xBF { // 6xBF: Give EXP (BB) (server->client only) // newserv implements an extension that causes this command to show the purple EXP numbers which are normally generated // by the client instead. This requires the server to also send the enemy ID that generated the EXP, hence the -// extension struct here. See ServerEXPDisplay.59NL.patch.s for details. +// extension struct here. See ServerEXPDisplay.s for details. struct G_GiveExperience_BB_6xBF { G_ClientIDHeader header; diff --git a/system/client-functions/AccurateKillCount.s b/system/client-functions/AccurateKillCount.s index 60cbf459..70865422 100644 --- a/system/client-functions/AccurateKillCount.s +++ b/system/client-functions/AccurateKillCount.s @@ -69,11 +69,11 @@ TItemWeapon_SealedJSword_count_kill_end: - .versions 59NJ 59NL + .versions 50YJ 59NJ 59NL - .data + .data .deltaof TItemUnitUnsealable_count_kill, TItemUnitUnsealable_count_kill_end - .address + .address TItemUnitUnsealable_count_kill: # [std] (TItemUnitUnsealable* this @ ecx) -> void mov eax, [ecx + 0xF8] movsx eax, word [eax + 0x11A] # eax = this->owner_player->num_kills_since_map_load @@ -91,12 +91,12 @@ TItemUnitUnsealable_count_kill_skip_update: setae dh shl edx, 1 or dword [ecx + 0xDC], edx - jmp + jmp TItemUnitUnsealable_count_kill_end: - .data + .data .deltaof TItemWeapon_LameDArgent_count_kill, TItemWeapon_LameDArgent_count_kill_end - .address + .address TItemWeapon_LameDArgent_count_kill: mov eax, [ecx + 0xF8] movsx eax, word [eax + 0x11A] @@ -117,9 +117,9 @@ TItemWeapon_LameDArgent_count_kill_skip_update: ret TItemWeapon_LameDArgent_count_kill_end: - .data + .data .deltaof TItemWeapon_SealedJSword_count_kill, TItemWeapon_SealedJSword_count_kill_end - .address + .address TItemWeapon_SealedJSword_count_kill: mov eax, [ecx + 0xF8] movsx eax, word [eax + 0x11A] diff --git a/system/client-functions/BlueBurstExclusive/BankSize.s b/system/client-functions/BlueBurstExclusive/BankSize.s index a1dec881..0f54c4c5 100644 --- a/system/client-functions/BlueBurstExclusive/BankSize.s +++ b/system/client-functions/BlueBurstExclusive/BankSize.s @@ -10,7 +10,7 @@ .meta name="More bank slots" .meta description="" -.versions 59NJ 59NL +.versions 50YJ 59NJ 59NL entry_ptr: reloc0: @@ -19,80 +19,80 @@ reloc0: start: .include WriteCodeBlocks - .data + .data .data 4 .data 1000 # slot count - .data + .data .data 4 .data 1000 # slot count - .data + .data .data 4 .data 999 # slot count - 1 - .data + .data .data 4 .data 0x5DC0 # data size - 8 - .data + .data .data 4 .data 999 # slot count - 1 - .data + .data .data 4 .data 999 # slot count - 1 - .data + .data .data 4 .data 999 # slot count - 1 - .data + .data .data 4 .data 0x5DB0 # data size - 0x18 - .data + .data .data 4 .data 0x5DC0 # data size - 8 - .data + .data .data 4 .data 0x5DB0 # data size - 0x18 - .data + .data .data 4 .data 0x5DC8 # data size - .data + .data .data 4 .data 1000 # slot count - .data + .data .data 4 .data 999 # slot count - 1 - .data + .data .data 4 .data 999 # slot count - 1 - .data + .data .data 4 .data 1000 # slot count - .data + .data .data 4 .data 1000 # slot count - .data + .data .data 4 .data 2000000000 # max meseta - .data + .data .data 4 .data 0x5DC8 # data size - .data + .data .data 4 .data 1000 # slot count - .data + .data .data 4 .data 0x5DC8 # data size - .data + .data .data 4 .data 1000 # slot count - .data + .data .data 4 .data 1000 # slot count - .data + .data .data 4 .data 1000 # slot count - .data + .data .data 4 .data 1000 # slot count - .data + .data .data 2 jmp +0x27 diff --git a/system/client-functions/BlueBurstExclusive/ClassicMainWarpBehavior.s b/system/client-functions/BlueBurstExclusive/ClassicMainWarpBehavior.s index 29c19fe5..006f16a0 100644 --- a/system/client-functions/BlueBurstExclusive/ClassicMainWarpBehavior.s +++ b/system/client-functions/BlueBurstExclusive/ClassicMainWarpBehavior.s @@ -7,23 +7,23 @@ .meta name="Classic main warp behavior" .meta description="" -.versions 59NJ 59NL +.versions 50YJ 59NJ 59NL entry_ptr: reloc0: .offsetof start start: .include WriteCodeBlocks - .data # Episode 1 + .data # Episode 1 .data 1 .binary 01 - .data # Episode 2 + .data # Episode 2 .data 2 .binary 0100 - .data # Episode 4 + .data # Episode 4 .data 1 .binary 01 - .data # Non-Normal difficulty check + .data # Non-Normal difficulty check .data 2 nop nop diff --git a/system/client-functions/BlueBurstExclusive/ClearUnreleasedItemList.s b/system/client-functions/BlueBurstExclusive/ClearUnreleasedItemList.s index e0547247..8f70697e 100644 --- a/system/client-functions/BlueBurstExclusive/ClearUnreleasedItemList.s +++ b/system/client-functions/BlueBurstExclusive/ClearUnreleasedItemList.s @@ -7,7 +7,7 @@ .meta name="Clear unreleased item list" .meta description="" -.versions 59NJ 59NL +.versions 50YJ 59NJ 59NL entry_ptr: reloc0: @@ -15,7 +15,7 @@ reloc0: start: xor eax, eax mov edx, esp - mov esp, + mov esp, mov ecx, 0x3C again: push 0 diff --git a/system/client-functions/BlueBurstExclusive/MomokaItemExchangeFix.s b/system/client-functions/BlueBurstExclusive/MomokaItemExchangeFix.s index 8c13196f..f7baecd7 100644 --- a/system/client-functions/BlueBurstExclusive/MomokaItemExchangeFix.s +++ b/system/client-functions/BlueBurstExclusive/MomokaItemExchangeFix.s @@ -2,7 +2,7 @@ .meta name="Item exch. fix" .meta description="Fixes some quest item\nexchange opcodes" -.versions 59NJ 59NL +.versions 50YJ 59NJ 59NL entry_ptr: reloc0: @@ -13,7 +13,7 @@ start: # Fix 6xDE failure label truncation - .data + .data .data 1 .binary 03 @@ -21,23 +21,23 @@ start: # Fix send_6xD9 not setting size field - .data + .data .deltaof send_6xD9_start, send_6xD9_end - .address + .address send_6xD9_start: # [std](void* this @ ecx) -> void push ebx mov ebx, ecx push 0 # cmd.success_label, cmd.failure_label - mov eax, [] # local_client_id + mov eax, [] # local_client_id xor eax, 1 push eax # cmd.token2 mov ecx, [ebx + 0x2C] - call # [std](void* this @ ecx = *(this + 0x2C)) -> void* @ eax + call # [std](void* this @ ecx = *(this + 0x2C)) -> void* @ eax mov edx, [ebx + 0x3C] imul eax, eax, 0x14 add edx, eax mov eax, [edx + 0x10] - xor eax, [] # local_client_id + xor eax, [] # local_client_id push eax # cmd.token1 push dword [edx + 0x10] # cmd.replace_item.data2d push dword [edx + 0x0C] # cmd.replace_item.id @@ -52,12 +52,12 @@ send_6xD9_start: # [std](void* this @ ecx) -> void push 0x00000ED9 # cmd.header mov ecx, esp - call # send_and_handle_60[std](void* cmd @ ecx) -> void + call # send_and_handle_60[std](void* cmd @ ecx) -> void add esp, 0x38 mov dword [ebx + 0x20], 6 push 0 - call # time[std](void* t @ [esp + 4] = nullptr) -> uint32_t @ eax + call # time[std](void* t @ [esp + 4] = nullptr) -> uint32_t @ eax add esp, 4 mov [ebx + 0x5C], eax @@ -69,16 +69,16 @@ send_6xD9_end: # Same fix as above, but for quest_F95B_send_6xD9 - .data + .data .deltaof quest_F95B_send_6xD9_start, quest_F95B_send_6xD9_end - .address + .address quest_F95B_send_6xD9_start: # [std]() -> void - mov edx, # quest_args_list + mov edx, # quest_args_list mov ax, [edx + 0x14] # quest_args_list[5] (failure_label) shl eax, 0x10 mov ax, [edx + 0x10] # quest_args_list[4] (success_label) push eax # cmd.success_label, cmd.failure_label - mov ecx, [] # local_client_id + mov ecx, [] # local_client_id mov eax, [edx + 0x0C] # quest_args_list[3] (token2) xor eax, ecx push eax # cmd.token2 @@ -107,7 +107,7 @@ quest_F95B_send_6xD9_start: # [std]() -> void push eax # cmd.header mov ecx, esp - call # send_and_handle_60[std](void* cmd @ ecx) -> void + call # send_and_handle_60[std](void* cmd @ ecx) -> void add esp, 0x38 ret quest_F95B_send_6xD9_end: diff --git a/system/client-functions/BlueBurstExclusive/MoreSaveSlots.s b/system/client-functions/BlueBurstExclusive/MoreSaveSlots.s index 51603de0..e7e0059d 100644 --- a/system/client-functions/BlueBurstExclusive/MoreSaveSlots.s +++ b/system/client-functions/BlueBurstExclusive/MoreSaveSlots.s @@ -18,7 +18,7 @@ .meta name="More save slots" .meta description="" -.versions 59NJ 59NL +.versions 50YJ 59NJ 59NL entry_ptr: reloc0: @@ -52,7 +52,7 @@ start: apply_enable_scroll_patch: # This patch enables scrolling behavior within the character list push -5 # Jump size (negative = jmp instead of call) - push # Jump address + push # Jump address call get_code_size_for_enable_scroll .deltaof enable_scroll_start, enable_scroll_end get_code_size_for_enable_scroll: @@ -62,7 +62,7 @@ get_code_size_for_enable_scroll: enable_scroll_start: mov eax, dword ptr [edi + 0x28] # cursor = char_select_menu->cursor_obj (TAdSelectCurGC*) or dword [eax + 0x01F8], 3 # cursor->flags |= 3 # Enable scrolling - mov eax, [] # scroll_bar = TAdScrollBarXb_objs[0] + mov eax, [] # scroll_bar = TAdScrollBarXb_objs[0] mov ecx, [eax + 0xEC] # ecx = scroll_bar->client_id imul ecx, ecx, 0x24 # Set up scroll bar graphics (in struct at scroll_bar + 0x1C) @@ -93,7 +93,7 @@ enable_scroll_end: apply_fix_scroll_patch1: # This patch fixes character selection cursor object so it will take the scroll offset into account push 6 # Call size - push # Call address + push # Call address call get_code_size_for_fix_scroll_patch1 .deltaof fix_scroll_patch1_start, fix_scroll_patch1_end get_code_size_for_fix_scroll_patch1: @@ -103,7 +103,7 @@ get_code_size_for_fix_scroll_patch1: fix_scroll_patch1_start: mov edx, [edi + 0x28] # cursor = this->ad_select_cur_obj (TAdSelectCurGC*) mov ebp, [edx + 0x44] # ebp = cursor->selected_index_within_view - mov eax, [] # scroll_bar = TAdScrollBarXb_objs[0] + mov eax, [] # scroll_bar = TAdScrollBarXb_objs[0] add ebp, [eax + 0xAC] # ebp += scroll_bar->selection_state[0].scroll_offset ret fix_scroll_patch1_end: @@ -116,7 +116,7 @@ apply_fix_scroll_patch2: # This patch changes the TAdSinglePlyChrSelectGC::selected_index_within_view to be the selected character's absolute # index (including scroll_offset), not the index only within the displayed four characters push 6 # Call size - push # Call address + push # Call address call get_code_size_for_fix_scroll_patch2 .deltaof fix_scroll_patch2_start, fix_scroll_patch2_end get_code_size_for_fix_scroll_patch2: @@ -124,7 +124,7 @@ get_code_size_for_fix_scroll_patch2: push dword [eax] call fix_scroll_patch2_end fix_scroll_patch2_start: - mov eax, [] # scroll_bar = TAdScrollBarXb_objs[0] + mov eax, [] # scroll_bar = TAdScrollBarXb_objs[0] mov eax, [eax + 0xAC] # eax = scroll_bar->selection_state[0].scroll_offset mov edx, [edi + 0x28] # cursor = this->ad_select_cur_obj (TAdSelectCurGC*) add eax, [edx + 0x44] # eax += cursor->selected_index_within_view @@ -138,7 +138,7 @@ fix_scroll_patch2_end: apply_fix_file_index: # This patch fixes the character file indexing so it will account for the scroll position push 5 # Call size - push # Call address + push # Call address call get_code_size_for_selection_index_fix2 .deltaof selection_index_fix2_start, selection_index_fix2_end get_code_size_for_selection_index_fix2: @@ -146,11 +146,11 @@ get_code_size_for_selection_index_fix2: push dword [eax] call selection_index_fix2_end selection_index_fix2_start: - mov eax, [] + mov eax, [] mov eax, [eax + 0xAC] # eax = TAdScrollBarXb_objs[0]->selection_state[0].scroll_offset add ebp, eax # arg0 += eax mov [esp + 4], ebp - mov eax, + mov eax, jmp eax # set_current_char_slot selection_index_fix2_end: call write_call_to_code @@ -169,10 +169,10 @@ get_code_size_for_preview_window_fix: push dword [eax] call preview_window_fix_end preview_window_fix_start: - mov eax, [] # scroll_bar = TAdScrollBarXb_objs[0] + mov eax, [] # scroll_bar = TAdScrollBarXb_objs[0] mov eax, [eax + 0xAC] # eax = scroll_bar->selection_state[0].scroll_offset add [esp + 4], eax - mov eax, # get_player_preview_info + mov eax, # get_player_preview_info jmp eax preview_window_fix_end: # This patch applies in two places, so push the second set of args now, then @@ -190,265 +190,266 @@ preview_window_fix_end: apply_static_patches: .include WriteCodeBlocks # These patches change various places where the character data size and slot count are referenced - .data + .data .data 0x00000001 .binary 0C # slot count; TDataProtocol::handle_E5 - .data + .data .data 0x00000001 .binary 0C # slot count; import_player_preview - .data + .data .data 0x00000001 .binary 0C # slot count; TDataProtocol::handle_E4 - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000001 .binary 0C # slot count - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000001 .binary 0C # slot count - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000001 .binary 0C # slot count - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000004 .data 0x00022FBC # save_count offset - .data + .data .data 0x00000004 .data 0x00022FBC # save_count offset - .data + .data .data 0x00000004 .data 0x00022FBC # save_count offset - .data + .data .data 0x00000004 .data 0x00022FC0 # round2_seed offset - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000001 .binary 0C # slot count - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000004 .data 0x00022FBC # save_count offset - .data + .data .data 0x00000004 .data 0x00022FBC # save_count offset - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000001 .binary 0C # slot count - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000001 .binary 0C # slot count - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000001 .binary 0C # slot count - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000001 .binary 0C # slot count - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000001 .binary 0C # slot count - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000001 .binary 0C # slot count - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000001 .binary 0C # slot count - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000001 .binary 0C # slot count - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000001 .binary 0C # slot count - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000001 .binary 0C # slot count - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000001 .binary 0C # slot count - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000001 .binary 0C # slot count - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000001 .binary 0C # slot count - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000001 .binary 0C # slot count - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000001 .binary 0C # slot count - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000001 .binary 0C # slot count - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000001 .binary 0C # slot count - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000001 .binary 0C # slot count - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000001 .binary 0C # slot count - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000001 .binary 0C # slot count - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000001 .binary 0C # slot count - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000004 .data 0x0000005D # memcard block count - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000001 .binary 0C # slot count - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000001 .binary 0C # slot count - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000001 .binary 0C # slot count - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000001 .binary 0C # slot count - .data + .data .data 0x00000004 .data 0x00022FC4 # total file size - .data + .data .data 0x00000004 .data 0x00022FB4 # bgm_test_songs_unlocked offset # Signature check on all save files (rewritten as loop) - .data + .data .deltaof sig_check_begin, sig_check_end + sig_check_begin: mov edx, 0xC87ED5B1 # Expected signature value add eax, 0x04E8 # &char_file_list->chars[0].part2.signature @@ -469,10 +470,10 @@ sig_bad: inc eax jmp sig_check_end .binary CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC -sig_check_end: # +sig_check_end: # # Send slot count in E3 command - .data # TDataProtocol::send_E3_for_index + .data # TDataProtocol::send_E3_for_index .deltaof send_slot_count_in_E3_begin, send_slot_count_in_E3_end send_slot_count_in_E3_begin: # ecx = this (TDataProtocol*) @@ -487,7 +488,7 @@ send_slot_count_in_E3_begin: mov eax, [ecx] call [eax + 0x20] # this->send_command(&cmd, 0x10) // ret 8 add esp, 8 - mov eax, + mov eax, call eax # set_current_char_slot(slot_index) // ret 0 add esp, 8 ret 4 @@ -515,7 +516,7 @@ show_slot_number_strend_again: jmp show_slot_number_strend_again show_slot_number_strend_done: # Format the slot number and append it to the string - mov ecx, [] # scroll_bar = TAdScrollBarXb_objs[0] + mov ecx, [] # scroll_bar = TAdScrollBarXb_objs[0] mov ecx, [ecx + 0xAC] # ecx = scroll_bar->selection_state[0].scroll_offset lea ecx, [ecx + ebp + 1] push ecx # Slot number (scroll_offset + z) @@ -523,7 +524,7 @@ show_slot_number_strend_done: .binary 20002800230025006400290020000000 # L" (#%d) " get_show_slot_number_suffix_fmt: push eax # Destination buffer - mov eax, # _swprintf + mov eax, # _swprintf call eax add esp, 0x0C jmp show_slot_number_end @@ -541,11 +542,11 @@ update_existing_char_file_list: # patch is applied statically to the executable; this is only necessary when used as a server patch because the # character list is already allocated at the time the patch is applied. push 0x00022FC4 # total file size - mov eax, # operator_new + mov eax, # operator_new call eax add esp, 4 - mov edx, [] # edx = old char_file_list - mov [], eax + mov edx, [] # edx = old char_file_list + mov [], eax mov ecx, [edx + 0xBA94] # Copy bgm_test_songs_unlocked_high to new file mov [eax + 0x00022FB4], ecx mov ecx, [edx + 0xBA98] # Copy bgm_test_songs_unlocked_low to new file @@ -558,7 +559,7 @@ update_existing_char_file_list: add edx, 4 mov ecx, 0xBA90 call memcpy # Copy the existing 4 characters over - mov eax, [] + mov eax, [] add eax, 0xBA94 mov ecx, 4 clear_next_char: @@ -578,19 +579,19 @@ clear_next_char_done: # countof(char_file_list.chars) - 4, # PSOCharacterFile::init, # PSOCharacterFile::destroy) - push # PSOCharacterFile::destroy - push # PSOCharacterFile::init + push # PSOCharacterFile::destroy + push # PSOCharacterFile::init push 0x08 # slot count - 4 push 0x2EA4 # sizeof(PSOCharacterFile) - mov eax, [] + mov eax, [] add eax, 0xBA94 push eax - mov eax, + mov eax, call eax # Fix the file's checksum - mov eax, [] - mov ecx, + mov eax, [] + mov ecx, jmp ecx # PSOBBCharacterFileList::checksum(char_file_list) @@ -605,10 +606,10 @@ update_existing_char_file_list_memcard: add eax, 0x0000FFFF and eax, 0xFFFFC000 push eax - mov eax, + mov eax, call eax # malloc10(total file size) add esp, 4 - mov [], eax - mov edx, [] + mov [], eax + mov edx, [] mov ecx, 0x00022FC4 # total file size jmp memcpy diff --git a/system/client-functions/BlueBurstExclusive/ServerEXPDisplay.s b/system/client-functions/BlueBurstExclusive/ServerEXPDisplay.s index ed28f173..be8d5cf8 100644 --- a/system/client-functions/BlueBurstExclusive/ServerEXPDisplay.s +++ b/system/client-functions/BlueBurstExclusive/ServerEXPDisplay.s @@ -5,7 +5,7 @@ .meta name="Server EXP display" .meta description="" -.versions 59NJ 59NL +.versions 50YJ 59NJ 59NL entry_ptr: reloc0: @@ -20,7 +20,7 @@ start: install_hook: pop ecx push 0 # Write address instead of a call/jmp opcode - push + push call get_code_size .deltaof handle_6xBF_start, handle_6xBF_end get_code_size: @@ -30,7 +30,7 @@ get_code_size: handle_6xBF_start: # [std](G_6xBF* cmd @ [esp + 4]) -> void mov edx, [esp + 4] - mov ecx, [] # local_client_id + mov ecx, [] # local_client_id cmp [edx + 2], cx jne skip_text @@ -47,25 +47,25 @@ handle_6xBF_start: # [std](G_6xBF* cmd @ [esp + 4]) -> void jnz enemy_entity_ok # Use player entity if enemy entity is already gone - mov eax, + mov eax, xchg eax, ecx call ecx # eax = TObjPlayer::for_client_id(local_client_id); conveniently, this function preserves all regs except eax enemy_entity_ok: push 0x0000FFFF # entity_id; ignored by TFontSmallTask if not a player push dword [edx + 4] # amount = cmd.amount - push # prefix = L"EXP" + push # prefix = L"EXP" push 0x14 push 0x14 push 0xFFFF00FF # color (ARGB) add eax, 0x300 push eax # position - mov eax, + mov eax, call eax # TFontSmallTask___new__(...) add esp, 0x1C skip_text: - mov eax, # Original handle_6xBF + mov eax, # Original handle_6xBF jmp eax # original_handle_6xBF(cmd) get_enemy_entity: @@ -81,7 +81,7 @@ handle_6xBF_end: apply_static_patches: .include WriteCodeBlocks - .data + .data .deltaof disable_kill_enemy_callsite_start, disable_kill_enemy_callsite_end disable_kill_enemy_callsite_start: nop @@ -91,7 +91,7 @@ disable_kill_enemy_callsite_start: nop disable_kill_enemy_callsite_end: - .data + .data .deltaof disable_exp_steal_callsite_start, disable_exp_steal_callsite_end disable_exp_steal_callsite_start: add esp, 0x0C # Original function has `ret 0x0C` diff --git a/system/client-functions/BlueBurstExclusive/StackLimits.s b/system/client-functions/BlueBurstExclusive/StackLimits.s index 67f7891a..a8c272b5 100644 --- a/system/client-functions/BlueBurstExclusive/StackLimits.s +++ b/system/client-functions/BlueBurstExclusive/StackLimits.s @@ -7,7 +7,7 @@ .meta name="Item stacks" .meta description="" -.versions 59NJ 59NL +.versions 50YJ 59NJ 59NL entry_ptr: reloc0: @@ -16,7 +16,7 @@ start: .include WriteCodeBlocks # Patch 1: rewrite item_is_stackable - .data + .data .deltaof item_is_stackable_start, item_is_stackable_end item_is_stackable_start: @@ -31,7 +31,7 @@ item_is_stackable_start: push eax mov ecx, esp - .binary # call max_stack_size_for_tool_start + .binary # call max_stack_size_for_tool_start pop ecx cmp eax, 1 jg return_1 @@ -47,7 +47,7 @@ return_1: item_is_stackable_end: # Patch 2: rewrite max_stack_size_for_tool - .data + .data .deltaof max_stack_size_for_tool_start, max_stack_size_for_tool_end max_stack_size_for_tool_start: diff --git a/system/client-functions/CallProtectedHandler.s b/system/client-functions/CallProtectedHandler.s index e4d479c6..ee4598a2 100644 --- a/system/client-functions/CallProtectedHandler.s +++ b/system/client-functions/CallProtectedHandler.s @@ -77,7 +77,7 @@ get_data_addr: -.versions 59NJ 59NL +.versions 50YJ 59NJ 59NL start: jmp get_data_addr @@ -103,8 +103,8 @@ resume: get_data_addr: call resume - .data # should_allow_protected_commands - .data # RcvPsoData2[std](void* data @ [esp + 4], uint32_t size @ [esp + 8]) + .data # should_allow_protected_commands + .data # RcvPsoData2[std](void* data @ [esp + 4], uint32_t size @ [esp + 8]) diff --git a/system/client-functions/DisableIdleDisconnect.s b/system/client-functions/DisableIdleDisconnect.s index 84edab39..555f83b4 100644 --- a/system/client-functions/DisableIdleDisconnect.s +++ b/system/client-functions/DisableIdleDisconnect.s @@ -34,8 +34,8 @@ start: - .versions 59NJ 59NL - .data + .versions 50YJ 59NJ 59NL + .data .data 0x00000005 mov eax, 0 diff --git a/system/client-functions/DrawDistance.s b/system/client-functions/DrawDistance.s index 1583b71d..e2ea8f11 100644 --- a/system/client-functions/DrawDistance.s +++ b/system/client-functions/DrawDistance.s @@ -228,21 +228,21 @@ p5_3e: -.versions 59NJ 59NL +.versions 50YJ 59NJ 59NL write_call_func: .include WriteCallToCode start: mov eax, 0x41800000 # Environment clip distance mod 16.0f - mov [], eax # This affects mostly static map objects - mov [], eax - mov [], eax + mov [], eax # This affects mostly static map objects + mov [], eax + mov [], eax mov ax, 0x9090 - mov [], ax # Players draw distance 10000.0f always + mov [], ax # Players draw distance 10000.0f always mov eax, 0x41000000 # Use newly acquired skipped branch room - mov [], eax # to store our float multiplier + mov [], eax # to store our float multiplier call patch_func_1 # Floor items call patch_func_2 # Whole bunch of stuff, including NPCs @@ -256,7 +256,7 @@ start: patch_func_1: pop ecx push 8 - push + push call get_code_size1 .deltaof patch_code1, patch_code_end1 get_code_size1: @@ -265,7 +265,7 @@ get_code_size1: call patch_code_end1 patch_code1: mov edx, [esp + 0x18] - fld st0, dword [] + fld st0, dword [] fld st0, dword [esp + 0x14] fmulp st1, st0 ret @@ -277,7 +277,7 @@ patch_code_end1: patch_func_2: pop ecx push 9 - push + push call get_code_size2 .deltaof patch_code2, patch_code_end2 get_code_size2: @@ -286,7 +286,7 @@ get_code_size2: call patch_code_end2 patch_code2: test eax, 0x400 - fld st0, dword [] + fld st0, dword [] fld st0, dword [esp + 0x2C] fmulp st1, st0 ret @@ -296,18 +296,18 @@ patch_code_end2: # Duplicate function from above, reuse same hook patch_func_3: - mov eax, dword [] + mov eax, dword [] add eax, 0x002A1C74 - mov dword [], eax - mov byte [], 0xE8 - mov dword [], 0x90909090 + mov dword [], eax + mov byte [], 0xE8 + mov dword [], 0x90909090 ret # TOComputerMachine01 patch_func_4: pop ecx push 7 - push + push call get_code_size4 .deltaof patch_code4, patch_code_end4 get_code_size4: @@ -316,7 +316,7 @@ get_code_size4: call patch_code_end4 patch_code4: lea edx, [edi + 0x38] - fld st0, dword [] + fld st0, dword [] fld st0, dword [esp + 0x14] fmulp st1, st0 ret @@ -328,7 +328,7 @@ patch_code_end4: patch_func_5: pop ecx push 6 - push + push call get_code_size5 .deltaof patch_code5, patch_code_end5 get_code_size5: @@ -336,7 +336,7 @@ get_code_size5: push dword [eax] call patch_code_end5 patch_code5: - fld st0, dword [] + fld st0, dword [] fld st0, dword [esp + 0x28] fmulp st1, st0 fchs st0 @@ -349,7 +349,7 @@ patch_code_end5: patch_func_6: pop ecx push 6 - push + push call get_code_size6 .deltaof patch_code6, patch_code_end6 get_code_size6: @@ -358,7 +358,7 @@ get_code_size6: call patch_code_end6 patch_code6: mov ebp, ecx - fld st0, dword [] + fld st0, dword [] fld st0, dword [esp + 0x30] fmulp st1, st0 ret diff --git a/system/client-functions/EnemyDamageSyncBB.s b/system/client-functions/EnemyDamageSyncBB.s index e7128c74..b142f276 100644 --- a/system/client-functions/EnemyDamageSyncBB.s +++ b/system/client-functions/EnemyDamageSyncBB.s @@ -4,7 +4,7 @@ .meta description="Mitigates effects\nof enemy health\ndesync" .meta client_flag="0x0000001000000000" -.versions 59NJ 59NL +.versions 50YJ 59NJ 59NL entry_ptr: reloc0: @@ -18,8 +18,8 @@ write_address_of_code: start: # Replace 6x09 with 6xE4 in subcommand handler table - mov dword [], 0x000600E4 # subcommand=0xE4, flags=6 - push + mov dword [], 0x000600E4 # subcommand=0xE4, flags=6 + push call +4 .deltaof handle_6xE4_start, handle_6xE4_end pop eax @@ -31,7 +31,7 @@ handle_6xE4_start: # (G_6xE4* cmd @ [esp + 4]) -> void push esi push edi - test byte [], 0x80 + test byte [], 0x80 #0x2480 jz handle_6xE4_return mov ebx, [esp + 0x10] # cmd movzx eax, word [ebx + 2] @@ -47,7 +47,7 @@ handle_6xE4_start: # (G_6xE4* cmd @ [esp + 4]) -> void movzx eax, word [ebx + 2] and eax, 0x0FFF imul eax, eax, 0x0C - add eax, [] # eax = state_for_enemy(cmd->header.entity_id) + add eax, [] # eax = state_for_enemy(cmd->header.entity_id) cmp dword [ebx + 0x0C], 0 jl handle_6xE4_not_proportional @@ -94,7 +94,7 @@ handle_6xE4_not_proportional: mov [esp + 4], si # out_cmd.entity_index mov [esp + 6], di # out_cmd.total_damage mov ecx, esp - mov edx, + mov edx, call edx # send_and_handle_60(&out_cmd); add esp, 0x10 jmp handle_6xE4_return @@ -130,41 +130,41 @@ handle_6xE4_end: # Note: in 59NJ this object is TObjectV00b421c0 (it's the same as 3OE1's TObjectV8047c128) # Write TObjectV00b441c0::incr_hp_with_sync push 5 - push # TObjectV00b441c0::v18_accept_hit (presumably Resta) - this is add_hp, not subtract_hp! + push # TObjectV00b441c0::v18_accept_hit (presumably Resta) - this is add_hp, not subtract_hp! push 5 - push # TObjectV00b441c0::subtract_hp_if_not_in_state_2 + push # TObjectV00b441c0::subtract_hp_if_not_in_state_2 push 5 - push # TObjectV00b441c0::v19_handle_hit_special_effects + push # TObjectV00b441c0::v19_handle_hit_special_effects push 5 - push # TObjectV00b441c0::v19_handle_hit_special_effects + push # TObjectV00b441c0::v19_handle_hit_special_effects push 5 - push # TObjectV00b441c0::v19_handle_hit_special_effects + push # TObjectV00b441c0::v19_handle_hit_special_effects push 5 - push # TObjectV00b441c0::v19_handle_hit_special_effects + push # TObjectV00b441c0::v19_handle_hit_special_effects push 5 - push # TObjectV00b441c0::v19_handle_hit_special_effects + push # TObjectV00b441c0::v19_handle_hit_special_effects push 5 - push # TObjectV00b441c0::v19_handle_hit_special_effects + push # TObjectV00b441c0::v19_handle_hit_special_effects push 5 - push # TObjectV00b441c0::v19_handle_hit_special_effects + push # TObjectV00b441c0::v19_handle_hit_special_effects push 5 - push # TObjectV00b441c0::v19_handle_hit_special_effects (Devil's/Demon's) + push # TObjectV00b441c0::v19_handle_hit_special_effects (Devil's/Demon's) push 5 - push # TObjectV00b441c0::v18_accept_hit + push # TObjectV00b441c0::v18_accept_hit push 5 - push # TObjectV00b441c0::v18_accept_hit + push # TObjectV00b441c0::v18_accept_hit push 5 - push # TObjectV00b441c0::v18_accept_hit + push # TObjectV00b441c0::v18_accept_hit push 5 - push # TObjectV00b441c0::v18_accept_hit + push # TObjectV00b441c0::v18_accept_hit push 5 - push # TObjectV00b441c0::v18_accept_hit + push # TObjectV00b441c0::v18_accept_hit push 5 - push # TObjectV00b441c0::v18_accept_hit + push # TObjectV00b441c0::v18_accept_hit push 5 - push # TObjectV00b441c0::v18_accept_hit + push # TObjectV00b441c0::v18_accept_hit push 5 - push # TObjectV00b441c0::v17 + push # TObjectV00b441c0::v17 push 18 call +4 .deltaof on_add_or_subtract_hp_start, on_add_or_subtract_hp_end @@ -173,7 +173,7 @@ handle_6xE4_end: call on_add_or_subtract_hp_end on_add_or_subtract_hp_start: # (TObjectV00b441c0* this @ ecx, int16_t amount @ [esp + 4]) -> bool @ eax - test byte [], 0x80 + test byte [], 0x80 jz on_add_or_subtract_hp_skip_send movzx eax, word [ecx + 0x1C] # ene->entity_id cmp eax, 0x1000 @@ -183,14 +183,14 @@ on_add_or_subtract_hp_start: # (TObjectV00b441c0* this @ ecx, int16_t amount @ and eax, 0x0FFF imul eax, eax, 0x0C - add eax, [] # eax = state_for_enemy(cmd->header.entity_id) + add eax, [] # eax = state_for_enemy(cmd->header.entity_id) sub esp, 0x10 mov word [esp], 0x04E4 mov dx, [ecx + 0x1C] mov [esp + 0x02], dx # cmd.entity_id mov dx, [esp + 0x14] - cmp dword [esp + 0x10], # Check if callsite is add_hp + cmp dword [esp + 0x10], # Check if callsite is add_hp jne on_add_or_subtract_hp_skip_negate_amount neg dx on_add_or_subtract_hp_skip_negate_amount: @@ -203,7 +203,7 @@ on_add_or_subtract_hp_skip_negate_amount: mov [esp + 0x0A], dx # cmd.max_hp mov dword [esp + 0x0C], 0xBF800000 # cmd.factor - cmp dword [esp + 0x10], # Check if callsite is Devil's/Demon's + cmp dword [esp + 0x10], # Check if callsite is Devil's/Demon's jne on_add_or_subtract_hp_not_proportional # esp is 0x18 down from where it is in caller's context mov edx, 100 @@ -221,16 +221,16 @@ on_add_or_subtract_hp_not_proportional: push ecx push 0x10 push edx - mov ecx, [] - mov edx, + mov ecx, [] + mov edx, call edx # send_60(root_protocol, &cmd, sizeof(cmd)); pop ecx add esp, 0x10 on_add_or_subtract_hp_skip_send: - mov eax, # subtract_hp - mov edx, # add_hp - cmp dword [esp], # Check if callsite is add_hp + mov eax, # subtract_hp + mov edx, # add_hp + cmp dword [esp], # Check if callsite is add_hp cmove eax, edx jmp eax @@ -240,7 +240,7 @@ on_add_or_subtract_hp_end: push 5 - push + push push 1 call +4 .deltaof on_6x0A_patch_start, on_6x0A_patch_end @@ -249,7 +249,7 @@ on_add_or_subtract_hp_end: call on_6x0A_patch_end on_6x0A_patch_start: # (TObjectV00b441c0* this @ ecx, int16_t amount @ [esp + 4]) -> bool @ eax - test byte [], 0x80 + test byte [], 0x80 jz on_6x0A_patch_skip_write mov [esp + 0x0A], cx on_6x0A_patch_skip_write: diff --git a/system/client-functions/EnemyHPBarsBB.s b/system/client-functions/EnemyHPBarsBB.s index 877134fb..42ad07dc 100644 --- a/system/client-functions/EnemyHPBarsBB.s +++ b/system/client-functions/EnemyHPBarsBB.s @@ -3,47 +3,47 @@ .meta name="Enemy HP bars" .meta description="Shows HP bars in\nenemy info windows" -.versions 59NJ 59NL +.versions 50YJ 59NJ 59NL entry_ptr: reloc0: .offsetof start start: .include WriteCodeBlocks - .data + .data .data 6 .binary 81E2FDFFFFFF - .data + .data .data 1 .binary FA - .data + .data .data 4 .data 0x42480000 - .data + .data .data 4 .data 0x41C00000 - .data + .data .data 4 .data 0x42480000 - .data + .data .data 4 .data 0x41C00000 - .data + .data .data 4 .data 0x42480000 - .data + .data .data 4 .data 0x41C00000 - .data + .data .data 4 .data 0x42480000 - .data + .data .data 4 .data 0x41C00000 - .data + .data .data 4 .data 0x42200000 - .data + .data .data 4 .data 0xFF00FF15 .data 0x00000000 diff --git a/system/client-functions/ExitAnywhere.s b/system/client-functions/ExitAnywhere.s index 62b3ee2c..ee79382f 100644 --- a/system/client-functions/ExitAnywhere.s +++ b/system/client-functions/ExitAnywhere.s @@ -52,11 +52,11 @@ start: -.versions 59NJ 59NL +.versions 50YJ 59NJ 59NL start: xor eax, eax - mov [], eax # is_in_quest = false - mov [], eax # dat_source_type = NONE + mov [], eax # is_in_quest = false + mov [], eax # dat_source_type = NONE inc eax - mov [], ax # should_leave_game = true + mov [], ax # should_leave_game = true ret diff --git a/system/client-functions/FastTekker.s b/system/client-functions/FastTekker.s index 61ff3655..e3698e63 100644 --- a/system/client-functions/FastTekker.s +++ b/system/client-functions/FastTekker.s @@ -64,15 +64,15 @@ patch2_end: - .versions 59NJ 59NL + .versions 50YJ 59NJ 59NL - .data + .data .deltaof patch1_start, patch1_end patch1_start: mov dword [edi + 0x14C], 1 patch1_end: - .data + .data .deltaof patch2_start, patch2_end patch2_start: nop diff --git a/system/client-functions/HungryMagSound.s b/system/client-functions/HungryMagSound.s index e505a585..e15aaade 100644 --- a/system/client-functions/HungryMagSound.s +++ b/system/client-functions/HungryMagSound.s @@ -122,12 +122,12 @@ hook6_end: -.versions 59NJ 59NL +.versions 50YJ 59NJ 59NL start: pop ecx push 6 - push + push call get_code_size .deltaof patch_code, patch_code_end get_code_size: @@ -135,16 +135,16 @@ get_code_size: push dword [eax] call patch_code_end patch_code: # [eax] (TItemMag* this @ ecx) -> void - mov dword [ecx + 0x01B8], eax + mov dword [ecx + ], eax mov eax, [ecx + 0x00F8] movzx eax, word [eax + 0x001C] # eax = this->owner_player->entity_id - cmp [], eax + cmp [], eax jne patch_code_skip_sound push 0 push 0 push 0 push 0xAC - mov eax, + mov eax, call eax add esp, 0x10 patch_code_skip_sound: diff --git a/system/client-functions/NoRareSelling.s b/system/client-functions/NoRareSelling.s index 0ceadd0c..a8998bb5 100644 --- a/system/client-functions/NoRareSelling.s +++ b/system/client-functions/NoRareSelling.s @@ -88,22 +88,22 @@ tool_check_end: -.versions 59NJ 59NL +.versions 50YJ 59NJ 59NL start: # This works by setting the item price to zero if it's rare, which causes the game to prevent you from selling the # item. For armors and weapons, this is easy because there are easily-patchable opcodes within branches that return a # constant price for rare items. xor eax, eax - mov [], eax # Rare armors - mov [], eax # Unidentified weapons - mov [], eax # Rare weapons + mov [], eax # Rare armors + mov [], eax # Unidentified weapons + mov [], eax # Rare weapons # For tools, it's harder to implement this, because the price comes from the ItemPMT tools table and there is no # branch for rares. Still, we can add a branch to a stub to handle tools. pop ecx push 5 - push + push call get_code_size .deltaof patch_code, patch_code_end get_code_size: @@ -113,7 +113,7 @@ get_code_size: patch_code: # TODO: It'd be nice to have something like WriteJumpToAndFromCode, since this hook is supposed to return to a # different place than where it was called, hence this mov [esp]. - mov dword [esp], + mov dword [esp], xor edi, edi test byte [eax + 0x14], 0x80 # flags & 0x80 = is rare cmovz edi, [eax + 0x10] # Use price from table if not rare diff --git a/system/client-functions/PaletteBB.s b/system/client-functions/PaletteBB.s index 211daabc..6ebdb88b 100644 --- a/system/client-functions/PaletteBB.s +++ b/system/client-functions/PaletteBB.s @@ -6,7 +6,7 @@ .meta name="Palette" .meta description="Enables the alternate action\npalette for number keys" -.versions 59NJ 59NL +.versions 50YJ 59NJ 59NL entry_ptr: reloc0: @@ -17,10 +17,10 @@ write_call_func: start: mov al, 0xEB - mov [], al # SecondaryPaletteAttack1 + mov [], al # SecondaryPaletteAttack1 xor al, al - mov [], al # SecondaryPaletteAttack2 - mov [], al # SecondaryPaletteAttack3 + mov [], al # SecondaryPaletteAttack2 + mov [], al # SecondaryPaletteAttack3 call patch_func_1 # GetCurrentPalette call patch_func_2 # CheckHotkey1_1 @@ -35,7 +35,7 @@ start: patch_func_1: pop ecx push 8 - push + push call get_code_size1 .deltaof patch_code1, patch_code_end1 get_code_size1: @@ -47,7 +47,7 @@ patch_code1: mov edx, [edx + 0x2C] movzx edx, byte [edx + 0x62] test edx, edx - setnz byte [] + setnz byte [] mov edx, edi and edx, 0xFF ret @@ -59,7 +59,7 @@ patch_code_end1: patch_func_2: pop ecx push 5 - push + push call get_code_size2 .deltaof patch_code2, patch_code_end2 get_code_size2: @@ -67,7 +67,7 @@ get_code_size2: push dword [eax] call patch_code_end2 patch_code2: - cmp byte [], 0 + cmp byte [], 0 jnz +0x06 movzx edx, byte [eax + esi * 4 + 0x04] # main palette ret @@ -81,7 +81,7 @@ patch_code_end2: patch_func_3: pop ecx push 5 - push + push call get_code_size3 .deltaof patch_code3, patch_code_end3 get_code_size3: @@ -89,7 +89,7 @@ get_code_size3: push dword [eax] call patch_code_end3 patch_code3: - cmp byte [], 0 + cmp byte [], 0 jnz +0x06 movzx ecx, byte [eax + ecx * 2 + 0x05] # main palette ret @@ -103,7 +103,7 @@ patch_code_end3: patch_func_4: pop ecx push 5 - push + push call get_code_size4 .deltaof patch_code4, patch_code_end4 get_code_size4: @@ -111,7 +111,7 @@ get_code_size4: push dword [eax] call patch_code_end4 patch_code4: - cmp byte [], 0 + cmp byte [], 0 jnz +0x06 movzx edx, byte [edx + ebx * 4 + 0x04] # main palette ret @@ -125,7 +125,7 @@ patch_code_end4: patch_func_5: pop ecx push 5 - push + push call get_code_size5 .deltaof patch_code5, patch_code_end5 get_code_size5: @@ -133,7 +133,7 @@ get_code_size5: push dword [eax] call patch_code_end5 patch_code5: - cmp byte [], 0 + cmp byte [], 0 jnz +0x06 movzx ecx, byte [edx + eax * 2 + 0x05] # main palette ret @@ -147,7 +147,7 @@ patch_code_end5: patch_func_6: pop ecx push 5 - push + push call get_code_size6 .deltaof patch_code6, patch_code_end6 get_code_size6: @@ -155,7 +155,7 @@ get_code_size6: push dword [eax] call patch_code_end6 patch_code6: - cmp byte [], 0 + cmp byte [], 0 jnz +0x06 movzx ecx, byte [eax + edx * 4 + 0x04] # main palette ret @@ -169,7 +169,7 @@ patch_code_end6: patch_func_7: pop ecx push 5 - push + push call get_code_size7 .deltaof patch_code7, patch_code_end7 get_code_size7: @@ -177,7 +177,7 @@ get_code_size7: push dword [eax] call patch_code_end7 patch_code7: - cmp byte [], 0 + cmp byte [], 0 jnz +0x06 movzx ecx, byte [eax + edx * 4 + 0x05] # main palette ret @@ -190,29 +190,29 @@ patch_code_end7: write_code_blocks: .include WriteCodeBlocks - .data + .data .deltaof code_block1_start, code_block1_end # UnsetHotkey1 code_block1_start: - push dword [] + push dword [] push eax - mov eax, # SetPaletteHotkey + mov eax, # SetPaletteHotkey call eax .binary 909090909090909090 code_block1_end: - .data + .data .deltaof code_block2_start, code_block2_end # UnsetHotkey2 code_block2_start: - push dword [] + push dword [] push eax - mov eax, # SetPaletteHotkey + mov eax, # SetPaletteHotkey call eax .binary 909090909090909090 code_block2_end: - .data + .data .deltaof code_block3_start, code_block3_end # SetHotkey @@ -224,9 +224,9 @@ code_block3_start: push edx push ebx push esi - .binary 6800000000 # tmpCurrentPalette = + .binary 6800000000 # tmpCurrentPalette = push 0 - mov eax, # SetPaletteHotkey + mov eax, # SetPaletteHotkey call eax .binary 90909090909090909090909090909090 code_block3_end: diff --git a/system/client-functions/System/GetEnemyEntity.inc.s b/system/client-functions/System/GetEnemyEntity.inc.s index 2fec4466..e7028370 100644 --- a/system/client-functions/System/GetEnemyEntity.inc.s +++ b/system/client-functions/System/GetEnemyEntity.inc.s @@ -1,7 +1,7 @@ # (uint16_t entity_id @ eax) -> TObjectV00b441c0* @ eax # Preserves all registers except eax -.versions 59NJ 59NL +.versions 50YJ 59NJ 59NL get_enemy_entity: push esi @@ -15,15 +15,15 @@ get_enemy_entity: cmp edx, 0x4000 jge done - mov esi, [] # bs_low = next_player_entity_index - mov edi, [] + mov esi, [] # bs_low = next_player_entity_index + mov edi, [] lea edi, [edi + esi - 1] # bs_high = next_player_entity_index + next_enemy_entity_index - 1 bs_again: cmp esi, edi jge bs_done lea ecx, [esi + edi] shr ecx, 1 - mov eax, [ecx * 4 + ] # all_entities[ecx] + mov eax, [ecx * 4 + ] # all_entities[ecx] cmp [eax + 0x1C], dx jge bs_not_less lea esi, [ecx + 1] @@ -33,7 +33,7 @@ bs_not_less: jmp bs_again bs_done: - mov eax, [esi * 4 + ] # all_entities[bs_low] + mov eax, [esi * 4 + ] # all_entities[bs_low] test eax, eax je done xor ecx, ecx diff --git a/system/client-functions/System/WriteAddressOfCode.inc.s b/system/client-functions/System/WriteAddressOfCode.inc.s index 6e19a405..5198d57b 100644 --- a/system/client-functions/System/WriteAddressOfCode.inc.s +++ b/system/client-functions/System/WriteAddressOfCode.inc.s @@ -7,7 +7,7 @@ # allocated code at the specified pointer. The allocated memory is never freed. This function pops its arguments off # the stack before returning. -.versions 59NJ 59NL +.versions 50YJ 59NJ 59NL write_call_to_code: # [esp + 0x04] = code ptr @@ -15,9 +15,9 @@ write_call_to_code: # [esp + 0x0C] = ptr addr # Allocate memory for the copied code - mov ecx, [] + mov ecx, [] push dword [esp + 0x08] - mov eax, + mov eax, call eax # malloc7 test eax, eax je done diff --git a/system/client-functions/System/WriteCallToCode.inc.s b/system/client-functions/System/WriteCallToCode.inc.s index 1b6747ae..a1095bc6 100644 --- a/system/client-functions/System/WriteCallToCode.inc.s +++ b/system/client-functions/System/WriteCallToCode.inc.s @@ -1,4 +1,4 @@ -.versions 59NJ 59NL +.versions 50YJ 59NJ 59NL # This file defines the following function: # write_call_to_code( @@ -20,9 +20,9 @@ write_call_to_code: # [esp + 0x10] = callsite size (if zero, write the address instead of a call) # Allocate memory for the copied code - mov ecx, [] + mov ecx, [] push dword [esp + 0x08] - mov eax, + mov eax, call eax # malloc7 test eax, eax je done diff --git a/system/client-functions/System/WriteCallToCodeMulti.inc.s b/system/client-functions/System/WriteCallToCodeMulti.inc.s index 1e357395..ebedf3f9 100644 --- a/system/client-functions/System/WriteCallToCodeMulti.inc.s +++ b/system/client-functions/System/WriteCallToCodeMulti.inc.s @@ -14,7 +14,7 @@ -.versions 59NJ 59NL +.versions 50YJ 59NJ 59NL write_call_to_code: # [esp + 0x04] = code ptr @@ -25,9 +25,9 @@ write_call_to_code: # ... (further callsite address/size pairs) # Allocate memory for the copied code - mov ecx, [] + mov ecx, [] push dword [esp + 0x08] - mov eax, + mov eax, call eax # malloc7 test eax, eax je done diff --git a/system/client-functions/System/WriteCodeBlocks.inc.s b/system/client-functions/System/WriteCodeBlocks.inc.s index 9d1f17fe..52e1fd14 100644 --- a/system/client-functions/System/WriteCodeBlocks.inc.s +++ b/system/client-functions/System/WriteCodeBlocks.inc.s @@ -118,7 +118,7 @@ first_patch_header: -.versions 2OJW 2OJZ 59NJ 59NL +.versions 2OJW 2OJZ 50YJ 59NJ 59NL start: push ebx