Log in

View Full Version : Changing default menu selection.


BBQmyNUTZ
May 15th, 2004, 20:56
Have a game that originally only allowed it's music to be played via the original CD, but there is an option in the menu to use wav files which was greyed out. I figured out how to enable that option to where it's selectable and the wav audio works fine after ripping the music tracks from the CD and finding out what filenames the program looks for, however, it still defaults to the CD audio even though I've specified that the WAV option be checked at startup. I would like to get it to recognize the wav fails by default.

I've already gone through the motions with the check and enablemenuitem calls, but they don't seem to have any effect on how the program runs, only what the menu displays.

I know where the code is that controls whether it plays the wav files or jumps to the CD audio part, and even though I've tried patching it to just jump to the wav code, it still doesn't work until I select the option in the menu.

I'm having a pretty tough time with this, so if someone could maybe lend me a hand I would really appreciate it.

Kai

Fake51
May 17th, 2004, 13:46
Well, it seems that either it doesn't check what to play when it starts up - or you've missed something vital.

Study the menu-function, to see what exactly it does, when you make it play the wav files. Then compare the routine with the startup of the program, to find similarities and differences.

If it doesn't check whether to play cd-audio or wav files, then you might have to patch the program to make it perform the appropriate menu-function - since that has the desired effect, it may be able to work in the startup phase as well.

Fake

BBQmyNUTZ
May 17th, 2004, 23:02
Quote:
[Originally Posted by Fake51]Well, it seems that either it doesn't check what to play when it starts up - or you've missed something vital.

Study the menu-function, to see what exactly it does, when you make it play the wav files. Then compare the routine with the startup of the program, to find similarities and differences.

If it doesn't check whether to play cd-audio or wav files, then you might have to patch the program to make it perform the appropriate menu-function - since that has the desired effect, it may be able to work in the startup phase as well.

Fake


Thanks for the reply Fake. As I said previously, the option isn't *really* supposed to be available... so it should be naturally defaulting to the CD-DA audio. I know exactly where the conditional jumps are that determine which option is to be used, but even though I've basically forced it to only jump to the WAV audio it *still* won't default to it.

I understand that this is a kind of "just learn it and do it" kind of forum, but I'm really at a loss here on what to do, and I don't even know where to start in regards to finding the information I need to learn.

Kai

Fake51
May 18th, 2004, 02:01
Quote:
[Originally Posted by BBQmyNUTZ]Thanks for the reply Fake. As I said previously, the option isn't *really* supposed to be available... so it should be naturally defaulting to the CD-DA audio. I know exactly where the conditional jumps are that determine which option is to be used, but even though I've basically forced it to only jump to the WAV audio it *still* won't default to it.

I understand that this is a kind of "just learn it and do it" kind of forum, but I'm really at a loss here on what to do, and I don't even know where to start in regards to finding the information I need to learn.

Kai


Well, without knowing the program, I can only recommend that you think logically about the issue.

The question you need to be asking is whether the program can actually be forced to default to wav-files. Maybe, even though you've forced the correct jumps, the program doesn't care because the choice is made after the jumps you forced. Or maybe, defaulting to cd-audio is simply hardcoded a bit later on. Either way, dig deep enough, and you should find clues.

Btw, have you checked that the code you forced is actually run at startup? Sure it doesn't follow another path, to start the audio?

Fake

BBQmyNUTZ
May 18th, 2004, 11:25
Quote:
[Originally Posted by Fake51]Well, without knowing the program, I can only recommend that you think logically about the issue.

The question you need to be asking is whether the program can actually be forced to default to wav-files. Maybe, even though you've forced the correct jumps, the program doesn't care because the choice is made after the jumps you forced. Or maybe, defaulting to cd-audio is simply hardcoded a bit later on. Either way, dig deep enough, and you should find clues.

Btw, have you checked that the code you forced is actually run at startup? Sure it doesn't follow another path, to start the audio?

Fake


That's my problem... I don't know how to find out any of the things you are referring to. I think I'm in a little over my head here.

Kai

Fake51
May 18th, 2004, 16:36
Quote:
[Originally Posted by BBQmyNUTZ]That's my problem... I don't know how to find out any of the things you are referring to. I think I'm in a little over my head here.

Kai


Never a moment for learning like the present. Grab the opportunity to do some debugging - have a picnic in the code-woods. Moderate to heavy amounts of zen, alcohol, caffeine and lack of sleep usually helps (or is it plenty of sleep? I always forget, in the dead of night)

Start with the easy bit, then. I'm assuming you're using some sort of debugger. Well, breakpoint on the piece of code you're forcing - check if it's run at startup. Then take things from there.
Second, find out how it goes about playing the audio - a trip through the menu function might provide some details (at least it should give you some variables to breakpoint on).
Third, start piecing info together.

Fake