Dolphin, the GameCube and Wii emulator - Forums

Full Version: AFC Looping Checkbox for DSP Plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9

LuisR14

(02-02-2010, 12:59 AM)James333 Wrote: [ -> ]
(02-01-2010, 05:40 AM)Xtreme2damax Wrote: [ -> ]Instead of:

if (g_Config.m_EnableAFCLooping || PB.RepeatMode == 0)

It should be:

if (!g_Config.m_EnableAFCLoopingHack || g_Config.m_EnableAFCLoopingHack && PB.RepeatMode == 0)
Why ? Tongue
this doesn't seem right either :p, you can just remove the "!g_Config.m_EnableAFCLoopingHack ||" portion Smile
(02-02-2010, 05:03 AM)LuisR14 Wrote: [ -> ]
(02-02-2010, 12:59 AM)James333 Wrote: [ -> ]
(02-01-2010, 05:40 AM)Xtreme2damax Wrote: [ -> ]Instead of:

if (g_Config.m_EnableAFCLooping || PB.RepeatMode == 0)

It should be:

if (!g_Config.m_EnableAFCLoopingHack || g_Config.m_EnableAFCLoopingHack && PB.RepeatMode == 0)
Why ? Tongue
this doesn't seem right either :p, you can just remove the "!g_Config.m_EnableAFCLoopingHack ||" portion Smile

It works just fine as it is, the way you mentioned causes problems and with James333 way the option is on all the time and can't be toggled.

Can anyone give me some hints how to hook this to ISOProperties.cpp and make the option functional in the GameConfig? I'm already half way or almost finished, I just need to know how to do this.

Any developers that can lend any insight or feedback?
(02-02-2010, 05:03 AM)LuisR14 Wrote: [ -> ]
(02-02-2010, 12:59 AM)James333 Wrote: [ -> ]
(02-01-2010, 05:40 AM)Xtreme2damax Wrote: [ -> ]Instead of:

if (g_Config.m_EnableAFCLooping || PB.RepeatMode == 0)

It should be:

if (!g_Config.m_EnableAFCLoopingHack || g_Config.m_EnableAFCLoopingHack && PB.RepeatMode == 0)
Why ? Tongue
this doesn't seem right either :p, you can just remove the "!g_Config.m_EnableAFCLoopingHack ||" portion Smile

At the moment of writing th patch I didn't knew which was the hack ( and actually , I didn't care xD ) so I leaved it like that. Actually I can't see why the original was wrong Tongue ( I read the Xtreme2damax posts but I didn't understand )

I would keep it like

if (!g_Config.m_EnableAFCLoopingHack || PB.RepeatMode == 0)

EDIT : and use && is not a good idea without the "!g_Config.m_EnableAFCLoopingHack ||" portion Tongue



(02-02-2010, 05:51 AM)Xtreme2damax Wrote: [ -> ]It works just fine as it is, the way you mentioned causes problems and with James333 way the option is on all the time and can't be toggled.

Can anyone give me some hints how to hook this to ISOProperties.cpp and make the option functional in the GameConfig? I'm already half way or almost finished, I just need to know how to do this.

Any developers that can lend any insight or feedback?
Now I understand , yeah , apparently it doesn't change in game ( but it does if you stop the game, at least It did in my tests )

LuisR14

(02-02-2010, 05:51 AM)Xtreme2damax Wrote: [ -> ]Any developers that can lend any insight or feedback?
well i'm currently looking at it Smile
(02-02-2010, 05:57 AM)LuisR14 Wrote: [ -> ]
(02-02-2010, 05:51 AM)Xtreme2damax Wrote: [ -> ]Any developers that can lend any insight or feedback?
well i'm currently looking at it Smile
Do you know how the ISOProperties.cpp overrides the main settings?? ( We can't make it override the settings of the DSP plugin D: )
Yes it should on a per game basis, so if you have it checked in the DSP options and unchecked in the Gameconfig AFC sound won't loop. I think I'm close to figuring it out, but I can seem to compile without errors. It looks like the Gameini code in ISOProperties was commented out for the RE0 hack and some looping hack that is likely unrelated to the AFC looping hack. I just started editing any files that were related to the DSP and Gameini configuration, adding the RE0 and AFCLooping hack under files that have EnableDTKMusic and AudioThrottle lines. I almost have it compiling correctly except for one or two small errors.

Here is the error I am receiving, perhaps someone can tell me what to do.

God I hope this works..

Here are the errors:

Code:
Error    7    error C2661: 'IniFile::Set' : no overloaded function takes 4 arguments    d:\My Documents\Emulator SVN\Dolphin-Modified\Source\Plugins\Plugin_DSP_HLE\Src\Config.cpp    72

Error    8    error C2661: 'IniFile::Set' : no overloaded function takes 4 arguments    d:\My Documents\Emulator SVN\Dolphin-Modified\Source\Plugins\Plugin_DSP_HLE\Src\Config.cpp    73

Here is the code contained in Config.cpp:

Code:
// Copyright (C) 2003 Dolphin Project.

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License 2.0 for more details.

// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/

// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/

#include "Globals.h"
#include "Common.h"
#include "IniFile.h"
#include "Config.h"
#include "AudioCommon.h"

CConfig g_Config;

CConfig::CConfig()
{
    Load();
}

void CConfig::Load()
{
    // first load defaults
    IniFile file;
    file.Load(FULL_CONFIG_DIR "DSP.ini");
    file.Get("Config", "EnableHLEAudio", &m_EnableHLEAudio, true); // Sound Settings
    file.Get("Config", "EnableRE0AudioFix", &m_EnableRE0Fix, false); // RE0 Hack
    file.Get("Config", "EnableAFCAudioLoopingHack", &m_EnableAFCLoopingHack, false); //AFC Looping Hack
    ac_Config.Load(file);
}

void CConfig::Save()
{
    IniFile file;
    file.Load(FULL_CONFIG_DIR "DSP.ini");
    file.Set("Config", "EnableHLEAudio", m_EnableHLEAudio); // Sound Settings
    file.Set("Config", "EnableRE0AudioFix", m_EnableRE0Fix); // RE0 Hack
    file.Set("Config", "EnableAFCAudioLoopingHack", m_EnableAFCLoopingHack); //AFC Looping Hack
    ac_Config.Set(file);

    file.Save(FULL_CONFIG_DIR "DSP.ini");
}

void CConfig::GameIniLoad(const char *game_ini)
{
    if (game_ini && strlen(game_ini))
    {
        IniFile iniFile;
        iniFile.Load(game_ini);
        iniFile.Get("HLEaudio", "UseRE0Fix", &m_EnableRE0Fix, 0);
        iniFile.Get("HLEaudio", "EnableAFCLoopingHack", &m_EnableAFCLoopingHack, 0);
        ac_Config.Load(iniFile);
    }
}
    
void CConfig::GameIniSave(const char *game_ini)
{
    if (game_ini && strlen(game_ini))
    {
        IniFile iniFile;
        iniFile.Load(game_ini);
        iniFile.Set("HLEaudio", "UseRE0Fix", &m_EnableRE0Fix, 0);
        iniFile.Set("HLEaudio", "EnableAFCLoopingHack", &m_EnableAFCLoopingHack, 0);
        ac_Config.Set(iniFile);

        iniFile.Save(game_ini);
    }
}

LuisR14

(02-02-2010, 09:58 AM)Xtreme2damax Wrote: [ -> ]It looks like the Gameini code in ISOProperties was commented out for the RE0 hack and some looping hack that is likely unrelated to the AFC looping hack.
actually it is related Smile

and maybe you should read the comments :p
HLE's Config.cpp
Code:
void CConfig::GameIniLoad(const char *game_ini)
{
// This game config will affect global system config
// Need a better way to seperate system config from game config
Well I was trying to work around that and fix it, already saw that comment..
Once proper looping is implemented, a checkbox to enable/disable looping would be nice for testing. It's seems like looping needs a lot of work in Dolphin, I notice that other games besides the games that use the Mario, Zelda, Pikmin, Luigi, SMS UCodes suffer from audio looping issues. Resident Evil Zero, Remake, RE2, RE3, and RE4 suffer from this as do some other games..

I have to figure out how to be able to override and enable/disable the AFC looping hack in the GameConfig. It seems editing ISOPropeties.cpp and ISOProperties.h is not enough. If I could find where all the other options in the GameConfig are hooked to that would be a step in the right direction.

LuisR14

took me some time to improve your patch and figure out what was wrong with ISOProperties but here's v2 of the patch :p

(also i was testing it and it seemed that ZTP was ok with it disabled o_o)
Pages: 1 2 3 4 5 6 7 8 9