Exemple #1
0
void FixDirectories(void)
{
    WriteTrace(TraceAppInit, TraceDebug, "Starting");
    CPath Directory(g_Settings->LoadStringVal(Cmd_BaseDirectory).c_str(), "");
    Directory.AppendDirectory("Config");
    if (!Directory.DirectoryExists())
    {
        WriteTrace(TraceAppInit, TraceDebug, "Creating %s", (const char *)Directory);
        Directory.DirectoryCreate();
    }
    else
    {
        WriteTrace(TraceAppInit, TraceDebug, "%s Already exists", (const char *)Directory);
    }

    Directory.UpDirectory();
    Directory.AppendDirectory("Save");
    if (!Directory.DirectoryExists())
    {
        WriteTrace(TraceAppInit, TraceDebug, "Creating %s", (const char *)Directory);
        Directory.DirectoryCreate();
    }
    else
    {
        WriteTrace(TraceAppInit, TraceDebug, "%s Already exists", (const char *)Directory);
    }

    Directory.UpDirectory();
    Directory.AppendDirectory("Screenshots");
    if (!Directory.DirectoryExists())
    {
        WriteTrace(TraceAppInit, TraceDebug, "Creating %s", (const char *)Directory);
        Directory.DirectoryCreate();
    }
    else
    {
        WriteTrace(TraceAppInit, TraceDebug, "%s Already exists", (const char *)Directory);
    }

    Directory.UpDirectory();
    Directory.AppendDirectory("textures");
    if (!Directory.DirectoryExists())
    {
        WriteTrace(TraceAppInit, TraceDebug, "Creating %s", (const char *)Directory);
        Directory.DirectoryCreate();
    }
    else
    {
        WriteTrace(TraceAppInit, TraceDebug, "%s Already exists", (const char *)Directory);
    }
    WriteTrace(TraceAppInit, TraceDebug, "Done");
}
Exemple #2
0
void SoundDriverBase::AI_Startup()
{
    WriteTrace(TraceAudioDriver, TraceDebug, "Start");
    m_AI_DMAPrimaryBytes = m_AI_DMASecondaryBytes = 0;
    m_AI_DMAPrimaryBuffer = m_AI_DMASecondaryBuffer = NULL;
    m_MaxBufferSize = MAX_SIZE;
    m_CurrentReadLoc = m_CurrentWriteLoc = m_BufferRemaining = 0;
    if (Initialize())
    {
        StartAudio();
    }
    WriteTrace(TraceAudioDriver, TraceDebug, "Start");
}
Exemple #3
0
void CPlugins::DestroyGfxPlugin( void ) 
{
	if (m_Gfx == NULL)
	{
		return;
	}
	WriteTrace(TraceGfxPlugin,__FUNCTION__ ": before delete m_Gfx");
	delete m_Gfx;   
	WriteTrace(TraceGfxPlugin,__FUNCTION__ ": after delete m_Gfx");
	m_Gfx = NULL;
//		g_Settings->UnknownSetting_GFX = NULL;
	DestroyRspPlugin();
}
Exemple #4
0
void CPlugins::DestroyGfxPlugin(void)
{
    if (m_Gfx == NULL)
    {
        return;
    }
    WriteTrace(TraceGFXPlugin, TraceInfo, "before delete m_Gfx");
    delete m_Gfx;
    WriteTrace(TraceGFXPlugin, TraceInfo, "after delete m_Gfx");
    m_Gfx = NULL;
    //		g_Settings->UnknownSetting_GFX = NULL;
    DestroyRspPlugin();
}
Exemple #5
0
void JavaBridge::GfxThreadInit()
{
    WriteTrace(TraceUserInterface, TraceDebug, "Start");
    JNIEnv *env = Android_JNI_GetEnv();
    if (g_GLThread != NULL && env != NULL)
    {
        jclass GLThreadClass = env->GetObjectClass(g_GLThread);
        jmethodID midThreadStarting = env->GetMethodID(GLThreadClass, "ThreadStarting", "()V");
        env->CallVoidMethod(g_GLThread, midThreadStarting);
        env->DeleteLocalRef(GLThreadClass);
    }
    WriteTrace(TraceUserInterface, TraceDebug, "Done");
}
Exemple #6
0
void CPlugins::DestroyControlPlugin(void)
{
    if (m_Control == NULL)
    {
        return;
    }
    WriteTrace(TraceControllerPlugin, TraceDebug, "before close");
    m_Control->Close();
    WriteTrace(TraceControllerPlugin, TraceDebug, "before delete");
    delete m_Control;
    m_Control = NULL;
    WriteTrace(TraceControllerPlugin, TraceDebug, "after delete");
    //		g_Settings->UnknownSetting_CTRL = NULL;
}
Exemple #7
0
void CPlugins::DestroyRspPlugin(void)
{
    if (m_RSP == NULL)
    {
        return;
    }
    WriteTrace(TraceRSPPlugin, TraceDebug, "before close");
    m_RSP->Close();
    WriteTrace(TraceRSPPlugin, TraceDebug, "before delete");
    delete m_RSP;
    m_RSP = NULL;
    WriteTrace(TraceRSPPlugin, TraceDebug, "after delete");
    //		g_Settings->UnknownSetting_RSP = NULL;
}
void CMainMenu::RebuildAccelerators(void)
{
	CGuard Guard(m_CS);

	//Delete the old accel list
	WriteTrace(TraceDebug,__FUNCTION__ ": Start");

	HACCEL m_OldAccelTable = (HACCEL)m_AccelTable;
	m_AccelTable = m_ShortCuts.GetAcceleratorTable();
	if (m_OldAccelTable) { 
		DestroyAcceleratorTable(m_OldAccelTable);
	}
	WriteTrace(TraceDebug,__FUNCTION__ ": Done");
}
Exemple #9
0
void CPlugins::CreatePlugins(void)
{
    LoadPlugin(Game_Plugin_Gfx, Plugin_GFX_CurVer, m_Gfx, m_PluginDir.c_str(), m_GfxFile, TraceGFXPlugin, "GFX");
    LoadPlugin(Game_Plugin_Audio, Plugin_AUDIO_CurVer, m_Audio, m_PluginDir.c_str(), m_AudioFile, TraceAudioPlugin, "Audio");
    LoadPlugin(Game_Plugin_RSP, Plugin_RSP_CurVer, m_RSP, m_PluginDir.c_str(), m_RSPFile, TraceRSPPlugin, "RSP");
    LoadPlugin(Game_Plugin_Controller, Plugin_CONT_CurVer, m_Control, m_PluginDir.c_str(), m_ControlFile, TraceControllerPlugin, "Control");

    //Enable debugger
    if (m_RSP != NULL && m_RSP->EnableDebugging)
    {
        WriteTrace(TraceRSPPlugin, TraceInfo, "EnableDebugging starting");
        m_RSP->EnableDebugging(bHaveDebugger());
        WriteTrace(TraceRSPPlugin, TraceInfo, "EnableDebugging done");
    }
}
Exemple #10
0
void CPlugins::DestroyRspPlugin( void ) 
{
	if (m_RSP == NULL)
	{
		return;
	}
	WriteTrace(TraceDebug,__FUNCTION__ ": 9");
	m_RSP->Close();
	WriteTrace(TraceDebug,__FUNCTION__ ": 10");
	delete m_RSP;   
	WriteTrace(TraceDebug,__FUNCTION__ ": 11");
	m_RSP = NULL;
	WriteTrace(TraceDebug,__FUNCTION__ ": 12");
//		g_Settings->UnknownSetting_RSP = NULL;
}
Exemple #11
0
void CPlugins::DestroyControlPlugin( void ) 
{
	if (m_Control == NULL) 
	{
		return;
	}
	WriteTrace(TraceDebug,__FUNCTION__ ": 13");
	m_Control->Close();
	WriteTrace(TraceDebug,__FUNCTION__ ": 14");
	delete m_Control;
	WriteTrace(TraceDebug,__FUNCTION__ ": 15");
	m_Control = NULL;
	WriteTrace(TraceDebug,__FUNCTION__ ": 16");
//		g_Settings->UnknownSetting_CTRL = NULL;
}
Exemple #12
0
CMainGui::~CMainGui(void)
{
	WriteTrace(TraceDebug, __FUNCTION__ ": Start");
	if (m_bMainWindow)
	{
		g_Settings->UnregisterChangeCB(RomBrowser_Enabled, this, (CSettings::SettingChangedFunc)RomBowserEnabledChanged);
		g_Settings->UnregisterChangeCB(RomBrowser_ColoumnsChanged, this, (CSettings::SettingChangedFunc)RomBowserColoumnsChanged);
		g_Settings->UnregisterChangeCB(RomBrowser_Recursive, this, (CSettings::SettingChangedFunc)RomBrowserRecursiveChanged);
	}
	if (m_hMainWindow)
	{
		DestroyWindow(m_hMainWindow);
	}
	WriteTrace(TraceDebug, __FUNCTION__ ": Done");
}
Exemple #13
0
void CPlugin::RomOpened()
{
    if (m_RomOpen)
    {
        return;
    }

    if (RomOpen != NULL)
    {
        WriteTrace(PluginTraceType(), TraceDebug, "Before Rom Open");
        RomOpen();
        WriteTrace(PluginTraceType(), TraceDebug, "After Rom Open");
    }
    m_RomOpen = true;
}
void AddRecentRom(const char * ImagePath)
{
    if (ImagePath == NULL) { return; }
    WriteTrace(TraceUserInterface, TraceDebug, "Start (ImagePath: %s)",ImagePath);

    //Get Information about the stored rom list
    size_t MaxRememberedFiles = UISettingsLoadDword(File_RecentGameFileCount);
    strlist RecentGames;
    size_t i;
    for (i = 0; i < MaxRememberedFiles; i++)
    {
        stdstr RecentGame = UISettingsLoadStringIndex(File_RecentGameFileIndex, i);
        if (RecentGame.empty())
        {
            break;
        }
        RecentGames.push_back(RecentGame);
    }

    //See if the game is already in the list if so then move it to the top of the list
    strlist::iterator iter;
    for (iter = RecentGames.begin(); iter != RecentGames.end(); iter++)
    {
        if (_stricmp(ImagePath, iter->c_str()) != 0)
        {
            continue;
        }
        RecentGames.erase(iter);
        break;
    }
    RecentGames.push_front(ImagePath);
    if (RecentGames.size() > MaxRememberedFiles)
    {
        RecentGames.pop_back();
    }

    for (i = 0, iter = RecentGames.begin(); iter != RecentGames.end(); iter++, i++)
    {
        UISettingsSaveStringIndex(File_RecentGameFileIndex, i, *iter);
    }

    if (g_JavaBridge)
    {
        WriteTrace(TraceUserInterface, TraceDebug, "calling RecentRomsUpdated");
        g_JavaBridge->RecentRomsUpdated();
    }
    WriteTrace(TraceUserInterface, TraceDebug, "Done");
}
void UpdateScreenResolution(int ScreenWidth, int ScreenHeight)
{
    WriteTrace(TraceResolution, TraceError, "aspectmode: %d", g_settings->aspectmode());
    g_resolutions.clear();
    switch (g_settings->aspectmode())
    {
    case CSettings::Aspect_4x3:
        g_resolutions.push_back(ResolutionInfo(stdstr_f("%dx%d", ScreenHeight * 4 / 3, ScreenHeight).c_str(), ScreenHeight * 4 / 3, ScreenHeight, 0, true));
        g_resolutions.push_back(ResolutionInfo("960x720", 960, 720, 0, false));
        g_resolutions.push_back(ResolutionInfo("800x600", 800, 600, 0, false));
        g_resolutions.push_back(ResolutionInfo("640x480", 640, 480, 0, false));
        g_resolutions.push_back(ResolutionInfo("480x360", 480, 360, 0, false));
        g_resolutions.push_back(ResolutionInfo("320x240", 320, 240, 0, false));
        break;
    case CSettings::Aspect_16x9:
        g_resolutions.push_back(ResolutionInfo(stdstr_f("%dx%d", ScreenHeight * 16 / 9, ScreenHeight).c_str(), ScreenHeight * 16 / 9, ScreenHeight, 0, true));
        g_resolutions.push_back(ResolutionInfo("1280x720", 1280, 720, 0, false));
        g_resolutions.push_back(ResolutionInfo("1067x600", 1067, 600, 0, false));
        g_resolutions.push_back(ResolutionInfo("854x480", 854, 480, 0, false));
        g_resolutions.push_back(ResolutionInfo("640x360", 640, 360, 0, false));
        g_resolutions.push_back(ResolutionInfo("426x240", 426, 240, 0, false));
        break;
    case CSettings::Aspect_Original:
        g_resolutions.push_back(ResolutionInfo("Original", ScreenWidth, ScreenHeight, 0, true));
        break;
    case CSettings::Aspect_Stretch:
    default: //stretch
        g_resolutions.push_back(ResolutionInfo(stdstr_f("%dx%d", ScreenWidth, ScreenHeight).c_str(), ScreenWidth, ScreenHeight, 0, true));
        break;
    }
}
void CPlugins::DestroyGfxPlugin(void)
{
    if (m_Gfx == NULL)
    {
        return;
    }
    WriteTrace(TraceGFXPlugin, TraceDebug, "before close");
    m_Gfx->Close(m_MainWindow);
    WriteTrace(TraceGFXPlugin, TraceInfo, "deleting");
    delete m_Gfx;
    WriteTrace(TraceGFXPlugin, TraceInfo, "m_Gfx deleted");
    m_Gfx = NULL;
    //		g_Settings->UnknownSetting_GFX = NULL;
    DestroyRspPlugin();
    WriteTrace(TraceGFXPlugin, TraceInfo, "Done");
}
Exemple #17
0
void CMainGui::GameCpuRunning(CMainGui * Gui)
{
    if (g_Settings->LoadBool(GameRunning_CPU_Running))
    {
        Gui->MakeWindowOnTop(g_Settings->LoadBool(UserInterface_AlwaysOnTop));
        if (g_Settings->LoadBool(Setting_AutoFullscreen))
        {
            WriteTrace(TraceDebug, __FUNCTION__ " 15");
            CIniFile RomIniFile(g_Settings->LoadStringVal(SupportFile_RomDatabase).c_str());
            stdstr Status = g_Settings->LoadStringVal(Rdb_Status);

            char String[100];
            RomIniFile.GetString("Rom Status", stdstr_f("%s.AutoFullScreen", Status.c_str()).c_str(), "true", String, sizeof(String));
            if (_stricmp(String, "true") == 0)
            {
                g_Notify->ChangeFullScreen();
            }
        }
        Gui->RefreshMenu();
        Gui->BringToTop();
    }
    else
    {
        PostMessage(Gui->m_hMainWindow, WM_GAME_CLOSED, 0, 0);
    }
}
Exemple #18
0
bool CMainGui::ResetPluginsInUiThread(CPlugins * plugins, CN64System * System)
{
    RESET_PLUGIN info;
    info.system = System;
    info.plugins = plugins;
    info.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
    bool bRes = true;
    if (info.hEvent)
    {
        PostMessage(m_hMainWindow, WM_RESET_PLUGIN, (WPARAM)&bRes, (LPARAM)&info);
#ifdef _DEBUG
        DWORD dwRes = WaitForSingleObject(info.hEvent, INFINITE);
#else
        DWORD dwRes = WaitForSingleObject(info.hEvent, 5000);
#endif
        dwRes = dwRes;
        CloseHandle(info.hEvent);
    }
    else
    {
        WriteTrace(TraceError, __FUNCTION__ ": Failed to create event");
        bRes = false;
    }
    Notify().RefreshMenu();
    return bRes;
}
Exemple #19
0
void DirectSoundDriver::StartAudio()
{
    WriteTrace(TraceAudioDriver, TraceDebug, "Start");
    if (m_handleAudioThread == NULL)
    {
        m_AudioIsDone = false;
        m_handleAudioThread = CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)stAudioThreadProc, this, 0, (LPDWORD)&m_dwAudioThreadId);

        LPDIRECTSOUNDBUFFER & lpdsbuf = (LPDIRECTSOUNDBUFFER &)m_lpdsbuf;
        if (lpdsbuf != NULL)
        {
            lpdsbuf->Play(0, 0, DSBPLAY_LOOPING);
        }
    }
    WriteTrace(TraceAudioDriver, TraceDebug, "Done");
}
Exemple #20
0
void CPlugins::DestroyAudioPlugin( void ) 
{
	if (m_Audio == NULL)
	{
		return;
	}
	WriteTrace(TraceDebug,__FUNCTION__ ": 5");
	m_Audio->Close();
	WriteTrace(TraceDebug,__FUNCTION__ ": 6");
	delete m_Audio;   
	WriteTrace(TraceDebug,__FUNCTION__ ": 7");
	m_Audio = NULL;
	WriteTrace(TraceDebug,__FUNCTION__ ": 8");
//		g_Settings->UnknownSetting_AUDIO = NULL;
	DestroyRspPlugin();
}
Exemple #21
0
static bool ParseCommand(int32_t argc, char **argv)
{
    if (argc <= 1)
    {
        return true;
    }
    for (int32_t i = 1; i < argc; i++)
    {
        int32_t ArgsLeft = argc - i - 1;
        if (strcmp(argv[i], "--help") == 0)
        {
            g_Settings->SaveBool(Cmd_ShowHelp, true);
            return false;
        }
        else if (ArgsLeft == 0 && argv[i][0] != '-')
        {
            g_Settings->SaveString(Cmd_RomFile, &(argv[i][0]));
            return true;
        }
        else
        {
            WriteTrace(TraceAppInit, TraceError, "unrecognized command-line parameter '%d: %s'", i, argv[i]);
        }
    }
    return false;
}
Exemple #22
0
void DirectSoundDriver::SetSegmentSize(uint32_t length, uint32_t SampleRate)
{
    if (SampleRate == 0) { return; }
    CGuard guard(m_CS);

    WAVEFORMATEX wfm = { 0 };
    wfm.wFormatTag = WAVE_FORMAT_PCM;
    wfm.nChannels = 2;
    wfm.nSamplesPerSec = SampleRate;
    wfm.wBitsPerSample = 16;
    wfm.nBlockAlign = wfm.wBitsPerSample / 8 * wfm.nChannels;
    wfm.nAvgBytesPerSec = wfm.nSamplesPerSec * wfm.nBlockAlign;

    DSBUFFERDESC dsbdesc = { 0 };
    dsbdesc.dwSize = sizeof(DSBUFFERDESC);
    dsbdesc.dwFlags = DSBCAPS_GLOBALFOCUS | DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_LOCSOFTWARE;
    dsbdesc.dwBufferBytes = length * DS_SEGMENTS;
    dsbdesc.lpwfxFormat = &wfm;

    LPDIRECTSOUND8 & lpds = (LPDIRECTSOUND8 &)m_lpds;
    LPDIRECTSOUNDBUFFER & lpdsbuf = (LPDIRECTSOUNDBUFFER &)m_lpdsbuf;
    if (lpds != NULL)
    {
        HRESULT hr = lpds->CreateSoundBuffer(&dsbdesc, &lpdsbuf, NULL);
        if (FAILED(hr))
        {
            WriteTrace(TraceAudioDriver, TraceWarning, "CreateSoundBuffer failed (hr: 0x%08X)", hr);
        }
    }

    if (lpdsbuf != NULL)
    {
        lpdsbuf->Play(0, 0, DSBPLAY_LOOPING);
    }
}
Exemple #23
0
void SetupTrace(void)
{
    AddLogModule();

    g_Settings->RegisterChangeCB(Debugger_TraceMD5, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->RegisterChangeCB(Debugger_TraceThread, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->RegisterChangeCB(Debugger_TracePath, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->RegisterChangeCB(Debugger_TraceSettings, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->RegisterChangeCB(Debugger_TraceUnknown, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->RegisterChangeCB(Debugger_TraceAppInit, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->RegisterChangeCB(Debugger_TraceAppCleanup, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->RegisterChangeCB(Debugger_TraceN64System, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->RegisterChangeCB(Debugger_TracePlugins, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->RegisterChangeCB(Debugger_TraceGFXPlugin, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->RegisterChangeCB(Debugger_TraceAudioPlugin, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->RegisterChangeCB(Debugger_TraceControllerPlugin, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->RegisterChangeCB(Debugger_TraceRSPPlugin, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->RegisterChangeCB(Debugger_TraceRSP, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->RegisterChangeCB(Debugger_TraceAudio, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->RegisterChangeCB(Debugger_TraceRegisterCache, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->RegisterChangeCB(Debugger_TraceRecompiler, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->RegisterChangeCB(Debugger_TraceTLB, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->RegisterChangeCB(Debugger_TraceProtectedMEM, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->RegisterChangeCB(Debugger_TraceUserInterface, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->RegisterChangeCB(Debugger_TraceRomList, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->RegisterChangeCB(Debugger_TraceExceptionHandler, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->RegisterChangeCB(Debugger_AppLogFlush, g_LogFile, (CSettings::SettingChangedFunc)LogFlushChanged);
    UpdateTraceLevel(NULL);

    WriteTrace(TraceAppInit, TraceInfo, "Application Starting %s", VER_FILE_VERSION_STR);
}
Exemple #24
0
void CleanupTrace(void)
{
    WriteTrace(TraceAppCleanup, TraceDebug, "Done");

    g_Settings->UnregisterChangeCB(Debugger_TraceMD5, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->UnregisterChangeCB(Debugger_TraceThread, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->UnregisterChangeCB(Debugger_TracePath, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->UnregisterChangeCB(Debugger_TraceSettings, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->UnregisterChangeCB(Debugger_TraceUnknown, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->UnregisterChangeCB(Debugger_TraceAppInit, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->UnregisterChangeCB(Debugger_TraceAppCleanup, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->UnregisterChangeCB(Debugger_TraceN64System, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->UnregisterChangeCB(Debugger_TracePlugins, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->UnregisterChangeCB(Debugger_TraceGFXPlugin, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->UnregisterChangeCB(Debugger_TraceAudioPlugin, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->UnregisterChangeCB(Debugger_TraceControllerPlugin, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->UnregisterChangeCB(Debugger_TraceRSPPlugin, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->UnregisterChangeCB(Debugger_TraceRSP, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->UnregisterChangeCB(Debugger_TraceAudio, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->UnregisterChangeCB(Debugger_TraceRegisterCache, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->UnregisterChangeCB(Debugger_TraceRecompiler, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->UnregisterChangeCB(Debugger_TraceTLB, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->UnregisterChangeCB(Debugger_TraceProtectedMEM, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->UnregisterChangeCB(Debugger_TraceUserInterface, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->UnregisterChangeCB(Debugger_TraceRomList, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->UnregisterChangeCB(Debugger_TraceExceptionHandler, NULL, (CSettings::SettingChangedFunc)UpdateTraceLevel);
    g_Settings->UnregisterChangeCB(Debugger_AppLogFlush, g_LogFile, (CSettings::SettingChangedFunc)LogFlushChanged);
}
bool CSettingTypeRDBYesNo::Load(uint32_t Index, bool & Value) const
{
    stdstr strValue;
    bool bRes = m_SettingsIniFile->GetString(m_SectionIdent->c_str(), m_KeyName.c_str(), m_DefaultStr, strValue);
    if (!bRes)
    {
        LoadDefault(Index, Value);
        return false;
    }
    const char * String = strValue.c_str();

    if (_stricmp(String, "Yes") == 0)
    {
        Value = true;
    }
    else if (_stricmp(String, "No") == 0)
    {
        Value = false;
    }
    else if (_stricmp(String, "default") == 0)
    {
        LoadDefault(Index, Value);
        return false;
    }
    else
    {
        WriteTrace(TraceSettings, TraceError, "Invalid Yes/No setting value (Section: %s Key: %s Value: %s)", m_SectionIdent->c_str(), String, m_KeyName.c_str(), strValue.c_str());
        LoadDefault(Index, Value);
        return false;
    }

    return true;
}
EXPORT void CALL Java_emu_project64_jni_NativeExports_RefreshRomDir(JNIEnv* env, jclass cls, jstring RomDir, jboolean Recursive)
{
    const char *romDir = env->GetStringUTFChars(RomDir, 0);
    WriteTrace(TraceUserInterface, TraceDebug, "romDir = %s Recursive = %s", romDir, Recursive ? "true" : "false");
    g_Settings->SaveString(RomList_GameDir,romDir);
    g_Settings->SaveBool(RomList_GameDirRecursive,Recursive);
    env->ReleaseStringUTFChars(RomDir, romDir);

    if (g_JavaRomList == NULL)
    {
        g_JavaRomList = new CJavaRomList;
    }
    g_JavaRomList->RefreshRomList();

    WriteTrace(TraceUserInterface, TraceDebug, "Done");
}
Exemple #27
0
extern "C" void UseUnregisteredSetting(int /*SettingID*/)
{
    WriteTrace(TraceAudioInterface, TraceDebug, "Called");
#ifdef _WIN32
    DebugBreak();
#endif
}
Exemple #28
0
bool CPlugins::Reset ( CN64System * System ) 
{
	WriteTrace(TraceDebug,__FUNCTION__ ": Start");	

	bool bGfxChange = _stricmp(m_GfxFile.c_str(),g_Settings->LoadStringVal(Game_Plugin_Gfx).c_str()) != 0;
	bool bAudioChange = _stricmp(m_AudioFile.c_str(),g_Settings->LoadStringVal(Game_Plugin_Audio).c_str()) != 0;
	bool bRspChange = _stricmp(m_RSPFile.c_str(),g_Settings->LoadStringVal(Game_Plugin_RSP).c_str()) != 0;
	bool bContChange = _stricmp(m_ControlFile.c_str(),g_Settings->LoadStringVal(Game_Plugin_Controller).c_str()) != 0;

	//if GFX and Audio has changed we also need to force reset of RSP
	if (bGfxChange || bAudioChange)
		bRspChange = true;

	if (bGfxChange) { DestroyGfxPlugin(); }
	if (bAudioChange) { DestroyAudioPlugin(); }
	if (bRspChange) { DestroyRspPlugin(); }
	if (bContChange) { DestroyControlPlugin(); }

	CreatePlugins();

	if (m_Gfx && bGfxChange) 
	{
		WriteTrace(TraceGfxPlugin,__FUNCTION__ ": Gfx Initiate Starting");
		if (!m_Gfx->Initiate(System,m_RenderWindow))   { return false; }
		WriteTrace(TraceGfxPlugin,__FUNCTION__ ": Gfx Initiate Done");
	}
	if (m_Audio && bAudioChange) 
	{
		WriteTrace(TraceDebug,__FUNCTION__ ": Audio Initiate Starting");
		if (!m_Audio->Initiate(System,m_RenderWindow)) { return false; }
		WriteTrace(TraceDebug,__FUNCTION__ ": Audio Initiate Done");
	}
	if (m_Control && bContChange)
	{
		WriteTrace(TraceDebug, __FUNCTION__ ": Control Initiate Starting");
		if (!m_Control->Initiate(System,m_RenderWindow)) { return false; }
		WriteTrace(TraceDebug, __FUNCTION__ ": Control Initiate Done");
	}
	if (m_RSP && bRspChange) 
	{
		WriteTrace(TraceRSP,__FUNCTION__ ": RSP Initiate Starting");
		if (!m_RSP->Initiate(this,System))   { return false; }
		WriteTrace(TraceRSP,__FUNCTION__ ": RSP Initiate Done");
	}
	WriteTrace(TraceDebug,__FUNCTION__ ": Done");	
	return true;
}
Exemple #29
0
FX_ENTRY void FX_CALL
grDepthBufferFunction(GrCmpFnc_t function)
{
    WriteTrace(TraceGlitch, TraceDebug, "function: %d", function);
    switch (function)
    {
    case GR_CMP_GEQUAL:
        if (w_buffer_mode)
            glDepthFunc(GL_LEQUAL);
        else
            glDepthFunc(GL_GEQUAL);
        break;
    case GR_CMP_LEQUAL:
        if (w_buffer_mode)
            glDepthFunc(GL_GEQUAL);
        else
            glDepthFunc(GL_LEQUAL);
        break;
    case GR_CMP_LESS:
        if (w_buffer_mode)
            glDepthFunc(GL_GREATER);
        else
            glDepthFunc(GL_LESS);
        break;
    case GR_CMP_ALWAYS:
        glDepthFunc(GL_ALWAYS);
        break;
    case GR_CMP_EQUAL:
        glDepthFunc(GL_EQUAL);
        break;
    case GR_CMP_GREATER:
        if (w_buffer_mode)
            glDepthFunc(GL_LESS);
        else
            glDepthFunc(GL_GREATER);
        break;
    case GR_CMP_NEVER:
        glDepthFunc(GL_NEVER);
        break;
    case GR_CMP_NOTEQUAL:
        glDepthFunc(GL_NOTEQUAL);
        break;

    default:
        WriteTrace(TraceGlitch, TraceWarning, "unknown depth buffer function : %x", function);
    }
}
void CNotification::DisplayMessage  ( int DisplayTime, const wchar_t * Message, va_list ap ) const 
{
	if (!m_hWnd) { return; }

	if (m_NextMsg > 0 || DisplayTime > 0)
	{
		time_t Now = time(NULL);
		if (DisplayTime == 0 && Now < m_NextMsg)
		{
			return;
		}
		if (DisplayTime > 0)
		{
			m_NextMsg = Now + DisplayTime;
		}
		if (m_NextMsg == 0)
		{
			m_NextMsg = 0;
		}
	}
	
	wchar_t Msg[1000];

	_vsnwprintf( Msg,sizeof(Msg) - 1,Message, ap );
	va_end( ap );
	
	
	if (InFullScreen())
	{
		if (m_gfxPlugin && m_gfxPlugin->DrawStatus)
		{
			WriteTrace(TraceGfxPlugin,__FUNCTION__ ": DrawStatus - Starting");
			stdstr PluginMessage;
			PluginMessage.FromUTF16(Msg);
			m_gfxPlugin->DrawStatus(PluginMessage.c_str(), FALSE);
			WriteTrace(TraceGfxPlugin,__FUNCTION__ ": DrawStatus - Done");
		}
	} 
    else 
    {
#if defined(WINDOWS_UI)
		m_hWnd->SetStatusText(0, Msg);
#else
		g_Notify -> BreakPoint(__FILEW__, __LINE__);
#endif
	}
}