02-05-2010, 06:56 PM
02-05-2010, 07:05 PM
Well I know it uses the Zelda Ucode.
02-05-2010, 07:37 PM
(02-05-2010, 06:14 PM)LuisR14 Wrote: [ -> ]so how's your patch now? :p (you don't need Save() btw, since ISOProperties does it already :p + i didn't fill in GConfig() since you don't have any ini when the plugin is loaded)
btw here's a less confusing way for the IF in UCode_Zelda_Voice.cpp :p
Code:
if (PB.RepeatMode == 0)
{
PB.KeyOff = 1;
PB.RemLength = 0;
PB.CurAddr = PB.StartAddr + PB.RestartPos + PB.Length;
while (sampleCount < _RealSize)
_Buffer[sampleCount++] = 0;
return;
}
else
{
// AFC Looping HACK: Fixes intro music in Zelda Twilight Princess and Pikmin audio.
// AFC looping doesn't work correctly, music will abruptly cease in Zelda Twilight Princess after playing for a short while,
// causes sound oddities with Zelda WindWaker and Super Mario Galaxy.
//
// AFC looping can now be enabled/disabled from the DSP configuration,
// making the former method of enabling/disabling the AFC looping hack obsolete until a proper fix can be implemented.
if (g_Config.m_EnableAFCLoopingHack || g_GConfig.m_EnableAFCLoopingHack)
{
// The loop start pos is incorrect, so samples will loop a bit wrong. However, at least
// this fixes the intro music in ZTP, Pikmin2.
// PB.RestartPos = PB.LoopStartPos;
PB.RemLength = PB.Length; // - PB.RestartPos;
PB.CurAddr = PB.StartAddr; //+ (PB.LoopStartPos >> 4) * PB.Format + ;
// Hmm, this shouldn't be reversed .. or should it? Is it different between versions of the ucode?
PB.YN1 = PB.LoopYN2;
PB.YN2 = PB.LoopYN1;
}
}
You are right, the plugin refused to initialize and wouldn't show on the list. It's just the way you did it looked a bit odd. See the bolded parenthesis I outlined, is there a better way of doing this?
Quote:GConfig::GConfig()
{
}
void GConfig::Load(const char *game_ini)
{
if (game_ini && strlen(game_ini))
{
IniFile iniFile;
iniFile.Load((std:tring(File::GetUserPath(D_CONFIG_IDX)) + "game_ini.ini").c_str());
iniFile.Get("HLEaudio", "UseRE0Fix", &m_EnableRE0Fix, false);
iniFile.Get("HLEaudio", "EnableAFCAudioLoopingHack", &m_EnableAFCLoopingHack, false);
ac_GConfig.Load(iniFile);
}
}
void GConfig::Save(const char *game_ini)
{
if (game_ini && strlen(game_ini))
{
IniFile iniFile;
iniFile.Load((std:tring(File::GetUserPath(D_CONFIG_IDX)) + "game_ini.ini").c_str());
iniFile.Set("Config", "EnableRE0AudioFix", m_EnableRE0Fix); // RE0 Hack
iniFile.Set("Config", "EnableAFCAudioLoopingHack", m_EnableAFCLoopingHack); // AFC Looping Hack
ac_GConfig.Set(iniFile);
iniFile.Save((std:tring(File::GetUserPath(D_CONFIG_IDX)) + "game_ini.ini").c_str());
}
}
02-05-2010, 07:44 PM
Just get the old AFC loop patch and look at how we handle Ini config for DSP HLE, then add the WxCheckbox to the dialog box.
02-05-2010, 07:44 PM
Another thing, when the checkbox for the AFC looping hack in the GameConfig is undetermined it should automatically load the option from the DSP configuration (DSP.ini), however it doesn't do this. Current method renders the option in the DSP configuration useless regardless if the checkbox in Gameconfig is undetermined.
02-05-2010, 07:51 PM
in the ctor of the Dialog class, have it get the option from INI and set the value of the checkbox.
LuisR14
02-05-2010, 07:51 PM
(02-05-2010, 07:44 PM)Xtreme2damax Wrote: [ -> ]Current method renders the option in the DSP configuration useless regardless if the checkbox in Gameconfig is undetermined.well what would that current method be?
02-05-2010, 08:03 PM
(02-05-2010, 07:51 PM)LuisR14 Wrote: [ -> ](02-05-2010, 07:44 PM)Xtreme2damax Wrote: [ -> ]Current method renders the option in the DSP configuration useless regardless if the checkbox in Gameconfig is undetermined.well what would that current method be?
The way it should work:
When the option is checked in in the DSP Configuration, and the checkbox is undetermined in the GameConfig the AFC audio should loop.
When the checkbox is unchecked in the DSP Configuration, but checked in the GameConfig, AFC audio should loop.
When the checkbox is checked in the DSP Configuration, but unchecked in the GameConfig, AFC audio should not loop.
When both are unchecked, audio shouldn't loop..
I'm going to do what Omegadox mentioned, shouldn't be too hard to accomplish (I hope)..

02-05-2010, 08:24 PM
Screw gameconfig 

02-07-2010, 12:16 PM
(02-05-2010, 08:24 PM)omegadox Wrote: [ -> ]Screw gameconfigKeep gameconfig and screw generalconfig
( because It is a hack that is only needed in few games right ? )
tring(File::GetUserPath(D_CONFIG_IDX)) + "game_ini.ini").c_str());