Bugfixes and Queries

  • Thread starter Thread starter DLPB_
  • Start date Start date
Status
Not open for further replies.
That's awesome but is there any chance to shift the fields down in the 2012/Steam version ?
 
That's awesome but is there any chance to shift the fields down in the 2012/Steam version ?
It uses Aali's driver, so yeah, it's possible.  But it means having to find the correct place in it (pretty easy) - like with Aali's 1998 driver.  It is getting out of hand having to support Reunion for both, though.  Esp since it's possible to just convert.  But for now I'm willing to support both.
 
We'd be far better off if we had Aali's driver source.

This isn't fully tested, but it does look like it works (I assume this is gonna fail somewhere because I can't see why there is a calculation at all, if these values were meant to be 0 and 1 originally :P.  I am testing that.) 

It isn't ideal since the FMV will never work properly with a full screen - and some fields don't have enough data to satisfy the areas where the black bars go. But....

Basically... this is what to do:

Code: [Select]
Code:
{No field borders by DLPB#Extend layer range640C77 = B8 F0 00 00 00640FD4 = B8 F0 00 00 00641397 = B8 F0 00 00 0010045A32 = BB F0 00 00 00#cursorCFF200 = 00 01# Fade in/outCFFAE8 = E0 01#Stop screen resolution being changed to 448 - and force 480 in Aali's driver.This isn't a problem since World map uses 480 regardless.100483C7 = 90 90 90 90 90 901008f178 = E0 01But here's the issue.  These 2 floating point values have to be the following with field:10085534 needs to be set to 0.9333310085554 needs to be set to -0.066667BUT the following with world map:10085534 needs to be set to 110085554 needs to be set to 0So the question is how to get the game to calculate 2 different values depending on WM/FieldMade more annoying by the fact Aali's driver is handling it.
The calculations are probably supposed to be this for field:

448 / 480 = 0.93333

and

-16 / 240 = -0.067

But these are becoming 480 / 480 = 1 at 100484CE

and 0 / 240 = 0 at 10048543.

Actually, the above is EXACTLY how it should be.
 
Last edited:
It seems opcode 28 - KAWAI is broken in PC game.  As a consequence there are a number of errors - including:

1. Treasure chests do not return to the correct colour after collecting them. The shine effect is stupid regardless - to turn it off they set the shine to 2. So that brightens the object - to fix this they then use the same opcode to reset the colour after stopping shine.  This is failing on treasure chests.

  Note that the chest colour change fails, so it stays bright.

2. Materia does not shine correctly.

I can't fix it.

Unless someone out there feels up to the task of reverse engineering that opcode - the best thing to do is to just remove all shine / colour change operations completely.
 
Last edited:
Can I share my frustration here too? This game has been out since 1998 and very very little appears to have been done to fix all these issues. That's a rather sorry indictment of the modding community - that some of this hasnt been tackled at all.  Recently the music lock bug I had to fix for example.  The level of attention this game has and the modders available really should have yielded far more fixes.
 
That's a pretty silly thing to say.  We not under any obligation to fix *anything* in the game. Heck the only reason why the Wiki exists is because I got tired telling everyone to aggregate their findings in one spot.  I decided to make a PDF with everything I could find... Then I put it all in the wiki when Qhimm set it up.

Sisyphus rolls his own boulder.
 
Never said anyone was under any obligation ;)  I said it was a sorry indictment of the modding community - mostly that it seems to have the body but no head.  But I do like the wiki.  Needs more people adding to it really - but it's easier I just place what I know here for time being.  I haven't got the skill to reverse engineer entire graphic based functions.  But what I can do - I will :)

The priority from the beginning should have been to fix the biggest bugs in the game - and a lot of them still remain.  I don't know if the graphic function for field Kawai 28 can be fixed.  If I knew how, I'd certainly try.  But there appears to be no information on its bugs or why it is bugged - for example.
 
Last edited:
As many of you will know, when the Highwind does a sharp turn (while holding Circle), you can see the edge of the sky / cloud texture.  You can even see past the end of the viewable area.  Since the graphics cannot support the sharper turn, the best way to fix this issue is to disable that operation entirely.

To Fix:
74F3B2 = 90 90 90 90 90 90

L1 and R1 can still be used for a full turn and do not affect the background.
 
Last edited:
I just added Otyugh encounter to the Ancient Forest on one of the maps. At first, the game just loaded the pyramids with error message. I knew there was nothing wrong with the code, so it had to be a bug.  Checked Terrence's guide, and it turns out that you should never use a battle chance greater than 31 in the field encounter list. 32-64 are bugged because the signed number is not calculated correctly. You'll get weird effects, like the pyramid battle if you do. 

So if you ever need a battle to have 50% + chance of being seen, use two encounter slots (same battle ID) with maximum value of 31 for each.
 
it turns out that you should never use a battle chance greater than 31 in the field encounter list. 32-64 are bugged because the signed number is not calculated correctly.
There are 5 examples of this glitch occurring in the Vanilla Game. The effect isn't that the battle will play out incorrectly, but rather, the battle check will cease to continue, and every formation placed after the formation with >31 enc rate will be ignored. This is why we will never encounter: (formation IDs are in dec)

mtcrl_4 - #505 2x Cokatolis (Mt. Corel Rollercoaster screen)
mtcrl_9 - #514 1x Bagnadrana (Mt. Corel Bridge)
mtnvl3 - #585 2x Sonic Speed (Mt. Nibel Bridge)
junsbd1 - #762 2x SOLDIER:2nd (Red Submarine Dock past barking dog)
junin2 - #945 2x SOLDIER:2nd (Outside press conference room, during escape).

I have written up on this glitch, along with several other similar glitches within the Bug Report section of my Enemy Formation Charts. Look in Section E - Final Notes, although I believe White Wind may have tracked them all in the bug tracker. It's still worth checking.

In regards to the battle with the pyramids, are you sure that you didn't have encounter "0" set with an encounter rate of >0? I've done it myself in the past, the likely culprit is when editing the four "special battle" slots.

One other thing worth mentioning for those that didn't know, the total encounter rate for all 6 "normal battle" slots must total 64, otherwise the game will just freeze as soon as you try to traverse on it.
 
I don't mean the Otyugh battle, i mean all of the slots which have a battle ID of 0 - does any of them have a probability that isn't 0?
 
you should never use a battle chance greater than 31 in the field encounter list. 32-64 are bugged because the signed number is not calculated correctly. You'll get weird effects, like the pyramid battle if you do. 
I think you can "fix" this by changing 0x60B5FA to EA instead of FA. That changes the signed SAR to the unsigned SHR.
 
I don't mean the Otyugh battle, i mean all of the slots which have a battle ID of 0 - does any of them have a probability that isn't 0?
No.  I only added one battle to a slot further down.  The code was correct. Once I changed it from 32 to 31 (and added 1 elsewhere), the pyramid battle did not show up and Otyugh did.
 
Last edited:
I needed to place "Delete Materia" opcode 5C back into the game.  The function is not there in the PC version. To fix, make Function 61EF43 do the following:

B9 C8 00 00 00 49 8B 1C 8D B4 04 DC 00 39 D8 75 10 C7 04 8D B4 04 DC 00 FF FF FF FF 4A 85 D2 74 04 85 C9 75 E0 C3
Code: [Select]
Code:
0:  b9 c8 00 00 00          mov    ecx,0xc85:  49                      dec    ecx6:  8b 1c 8d b4 04 dc 00    mov    ebx,DWORD PTR [ecx*4+0xdc04b4]d:  39 d8                   cmp    eax,ebxf:  75 10                   jne    0x2111: c7 04 8d b4 04 dc 00    mov    DWORD PTR [ecx*4+0xdc04b4],0xffffffff1c: 4a                      dec    edx1d: 85 d2                   test   edx,edx1f: 74 04                   je     0x2521: 85 c9                   test   ecx,ecx23: 75 e0                   jne    0x525: c3                      ret
You'll need to jump to a new area and add that.

This will check through all materias to see if the AP matches.  If it does, it will then "delete" the materia by making the entry FF FF FF FF.  It will decrease edx (the number of times to delete this materia).
 
Last edited:
Dziugo had a look into the Chocobo minigame, which has a problem. The problem is that Mountain and River chocobos are not behaving correctly for their abilities.

The long map has a water area  - this should slow Yellow (Regular) and Green (Mountain) down.
The short map has a hill to climb (the spiral part) and a hill just before the finish line - this should slow Yellow (Regular) and Blue (River) down.

This is what's really happening:

Yellow (Regular): Being slowed down correctly.
Black (River / Mountain): Being unaffected correctly.
Gold (Ocean): Being unaffected correctly.
Green (Mountain): Being unaffected.  This is incorrect behaviour, as it should be slowed down in the river area.
River: Being slowed down by both areas. This is incorrect behaviour, as it should be slowed down only on hills.

The area that sets the values is 7725E8. For some reason it deducts 1 from the chocobo type value, and then jumps to an area based on this. If the yellow chocobo is chosen, it will deduct 1 from 0 and end up with a massive value, but since the "ja" is unsigned, this is still OK.  It will jump to mov word ptr [eax+00000086],0003.

The values for eax+00000086 are:

0: Black Chocobo, Gold Chocobo [Will not affect speed in either area]
1: Green Chocobo [Will not affect speed in either area]
2: Blue Chocobo [Will affect speed in both areas]
3: Yellow Chocobo [Will affect speed in both areas]

Values of 1 and 2 are not being correctly used at whatever area decides the speed of a chocobo.  I think this *may* be at 774A5C, but I am unsure how it calculates things.

So to recap.  Gold, Black and Yellow are working fine.  Green and Blue are not.  It isn't the values that are wrong (unless 1 and 2 should be some other value) - it's the part that uses these values in hard code.
 
Last edited:
I thought that it worked fine with the changes I sent you? I can't run the game, but it looks like this:

Long map bits:Code: [Select]
Code:
80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80
Short map bits:Code: [Select]
Code:
80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 00 00 00 00 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80
Values are in hex, let's only look at the lowest 2 bits of each byte. From what you say it looks like short map has 0x01 (hill) first and 0x02 (water) after that. Long map has only 0x02 (so water, looks good).

Now, the case is ok, it's just how it works. Values are:
0 (yellow): 0x03 (so 0x01 + 0x02, or more correctly 0x01 | 0x02)
1 (green hills-chocobo): 0x01
2 (blue water-chocobo): 0x02
3 (black water-hills-chocobo): 0x00
4 (gold all-wonders): 0x00
Those are handicap bits - if a bit is set, a chocobo will be affected by terrain with that bit set. We can clearly see, that setting 0x02 (so a water handicap bit) for a water chocobo is a big wtf.

And yes, the speed corrections are at 0x00774A5C, it just does a bitwise AND between chocobo handicap bits and terrain bits. So for a terrain 0x82 (water) and a blue chocobo (0x02) we get 0x02 (affected). Yellow chocobo with 0x03 will also get 0x02 (affected).

If the bit is set, it looks like the speed is reduced by "result / 4" (so 1/4 for hill bit and 2/4 for water bit). So, the fix I proposed was switching 0x01 and 0x02 in that case. If that doesn't work, you gotta debug it, since I can't run FF7 for now.

==========
I take no credit for that, that's based on ergonomy_joe's work.

Also, I looked at that NOPed part of the chocobo fix, it looks like what was missing is a lower right coordinate of some rectangle, but the drawing function disregards it anyway (only using left-top corner and width + height). So a proper fix wouldn't be noticable, I post it anyway.

Before:Code: [Select]
Code:
0076EC29   6BC0 18                    IMUL EAX,EAX,180076EC2C   8B0D F010E700              MOV ECX,DWORD PTR DS:[E710F0]0076EC32   0FBF9401 B8860100          MOVSX EDX,WORD PTR DS:[ECX+EAX+186B8]
After:Code: [Select]
Code:
0076EC29     6BC0 48                  IMUL EAX,EAX,480076EC2C     0FBF90 6CB7E300          MOVSX EDX,WORD PTR DS:[EAX+E3B76C]0076EC33     90                       NOP0076EC34     90                       NOP0076EC35     90                       NOP0076EC36     90                       NOP0076EC37     90                       NOP0076EC38     90                       NOP0076EC39     90                       NOP
Patch:Code: [Select]
Code:
0076EC29: 6B C0 48 0F BF 90 6C B7 E3 00 90 90 90 90 90 90 90
I take no credit for that, that's based on ergonomy_joe's work
 
The problem above is that the actual data on the map is wrong (if you're values above are correct).  Both maps have value 82...  while only one map (long) has water.  So both maps affect the water chocobo.  If you see what I mean? 

I'll edit the map data. That should do it.
 
Last edited:
Now I see it, I misread your post. You really should debug it before attempting any fixes, it might be that the part of the map is disabled or something like that. I never really bothered to check which is a hill and which isn't, just assumed that the map in the file is linear.
 
Status
Not open for further replies.
Back
Top