Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - DLPB

Pages: [1] 2 3 ... 6
Audio Mods / Automatic Loop Point Detection
« on: 2017-04-16 03:54:28 »
I've been killing myself for nothing. Learn from my mistake.

This can find the loop point usually to a perfect sample (the search will take time - but it's worth the wait). I am using it to find loop points for sound effects that are too tricky to do by ear and eye.

Edit.  Hmm then again, it's still not great with music.  Still, it can be used as a guide.

Completely unrelated / Megaman Music Fans?
« on: 2017-04-02 14:30:47 »
Well, Megaman 3 haha.  I think that was the best of all - certainly music wise. It's uncanny how well 8 bit game music works on piano.


Intro again

Snake Man

Proto Man

Spark Man

Wiley Stage 2

Top Man

Magnet Man

Orchestra MM1-3.

I know I can cheat using something like dxwnd, but I want to do this properly.  I have spent a lot of time looking at the apis (like destroy / createwindow, which aali seems to use), setwindowpos, setwindowlong... you name it. But I clearly have no idea what I am doing. It's like the blind leading the blind.

The game starts full screen and I have no idea how to make the game work in a window. Aali's driver seems to destroy the initial window, and recreate it - but it's not as simple as that, since that alone just leaves a black window. So how is it done?

If anyone can help, then please do.  Set ff7config to software mode (using nvidia tnt seems to work ok for me) or hardware nvidia tnt - and have a look at 6786bf.

Yeah, I don't use it - and I disabled it.  But, still, a huge file remained on Drive C.  I didn't know about it until I decided to look at hidden system files.

So, if you want to save some GB of space...

powercfg -h off

Use that inside the command window (cmd).

Scripting and Reverse Engineering / [FF7] FF7ddraw - WIP
« on: 2016-12-20 08:34:11 »
WIP. See latest post.

I will add to this if I do more work on it.  Suffice to say, this stuff is really irritating. As I mentioned before, the code is a joke.  You have numerous functions doing mostly the same thing - calling one another after numerous checks to decide everything from loops to which channel to dump the effect on.  The field module does this by script, which is fair enough, but the battle module doesn't have a set standard.  Take a look at the following paths that the processor took to initiate a sound effect from dsound:

Path for enemy attack (just one I chose at random)
call 005BFFF3 
call 00745606
call 00745160
call 0074A795

Path for menu cursor (menu outside of battle also)
call 0074580A
call 00745160
call 0074A795

Path for Summon effects
call 005BFFF3
call 00749404
call 00748D69
call 0074A795

path for disappearing characters
call 00748F8F
call 0074A795

As you can see, this isn't a case of a sane, or rational, or well coded function. It's a giant mess. Some effects, like the sound used when characters disappear before a Summon, use a dedicated function, like 00748F8F. This function is ONLY called for this ONE effect.  Despite the fact they could have just used 00745160 - or any other function that eventually calls 0074A795. And there's the first problem.  Even if you do hijack the functions that do most of the work:   005BFFF3  and 0074580A , you are still left with these oddities.  There are others out there too.

It's like the programmers lost track entirely of what was going on. There is a ton of duplicate checking code.

005BFFF3: This has 3 parameters.

1: Pushes identification to decide how to proceed.
Code: [Select]
21 to 23: Calls 00749404
24 to 27: call 745606 and let it decide the channel.
28:Channel 1, call 745160
29:Channel 2, call 745160
30:Channel 3, call 745160
31:Channel 4, call 745160
Else call 745606 and let's it decide the channel.

Yeah, you aren't going to believe how these silly ID numbers come into being either.  They seem to be plucked from someone's brown end. When the function is called, it deducts 21 from the ID.  So if the value is less than 21, you get 20 - 21 = -1 (sigh which is then seen as HIGHER than 10 using a "Ja" - so it ends up calling 745606. It also has a silly table to decide the jump positions and even that isn't logical.  I have solved this above (as you can see).

2. L/R Balance of the sound effect (where 00 is left, 64 is centre and 127 is right).

3. Effect ID (0-750, but some of these don't even exist past a certain number). Note that a check is done in numerous functions to make sure that the range is correct.

So as you can see, 005BFFF3 doesn't know what to do until the programmer tells it. It is sent a balance value and the effect to play, but what path it takes from there depends on the stupid ID it is given.

0074580A: Haven't really gone into this one much but it ultimately ends up either playing the effect with centred panning on channel 5 (4) using 745160, or it calls 00745CF3 with the effect ID and does another raft of checking.  It's bizarre.

Then we have akao/akao2 from field script.  At least we know exactly how this works and it is guaranteed that one of these is going to be called in order to play an effect from the field.  So, unlike battle, you aren't running around trying to disassemble the universe. The field code effects probably won't take me long to code.  But the battle side of things is tougher if we want  to completely replace the original engine. Unless someone can shed some light on how call 0074A795 actually uses all the data it is given to produce the effect using dsound.

But even then it may still need multiple changes elsewhere.

I am not going to go into this in any detail. Firstly, because I haven't myself that much; secondly, because it's boring. But a no-frills explanation is this:

There are numerous and chaotic functions that make the simplest idea the most convoluted. Functions calling functions where, if proper communication, time, and better coding had been deployed, much of the bloat would not exist.  But, hey ho... that's where we are. I'd love to tell you that one function takes in a few parameters and then just works with them... but no. Some effects, like the Summon effects use a completely different function to set audio compared to the field version. And there are others.  In fact, I think it's even possible to call the main function (74A795)  directly, which I am sure a few areas do. 

But let's keep it simple.  The field module, as some will know, uses akao and akao2. The difference between these is that akao is 8 bit and akao2 is 16 bit.  These field functions then call another function... which passes on to another function (745160).

Most normal menu and field effects use 745160 eventually. I haven't checked if any of the other functions do this, but 745160 does:

All audio effects have an associated record of 28 bytes. I don't know what all of them do, but the only thing I needed to know was - how does the game know when to loop sounds and when to play once?

In code you can see at 7452EA, the "does this sound effect loop" flag (where 00 = no).

To work out where in memory the "loop flag" for each effect is, you just do this:

( (EffectID - 1) * 1C) + 00DE0E8C.  For example, the cursor ID is 01, so:

( (1 - 1) * 1C) +  00DE0E8C = 00DE0E8C :P  [Well, it's the first effect and the minus above makes it 0].

So look at 00DE0E8C and set it to 01. You should then get a looping cursor.

And that's how it's done.


The mov eax,[edx+00DE0E9C] at 745479 is actually retrieving an address for sample rate for the effect.  In this case, 44100.


Watch this first.

Americans have a choice. The choice is between a successful businessman who says what he thinks - however politically incorrect - and genuinely wants to end corruption, or a family who have lied, and cheated, and broken the law all their lives. It really is that simple.

Hillary is back under investigation by the FBI for her flagrant disregard for even the most basic of security laws. Hillary lied about a 12 year old rape victim, claiming that she was a fantasist who pursued older men. Hillary did this knowing the victim was in a coma for 5 days, and knowing the accused was guilty. She has even lied about her whereabouts on 9/11, claiming she was in New York. Her campaign knew about - and orchestrated - riots at Trump rallies. The list of laws she has broken is incredible—and she is running to be your leader.

So what will you get from her, other than lies and corruption?  Well, she thinks Merkel is a genius and wants to ape her European model. This means that you can forget your borders. She wants to grant amnesty for illegal immigrants (because they will then vote Dem), and citizenship for Syrians, knowing full well they can't be properly vetted (because they will then vote Dem). She won't be held accountable personally when one of them kills or destroys. France, Germany, Belgium, and Sweden have all paid a heavy price for the retarded leftist agenda.

Fine. Trump said some naughty things.  Boo hoo.  Hillary and the left have DONE some truly awful things.  Trump didn't need to run for president - and he isn't blackmailed by people offering money, like Hillary.  If you want to join Europe as a failing, dying, Islamic hell-hole... VOTE HILLARY.  If Not... and you have any sanity... VOTE TRUMP.

This election is more significant than most because two or more Supreme Court judges need replacing. Trump has already made his choice for who will replace them, and they are a sane choice. They will uphold the constitution. Hillary will stack the deck with far left judges who will implement her crazy Leftie dream. Ask Germany how things are working out.

A message I sent to someone else:


Hillary and her camp:
Mexicans are "Taco Bowls"
Bernie Sanders voters are "Basement dwellers".
Trump supporters are "Deplorables".
Women Bill abused are "Bimbos / Trailer trash"
Black people are "Super predators"
Latinos are "Needy"
Catholics are "Severely backwards" [notice no mention of that other protected religion anywhere]
Child rapist's victim is an attention seeker who sought out older men.
Laughs at getting child rapist off the hook and knowing he was guilty.
Deleted 33,000 emails and broke one of the country's most serious laws.
says that Breibart has "no right to exist" and that she will shut the website down.
"We came, we saw, he died"  Laughing her head off like a little child over a murder and over an extremely serious matter.
Wrecked Libya
Wrecked Syria and is now trying to start a war with Russia.
Repeated lies.

Yeah, how could we ever vote for Trump?

I am trying to add a new field to flevel and jump to it in the game.  I've successfully added it (edited maplist too), but when I try to jump to it, the game crashes. Clearly there seems to be something going on in the exe too - but so far I can't find anything.  Actually, I had to disable one part that defaults to chocobo farm if the ID is 787 (the newly added script). Unless there is something more at work here.

Completely unrelated / Random Old Topic. Very funny.
« on: 2016-09-29 03:25:18 »

I sometimes check out the online users of this forum, and it never ceases to amaze me what topics are being read. Maybe most of the guest users are just bots or something, but some of this strawberries is hilarious.  This one is probably the best one I've seen.   :-D

The Butcher hates Chocobos, and will chop them up whenever he sees them. Take him to the Chocobo farm, it's pretty funny!

Hahaha!  I never even heard of all these whacky rumours. This guy dealt with it using humour :)

It's only a matter of time before I end up smacking my monitor, so please help me not do that.  Here's the issue - some games (FF7 Steam, and FF8 original and Steam, and I think EPSXE emulator too) show "Not responding" for very brief and random(?) intervals. When this happens, the game window jumps a bit or flashes. It seems to happen on FF7 and 8 a whole lot more when the window is not in focus.  I am not sure if this happens in full screen mode.

I've tried different graphic card drivers. This is a very good system using i7 processor and GTX760. Perhaps this is some silly bios setting for the CPU? Because that's all I can narrow it down to.  I do not have an antivirus software installed - and this issue happens from a Fresh Windows installation. I am using Win 7.

New Frame Limiters

Download L02 HERE
Donate HERE

The Reunion comes with new frame limiters and 60FPS Battles. Since some people do not want to install The Reunion, I have generously (:-P) branched these modifications off into this installer.

This mod should fix the frame limiter on the following modules: Menu, Battle, Field, World, Chocobo Races Minigame, Fort Condor Minigame, Submarine Minigame.

You can speed up the game (up to 8x) by holding Select and pressing R2, or slow it down by holding Select and pressing R1. If VSync is enabled, the upper-limit will be your monitor refresh rate (60 for most people). The maximum speed will also be dependent on the performance of your computer.

FMVs can be skipped by holding Select and pressing Start. Please be aware that skipping a small number of FMVs will cause the game to hang. So be careful.

Finally, Game Over can be forced from a battle or from a field by holding L1, L2, R1, R2, Select, and Start.

To find out which key or control is linked to the above, see the game's Config menu.

This mod will also make any timers that were previously based on Windows internal timer (using TimeGetTime / GetTickCount) frame-based. These are: Countdown/Up Timer, Main Game Timer, Submarine Timer. This means that timers are now accurate to what is happening on-screen, which is fair. Originally, any slowdown of the game would not affect the timers. The Snowboard Minigame's timer is still time-based and is only modified in The Reunion (R05+).

Additionally, the pause function on all modules now properly halts the Main Game Timer. 

Finally, I have also included the 60fps Battles mod in this installer as an option.

Please see the "Limiters - Help.rtf" file for more information.

OK - so here's the issue. As most us know by now, FF7 is a glorious mess. Glorious in the literal meaning, because it is obviously a great game, but a mess because you can clearly see how slap dash it was all thrown together. It reminds me of the first programs I wrote - where I just heaped on code to fix crap code - and kept coming up with workarounds because I was too lazy, or too far down the rabbit hole, or wanted it done and dusted.

FF7's engine suffers with this all over the place. One such place is the ridiculous specialist menu opcode in the field module. It's where the programmers realized "strawberries... our engine doesn't support that - Let's just add another operation to fix it. We'll shoehorn it into the Menu function."  When, really, the game should have been thought out in advance, so that no slap dash fix was even needed.

That brings me to the field 'bugin1b', where mastered materia can be fused into a Master Command, Master Magic, or Master Summon. One operation checks whether the relevant materias are present and mastered - and if this check is successful, the next adds a Master materia and removes the mastered materias that were 'fused'.  The problem is, this function tries to add the Master materia BEFORE removing the mastered materias that were fused.  So, if your inventory is full, you will lose all your individual mastered materias and gain absolutely nothing for it.  Clearly a huge oversight.

How to fix?  That's why I am here. One operation that exists is "amount of materia".  I haven't checked if this is working, but if it is, then it should be possible to manually check for each materia.  This would be a bit annoying and time consuming.

The other operation seems to be broken.  I first add a materia (let's say MP plus) to see if the inventory is full.  If it is, the materia is not added and I don't proceed.  But if it isn't, the first thing that is done is to remove an MP Plus.  Sadly, this operation is yet another that is broken in the PC version.

Maybe I am just here to hope that I don't have to manually check for each bloody materia.


Oh, it's absent in PC.

So there we have it... I think I am screwwwwed haha.

General discussion / FF8 Retranslation Project.
« on: 2016-06-05 13:39:13 »
No, I'm not really going to do it.

But this is interesting. Seems FF8 was here and there too.  Not as bad as FF7 by any means (Alexander O Smith isn't a slouch) - but not great either.

General discussion / Where is this played?
« on: 2016-06-05 00:54:09 »

It is a variation of the Galbadia GARDEN theme.  It has a slightly longer intro.

Is it played? If so - when and where?  It's bound to be played at Galbadia Garden if it is played at all.

Completely unrelated / What Leftism Is
« on: 2016-05-27 04:25:32 »

No greater example than the bastards in the audience.

Also worth a watch

When I find something useful to post about how audio works in the field script, I will place it here.

Sound effects:

Let's start off by noting that there are actually three different functions used for setting sound effects in FF7 (Play Sound, Akao, and Akao2).  Why?  No-one knows. Play Sound (not to be confused with Play Music) is totally redundant. It isn't needed at all. More than likely it was added to be a simpler way of playing an effect. Setting a sound effect at full volume is very common (like when you collect an item). This operation is fully understood and is easy to use:

Argument 1/2: If not set to 0, these will decide the ID of the sound effect from a var.
Argument 3: ID of sound effect, if Argument 1 and 2 are set to 0.
Argument 4: Panning of the sound effect (where 63 is centred, 0 is left channel only, and 127 is right channel only).

Simple. Again, note that there is NO volume control with this operation.

For the most part, as I said, this operation is mainly used for simple "item gained" sound effects. It uses effect channel #1. So if you also use the Akao and Akao2 operations at the same time, you'll need to be mindful of that. 

That brings us on to Akao and Akao2. They're identical except Akao uses 8-bit arguments and Akao2 uses 16-bit arguments. This is needed when, for example, your effect ID is over 255. Why they created two when only one is needed, we will never know. It's likely they were trying to save every byte. Perhaps because at the beginning they had no idea they'd have a surplus (CD media). I'll concentrate on Akao, but all of the following is relevant to akao2.

Akao is a one-size-fits-all operation. It can perform nearly every audio task in the game. It is used when the programmer needs more control over sound; for example, volume control, multiple sound effects, volume panning, tempo (useless in PC now because it uses streamed data, such as Vorbis). 

When you first look at Akao in an editor such as Makou Reactor, you'll be struck by the number of arguments there are. Don't be frightened. Just remember that this operation is made to do everything.  Because of that, you'll frequently note that many of the arguments are often set to 0. At this moment in time, the full functionality of this operation is unknown - there are many gaps.  Still, let's look at some of the more useful findings:

The main thing to note about Akao is that argument 7 is the Sound Operation.  This is the crucial part of the entire opcode. It sets the type of operation to be performed. So, instead of multiple opcodes, the programmer decided to create Akao and make it do all operations based on the ID placed here. Some of these operations are known, and some are not.  Some do not work with the PC game at all, and some are completely useless. There are 4 channels available for sound effects, and one channel available for music. Each of the 4 sound effect channels have a corresponding operation for volume control and so on. In other words, you can change the volume and effect of channel 1 without affecting channels 2-4.

The main operations for sound effects in the PC game are:

40-43: Play sound effect on channel 1, 2, 3, 4
160-163: Volume for channel 1, 2, 3, 4
164-167: Volume transition (fading in / out) for channel 1, 2, 3, 4
168-171: Panning for channel 1, 2, 3, 4
172-175: Panning transition for channel 1, 2, 3, 4

As you can see, you can set a number of controls for the 4 channels. But once Argument 7 has been selected, the other arguments become important.  This is currently the thing that makes Akao confusing.  Documentation on this is scarce.  Here's what I have found so far:

When playing a sound effect (Sound operation 40-43), Argument 8 is the sound effect ID, but only IF argument 9 is 0. If argument 9 is non-0, this then changes :P  If argument 9 is non-0, it becomes the sound effect ID, and argument 8 then becomes the starting panning value (as above, this is 0 left, 63 centre, 127 right).  I hope I have this right.  However illogical, it does seem to be the case.

When setting Volume Control (Sound Operation 160-163), Argument 8 sets the volume (0-127). So, for example, if you want to set the volume of channel 2 to maximum, Argument 7 would be 161 and Argument 8 would be 127.  Pretty simple.

When setting Volume Transition (Sound Operation 164-167), Argument 8 is the TIME it will take to reach a particular volume. The maximum is 255 [akao2 obviously allows for greater values] (longest time), and Argument 9 is the desired volume (again, 0-127).  So, for example, if you want to fade channel 2 to volume 88 as fast as possible, you'd set Argument 7 to 165, Argument 8 to 1, and Argument 9 to 88. 

I am currently unsure how the value of Time relates to actual time.  That will need a peak at the assembly.

The panning and transition panning very likely work on the exact same basis.

Arguments 1-6 are used only when you wish to set the other arguments from a variable.  I have not done any experimenting with this. If they are set to 0, they are ignored.

Completely unrelated / Norway - The Land of the Insane
« on: 2016-04-20 16:56:44 »
If anything sums up where ultra Left thinking gets you, Norway is the poster boy.  I have literally never heard anything as dumb as this in my whole life. A man who executed 77 people (mostly children) wins his claim that he is being deprived of his "human rights", while being clothed and fed in a cushy cell.  Supposedly, rehabilitating a monster (there isn't a chance of that happening - and it wouldn't matter anyway, since his crime deserves no absolution) is more important to Norway than justice.

Just read this nonsense:

Hmm, maybe if you had given him the rope, he wouldn't be deliberately playing your pathetic justice system like a fiddle.

Also note:  BBC uses the quote of one survivor that agrees with its Left position.  I am willing to bet the majority do not share their sentiment.  But, who cares, right?

Bjorn Ihler, a survivor of Breivik's massacre of young activists on Utoya, tweeted that the judgement in Breivik's favour showed Norway had a "working court system, respecting human rights even under extreme conditions".

No, it means you are a dumbo - and Breivik is laughing at you.

Completely unrelated / Just can't function no more.
« on: 2016-04-15 11:52:09 »
When routine bites hard,
And ambitions are low,
And resentment rides high,
But emotions won't grow,
And we're changing our ways,
Taking different roads.

Then love, love will tear us apart again.
Love, love will tear us apart again.

In many clubs, this ends the night.  One of the recording studios they used is right near me.

Scripting and Reverse Engineering / Talk / Contact range.
« on: 2016-04-13 21:32:39 »
The original game often sets the contact and talk range in the "init" of the field model (in this case, Cloud),  but from what i can see, it's ignored there. Is this the case with PSX too? It takes effect fine in "main"  - unless this is a Makou issue?

The "music lock" [f5] opcode/function is broken on PC. It's being ignored (in blin67_3, for example).  The PC version loses the lock on map change, when it should carry.

It gets reset to 0 (unlocked)  at 63C060 on field change - when it should not.  The function in question is 613FD9.

I am unsure if nopping this will solve the issue, but it's definitely worth a shot. This may also fix a lot of other issues in the game. The turks' theme not playing and so on.

If anyone wants to test that with me - change memory 63C060 to 90 90 90 90 90 90 90

It does appear to fix the issue.  You can monitor the lock / unlock bit at CBF9C0

This should also fix the issue with Turks' Theme not playing, Cid's theme ending - and a ton more.  I need to check though.

There are two other 00 resets near this address - and I wonder if those are doing something they shouldn't.


Atari soon realised that ET was not going home.


Pages: [1] 2 3 ... 6