Skip to content

Commit

Permalink
MM8Patch v2.5.6:
Browse files Browse the repository at this point in the history
[-] Items laying on the ground in one map were appearing in another when traveling by foot sometimes.
[-] Ogre corpses were containing most basic sword instead of a club.
[-] My bug: DisableHooks option wasn't working for some new hooks.
[-] My bug: When custom *.games.lod archives are used, incorrect data was written to autosave on New Game start. It was fully inconsequential until version 2.5.4.
[-] My bug: The DirectX 7 bug/limitation fix was being applied prematurely, causing a crash on Wine.
  • Loading branch information
GrayFace committed Feb 5, 2022
1 parent 9200e88 commit 0360145
Show file tree
Hide file tree
Showing 9 changed files with 3,989 additions and 3,880 deletions.
7,777 changes: 3,903 additions & 3,874 deletions MMPatches/Install/MM8patch.map

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion MMPatches/Install/MM8patch/Files/MM8Patch ReadMe.TXT
@@ -1,4 +1,4 @@
GrayFace MM8 Patch v2.5.5
GrayFace MM8 Patch v2.5.6
By Sergey Rozhenko <mailto:sergroj@mail.ru>
https://grayface.github.io/

Expand All @@ -11,6 +11,17 @@ At the end of ReadMe you'll find info on how to report errors.

([+] - feature, [-] - fixed bug, [*] - other)

New in version 2.5.6:
<< MM6 - MM8 >>
[+] New command available to map scripts (*.evt) that powers some of the MM6 and MM7 changes of this version (code 0x45 - RefundChestArtifacts).
[-] Items laying on the ground in one map were appearing in another when traveling by foot sometimes. Add FixItemDuplicates=0 to INI to disable this fix.
[-] My bug: DisableHooks option wasn't working for some new hooks.
[-] My bug: When custom *.games.lod archives are used, incorrect data was written to autosave on New Game start. It was fully inconsequential until version 2.5.4.
<< MM7, MM8 >>
[-] My bug: The DirectX 7 bug/limitation fix was being applied prematurely, causing a crash on Wine.
<< MM8 >>
[-] Ogre corpses were containing most basic sword instead of a club. Add FixClubsGeneration=0 to INI to disable this fix.

New in version 2.5.5:
<< MM6 - MM8 >>
[-] My bug: Possible character resistances corruption when taking an item from the inventory.
Expand Down
Binary file modified MMPatches/Install/MM8patch/Files/MM8patch.dll
Binary file not shown.
13 changes: 12 additions & 1 deletion MMPatches/Install/MM8patch/eng/MM8Patch ReadMe.TXT
@@ -1,4 +1,4 @@
GrayFace MM8 Patch v2.5.5
GrayFace MM8 Patch v2.5.6
By Sergey Rozhenko <mailto:sergroj@mail.ru>
https://grayface.github.io/

Expand All @@ -11,6 +11,17 @@ At the end of ReadMe you'll find info on how to report errors.

([+] - feature, [-] - fixed bug, [*] - other)

New in version 2.5.6:
<< MM6 - MM8 >>
[+] New command available to map scripts (*.evt) that powers some of the MM6 and MM7 changes of this version (code 0x45 - RefundChestArtifacts).
[-] Items laying on the ground in one map were appearing in another when traveling by foot sometimes. Add FixItemDuplicates=0 to INI to disable this fix.
[-] My bug: DisableHooks option wasn't working for some new hooks.
[-] My bug: When custom *.games.lod archives are used, incorrect data was written to autosave on New Game start. It was fully inconsequential until version 2.5.4.
<< MM7, MM8 >>
[-] My bug: The DirectX 7 bug/limitation fix was being applied prematurely, causing a crash on Wine.
<< MM8 >>
[-] Ogre corpses were containing most basic sword instead of a club. Add FixClubsGeneration=0 to INI to disable this fix.

New in version 2.5.5:
<< MM6 - MM8 >>
[-] My bug: Possible character resistances corruption when taking an item from the inventory.
Expand Down
13 changes: 12 additions & 1 deletion MMPatches/Install/MM8patch/rus/MM8Patch ReadMe_rus.TXT
@@ -1,4 +1,4 @@
GrayFace MM8 Patch v2.5.5
GrayFace MM8 Patch v2.5.6
�����: ������ ������� <mailto:sergroj@mail.ru>
https://grayface.github.io/ru/

Expand All @@ -9,6 +9,17 @@ https://grayface.github.io/ru/

([+] - ����, [-] - ������������ ���, [*] - ������)

��������� ������ 2.5.6:
<< MM6 - MM8 >>
[+] ����� �������, ��������� ��� �������� ���� (*.evt), ������� ��������� ������� ��������� ��������� ����� � MM6 � MM7 (��� 0x45 - RefundChestArtifacts).
[-] ������ ������� �� ����� �������� �� ����� ����� ���������� � ������ ��� ����������� ������. ����� ��������� �����������, �������� FixItemDuplicates=0 � INI.
[-] ��� ���: ����� "DisableHooks" �� �������� ��� ��������� ����� �����.
[-] ��� ���: ��� ������������� ����� ������� *.games.lod �������� ������ �������� � �������������� ��� ������ ����� ����. ��� �� �� ��� �� ������ �� ������ 2.5.4.
<< MM7, MM8 >>
[-] ��� ���: ����������� ��� ����/����������� DirectX 7 ����������� ������� ����, ������� � ������ ��� Wine.
<< MM8 >>
[-] � ������ ����� ��������� ����� ������ ��� ������ �������. ����� ��������� �����������, �������� FixClubsGeneration=0 � INI.

��������� ������ 2.5.5:
<< MM6 - MM8 >>
[-] ��� ���: ������ �������� �� ��������� ����� ��������� � ����������� ������ � ����������������� ���������.
Expand Down
35 changes: 34 additions & 1 deletion MMPatches/MM8Patch/Hooks.pas
Expand Up @@ -3071,10 +3071,39 @@ procedure FixOfAcid;
push $437AC5
end;

//----- Fix clubs being generated as sword 0 instead

procedure FixClubsGenerationRead;
const
club: pchar = 'club';
asm
mov edx, [esp + 4]
push eax
push club
push edx
call eax
test eax, eax
jnz @std
lea eax, [esi+esi*2]
shl eax, 4
mov byte ptr [eax+edi+21h], _Skill_Club
add esp, 8+8+4
push $4551FE
ret
@std:
add esp, 8
end;

procedure FixClubsGeneration;
asm
mov [ebp - 4], _Skill_Club
push $454028
end;

//----- HooksList

var
HooksList: array[1..314] of TRSHookInfo = (
HooksList: array[1..316] of TRSHookInfo = (
(p: $458E18; newp: @KeysHook; t: RShtCall; size: 6), // My keys handler
(p: $463862; old: $450493; backup: @@SaveNamesStd; newp: @SaveNamesHook; t: RShtCall), // Buggy autosave/quicksave filenames localization
(p: $4CD509; t: RShtNop; size: 12), // Fix Save/Load Slots: it resets SaveSlot, SaveScroll
Expand Down Expand Up @@ -3391,6 +3420,8 @@ procedure FixOfAcid;
(p: $437AAD; newp: @FixOfAcid; t: RShtJmp; size: 6), // 'of Acid' was dealing Water damage instead of Body
(p: $40546F; old: $36FF; new: $9057; t: RSht2), // (push edi) Fix monsters using 'Spirit Lash', 'Inferno', 'Prismatic Light'
(p: $463EF0; size: 2), // Intro movies were unskippable on 1st launch
(p: $454F51; newp: @FixClubsGenerationRead; t: RShtCallStore), // Fix clubs being generated as sword 0 instead
(p: $45459C; newp: @FixClubsGeneration; t: RSht4; Querry: hqFixClubsGeneration), // Fix clubs being generated as sword 0 instead
()
);

Expand Down Expand Up @@ -3485,6 +3516,8 @@ procedure ApplyDeferredHooks;
RSApplyHooks(HooksList, hqTrueColor);
if Options.FixMonsterSummon then
RSApplyHooks(HooksList, hqFixMonsterSummon);
if Options.FixClubsGeneration then
RSApplyHooks(HooksList, hqFixClubsGeneration);
ApplyMMDeferredHooks;
end;

Expand Down
11 changes: 11 additions & 0 deletions MMPatches/MM8Patch/MM8patch.dpr
Expand Up @@ -406,6 +406,17 @@ Version 2.5.5:
[-] My bug: Possible corruption when taking an item from character's inventory
[-] My bug: FixChests option got broken by 2.5.4 changes
Version 2.5.6:
(MM6-MM8)
[+] New Evt command 0x45 - RefundChestArtifacts
[-] FixItemDuplicates - Fix items from one map appearing in another when traveling by foot
[-] My bug: DisableHooks option wasn't working for some hooks
[-] My bug: With custom *.games.lod archives incorrect data was written to autosave on New Game start
(MM7, MM8)
[-] My bug: The DirectX 7 bug fix was being applied prematurely, causing a crash on Wine
(MM8)
[-] FixClubsGeneration - Ogres were dropping 1st level sword instead of clubs
Version ?:
Expand Down
Binary file modified MMPatches/MM8Patch/MM8patch.res
Binary file not shown.
7 changes: 5 additions & 2 deletions MMPatches/MM8Patch/RSCodeHook.pas
Expand Up @@ -43,6 +43,8 @@ interface
RShtFunctionStart:
<code at @p> -> jmp @store
(here @std is an allocated code block containing code from @p and jump to p + size)
RShtBeforeJmp6:
jz @std -> jz @store2
RShtCallBefore:
call @std -> call @store2
}
Expand Down Expand Up @@ -199,8 +201,9 @@ procedure RSApplyHook(const Hook: TRSHookInfo);
RShtBeforeJmp6:
begin
p1:= RSAllocCode(10); // p: jnz p1
Jmp(p1, new, true); // call @hook
Jmp(p1 + 5, RSGetHookValue(Hook)); // jmp @std
pbyte(p1)^:= $68; // push @orig
pint(p1+1)^:= RSGetHookValue(Hook);
Jmp(p1 + 5, new); // jmp @hook
pint(p+2)^:= p1 - p - 6;
end;
RShtAfter:
Expand Down

0 comments on commit 0360145

Please sign in to comment.