Author Topic: Bugfixes and Queries  (Read 7610 times)

NFITC1

  • No life
  • *
  • Posts: 2690
  • Karma: 59
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: Bugfixes and Queries
« Reply #75 on: 2017-03-03 20:53:27 »
Ah, cheers for that NFITC! ;)  Very nice.  Why nothing after 1B?  I remember jumps to code exist,  This code doesn't do anything?

Jumps exist and they do things, but they're used by the Wutai event. The actual event driver variable (0xCBF9DC) has a max value of 1C, but is subtracted by 1 when the event is selected. If that subtracted value is greater than 1C it goes to a non-event. In practice, this never happens. Quite strange and I'm not really sure what the point of subtracting by 1 is. It's only ever dynamically assigned in three places: loading a game (including new game), exiting the main menu and changing CDs. That's only to redirect it back to the world map and the field. As a matter of fact, this might be the source of the Yuffie warp glitch. I can't confirm that right now, however.
« Last Edit: 2017-03-03 21:02:40 by NFITC1 »

DLPB

  • No life
  • *
  • Posts: 8237
  • Karma: 222
  • Shoot For Solar Value
    • View Profile
Re: Bugfixes and Queries
« Reply #76 on: 2017-03-03 21:37:51 »
I've seen this subtraction nonsense a lot actually.  I'm thinking it may have been the compiler that did it.  I know that when I look at my own code it often uses fancy tricks like that, usually for efficiency.

DLPB

  • No life
  • *
  • Posts: 8237
  • Karma: 222
  • Shoot For Solar Value
    • View Profile
Re: Bugfixes and Queries
« Reply #77 on: 2017-03-03 21:40:18 »
The warp glitch has been fixed by me actually for my dll.  It's caused by some temp vars not being reset on game over - here:

              {reset field vars to stop teleport bug}
              mov dword ptr [$CFF594],$00
              mov dword ptr [$CFFAB2],$00
              mov dword ptr [$CC0B60],$00
              mov dword ptr [$CFFC60],$00

They were a buttercup to find and I had to use some nifty comparison trickery to isolate them.

3 of these contain addresses.  If they aren't cleared on game over, then reloading to world map will not clear them either.  After world map battle, it will use these to attempt to jump back to field. When cleared, the behaviour changes and will be correct. As far as I can see, these addresses are used for a simply "jump back to previous field" operation.  And, as I noted, they take precedence over other jump field operations.

Other addresses need to be cleared to stop other bugs.  For example, countdown timer being visible in world map battle after reloading game.  World map / game over / load  do not reset any of the vars.  Only entering a field will. I've added these fixes too.
« Last Edit: 2017-03-03 21:46:00 by DLPB »

DLPB

  • No life
  • *
  • Posts: 8237
  • Karma: 222
  • Shoot For Solar Value
    • View Profile
Re: Bugfixes and Queries
« Reply #78 on: 2017-03-06 00:25:10 »
credit screen fix is going well, but I will have to hold off until I have got the original text in place from psx... since a lot of this is a manual changes to the table.

Anyway, here is how it works.  Each text uses 16 bytes.  Four texts to a corner means 64 bytes per fix. And, since there are 29 corners needing repair, that is 29 * 64 bytes in total (1856).
 

99B5E8 = C2 01 00 00 08 00 00 00 80 FF FF FF 08 00 00 00
99B5F8 = 02 01 00 00 00 00 00 00 03 01 00 00 00 00 00 00
99B608 = BB 00 00 00 94 FF FF FF BB 00 00 00 50 01 00 00
99B618 = 00 00 00 00 28 00 00 00 00 00 00 00 29 00 00 00


Red:  Starting X of white text1 and black text 1
Orange:  Ending X of white text1 and black text 1
Blue: Fixed Y of white text 1 and black text 1

Green: Starting Y of White text 2 and black text 2
Brown: Ending Y of white text 2 and black text 2
Purple: Fixed X of white text 2 and black text 2

When in the top right, black text 1 X pos dictates the timing. In this case, 80 FF FF FF (minus 127).

*** These are unused above as top right calculations do not need them.  Two of the corners use these values, while discarding 4 others.
Yellow:  Fixed X of of white text 1 and black text 1
Pink: Fixed Y of white text 2 and black text 2

In order to get the top right working properly, part of the calculation phase also needs amendment:

7A53FB = 90 90
7A554B = 90 90

Another 6 of these will be nopped to fix the other 3 corners.
« Last Edit: 2017-03-06 00:39:58 by DLPB »

DLPB

  • No life
  • *
  • Posts: 8237
  • Karma: 222
  • Shoot For Solar Value
    • View Profile
Re: Bugfixes and Queries
« Reply #79 on: 2017-03-06 21:10:55 »
NFITC1.  Why does the World Map not use the main jump at 40919E when calling the menu.  Everything else seems to use this no matter what.
« Last Edit: 2017-03-06 21:12:51 by DLPB »

NFITC1

  • No life
  • *
  • Posts: 2690
  • Karma: 59
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: Bugfixes and Queries
« Reply #80 on: 2017-03-06 23:04:35 »
It's a memory thing. If it changed modules it would have to unload itself before loading the menu THEN it would have to reload when the menu ends. That's too slow for the PSX (I guess) so the WM module sets the menu handlers and calls them itself at the bottom of its draw method.

DLPB

  • No life
  • *
  • Posts: 8237
  • Karma: 222
  • Shoot For Solar Value
    • View Profile
Re: Bugfixes and Queries
« Reply #81 on: 2017-03-06 23:08:16 »
But it doesn't have any problem doing it from field?  It uses less memory than the WM?

NFITC1

  • No life
  • *
  • Posts: 2690
  • Karma: 59
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: Bugfixes and Queries
« Reply #82 on: 2017-03-07 13:13:01 »
That'd be my guess. If you destroy the WM you'd have to destroy it and recreate it each time you'd use the menu. That's a long enough task when transitioning to/from a field. I'd imagine the team wanted menu use to be less of a hassle and just made an internal menu event.

DLPB

  • No life
  • *
  • Posts: 8237
  • Karma: 222
  • Shoot For Solar Value
    • View Profile
Re: Bugfixes and Queries
« Reply #83 on: 2017-03-07 17:42:37 »
Why didn't they just overlay the menu on top for field?  Surely that could have been done since the menu is next to no memory?  Or perhaps because people worked on different modules, they just didn't have time to make that idea fly.

n other news, I managed to create a way to jump to any module instantly.  I am using it to jump back to the credit screen with a master reset.  Aali's driver is interfering with screen height / width (it uses field version, which I've altered), but it's fixable.  Master reset seems to work fine.

It's initiated by certain addresses being placed at certain addresses.  It then uses

CC0D84 = 26
CBF9DC = 27

To decide what to do.  The above is "Jump to Credit screen".  CBF9DC is the main identifier.

« Last Edit: 2017-03-07 21:18:08 by DLPB »

Sega Chief

  • No life
  • *
  • Posts: 2192
  • Karma: 130
  • These guys is sick
    • View Profile
Re: Bugfixes and Queries
« Reply #84 on: 2017-03-10 16:02:40 »
Sorry to butt in; I searched the bug tracker database for bugin1c but couldn't see this issue there.

I'm trying to fix the problems in the Observatory scene; I've got the character placements done using offset object, but the sound is a problem. There's supposed to be 4 sound effects played in tandem using AKAO 35 but only the fourth one plays. After some testing, I found that other sound effects will behave correctly with this and play all at once but these four won't.

AKAO: 35? (param1=64, param2=110, param3=111, param4=112, param5=113)

So it seems to be something to do with these particular sound files themselves and how they're handled. I saw in Dan's notes that there's code to determine if sound files loop or not, is there maybe some kind of override that might be causing these sounds to not play together?

DLPB

  • No life
  • *
  • Posts: 8237
  • Karma: 222
  • Shoot For Solar Value
    • View Profile
Re: Bugfixes and Queries
« Reply #85 on: 2017-03-11 10:55:19 »
It could also be broken in original pc / aali's driver.  Since you have to remember field script is only script... it's the sound functions that do the work.  And they are definitely broken in some areas.  You'll likely find that my dll fixes the issue you have.  There is a condition to allow up to 4 sounds to play together using AKAO function.  I didn't know that field did it, but battle does - some Summons use 3 sound effects together.

The bugin visual bug is known and has been fixed with Reunion by Spy__Dragon. But this is the first time I have heard of the sound issue.

I should note, actually:  Aali doesn't do anything with the sound effects that I've seen.  So all the original errors with PC version are there.  With music, he took over the midi functions - but, by that time, the music is already broken. Which is why certain functions like tempo, fade do not work properly.  I've rewritten akao and other sound functions from scratch and fed them to bass.dll.  This fixes all the issues.
« Last Edit: 2017-03-11 11:03:33 by DLPB »

Sega Chief

  • No life
  • *
  • Posts: 2192
  • Karma: 130
  • These guys is sick
    • View Profile
Re: Bugfixes and Queries
« Reply #86 on: 2017-03-11 12:29:55 »
I'll check out your bass.dll; thanks for the info.

DLPB

  • No life
  • *
  • Posts: 8237
  • Karma: 222
  • Shoot For Solar Value
    • View Profile
Re: Bugfixes and Queries
« Reply #87 on: 2017-03-11 13:00:54 »
It isn't released yet.  Soon :)  bass.dll allows for dsound operation and isn't made by me.  My dll project is called ff7ddraw / ff8ddraw.  But obviously that will go in the game root as ddraw.dll.  Same thing for FF8.

DLPB

  • No life
  • *
  • Posts: 8237
  • Karma: 222
  • Shoot For Solar Value
    • View Profile
Re: Bugfixes and Queries
« Reply #88 on: 2017-03-18 10:22:37 »
Updated akao documentation.  This should be 100% correct now.

http://wiki.qhimm.com/view/FF7/Field/Script/Opcodes/F2_AKAO

Notes:

PC specific problems:

1. All tempo functions do not exist in original PC version. Steam added operation 0xD0 back in, but it does not have pitch correction.
2. Operation 0x30 cannot be stopped by using an effect on channel 4 like it should. 0x30 is supposed to work on channel 4.
3. Operation 0x20 to 0x23 are apparently broken.
4. Operation 0xC2 does not exist.

I have fixed these issues with my dll.

PSX issues:

Operation 0x10/0x14 and 0x18/0x19 do not seem to work. I think they have been intentionally disabled to force script programmers into using Opcode 0xF0 : http://wiki.qhimm.com/view/FF7/Field/Script/Opcodes/F0_MUSIC

No such limitation exists on the PC version. F0 calls akao Operation 0x10 anyway, so I am not sure why akao operation 0x10/14 has been disabled on the PSX version. Perhaps the design team wanted to keep it consistent.

It may also be that I don't understand how the PSX version handles music. 
« Last Edit: 2017-03-18 10:40:35 by DLPB »

halkun

  • Global moderator
  • No life
  • *
  • Posts: 2104
  • Karma: 20
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Re: Bugfixes and Queries
« Reply #89 on: 2017-03-18 23:50:34 »
PC port used an older version of the source. They didn't have very good versioning control software back then, unless you count backup tapes.