Author Topic: Bugfixes and Queries  (Read 55571 times)

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Bugfixes and Queries
« Reply #50 on: 2016-08-04 20:59:19 »
Nah, definitely not.  It was set to above 31 with correct ID.

DynamixDJ

  • *
  • Posts: 240
  • 1111 1111 0111
    • View Profile
Re: Bugfixes and Queries
« Reply #51 on: 2016-08-04 21:16:55 »
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?

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: Bugfixes and Queries
« Reply #52 on: 2016-08-04 21:55:03 »
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.

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Bugfixes and Queries
« Reply #53 on: 2016-08-06 13:48:15 »
Ah, thanks for that!

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Bugfixes and Queries
« Reply #54 on: 2016-08-06 22:09:37 »
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 Edit: 2016-08-06 22:11:18 by DLPB »

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Bugfixes and Queries
« Reply #55 on: 2016-08-25 03:56:11 »
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:

Quote
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]
0:  b9 c8 00 00 00          mov    ecx,0xc8
5:  49                      dec    ecx
6:  8b 1c 8d b4 04 dc 00    mov    ebx,DWORD PTR [ecx*4+0xdc04b4]
d:  39 d8                   cmp    eax,ebx
f:  75 10                   jne    0x21
11: c7 04 8d b4 04 dc 00    mov    DWORD PTR [ecx*4+0xdc04b4],0xffffffff
1c: 4a                      dec    edx
1d: 85 d2                   test   edx,edx
1f: 74 04                   je     0x25
21: 85 c9                   test   ecx,ecx
23: 75 e0                   jne    0x5
25: 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 Edit: 2016-08-25 21:30:14 by DLPB »

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Bugfixes and Queries
« Reply #56 on: 2016-09-06 03:10:05 »
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 Edit: 2016-09-06 03:17:38 by DLPB »

dziugo

  • *
  • Posts: 1470
    • View Profile
    • A new copy of FF7 thanks to Salk. Pack (zip/rar/etc) your saved game before sending it to me.
Re: Bugfixes and Queries
« Reply #57 on: 2016-09-06 09:20:04 »
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]
80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 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]
80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 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]
0076EC29   6BC0 18                    IMUL EAX,EAX,18
0076EC2C   8B0D F010E700              MOV ECX,DWORD PTR DS:[E710F0]
0076EC32   0FBF9401 B8860100          MOVSX EDX,WORD PTR DS:[ECX+EAX+186B8]
After:
Code: [Select]
0076EC29     6BC0 48                  IMUL EAX,EAX,48
0076EC2C     0FBF90 6CB7E300          MOVSX EDX,WORD PTR DS:[EAX+E3B76C]
0076EC33     90                       NOP
0076EC34     90                       NOP
0076EC35     90                       NOP
0076EC36     90                       NOP
0076EC37     90                       NOP
0076EC38     90                       NOP
0076EC39     90                       NOP

Patch:
Code: [Select]
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

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Bugfixes and Queries
« Reply #58 on: 2016-09-06 15:55:19 »
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 Edit: 2016-09-06 16:04:54 by DLPB »

dziugo

  • *
  • Posts: 1470
    • View Profile
    • A new copy of FF7 thanks to Salk. Pack (zip/rar/etc) your saved game before sending it to me.
Re: Bugfixes and Queries
« Reply #59 on: 2016-09-06 16:20:37 »
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.

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Bugfixes and Queries
« Reply #60 on: 2016-09-07 02:36:31 »
The issue is entirely the actual data.  Starting 326D in chocobo.wat (found on chocobo.lgp), the list of values with 82 should be 81. If your list above is right, it seems that there is also a sequence of 00 as opposed to 80.  Which is a bit strange?

Hmm and I think all those 01s at the start of the short map should be 02s (to stop river but not mountain)

It depends whether that "outer space" part at the end of short course is meant to stop river but not mountain. It isnt a water area...  so I'd have to go hill.
« Last Edit: 2016-09-07 06:07:37 by DLPB »

dziugo

  • *
  • Posts: 1470
    • View Profile
    • A new copy of FF7 thanks to Salk. Pack (zip/rar/etc) your saved game before sending it to me.
Re: Bugfixes and Queries
« Reply #61 on: 2016-09-07 07:43:27 »
It depends whether that "outer space" part at the end of short course is meant to stop river but not mountain. It isnt a water area...  so I'd have to go hill.
Well, if you're into map editing then you should just disable handicap bits for that part, as it's neither water nor uphill (as downhills are in the other part of both tracks and they don't slow chocobos down).

Second thought: Actually, if you think of it - water chocobos are able to cross rivers and shallow waters, so places with no solid ground. It might be that the space was supposed to be that "not-that-solid" ground.

Third thought: How the chocobos behave on PSX? The maps were probably converted from some other format, there might be a difference.

Oh, and the highest bit (0x80) is supposed to mark some places on the map, as it's checked in the code, but dunno what. It's not connected with 0x01 & 0x02 though, so just don't change that bit and you should be fine.

Kaldarasha

  • *
  • Posts: 2449
  • Prince of Model Editing
    • View Profile
Re: Bugfixes and Queries
« Reply #62 on: 2016-09-07 09:43:03 »
I would say that the space area is meant for the black and golden Chocobo.

dziugo

  • *
  • Posts: 1470
    • View Profile
    • A new copy of FF7 thanks to Salk. Pack (zip/rar/etc) your saved game before sending it to me.
Re: Bugfixes and Queries
« Reply #63 on: 2016-09-07 12:09:24 »
That's an interesting idea. Technically, if the slowing down would be done the way it is done now, given one blue and one green chocobo, one would be slowed down by 25% (the one affected by 0x01 bit) and the other by 50% (the one affected by 0x02 bit). Yellow chocobos would be slowed down by 75%.

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Bugfixes and Queries
« Reply #64 on: 2016-09-09 05:28:37 »
The psx data does appear to be different.  I don't think the "chocobo.dat" file is compressed - and its contents bear no resemblance to "chocobo.wat". I'd have to look at the PSX game and see if they fixed this error there already.

White Wind

  • *
  • Posts: 206
    • View Profile
Re: Bugfixes and Queries
« Reply #65 on: 2016-09-10 02:21:50 »
I had the same thought for a moment, technically  space is not water, and maybe space was meant to favour Blacks and Golds only, or even just Golds only.
Like:
Blue's strength: Water..  Green's: Hills..  Black's: Water and Hills..  Gold: Water, Hills and Space.

Green is already a better choice than Blue overall for racing (more hills than water), and with space not being water, it'll be even more true.

So what will this mean from a player's pov..
Do I choose the short course? Nope, I have no Gold Chocobo yet. So, the long course where we have water.. but more hills than water..
So we'll end up always choosing the long course with a Green Chocobo. Then later, always the long course with a Black.
Then bingo I've got my Gold, it's finally become a thing to choose the short course.

I'm not saying it's especially a bad thing.
The only thing I find meh, is to unbalance even more Green/Blue, but the unbalance has more to do with both tracks being often hilly, and that's the original game.

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Bugfixes and Queries
« Reply #66 on: 2016-09-10 02:50:14 »
I'd disagree with space for gold only because the black chocobo ridden by Joe is meant to be difficult to beat across all classes - and that would kill the competition. I'd say short is meant to be harder since you are being lazy.

White Wind

  • *
  • Posts: 206
    • View Profile
Re: Bugfixes and Queries
« Reply #67 on: 2016-09-10 05:30:54 »
I agree.
Here's what I come up with. It's balanced.
Each number represents the %age of handicap. For the best, we can assume that the handicap from a big hill = from water = from space (the only change is which colour(s) will be unaffected).

small Hill         Gold&Black:0   Green:0   Blue:25  others:25
big Hill            Gold&Black:0   Green:0   Blue:50  others:50
Water              Gold&Black:0   Green:50  Blue:0   others:50
Water+smallH  Gold&Black:0   Green:50  Blue:25  others:75
Space              Gold&Black:0   Green:50  Blue:50  others:50
Space+smallH  Gold&Black:0   Green:50  Blue:75  others:75


Big hills are the ones like in the spiral, in opposition to the slighter slopes.

Kaldarasha

  • *
  • Posts: 2449
  • Prince of Model Editing
    • View Profile
Re: Bugfixes and Queries
« Reply #68 on: 2017-01-03 05:23:28 »
I encountered an odd bug. When you have to sleep in Aerith house and are out to leave, but think “Hey, why not move before her door and do some run action? :-D” (and do this of course) Aerith will come out and surround you like a bee a flower, endlessly. I guess I blocked her point with Cloud. The script needs an alternative point if it is blocked.

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Bugfixes and Queries
« Reply #69 on: 2017-01-03 10:23:40 »
That was fixed, I think.  I'll recheck when I get time.

« Last Edit: 2017-02-16 14:06:27 by DLPB »

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Bugfixes and Queries
« Reply #70 on: 2017-02-16 14:06:31 »
I am working on fixing quite a few things (for example Game Over and Credits are being limited to 60fps), but first I needed to document the module calls. I've got everything I need now, but I guess I should share...

Code: [Select]
Modules  Main Jump at 40919E
ebp-10 Main loop
ebp-C Mouse
ebp-8 keyboard
ebp-18 Enter
ebp-14 (?)
ModuleEnterAddress Enter call at 666CDA
ModuleMainAddress  Main call at 67DD8A

              ENTER     MAIN LOOP
NA MAIN       408FA6    NA
00 FIELD      60E0BD    60E5B7
01 BATTLE     41B300    41BAB3
02 WORLD      74BAF5    74BE49
03 NOT USED
04 MENU       6CD3B0    6CC623
05 G-BIKE     650310    650412
06 CHOCOBO    76D597    76DBD1
07
08
09 SUB        77D030    77DF72
0A COASTER    5E8D49    5E8E7E
0B
0C
0D SNOWBOARD  722C10    722CCF
0E NOT USED
0F
10 BAT MENU   See 04    See 04
11 NOT USED
12
13 TITLE SCR  See 04    See 04
14
15 NEW GAME   See 00    See 00
16 SWIRL      40164E    4021E9
17 NOT USED
18
19 GAME OVER  406367    4064D7
1A CREDITS    7A776F    7A7A33
1B
1C
1E
1F
20 Same as 1F
21 Same as 1F
22
23
24
25
}
« Last Edit: 2017-02-20 14:01:37 by DLPB »

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Bugfixes and Queries
« Reply #71 on: 2017-02-19 14:29:52 »
The "teleport bug" is fixed.  I am not sure why exactly these bytes need to be reset to 0 - but they do.  If they aren't the game is instructed (after a world map battle + jump to a field flag) to jump back to the previous field that is still in memory. Once these bytes are zeroed, the bug will go away.

More fixes made:

1. Sound effects are also terminated on battle game over.
2. field and battle vars that need zeroing to prevent issues are now zeroed (these include teleport bug, countdown timer in world map battles bug, and others).
« Last Edit: 2017-02-20 11:32:23 by DLPB »

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Bugfixes and Queries
« Reply #72 on: 2017-03-03 18:20:27 »
I am currently fixing up the credit screen to look like it did on the PSX.  Here are the differences:

1. Programming error on the part of the porting team. Text is traversing a distance 2x what it should be (because it's starting position is outside of 2 screen widths instead of 1). That's why there is a huge pause between each credit. Each text has its own starting X / Y and other data, which is part of a large table.

2. PSX black text is faster than the white text, but in the PC version, both texts are the same speed. This may explain 1. I can;t be sure yet, but perhaps the reason 1 is the way it is is because the black text, now running at same speed as the white, has been corrected to move 2x the distance so the timing works.  I will check.

3. Text size is wrong.  PSX appears to the eye to be 2x larger. This is because the text is being displayed at 320 * 240.  This may prove to be a real pain in the arse to correct - and if I do, a lot of the table data will  need correcting also to start the text X ending pos to be further left (or text will be chopped).

I really shouldn't give a shit about the credit screen, but it's been annoying me for years.
« Last Edit: 2017-03-03 18:23:38 by DLPB »

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: Bugfixes and Queries
« Reply #73 on: 2017-03-03 18:51:55 »
I've added a few that I have documented:

Code: [Select]
ENTER     MAIN LOOP
NA MAIN       408FA6    NA
00 FIELD      60E0BD    60E5B7
01 BATTLE     41B300    41BAB3
02 WORLD      74BAF5    74BE49
03 NOT USED
04 MENU       6CD3B0    6CC623
05 G-BIKE     650310    650412
06 CHOCOBO    76D597    76DBD1
07 same as 0D
08 CONDOR     5F47B5    5F4A47
09 SUB        77D030    77DF72
0A COASTER    5E8D49    5E8E7E
0B CDCHANGE   404688    4047F6
0C WUTAI        N/A       N/A
0D SNOWBOARD  722C10    722CCF
0E NOT USED
0F Force battle? N/A       N/A
10 BAT MENU   See 04    See 04
11 NOT USED
12 End_Game    N/A       N/A
13 TITLE SCR  See 04    See 04
14 Load Game   N/A       N/A
15 NEW GAME   See 00    See 00
16 SWIRL      40164E    4021E9
17 NOT USED
18 Play Ending Movie
19 GAME OVER  406367    4064D7
1A OPCREDITS  7A776F    7A7A33
1B ENDCREDITS 7A776F    7A7A33
}

Past these values are nothing.

The Wutai event apparently has several sub events related to materia including:
-Stealing materia at the beginning of the quest
-Returning materia at the end of the quest
-Granting master materia
-Granting bahamut zero
« Last Edit: 2017-03-03 18:56:28 by NFITC1 »

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Bugfixes and Queries
« Reply #74 on: 2017-03-03 19:11:51 »
Ah, cheers for that NFITC! ;)  Very nice.  Why nothing after 1B?  I remember jumps to code exist,  This code doesn't do anything?

Also, I've worked out where the porting team's mistake was. They assumed the bl;ack and white text was the same speed.  When they came to port the game, they couldn't make the timing work because they were under this assumption. To compensate for their own mistake, they made the black text travserse 2x the distance.  What they really needed to do was half the speed of white text.

As I have here:

Code: [Select]
99C57C = 02
99C58C = 02
99C538 = FE
99C540 = 02
99C548 = 02
99C550 = FE
99C584 = FE
99C594 = FE

I now have to alter all black text starting X / Y pos - so the timing again works.  Some white text pos will also need fixing.
« Last Edit: 2017-03-03 19:22:17 by DLPB »