From 6c4ee1753aa2b9e620138801b479365b0569317c Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 16 Feb 2014 15:30:18 -0500 Subject: [PATCH] Fix some vertical alignments ie. uses spaces for alignment. --- Source/Core/AudioCommon/Mixer.h | 12 +- Source/Core/AudioCommon/XAudio2Stream.cpp | 20 +- Source/Core/AudioCommon/XAudio2_7Stream.cpp | 20 +- Source/Core/Core/ActionReplay.cpp | 46 +-- Source/Core/Core/BootManager.cpp | 38 +-- Source/Core/Core/ConfigManager.cpp | 306 +++++++++--------- Source/Core/Core/DSP/DSPAnalyzer.cpp | 48 +-- Source/Core/Core/DSP/DSPCore.h | 220 ++++++------- Source/Core/Core/DSP/DSPEmitter.h | 6 +- Source/Core/Core/DSP/DSPHWInterface.cpp | 13 +- Source/Core/Core/Debugger/Dump.cpp | 18 +- Source/Core/Core/Debugger/GCELF.h | 62 ++-- .../Core/Core/Debugger/PPCDebugInterface.cpp | 7 +- Source/Core/Core/HW/DSP.cpp | 6 +- .../Core/HW/DSPHLE/UCodes/UCode_Zelda.cpp | 24 +- Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp | 28 +- Source/Core/Core/HW/DSPHLE/UCodes/UCodes.h | 4 +- Source/Core/Core/HW/EXI_Channel.cpp | 12 +- Source/Core/Core/HW/EXI_Device.cpp | 8 +- Source/Core/Core/HW/EXI_DeviceEthernet.cpp | 6 +- Source/Core/Core/HW/EXI_DeviceGecko.cpp | 12 +- Source/Core/Core/HW/EXI_DeviceGecko.h | 28 +- Source/Core/Core/HW/EXI_DeviceIPL.h | 20 +- Source/Core/Core/HW/EXI_DeviceMemoryCard.cpp | 24 +- Source/Core/Core/HW/EXI_DeviceMic.cpp | 4 +- Source/Core/Core/HW/GCPadEmu.cpp | 74 ++--- Source/Core/Core/HW/GCPadEmu.h | 16 +- Source/Core/Core/HW/ProcessorInterface.cpp | 34 +- Source/Core/Core/HW/ProcessorInterface.h | 32 +- Source/Core/Core/HW/SI.cpp | 36 +-- Source/Core/Core/HW/SI_DeviceDanceMat.cpp | 64 ++-- Source/Core/Core/HW/SI_DeviceGCController.cpp | 88 ++--- .../Core/Core/HW/SI_DeviceGCSteeringWheel.cpp | 88 ++--- Source/Core/Core/HW/SystemTimers.cpp | 20 +- Source/Core/Core/HW/VideoInterface.cpp | 48 +-- Source/Core/Core/HW/VideoInterface.h | 20 +- Source/Core/Core/HW/WII_IPC.cpp | 12 +- Source/Core/Core/HW/WiimoteEmu/MatrixMath.h | 25 +- Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp | 44 +-- Source/Core/Core/HW/WiimoteEmu/WiimoteHid.h | 12 +- .../Core/Core/HW/WiimoteReal/WiimoteReal.cpp | 2 +- Source/Core/Core/HW/WiimoteReal/WiimoteReal.h | 16 +- .../Core/HW/WiimoteReal/WiimoteRealBase.h | 26 +- Source/Core/Core/IPC_HLE/WII_IPC_HLE.h | 18 +- .../Core/IPC_HLE/WII_IPC_HLE_Device_es.cpp | 52 +-- .../Core/IPC_HLE/WII_IPC_HLE_Device_fs.cpp | 36 +-- .../Core/IPC_HLE/WII_IPC_HLE_Device_hid.cpp | 19 +- .../Core/IPC_HLE/WII_IPC_HLE_Device_net.cpp | 56 ++-- .../Core/IPC_HLE/WII_IPC_HLE_Device_net.h | 18 +- .../IPC_HLE/WII_IPC_HLE_Device_net_ssl.cpp | 10 +- .../IPC_HLE/WII_IPC_HLE_Device_sdio_slot0.cpp | 31 +- .../Core/IPC_HLE/WII_IPC_HLE_Device_stm.h | 48 +-- .../Core/IPC_HLE/WII_IPC_HLE_Device_usb.cpp | 38 +-- .../Core/IPC_HLE/WII_IPC_HLE_Device_usb.h | 4 +- .../IPC_HLE/WII_IPC_HLE_Device_usb_kbd.cpp | 2 +- .../Core/Core/IPC_HLE/WII_IPC_HLE_WiiMote.cpp | 57 ++-- .../Core/Core/IPC_HLE/WII_IPC_HLE_WiiMote.h | 16 +- Source/Core/Core/IPC_HLE/WII_Socket.cpp | 8 +- Source/Core/Core/IPC_HLE/WiiMote_HID_Attr.cpp | 149 +++++---- Source/Core/Core/Movie.cpp | 12 +- Source/Core/Core/NetPlayClient.cpp | 2 +- Source/Core/Core/NetPlayClient.h | 8 +- Source/Core/Core/NetPlayServer.h | 8 +- Source/Core/Core/PowerPC/GDBStub.cpp | 12 +- Source/Core/Core/PowerPC/GDBStub.h | 4 +- Source/Core/DiscIO/FileSystemGCWii.cpp | 12 +- Source/Core/DiscIO/VolumeCommon.cpp | 20 +- Source/Core/DiscIO/VolumeDirectory.cpp | 6 +- Source/Core/DiscIO/VolumeWad.h | 4 +- Source/Core/DiscIO/VolumeWiiCrypted.cpp | 2 +- Source/Core/DiscIO/WbfsBlob.cpp | 8 +- .../ControllerInterface/OSX/OSXKeyboard.h | 22 +- .../ControllerInterface/OSX/OSXKeyboard.mm | 4 +- .../ControllerInterface/SDL/SDL.cpp | 18 +- .../ControllerInterface/Xlib/XInput2.cpp | 25 +- .../ControllerInterface/Xlib/XInput2.h | 30 +- .../ControllerInterface/Xlib/Xlib.h | 14 +- Source/Core/VideoBackends/D3D/D3DUtil.cpp | 2 +- Source/Core/VideoBackends/D3D/Render.cpp | 83 ++--- .../VideoBackends/Software/SWVertexLoader.cpp | 36 +-- Source/Core/VideoBackends/Software/Tev.cpp | 12 +- Source/Core/VideoCommon/CommandProcessor.cpp | 28 +- Source/Core/VideoCommon/DriverDetails.cpp | 12 +- Source/Core/VideoCommon/PixelEngine.h | 4 +- Source/Core/VideoCommon/PixelShaderGen.cpp | 34 +- .../Core/VideoCommon/TextureDecoder_x64.cpp | 32 +- Source/Core/VideoCommon/VertexLoader.cpp | 88 ++--- .../Core/VideoCommon/VertexLoader_Color.cpp | 10 +- Source/Core/VideoCommon/VertexLoader_Normal.h | 26 +- .../Core/VideoCommon/VertexShaderManager.cpp | 28 +- Source/Core/VideoCommon/VideoConfig.h | 8 +- 91 files changed, 1420 insertions(+), 1405 deletions(-) diff --git a/Source/Core/AudioCommon/Mixer.h b/Source/Core/AudioCommon/Mixer.h index d5e82edf4b..ca9c5b7dd5 100644 --- a/Source/Core/AudioCommon/Mixer.h +++ b/Source/Core/AudioCommon/Mixer.h @@ -8,13 +8,13 @@ #include "StdMutex.h" // 16 bit Stereo -#define MAX_SAMPLES (1024 * 2) // 64ms -#define INDEX_MASK (MAX_SAMPLES * 2 - 1) +#define MAX_SAMPLES (1024 * 2) // 64ms +#define INDEX_MASK (MAX_SAMPLES * 2 - 1) -#define LOW_WATERMARK 1280 // 40 ms -#define MAX_FREQ_SHIFT 200 // per 32000 Hz -#define CONTROL_FACTOR 0.2 // in freq_shift per fifo size offset -#define CONTROL_AVG 32 +#define LOW_WATERMARK 1280 // 40 ms +#define MAX_FREQ_SHIFT 200 // per 32000 Hz +#define CONTROL_FACTOR 0.2 // in freq_shift per fifo size offset +#define CONTROL_AVG 32 class CMixer { diff --git a/Source/Core/AudioCommon/XAudio2Stream.cpp b/Source/Core/AudioCommon/XAudio2Stream.cpp index 8c8a2253d0..cbc860bda3 100644 --- a/Source/Core/AudioCommon/XAudio2Stream.cpp +++ b/Source/Core/AudioCommon/XAudio2Stream.cpp @@ -62,16 +62,16 @@ StreamingVoiceContext::StreamingVoiceContext(IXAudio2 *pXAudio2, CMixer *pMixer, { WAVEFORMATEXTENSIBLE wfx = {}; - wfx.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE; - wfx.Format.nSamplesPerSec = m_mixer->GetSampleRate(); - wfx.Format.nChannels = 2; - wfx.Format.wBitsPerSample = 16; - wfx.Format.nBlockAlign = wfx.Format.nChannels*wfx.Format.wBitsPerSample / 8; - wfx.Format.nAvgBytesPerSec = wfx.Format.nSamplesPerSec * wfx.Format.nBlockAlign; - wfx.Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX); + wfx.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE; + wfx.Format.nSamplesPerSec = m_mixer->GetSampleRate(); + wfx.Format.nChannels = 2; + wfx.Format.wBitsPerSample = 16; + wfx.Format.nBlockAlign = wfx.Format.nChannels*wfx.Format.wBitsPerSample / 8; + wfx.Format.nAvgBytesPerSec = wfx.Format.nSamplesPerSec * wfx.Format.nBlockAlign; + wfx.Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX); wfx.Samples.wValidBitsPerSample = 16; - wfx.dwChannelMask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT; - wfx.SubFormat = KSDATAFORMAT_SUBTYPE_PCM; + wfx.dwChannelMask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT; + wfx.SubFormat = KSDATAFORMAT_SUBTYPE_PCM; // create source voice HRESULT hr; @@ -221,7 +221,7 @@ void XAudio2::Update() // XAUDIO2_PERFORMANCE_DATA perfData; // pXAudio2->GetPerformanceData(&perfData); // NOTICE_LOG(DSPHLE, "XAudio2 latency (samples): %i", perfData.CurrentLatencyInSamples); - // NOTICE_LOG(DSPHLE, "XAudio2 total glitches: %i", perfData.GlitchesSinceEngineStarted); + // NOTICE_LOG(DSPHLE, "XAudio2 total glitches: %i", perfData.GlitchesSinceEngineStarted); //} } diff --git a/Source/Core/AudioCommon/XAudio2_7Stream.cpp b/Source/Core/AudioCommon/XAudio2_7Stream.cpp index 782a29a301..c3ddf1b039 100644 --- a/Source/Core/AudioCommon/XAudio2_7Stream.cpp +++ b/Source/Core/AudioCommon/XAudio2_7Stream.cpp @@ -75,16 +75,16 @@ StreamingVoiceContext2_7::StreamingVoiceContext2_7(IXAudio2 *pXAudio2, CMixer *p { WAVEFORMATEXTENSIBLE wfx = {}; - wfx.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE; - wfx.Format.nSamplesPerSec = m_mixer->GetSampleRate(); - wfx.Format.nChannels = 2; - wfx.Format.wBitsPerSample = 16; - wfx.Format.nBlockAlign = wfx.Format.nChannels*wfx.Format.wBitsPerSample / 8; - wfx.Format.nAvgBytesPerSec = wfx.Format.nSamplesPerSec * wfx.Format.nBlockAlign; - wfx.Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX); + wfx.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE; + wfx.Format.nSamplesPerSec = m_mixer->GetSampleRate(); + wfx.Format.nChannels = 2; + wfx.Format.wBitsPerSample = 16; + wfx.Format.nBlockAlign = wfx.Format.nChannels*wfx.Format.wBitsPerSample / 8; + wfx.Format.nAvgBytesPerSec = wfx.Format.nSamplesPerSec * wfx.Format.nBlockAlign; + wfx.Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX); wfx.Samples.wValidBitsPerSample = 16; - wfx.dwChannelMask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT; - wfx.SubFormat = KSDATAFORMAT_SUBTYPE_PCM; + wfx.dwChannelMask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT; + wfx.SubFormat = KSDATAFORMAT_SUBTYPE_PCM; // create source voice HRESULT hr; @@ -222,7 +222,7 @@ void XAudio2_7::Update() // XAUDIO2_PERFORMANCE_DATA perfData; // pXAudio2->GetPerformanceData(&perfData); // NOTICE_LOG(DSPHLE, "XAudio2_7 latency (samples): %i", perfData.CurrentLatencyInSamples); - // NOTICE_LOG(DSPHLE, "XAudio2_7 total glitches: %i", perfData.GlitchesSinceEngineStarted); + // NOTICE_LOG(DSPHLE, "XAudio2_7 total glitches: %i", perfData.GlitchesSinceEngineStarted); //} } diff --git a/Source/Core/Core/ActionReplay.cpp b/Source/Core/Core/ActionReplay.cpp index 9a460754eb..db201ba081 100644 --- a/Source/Core/Core/ActionReplay.cpp +++ b/Source/Core/Core/ActionReplay.cpp @@ -37,37 +37,37 @@ namespace ActionReplay enum { // Zero Code Types - ZCODE_END = 0x00, - ZCODE_NORM = 0x02, - ZCODE_ROW = 0x03, - ZCODE_04 = 0x04, + ZCODE_END = 0x00, + ZCODE_NORM = 0x02, + ZCODE_ROW = 0x03, + ZCODE_04 = 0x04, // Conditional Codes - CONDTIONAL_EQUAL = 0x01, - CONDTIONAL_NOT_EQUAL = 0x02, - CONDTIONAL_LESS_THAN_SIGNED = 0x03, - CONDTIONAL_GREATER_THAN_SIGNED = 0x04, - CONDTIONAL_LESS_THAN_UNSIGNED = 0x05, - CONDTIONAL_GREATER_THAN_UNSIGNED = 0x06, - CONDTIONAL_AND = 0x07, // bitwise AND + CONDTIONAL_EQUAL = 0x01, + CONDTIONAL_NOT_EQUAL = 0x02, + CONDTIONAL_LESS_THAN_SIGNED = 0x03, + CONDTIONAL_GREATER_THAN_SIGNED = 0x04, + CONDTIONAL_LESS_THAN_UNSIGNED = 0x05, + CONDTIONAL_GREATER_THAN_UNSIGNED = 0x06, + CONDTIONAL_AND = 0x07, // bitwise AND // Conditional Line Counts - CONDTIONAL_ONE_LINE = 0x00, - CONDTIONAL_TWO_LINES = 0x01, - CONDTIONAL_ALL_LINES_UNTIL = 0x02, - CONDTIONAL_ALL_LINES = 0x03, + CONDTIONAL_ONE_LINE = 0x00, + CONDTIONAL_TWO_LINES = 0x01, + CONDTIONAL_ALL_LINES_UNTIL = 0x02, + CONDTIONAL_ALL_LINES = 0x03, // Data Types - DATATYPE_8BIT = 0x00, - DATATYPE_16BIT = 0x01, - DATATYPE_32BIT = 0x02, - DATATYPE_32BIT_FLOAT = 0x03, + DATATYPE_8BIT = 0x00, + DATATYPE_16BIT = 0x01, + DATATYPE_32BIT = 0x02, + DATATYPE_32BIT_FLOAT = 0x03, // Normal Code 0 Subtypes - SUB_RAM_WRITE = 0x00, - SUB_WRITE_POINTER = 0x01, - SUB_ADD_CODE = 0x02, - SUB_MASTER_CODE = 0x03, + SUB_RAM_WRITE = 0x00, + SUB_WRITE_POINTER = 0x01, + SUB_ADD_CODE = 0x02, + SUB_MASTER_CODE = 0x03, }; // pointer to the code currently being run, (used by log messages that include the code name) diff --git a/Source/Core/Core/BootManager.cpp b/Source/Core/Core/BootManager.cpp index b3aeeae6bc..f4f0cca870 100644 --- a/Source/Core/Core/BootManager.cpp +++ b/Source/Core/Core/BootManager.cpp @@ -132,27 +132,27 @@ bool BootCore(const std::string& _rFilename) config_cache.bSetFramelimit = false; // General settings - game_ini.Get("Core", "CPUThread", &StartUp.bCPUThread, StartUp.bCPUThread); - game_ini.Get("Core", "SkipIdle", &StartUp.bSkipIdle, StartUp.bSkipIdle); - game_ini.Get("Core", "EnableFPRF", &StartUp.bEnableFPRF, StartUp.bEnableFPRF); - game_ini.Get("Core", "MMU", &StartUp.bMMU, StartUp.bMMU); - game_ini.Get("Core", "TLBHack", &StartUp.bTLBHack, StartUp.bTLBHack); - game_ini.Get("Core", "DCBZ", &StartUp.bDCBZOFF, StartUp.bDCBZOFF); - game_ini.Get("Core", "VBeam", &StartUp.bVBeamSpeedHack, StartUp.bVBeamSpeedHack); - game_ini.Get("Core", "SyncGPU", &StartUp.bSyncGPU, StartUp.bSyncGPU); - game_ini.Get("Core", "FastDiscSpeed", &StartUp.bFastDiscSpeed, StartUp.bFastDiscSpeed); - game_ini.Get("Core", "BlockMerging", &StartUp.bMergeBlocks, StartUp.bMergeBlocks); - game_ini.Get("Core", "DSPHLE", &StartUp.bDSPHLE, StartUp.bDSPHLE); - game_ini.Get("Core", "DSPThread", &StartUp.bDSPThread, StartUp.bDSPThread); - game_ini.Get("Core", "GFXBackend", &StartUp.m_strVideoBackend, StartUp.m_strVideoBackend); - game_ini.Get("Core", "CPUCore", &StartUp.iCPUCore, StartUp.iCPUCore); - game_ini.Get("Core", "HLE_BS2", &StartUp.bHLE_BS2, StartUp.bHLE_BS2); - if (game_ini.Get("Core", "FrameLimit", &SConfig::GetInstance().m_Framelimit, SConfig::GetInstance().m_Framelimit)) + game_ini.Get("Core", "CPUThread", &StartUp.bCPUThread, StartUp.bCPUThread); + game_ini.Get("Core", "SkipIdle", &StartUp.bSkipIdle, StartUp.bSkipIdle); + game_ini.Get("Core", "EnableFPRF", &StartUp.bEnableFPRF, StartUp.bEnableFPRF); + game_ini.Get("Core", "MMU", &StartUp.bMMU, StartUp.bMMU); + game_ini.Get("Core", "TLBHack", &StartUp.bTLBHack, StartUp.bTLBHack); + game_ini.Get("Core", "DCBZ", &StartUp.bDCBZOFF, StartUp.bDCBZOFF); + game_ini.Get("Core", "VBeam", &StartUp.bVBeamSpeedHack, StartUp.bVBeamSpeedHack); + game_ini.Get("Core", "SyncGPU", &StartUp.bSyncGPU, StartUp.bSyncGPU); + game_ini.Get("Core", "FastDiscSpeed", &StartUp.bFastDiscSpeed, StartUp.bFastDiscSpeed); + game_ini.Get("Core", "BlockMerging", &StartUp.bMergeBlocks, StartUp.bMergeBlocks); + game_ini.Get("Core", "DSPHLE", &StartUp.bDSPHLE, StartUp.bDSPHLE); + game_ini.Get("Core", "DSPThread", &StartUp.bDSPThread, StartUp.bDSPThread); + game_ini.Get("Core", "GFXBackend", &StartUp.m_strVideoBackend, StartUp.m_strVideoBackend); + game_ini.Get("Core", "CPUCore", &StartUp.iCPUCore, StartUp.iCPUCore); + game_ini.Get("Core", "HLE_BS2", &StartUp.bHLE_BS2, StartUp.bHLE_BS2); + if (game_ini.Get("Core", "FrameLimit", &SConfig::GetInstance().m_Framelimit, SConfig::GetInstance().m_Framelimit)) config_cache.bSetFramelimit = true; - if (game_ini.Get("DSP", "Volume", &SConfig::GetInstance().m_Volume, SConfig::GetInstance().m_Volume)) + if (game_ini.Get("DSP", "Volume", &SConfig::GetInstance().m_Volume, SConfig::GetInstance().m_Volume)) config_cache.bSetVolume = true; - game_ini.Get("DSP", "EnableJIT", &SConfig::GetInstance().m_EnableJIT, SConfig::GetInstance().m_EnableJIT); - game_ini.Get("DSP", "Backend", &SConfig::GetInstance().sBackend, SConfig::GetInstance().sBackend); + game_ini.Get("DSP", "EnableJIT", &SConfig::GetInstance().m_EnableJIT, SConfig::GetInstance().m_EnableJIT); + game_ini.Get("DSP", "Backend", &SConfig::GetInstance().sBackend, SConfig::GetInstance().sBackend); VideoBackend::ActivateBackend(StartUp.m_strVideoBackend); for (unsigned int i = 0; i < MAX_SI_CHANNELS; ++i) diff --git a/Source/Core/Core/ConfigManager.cpp b/Source/Core/Core/ConfigManager.cpp index 68c009963a..43f77541e6 100644 --- a/Source/Core/Core/ConfigManager.cpp +++ b/Source/Core/Core/ConfigManager.cpp @@ -142,7 +142,7 @@ void SConfig::SaveSettings() ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX)); // load first to not kill unknown stuff // General - ini.Set("General", "LastFilename", m_LastFilename); + ini.Set("General", "LastFilename", m_LastFilename); ini.Set("General", "ShowLag", m_ShowLag); // ISO folders @@ -163,29 +163,29 @@ void SConfig::SaveSettings() } ini.Set("General", "RecursiveGCMPaths", m_RecursiveISOFolder); - ini.Set("General", "NANDRootPath", m_NANDPath); - ini.Set("General", "WirelessMac", m_WirelessMac); + ini.Set("General", "NANDRootPath", m_NANDPath); + ini.Set("General", "WirelessMac", m_WirelessMac); #ifdef USE_GDBSTUB ini.Set("General", "GDBPort", m_LocalCoreStartupParameter.iGDBPort); #endif // Interface - ini.Set("Interface", "ConfirmStop", m_LocalCoreStartupParameter.bConfirmStop); - ini.Set("Interface", "UsePanicHandlers", m_LocalCoreStartupParameter.bUsePanicHandlers); - ini.Set("Interface", "OnScreenDisplayMessages", m_LocalCoreStartupParameter.bOnScreenDisplayMessages); - ini.Set("Interface", "HideCursor", m_LocalCoreStartupParameter.bHideCursor); - ini.Set("Interface", "AutoHideCursor", m_LocalCoreStartupParameter.bAutoHideCursor); - ini.Set("Interface", "MainWindowPosX", (m_LocalCoreStartupParameter.iPosX == -32000) ? 0 : m_LocalCoreStartupParameter.iPosX); // TODO - HAX - ini.Set("Interface", "MainWindowPosY", (m_LocalCoreStartupParameter.iPosY == -32000) ? 0 : m_LocalCoreStartupParameter.iPosY); // TODO - HAX - ini.Set("Interface", "MainWindowWidth", m_LocalCoreStartupParameter.iWidth); - ini.Set("Interface", "MainWindowHeight", m_LocalCoreStartupParameter.iHeight); - ini.Set("Interface", "Language", m_InterfaceLanguage); - ini.Set("Interface", "ShowToolbar", m_InterfaceToolbar); - ini.Set("Interface", "ShowStatusbar", m_InterfaceStatusbar); - ini.Set("Interface", "ShowLogWindow", m_InterfaceLogWindow); - ini.Set("Interface", "ShowLogConfigWindow", m_InterfaceLogConfigWindow); - ini.Set("Interface", "ShowConsole", m_InterfaceConsole); - ini.Set("Interface", "ThemeName40", m_LocalCoreStartupParameter.theme_name); + ini.Set("Interface", "ConfirmStop", m_LocalCoreStartupParameter.bConfirmStop); + ini.Set("Interface", "UsePanicHandlers", m_LocalCoreStartupParameter.bUsePanicHandlers); + ini.Set("Interface", "OnScreenDisplayMessages", m_LocalCoreStartupParameter.bOnScreenDisplayMessages); + ini.Set("Interface", "HideCursor", m_LocalCoreStartupParameter.bHideCursor); + ini.Set("Interface", "AutoHideCursor", m_LocalCoreStartupParameter.bAutoHideCursor); + ini.Set("Interface", "MainWindowPosX", (m_LocalCoreStartupParameter.iPosX == -32000) ? 0 : m_LocalCoreStartupParameter.iPosX); // TODO - HAX + ini.Set("Interface", "MainWindowPosY", (m_LocalCoreStartupParameter.iPosY == -32000) ? 0 : m_LocalCoreStartupParameter.iPosY); // TODO - HAX + ini.Set("Interface", "MainWindowWidth", m_LocalCoreStartupParameter.iWidth); + ini.Set("Interface", "MainWindowHeight", m_LocalCoreStartupParameter.iHeight); + ini.Set("Interface", "Language", m_InterfaceLanguage); + ini.Set("Interface", "ShowToolbar", m_InterfaceToolbar); + ini.Set("Interface", "ShowStatusbar", m_InterfaceStatusbar); + ini.Set("Interface", "ShowLogWindow", m_InterfaceLogWindow); + ini.Set("Interface", "ShowLogConfigWindow", m_InterfaceLogConfigWindow); + ini.Set("Interface", "ShowConsole", m_InterfaceConsole); + ini.Set("Interface", "ThemeName40", m_LocalCoreStartupParameter.theme_name); // Hotkeys for (int i = 0; i < NUM_HOTKEYS; i++) @@ -196,56 +196,56 @@ void SConfig::SaveSettings() } // Display - ini.Set("Display", "FullscreenResolution", m_LocalCoreStartupParameter.strFullscreenResolution); - ini.Set("Display", "Fullscreen", m_LocalCoreStartupParameter.bFullscreen); - ini.Set("Display", "RenderToMain", m_LocalCoreStartupParameter.bRenderToMain); - ini.Set("Display", "RenderWindowXPos", m_LocalCoreStartupParameter.iRenderWindowXPos); - ini.Set("Display", "RenderWindowYPos", m_LocalCoreStartupParameter.iRenderWindowYPos); - ini.Set("Display", "RenderWindowWidth", m_LocalCoreStartupParameter.iRenderWindowWidth); - ini.Set("Display", "RenderWindowHeight", m_LocalCoreStartupParameter.iRenderWindowHeight); - ini.Set("Display", "RenderWindowAutoSize", m_LocalCoreStartupParameter.bRenderWindowAutoSize); - ini.Set("Display", "KeepWindowOnTop", m_LocalCoreStartupParameter.bKeepWindowOnTop); - ini.Set("Display", "ProgressiveScan", m_LocalCoreStartupParameter.bProgressive); - ini.Set("Display", "DisableScreenSaver", m_LocalCoreStartupParameter.bDisableScreenSaver); - ini.Set("Display", "ForceNTSCJ", m_LocalCoreStartupParameter.bForceNTSCJ); + ini.Set("Display", "FullscreenResolution", m_LocalCoreStartupParameter.strFullscreenResolution); + ini.Set("Display", "Fullscreen", m_LocalCoreStartupParameter.bFullscreen); + ini.Set("Display", "RenderToMain", m_LocalCoreStartupParameter.bRenderToMain); + ini.Set("Display", "RenderWindowXPos", m_LocalCoreStartupParameter.iRenderWindowXPos); + ini.Set("Display", "RenderWindowYPos", m_LocalCoreStartupParameter.iRenderWindowYPos); + ini.Set("Display", "RenderWindowWidth", m_LocalCoreStartupParameter.iRenderWindowWidth); + ini.Set("Display", "RenderWindowHeight", m_LocalCoreStartupParameter.iRenderWindowHeight); + ini.Set("Display", "RenderWindowAutoSize", m_LocalCoreStartupParameter.bRenderWindowAutoSize); + ini.Set("Display", "KeepWindowOnTop", m_LocalCoreStartupParameter.bKeepWindowOnTop); + ini.Set("Display", "ProgressiveScan", m_LocalCoreStartupParameter.bProgressive); + ini.Set("Display", "DisableScreenSaver", m_LocalCoreStartupParameter.bDisableScreenSaver); + ini.Set("Display", "ForceNTSCJ", m_LocalCoreStartupParameter.bForceNTSCJ); // Game List Control - ini.Set("GameList", "ListDrives", m_ListDrives); - ini.Set("GameList", "ListWad", m_ListWad); - ini.Set("GameList", "ListWii", m_ListWii); - ini.Set("GameList", "ListGC", m_ListGC); - ini.Set("GameList", "ListJap", m_ListJap); - ini.Set("GameList", "ListPal", m_ListPal); - ini.Set("GameList", "ListUsa", m_ListUsa); - ini.Set("GameList", "ListFrance", m_ListFrance); - ini.Set("GameList", "ListItaly", m_ListItaly); - ini.Set("GameList", "ListKorea", m_ListKorea); - ini.Set("GameList", "ListTaiwan", m_ListTaiwan); - ini.Set("GameList", "ListUnknown", m_ListUnknown); - ini.Set("GameList", "ListSort", m_ListSort); + ini.Set("GameList", "ListDrives", m_ListDrives); + ini.Set("GameList", "ListWad", m_ListWad); + ini.Set("GameList", "ListWii", m_ListWii); + ini.Set("GameList", "ListGC", m_ListGC); + ini.Set("GameList", "ListJap", m_ListJap); + ini.Set("GameList", "ListPal", m_ListPal); + ini.Set("GameList", "ListUsa", m_ListUsa); + ini.Set("GameList", "ListFrance", m_ListFrance); + ini.Set("GameList", "ListItaly", m_ListItaly); + ini.Set("GameList", "ListKorea", m_ListKorea); + ini.Set("GameList", "ListTaiwan", m_ListTaiwan); + ini.Set("GameList", "ListUnknown", m_ListUnknown); + ini.Set("GameList", "ListSort", m_ListSort); ini.Set("GameList", "ListSortSecondary", m_ListSort2); // Core - ini.Set("Core", "HLE_BS2", m_LocalCoreStartupParameter.bHLE_BS2); - ini.Set("Core", "CPUCore", m_LocalCoreStartupParameter.iCPUCore); - ini.Set("Core", "Fastmem", m_LocalCoreStartupParameter.bFastmem); - ini.Set("Core", "CPUThread", m_LocalCoreStartupParameter.bCPUThread); - ini.Set("Core", "DSPThread", m_LocalCoreStartupParameter.bDSPThread); - ini.Set("Core", "DSPHLE", m_LocalCoreStartupParameter.bDSPHLE); - ini.Set("Core", "SkipIdle", m_LocalCoreStartupParameter.bSkipIdle); - ini.Set("Core", "DefaultGCM", m_LocalCoreStartupParameter.m_strDefaultGCM); - ini.Set("Core", "DVDRoot", m_LocalCoreStartupParameter.m_strDVDRoot); - ini.Set("Core", "Apploader", m_LocalCoreStartupParameter.m_strApploader); - ini.Set("Core", "EnableCheats", m_LocalCoreStartupParameter.bEnableCheats); - ini.Set("Core", "SelectedLanguage", m_LocalCoreStartupParameter.SelectedLanguage); - ini.Set("Core", "DPL2Decoder", m_LocalCoreStartupParameter.bDPL2Decoder); - ini.Set("Core", "Latency", m_LocalCoreStartupParameter.iLatency); - ini.Set("Core", "MemcardAPath", m_strMemoryCardA); - ini.Set("Core", "MemcardBPath", m_strMemoryCardB); - ini.Set("Core", "SlotA", m_EXIDevice[0]); - ini.Set("Core", "SlotB", m_EXIDevice[1]); - ini.Set("Core", "SerialPort1", m_EXIDevice[2]); - ini.Set("Core", "BBA_MAC", m_bba_mac); + ini.Set("Core", "HLE_BS2", m_LocalCoreStartupParameter.bHLE_BS2); + ini.Set("Core", "CPUCore", m_LocalCoreStartupParameter.iCPUCore); + ini.Set("Core", "Fastmem", m_LocalCoreStartupParameter.bFastmem); + ini.Set("Core", "CPUThread", m_LocalCoreStartupParameter.bCPUThread); + ini.Set("Core", "DSPThread", m_LocalCoreStartupParameter.bDSPThread); + ini.Set("Core", "DSPHLE", m_LocalCoreStartupParameter.bDSPHLE); + ini.Set("Core", "SkipIdle", m_LocalCoreStartupParameter.bSkipIdle); + ini.Set("Core", "DefaultGCM", m_LocalCoreStartupParameter.m_strDefaultGCM); + ini.Set("Core", "DVDRoot", m_LocalCoreStartupParameter.m_strDVDRoot); + ini.Set("Core", "Apploader", m_LocalCoreStartupParameter.m_strApploader); + ini.Set("Core", "EnableCheats", m_LocalCoreStartupParameter.bEnableCheats); + ini.Set("Core", "SelectedLanguage", m_LocalCoreStartupParameter.SelectedLanguage); + ini.Set("Core", "DPL2Decoder", m_LocalCoreStartupParameter.bDPL2Decoder); + ini.Set("Core", "Latency", m_LocalCoreStartupParameter.iLatency); + ini.Set("Core", "MemcardAPath", m_strMemoryCardA); + ini.Set("Core", "MemcardBPath", m_strMemoryCardB); + ini.Set("Core", "SlotA", m_EXIDevice[0]); + ini.Set("Core", "SlotB", m_EXIDevice[1]); + ini.Set("Core", "SerialPort1", m_EXIDevice[2]); + ini.Set("Core", "BBA_MAC", m_bba_mac); for (int i = 0; i < MAX_SI_CHANNELS; ++i) { ini.Set("Core", StringFromFormat("SIDevice%i", i), m_SIDevice[i]); @@ -254,12 +254,12 @@ void SConfig::SaveSettings() ini.Set("Core", "WiiKeyboard", m_WiiKeyboard); ini.Set("Core", "WiimoteContinuousScanning", m_WiimoteContinuousScanning); ini.Set("Core", "WiimoteEnableSpeaker", m_WiimoteEnableSpeaker); - ini.Set("Core", "RunCompareServer", m_LocalCoreStartupParameter.bRunCompareServer); - ini.Set("Core", "RunCompareClient", m_LocalCoreStartupParameter.bRunCompareClient); - ini.Set("Core", "FrameLimit", m_Framelimit); + ini.Set("Core", "RunCompareServer", m_LocalCoreStartupParameter.bRunCompareServer); + ini.Set("Core", "RunCompareClient", m_LocalCoreStartupParameter.bRunCompareClient); + ini.Set("Core", "FrameLimit", m_Framelimit); // GFX Backend - ini.Set("Core", "GFXBackend", m_LocalCoreStartupParameter.m_strVideoBackend); + ini.Set("Core", "GFXBackend", m_LocalCoreStartupParameter.m_strVideoBackend); // Movie ini.Set("Movie", "PauseMovie", m_PauseMovie); @@ -287,7 +287,7 @@ void SConfig::LoadSettings() // General { - ini.Get("General", "LastFilename", &m_LastFilename); + ini.Get("General", "LastFilename", &m_LastFilename); ini.Get("General", "ShowLag", &m_ShowLag, false); #ifdef USE_GDBSTUB ini.Get("General", "GDBPort", &(m_LocalCoreStartupParameter.iGDBPort), -1); @@ -306,119 +306,119 @@ void SConfig::LoadSettings() } } - ini.Get("General", "RecursiveGCMPaths", &m_RecursiveISOFolder, false); + ini.Get("General", "RecursiveGCMPaths", &m_RecursiveISOFolder, false); - ini.Get("General", "NANDRootPath", &m_NANDPath); + ini.Get("General", "NANDRootPath", &m_NANDPath); m_NANDPath = File::GetUserPath(D_WIIROOT_IDX, m_NANDPath); DiscIO::cUIDsys::AccessInstance().UpdateLocation(); DiscIO::CSharedContent::AccessInstance().UpdateLocation(); - ini.Get("General", "WirelessMac", &m_WirelessMac); + ini.Get("General", "WirelessMac", &m_WirelessMac); } { // Interface - ini.Get("Interface", "ConfirmStop", &m_LocalCoreStartupParameter.bConfirmStop, true); - ini.Get("Interface", "UsePanicHandlers", &m_LocalCoreStartupParameter.bUsePanicHandlers, true); - ini.Get("Interface", "OnScreenDisplayMessages", &m_LocalCoreStartupParameter.bOnScreenDisplayMessages, true); - ini.Get("Interface", "HideCursor", &m_LocalCoreStartupParameter.bHideCursor, false); - ini.Get("Interface", "AutoHideCursor", &m_LocalCoreStartupParameter.bAutoHideCursor, false); - ini.Get("Interface", "MainWindowPosX", &m_LocalCoreStartupParameter.iPosX, 100); - ini.Get("Interface", "MainWindowPosY", &m_LocalCoreStartupParameter.iPosY, 100); - ini.Get("Interface", "MainWindowWidth", &m_LocalCoreStartupParameter.iWidth, 800); - ini.Get("Interface", "MainWindowHeight", &m_LocalCoreStartupParameter.iHeight, 600); - ini.Get("Interface", "Language", &m_InterfaceLanguage, 0); - ini.Get("Interface", "ShowToolbar", &m_InterfaceToolbar, true); - ini.Get("Interface", "ShowStatusbar", &m_InterfaceStatusbar, true); - ini.Get("Interface", "ShowLogWindow", &m_InterfaceLogWindow, false); - ini.Get("Interface", "ShowLogConfigWindow", &m_InterfaceLogConfigWindow, false); - ini.Get("Interface", "ShowConsole", &m_InterfaceConsole, false); - ini.Get("Interface", "ThemeName40", &m_LocalCoreStartupParameter.theme_name, "Clean"); + ini.Get("Interface", "ConfirmStop", &m_LocalCoreStartupParameter.bConfirmStop, true); + ini.Get("Interface", "UsePanicHandlers", &m_LocalCoreStartupParameter.bUsePanicHandlers, true); + ini.Get("Interface", "OnScreenDisplayMessages", &m_LocalCoreStartupParameter.bOnScreenDisplayMessages, true); + ini.Get("Interface", "HideCursor", &m_LocalCoreStartupParameter.bHideCursor, false); + ini.Get("Interface", "AutoHideCursor", &m_LocalCoreStartupParameter.bAutoHideCursor, false); + ini.Get("Interface", "MainWindowPosX", &m_LocalCoreStartupParameter.iPosX, 100); + ini.Get("Interface", "MainWindowPosY", &m_LocalCoreStartupParameter.iPosY, 100); + ini.Get("Interface", "MainWindowWidth", &m_LocalCoreStartupParameter.iWidth, 800); + ini.Get("Interface", "MainWindowHeight", &m_LocalCoreStartupParameter.iHeight, 600); + ini.Get("Interface", "Language", &m_InterfaceLanguage, 0); + ini.Get("Interface", "ShowToolbar", &m_InterfaceToolbar, true); + ini.Get("Interface", "ShowStatusbar", &m_InterfaceStatusbar, true); + ini.Get("Interface", "ShowLogWindow", &m_InterfaceLogWindow, false); + ini.Get("Interface", "ShowLogConfigWindow", &m_InterfaceLogConfigWindow, false); + ini.Get("Interface", "ShowConsole", &m_InterfaceConsole, false); + ini.Get("Interface", "ThemeName40", &m_LocalCoreStartupParameter.theme_name, "Clean"); // Hotkeys for (int i = 0; i < NUM_HOTKEYS; i++) { ini.Get("Hotkeys", g_HKData[i].IniText, - &m_LocalCoreStartupParameter.iHotkey[i], g_HKData[i].DefaultKey); + &m_LocalCoreStartupParameter.iHotkey[i], g_HKData[i].DefaultKey); ini.Get("Hotkeys", std::string(g_HKData[i].IniText) + "Modifier", - &m_LocalCoreStartupParameter.iHotkeyModifier[i], g_HKData[i].DefaultModifier); + &m_LocalCoreStartupParameter.iHotkeyModifier[i], g_HKData[i].DefaultModifier); } // Display - ini.Get("Display", "Fullscreen", &m_LocalCoreStartupParameter.bFullscreen, false); - ini.Get("Display", "FullscreenResolution", &m_LocalCoreStartupParameter.strFullscreenResolution, "Auto"); - ini.Get("Display", "RenderToMain", &m_LocalCoreStartupParameter.bRenderToMain, false); - ini.Get("Display", "RenderWindowXPos", &m_LocalCoreStartupParameter.iRenderWindowXPos, -1); - ini.Get("Display", "RenderWindowYPos", &m_LocalCoreStartupParameter.iRenderWindowYPos, -1); - ini.Get("Display", "RenderWindowWidth", &m_LocalCoreStartupParameter.iRenderWindowWidth, 640); - ini.Get("Display", "RenderWindowHeight", &m_LocalCoreStartupParameter.iRenderWindowHeight, 480); - ini.Get("Display", "RenderWindowAutoSize", &m_LocalCoreStartupParameter.bRenderWindowAutoSize, false); - ini.Get("Display", "KeepWindowOnTop", &m_LocalCoreStartupParameter.bKeepWindowOnTop, false); - ini.Get("Display", "ProgressiveScan", &m_LocalCoreStartupParameter.bProgressive, false); - ini.Get("Display", "DisableScreenSaver", &m_LocalCoreStartupParameter.bDisableScreenSaver, true); - ini.Get("Display", "ForceNTSCJ", &m_LocalCoreStartupParameter.bForceNTSCJ, false); + ini.Get("Display", "Fullscreen", &m_LocalCoreStartupParameter.bFullscreen, false); + ini.Get("Display", "FullscreenResolution", &m_LocalCoreStartupParameter.strFullscreenResolution, "Auto"); + ini.Get("Display", "RenderToMain", &m_LocalCoreStartupParameter.bRenderToMain, false); + ini.Get("Display", "RenderWindowXPos", &m_LocalCoreStartupParameter.iRenderWindowXPos, -1); + ini.Get("Display", "RenderWindowYPos", &m_LocalCoreStartupParameter.iRenderWindowYPos, -1); + ini.Get("Display", "RenderWindowWidth", &m_LocalCoreStartupParameter.iRenderWindowWidth, 640); + ini.Get("Display", "RenderWindowHeight", &m_LocalCoreStartupParameter.iRenderWindowHeight, 480); + ini.Get("Display", "RenderWindowAutoSize", &m_LocalCoreStartupParameter.bRenderWindowAutoSize, false); + ini.Get("Display", "KeepWindowOnTop", &m_LocalCoreStartupParameter.bKeepWindowOnTop, false); + ini.Get("Display", "ProgressiveScan", &m_LocalCoreStartupParameter.bProgressive, false); + ini.Get("Display", "DisableScreenSaver", &m_LocalCoreStartupParameter.bDisableScreenSaver, true); + ini.Get("Display", "ForceNTSCJ", &m_LocalCoreStartupParameter.bForceNTSCJ, false); // Game List Control - ini.Get("GameList", "ListDrives", &m_ListDrives, false); - ini.Get("GameList", "ListWad", &m_ListWad, true); - ini.Get("GameList", "ListWii", &m_ListWii, true); - ini.Get("GameList", "ListGC", &m_ListGC, true); - ini.Get("GameList", "ListJap", &m_ListJap, true); - ini.Get("GameList", "ListPal", &m_ListPal, true); - ini.Get("GameList", "ListUsa", &m_ListUsa, true); + ini.Get("GameList", "ListDrives", &m_ListDrives, false); + ini.Get("GameList", "ListWad", &m_ListWad, true); + ini.Get("GameList", "ListWii", &m_ListWii, true); + ini.Get("GameList", "ListGC", &m_ListGC, true); + ini.Get("GameList", "ListJap", &m_ListJap, true); + ini.Get("GameList", "ListPal", &m_ListPal, true); + ini.Get("GameList", "ListUsa", &m_ListUsa, true); - ini.Get("GameList", "ListFrance", &m_ListFrance, true); - ini.Get("GameList", "ListItaly", &m_ListItaly, true); - ini.Get("GameList", "ListKorea", &m_ListKorea, true); - ini.Get("GameList", "ListTaiwan", &m_ListTaiwan, true); - ini.Get("GameList", "ListUnknown", &m_ListUnknown, true); - ini.Get("GameList", "ListSort", &m_ListSort, 3); - ini.Get("GameList", "ListSortSecondary",&m_ListSort2, 0); + ini.Get("GameList", "ListFrance", &m_ListFrance, true); + ini.Get("GameList", "ListItaly", &m_ListItaly, true); + ini.Get("GameList", "ListKorea", &m_ListKorea, true); + ini.Get("GameList", "ListTaiwan", &m_ListTaiwan, true); + ini.Get("GameList", "ListUnknown", &m_ListUnknown, true); + ini.Get("GameList", "ListSort", &m_ListSort, 3); + ini.Get("GameList", "ListSortSecondary",&m_ListSort2, 0); // Core - ini.Get("Core", "HLE_BS2", &m_LocalCoreStartupParameter.bHLE_BS2, false); + ini.Get("Core", "HLE_BS2", &m_LocalCoreStartupParameter.bHLE_BS2, false); #ifdef _M_ARM - ini.Get("Core", "CPUCore", &m_LocalCoreStartupParameter.iCPUCore, 3); + ini.Get("Core", "CPUCore", &m_LocalCoreStartupParameter.iCPUCore, 3); #else - ini.Get("Core", "CPUCore", &m_LocalCoreStartupParameter.iCPUCore, 1); + ini.Get("Core", "CPUCore", &m_LocalCoreStartupParameter.iCPUCore, 1); #endif - ini.Get("Core", "Fastmem", &m_LocalCoreStartupParameter.bFastmem, true); - ini.Get("Core", "DSPThread", &m_LocalCoreStartupParameter.bDSPThread, false); - ini.Get("Core", "DSPHLE", &m_LocalCoreStartupParameter.bDSPHLE, true); - ini.Get("Core", "CPUThread", &m_LocalCoreStartupParameter.bCPUThread, true); - ini.Get("Core", "SkipIdle", &m_LocalCoreStartupParameter.bSkipIdle, true); - ini.Get("Core", "DefaultGCM", &m_LocalCoreStartupParameter.m_strDefaultGCM); - ini.Get("Core", "DVDRoot", &m_LocalCoreStartupParameter.m_strDVDRoot); - ini.Get("Core", "Apploader", &m_LocalCoreStartupParameter.m_strApploader); - ini.Get("Core", "EnableCheats", &m_LocalCoreStartupParameter.bEnableCheats, false); - ini.Get("Core", "SelectedLanguage", &m_LocalCoreStartupParameter.SelectedLanguage, 0); - ini.Get("Core", "DPL2Decoder", &m_LocalCoreStartupParameter.bDPL2Decoder, false); - ini.Get("Core", "Latency", &m_LocalCoreStartupParameter.iLatency, 2); - ini.Get("Core", "MemcardAPath", &m_strMemoryCardA); - ini.Get("Core", "MemcardBPath", &m_strMemoryCardB); - ini.Get("Core", "SlotA", (int*)&m_EXIDevice[0], EXIDEVICE_MEMORYCARD); - ini.Get("Core", "SlotB", (int*)&m_EXIDevice[1], EXIDEVICE_NONE); - ini.Get("Core", "SerialPort1", (int*)&m_EXIDevice[2], EXIDEVICE_NONE); - ini.Get("Core", "BBA_MAC", &m_bba_mac); - ini.Get("Core", "TimeProfiling",&m_LocalCoreStartupParameter.bJITILTimeProfiling, false); - ini.Get("Core", "OutputIR", &m_LocalCoreStartupParameter.bJITILOutputIR, false); + ini.Get("Core", "Fastmem", &m_LocalCoreStartupParameter.bFastmem, true); + ini.Get("Core", "DSPThread", &m_LocalCoreStartupParameter.bDSPThread, false); + ini.Get("Core", "DSPHLE", &m_LocalCoreStartupParameter.bDSPHLE, true); + ini.Get("Core", "CPUThread", &m_LocalCoreStartupParameter.bCPUThread, true); + ini.Get("Core", "SkipIdle", &m_LocalCoreStartupParameter.bSkipIdle, true); + ini.Get("Core", "DefaultGCM", &m_LocalCoreStartupParameter.m_strDefaultGCM); + ini.Get("Core", "DVDRoot", &m_LocalCoreStartupParameter.m_strDVDRoot); + ini.Get("Core", "Apploader", &m_LocalCoreStartupParameter.m_strApploader); + ini.Get("Core", "EnableCheats", &m_LocalCoreStartupParameter.bEnableCheats, false); + ini.Get("Core", "SelectedLanguage", &m_LocalCoreStartupParameter.SelectedLanguage, 0); + ini.Get("Core", "DPL2Decoder", &m_LocalCoreStartupParameter.bDPL2Decoder, false); + ini.Get("Core", "Latency", &m_LocalCoreStartupParameter.iLatency, 2); + ini.Get("Core", "MemcardAPath", &m_strMemoryCardA); + ini.Get("Core", "MemcardBPath", &m_strMemoryCardB); + ini.Get("Core", "SlotA", (int*)&m_EXIDevice[0], EXIDEVICE_MEMORYCARD); + ini.Get("Core", "SlotB", (int*)&m_EXIDevice[1], EXIDEVICE_NONE); + ini.Get("Core", "SerialPort1", (int*)&m_EXIDevice[2], EXIDEVICE_NONE); + ini.Get("Core", "BBA_MAC", &m_bba_mac); + ini.Get("Core", "TimeProfiling", &m_LocalCoreStartupParameter.bJITILTimeProfiling, false); + ini.Get("Core", "OutputIR", &m_LocalCoreStartupParameter.bJITILOutputIR, false); for (int i = 0; i < MAX_SI_CHANNELS; ++i) { ini.Get("Core", StringFromFormat("SIDevice%i", i), (u32*)&m_SIDevice[i], (i == 0) ? SIDEVICE_GC_CONTROLLER : SIDEVICE_NONE); } - ini.Get("Core", "WiiSDCard", &m_WiiSDCard, false); - ini.Get("Core", "WiiKeyboard", &m_WiiKeyboard, false); - ini.Get("Core", "WiimoteContinuousScanning", &m_WiimoteContinuousScanning, false); - ini.Get("Core", "WiimoteEnableSpeaker", &m_WiimoteEnableSpeaker, true); - ini.Get("Core", "RunCompareServer", &m_LocalCoreStartupParameter.bRunCompareServer, false); - ini.Get("Core", "RunCompareClient", &m_LocalCoreStartupParameter.bRunCompareClient, false); - ini.Get("Core", "MMU", &m_LocalCoreStartupParameter.bMMU, false); - ini.Get("Core", "TLBHack", &m_LocalCoreStartupParameter.bTLBHack, false); - ini.Get("Core", "BBDumpPort", &m_LocalCoreStartupParameter.iBBDumpPort, -1); - ini.Get("Core", "VBeam", &m_LocalCoreStartupParameter.bVBeamSpeedHack, false); - ini.Get("Core", "SyncGPU", &m_LocalCoreStartupParameter.bSyncGPU, false); - ini.Get("Core", "FastDiscSpeed", &m_LocalCoreStartupParameter.bFastDiscSpeed, false); - ini.Get("Core", "DCBZ", &m_LocalCoreStartupParameter.bDCBZOFF, false); - ini.Get("Core", "FrameLimit", &m_Framelimit, 1); // auto frame limit by default + ini.Get("Core", "WiiSDCard", &m_WiiSDCard, false); + ini.Get("Core", "WiiKeyboard", &m_WiiKeyboard, false); + ini.Get("Core", "WiimoteContinuousScanning", &m_WiimoteContinuousScanning, false); + ini.Get("Core", "WiimoteEnableSpeaker", &m_WiimoteEnableSpeaker, true); + ini.Get("Core", "RunCompareServer", &m_LocalCoreStartupParameter.bRunCompareServer, false); + ini.Get("Core", "RunCompareClient", &m_LocalCoreStartupParameter.bRunCompareClient, false); + ini.Get("Core", "MMU", &m_LocalCoreStartupParameter.bMMU, false); + ini.Get("Core", "TLBHack", &m_LocalCoreStartupParameter.bTLBHack, false); + ini.Get("Core", "BBDumpPort", &m_LocalCoreStartupParameter.iBBDumpPort, -1); + ini.Get("Core", "VBeam", &m_LocalCoreStartupParameter.bVBeamSpeedHack, false); + ini.Get("Core", "SyncGPU", &m_LocalCoreStartupParameter.bSyncGPU, false); + ini.Get("Core", "FastDiscSpeed", &m_LocalCoreStartupParameter.bFastDiscSpeed, false); + ini.Get("Core", "DCBZ", &m_LocalCoreStartupParameter.bDCBZOFF, false); + ini.Get("Core", "FrameLimit", &m_Framelimit, 1); // auto frame limit by default // GFX Backend ini.Get("Core", "GFXBackend", &m_LocalCoreStartupParameter.m_strVideoBackend, ""); diff --git a/Source/Core/Core/DSP/DSPAnalyzer.cpp b/Source/Core/Core/DSP/DSPAnalyzer.cpp index c682cdf415..043451f21e 100644 --- a/Source/Core/Core/DSP/DSPAnalyzer.cpp +++ b/Source/Core/Core/DSP/DSPAnalyzer.cpp @@ -24,39 +24,39 @@ u8 code_flags[ISPACE]; const u16 idle_skip_sigs[NUM_IDLE_SIGS][MAX_IDLE_SIG_SIZE + 1] = { // From AX: - { 0x26fc, // LRS $30, @DMBH - 0x02c0, 0x8000, // ANDCF $30, #0x8000 - 0x029d, 0xFFFF, // JLZ 0x027a + { 0x26fc, // LRS $30, @DMBH + 0x02c0, 0x8000, // ANDCF $30, #0x8000 + 0x029d, 0xFFFF, // JLZ 0x027a 0, 0 }, // RET - { 0x27fc, // LRS $31, @DMBH - 0x03c0, 0x8000, // ANDCF $31, #0x8000 - 0x029d, 0xFFFF, // JLZ 0x027a + { 0x27fc, // LRS $31, @DMBH + 0x03c0, 0x8000, // ANDCF $31, #0x8000 + 0x029d, 0xFFFF, // JLZ 0x027a 0, 0 }, // RET - { 0x26fe, // LRS $30, @CMBH - 0x02c0, 0x8000, // ANDCF $30, #0x8000 - 0x029c, 0xFFFF, // JLNZ 0x0280 + { 0x26fe, // LRS $30, @CMBH + 0x02c0, 0x8000, // ANDCF $30, #0x8000 + 0x029c, 0xFFFF, // JLNZ 0x0280 0, 0 }, // RET - { 0x27fe, // LRS $31, @CMBH - 0x03c0, 0x8000, // ANDCF $31, #0x8000 - 0x029c, 0xFFFF, // JLNZ 0x0280 + { 0x27fe, // LRS $31, @CMBH + 0x03c0, 0x8000, // ANDCF $31, #0x8000 + 0x029c, 0xFFFF, // JLNZ 0x0280 0, 0 }, // RET - { 0x26fc, // lrs $AC0.M, @DMBH - 0x02a0, 0x8000, // andf $AC0.M, #0x8000 - 0x029c, 0xFFFF, // jlnz 0x???? + { 0x26fc, // LRS $AC0.M, @DMBH + 0x02a0, 0x8000, // ANDF $AC0.M, #0x8000 + 0x029c, 0xFFFF, // JLNZ 0x???? 0, 0 }, - { 0x27fc, // lrs $AC1.M, @DMBH - 0x03a0, 0x8000, // andf $AC1.M, #0x8000 - 0x029c, 0xFFFF, // jlnz 0x???? + { 0x27fc, // LRS $AC1.M, @DMBH + 0x03a0, 0x8000, // ANDF $AC1.M, #0x8000 + 0x029c, 0xFFFF, // JLNZ 0x???? 0, 0 }, // From Zelda: - { 0x00de, 0xFFFE, // LR $AC0.M, @CMBH - 0x02c0, 0x8000, // ANDCF $AC0.M, #0x8000 - 0x029c, 0xFFFF, // JLNZ 0x05cf + { 0x00de, 0xFFFE, // LR $AC0.M, @CMBH + 0x02c0, 0x8000, // ANDCF $AC0.M, #0x8000 + 0x029c, 0xFFFF, // JLNZ 0x05cf 0 }, // From Zelda - experimental - { 0x00da, 0x0352, // lr $AX0.H, @0x0352 - 0x8600, // tstaxh $AX0.H - 0x0295, 0xFFFF, // jz 0x???? + { 0x00da, 0x0352, // LR $AX0.H, @0x0352 + 0x8600, // TSTAXH $AX0.H + 0x0295, 0xFFFF, // JZ 0x???? 0, 0 } }; diff --git a/Source/Core/Core/DSP/DSPCore.h b/Source/Core/Core/DSP/DSPCore.h index 6bd1e959a6..39618d832a 100644 --- a/Source/Core/Core/DSP/DSPCore.h +++ b/Source/Core/Core/DSP/DSPCore.h @@ -30,154 +30,154 @@ #include "DSPBreakpoints.h" #include "DSPEmitter.h" -#define DSP_IRAM_BYTE_SIZE 0x2000 -#define DSP_IRAM_SIZE 0x1000 -#define DSP_IRAM_MASK 0x0fff +#define DSP_IRAM_BYTE_SIZE 0x2000 +#define DSP_IRAM_SIZE 0x1000 +#define DSP_IRAM_MASK 0x0fff -#define DSP_IROM_BYTE_SIZE 0x2000 -#define DSP_IROM_SIZE 0x1000 -#define DSP_IROM_MASK 0x0fff +#define DSP_IROM_BYTE_SIZE 0x2000 +#define DSP_IROM_SIZE 0x1000 +#define DSP_IROM_MASK 0x0fff -#define DSP_DRAM_BYTE_SIZE 0x2000 -#define DSP_DRAM_SIZE 0x1000 -#define DSP_DRAM_MASK 0x0fff +#define DSP_DRAM_BYTE_SIZE 0x2000 +#define DSP_DRAM_SIZE 0x1000 +#define DSP_DRAM_MASK 0x0fff -#define DSP_COEF_BYTE_SIZE 0x1000 -#define DSP_COEF_SIZE 0x800 -#define DSP_COEF_MASK 0x7ff +#define DSP_COEF_BYTE_SIZE 0x1000 +#define DSP_COEF_SIZE 0x800 +#define DSP_COEF_MASK 0x7ff -#define DSP_RESET_VECTOR 0x8000 +#define DSP_RESET_VECTOR 0x8000 -#define DSP_STACK_DEPTH 0x20 -#define DSP_STACK_MASK 0x1f +#define DSP_STACK_DEPTH 0x20 +#define DSP_STACK_MASK 0x1f -#define DSP_CR_IMEM 2 -#define DSP_CR_DMEM 0 -#define DSP_CR_TO_CPU 1 -#define DSP_CR_FROM_CPU 0 +#define DSP_CR_IMEM 2 +#define DSP_CR_DMEM 0 +#define DSP_CR_TO_CPU 1 +#define DSP_CR_FROM_CPU 0 // Register table taken from libasnd -#define DSP_REG_AR0 0x00 // address registers -#define DSP_REG_AR1 0x01 -#define DSP_REG_AR2 0x02 -#define DSP_REG_AR3 0x03 +#define DSP_REG_AR0 0x00 // address registers +#define DSP_REG_AR1 0x01 +#define DSP_REG_AR2 0x02 +#define DSP_REG_AR3 0x03 -#define DSP_REG_IX0 0x04 // indexing registers (actually, mostly used as increments) -#define DSP_REG_IX1 0x05 -#define DSP_REG_IX2 0x06 -#define DSP_REG_IX3 0x07 +#define DSP_REG_IX0 0x04 // indexing registers (actually, mostly used as increments) +#define DSP_REG_IX1 0x05 +#define DSP_REG_IX2 0x06 +#define DSP_REG_IX3 0x07 -#define DSP_REG_WR0 0x08 // address wrapping registers. should be initialized to 0xFFFF if not used. -#define DSP_REG_WR1 0x09 -#define DSP_REG_WR2 0x0a -#define DSP_REG_WR3 0x0b +#define DSP_REG_WR0 0x08 // address wrapping registers. should be initialized to 0xFFFF if not used. +#define DSP_REG_WR1 0x09 +#define DSP_REG_WR2 0x0a +#define DSP_REG_WR3 0x0b -#define DSP_REG_ST0 0x0c // stacks. -#define DSP_REG_ST1 0x0d -#define DSP_REG_ST2 0x0e -#define DSP_REG_ST3 0x0f +#define DSP_REG_ST0 0x0c // stacks. +#define DSP_REG_ST1 0x0d +#define DSP_REG_ST2 0x0e +#define DSP_REG_ST3 0x0f -#define DSP_REG_CR 0x12 // Seems to be the top 8 bits of LRS/SRS. -#define DSP_REG_SR 0x13 +#define DSP_REG_CR 0x12 // Seems to be the top 8 bits of LRS/SRS. +#define DSP_REG_SR 0x13 -#define DSP_REG_PRODL 0x14 // product. -#define DSP_REG_PRODM 0x15 -#define DSP_REG_PRODH 0x16 -#define DSP_REG_PRODM2 0x17 +#define DSP_REG_PRODL 0x14 // product. +#define DSP_REG_PRODM 0x15 +#define DSP_REG_PRODH 0x16 +#define DSP_REG_PRODM2 0x17 -#define DSP_REG_AXL0 0x18 -#define DSP_REG_AXL1 0x19 -#define DSP_REG_AXH0 0x1a -#define DSP_REG_AXH1 0x1b +#define DSP_REG_AXL0 0x18 +#define DSP_REG_AXL1 0x19 +#define DSP_REG_AXH0 0x1a +#define DSP_REG_AXH1 0x1b -#define DSP_REG_ACC0 0x1c // accumulator (global) -#define DSP_REG_ACC1 0x1d +#define DSP_REG_ACC0 0x1c // accumulator (global) +#define DSP_REG_ACC1 0x1d -#define DSP_REG_ACL0 0x1c // Low accumulator -#define DSP_REG_ACL1 0x1d -#define DSP_REG_ACM0 0x1e // Mid accumulator -#define DSP_REG_ACM1 0x1f -#define DSP_REG_ACH0 0x10 // Sign extended 8 bit register 0 -#define DSP_REG_ACH1 0x11 // Sign extended 8 bit register 1 +#define DSP_REG_ACL0 0x1c // Low accumulator +#define DSP_REG_ACL1 0x1d +#define DSP_REG_ACM0 0x1e // Mid accumulator +#define DSP_REG_ACM1 0x1f +#define DSP_REG_ACH0 0x10 // Sign extended 8 bit register 0 +#define DSP_REG_ACH1 0x11 // Sign extended 8 bit register 1 // Hardware registers address -#define DSP_COEF_A1_0 0xa0 +#define DSP_COEF_A1_0 0xa0 -#define DSP_DSCR 0xc9 // DSP DMA Control Reg -#define DSP_DSPA 0xcd // DSP DMA Address (DSP) -#define DSP_DSBL 0xcb // DSP DMA Block Length -#define DSP_DSMAH 0xce // DSP DMA Address High (External) -#define DSP_DSMAL 0xcf // DSP DMA Address Low (External) +#define DSP_DSCR 0xc9 // DSP DMA Control Reg +#define DSP_DSPA 0xcd // DSP DMA Address (DSP) +#define DSP_DSBL 0xcb // DSP DMA Block Length +#define DSP_DSMAH 0xce // DSP DMA Address High (External) +#define DSP_DSMAL 0xcf // DSP DMA Address Low (External) -#define DSP_FORMAT 0xd1 // Sample format -#define DSP_ACUNK 0xd2 // Set to 3 on my dumps -#define DSP_ACDATA1 0xd3 // used only by Zelda ucodes -#define DSP_ACSAH 0xd4 // Start of loop -#define DSP_ACSAL 0xd5 -#define DSP_ACEAH 0xd6 // End of sample (and loop) -#define DSP_ACEAL 0xd7 -#define DSP_ACCAH 0xd8 // Current playback position -#define DSP_ACCAL 0xd9 -#define DSP_PRED_SCALE 0xda // ADPCM predictor and scale -#define DSP_YN1 0xdb -#define DSP_YN2 0xdc -#define DSP_ACCELERATOR 0xdd // ADPCM accelerator read. Used by AX. -#define DSP_GAIN 0xde -#define DSP_ACUNK2 0xdf // Set to 0xc on my dumps +#define DSP_FORMAT 0xd1 // Sample format +#define DSP_ACUNK 0xd2 // Set to 3 on my dumps +#define DSP_ACDATA1 0xd3 // used only by Zelda ucodes +#define DSP_ACSAH 0xd4 // Start of loop +#define DSP_ACSAL 0xd5 +#define DSP_ACEAH 0xd6 // End of sample (and loop) +#define DSP_ACEAL 0xd7 +#define DSP_ACCAH 0xd8 // Current playback position +#define DSP_ACCAL 0xd9 +#define DSP_PRED_SCALE 0xda // ADPCM predictor and scale +#define DSP_YN1 0xdb +#define DSP_YN2 0xdc +#define DSP_ACCELERATOR 0xdd // ADPCM accelerator read. Used by AX. +#define DSP_GAIN 0xde +#define DSP_ACUNK2 0xdf // Set to 0xc on my dumps -#define DSP_AMDM 0xef // ARAM DMA Request Mask 0: DMA with ARAM unmasked 1: masked +#define DSP_AMDM 0xef // ARAM DMA Request Mask 0: DMA with ARAM unmasked 1: masked -#define DSP_DIRQ 0xfb // DSP Irq Rest -#define DSP_DMBH 0xfc // DSP Mailbox H -#define DSP_DMBL 0xfd // DSP Mailbox L -#define DSP_CMBH 0xfe // CPU Mailbox H -#define DSP_CMBL 0xff // CPU Mailbox L +#define DSP_DIRQ 0xfb // DSP Irq Rest +#define DSP_DMBH 0xfc // DSP Mailbox H +#define DSP_DMBL 0xfd // DSP Mailbox L +#define DSP_CMBH 0xfe // CPU Mailbox H +#define DSP_CMBL 0xff // CPU Mailbox L -#define DMA_TO_DSP 0 -#define DMA_TO_CPU 1 +#define DMA_TO_DSP 0 +#define DMA_TO_CPU 1 // Stacks -#define DSP_STACK_C 0 -#define DSP_STACK_D 1 +#define DSP_STACK_C 0 +#define DSP_STACK_D 1 // cr (Not g_dsp.r[CR]) bits // See HW/DSP.cpp. -#define CR_EXTERNAL_INT 0x0002 -#define CR_HALT 0x0004 -#define CR_INIT 0x0400 +#define CR_EXTERNAL_INT 0x0002 +#define CR_HALT 0x0004 +#define CR_INIT 0x0400 // SR bits -#define SR_CARRY 0x0001 -#define SR_OVERFLOW 0x0002 -#define SR_ARITH_ZERO 0x0004 -#define SR_SIGN 0x0008 -#define SR_OVER_S32 0x0010 // set when there was mod/tst/cmp on accu and result is over s32 -#define SR_TOP2BITS 0x0020 // if the upper (ac?.m/ax?.h) 2 bits are equal -#define SR_LOGIC_ZERO 0x0040 -#define SR_OVERFLOW_STICKY 0x0080 // set at the same time as 0x2 (under same conditions) - but not cleared the same -#define SR_100 0x0100 // unknown -#define SR_INT_ENABLE 0x0200 // Not 100% sure but duddie says so. This should replace the hack, if so. -#define SR_400 0x0400 // unknown -#define SR_EXT_INT_ENABLE 0x0800 // Appears in zelda - seems to disable external interrupts -#define SR_1000 0x1000 // unknown -#define SR_MUL_MODIFY 0x2000 // 1 = normal. 0 = x2 (M0, M2) (Free mul by 2) -#define SR_40_MODE_BIT 0x4000 // 0 = "16", 1 = "40" (SET16, SET40) Controls sign extension when loading mid accums and data saturation for stores from mid accums. -#define SR_MUL_UNSIGNED 0x8000 // 0 = normal. 1 = unsigned (CLR15, SET15) If set, treats ax?.l as unsigned (MULX family only). +#define SR_CARRY 0x0001 +#define SR_OVERFLOW 0x0002 +#define SR_ARITH_ZERO 0x0004 +#define SR_SIGN 0x0008 +#define SR_OVER_S32 0x0010 // set when there was mod/tst/cmp on accu and result is over s32 +#define SR_TOP2BITS 0x0020 // if the upper (ac?.m/ax?.h) 2 bits are equal +#define SR_LOGIC_ZERO 0x0040 +#define SR_OVERFLOW_STICKY 0x0080 // set at the same time as 0x2 (under same conditions) - but not cleared the same +#define SR_100 0x0100 // unknown +#define SR_INT_ENABLE 0x0200 // Not 100% sure but duddie says so. This should replace the hack, if so. +#define SR_400 0x0400 // unknown +#define SR_EXT_INT_ENABLE 0x0800 // Appears in zelda - seems to disable external interrupts +#define SR_1000 0x1000 // unknown +#define SR_MUL_MODIFY 0x2000 // 1 = normal. 0 = x2 (M0, M2) (Free mul by 2) +#define SR_40_MODE_BIT 0x4000 // 0 = "16", 1 = "40" (SET16, SET40) Controls sign extension when loading mid accums and data saturation for stores from mid accums. +#define SR_MUL_UNSIGNED 0x8000 // 0 = normal. 1 = unsigned (CLR15, SET15) If set, treats ax?.l as unsigned (MULX family only). // This should be the bits affected by CMP. Does not include logic zero. #define SR_CMP_MASK 0x3f // exceptions vector -#define EXP_STOVF 1 // 0x0002 stack under/over flow -#define EXP_2 2 // 0x0004 -#define EXP_3 3 // 0x0006 -#define EXP_4 4 // 0x0008 -#define EXP_ACCOV 5 // 0x000a accelerator address overflow -#define EXP_6 6 // 0x000c -#define EXP_INT 7 // 0x000e external int (message from cpu) +#define EXP_STOVF 1 // 0x0002 stack under/over flow +#define EXP_2 2 // 0x0004 +#define EXP_3 3 // 0x0006 +#define EXP_4 4 // 0x0008 +#define EXP_ACCOV 5 // 0x000a accelerator address overflow +#define EXP_6 6 // 0x000c +#define EXP_INT 7 // 0x000e external int (message from cpu) typedef struct { u16 ar[4]; diff --git a/Source/Core/Core/DSP/DSPEmitter.h b/Source/Core/Core/DSP/DSPEmitter.h index 78855553e2..9f8ffe7727 100644 --- a/Source/Core/Core/DSP/DSPEmitter.h +++ b/Source/Core/Core/DSP/DSPEmitter.h @@ -41,10 +41,8 @@ public: // CC Util void Update_SR_Register64(Gen::X64Reg val = Gen::EAX); - void Update_SR_Register64_Carry(Gen::X64Reg val, - Gen::X64Reg carry_ovfl); - void Update_SR_Register64_Carry2(Gen::X64Reg val, - Gen::X64Reg carry_ovfl); + void Update_SR_Register64_Carry(Gen::X64Reg val, Gen::X64Reg carry_ovfl); + void Update_SR_Register64_Carry2(Gen::X64Reg val, Gen::X64Reg carry_ovfl); void Update_SR_Register16(Gen::X64Reg val = Gen::EAX); void Update_SR_Register16_OverS32(Gen::X64Reg val = Gen::EAX); diff --git a/Source/Core/Core/DSP/DSPHWInterface.cpp b/Source/Core/Core/DSP/DSPHWInterface.cpp index 92d9c5d67a..a8ecd3ad2d 100644 --- a/Source/Core/Core/DSP/DSPHWInterface.cpp +++ b/Source/Core/Core/DSP/DSPHWInterface.cpp @@ -310,15 +310,10 @@ static void gdsp_ddma_out(u16 dsp_addr, u32 addr, u32 size) static void gdsp_do_dma() { - u16 ctl; - u32 addr; - u16 dsp_addr; - u16 len; - - addr = (g_dsp.ifx_regs[DSP_DSMAH] << 16) | g_dsp.ifx_regs[DSP_DSMAL]; - ctl = g_dsp.ifx_regs[DSP_DSCR]; - dsp_addr = g_dsp.ifx_regs[DSP_DSPA] * 2; - len = g_dsp.ifx_regs[DSP_DSBL]; + u32 addr = (g_dsp.ifx_regs[DSP_DSMAH] << 16) | g_dsp.ifx_regs[DSP_DSMAL]; + u16 ctl = g_dsp.ifx_regs[DSP_DSCR]; + u16 dsp_addr = g_dsp.ifx_regs[DSP_DSPA] * 2; + u16 len = g_dsp.ifx_regs[DSP_DSBL]; if (len > 0x4000) { diff --git a/Source/Core/Core/Debugger/Dump.cpp b/Source/Core/Core/Debugger/Dump.cpp index 8c4a23ca1a..bdd4f152d7 100644 --- a/Source/Core/Core/Debugger/Dump.cpp +++ b/Source/Core/Core/Debugger/Dump.cpp @@ -31,14 +31,12 @@ CDump::~CDump(void) } } -int -CDump::GetNumberOfSteps(void) +int CDump::GetNumberOfSteps(void) { return (int)(m_size / STRUCTUR_SIZE); } -u32 -CDump::GetGPR(int _step, int _gpr) +u32 CDump::GetGPR(int _step, int _gpr) { u32 offset = _step * STRUCTUR_SIZE; @@ -48,8 +46,7 @@ CDump::GetGPR(int _step, int _gpr) return Read32(offset + OFFSET_GPR + (_gpr * 4)); } -u32 -CDump::GetPC(int _step) +u32 CDump::GetPC(int _step) { u32 offset = _step * STRUCTUR_SIZE; @@ -59,13 +56,12 @@ CDump::GetPC(int _step) return Read32(offset + OFFSET_PC); } -u32 -CDump::Read32(u32 _pos) +u32 CDump::Read32(u32 _pos) { u32 result = (m_pData[_pos+0] << 24) | - (m_pData[_pos+1] << 16) | - (m_pData[_pos+2] << 8) | - (m_pData[_pos+3] << 0); + (m_pData[_pos+1] << 16) | + (m_pData[_pos+2] << 8) | + (m_pData[_pos+3] << 0); return result; } diff --git a/Source/Core/Core/Debugger/GCELF.h b/Source/Core/Core/Debugger/GCELF.h index cc49c7492c..5354f53894 100644 --- a/Source/Core/Core/Debugger/GCELF.h +++ b/Source/Core/Core/Debugger/GCELF.h @@ -5,43 +5,43 @@ #pragma once // ELF File Types -#define ET_NONE 0 // No file type -#define ET_REL 1 // Relocatable file -#define ET_EXEC 2 // Executable file -#define ET_DYN 3 // Shared object file -#define ET_CORE 4 // Core file -#define ET_LOPROC 0xFF00 // Processor specific -#define ET_HIPROC 0xFFFF // Processor specific +#define ET_NONE 0 // No file type +#define ET_REL 1 // Relocatable file +#define ET_EXEC 2 // Executable file +#define ET_DYN 3 // Shared object file +#define ET_CORE 4 // Core file +#define ET_LOPROC 0xFF00 // Processor specific +#define ET_HIPROC 0xFFFF // Processor specific // ELF Machine Types -#define EM_NONE 0 // No machine -#define EM_M32 1 // AT&T WE 32100 -#define EM_SPARC 2 // SPARC -#define EM_386 3 // Intel Architecture -#define EM_68K 4 // Motorola 68000 -#define EM_88K 5 // Motorola 88000 -#define EM_860 6 // Intel 80860 -#define EM_MIPS 7 // MIPS RS3000 Big-Endian -#define EM_MIPS_RS4_BE 8 // MIPS RS4000 Big-Endian -#define EM_ARM 40 // ARM/Thumb Architecture +#define EM_NONE 0 // No machine +#define EM_M32 1 // AT&T WE 32100 +#define EM_SPARC 2 // SPARC +#define EM_386 3 // Intel Architecture +#define EM_68K 4 // Motorola 68000 +#define EM_88K 5 // Motorola 88000 +#define EM_860 6 // Intel 80860 +#define EM_MIPS 7 // MIPS RS3000 Big-Endian +#define EM_MIPS_RS4_BE 8 // MIPS RS4000 Big-Endian +#define EM_ARM 40 // ARM/Thumb Architecture // ELF Version Types -#define EV_NONE 0 // Invalid version -#define EV_CURRENT 1 // Current version +#define EV_NONE 0 // Invalid version +#define EV_CURRENT 1 // Current version // ELF Section Header Types -#define SHT_NULL 0 -#define SHT_PROGBITS 1 -#define SHT_SYMTAB 2 -#define SHT_STRTAB 3 -#define SHT_RELA 4 -#define SHT_HASH 5 -#define SHT_DYNAMIC 6 -#define SHT_NOTE 7 -#define SHT_NOBITS 8 -#define SHT_REL 9 -#define SHT_SHLIB 10 -#define SHT_DYNSYM 11 +#define SHT_NULL 0 +#define SHT_PROGBITS 1 +#define SHT_SYMTAB 2 +#define SHT_STRTAB 3 +#define SHT_RELA 4 +#define SHT_HASH 5 +#define SHT_DYNAMIC 6 +#define SHT_NOTE 7 +#define SHT_NOBITS 8 +#define SHT_REL 9 +#define SHT_SHLIB 10 +#define SHT_DYNSYM 11 typedef struct diff --git a/Source/Core/Core/Debugger/PPCDebugInterface.cpp b/Source/Core/Core/Debugger/PPCDebugInterface.cpp index 4b224d5677..0fb1363f9c 100644 --- a/Source/Core/Core/Debugger/PPCDebugInterface.cpp +++ b/Source/Core/Core/Debugger/PPCDebugInterface.cpp @@ -75,9 +75,9 @@ unsigned int PPCDebugInterface::readExtraMemory(int memory, unsigned int address return Memory::ReadUnchecked_U32(address); case 1: return (DSP::ReadARAM(address) << 24) | - (DSP::ReadARAM(address + 1) << 16) | - (DSP::ReadARAM(address + 2) << 8) | - (DSP::ReadARAM(address + 3)); + (DSP::ReadARAM(address + 1) << 16) | + (DSP::ReadARAM(address + 2) << 8) | + (DSP::ReadARAM(address + 3)); default: return 0; } @@ -140,7 +140,6 @@ void PPCDebugInterface::toggleMemCheck(unsigned int address) MemCheck.Break = true; PowerPC::memchecks.Add(MemCheck); - } else PowerPC::memchecks.Remove(address); diff --git a/Source/Core/Core/HW/DSP.cpp b/Source/Core/Core/HW/DSP.cpp index 9ab9d3fa49..54374ff77b 100644 --- a/Source/Core/Core/HW/DSP.cpp +++ b/Source/Core/Core/HW/DSP.cpp @@ -460,9 +460,9 @@ void GenerateDSPInterrupt(DSPInterruptType type, bool _bSet) { switch (type) { - case INT_DSP: g_dspState.DSPControl.DSP = _bSet ? 1 : 0; break; - case INT_ARAM: g_dspState.DSPControl.ARAM = _bSet ? 1 : 0; if (_bSet) g_dspState.DSPControl.DMAState = 0; break; - case INT_AID: g_dspState.DSPControl.AID = _bSet ? 1 : 0; break; + case INT_DSP: g_dspState.DSPControl.DSP = _bSet ? 1 : 0; break; + case INT_ARAM: g_dspState.DSPControl.ARAM = _bSet ? 1 : 0; if (_bSet) g_dspState.DSPControl.DMAState = 0; break; + case INT_AID: g_dspState.DSPControl.AID = _bSet ? 1 : 0; break; } UpdateInterrupts(); diff --git a/Source/Core/Core/HW/DSPHLE/UCodes/UCode_Zelda.cpp b/Source/Core/Core/HW/DSPHLE/UCodes/UCode_Zelda.cpp index 899a7d902f..c74967b90f 100644 --- a/Source/Core/Core/HW/DSPHLE/UCodes/UCode_Zelda.cpp +++ b/Source/Core/Core/HW/DSPHLE/UCodes/UCode_Zelda.cpp @@ -247,23 +247,23 @@ void CUCode_Zelda::HandleMail_SMSVersion(u32 _uMail) m_numSteps = _uMail; m_step = 0; } - else if ((_uMail >> 16) == 0xCDD1) // A 0xCDD1000X mail should come right after we send a DSP_SYNCEND mail + else if ((_uMail >> 16) == 0xCDD1) // A 0xCDD1000X mail should come right after we send a DSP_SYNCEND mail { // The low part of the mail tells the operation to perform // Seeing as every possible operation number halts the uCode, // except 3, that thing seems to be intended for debugging switch (_uMail & 0xFFFF) { - case 0x0003: // Do nothing + case 0x0003: // Do nothing return; - case 0x0000: // Halt - case 0x0001: // Dump memory? and halt - case 0x0002: // Do something and halt + case 0x0000: // Halt + case 0x0001: // Dump memory? and halt + case 0x0002: // Do something and halt WARN_LOG(DSPHLE, "Zelda uCode(SMS version): received halting operation %04X", _uMail & 0xFFFF); return; - default: // Invalid (the real ucode would likely crash) + default: // Invalid (the real ucode would likely crash) WARN_LOG(DSPHLE, "Zelda uCode(SMS version): received invalid operation %04X", _uMail & 0xFFFF); return; } @@ -381,31 +381,31 @@ void CUCode_Zelda::HandleMail_NormalVersion(u32 _uMail) m_numSteps = _uMail; m_step = 0; } - else if ((_uMail >> 16) == 0xCDD1) // A 0xCDD1000X mail should come right after we send a DSP_FRAME_END mail + else if ((_uMail >> 16) == 0xCDD1) // A 0xCDD1000X mail should come right after we send a DSP_FRAME_END mail { // The low part of the mail tells the operation to perform // Seeing as every possible operation number halts the uCode, // except 3, that thing seems to be intended for debugging switch (_uMail & 0xFFFF) { - case 0x0003: // Do nothing - continue normally + case 0x0003: // Do nothing - continue normally return; - case 0x0001: // accepts params to either dma to iram and/or dram (used for hotbooting a new ucode) + case 0x0001: // accepts params to either dma to iram and/or dram (used for hotbooting a new ucode) // TODO find a better way to protect from HLEMixer? soundStream->GetMixer()->SetHLEReady(false); m_UploadSetupInProgress = true; return; - case 0x0002: // Let IROM play us off + case 0x0002: // Let IROM play us off m_DSPHLE->SetUCode(UCODE_ROM); return; - case 0x0000: // Halt + case 0x0000: // Halt WARN_LOG(DSPHLE, "Zelda uCode: received halting operation %04X", _uMail & 0xFFFF); return; - default: // Invalid (the real ucode would likely crash) + default: // Invalid (the real ucode would likely crash) WARN_LOG(DSPHLE, "Zelda uCode: received invalid operation %04X", _uMail & 0xFFFF); return; } diff --git a/Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp b/Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp index c8b847c17c..403d95c1b6 100644 --- a/Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp +++ b/Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp @@ -40,11 +40,11 @@ IUCode* UCodeFactory(u32 _CRC, DSPHLE *dsp_hle, bool bWii) case 0x3ad3b7ac: // Naruto3, Paper Mario - The Thousand Year Door case 0x3daf59b9: // Alien Hominid case 0x4e8a8b21: // spdemo, ctaxi, 18 wheeler, disney, monkeyball 1/2,cubivore,puzzlecollection,wario, - // capcom vs snk, naruto2, lost kingdoms, star fox, mario party 4, mortal kombat, - // smugglers run warzone, smash brothers, sonic mega collection, ZooCube - // nddemo, starfox + // capcom vs snk, naruto2, lost kingdoms, star fox, mario party 4, mortal kombat, + // smugglers run warzone, smash brothers, sonic mega collection, ZooCube + // nddemo, starfox case 0x07f88145: // bustamove, ikaruga, fzero, robotech battle cry, star soldier, soul calibur2, - // Zelda:OOT, Tony hawk, viewtiful joe + // Zelda:OOT, Tony hawk, viewtiful joe case 0xe2136399: // billy hatcher, dragonballz, mario party 5, TMNT, ava1080 case 0x3389a79e: // MP1/MP2 Wii (Metroid Prime Trilogy) INFO_LOG(DSPHLE, "CRC %08x: AX ucode chosen", _CRC); @@ -116,16 +116,16 @@ void IUCode::PrepareBootUCode(u32 mail) { switch (m_NextUCode_steps) { - case 0: m_NextUCode.mram_dest_addr = mail; break; - case 1: m_NextUCode.mram_size = mail & 0xffff; break; - case 2: m_NextUCode.mram_dram_addr = mail & 0xffff; break; - case 3: m_NextUCode.iram_mram_addr = mail; break; - case 4: m_NextUCode.iram_size = mail & 0xffff; break; - case 5: m_NextUCode.iram_dest = mail & 0xffff; break; - case 6: m_NextUCode.iram_startpc = mail & 0xffff; break; - case 7: m_NextUCode.dram_mram_addr = mail; break; - case 8: m_NextUCode.dram_size = mail & 0xffff; break; - case 9: m_NextUCode.dram_dest = mail & 0xffff; break; + case 0: m_NextUCode.mram_dest_addr = mail; break; + case 1: m_NextUCode.mram_size = mail & 0xffff; break; + case 2: m_NextUCode.mram_dram_addr = mail & 0xffff; break; + case 3: m_NextUCode.iram_mram_addr = mail; break; + case 4: m_NextUCode.iram_size = mail & 0xffff; break; + case 5: m_NextUCode.iram_dest = mail & 0xffff; break; + case 6: m_NextUCode.iram_startpc = mail & 0xffff; break; + case 7: m_NextUCode.dram_mram_addr = mail; break; + case 8: m_NextUCode.dram_size = mail & 0xffff; break; + case 9: m_NextUCode.dram_dest = mail & 0xffff; break; } m_NextUCode_steps++; diff --git a/Source/Core/Core/HW/DSPHLE/UCodes/UCodes.h b/Source/Core/Core/HW/DSPHLE/UCodes/UCodes.h index f1995df1ea..f462674156 100644 --- a/Source/Core/Core/HW/DSPHLE/UCodes/UCodes.h +++ b/Source/Core/Core/HW/DSPHLE/UCodes/UCodes.h @@ -132,8 +132,8 @@ private: u16 dram_size; u16 dram_dest; }; - SUCode m_NextUCode; - int m_NextUCode_steps; + SUCode m_NextUCode; + int m_NextUCode_steps; bool m_NeedsResumeMail; }; diff --git a/Source/Core/Core/HW/EXI_Channel.cpp b/Source/Core/Core/HW/EXI_Channel.cpp index 52fd79fa3c..ae91ebe2cd 100644 --- a/Source/Core/Core/HW/EXI_Channel.cpp +++ b/Source/Core/Core/HW/EXI_Channel.cpp @@ -9,9 +9,9 @@ #include "../Movie.h" #include "MMIO.h" -#define EXI_READ 0 -#define EXI_WRITE 1 -#define EXI_READWRITE 2 +#define EXI_READ 0 +#define EXI_WRITE 1 +#define EXI_READWRITE 2 #include "ProcessorInterface.h" #include "../PowerPC/PowerPC.h" @@ -197,9 +197,9 @@ bool CEXIChannel::IsCausingInterrupt() if (GetDevice(m_Status.CHIP_SELECT)->IsInterruptSet()) m_Status.EXIINT = 1; - if ((m_Status.EXIINT & m_Status.EXIINTMASK) || - (m_Status.TCINT & m_Status.TCINTMASK) || - (m_Status.EXTINT & m_Status.EXTINTMASK)) + if ((m_Status.EXIINT & m_Status.EXIINTMASK) || + (m_Status.TCINT & m_Status.TCINTMASK) || + (m_Status.EXTINT & m_Status.EXTINTMASK)) { return true; } diff --git a/Source/Core/Core/HW/EXI_Device.cpp b/Source/Core/Core/HW/EXI_Device.cpp index a1c6e5ed80..ce657f7ff1 100644 --- a/Source/Core/Core/HW/EXI_Device.cpp +++ b/Source/Core/Core/HW/EXI_Device.cpp @@ -81,10 +81,10 @@ public: virtual ~CEXIDummy(){} - void ImmWrite(u32 data, u32 size) override {INFO_LOG(EXPANSIONINTERFACE, "EXI DUMMY %s ImmWrite: %08x", m_strName.c_str(), data);} - u32 ImmRead (u32 size) override {INFO_LOG(EXPANSIONINTERFACE, "EXI DUMMY %s ImmRead", m_strName.c_str()); return 0;} - void DMAWrite(u32 addr, u32 size) override {INFO_LOG(EXPANSIONINTERFACE, "EXI DUMMY %s DMAWrite: %08x bytes, from %08x to device", m_strName.c_str(), size, addr);} - void DMARead (u32 addr, u32 size) override {INFO_LOG(EXPANSIONINTERFACE, "EXI DUMMY %s DMARead: %08x bytes, from device to %08x", m_strName.c_str(), size, addr);} + void ImmWrite(u32 data, u32 size) override {INFO_LOG(EXPANSIONINTERFACE, "EXI DUMMY %s ImmWrite: %08x", m_strName.c_str(), data);} + u32 ImmRead (u32 size) override {INFO_LOG(EXPANSIONINTERFACE, "EXI DUMMY %s ImmRead", m_strName.c_str()); return 0;} + void DMAWrite(u32 addr, u32 size) override {INFO_LOG(EXPANSIONINTERFACE, "EXI DUMMY %s DMAWrite: %08x bytes, from %08x to device", m_strName.c_str(), size, addr);} + void DMARead (u32 addr, u32 size) override {INFO_LOG(EXPANSIONINTERFACE, "EXI DUMMY %s DMARead: %08x bytes, from device to %08x", m_strName.c_str(), size, addr);} }; diff --git a/Source/Core/Core/HW/EXI_DeviceEthernet.cpp b/Source/Core/Core/HW/EXI_DeviceEthernet.cpp index 5e4b7be015..e780c8d6e7 100644 --- a/Source/Core/Core/HW/EXI_DeviceEthernet.cpp +++ b/Source/Core/Core/HW/EXI_DeviceEthernet.cpp @@ -562,9 +562,9 @@ bool CEXIETHERNET::RecvHandlePacket() page_ptr(BBA_RHBP)); #endif - write_ptr = ptr_from_page_ptr(BBA_RWP); - end_ptr = ptr_from_page_ptr(BBA_RHBP); - read_ptr = ptr_from_page_ptr(BBA_RRP); + write_ptr = ptr_from_page_ptr(BBA_RWP); + end_ptr = ptr_from_page_ptr(BBA_RHBP); + read_ptr = ptr_from_page_ptr(BBA_RRP); descriptor = (Descriptor *)write_ptr; write_ptr += 4; diff --git a/Source/Core/Core/HW/EXI_DeviceGecko.cpp b/Source/Core/Core/HW/EXI_DeviceGecko.cpp index b8ac071425..27e456e96b 100644 --- a/Source/Core/Core/HW/EXI_DeviceGecko.cpp +++ b/Source/Core/Core/HW/EXI_DeviceGecko.cpp @@ -8,12 +8,12 @@ #include "EXI_DeviceGecko.h" #include "../Core.h" -u16 GeckoSockServer::server_port; -int GeckoSockServer::client_count; -std::thread GeckoSockServer::connectionThread; -volatile bool GeckoSockServer::server_running; -std::queue GeckoSockServer::waiting_socks; -std::mutex GeckoSockServer::connection_lock; +u16 GeckoSockServer::server_port; +int GeckoSockServer::client_count; +std::thread GeckoSockServer::connectionThread; +volatile bool GeckoSockServer::server_running; +std::queue GeckoSockServer::waiting_socks; +std::mutex GeckoSockServer::connection_lock; GeckoSockServer::GeckoSockServer() : client_running(false) diff --git a/Source/Core/Core/HW/EXI_DeviceGecko.h b/Source/Core/Core/HW/EXI_DeviceGecko.h index c1d1f7fd07..9de1801f79 100644 --- a/Source/Core/Core/HW/EXI_DeviceGecko.h +++ b/Source/Core/Core/HW/EXI_DeviceGecko.h @@ -28,17 +28,17 @@ public: std::deque recv_fifo; private: - static int client_count; - volatile bool client_running; + static int client_count; + volatile bool client_running; // Only ever one server thread static void GeckoConnectionWaiter(); - static u16 server_port; - static volatile bool server_running; - static std::thread connectionThread; - static std::queue waiting_socks; - static std::mutex connection_lock; + static u16 server_port; + static volatile bool server_running; + static std::thread connectionThread; + static std::queue waiting_socks; + static std::mutex connection_lock; }; class CEXIGecko @@ -53,13 +53,13 @@ public: private: enum { - CMD_LED_OFF = 0x7, - CMD_LED_ON = 0x8, - CMD_INIT = 0x9, - CMD_RECV = 0xa, - CMD_SEND = 0xb, - CMD_CHK_TX = 0xc, - CMD_CHK_RX = 0xd, + CMD_LED_OFF = 0x7, + CMD_LED_ON = 0x8, + CMD_INIT = 0x9, + CMD_RECV = 0xa, + CMD_SEND = 0xb, + CMD_CHK_TX = 0xc, + CMD_CHK_RX = 0xd, }; static const u32 ident = 0x04700000; diff --git a/Source/Core/Core/HW/EXI_DeviceIPL.h b/Source/Core/Core/HW/EXI_DeviceIPL.h index d821967c4c..2d0759f3ee 100644 --- a/Source/Core/Core/HW/EXI_DeviceIPL.h +++ b/Source/Core/Core/HW/EXI_DeviceIPL.h @@ -31,16 +31,16 @@ private: enum { - REGION_RTC = 0x200000, - REGION_SRAM = 0x200001, - REGION_UART = 0x200100, - REGION_UART_UNK = 0x200103, - REGION_BARNACLE = 0x200113, - REGION_WRTC0 = 0x210000, - REGION_WRTC1 = 0x210001, - REGION_WRTC2 = 0x210008, - REGION_EUART_UNK= 0x300000, - REGION_EUART = 0x300001 + REGION_RTC = 0x200000, + REGION_SRAM = 0x200001, + REGION_UART = 0x200100, + REGION_UART_UNK = 0x200103, + REGION_BARNACLE = 0x200113, + REGION_WRTC0 = 0x210000, + REGION_WRTC1 = 0x210001, + REGION_WRTC2 = 0x210008, + REGION_EUART_UNK = 0x300000, + REGION_EUART = 0x300001 }; // Region diff --git a/Source/Core/Core/HW/EXI_DeviceMemoryCard.cpp b/Source/Core/Core/HW/EXI_DeviceMemoryCard.cpp index 2d1fb56c2a..fbf492e4d2 100644 --- a/Source/Core/Core/HW/EXI_DeviceMemoryCard.cpp +++ b/Source/Core/Core/HW/EXI_DeviceMemoryCard.cpp @@ -16,12 +16,12 @@ #include "Sram.h" #include "GCMemcard.h" -#define MC_STATUS_BUSY 0x80 -#define MC_STATUS_UNLOCKED 0x40 -#define MC_STATUS_SLEEP 0x20 -#define MC_STATUS_ERASEERROR 0x10 -#define MC_STATUS_PROGRAMEERROR 0x08 -#define MC_STATUS_READY 0x01 +#define MC_STATUS_BUSY 0x80 +#define MC_STATUS_UNLOCKED 0x40 +#define MC_STATUS_SLEEP 0x20 +#define MC_STATUS_ERASEERROR 0x10 +#define MC_STATUS_PROGRAMEERROR 0x08 +#define MC_STATUS_READY 0x01 #define SIZE_TO_Mb (1024 * 8 * 16) #define MC_HDR_SIZE 0xA000 @@ -63,12 +63,12 @@ CEXIMemoryCard::CEXIMemoryCard(const int index) formatDelay = 0; //Nintendo Memory Card EXI IDs - //0x00000004 Memory Card 59 4Mbit - //0x00000008 Memory Card 123 8Mb - //0x00000010 Memory Card 251 16Mb - //0x00000020 Memory Card 507 32Mb - //0x00000040 Memory Card 1019 64Mb - //0x00000080 Memory Card 2043 128Mb + //0x00000004 Memory Card 59 4Mbit + //0x00000008 Memory Card 123 8Mb + //0x00000010 Memory Card 251 16Mb + //0x00000020 Memory Card 507 32Mb + //0x00000040 Memory Card 1019 64Mb + //0x00000080 Memory Card 2043 128Mb //0x00000510 16Mb "bigben" card //card_id = 0xc243; diff --git a/Source/Core/Core/HW/EXI_DeviceMic.cpp b/Source/Core/Core/HW/EXI_DeviceMic.cpp index 6ad84cc860..804203eb04 100644 --- a/Source/Core/Core/HW/EXI_DeviceMic.cpp +++ b/Source/Core/Core/HW/EXI_DeviceMic.cpp @@ -203,8 +203,8 @@ void CEXIMic::TransferByte(u8 &byte) { if (m_position == 0) { - command = byte; // first byte is command - byte = 0xFF; // would be tristate, but we don't care. + command = byte; // first byte is command + byte = 0xFF; // would be tristate, but we don't care. m_position++; return; } diff --git a/Source/Core/Core/HW/GCPadEmu.cpp b/Source/Core/Core/HW/GCPadEmu.cpp index 4173b231da..39d2ea29c5 100644 --- a/Source/Core/Core/HW/GCPadEmu.cpp +++ b/Source/Core/Core/HW/GCPadEmu.cpp @@ -13,7 +13,7 @@ const u16 button_bitmasks[] = PAD_BUTTON_Y, PAD_TRIGGER_Z, PAD_BUTTON_START, - 0 // MIC HAX + 0 // MIC HAX }; const u16 trigger_bitmasks[] = @@ -138,21 +138,21 @@ void GCPad::SetOutput(const u8 on) void GCPad::LoadDefaults(const ControllerInterface& ciface) { - #define set_control(group, num, str) (group)->controls[num]->control_ref->expression = (str) + #define set_control(group, num, str) (group)->controls[num]->control_ref->expression = (str) ControllerEmu::LoadDefaults(ciface); // Buttons - set_control(m_buttons, 0, "X"); // A - set_control(m_buttons, 1, "Z"); // B - set_control(m_buttons, 2, "C"); // X - set_control(m_buttons, 3, "S"); // Y - set_control(m_buttons, 4, "D"); // Z + set_control(m_buttons, 0, "X"); // A + set_control(m_buttons, 1, "Z"); // B + set_control(m_buttons, 2, "C"); // X + set_control(m_buttons, 3, "S"); // Y + set_control(m_buttons, 4, "D"); // Z #ifdef _WIN32 - set_control(m_buttons, 5, "RETURN"); // Start + set_control(m_buttons, 5, "RETURN"); // Start #else // osx/linux - set_control(m_buttons, 5, "Return"); // Start + set_control(m_buttons, 5, "Return"); // Start #endif // stick modifiers to 50 % @@ -160,51 +160,51 @@ void GCPad::LoadDefaults(const ControllerInterface& ciface) m_c_stick->controls[4]->control_ref->range = 0.5f; // D-Pad - set_control(m_dpad, 0, "T"); // Up - set_control(m_dpad, 1, "G"); // Down - set_control(m_dpad, 2, "F"); // Left - set_control(m_dpad, 3, "H"); // Right + set_control(m_dpad, 0, "T"); // Up + set_control(m_dpad, 1, "G"); // Down + set_control(m_dpad, 2, "F"); // Left + set_control(m_dpad, 3, "H"); // Right // C-Stick - set_control(m_c_stick, 0, "I"); // Up - set_control(m_c_stick, 1, "K"); // Down - set_control(m_c_stick, 2, "J"); // Left - set_control(m_c_stick, 3, "L"); // Right + set_control(m_c_stick, 0, "I"); // Up + set_control(m_c_stick, 1, "K"); // Down + set_control(m_c_stick, 2, "J"); // Left + set_control(m_c_stick, 3, "L"); // Right #ifdef _WIN32 - set_control(m_c_stick, 4, "LCONTROL"); // Modifier + set_control(m_c_stick, 4, "LCONTROL"); // Modifier // Main Stick - set_control(m_main_stick, 0, "UP"); // Up - set_control(m_main_stick, 1, "DOWN"); // Down - set_control(m_main_stick, 2, "LEFT"); // Left - set_control(m_main_stick, 3, "RIGHT"); // Right - set_control(m_main_stick, 4, "LSHIFT"); // Modifier + set_control(m_main_stick, 0, "UP"); // Up + set_control(m_main_stick, 1, "DOWN"); // Down + set_control(m_main_stick, 2, "LEFT"); // Left + set_control(m_main_stick, 3, "RIGHT"); // Right + set_control(m_main_stick, 4, "LSHIFT"); // Modifier #elif __APPLE__ - set_control(m_c_stick, 4, "Left Control"); // Modifier + set_control(m_c_stick, 4, "Left Control"); // Modifier // Main Stick - set_control(m_main_stick, 0, "Up Arrow"); // Up - set_control(m_main_stick, 1, "Down Arrow"); // Down - set_control(m_main_stick, 2, "Left Arrow"); // Left - set_control(m_main_stick, 3, "Right Arrow"); // Right - set_control(m_main_stick, 4, "Left Shift"); // Modifier + set_control(m_main_stick, 0, "Up Arrow"); // Up + set_control(m_main_stick, 1, "Down Arrow"); // Down + set_control(m_main_stick, 2, "Left Arrow"); // Left + set_control(m_main_stick, 3, "Right Arrow"); // Right + set_control(m_main_stick, 4, "Left Shift"); // Modifier #else // not sure if these are right - set_control(m_c_stick, 4, "Control_L"); // Modifier + set_control(m_c_stick, 4, "Control_L"); // Modifier // Main Stick - set_control(m_main_stick, 0, "Up"); // Up - set_control(m_main_stick, 1, "Down"); // Down - set_control(m_main_stick, 2, "Left"); // Left - set_control(m_main_stick, 3, "Right"); // Right - set_control(m_main_stick, 4, "Shift_L"); // Modifier + set_control(m_main_stick, 0, "Up"); // Up + set_control(m_main_stick, 1, "Down"); // Down + set_control(m_main_stick, 2, "Left"); // Left + set_control(m_main_stick, 3, "Right"); // Right + set_control(m_main_stick, 4, "Shift_L"); // Modifier #endif // Triggers - set_control(m_triggers, 0, "Q"); // L - set_control(m_triggers, 1, "W"); // R + set_control(m_triggers, 0, "Q"); // L + set_control(m_triggers, 1, "W"); // R } bool GCPad::GetMicButton() const diff --git a/Source/Core/Core/HW/GCPadEmu.h b/Source/Core/Core/HW/GCPadEmu.h index c81f73b276..4fe96a6662 100644 --- a/Source/Core/Core/HW/GCPadEmu.h +++ b/Source/Core/Core/HW/GCPadEmu.h @@ -25,14 +25,14 @@ public: private: - Buttons* m_buttons; - AnalogStick* m_main_stick; - AnalogStick* m_c_stick; - Buttons* m_dpad; - MixedTriggers* m_triggers; - ControlGroup* m_rumble; - ControlGroup* m_options; + Buttons* m_buttons; + AnalogStick* m_main_stick; + AnalogStick* m_c_stick; + Buttons* m_dpad; + MixedTriggers* m_triggers; + ControlGroup* m_rumble; + ControlGroup* m_options; - const unsigned int m_index; + const unsigned int m_index; }; diff --git a/Source/Core/Core/HW/ProcessorInterface.cpp b/Source/Core/Core/HW/ProcessorInterface.cpp index 15244b0b3e..7b8e4778b0 100644 --- a/Source/Core/Core/HW/ProcessorInterface.cpp +++ b/Source/Core/Core/HW/ProcessorInterface.cpp @@ -167,23 +167,23 @@ static const char *Debug_GetInterruptName(u32 _causemask) { switch (_causemask) { - case INT_CAUSE_PI: return "INT_CAUSE_PI"; - case INT_CAUSE_DI: return "INT_CAUSE_DI"; - case INT_CAUSE_RSW: return "INT_CAUSE_RSW"; - case INT_CAUSE_SI: return "INT_CAUSE_SI"; - case INT_CAUSE_EXI: return "INT_CAUSE_EXI"; - case INT_CAUSE_AI: return "INT_CAUSE_AI"; - case INT_CAUSE_DSP: return "INT_CAUSE_DSP"; - case INT_CAUSE_MEMORY: return "INT_CAUSE_MEMORY"; - case INT_CAUSE_VI: return "INT_CAUSE_VI"; - case INT_CAUSE_PE_TOKEN: return "INT_CAUSE_PE_TOKEN"; - case INT_CAUSE_PE_FINISH: return "INT_CAUSE_PE_FINISH"; - case INT_CAUSE_CP: return "INT_CAUSE_CP"; - case INT_CAUSE_DEBUG: return "INT_CAUSE_DEBUG"; - case INT_CAUSE_WII_IPC: return "INT_CAUSE_WII_IPC"; - case INT_CAUSE_HSP: return "INT_CAUSE_HSP"; - case INT_CAUSE_RST_BUTTON: return "INT_CAUSE_RST_BUTTON"; - default: return "!!! ERROR-unknown Interrupt !!!"; + case INT_CAUSE_PI: return "INT_CAUSE_PI"; + case INT_CAUSE_DI: return "INT_CAUSE_DI"; + case INT_CAUSE_RSW: return "INT_CAUSE_RSW"; + case INT_CAUSE_SI: return "INT_CAUSE_SI"; + case INT_CAUSE_EXI: return "INT_CAUSE_EXI"; + case INT_CAUSE_AI: return "INT_CAUSE_AI"; + case INT_CAUSE_DSP: return "INT_CAUSE_DSP"; + case INT_CAUSE_MEMORY: return "INT_CAUSE_MEMORY"; + case INT_CAUSE_VI: return "INT_CAUSE_VI"; + case INT_CAUSE_PE_TOKEN: return "INT_CAUSE_PE_TOKEN"; + case INT_CAUSE_PE_FINISH: return "INT_CAUSE_PE_FINISH"; + case INT_CAUSE_CP: return "INT_CAUSE_CP"; + case INT_CAUSE_DEBUG: return "INT_CAUSE_DEBUG"; + case INT_CAUSE_WII_IPC: return "INT_CAUSE_WII_IPC"; + case INT_CAUSE_HSP: return "INT_CAUSE_HSP"; + case INT_CAUSE_RST_BUTTON: return "INT_CAUSE_RST_BUTTON"; + default: return "!!! ERROR-unknown Interrupt !!!"; } } diff --git a/Source/Core/Core/HW/ProcessorInterface.h b/Source/Core/Core/HW/ProcessorInterface.h index 8078f64466..c0c4507496 100644 --- a/Source/Core/Core/HW/ProcessorInterface.h +++ b/Source/Core/Core/HW/ProcessorInterface.h @@ -16,22 +16,22 @@ namespace ProcessorInterface enum InterruptCause { - INT_CAUSE_PI = 0x1, // YAGCD says: GP runtime error - INT_CAUSE_RSW = 0x2, // Reset Switch - INT_CAUSE_DI = 0x4, // DVD interrupt - INT_CAUSE_SI = 0x8, // Serial interface - INT_CAUSE_EXI = 0x10, // Expansion interface - INT_CAUSE_AI = 0x20, // Audio Interface Streaming - INT_CAUSE_DSP = 0x40, // DSP interface - INT_CAUSE_MEMORY = 0x80, // Memory interface - INT_CAUSE_VI = 0x100, // Video interface - INT_CAUSE_PE_TOKEN = 0x200, // GP Token - INT_CAUSE_PE_FINISH = 0x400, // GP Finished - INT_CAUSE_CP = 0x800, // Command Fifo - INT_CAUSE_DEBUG = 0x1000, // Debugger (from devkit) - INT_CAUSE_HSP = 0x2000, // High Speed Port (from sdram controller) - INT_CAUSE_WII_IPC = 0x4000, // Wii IPC - INT_CAUSE_RST_BUTTON = 0x10000 // ResetButtonState (1 = unpressed, 0 = pressed) it's a state, not maskable + INT_CAUSE_PI = 0x1, // YAGCD says: GP runtime error + INT_CAUSE_RSW = 0x2, // Reset Switch + INT_CAUSE_DI = 0x4, // DVD interrupt + INT_CAUSE_SI = 0x8, // Serial interface + INT_CAUSE_EXI = 0x10, // Expansion interface + INT_CAUSE_AI = 0x20, // Audio Interface Streaming + INT_CAUSE_DSP = 0x40, // DSP interface + INT_CAUSE_MEMORY = 0x80, // Memory interface + INT_CAUSE_VI = 0x100, // Video interface + INT_CAUSE_PE_TOKEN = 0x200, // GP Token + INT_CAUSE_PE_FINISH = 0x400, // GP Finished + INT_CAUSE_CP = 0x800, // Command Fifo + INT_CAUSE_DEBUG = 0x1000, // Debugger (from devkit) + INT_CAUSE_HSP = 0x2000, // High Speed Port (from sdram controller) + INT_CAUSE_WII_IPC = 0x4000, // Wii IPC + INT_CAUSE_RST_BUTTON = 0x10000 // ResetButtonState (1 = unpressed, 0 = pressed) it's a state, not maskable }; diff --git a/Source/Core/Core/HW/SI.cpp b/Source/Core/Core/HW/SI.cpp index 47ce14ddb0..66d8bc088a 100644 --- a/Source/Core/Core/HW/SI.cpp +++ b/Source/Core/Core/HW/SI.cpp @@ -356,25 +356,25 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base) USIStatusReg tmpStatus(val); // clear bits ( if(tmp.bit) SISR.bit=0 ) - if (tmpStatus.NOREP0) g_StatusReg.NOREP0 = 0; - if (tmpStatus.COLL0) g_StatusReg.COLL0 = 0; - if (tmpStatus.OVRUN0) g_StatusReg.OVRUN0 = 0; - if (tmpStatus.UNRUN0) g_StatusReg.UNRUN0 = 0; + if (tmpStatus.NOREP0) g_StatusReg.NOREP0 = 0; + if (tmpStatus.COLL0) g_StatusReg.COLL0 = 0; + if (tmpStatus.OVRUN0) g_StatusReg.OVRUN0 = 0; + if (tmpStatus.UNRUN0) g_StatusReg.UNRUN0 = 0; - if (tmpStatus.NOREP1) g_StatusReg.NOREP1 = 0; - if (tmpStatus.COLL1) g_StatusReg.COLL1 = 0; - if (tmpStatus.OVRUN1) g_StatusReg.OVRUN1 = 0; - if (tmpStatus.UNRUN1) g_StatusReg.UNRUN1 = 0; + if (tmpStatus.NOREP1) g_StatusReg.NOREP1 = 0; + if (tmpStatus.COLL1) g_StatusReg.COLL1 = 0; + if (tmpStatus.OVRUN1) g_StatusReg.OVRUN1 = 0; + if (tmpStatus.UNRUN1) g_StatusReg.UNRUN1 = 0; - if (tmpStatus.NOREP2) g_StatusReg.NOREP2 = 0; - if (tmpStatus.COLL2) g_StatusReg.COLL2 = 0; - if (tmpStatus.OVRUN2) g_StatusReg.OVRUN2 = 0; - if (tmpStatus.UNRUN2) g_StatusReg.UNRUN2 = 0; + if (tmpStatus.NOREP2) g_StatusReg.NOREP2 = 0; + if (tmpStatus.COLL2) g_StatusReg.COLL2 = 0; + if (tmpStatus.OVRUN2) g_StatusReg.OVRUN2 = 0; + if (tmpStatus.UNRUN2) g_StatusReg.UNRUN2 = 0; - if (tmpStatus.NOREP3) g_StatusReg.NOREP3 = 0; - if (tmpStatus.COLL3) g_StatusReg.COLL3 = 0; - if (tmpStatus.OVRUN3) g_StatusReg.OVRUN3 = 0; - if (tmpStatus.UNRUN3) g_StatusReg.UNRUN3 = 0; + if (tmpStatus.NOREP3) g_StatusReg.NOREP3 = 0; + if (tmpStatus.COLL3) g_StatusReg.COLL3 = 0; + if (tmpStatus.OVRUN3) g_StatusReg.OVRUN3 = 0; + if (tmpStatus.UNRUN3) g_StatusReg.UNRUN3 = 0; // send command to devices if (tmpStatus.WR) @@ -409,8 +409,8 @@ void UpdateInterrupts() g_ComCSR.RDSTINT = 0; // check if we have to generate an interrupt - if ((g_ComCSR.RDSTINT & g_ComCSR.RDSTINTMSK) || - (g_ComCSR.TCINT & g_ComCSR.TCINTMSK)) + if ((g_ComCSR.RDSTINT & g_ComCSR.RDSTINTMSK) || + (g_ComCSR.TCINT & g_ComCSR.TCINTMSK)) { ProcessorInterface::SetInterrupt(ProcessorInterface::INT_CAUSE_SI, true); } diff --git a/Source/Core/Core/HW/SI_DeviceDanceMat.cpp b/Source/Core/Core/HW/SI_DeviceDanceMat.cpp index 72420abf9b..20dbd3ff61 100644 --- a/Source/Core/Core/HW/SI_DeviceDanceMat.cpp +++ b/Source/Core/Core/HW/SI_DeviceDanceMat.cpp @@ -26,16 +26,16 @@ CSIDevice_DanceMat::CSIDevice_DanceMat(SIDevices device, int _iDeviceNumber) , m_LastButtonCombo(COMBO_NONE) { memset(&m_Origin, 0, sizeof(SOrigin)); - m_Origin.uCommand = CMD_ORIGIN; - m_Origin.uOriginStickX = 0x80; // center - m_Origin.uOriginStickY = 0x80; - m_Origin.uSubStickStickX = 0x80; - m_Origin.uSubStickStickY = 0x80; - m_Origin.uTrigger_L = 0x00; - m_Origin.uTrigger_R = 0x00; + m_Origin.uCommand = CMD_ORIGIN; + m_Origin.uOriginStickX = 0x80; // center + m_Origin.uOriginStickY = 0x80; + m_Origin.uSubStickStickX = 0x80; + m_Origin.uSubStickStickY = 0x80; + m_Origin.uTrigger_L = 0x00; + m_Origin.uTrigger_R = 0x00; // Dunno if we need to do this, game/lib should set it? - m_Mode = 0x03; + m_Mode = 0x03; } int CSIDevice_DanceMat::RunBuffer(u8* _pBuffer, int _iLength) @@ -60,8 +60,8 @@ int CSIDevice_DanceMat::RunBuffer(u8* _pBuffer, int _iLength) GetData(high, low); for (int i = 0; i < (_iLength - 1) / 2; i++) { - _pBuffer[0 + i] = (high >> (i * 8)) & 0xff; - _pBuffer[4 + i] = (low >> (i * 8)) & 0xff; + _pBuffer[i + 0] = (high >> (i * 8)) & 0xff; + _pBuffer[i + 4] = (low >> (i * 8)) & 0xff; } } break; @@ -119,8 +119,8 @@ bool CSIDevice_DanceMat::GetData(u32& _Hi, u32& _Low) u32 netValues[2]; if (NetPlay_GetInput(ISIDevice::m_iDeviceNumber, PadStatus, netValues)) { - _Hi = netValues[0]; // first 4 bytes - _Low = netValues[1]; // last 4 bytes + _Hi = netValues[0]; // first 4 bytes + _Low = netValues[1]; // last 4 bytes return true; } @@ -170,21 +170,21 @@ bool CSIDevice_DanceMat::GetData(u32& _Hi, u32& _Low) // Low bits are packed differently per mode if (m_Mode == 0 || m_Mode == 5 || m_Mode == 6 || m_Mode == 7) { - _Low = (u8)(PadStatus.analogB >> 4); // Top 4 bits - _Low |= (u32)((u8)(PadStatus.analogA >> 4) << 4); // Top 4 bits - _Low |= (u32)((u8)(PadStatus.triggerRight >> 4) << 8); // Top 4 bits - _Low |= (u32)((u8)(PadStatus.triggerLeft >> 4) << 12); // Top 4 bits - _Low |= (u32)((u8)(PadStatus.substickY) << 16); // All 8 bits - _Low |= (u32)((u8)(PadStatus.substickX) << 24); // All 8 bits + _Low = (u8)(PadStatus.analogB >> 4); // Top 4 bits + _Low |= (u32)((u8)(PadStatus.analogA >> 4) << 4); // Top 4 bits + _Low |= (u32)((u8)(PadStatus.triggerRight >> 4) << 8); // Top 4 bits + _Low |= (u32)((u8)(PadStatus.triggerLeft >> 4) << 12); // Top 4 bits + _Low |= (u32)((u8)(PadStatus.substickY) << 16); // All 8 bits + _Low |= (u32)((u8)(PadStatus.substickX) << 24); // All 8 bits } else if (m_Mode == 1) { - _Low = (u8)(PadStatus.analogB >> 4); // Top 4 bits - _Low |= (u32)((u8)(PadStatus.analogA >> 4) << 4); // Top 4 bits - _Low |= (u32)((u8)PadStatus.triggerRight << 8); // All 8 bits - _Low |= (u32)((u8)PadStatus.triggerLeft << 16); // All 8 bits - _Low |= (u32)((u8)PadStatus.substickY << 24); // Top 4 bits - _Low |= (u32)((u8)PadStatus.substickX << 28); // Top 4 bits + _Low = (u8)(PadStatus.analogB >> 4); // Top 4 bits + _Low |= (u32)((u8)(PadStatus.analogA >> 4) << 4); // Top 4 bits + _Low |= (u32)((u8)PadStatus.triggerRight << 8); // All 8 bits + _Low |= (u32)((u8)PadStatus.triggerLeft << 16); // All 8 bits + _Low |= (u32)((u8)PadStatus.substickY << 24); // Top 4 bits + _Low |= (u32)((u8)PadStatus.substickX << 28); // Top 4 bits } else if (m_Mode == 2) { @@ -194,18 +194,18 @@ bool CSIDevice_DanceMat::GetData(u32& _Hi, u32& _Low) else if (m_Mode == 3) { // Analog A/B are always 0 - _Low = (u8)PadStatus.triggerRight; // All 8 bits - _Low |= (u32)((u8)PadStatus.triggerLeft << 8); // All 8 bits - _Low |= (u32)((u8)PadStatus.substickY << 16); // All 8 bits - _Low |= (u32)((u8)PadStatus.substickX << 24); // All 8 bits + _Low = (u8)PadStatus.triggerRight; // All 8 bits + _Low |= (u32)((u8)PadStatus.triggerLeft << 8); // All 8 bits + _Low |= (u32)((u8)PadStatus.substickY << 16); // All 8 bits + _Low |= (u32)((u8)PadStatus.substickX << 24); // All 8 bits } else if (m_Mode == 4) { - _Low = (u8)(PadStatus.analogB); // All 8 bits - _Low |= (u32)((u8)(PadStatus.analogA) << 8); // All 8 bits + _Low = (u8)(PadStatus.analogB); // All 8 bits + _Low |= (u32)((u8)(PadStatus.analogA) << 8); // All 8 bits // triggerLeft/Right are always 0 - _Low |= (u32)((u8)PadStatus.substickY << 16); // All 8 bits - _Low |= (u32)((u8)PadStatus.substickX << 24); // All 8 bits + _Low |= (u32)((u8)PadStatus.substickY << 16); // All 8 bits + _Low |= (u32)((u8)PadStatus.substickX << 24); // All 8 bits } return true; } diff --git a/Source/Core/Core/HW/SI_DeviceGCController.cpp b/Source/Core/Core/HW/SI_DeviceGCController.cpp index 2db017d5c6..a6ddab1f03 100644 --- a/Source/Core/Core/HW/SI_DeviceGCController.cpp +++ b/Source/Core/Core/HW/SI_DeviceGCController.cpp @@ -26,16 +26,16 @@ CSIDevice_GCController::CSIDevice_GCController(SIDevices device, int _iDeviceNum , m_LastButtonCombo(COMBO_NONE) { memset(&m_Origin, 0, sizeof(SOrigin)); - m_Origin.uCommand = CMD_ORIGIN; - m_Origin.uOriginStickX = 0x80; // center - m_Origin.uOriginStickY = 0x80; - m_Origin.uSubStickStickX = 0x80; - m_Origin.uSubStickStickY = 0x80; - m_Origin.uTrigger_L = 0x1F; // 0-30 is the lower deadzone - m_Origin.uTrigger_R = 0x1F; + m_Origin.uCommand = CMD_ORIGIN; + m_Origin.uOriginStickX = 0x80; // center + m_Origin.uOriginStickY = 0x80; + m_Origin.uSubStickStickX = 0x80; + m_Origin.uSubStickStickY = 0x80; + m_Origin.uTrigger_L = 0x1F; // 0-30 is the lower deadzone + m_Origin.uTrigger_R = 0x1F; // Dunno if we need to do this, game/lib should set it? - m_Mode = 0x03; + m_Mode = 0x03; } int CSIDevice_GCController::RunBuffer(u8* _pBuffer, int _iLength) @@ -60,8 +60,8 @@ int CSIDevice_GCController::RunBuffer(u8* _pBuffer, int _iLength) GetData(high, low); for (int i = 0; i < (_iLength - 1) / 2; i++) { - _pBuffer[0 + i] = (high >> (i * 8)) & 0xff; - _pBuffer[4 + i] = (low >> (i * 8)) & 0xff; + _pBuffer[i + 0] = (high >> (i * 8)) & 0xff; + _pBuffer[i + 4] = (low >> (i * 8)) & 0xff; } } break; @@ -119,8 +119,8 @@ bool CSIDevice_GCController::GetData(u32& _Hi, u32& _Low) u32 netValues[2]; if (NetPlay_GetInput(ISIDevice::m_iDeviceNumber, PadStatus, netValues)) { - _Hi = netValues[0]; // first 4 bytes - _Low = netValues[1]; // last 4 bytes + _Hi = netValues[0]; // first 4 bytes + _Low = netValues[1]; // last 4 bytes return true; } @@ -149,46 +149,46 @@ bool CSIDevice_GCController::GetData(u32& _Hi, u32& _Low) // Low bits are packed differently per mode if (m_Mode == 0 || m_Mode == 5 || m_Mode == 6 || m_Mode == 7) { - _Low = (u8)(PadStatus.analogB >> 4); // Top 4 bits - _Low |= (u32)((u8)(PadStatus.analogA >> 4) << 4); // Top 4 bits - _Low |= (u32)((u8)(PadStatus.triggerRight >> 4) << 8); // Top 4 bits - _Low |= (u32)((u8)(PadStatus.triggerLeft >> 4) << 12); // Top 4 bits - _Low |= (u32)((u8)(PadStatus.substickY) << 16); // All 8 bits - _Low |= (u32)((u8)(PadStatus.substickX) << 24); // All 8 bits + _Low = (u8)(PadStatus.analogB >> 4); // Top 4 bits + _Low |= (u32)((u8)(PadStatus.analogA >> 4) << 4); // Top 4 bits + _Low |= (u32)((u8)(PadStatus.triggerRight >> 4) << 8); // Top 4 bits + _Low |= (u32)((u8)(PadStatus.triggerLeft >> 4) << 12); // Top 4 bits + _Low |= (u32)((u8)(PadStatus.substickY) << 16); // All 8 bits + _Low |= (u32)((u8)(PadStatus.substickX) << 24); // All 8 bits } else if (m_Mode == 1) { - _Low = (u8)(PadStatus.analogB >> 4); // Top 4 bits - _Low |= (u32)((u8)(PadStatus.analogA >> 4) << 4); // Top 4 bits - _Low |= (u32)((u8)PadStatus.triggerRight << 8); // All 8 bits - _Low |= (u32)((u8)PadStatus.triggerLeft << 16); // All 8 bits - _Low |= (u32)((u8)PadStatus.substickY << 24); // Top 4 bits - _Low |= (u32)((u8)PadStatus.substickX << 28); // Top 4 bits + _Low = (u8)(PadStatus.analogB >> 4); // Top 4 bits + _Low |= (u32)((u8)(PadStatus.analogA >> 4) << 4); // Top 4 bits + _Low |= (u32)((u8)PadStatus.triggerRight << 8); // All 8 bits + _Low |= (u32)((u8)PadStatus.triggerLeft << 16); // All 8 bits + _Low |= (u32)((u8)PadStatus.substickY << 24); // Top 4 bits + _Low |= (u32)((u8)PadStatus.substickX << 28); // Top 4 bits } else if (m_Mode == 2) { - _Low = (u8)(PadStatus.analogB); // All 8 bits - _Low |= (u32)((u8)(PadStatus.analogA) << 8); // All 8 bits - _Low |= (u32)((u8)(PadStatus.triggerRight >> 4) << 16); // Top 4 bits - _Low |= (u32)((u8)(PadStatus.triggerLeft >> 4) << 20); // Top 4 bits - _Low |= (u32)((u8)PadStatus.substickY << 24); // Top 4 bits - _Low |= (u32)((u8)PadStatus.substickX << 28); // Top 4 bits + _Low = (u8)(PadStatus.analogB); // All 8 bits + _Low |= (u32)((u8)(PadStatus.analogA) << 8); // All 8 bits + _Low |= (u32)((u8)(PadStatus.triggerRight >> 4) << 16); // Top 4 bits + _Low |= (u32)((u8)(PadStatus.triggerLeft >> 4) << 20); // Top 4 bits + _Low |= (u32)((u8)PadStatus.substickY << 24); // Top 4 bits + _Low |= (u32)((u8)PadStatus.substickX << 28); // Top 4 bits } else if (m_Mode == 3) { // Analog A/B are always 0 - _Low = (u8)PadStatus.triggerRight; // All 8 bits - _Low |= (u32)((u8)PadStatus.triggerLeft << 8); // All 8 bits - _Low |= (u32)((u8)PadStatus.substickY << 16); // All 8 bits - _Low |= (u32)((u8)PadStatus.substickX << 24); // All 8 bits + _Low = (u8)PadStatus.triggerRight; // All 8 bits + _Low |= (u32)((u8)PadStatus.triggerLeft << 8); // All 8 bits + _Low |= (u32)((u8)PadStatus.substickY << 16); // All 8 bits + _Low |= (u32)((u8)PadStatus.substickX << 24); // All 8 bits } else if (m_Mode == 4) { - _Low = (u8)(PadStatus.analogB); // All 8 bits - _Low |= (u32)((u8)(PadStatus.analogA) << 8); // All 8 bits + _Low = (u8)(PadStatus.analogB); // All 8 bits + _Low |= (u32)((u8)(PadStatus.analogA) << 8); // All 8 bits // triggerLeft/Right are always 0 - _Low |= (u32)((u8)PadStatus.substickY << 16); // All 8 bits - _Low |= (u32)((u8)PadStatus.substickX << 24); // All 8 bits + _Low |= (u32)((u8)PadStatus.substickY << 16); // All 8 bits + _Low |= (u32)((u8)PadStatus.substickX << 24); // All 8 bits } // Keep track of the special button combos (embedded in controller hardware... :( ) @@ -214,12 +214,12 @@ bool CSIDevice_GCController::GetData(u32& _Hi, u32& _Low) ProcessorInterface::ResetButton_Tap(); else if (m_LastButtonCombo == COMBO_ORIGIN) { - m_Origin.uOriginStickX = PadStatus.stickX; - m_Origin.uOriginStickY = PadStatus.stickY; - m_Origin.uSubStickStickX = PadStatus.substickX; - m_Origin.uSubStickStickY = PadStatus.substickY; - m_Origin.uTrigger_L = PadStatus.triggerLeft; - m_Origin.uTrigger_R = PadStatus.triggerRight; + m_Origin.uOriginStickX = PadStatus.stickX; + m_Origin.uOriginStickY = PadStatus.stickY; + m_Origin.uSubStickStickX = PadStatus.substickX; + m_Origin.uSubStickStickY = PadStatus.substickY; + m_Origin.uTrigger_L = PadStatus.triggerLeft; + m_Origin.uTrigger_R = PadStatus.triggerRight; } m_LastButtonCombo = COMBO_NONE; } diff --git a/Source/Core/Core/HW/SI_DeviceGCSteeringWheel.cpp b/Source/Core/Core/HW/SI_DeviceGCSteeringWheel.cpp index 322b0bcfc2..33937dccca 100644 --- a/Source/Core/Core/HW/SI_DeviceGCSteeringWheel.cpp +++ b/Source/Core/Core/HW/SI_DeviceGCSteeringWheel.cpp @@ -26,16 +26,16 @@ CSIDevice_GCSteeringWheel::CSIDevice_GCSteeringWheel(SIDevices device, int _iDev , m_LastButtonCombo(COMBO_NONE) { memset(&m_Origin, 0, sizeof(SOrigin)); - m_Origin.uCommand = CMD_ORIGIN; - m_Origin.uOriginStickX = 0x80; // center - m_Origin.uOriginStickY = 0x80; - m_Origin.uSubStickStickX = 0x80; - m_Origin.uSubStickStickY = 0x80; - m_Origin.uTrigger_L = 0x1F; // 0-30 is the lower deadzone - m_Origin.uTrigger_R = 0x1F; + m_Origin.uCommand = CMD_ORIGIN; + m_Origin.uOriginStickX = 0x80; // center + m_Origin.uOriginStickY = 0x80; + m_Origin.uSubStickStickX = 0x80; + m_Origin.uSubStickStickY = 0x80; + m_Origin.uTrigger_L = 0x1F; // 0-30 is the lower deadzone + m_Origin.uTrigger_R = 0x1F; // Dunno if we need to do this, game/lib should set it? - m_Mode = 0x03; + m_Mode = 0x03; } int CSIDevice_GCSteeringWheel::RunBuffer(u8* _pBuffer, int _iLength) @@ -109,8 +109,8 @@ bool CSIDevice_GCSteeringWheel::GetData(u32& _Hi, u32& _Low) u32 netValues[2]; if (NetPlay_GetInput(ISIDevice::m_iDeviceNumber, PadStatus, netValues)) { - _Hi = netValues[0]; // first 4 bytes - _Low = netValues[1]; // last 4 bytes + _Hi = netValues[0]; // first 4 bytes + _Low = netValues[1]; // last 4 bytes return true; } @@ -139,51 +139,51 @@ bool CSIDevice_GCSteeringWheel::GetData(u32& _Hi, u32& _Low) // Low bits are packed differently per mode if (m_Mode == 0 || m_Mode == 5 || m_Mode == 7) { - _Low = (u8)(PadStatus.analogB >> 4); // Top 4 bits - _Low |= (u32)((u8)(PadStatus.analogA >> 4) << 4); // Top 4 bits - _Low |= (u32)((u8)(PadStatus.triggerRight >> 4) << 8); // Top 4 bits - _Low |= (u32)((u8)(PadStatus.triggerLeft >> 4) << 12); // Top 4 bits - _Low |= (u32)((u8)(PadStatus.substickY) << 16); // All 8 bits - _Low |= (u32)((u8)(PadStatus.substickX) << 24); // All 8 bits + _Low = (u8)(PadStatus.analogB >> 4); // Top 4 bits + _Low |= (u32)((u8)(PadStatus.analogA >> 4) << 4); // Top 4 bits + _Low |= (u32)((u8)(PadStatus.triggerRight >> 4) << 8); // Top 4 bits + _Low |= (u32)((u8)(PadStatus.triggerLeft >> 4) << 12); // Top 4 bits + _Low |= (u32)((u8)(PadStatus.substickY) << 16); // All 8 bits + _Low |= (u32)((u8)(PadStatus.substickX) << 24); // All 8 bits } else if (m_Mode == 1) { - _Low = (u8)(PadStatus.analogB >> 4); // Top 4 bits - _Low |= (u32)((u8)(PadStatus.analogA >> 4) << 4); // Top 4 bits - _Low |= (u32)((u8)PadStatus.triggerRight << 8); // All 8 bits - _Low |= (u32)((u8)PadStatus.triggerLeft << 16); // All 8 bits - _Low |= (u32)((u8)PadStatus.substickY << 24); // Top 4 bits - _Low |= (u32)((u8)PadStatus.substickX << 28); // Top 4 bits + _Low = (u8)(PadStatus.analogB >> 4); // Top 4 bits + _Low |= (u32)((u8)(PadStatus.analogA >> 4) << 4); // Top 4 bits + _Low |= (u32)((u8)PadStatus.triggerRight << 8); // All 8 bits + _Low |= (u32)((u8)PadStatus.triggerLeft << 16); // All 8 bits + _Low |= (u32)((u8)PadStatus.substickY << 24); // Top 4 bits + _Low |= (u32)((u8)PadStatus.substickX << 28); // Top 4 bits } else if (m_Mode == 2) { - _Low = (u8)(PadStatus.analogB); // All 8 bits - _Low |= (u32)((u8)(PadStatus.analogA) << 8); // All 8 bits - _Low |= (u32)((u8)(PadStatus.triggerRight >> 4) << 16); // Top 4 bits - _Low |= (u32)((u8)(PadStatus.triggerLeft >> 4) << 20); // Top 4 bits - _Low |= (u32)((u8)PadStatus.substickY << 24); // Top 4 bits - _Low |= (u32)((u8)PadStatus.substickX << 28); // Top 4 bits + _Low = (u8)(PadStatus.analogB); // All 8 bits + _Low |= (u32)((u8)(PadStatus.analogA) << 8); // All 8 bits + _Low |= (u32)((u8)(PadStatus.triggerRight >> 4) << 16); // Top 4 bits + _Low |= (u32)((u8)(PadStatus.triggerLeft >> 4) << 20); // Top 4 bits + _Low |= (u32)((u8)PadStatus.substickY << 24); // Top 4 bits + _Low |= (u32)((u8)PadStatus.substickX << 28); // Top 4 bits } else if (m_Mode == 3) { // Analog A/B are always 0 - _Low = (u8)PadStatus.triggerRight; // All 8 bits - _Low |= (u32)((u8)PadStatus.triggerLeft << 8); // All 8 bits - _Low |= (u32)((u8)PadStatus.substickY << 16); // All 8 bits - _Low |= (u32)((u8)PadStatus.substickX << 24); // All 8 bits + _Low = (u8)PadStatus.triggerRight; // All 8 bits + _Low |= (u32)((u8)PadStatus.triggerLeft << 8); // All 8 bits + _Low |= (u32)((u8)PadStatus.substickY << 16); // All 8 bits + _Low |= (u32)((u8)PadStatus.substickX << 24); // All 8 bits } else if (m_Mode == 4) { - _Low = (u8)(PadStatus.analogB); // All 8 bits - _Low |= (u32)((u8)(PadStatus.analogA) << 8); // All 8 bits + _Low = (u8)(PadStatus.analogB); // All 8 bits + _Low |= (u32)((u8)(PadStatus.analogA) << 8); // All 8 bits // triggerLeft/Right are always 0 - _Low |= (u32)((u8)PadStatus.substickY << 16); // All 8 bits - _Low |= (u32)((u8)PadStatus.substickX << 24); // All 8 bits + _Low |= (u32)((u8)PadStatus.substickY << 16); // All 8 bits + _Low |= (u32)((u8)PadStatus.substickX << 24); // All 8 bits } else if (m_Mode == 6) { - _Low = (u8)PadStatus.triggerRight; // All 8 bits - _Low |= (u32)((u8)PadStatus.triggerLeft << 8); // All 8 bits + _Low = (u8)PadStatus.triggerRight; // All 8 bits + _Low |= (u32)((u8)PadStatus.triggerLeft << 8); // All 8 bits // The GC Steering Wheel appears to have combined pedals // (both the Accelerate and Brake pedals are mapped to a single axis) @@ -219,12 +219,12 @@ bool CSIDevice_GCSteeringWheel::GetData(u32& _Hi, u32& _Low) } else if (m_LastButtonCombo == COMBO_ORIGIN) { - m_Origin.uOriginStickX = PadStatus.stickX; - m_Origin.uOriginStickY = PadStatus.stickY; - m_Origin.uSubStickStickX = PadStatus.substickX; - m_Origin.uSubStickStickY = PadStatus.substickY; - m_Origin.uTrigger_L = PadStatus.triggerLeft; - m_Origin.uTrigger_R = PadStatus.triggerRight; + m_Origin.uOriginStickX = PadStatus.stickX; + m_Origin.uOriginStickY = PadStatus.stickY; + m_Origin.uSubStickStickX = PadStatus.substickX; + m_Origin.uSubStickStickY = PadStatus.substickY; + m_Origin.uTrigger_L = PadStatus.triggerLeft; + m_Origin.uTrigger_R = PadStatus.triggerRight; } m_LastButtonCombo = COMBO_NONE; } diff --git a/Source/Core/Core/HW/SystemTimers.cpp b/Source/Core/Core/HW/SystemTimers.cpp index fdce305f9b..9c519793a3 100644 --- a/Source/Core/Core/HW/SystemTimers.cpp +++ b/Source/Core/Core/HW/SystemTimers.cpp @@ -84,18 +84,18 @@ namespace SystemTimers u32 CPU_CORE_CLOCK = 486000000u; // 486 mhz (its not 485, stop bugging me!) /* -Gamecube MHz -flipper <-> ARAM bus: 81 (DSP) -gekko <-> flipper bus: 162 -flipper <-> 1T-SRAM bus: 324 -gekko: 486 +Gamecube MHz +flipper <-> ARAM bus: 81 (DSP) +gekko <-> flipper bus: 162 +flipper <-> 1T-SRAM bus: 324 +gekko: 486 These contain some guesses: -Wii MHz -hollywood <-> GDDR3 RAM bus: ??? no idea really -broadway <-> hollywood bus: 243 -hollywood <-> 1T-SRAM bus: 486 -broadway: 729 +Wii MHz +hollywood <-> GDDR3 RAM bus: ??? no idea really +broadway <-> hollywood bus: 243 +hollywood <-> 1T-SRAM bus: 486 +broadway: 729 */ // Ratio of TB and Decrementer to clock cycles. // TB clk is 1/4 of BUS clk. And it seems BUS clk is really 1/3 of CPU clk. diff --git a/Source/Core/Core/HW/VideoInterface.cpp b/Source/Core/Core/HW/VideoInterface.cpp index 808bb1dc1f..66f0d70517 100644 --- a/Source/Core/Core/HW/VideoInterface.cpp +++ b/Source/Core/Core/HW/VideoInterface.cpp @@ -23,30 +23,30 @@ namespace VideoInterface // STATE_TO_SAVE // Registers listed in order: -static UVIVerticalTimingRegister m_VerticalTimingRegister; -static UVIDisplayControlRegister m_DisplayControlRegister; -static UVIHorizontalTiming0 m_HTiming0; -static UVIHorizontalTiming1 m_HTiming1; -static UVIVBlankTimingRegister m_VBlankTimingOdd; -static UVIVBlankTimingRegister m_VBlankTimingEven; -static UVIBurstBlankingRegister m_BurstBlankingOdd; -static UVIBurstBlankingRegister m_BurstBlankingEven; -static UVIFBInfoRegister m_XFBInfoTop; -static UVIFBInfoRegister m_XFBInfoBottom; -static UVIFBInfoRegister m_3DFBInfoTop; // Start making your stereoscopic demos! :p -static UVIFBInfoRegister m_3DFBInfoBottom; -static u16 m_VBeamPos = 0; // 0: Inactive -static u16 m_HBeamPos = 0; // 0: Inactive -static UVIInterruptRegister m_InterruptRegister[4]; -static UVILatchRegister m_LatchRegister[2]; -static UVIHorizontalStepping m_HorizontalStepping; -static UVIHorizontalScaling m_HorizontalScaling; -static SVIFilterCoefTables m_FilterCoefTables; -static u32 m_UnkAARegister = 0;// ??? 0x00FF0000 -static u16 m_Clock = 0; // 0: 27MHz, 1: 54MHz -static UVIDTVStatus m_DTVStatus; -static u16 m_FBWidth = 0; // Only correct when scaling is enabled? -static UVIBorderBlankRegister m_BorderHBlank; +static UVIVerticalTimingRegister m_VerticalTimingRegister; +static UVIDisplayControlRegister m_DisplayControlRegister; +static UVIHorizontalTiming0 m_HTiming0; +static UVIHorizontalTiming1 m_HTiming1; +static UVIVBlankTimingRegister m_VBlankTimingOdd; +static UVIVBlankTimingRegister m_VBlankTimingEven; +static UVIBurstBlankingRegister m_BurstBlankingOdd; +static UVIBurstBlankingRegister m_BurstBlankingEven; +static UVIFBInfoRegister m_XFBInfoTop; +static UVIFBInfoRegister m_XFBInfoBottom; +static UVIFBInfoRegister m_3DFBInfoTop; // Start making your stereoscopic demos! :p +static UVIFBInfoRegister m_3DFBInfoBottom; +static u16 m_VBeamPos = 0; // 0: Inactive +static u16 m_HBeamPos = 0; // 0: Inactive +static UVIInterruptRegister m_InterruptRegister[4]; +static UVILatchRegister m_LatchRegister[2]; +static UVIHorizontalStepping m_HorizontalStepping; +static UVIHorizontalScaling m_HorizontalScaling; +static SVIFilterCoefTables m_FilterCoefTables; +static u32 m_UnkAARegister = 0;// ??? 0x00FF0000 +static u16 m_Clock = 0; // 0: 27MHz, 1: 54MHz +static UVIDTVStatus m_DTVStatus; +static u16 m_FBWidth = 0; // Only correct when scaling is enabled? +static UVIBorderBlankRegister m_BorderHBlank; // 0xcc002076 - 0xcc00207f is full of 0x00FF: unknown // 0xcc002080 - 0xcc002100 even more unknown diff --git a/Source/Core/Core/HW/VideoInterface.h b/Source/Core/Core/HW/VideoInterface.h index 7363f74968..dc4a3c248c 100644 --- a/Source/Core/Core/HW/VideoInterface.h +++ b/Source/Core/Core/HW/VideoInterface.h @@ -16,22 +16,22 @@ namespace VideoInterface // the field rate from 60 FPS when they added color to the standard. // This was done to prevent analog interference between the video and // audio signals. PAL has no similar reduction; it is exactly 50 FPS. -//#define NTSC_FIELD_RATE (60.0f / 1.001f) -#define NTSC_FIELD_RATE 60 -#define NTSC_LINE_COUNT 525 +//#define NTSC_FIELD_RATE (60.0f / 1.001f) +#define NTSC_FIELD_RATE 60 +#define NTSC_LINE_COUNT 525 // These line numbers indicate the beginning of the "active video" in a frame. // An NTSC frame has the lower field first followed by the upper field. // TODO: Is this true for PAL-M? Is this true for EURGB60? -#define NTSC_LOWER_BEGIN 21 -#define NTSC_UPPER_BEGIN 283 +#define NTSC_LOWER_BEGIN 21 +#define NTSC_UPPER_BEGIN 283 -//#define PAL_FIELD_RATE 50.0f -#define PAL_FIELD_RATE 50 -#define PAL_LINE_COUNT 625 +//#define PAL_FIELD_RATE 50.0f +#define PAL_FIELD_RATE 50 +#define PAL_LINE_COUNT 625 // These line numbers indicate the beginning of the "active video" in a frame. // A PAL frame has the upper field first followed by the lower field. -#define PAL_UPPER_BEGIN 23 -#define PAL_LOWER_BEGIN 336 +#define PAL_UPPER_BEGIN 23 +#define PAL_LOWER_BEGIN 336 // VI Internal Hardware Addresses enum diff --git a/Source/Core/Core/HW/WII_IPC.cpp b/Source/Core/Core/HW/WII_IPC.cpp index 49e1fff41f..04bd936d43 100644 --- a/Source/Core/Core/HW/WII_IPC.cpp +++ b/Source/Core/Core/HW/WII_IPC.cpp @@ -119,13 +119,13 @@ void DoState(PointerWrap &p) void Init() { ctrl = CtrlRegister(); - ppc_msg = - arm_msg = + ppc_msg = 0; + arm_msg = 0; - ppc_irq_flags = - ppc_irq_masks = - arm_irq_flags = - arm_irq_masks = + ppc_irq_flags = 0; + ppc_irq_masks = 0; + arm_irq_flags = 0; + arm_irq_masks = 0; sensorbar_power = 0; diff --git a/Source/Core/Core/HW/WiimoteEmu/MatrixMath.h b/Source/Core/Core/HW/WiimoteEmu/MatrixMath.h index 42944cdfd1..d7eeaf8c8d 100644 --- a/Source/Core/Core/HW/WiimoteEmu/MatrixMath.h +++ b/Source/Core/Core/HW/WiimoteEmu/MatrixMath.h @@ -7,7 +7,7 @@ #include #ifndef M_PI -#define M_PI 3.14159265358979323846 +#define M_PI 3.14159265358979323846 #endif typedef double Matrix[4][4]; @@ -26,10 +26,10 @@ inline void MatrixIdentity(Matrix & m) inline void MatrixFrustum(Matrix &m, double l, double r, double b, double t, double n, double f) { - m[0][0]=2*n/(r-l); m[0][1]=0; m[0][2]=0; m[0][3]=0; - m[1][0]=0; m[1][1]=2*n/(t-b); m[1][2]=0; m[1][3]=0; - m[2][0]=(r+l)/(r-l); m[2][1]=(t+b)/(t-b); m[2][2]=(f+n)/(f-n); m[2][3]=-1; - m[3][0]=0; m[3][1]=0; m[3][2]=2*f*n/(f-n); m[3][3]=0; + m[0][0]=2*n/(r-l); m[0][1]=0; m[0][2]=0; m[0][3]=0; + m[1][0]=0; m[1][1]=2*n/(t-b); m[1][2]=0; m[1][3]=0; + m[2][0]=(r+l)/(r-l); m[2][1]=(t+b)/(t-b); m[2][2]=(f+n)/(f-n); m[2][3]=-1; + m[3][0]=0; m[3][1]=0; m[3][2]=2*f*n/(f-n); m[3][3]=0; } inline void MatrixPerspective(Matrix & m, double fovy, double aspect, double nplane, double fplane) @@ -47,23 +47,24 @@ inline void MatrixPerspective(Matrix & m, double fovy, double aspect, double npl inline void MatrixRotationByZ(Matrix &m, double sin, double cos) { m[0][0]=cos; m[0][1]=-sin; m[0][2]=0; m[0][3]=0; - m[1][0]=sin; m[1][1]=cos; m[1][2]=0; m[1][3]=0; - m[2][0]=0; m[2][1]=0; m[2][2]=1; m[2][3]=0; - m[3][0]=0; m[3][1]=0; m[3][2]=0; m[3][3]=1; + m[1][0]=sin; m[1][1]=cos; m[1][2]=0; m[1][3]=0; + m[2][0]=0; m[2][1]=0; m[2][2]=1; m[2][3]=0; + m[3][0]=0; m[3][1]=0; m[3][2]=0; m[3][3]=1; } inline void MatrixScale(Matrix &m, double xfact, double yfact, double zfact) { - m[0][0]=xfact; m[0][1]=0; m[0][2]=0; m[0][3]=0; - m[1][0]=0; m[1][1]=yfact; m[1][2]=0; m[1][3]=0; - m[2][0]=0; m[2][1]=0; m[2][2]=zfact; m[2][3]=0; - m[3][0]=0; m[3][1]=0; m[3][2]=0; m[3][3]=1; + m[0][0]=xfact; m[0][1]=0; m[0][2]=0; m[0][3]=0; + m[1][0]=0; m[1][1]=yfact; m[1][2]=0; m[1][3]=0; + m[2][0]=0; m[2][1]=0; m[2][2]=zfact; m[2][3]=0; + m[3][0]=0; m[3][1]=0; m[3][2]=0; m[3][3]=1; } inline void MatrixMultiply(Matrix &r, const Matrix &a, const Matrix &b) { for (int i=0; i<16; i++) r[i>>2][i&3]=0.0f; + for (int i=0; i<4; i++) for (int j=0; j<4; j++) for (int k=0; k<4; k++) diff --git a/Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp b/Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp index edebc2fb1b..e0c4a36e39 100644 --- a/Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp +++ b/Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp @@ -899,21 +899,21 @@ void Wiimote::LoadDefaults(const ControllerInterface& ciface) // Buttons #if defined HAVE_X11 && HAVE_X11 - set_control(m_buttons, 0, "Click 1"); // A - set_control(m_buttons, 1, "Click 3"); // B + set_control(m_buttons, 0, "Click 1"); // A + set_control(m_buttons, 1, "Click 3"); // B #else - set_control(m_buttons, 0, "Click 0"); // A - set_control(m_buttons, 1, "Click 1"); // B + set_control(m_buttons, 0, "Click 0"); // A + set_control(m_buttons, 1, "Click 1"); // B #endif - set_control(m_buttons, 2, "1"); // 1 - set_control(m_buttons, 3, "2"); // 2 - set_control(m_buttons, 4, "Q"); // - - set_control(m_buttons, 5, "E"); // + + set_control(m_buttons, 2, "1"); // 1 + set_control(m_buttons, 3, "2"); // 2 + set_control(m_buttons, 4, "Q"); // - + set_control(m_buttons, 5, "E"); // + #ifdef _WIN32 - set_control(m_buttons, 6, "RETURN"); // Home + set_control(m_buttons, 6, "RETURN"); // Home #else - set_control(m_buttons, 6, "Return"); // Home + set_control(m_buttons, 6, "Return"); // Home #endif // Shake @@ -928,20 +928,20 @@ void Wiimote::LoadDefaults(const ControllerInterface& ciface) // DPad #ifdef _WIN32 - set_control(m_dpad, 0, "UP"); // Up - set_control(m_dpad, 1, "DOWN"); // Down - set_control(m_dpad, 2, "LEFT"); // Left - set_control(m_dpad, 3, "RIGHT"); // Right + set_control(m_dpad, 0, "UP"); // Up + set_control(m_dpad, 1, "DOWN"); // Down + set_control(m_dpad, 2, "LEFT"); // Left + set_control(m_dpad, 3, "RIGHT"); // Right #elif __APPLE__ - set_control(m_dpad, 0, "Up Arrow"); // Up - set_control(m_dpad, 1, "Down Arrow"); // Down - set_control(m_dpad, 2, "Left Arrow"); // Left - set_control(m_dpad, 3, "Right Arrow"); // Right + set_control(m_dpad, 0, "Up Arrow"); // Up + set_control(m_dpad, 1, "Down Arrow"); // Down + set_control(m_dpad, 2, "Left Arrow"); // Left + set_control(m_dpad, 3, "Right Arrow"); // Right #else - set_control(m_dpad, 0, "Up"); // Up - set_control(m_dpad, 1, "Down"); // Down - set_control(m_dpad, 2, "Left"); // Left - set_control(m_dpad, 3, "Right"); // Right + set_control(m_dpad, 0, "Up"); // Up + set_control(m_dpad, 1, "Down"); // Down + set_control(m_dpad, 2, "Left"); // Left + set_control(m_dpad, 3, "Right"); // Right #endif // ugly stuff diff --git a/Source/Core/Core/HW/WiimoteEmu/WiimoteHid.h b/Source/Core/Core/HW/WiimoteEmu/WiimoteHid.h index 01b4018356..f417f810aa 100644 --- a/Source/Core/Core/HW/WiimoteEmu/WiimoteHid.h +++ b/Source/Core/Core/HW/WiimoteEmu/WiimoteHid.h @@ -175,10 +175,10 @@ struct wm_report u8 data[0]; struct { - u8 rumble : 1; // enable/disable rumble + u8 rumble : 1; // enable/disable rumble // only valid for certain reports - u8 ack : 1; // respond with an ack - u8 enable : 1; // enable/disable certain features + u8 ack : 1; // respond with an ack + u8 enable : 1; // enable/disable certain features }; }; }; @@ -232,7 +232,7 @@ struct wm_status_report struct wm_write_data { u8 rumble : 1; - u8 space : 2; //see WM_SPACE_* + u8 space : 2; //see WM_SPACE_* u8 : 5; u8 address[3]; u8 size; @@ -251,7 +251,7 @@ struct wm_acknowledge struct wm_read_data { u8 rumble : 1; - u8 space : 2; //see WM_SPACE_* + u8 space : 2; //see WM_SPACE_* u8 : 5; u8 address[3]; u16 size; @@ -266,7 +266,7 @@ struct wm_read_data struct wm_read_data_reply { wm_core buttons; - u8 error : 4; //see WM_RDERR_* + u8 error : 4; //see WM_RDERR_* u8 size : 4; u16 address; u8 data[16]; diff --git a/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp b/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp index 94724e35cc..e5f7fe8724 100644 --- a/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp +++ b/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp @@ -19,7 +19,7 @@ #include "../WiimoteEmu/WiimoteHid.h" -unsigned int g_wiimote_sources[MAX_BBMOTES]; +unsigned int g_wiimote_sources[MAX_BBMOTES]; namespace WiimoteReal { diff --git a/Source/Core/Core/HW/WiimoteReal/WiimoteReal.h b/Source/Core/Core/HW/WiimoteReal/WiimoteReal.h index 90b124772b..d4fef86c69 100644 --- a/Source/Core/Core/HW/WiimoteReal/WiimoteReal.h +++ b/Source/Core/Core/HW/WiimoteReal/WiimoteReal.h @@ -82,17 +82,17 @@ public: bool m_connected; CFRunLoopRef m_wiimote_thread_run_loop; #elif defined(__linux__) && HAVE_BLUEZ - bdaddr_t bdaddr; // Bluetooth address - int cmd_sock; // Command socket - int int_sock; // Interrupt socket + bdaddr_t bdaddr; // Bluetooth address + int cmd_sock; // Command socket + int int_sock; // Interrupt socket int wakeup_pipe_w, wakeup_pipe_r; #elif defined(_WIN32) - std::basic_string devicepath; // Unique wiimote reference - //ULONGLONG btaddr; // Bluetooth address - HANDLE dev_handle; // HID handle - OVERLAPPED hid_overlap_read, hid_overlap_write; // Overlap handle - enum win_bt_stack_t stack; // Type of bluetooth stack to use + std::basic_string devicepath; // Unique wiimote reference + //ULONGLONG btaddr; // Bluetooth address + HANDLE dev_handle; // HID handle + OVERLAPPED hid_overlap_read, hid_overlap_write; // Overlap handle + enum win_bt_stack_t stack; // Type of bluetooth stack to use #endif protected: diff --git a/Source/Core/Core/HW/WiimoteReal/WiimoteRealBase.h b/Source/Core/Core/HW/WiimoteReal/WiimoteRealBase.h index f9997a38ff..4d1f6a2d36 100644 --- a/Source/Core/Core/HW/WiimoteReal/WiimoteRealBase.h +++ b/Source/Core/Core/HW/WiimoteReal/WiimoteRealBase.h @@ -22,33 +22,33 @@ // Wiimote internal codes // Communication channels -#define WM_OUTPUT_CHANNEL 0x11 -#define WM_INPUT_CHANNEL 0x13 +#define WM_OUTPUT_CHANNEL 0x11 +#define WM_INPUT_CHANNEL 0x13 // The 4 most significant bits of the first byte of an outgoing command must be // 0x50 if sending on the command channel and 0xA0 if sending on the interrupt // channel. On Mac and Linux we use interrupt channel; on Windows, command. #ifdef _WIN32 -#define WM_SET_REPORT 0x50 +#define WM_SET_REPORT 0x50 #else -#define WM_SET_REPORT 0xA0 +#define WM_SET_REPORT 0xA0 #endif -#define WM_BT_INPUT 0x01 -#define WM_BT_OUTPUT 0x02 +#define WM_BT_INPUT 0x01 +#define WM_BT_OUTPUT 0x02 // LED bit masks -#define WIIMOTE_LED_NONE 0x00 -#define WIIMOTE_LED_1 0x10 -#define WIIMOTE_LED_2 0x20 -#define WIIMOTE_LED_3 0x40 -#define WIIMOTE_LED_4 0x80 +#define WIIMOTE_LED_NONE 0x00 +#define WIIMOTE_LED_1 0x10 +#define WIIMOTE_LED_2 0x20 +#define WIIMOTE_LED_3 0x40 +#define WIIMOTE_LED_4 0x80 // End Wiimote internal codes // It's 23. NOT 32! -#define MAX_PAYLOAD 23 -#define WIIMOTE_DEFAULT_TIMEOUT 1000 +#define MAX_PAYLOAD 23 +#define WIIMOTE_DEFAULT_TIMEOUT 1000 #ifdef _WIN32 // Available bluetooth stacks for Windows. diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE.h b/Source/Core/Core/IPC_HLE/WII_IPC_HLE.h index 7d18cb4498..20528b1142 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE.h +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE.h @@ -11,8 +11,8 @@ class IWII_IPC_HLE_Device; namespace WII_IPC_HLE_Interface { -#define IPC_FIRST_ID 0x00 // first IPC device ID -#define IPC_MAX_FILES 0x10 // first IPC file ID +#define IPC_FIRST_ID 0x00 // First IPC device ID +#define IPC_MAX_FILES 0x10 // First IPC file ID void EnqueReplyCallback(u64 userdata, int =0); @@ -54,13 +54,13 @@ void EnqReply(u32 _Address, int cycles_in_future = 0); enum ECommandType { - COMMAND_OPEN_DEVICE = 1, - COMMAND_CLOSE_DEVICE = 2, - COMMAND_READ = 3, - COMMAND_WRITE = 4, - COMMAND_SEEK = 5, - COMMAND_IOCTL = 6, - COMMAND_IOCTLV = 7, + COMMAND_OPEN_DEVICE = 1, + COMMAND_CLOSE_DEVICE = 2, + COMMAND_READ = 3, + COMMAND_WRITE = 4, + COMMAND_SEEK = 5, + COMMAND_IOCTL = 6, + COMMAND_IOCTLV = 7, }; } // end of namespace WII_IPC_HLE_Interface diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_es.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_es.cpp index ea4230f485..8ae31d71f9 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_es.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_es.cpp @@ -68,23 +68,23 @@ CWII_IPC_HLE_Device_es::CWII_IPC_HLE_Device_es(u32 _DeviceID, const std::string& { } -static u8 key_sd [0x10] = {0xab, 0x01, 0xb9, 0xd8, 0xe1, 0x62, 0x2b, 0x08, 0xaf, 0xba, 0xd8, 0x4d, 0xbf, 0xc2, 0xa5, 0x5d}; -static u8 key_ecc [0x1e] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}; -static u8 key_empty[0x10] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; +static u8 key_sd [0x10] = {0xab, 0x01, 0xb9, 0xd8, 0xe1, 0x62, 0x2b, 0x08, 0xaf, 0xba, 0xd8, 0x4d, 0xbf, 0xc2, 0xa5, 0x5d}; +static u8 key_ecc [0x1e] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}; +static u8 key_empty[0x10] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; // default key table u8* CWII_IPC_HLE_Device_es::keyTable[11] = { - key_ecc, // ECC Private Key - key_empty, // Console ID - key_empty, // NAND AES Key - key_empty, // NAND HMAC - key_empty, // Common Key - key_empty, // PRNG seed - key_sd, // SD Key - key_empty, // Unknown - key_empty, // Unknown - key_empty, // Unknown - key_empty, // Unknown + key_ecc, // ECC Private Key + key_empty, // Console ID + key_empty, // NAND AES Key + key_empty, // NAND HMAC + key_empty, // Common Key + key_empty, // PRNG seed + key_sd, // SD Key + key_empty, // Unknown + key_empty, // Unknown + key_empty, // Unknown + key_empty, // Unknown }; CWII_IPC_HLE_Device_es::~CWII_IPC_HLE_Device_es() @@ -875,12 +875,12 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress) case IOCTL_ES_DECRYPT: { - u32 keyIndex = Memory::Read_U32(Buffer.InBuffer[0].m_Address); - u8* IV = Memory::GetPointer(Buffer.InBuffer[1].m_Address); - u8* source = Memory::GetPointer(Buffer.InBuffer[2].m_Address); - u32 size = Buffer.InBuffer[2].m_Size; - u8* newIV = Memory::GetPointer(Buffer.PayloadBuffer[0].m_Address); - u8* destination = Memory::GetPointer(Buffer.PayloadBuffer[1].m_Address); + u32 keyIndex = Memory::Read_U32(Buffer.InBuffer[0].m_Address); + u8* IV = Memory::GetPointer(Buffer.InBuffer[1].m_Address); + u8* source = Memory::GetPointer(Buffer.InBuffer[2].m_Address); + u32 size = Buffer.InBuffer[2].m_Size; + u8* newIV = Memory::GetPointer(Buffer.PayloadBuffer[0].m_Address); + u8* destination = Memory::GetPointer(Buffer.PayloadBuffer[1].m_Address); aes_context AES_ctx; aes_setkey_dec(&AES_ctx, keyTable[keyIndex], 128); @@ -898,12 +898,12 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress) bool bSuccess = false; u16 IOSv = 0xffff; - u64 TitleID = Memory::Read_U64(Buffer.InBuffer[0].m_Address); - u32 view = Memory::Read_U32(Buffer.InBuffer[1].m_Address); - u64 ticketid = Memory::Read_U64(Buffer.InBuffer[1].m_Address+4); - u32 devicetype = Memory::Read_U32(Buffer.InBuffer[1].m_Address+12); - u64 titleid = Memory::Read_U64(Buffer.InBuffer[1].m_Address+16); - u16 access = Memory::Read_U16(Buffer.InBuffer[1].m_Address+24); + u64 TitleID = Memory::Read_U64(Buffer.InBuffer[0].m_Address); + u32 view = Memory::Read_U32(Buffer.InBuffer[1].m_Address); + u64 ticketid = Memory::Read_U64(Buffer.InBuffer[1].m_Address+4); + u32 devicetype = Memory::Read_U32(Buffer.InBuffer[1].m_Address+12); + u64 titleid = Memory::Read_U64(Buffer.InBuffer[1].m_Address+16); + u16 access = Memory::Read_U16(Buffer.InBuffer[1].m_Address+24); if ((u32)(TitleID>>32) != 0x00000001 || TitleID == TITLEID_SYSMENU) diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_fs.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_fs.cpp index 31c5c6f7cd..cae62b8f70 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_fs.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_fs.cpp @@ -267,13 +267,13 @@ s32 CWII_IPC_HLE_Device_fs::ExecuteCommand(u32 _Parameter, u32 _BufferIn, u32 _B NANDStat fs; //TODO: scrape the real amounts from somewhere... - fs.BlockSize = 0x4000; - fs.FreeUserBlocks = 0x5DEC; - fs.UsedUserBlocks = 0x1DD4; - fs.FreeSysBlocks = 0x10; - fs.UsedSysBlocks = 0x02F0; - fs.Free_INodes = 0x146B; - fs.Used_Inodes = 0x0394; + fs.BlockSize = 0x4000; + fs.FreeUserBlocks = 0x5DEC; + fs.UsedUserBlocks = 0x1DD4; + fs.FreeSysBlocks = 0x10; + fs.UsedSysBlocks = 0x02F0; + fs.Free_INodes = 0x146B; + fs.Used_Inodes = 0x0394; *(NANDStat*)Memory::GetPointer(_BufferOut) = fs; @@ -335,10 +335,10 @@ s32 CWII_IPC_HLE_Device_fs::ExecuteCommand(u32 _Parameter, u32 _BufferIn, u32 _B u32 OwnerID = 0; u16 GroupID = 0x3031; // this is also known as makercd, 01 (0x3031) for nintendo and 08 (0x3038) for MH3 etc std::string Filename = HLE_IPC_BuildFilename((const char*)Memory::GetPointer(_BufferIn), 64); - u8 OwnerPerm = 0x3; // read/write - u8 GroupPerm = 0x3; // read/write - u8 OtherPerm = 0x3; // read/write - u8 Attributes = 0x00; // no attributes + u8 OwnerPerm = 0x3; // read/write + u8 GroupPerm = 0x3; // read/write + u8 OtherPerm = 0x3; // read/write + u8 Attributes = 0x00; // no attributes if (File::IsDirectory(Filename)) { INFO_LOG(WII_IPC_FILEIO, "FS: GET_ATTR Directory %s - all permission flags are set", Filename.c_str()); @@ -360,13 +360,13 @@ s32 CWII_IPC_HLE_Device_fs::ExecuteCommand(u32 _Parameter, u32 _BufferIn, u32 _B if (_BufferOutSize == 76) { u32 Addr = _BufferOut; - Memory::Write_U32(OwnerID, Addr); Addr += 4; - Memory::Write_U16(GroupID, Addr); Addr += 2; - memcpy(Memory::GetPointer(Addr), Memory::GetPointer(_BufferIn), 64); Addr += 64; - Memory::Write_U8(OwnerPerm, Addr); Addr += 1; - Memory::Write_U8(GroupPerm, Addr); Addr += 1; - Memory::Write_U8(OtherPerm, Addr); Addr += 1; - Memory::Write_U8(Attributes, Addr); Addr += 1; + Memory::Write_U32(OwnerID, Addr); Addr += 4; + Memory::Write_U16(GroupID, Addr); Addr += 2; + memcpy(Memory::GetPointer(Addr), Memory::GetPointer(_BufferIn), 64); Addr += 64; + Memory::Write_U8(OwnerPerm, Addr); Addr += 1; + Memory::Write_U8(GroupPerm, Addr); Addr += 1; + Memory::Write_U8(OtherPerm, Addr); Addr += 1; + Memory::Write_U8(Attributes, Addr); Addr += 1; } return FS_RESULT_OK; diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_hid.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_hid.cpp index 636c8830a8..23f618f4fa 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_hid.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_hid.cpp @@ -130,11 +130,11 @@ u32 CWII_IPC_HLE_Device_hid::Update() bool CWII_IPC_HLE_Device_hid::IOCtl(u32 _CommandAddress) { - u32 Parameter = Memory::Read_U32(_CommandAddress + 0xC); - u32 BufferIn = Memory::Read_U32(_CommandAddress + 0x10); - u32 BufferInSize = Memory::Read_U32(_CommandAddress + 0x14); - u32 BufferOut = Memory::Read_U32(_CommandAddress + 0x18); - u32 BufferOutSize = Memory::Read_U32(_CommandAddress + 0x1C); + u32 Parameter = Memory::Read_U32(_CommandAddress + 0xC); + u32 BufferIn = Memory::Read_U32(_CommandAddress + 0x10); + u32 BufferInSize = Memory::Read_U32(_CommandAddress + 0x14); + u32 BufferOut = Memory::Read_U32(_CommandAddress + 0x18); + u32 BufferOutSize = Memory::Read_U32(_CommandAddress + 0x1C); u32 ReturnValue = 0; switch (Parameter) @@ -536,7 +536,8 @@ libusb_device_handle * CWII_IPC_HLE_Device_hid::GetDeviceByDevNum(u32 devNum) static bool has_warned_about_drivers = false; #endif - for (ssize_t i = 0; i < cnt; i++) { + for (ssize_t i = 0; i < cnt; i++) + { libusb_device *device = list[i]; struct libusb_device_descriptor desc; int dRet = libusb_get_device_descriptor (device, &desc); @@ -610,10 +611,10 @@ libusb_device_handle * CWII_IPC_HLE_Device_hid::GetDeviceByDevNum(u32 devNum) int CWII_IPC_HLE_Device_hid::GetAvaiableDevNum(u16 idVendor, u16 idProduct, u8 bus, u8 port, u16 check) { - int i; int pos = -1; u64 unique_id = ((u64)idVendor << 32) | ((u64)idProduct << 16) | ((u64)bus << 8) | (u64)port; - for (i=0; icon_handle = HCI_MK_CON_HANDLE(conn_handle, HCI_PACKET_START, HCI_POINT2POINT); - pHeader->length = size; + pHeader->con_handle = HCI_MK_CON_HANDLE(conn_handle, HCI_PACKET_START, HCI_POINT2POINT); + pHeader->length = size; // Write the packet to the buffer std::copy(data, data + size, (u8*)pHeader + sizeof(hci_acldata_hdr_t)); @@ -870,12 +870,12 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventNumberOfCompletedPackets() INFO_LOG(WII_IPC_WIIMOTE, "Event: SendEventNumberOfCompletedPackets"); - hci_event_hdr_t* event_hdr = (hci_event_hdr_t*)Event.m_buffer; - hci_num_compl_pkts_ep* event = (hci_num_compl_pkts_ep*)((u8*)event_hdr + sizeof(hci_event_hdr_t)); - hci_num_compl_pkts_info* info = (hci_num_compl_pkts_info*)((u8*)event + sizeof(hci_num_compl_pkts_ep)); + hci_event_hdr_t* event_hdr = (hci_event_hdr_t*)Event.m_buffer; + hci_num_compl_pkts_ep* event = (hci_num_compl_pkts_ep*)((u8*)event_hdr + sizeof(hci_event_hdr_t)); + hci_num_compl_pkts_info* info = (hci_num_compl_pkts_info*)((u8*)event + sizeof(hci_num_compl_pkts_ep)); - event_hdr->event = HCI_EVENT_NUM_COMPL_PKTS; - event_hdr->length = sizeof(hci_num_compl_pkts_ep); + event_hdr->event = HCI_EVENT_NUM_COMPL_PKTS; + event_hdr->length = sizeof(hci_num_compl_pkts_ep); event->num_con_handles = 0; u32 acc = 0; @@ -941,10 +941,10 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventLinkKeyNotification(const u8 INFO_LOG(WII_IPC_WIIMOTE, "Event: SendEventLinkKeyNotification"); // event header - pEventLinkKey->EventType = HCI_EVENT_RETURN_LINK_KEYS; - pEventLinkKey->PayloadLength = payload_length; + pEventLinkKey->EventType = HCI_EVENT_RETURN_LINK_KEYS; + pEventLinkKey->PayloadLength = payload_length; // this is really hci_return_link_keys_ep.num_keys - pEventLinkKey->numKeys = num_to_send; + pEventLinkKey->numKeys = num_to_send; // copy infos - this only works correctly if we're meant to start at first device and read all keys for (int i = 0; i < num_to_send; i++) diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb.h b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb.h index 396d5db079..5f5e73f8b9 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb.h +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb.h @@ -112,8 +112,8 @@ private: { if (m_address) { - u32 InBufferNum = Memory::Read_U32(m_address + 0x10); - u32 BufferVector = Memory::Read_U32(m_address + 0x18); + u32 InBufferNum = Memory::Read_U32(m_address + 0x10); + u32 BufferVector = Memory::Read_U32(m_address + 0x18); m_buffer = Memory::Read_U32( BufferVector + InBufferNum * sizeof(SIOCtlVBuffer::SBuffer)); } diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_kbd.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_kbd.cpp index 4300ecc4da..978cd2313a 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_kbd.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_usb_kbd.cpp @@ -59,7 +59,7 @@ bool CWII_IPC_HLE_Device_usb_kbd::Write(u32 _CommandAddress) bool CWII_IPC_HLE_Device_usb_kbd::IOCtl(u32 _CommandAddress) { - u32 BufferOut = Memory::Read_U32(_CommandAddress + 0x18); + u32 BufferOut = Memory::Read_U32(_CommandAddress + 0x18); if (SConfig::GetInstance().m_WiiKeyboard && !m_MessageQueue.empty()) { diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_WiiMote.cpp b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_WiiMote.cpp index d873914b2b..9aaf0a537c 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_WiiMote.cpp +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_WiiMote.cpp @@ -591,7 +591,8 @@ void CWII_IPC_HLE_WiiMote::SendConfigurationRequest(u16 scid, u16 MTU, u16 Flush l2cap_cfg_req_cp* cr = (l2cap_cfg_req_cp*)&Buffer[Offset]; cr->dcid = rChannel.DCID; - cr->flags = 0; Offset += sizeof(l2cap_cfg_req_cp); + cr->flags = 0; + Offset += sizeof(l2cap_cfg_req_cp); INFO_LOG(WII_IPC_WIIMOTE, "[L2CAP] SendConfigurationRequest"); DEBUG_LOG(WII_IPC_WIIMOTE, " Dcid: 0x%04x", cr->dcid); @@ -607,10 +608,10 @@ void CWII_IPC_HLE_WiiMote::SendConfigurationRequest(u16 scid, u16 MTU, u16 Flush { if (MTU == 0) MTU = rChannel.MTU; - pOptions = (l2cap_cfg_opt_t*)&Buffer[Offset]; Offset += sizeof(l2cap_cfg_opt_t); + pOptions = (l2cap_cfg_opt_t*)&Buffer[Offset]; Offset += sizeof(l2cap_cfg_opt_t); pOptions->type = L2CAP_OPT_MTU; pOptions->length = L2CAP_OPT_MTU_SIZE; - *(u16*)&Buffer[Offset] = MTU; Offset += L2CAP_OPT_MTU_SIZE; + *(u16*)&Buffer[Offset] = MTU; Offset += L2CAP_OPT_MTU_SIZE; DEBUG_LOG(WII_IPC_WIIMOTE, " MTU: 0x%04x", MTU); } @@ -618,10 +619,10 @@ void CWII_IPC_HLE_WiiMote::SendConfigurationRequest(u16 scid, u16 MTU, u16 Flush { if (FlushTimeOut == 0) FlushTimeOut = rChannel.FlushTimeOut; - pOptions = (l2cap_cfg_opt_t*)&Buffer[Offset]; Offset += sizeof(l2cap_cfg_opt_t); + pOptions = (l2cap_cfg_opt_t*)&Buffer[Offset]; Offset += sizeof(l2cap_cfg_opt_t); pOptions->type = L2CAP_OPT_FLUSH_TIMO; pOptions->length = L2CAP_OPT_FLUSH_TIMO_SIZE; - *(u16*)&Buffer[Offset] = FlushTimeOut; Offset += L2CAP_OPT_FLUSH_TIMO_SIZE; + *(u16*)&Buffer[Offset] = FlushTimeOut; Offset += L2CAP_OPT_FLUSH_TIMO_SIZE; DEBUG_LOG(WII_IPC_WIIMOTE, " FlushTimeOut: 0x%04x", FlushTimeOut); } @@ -640,11 +641,11 @@ void CWII_IPC_HLE_WiiMote::SendConfigurationRequest(u16 scid, u16 MTU, u16 Flush // // -#define SDP_UINT8 0x08 -#define SDP_UINT16 0x09 -#define SDP_UINT32 0x0A -#define SDP_SEQ8 0x35 -#define SDP_SEQ16 0x36 +#define SDP_UINT8 0x08 +#define SDP_UINT16 0x09 +#define SDP_UINT32 0x0A +#define SDP_SEQ8 0x35 +#define SDP_SEQ16 0x36 void CWII_IPC_HLE_WiiMote::SDPSendServiceSearchResponse(u16 cid, u16 TransactionID, u8* pServiceSearchPattern, u16 MaximumServiceRecordCount) { @@ -666,13 +667,13 @@ void CWII_IPC_HLE_WiiMote::SDPSendServiceSearchResponse(u16 cid, u16 Transaction l2cap_hdr_t* pHeader = (l2cap_hdr_t*)&DataFrame[Offset]; Offset += sizeof(l2cap_hdr_t); pHeader->dcid = cid; - buffer.Write8 (Offset, 0x03); Offset++; - buffer.Write16(Offset, TransactionID); Offset += 2; // transaction ID - buffer.Write16(Offset, 0x0009); Offset += 2; // param length - buffer.Write16(Offset, 0x0001); Offset += 2; // TotalServiceRecordCount - buffer.Write16(Offset, 0x0001); Offset += 2; // CurrentServiceRecordCount - buffer.Write32(Offset, 0x10000); Offset += 4; // ServiceRecordHandleList[4] - buffer.Write8(Offset, 0x00); Offset++; // no continuation state; + buffer.Write8 (Offset, 0x03); Offset++; + buffer.Write16(Offset, TransactionID); Offset += 2; // Transaction ID + buffer.Write16(Offset, 0x0009); Offset += 2; // Param length + buffer.Write16(Offset, 0x0001); Offset += 2; // TotalServiceRecordCount + buffer.Write16(Offset, 0x0001); Offset += 2; // CurrentServiceRecordCount + buffer.Write32(Offset, 0x10000); Offset += 4; // ServiceRecordHandleList[4] + buffer.Write8(Offset, 0x00); Offset++; // No continuation state; pHeader->length = (u16)(Offset - sizeof(l2cap_hdr_t)); @@ -683,7 +684,7 @@ static u32 ParseCont(u8* pCont) { u32 attribOffset = 0; CBigEndianBuffer attribList(pCont); - u8 typeID = attribList.Read8(attribOffset); attribOffset++; + u8 typeID = attribList.Read8(attribOffset); attribOffset++; if (typeID == 0x02) { @@ -704,9 +705,9 @@ int ParseAttribList(u8* pAttribIDList, u16& _startID, u16& _endID) u32 attribOffset = 0; CBigEndianBuffer attribList(pAttribIDList); - u8 sequence = attribList.Read8(attribOffset); attribOffset++; - u8 seqSize = attribList.Read8(attribOffset); attribOffset++; - u8 typeID = attribList.Read8(attribOffset); attribOffset++; + u8 sequence = attribList.Read8(attribOffset); attribOffset++; + u8 seqSize = attribList.Read8(attribOffset); attribOffset++; + u8 typeID = attribList.Read8(attribOffset); attribOffset++; #if MAX_LOGLEVEL >= DEBUG_LEVEL _dbg_assert_(WII_IPC_WIIMOTE, sequence == SDP_SEQ8); @@ -717,12 +718,12 @@ int ParseAttribList(u8* pAttribIDList, u16& _startID, u16& _endID) if (typeID == SDP_UINT32) { - _startID = attribList.Read16(attribOffset); attribOffset += 2; - _endID = attribList.Read16(attribOffset); attribOffset += 2; + _startID = attribList.Read16(attribOffset); attribOffset += 2; + _endID = attribList.Read16(attribOffset); attribOffset += 2; } else { - _startID = attribList.Read16(attribOffset); attribOffset += 2; + _startID = attribList.Read16(attribOffset); attribOffset += 2; _endID = _startID; DEBUG_LOG(WII_IPC_WIIMOTE, "Read just a single attrib - not tested"); PanicAlert("Read just a single attrib - not tested"); @@ -755,13 +756,13 @@ void CWII_IPC_HLE_WiiMote::SDPSendServiceAttributeResponse(u16 cid, u16 Transact CBigEndianBuffer buffer(DataFrame); int Offset = 0; - l2cap_hdr_t* pHeader = (l2cap_hdr_t*)&DataFrame[Offset]; Offset += sizeof(l2cap_hdr_t); + l2cap_hdr_t* pHeader = (l2cap_hdr_t*)&DataFrame[Offset]; Offset += sizeof(l2cap_hdr_t); pHeader->dcid = cid; - buffer.Write8 (Offset, 0x05); Offset++; - buffer.Write16(Offset, TransactionID); Offset += 2; // transaction ID + buffer.Write8 (Offset, 0x05); Offset++; + buffer.Write16(Offset, TransactionID); Offset += 2; // Transaction ID - memcpy(buffer.GetPointer(Offset), pPacket, packetSize); Offset += packetSize; + memcpy(buffer.GetPointer(Offset), pPacket, packetSize); Offset += packetSize; pHeader->length = (u16)(Offset - sizeof(l2cap_hdr_t)); m_pHost->SendACLPacket(GetConnectionHandle(), DataFrame, pHeader->length + sizeof(l2cap_hdr_t)); diff --git a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_WiiMote.h b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_WiiMote.h index 5e4bd85beb..68d04e37fa 100644 --- a/Source/Core/Core/IPC_HLE/WII_IPC_HLE_WiiMote.h +++ b/Source/Core/Core/IPC_HLE/WII_IPC_HLE_WiiMote.h @@ -19,15 +19,15 @@ class CBigEndianBuffer public: CBigEndianBuffer(u8* pBuffer) : m_pBuffer(pBuffer) {} - u8 Read8(u32 offset) { return m_pBuffer[offset]; } - u16 Read16(u32 offset) { return Common::swap16(*(u16*)&m_pBuffer[offset]); } - u32 Read32(u32 offset) { return Common::swap32(*(u32*)&m_pBuffer[offset]); } + u8 Read8(u32 offset) { return m_pBuffer[offset]; } + u16 Read16(u32 offset) { return Common::swap16(*(u16*)&m_pBuffer[offset]); } + u32 Read32(u32 offset) { return Common::swap32(*(u32*)&m_pBuffer[offset]); } - void Write8(u32 offset, u8 data) { m_pBuffer[offset] = data; } - void Write16(u32 offset, u16 data) { *(u16*)&m_pBuffer[offset] = Common::swap16(data); } - void Write32(u32 offset, u32 data) { *(u32*)&m_pBuffer[offset] = Common::swap32(data); } + void Write8(u32 offset, u8 data) { m_pBuffer[offset] = data; } + void Write16(u32 offset, u16 data) { *(u16*)&m_pBuffer[offset] = Common::swap16(data); } + void Write32(u32 offset, u32 data) { *(u32*)&m_pBuffer[offset] = Common::swap32(data); } - u8* GetPointer(u32 offset) { return &m_pBuffer[offset]; } + u8* GetPointer(u32 offset) { return &m_pBuffer[offset]; } private: u8* m_pBuffer; @@ -73,7 +73,7 @@ public: private: enum ConnectionState { - CONN_INACTIVE = -1, + CONN_INACTIVE = -1, CONN_READY, CONN_LINKING, CONN_COMPLETE diff --git a/Source/Core/Core/IPC_HLE/WII_Socket.cpp b/Source/Core/Core/IPC_HLE/WII_Socket.cpp index 35655778c9..06c1b361d3 100644 --- a/Source/Core/Core/IPC_HLE/WII_Socket.cpp +++ b/Source/Core/Core/IPC_HLE/WII_Socket.cpp @@ -150,9 +150,9 @@ s32 WiiSocket::closeFd() s32 WiiSocket::_fcntl(u32 cmd, u32 arg) { -#define F_GETFL 3 -#define F_SETFL 4 -#define F_NONBLOCK 4 +#define F_GETFL 3 +#define F_SETFL 4 +#define F_NONBLOCK 4 s32 ret = 0; if (cmd == F_GETFL) { @@ -490,7 +490,6 @@ void WiiSocket::update(bool read, bool write, bool except) BufferOutSize2 ? &addrlen : 0); ReturnValue = WiiSockMan::getNetErrorCode(ret, BufferOutSize2 ? "SO_RECVFROM" : "SO_RECV", true); - INFO_LOG(WII_IPC_NET, "%s(%d, %p) Socket: %08X, Flags: %08X, " "BufferIn: (%08x, %i), BufferIn2: (%08x, %i), " "BufferOut: (%08x, %i), BufferOut2: (%08x, %i)", @@ -510,7 +509,6 @@ void WiiSocket::update(bool read, bool write, bool except) break; } } - } if ( nonBlock || forceNonBlock diff --git a/Source/Core/Core/IPC_HLE/WiiMote_HID_Attr.cpp b/Source/Core/Core/IPC_HLE/WiiMote_HID_Attr.cpp index f919b4dec4..57e60e8899 100644 --- a/Source/Core/Core/IPC_HLE/WiiMote_HID_Attr.cpp +++ b/Source/Core/Core/IPC_HLE/WiiMote_HID_Attr.cpp @@ -9,37 +9,56 @@ #if 0 // 0x00 (checked) u8 ServiceRecordHandle[] = { 0x0a, 0x00, 0x01, 0x00, 0x00 }; + // 0x01 (checked) -u8 SrvClassIDList[] = { 0x35, 0x03, - 0x19, 0x11, 0x24 }; +u8 SrvClassIDList[] = { + 0x35, 0x03, + 0x19, 0x11, 0x24 +}; + // 0x04 (checked) -u8 ProtocolDescriptorList[] = { 0x35, 0x0D, - 0x35, 0x06, - 0x19, 0x01, 0x00, // Element 0 - 0x09, 0x00, 0x11, // Element 1 - 0x35, 0x03, - 0x19, 0x00, 0x11}; // Element 0 +u8 ProtocolDescriptorList[] = { + 0x35, 0x0D, + 0x35, 0x06, + 0x19, 0x01, 0x00, // Element 0 + 0x09, 0x00, 0x11, // Element 1 + 0x35, 0x03, + 0x19, 0x00, 0x11 // Element 0 +}; + // 0x5 (checked) -u8 BrowseGroupList[] = { 0x35, 0x03, - 0x19, 0x10, 0x02 }; +u8 BrowseGroupList[] = { + 0x35, 0x03, + 0x19, 0x10, 0x02 +}; + // 0x6 (checked) -u8 LanguageBaseAttributeIDList[] = { 0x35, 0x09, - 0x09, 0x65, 0x6e, - 0x09, 0x00, 0x6a, - 0x09, 0x01, 0x00 }; +u8 LanguageBaseAttributeIDList[] = { + 0x35, 0x09, + 0x09, 0x65, 0x6e, + 0x09, 0x00, 0x6a, + 0x09, 0x01, 0x00 +}; + // 0x09 (checked) -u8 BluetoothProfileDescriptorList[] = { 0x35, 0x08, - 0x35, 0x06, - 0x19, 0x11, 0x24, - 0x09, 0x01, 0x00 }; +u8 BluetoothProfileDescriptorList[] = { + 0x35, 0x08, + 0x35, 0x06, + 0x19, 0x11, 0x24, + 0x09, 0x01, 0x00 +}; + // 0x0D (checked) -u8 AdditionalProtocolDescriptorLists[] = { 0x35, 0x0F, - 0x35, 0x0D, - 0x35, 0x06, - 0x19, 0x01, 0x00, - 0x09, 0x00, 0x13, - 0x35, 0x03, - 0x19, 0x00, 0x11 }; +u8 AdditionalProtocolDescriptorLists[] = { + 0x35, 0x0F, + 0x35, 0x0D, + 0x35, 0x06, + 0x19, 0x01, 0x00, + 0x09, 0x00, 0x13, + 0x35, 0x03, + 0x19, 0x00, 0x11 +}; + // 0x100 u8 ServiceName[] = { 0x25, 0x13, 'N','i','n','t','e','n','d','o',' ','R','V','L','-','C','N','T','-','0','1' }; // 0x101 @@ -61,47 +80,50 @@ u8 HIDVirtualCable[] = { 0x09, 0x00, 0x00 }; u8 HIDReconnectInitiate[] = { 0x09, 0x00, 0x01 }; // 0x206 -u8 HIDDescriptorList[] = { 0x35, 0xDF, - 0x35, 0xDD, - 0x08, 0x22, // Element 0 - 0x25, 0xD9, // hmm... <- 0x25 is a string but there is Data - - // 0xD9 Bytes - Element 1 - 0x05, 0x01, 0x09, 0x05, 0xa1, 0x01, 0x85, 0x10, - 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, - 0x01, 0x06, 0x00, 0xff, 0x09, 0x01, 0x91, 0x00, - 0x85, 0x11, 0x95, 0x01, 0x09, 0x01, 0x91, 0x00, - 0x85, 0x12, 0x95, 0x02, 0x09, 0x01, 0x91, 0x00, - 0x85, 0x13, 0x95, 0x01, 0x09, 0x01, 0x91, 0x00, - 0x85, 0x14, 0x95, 0x01, 0x09, 0x01, 0x91, 0x00, - 0x85, 0x15, 0x95, 0x01, 0x09, 0x01, 0x91, 0x00, - 0x85, 0x16, 0x95, 0x15, 0x09, 0x01, 0x91, 0x00, - 0x85, 0x17, 0x95, 0x06, 0x09, 0x01, 0x91, 0x00, - 0x85, 0x18, 0x95, 0x15, 0x09, 0x01, 0x91, 0x00, - 0x85, 0x19, 0x95, 0x01, 0x09, 0x01, 0x91, 0x00, - 0x85, 0x1a, 0x95, 0x01, 0x09, 0x01, 0x91, 0x00, - 0x85, 0x20, 0x95, 0x06, 0x09, 0x01, 0x81, 0x00, - 0x85, 0x21, 0x95, 0x15, 0x09, 0x01, 0x81, 0x00, - 0x85, 0x22, 0x95, 0x04, 0x09, 0x01, 0x81, 0x00, - 0x85, 0x30, 0x95, 0x02, 0x09, 0x01, 0x81, 0x00, - 0x85, 0x31, 0x95, 0x05, 0x09, 0x01, 0x81, 0x00, - 0x85, 0x32, 0x95, 0x0a, 0x09, 0x01, 0x81, 0x00, - 0x85, 0x33, 0x95, 0x11, 0x09, 0x01, 0x81, 0x00, - 0x85, 0x34, 0x95, 0x15, 0x09, 0x01, 0x81, 0x00, - 0x85, 0x35, 0x95, 0x15, 0x09, 0x01, 0x81, 0x00, - 0x85, 0x36, 0x95, 0x15, 0x09, 0x01, 0x81, 0x00, - 0x85, 0x37, 0x95, 0x15, 0x09, 0x01, 0x81, 0x00, - 0x85, 0x3d, 0x95, 0x15, 0x09, 0x01, 0x81, 0x00, - 0x85, 0x3e, 0x95, 0x15, 0x09, 0x01, 0x81, 0x00, - 0x85, 0x3f, 0x95, 0x15, 0x09, 0x01, 0x81, 0x00, - 0xc0 }; // end tag +u8 HIDDescriptorList[] = { + 0x35, 0xDF, + 0x35, 0xDD, + 0x08, 0x22, // Element 0 + 0x25, 0xD9, // hmm... <- 0x25 is a string but there is Data + // 0xD9 Bytes - Element 1 + 0x05, 0x01, 0x09, 0x05, 0xa1, 0x01, 0x85, 0x10, + 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, + 0x01, 0x06, 0x00, 0xff, 0x09, 0x01, 0x91, 0x00, + 0x85, 0x11, 0x95, 0x01, 0x09, 0x01, 0x91, 0x00, + 0x85, 0x12, 0x95, 0x02, 0x09, 0x01, 0x91, 0x00, + 0x85, 0x13, 0x95, 0x01, 0x09, 0x01, 0x91, 0x00, + 0x85, 0x14, 0x95, 0x01, 0x09, 0x01, 0x91, 0x00, + 0x85, 0x15, 0x95, 0x01, 0x09, 0x01, 0x91, 0x00, + 0x85, 0x16, 0x95, 0x15, 0x09, 0x01, 0x91, 0x00, + 0x85, 0x17, 0x95, 0x06, 0x09, 0x01, 0x91, 0x00, + 0x85, 0x18, 0x95, 0x15, 0x09, 0x01, 0x91, 0x00, + 0x85, 0x19, 0x95, 0x01, 0x09, 0x01, 0x91, 0x00, + 0x85, 0x1a, 0x95, 0x01, 0x09, 0x01, 0x91, 0x00, + 0x85, 0x20, 0x95, 0x06, 0x09, 0x01, 0x81, 0x00, + 0x85, 0x21, 0x95, 0x15, 0x09, 0x01, 0x81, 0x00, + 0x85, 0x22, 0x95, 0x04, 0x09, 0x01, 0x81, 0x00, + 0x85, 0x30, 0x95, 0x02, 0x09, 0x01, 0x81, 0x00, + 0x85, 0x31, 0x95, 0x05, 0x09, 0x01, 0x81, 0x00, + 0x85, 0x32, 0x95, 0x0a, 0x09, 0x01, 0x81, 0x00, + 0x85, 0x33, 0x95, 0x11, 0x09, 0x01, 0x81, 0x00, + 0x85, 0x34, 0x95, 0x15, 0x09, 0x01, 0x81, 0x00, + 0x85, 0x35, 0x95, 0x15, 0x09, 0x01, 0x81, 0x00, + 0x85, 0x36, 0x95, 0x15, 0x09, 0x01, 0x81, 0x00, + 0x85, 0x37, 0x95, 0x15, 0x09, 0x01, 0x81, 0x00, + 0x85, 0x3d, 0x95, 0x15, 0x09, 0x01, 0x81, 0x00, + 0x85, 0x3e, 0x95, 0x15, 0x09, 0x01, 0x81, 0x00, + 0x85, 0x3f, 0x95, 0x15, 0x09, 0x01, 0x81, 0x00, + 0xc0 // end tag +}; // 0x207 -u8 HIDLANGIDBaseList[] = { 0x35, 0x08, - 0x35, 0x06, - 0x09, 0x04, 0x09, - 0x09, 0x01, 0x00 }; +u8 HIDLANGIDBaseList[] = { + 0x35, 0x08, + 0x35, 0x06, + 0x09, 0x04, 0x09, + 0x09, 0x01, 0x00 +}; // 0x208 u8 HIDSDPDisable[] = { 0x28, 0x00 }; @@ -143,7 +165,6 @@ static u8 packet2[] = { }; static u8 packet3[] = { - 0x00, 0x7b, 0x00, 0x76, 0x85, 0x13, 0x95, 0x01, 0x09, 0x01, 0x91, 0x00, 0x85, 0x14, 0x95, 0x01, 0x09, 0x01, 0x91, 0x00, 0x85, 0x15, 0x95, 0x01, 0x09, 0x01, 0x91, 0x00, 0x85, 0x16, 0x95, 0x15, 0x09, 0x01, 0x91, 0x00, 0x85, 0x17, 0x95, 0x06, 0x09, 0x01, 0x91, 0x00, 0x85, diff --git a/Source/Core/Core/Movie.cpp b/Source/Core/Core/Movie.cpp index b02b74be90..019d2b0a63 100644 --- a/Source/Core/Core/Movie.cpp +++ b/Source/Core/Core/Movie.cpp @@ -605,14 +605,14 @@ void SetWiiInputDisplayString(int remoteID, u8* const coreData, u8* const accelD void CheckPadStatus(SPADStatus *PadStatus, int controllerID) { - g_padState.A = ((PadStatus->button & PAD_BUTTON_A) != 0); - g_padState.B = ((PadStatus->button & PAD_BUTTON_B) != 0); - g_padState.X = ((PadStatus->button & PAD_BUTTON_X) != 0); - g_padState.Y = ((PadStatus->button & PAD_BUTTON_Y) != 0); - g_padState.Z = ((PadStatus->button & PAD_TRIGGER_Z) != 0); + g_padState.A = ((PadStatus->button & PAD_BUTTON_A) != 0); + g_padState.B = ((PadStatus->button & PAD_BUTTON_B) != 0); + g_padState.X = ((PadStatus->button & PAD_BUTTON_X) != 0); + g_padState.Y = ((PadStatus->button & PAD_BUTTON_Y) != 0); + g_padState.Z = ((PadStatus->button & PAD_TRIGGER_Z) != 0); g_padState.Start = ((PadStatus->button & PAD_BUTTON_START) != 0); - g_padState.DPadUp = ((PadStatus->button & PAD_BUTTON_UP) != 0); + g_padState.DPadUp = ((PadStatus->button & PAD_BUTTON_UP) != 0); g_padState.DPadDown = ((PadStatus->button & PAD_BUTTON_DOWN) != 0); g_padState.DPadLeft = ((PadStatus->button & PAD_BUTTON_LEFT) != 0); g_padState.DPadRight = ((PadStatus->button & PAD_BUTTON_RIGHT) != 0); diff --git a/Source/Core/Core/NetPlayClient.cpp b/Source/Core/Core/NetPlayClient.cpp index 02b71e495b..78be8c41dc 100644 --- a/Source/Core/Core/NetPlayClient.cpp +++ b/Source/Core/Core/NetPlayClient.cpp @@ -25,7 +25,7 @@ std::mutex crit_netplay_client; static NetPlayClient * netplay_client = NULL; NetSettings g_NetPlaySettings; -#define RPT_SIZE_HACK (1 << 16) +#define RPT_SIZE_HACK (1 << 16) NetPad::NetPad() { diff --git a/Source/Core/Core/NetPlayClient.h b/Source/Core/Core/NetPlayClient.h index 933072c292..4ea30dd760 100644 --- a/Source/Core/Core/NetPlayClient.h +++ b/Source/Core/Core/NetPlayClient.h @@ -51,10 +51,10 @@ public: class Player { public: - PlayerId pid; - std::string name; - std::string revision; - u32 ping; + PlayerId pid; + std::string name; + std::string revision; + u32 ping; }; class NetPlayClient diff --git a/Source/Core/Core/NetPlayServer.h b/Source/Core/Core/NetPlayServer.h index b08ab98b51..11a8138559 100644 --- a/Source/Core/Core/NetPlayServer.h +++ b/Source/Core/Core/NetPlayServer.h @@ -51,11 +51,11 @@ private: class Client { public: - PlayerId pid; - std::string name; - std::string revision; + PlayerId pid; + std::string name; + std::string revision; - sf::SocketTCP socket; + sf::SocketTCP socket; u32 ping; u32 current_game; }; diff --git a/Source/Core/Core/PowerPC/GDBStub.cpp b/Source/Core/Core/PowerPC/GDBStub.cpp index 763aa24b8a..17eaf3471b 100644 --- a/Source/Core/Core/PowerPC/GDBStub.cpp +++ b/Source/Core/Core/PowerPC/GDBStub.cpp @@ -36,13 +36,13 @@ #include "Host.h" -#define GDB_BFR_MAX 10000 -#define GDB_MAX_BP 10 +#define GDB_BFR_MAX 10000 +#define GDB_MAX_BP 10 -#define GDB_STUB_START '$' -#define GDB_STUB_END '#' -#define GDB_STUB_ACK '+' -#define GDB_STUB_NAK '-' +#define GDB_STUB_START '$' +#define GDB_STUB_END '#' +#define GDB_STUB_ACK '+' +#define GDB_STUB_NAK '-' static int tmpsock = -1; diff --git a/Source/Core/Core/PowerPC/GDBStub.h b/Source/Core/Core/PowerPC/GDBStub.h index 93330ce05d..c96b48f3b7 100644 --- a/Source/Core/Core/PowerPC/GDBStub.h +++ b/Source/Core/Core/PowerPC/GDBStub.h @@ -14,8 +14,8 @@ #include "../HW/Memmap.h" #ifdef _WIN32 -#define SIGTRAP 5 -#define SIGTERM 15 +#define SIGTRAP 5 +#define SIGTERM 15 #define MSG_WAITALL 8 #endif diff --git a/Source/Core/DiscIO/FileSystemGCWii.cpp b/Source/Core/DiscIO/FileSystemGCWii.cpp index cc09138f3e..c8d5c2b198 100644 --- a/Source/Core/DiscIO/FileSystemGCWii.cpp +++ b/Source/Core/DiscIO/FileSystemGCWii.cpp @@ -121,8 +121,8 @@ bool CFileSystemGCWii::ExportFile(const char* _rFullPath, const char* _rExportFi bool CFileSystemGCWii::ExportApploader(const char* _rExportFolder) const { u32 AppSize = Read32(0x2440 + 0x14);// apploader size - AppSize += Read32(0x2440 + 0x18); // + trailer size - AppSize += 0x20; // + header size + AppSize += Read32(0x2440 + 0x18); // + trailer size + AppSize += 0x20; // + header size DEBUG_LOG(DISCIO,"AppSize -> %x", AppSize); std::vector buffer(AppSize); @@ -150,8 +150,8 @@ u32 CFileSystemGCWii::GetBootDOLSize() const // Iterate through the 7 code segments for (u8 i = 0; i < 7; i++) { - offset = Read32(DolOffset + 0x00 + i * 4); - size = Read32(DolOffset + 0x90 + i * 4); + offset = Read32(DolOffset + 0x00 + i * 4); + size = Read32(DolOffset + 0x90 + i * 4); if (offset + size > DolSize) DolSize = offset + size; } @@ -159,8 +159,8 @@ u32 CFileSystemGCWii::GetBootDOLSize() const // Iterate through the 11 data segments for (u8 i = 0; i < 11; i++) { - offset = Read32(DolOffset + 0x1c + i * 4); - size = Read32(DolOffset + 0xac + i * 4); + offset = Read32(DolOffset + 0x1c + i * 4); + size = Read32(DolOffset + 0xac + i * 4); if (offset + size > DolSize) DolSize = offset + size; } diff --git a/Source/Core/DiscIO/VolumeCommon.cpp b/Source/Core/DiscIO/VolumeCommon.cpp index 53eb9948dd..ad5a226ef7 100644 --- a/Source/Core/DiscIO/VolumeCommon.cpp +++ b/Source/Core/DiscIO/VolumeCommon.cpp @@ -79,19 +79,19 @@ u8 GetSysMenuRegion(u16 _TitleVersion) { switch(_TitleVersion) { - case 128: case 192: case 224: case 256: - case 288: case 352: case 384: case 416: - case 448: case 480: case 512: + case 128: case 192: case 224: case 256: + case 288: case 352: case 384: case 416: + case 448: case 480: case 512: return 'J'; - case 97: case 193: case 225: case 257: - case 289: case 353: case 385: case 417: - case 449: case 481: case 513: + case 97: case 193: case 225: case 257: + case 289: case 353: case 385: case 417: + case 449: case 481: case 513: return 'E'; - case 130: case 162: case 194: case 226: - case 258: case 290: case 354: case 386: - case 418: case 450: case 482: case 514: + case 130: case 162: case 194: case 226: + case 258: case 290: case 354: case 386: + case 418: case 450: case 482: case 514: return 'P'; - case 326: case 390: case 454: case 486: + case 326: case 390: case 454: case 486: case 518: return 'K'; default: diff --git a/Source/Core/DiscIO/VolumeDirectory.cpp b/Source/Core/DiscIO/VolumeDirectory.cpp index a501a9c0fa..6a20db54a5 100644 --- a/Source/Core/DiscIO/VolumeDirectory.cpp +++ b/Source/Core/DiscIO/VolumeDirectory.cpp @@ -356,9 +356,9 @@ void CVolumeDirectory::BuildFST() m_dataStartAddress = ROUND_UP(FST_ADDRESS + m_fstSize, 0x8000ull); u64 curDataAddress = m_dataStartAddress; - u32 fstOffset = 0; // offset within FST data - u32 nameOffset = 0; // offset within name table - u32 rootOffset = 0; // offset of root of FST + u32 fstOffset = 0; // Offset within FST data + u32 nameOffset = 0; // Offset within name table + u32 rootOffset = 0; // Offset of root of FST // write root entry WriteEntryData(fstOffset, DIRECTORY_ENTRY, 0, 0, totalEntries); diff --git a/Source/Core/DiscIO/VolumeWad.h b/Source/Core/DiscIO/VolumeWad.h index cd5835c986..892b2c0fbf 100644 --- a/Source/Core/DiscIO/VolumeWad.h +++ b/Source/Core/DiscIO/VolumeWad.h @@ -25,8 +25,8 @@ public: std::string GetUniqueID() const; std::string GetMakerID() const; std::vector GetNames() const; - u32 GetFSTSize() const { return 0; } - std::string GetApploaderDate() const { return "0"; } + u32 GetFSTSize() const { return 0; } + std::string GetApploaderDate() const { return "0"; } ECountry GetCountry() const; u64 GetSize() const; u64 GetRawSize() const; diff --git a/Source/Core/DiscIO/VolumeWiiCrypted.cpp b/Source/Core/DiscIO/VolumeWiiCrypted.cpp index 8d2e46a0f6..c6666ca029 100644 --- a/Source/Core/DiscIO/VolumeWiiCrypted.cpp +++ b/Source/Core/DiscIO/VolumeWiiCrypted.cpp @@ -82,7 +82,7 @@ bool CVolumeWiiCrypted::Read(u64 _ReadOffset, u64 _Length, u8* _pBuffer) const // increase buffers _Length -= CopySize; - _pBuffer += CopySize; + _pBuffer += CopySize; _ReadOffset += CopySize; } diff --git a/Source/Core/DiscIO/WbfsBlob.cpp b/Source/Core/DiscIO/WbfsBlob.cpp index 7a4d8d99d6..50b3c78918 100644 --- a/Source/Core/DiscIO/WbfsBlob.cpp +++ b/Source/Core/DiscIO/WbfsBlob.cpp @@ -187,10 +187,10 @@ bool IsWbfsBlob(const char* filename) u8 magic[4] = {0, 0, 0, 0}; f.ReadBytes(&magic, 4); - return (magic[0] == 'W') && - (magic[1] == 'B') && - (magic[2] == 'F') && - (magic[3] == 'S'); + return (magic[0] == 'W') && + (magic[1] == 'B') && + (magic[2] == 'F') && + (magic[3] == 'S'); } } // namespace diff --git a/Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.h b/Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.h index b18113bc38..170e4ae9f2 100644 --- a/Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.h +++ b/Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.h @@ -23,10 +23,11 @@ private: Key(IOHIDElementRef element, IOHIDDeviceRef device); ControlState GetState() const; private: - const IOHIDElementRef m_element; - const IOHIDDeviceRef m_device; - std::string m_name; + const IOHIDElementRef m_element; + const IOHIDDeviceRef m_device; + std::string m_name; }; + class Cursor : public Input { public: @@ -36,9 +37,10 @@ private: ControlState GetState() const; private: const float& m_axis; - const u8 m_index; - const bool m_positive; + const u8 m_index; + const bool m_positive; }; + class Button : public Input { public: @@ -66,11 +68,11 @@ private: float x, y; } m_cursor; - const IOHIDDeviceRef m_device; - const std::string m_device_name; - int m_index; - uint32_t m_windowid; - unsigned char m_mousebuttons[3]; + const IOHIDDeviceRef m_device; + const std::string m_device_name; + int m_index; + uint32_t m_windowid; + unsigned char m_mousebuttons[3]; }; } diff --git a/Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.mm b/Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.mm index 9fb832c340..101971dab6 100644 --- a/Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.mm +++ b/Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.mm @@ -117,8 +117,8 @@ Keyboard::Key::Key(IOHIDElementRef element, IOHIDDeviceRef device) , m_device(device) { static const struct PrettyKeys { - const uint32_t code; - const char *const name; + const uint32_t code; + const char *const name; } named_keys[] = { { kHIDUsage_KeyboardA, "A" }, { kHIDUsage_KeyboardB, "B" }, diff --git a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp index c4cdae71bc..23d247d704 100644 --- a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp +++ b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp @@ -319,29 +319,29 @@ bool Joystick::UpdateOutput() #ifdef USE_SDL_HAPTIC for (auto &i : m_state_out) { - if (i.changed) // if SetState was called on this output + if (i.changed) // if SetState was called on this output { - if (-1 == i.id) // effect isn't currently uploaded + if (-1 == i.id) // effect isn't currently uploaded { - if (i.effect.type) // if outputstate is >0 this would be true + if (i.effect.type) // if outputstate is >0 this would be true { - if ((i.id = SDL_HapticNewEffect(m_haptic, &i.effect)) > -1) // upload the effect + if ((i.id = SDL_HapticNewEffect(m_haptic, &i.effect)) > -1) // upload the effect { - SDL_HapticRunEffect(m_haptic, i.id, 1); // run the effect + SDL_HapticRunEffect(m_haptic, i.id, 1); // run the effect } } } - else // effect is already uploaded + else // effect is already uploaded { - if (i.effect.type) // if ouputstate >0 + if (i.effect.type) // if ouputstate >0 { SDL_HapticUpdateEffect(m_haptic, i.id, &i.effect); // update the effect } else { - SDL_HapticStopEffect(m_haptic, i.id); // else, stop and remove the effect + SDL_HapticStopEffect(m_haptic, i.id); // else, stop and remove the effect SDL_HapticDestroyEffect(m_haptic, i.id); - i.id = -1; // mark it as not uploaded + i.id = -1; // mark it as not uploaded } } diff --git a/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.cpp b/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.cpp index 23cadd3ee6..4da005fa65 100644 --- a/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.cpp +++ b/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.cpp @@ -30,7 +30,7 @@ // Mouse axis control output is simply divided by this number. In practice, // that just means you can use a smaller "dead zone" if you bind axis controls // to a joystick. No real need to make this customizable. -#define MOUSE_AXIS_SENSITIVITY 8.0f +#define MOUSE_AXIS_SENSITIVITY 8.0f // The mouse axis controls use a weighted running average. Each frame, the new // value is the average of the old value and the amount of relative mouse @@ -38,7 +38,7 @@ // MOUSE_AXIS_SMOOTHING:1 compared to the new value. Increasing // MOUSE_AXIS_SMOOTHING makes the controls smoother, decreasing it makes them // more responsive. This might be useful as a user-customizable option. -#define MOUSE_AXIS_SMOOTHING 1.5f +#define MOUSE_AXIS_SMOOTHING 1.5f namespace ciface { @@ -48,9 +48,7 @@ namespace XInput2 // This function will add zero or more KeyboardMouse objects to devices. void Init(std::vector& devices, void* const hwnd) { - Display* dpy; - - dpy = XOpenDisplay(NULL); + Display* dpy = XOpenDisplay(NULL); // xi_opcode is important; it will be used to identify XInput events by // the polling loop in UpdateInput. @@ -68,9 +66,9 @@ void Init(std::vector& devices, void* const hwnd) // register all master devices with Dolphin - XIDeviceInfo* all_masters; - XIDeviceInfo* current_master; - int num_masters; + XIDeviceInfo* all_masters; + XIDeviceInfo* current_master; + int num_masters; all_masters = XIQueryDevice(dpy, XIAllMasterDevices, &num_masters); @@ -94,7 +92,6 @@ void Init(std::vector& devices, void* const hwnd) void KeyboardMouse::SelectEventsForDevice(Window window, XIEventMask *mask, int deviceid) { // Set the event mask for the master device. - mask->deviceid = deviceid; XISelectEvents(m_display, window, mask, 1); @@ -104,9 +101,9 @@ void KeyboardMouse::SelectEventsForDevice(Window window, XIEventMask *mask, int // devices) emit those. For keyboard devices, selecting slaves avoids // dealing with key focus. - XIDeviceInfo* all_slaves; - XIDeviceInfo* current_slave; - int num_slaves; + XIDeviceInfo* all_slaves; + XIDeviceInfo* current_slave; + int num_slaves; all_slaves = XIQueryDevice(m_display, XIAllDevices, &num_slaves); @@ -142,8 +139,8 @@ KeyboardMouse::KeyboardMouse(Window window, int opcode, int pointer, int keyboar name = std::string(pointer_device->name); XIFreeDeviceInfo(pointer_device); - XIEventMask mask; - unsigned char mask_buf[(XI_LASTEVENT + 7)/8]; + XIEventMask mask; + unsigned char mask_buf[(XI_LASTEVENT + 7)/8]; mask.mask_len = sizeof(mask_buf); mask.mask = mask_buf; diff --git a/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h b/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h index b5bb8442a6..4357ee9b5a 100644 --- a/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h +++ b/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h @@ -44,10 +44,10 @@ private: ControlState GetState() const; private: - std::string m_keyname; - Display* const m_display; + std::string m_keyname; + Display* const m_display; const char* const m_keyboard; - const KeyCode m_keycode; + const KeyCode m_keycode; }; class Button : public Input @@ -73,9 +73,9 @@ private: private: const float& m_cursor; - const u8 m_index; - const bool m_positive; - std::string name; + const u8 m_index; + const bool m_positive; + std::string name; }; class Axis : public Input @@ -88,9 +88,9 @@ private: private: const float& m_axis; - const u8 m_index; - const bool m_positive; - std::string name; + const u8 m_index; + const bool m_positive; + std::string name; }; private: @@ -109,12 +109,12 @@ public: int GetId() const; private: - Window m_window; - Display* m_display; - State m_state; - int xi_opcode; - const int pointer_deviceid, keyboard_deviceid; - std::string name; + Window m_window; + Display* m_display; + State m_state; + int xi_opcode; + const int pointer_deviceid, keyboard_deviceid; + std::string name; }; } diff --git a/Source/Core/InputCommon/ControllerInterface/Xlib/Xlib.h b/Source/Core/InputCommon/ControllerInterface/Xlib/Xlib.h index 6ccdf73a6a..ed2e3098b4 100644 --- a/Source/Core/InputCommon/ControllerInterface/Xlib/Xlib.h +++ b/Source/Core/InputCommon/ControllerInterface/Xlib/Xlib.h @@ -35,10 +35,10 @@ private: ControlState GetState() const; private: - std::string m_keyname; - Display* const m_display; + std::string m_keyname; + Display* const m_display; const char* const m_keyboard; - const KeyCode m_keycode; + const KeyCode m_keycode; }; class Button : public Input @@ -65,8 +65,8 @@ private: private: const float& m_cursor; - const u8 m_index; - const bool m_positive; + const u8 m_index; + const bool m_positive; }; public: @@ -81,9 +81,9 @@ public: int GetId() const; private: - Window m_window; + Window m_window; Display* m_display; - State m_state; + State m_state; }; } diff --git a/Source/Core/VideoBackends/D3D/D3DUtil.cpp b/Source/Core/VideoBackends/D3D/D3DUtil.cpp index df965dc58b..26a9b38af9 100644 --- a/Source/Core/VideoBackends/D3D/D3DUtil.cpp +++ b/Source/Core/VideoBackends/D3D/D3DUtil.cpp @@ -210,7 +210,7 @@ int CD3DFont::Init() // Create a new texture for the font // possible optimization: store the converted data in a buffer and fill the texture on creation. - // That way, we can use a static texture + // That way, we can use a static texture ID3D11Texture2D* buftex; D3D11_TEXTURE2D_DESC texdesc = CD3D11_TEXTURE2D_DESC(DXGI_FORMAT_R8G8B8A8_UNORM, m_dwTexWidth, m_dwTexHeight, 1, 1, D3D11_BIND_SHADER_RESOURCE, D3D11_USAGE_DYNAMIC, diff --git a/Source/Core/VideoBackends/D3D/Render.cpp b/Source/Core/VideoBackends/D3D/Render.cpp index b48995c410..d052995d99 100644 --- a/Source/Core/VideoBackends/D3D/Render.cpp +++ b/Source/Core/VideoBackends/D3D/Render.cpp @@ -81,16 +81,16 @@ void SetupDeviceObjects() D3D::SetDebugObjectName((ID3D11DeviceChild*)access_efb_cbuf, "constant buffer for Renderer::AccessEFB"); D3D11_DEPTH_STENCIL_DESC ddesc; - ddesc.DepthEnable = FALSE; + ddesc.DepthEnable = FALSE; ddesc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ZERO; - ddesc.DepthFunc = D3D11_COMPARISON_ALWAYS; - ddesc.StencilEnable = FALSE; + ddesc.DepthFunc = D3D11_COMPARISON_ALWAYS; + ddesc.StencilEnable = FALSE; ddesc.StencilReadMask = D3D11_DEFAULT_STENCIL_READ_MASK; ddesc.StencilWriteMask = D3D11_DEFAULT_STENCIL_WRITE_MASK; hr = D3D::device->CreateDepthStencilState(&ddesc, &cleardepthstates[0]); CHECK(hr==S_OK, "Create depth state for Renderer::ClearScreen"); ddesc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL; - ddesc.DepthEnable = TRUE; + ddesc.DepthEnable = TRUE; hr = D3D::device->CreateDepthStencilState(&ddesc, &cleardepthstates[1]); CHECK(hr==S_OK, "Create depth state for Renderer::ClearScreen"); ddesc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ZERO; @@ -130,12 +130,12 @@ void SetupDeviceObjects() hr = D3D::device->CreateBlendState(&blenddesc, &clearblendstates[3]); CHECK(hr==S_OK, "Create blend state for Renderer::ClearScreen"); - ddesc.DepthEnable = FALSE; - ddesc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ZERO; - ddesc.DepthFunc = D3D11_COMPARISON_LESS; - ddesc.StencilEnable = FALSE; - ddesc.StencilReadMask = D3D11_DEFAULT_STENCIL_READ_MASK; - ddesc.StencilWriteMask = D3D11_DEFAULT_STENCIL_WRITE_MASK; + ddesc.DepthEnable = FALSE; + ddesc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ZERO; + ddesc.DepthFunc = D3D11_COMPARISON_LESS; + ddesc.StencilEnable = FALSE; + ddesc.StencilReadMask = D3D11_DEFAULT_STENCIL_READ_MASK; + ddesc.StencilWriteMask = D3D11_DEFAULT_STENCIL_WRITE_MASK; hr = D3D::device->CreateDepthStencilState(&ddesc, &resetdepthstate); CHECK(hr==S_OK, "Create depth state for Renderer::ResetAPIState"); D3D::SetDebugObjectName((ID3D11DeviceChild*)resetdepthstate, "depth stencil state for Renderer::ResetAPIState"); @@ -216,12 +216,12 @@ Renderer::Renderer() gx_state.blenddc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD; memset(&gx_state.depthdc, 0, sizeof(gx_state.depthdc)); - gx_state.depthdc.DepthEnable = TRUE; - gx_state.depthdc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL; - gx_state.depthdc.DepthFunc = D3D11_COMPARISON_LESS; - gx_state.depthdc.StencilEnable = FALSE; - gx_state.depthdc.StencilReadMask = D3D11_DEFAULT_STENCIL_READ_MASK; - gx_state.depthdc.StencilWriteMask = D3D11_DEFAULT_STENCIL_WRITE_MASK; + gx_state.depthdc.DepthEnable = TRUE; + gx_state.depthdc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL; + gx_state.depthdc.DepthFunc = D3D11_COMPARISON_LESS; + gx_state.depthdc.StencilEnable = FALSE; + gx_state.depthdc.StencilReadMask = D3D11_DEFAULT_STENCIL_READ_MASK; + gx_state.depthdc.StencilWriteMask = D3D11_DEFAULT_STENCIL_WRITE_MASK; // TODO: Do we need to enable multisampling here? gx_state.rastdc = CD3D11_RASTERIZER_DESC(D3D11_FILL_SOLID, D3D11_CULL_NONE, false, 0, 0.f, 0, false, true, false, false); @@ -327,15 +327,15 @@ void Renderer::SetColorMask() // and EFB pokes (which will change the color or depth of a pixel). // // The behavior of EFB peeks can only be modified by: -// - GX_PokeAlphaRead +// - GX_PokeAlphaRead // The behavior of EFB pokes can be modified by: -// - GX_PokeAlphaMode (TODO) -// - GX_PokeAlphaUpdate (TODO) -// - GX_PokeBlendMode (TODO) -// - GX_PokeColorUpdate (TODO) -// - GX_PokeDither (TODO) -// - GX_PokeDstAlpha (TODO) -// - GX_PokeZMode (TODO) +// - GX_PokeAlphaMode (TODO) +// - GX_PokeAlphaUpdate (TODO) +// - GX_PokeBlendMode (TODO) +// - GX_PokeColorUpdate (TODO) +// - GX_PokeDither (TODO) +// - GX_PokeDstAlpha (TODO) +// - GX_PokeZMode (TODO) u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) { // TODO: This function currently is broken if anti-aliasing is enabled @@ -1198,22 +1198,22 @@ void Renderer::SetLogicOpMode() // D3D11 doesn't support logic blending, so this is a huge hack // TODO: Make use of D3D11.1's logic blending support - // 0 0x00 - // 1 Source & destination - // 2 Source & ~destination - // 3 Source - // 4 ~Source & destination - // 5 Destination - // 6 Source ^ destination = Source & ~destination | ~Source & destination - // 7 Source | destination - // 8 ~(Source | destination) - // 9 ~(Source ^ destination) = ~Source & ~destination | Source & destination - // 10 ~Destination - // 11 Source | ~destination - // 12 ~Source - // 13 ~Source | destination - // 14 ~(Source & destination) - // 15 0xff + // 0 0x00 + // 1 Source & destination + // 2 Source & ~destination + // 3 Source + // 4 ~Source & destination + // 5 Destination + // 6 Source ^ destination = Source & ~destination | ~Source & destination + // 7 Source | destination + // 8 ~(Source | destination) + // 9 ~(Source ^ destination) = ~Source & ~destination | Source & destination + // 10 ~Destination + // 11 Source | ~destination + // 12 ~Source + // 13 ~Source | destination + // 14 ~(Source & destination) + // 15 0xff const D3D11_BLEND_OP d3dLogicOps[16] = { D3D11_BLEND_OP_ADD,//0 @@ -1321,7 +1321,8 @@ void Renderer::SetSamplerState(int stage, int texindex) unsigned int mip = d3dMipFilters[tm0.min_filter & 3]; - if (texindex) stage += 4; + if (texindex) + stage += 4; if (g_ActiveConfig.bForceFiltering) { diff --git a/Source/Core/VideoBackends/Software/SWVertexLoader.cpp b/Source/Core/VideoBackends/Software/SWVertexLoader.cpp index f08e2f3825..a8cbdae326 100644 --- a/Source/Core/VideoBackends/Software/SWVertexLoader.cpp +++ b/Source/Core/VideoBackends/Software/SWVertexLoader.cpp @@ -182,12 +182,12 @@ void SWVertexLoader::SetFormat(u8 attributeIndex, u8 primitiveType) case DIRECT: switch (colComp[i]) { - case FORMAT_16B_565: m_VertexSize += 2; m_colorLoader[i] = (Color_ReadDirect_16b_565); break; - case FORMAT_24B_888: m_VertexSize += 3; m_colorLoader[i] = (Color_ReadDirect_24b_888); break; - case FORMAT_32B_888x: m_VertexSize += 4; m_colorLoader[i] = (Color_ReadDirect_32b_888x); break; - case FORMAT_16B_4444: m_VertexSize += 2; m_colorLoader[i] = (Color_ReadDirect_16b_4444); break; - case FORMAT_24B_6666: m_VertexSize += 3; m_colorLoader[i] = (Color_ReadDirect_24b_6666); break; - case FORMAT_32B_8888: m_VertexSize += 4; m_colorLoader[i] = (Color_ReadDirect_32b_8888); break; + case FORMAT_16B_565: m_VertexSize += 2; m_colorLoader[i] = (Color_ReadDirect_16b_565); break; + case FORMAT_24B_888: m_VertexSize += 3; m_colorLoader[i] = (Color_ReadDirect_24b_888); break; + case FORMAT_32B_888x: m_VertexSize += 4; m_colorLoader[i] = (Color_ReadDirect_32b_888x); break; + case FORMAT_16B_4444: m_VertexSize += 2; m_colorLoader[i] = (Color_ReadDirect_16b_4444); break; + case FORMAT_24B_6666: m_VertexSize += 3; m_colorLoader[i] = (Color_ReadDirect_24b_6666); break; + case FORMAT_32B_8888: m_VertexSize += 4; m_colorLoader[i] = (Color_ReadDirect_32b_8888); break; default: _assert_(0); break; } AddAttributeLoader(LoadColor, i); @@ -196,12 +196,12 @@ void SWVertexLoader::SetFormat(u8 attributeIndex, u8 primitiveType) m_VertexSize += 1; switch (colComp[i]) { - case FORMAT_16B_565: m_colorLoader[i] = (Color_ReadIndex8_16b_565); break; - case FORMAT_24B_888: m_colorLoader[i] = (Color_ReadIndex8_24b_888); break; - case FORMAT_32B_888x: m_colorLoader[i] = (Color_ReadIndex8_32b_888x); break; - case FORMAT_16B_4444: m_colorLoader[i] = (Color_ReadIndex8_16b_4444); break; - case FORMAT_24B_6666: m_colorLoader[i] = (Color_ReadIndex8_24b_6666); break; - case FORMAT_32B_8888: m_colorLoader[i] = (Color_ReadIndex8_32b_8888); break; + case FORMAT_16B_565: m_colorLoader[i] = (Color_ReadIndex8_16b_565); break; + case FORMAT_24B_888: m_colorLoader[i] = (Color_ReadIndex8_24b_888); break; + case FORMAT_32B_888x: m_colorLoader[i] = (Color_ReadIndex8_32b_888x); break; + case FORMAT_16B_4444: m_colorLoader[i] = (Color_ReadIndex8_16b_4444); break; + case FORMAT_24B_6666: m_colorLoader[i] = (Color_ReadIndex8_24b_6666); break; + case FORMAT_32B_8888: m_colorLoader[i] = (Color_ReadIndex8_32b_8888); break; default: _assert_(0); break; } AddAttributeLoader(LoadColor, i); @@ -210,12 +210,12 @@ void SWVertexLoader::SetFormat(u8 attributeIndex, u8 primitiveType) m_VertexSize += 2; switch (colComp[i]) { - case FORMAT_16B_565: m_colorLoader[i] = (Color_ReadIndex16_16b_565); break; - case FORMAT_24B_888: m_colorLoader[i] = (Color_ReadIndex16_24b_888); break; - case FORMAT_32B_888x: m_colorLoader[i] = (Color_ReadIndex16_32b_888x); break; - case FORMAT_16B_4444: m_colorLoader[i] = (Color_ReadIndex16_16b_4444); break; - case FORMAT_24B_6666: m_colorLoader[i] = (Color_ReadIndex16_24b_6666); break; - case FORMAT_32B_8888: m_colorLoader[i] = (Color_ReadIndex16_32b_8888); break; + case FORMAT_16B_565: m_colorLoader[i] = (Color_ReadIndex16_16b_565); break; + case FORMAT_24B_888: m_colorLoader[i] = (Color_ReadIndex16_24b_888); break; + case FORMAT_32B_888x: m_colorLoader[i] = (Color_ReadIndex16_32b_888x); break; + case FORMAT_16B_4444: m_colorLoader[i] = (Color_ReadIndex16_16b_4444); break; + case FORMAT_24B_6666: m_colorLoader[i] = (Color_ReadIndex16_24b_6666); break; + case FORMAT_32B_8888: m_colorLoader[i] = (Color_ReadIndex16_32b_8888); break; default: _assert_(0); break; } AddAttributeLoader(LoadColor, i); diff --git a/Source/Core/VideoBackends/Software/Tev.cpp b/Source/Core/VideoBackends/Software/Tev.cpp index 69c16aeb34..254d4cbcff 100644 --- a/Source/Core/VideoBackends/Software/Tev.cpp +++ b/Source/Core/VideoBackends/Software/Tev.cpp @@ -119,7 +119,7 @@ inline s16 Clamp255(s16 in) inline s16 Clamp1024(s16 in) { - return in>1023?1023:(in<-1024?-1024:in); + return in>1023?1023:(in<-1024?-1024:in); } void Tev::SetRasColor(int colorChan, int swaptable) @@ -595,10 +595,12 @@ void Tev::Draw() #if ALLOW_TEV_DUMPS if (g_SWVideoConfig.bDumpTevStages) { - u8 stage[4] = { IndirectTex[stageNum][TextureSampler::ALP_SMP], - IndirectTex[stageNum][TextureSampler::BLU_SMP], - IndirectTex[stageNum][TextureSampler::GRN_SMP], - 255}; + u8 stage[4] = { + IndirectTex[stageNum][TextureSampler::ALP_SMP], + IndirectTex[stageNum][TextureSampler::BLU_SMP], + IndirectTex[stageNum][TextureSampler::GRN_SMP], + 255 + }; DebugUtil::DrawTempBuffer(stage, INDIRECT + stageNum); } #endif diff --git a/Source/Core/VideoCommon/CommandProcessor.cpp b/Source/Core/VideoCommon/CommandProcessor.cpp index ca70a43703..e3f6937b0e 100644 --- a/Source/Core/VideoCommon/CommandProcessor.cpp +++ b/Source/Core/VideoCommon/CommandProcessor.cpp @@ -337,9 +337,9 @@ void STACKALIGN GatherPipeBursted() "FIFO is overflowed by GatherPipe !\nCPU thread is too fast!"); // check if we are in sync - _assert_msg_(COMMANDPROCESSOR, fifo.CPWritePointer == ProcessorInterface::Fifo_CPUWritePointer, "FIFOs linked but out of sync"); - _assert_msg_(COMMANDPROCESSOR, fifo.CPBase == ProcessorInterface::Fifo_CPUBase, "FIFOs linked but out of sync"); - _assert_msg_(COMMANDPROCESSOR, fifo.CPEnd == ProcessorInterface::Fifo_CPUEnd, "FIFOs linked but out of sync"); + _assert_msg_(COMMANDPROCESSOR, fifo.CPWritePointer == ProcessorInterface::Fifo_CPUWritePointer, "FIFOs linked but out of sync"); + _assert_msg_(COMMANDPROCESSOR, fifo.CPBase == ProcessorInterface::Fifo_CPUBase, "FIFOs linked but out of sync"); + _assert_msg_(COMMANDPROCESSOR, fifo.CPEnd == ProcessorInterface::Fifo_CPUEnd, "FIFOs linked but out of sync"); } void UpdateInterrupts(u64 userdata) @@ -486,11 +486,11 @@ void SetCpStatusRegister() INFO_LOG(COMMANDPROCESSOR,"\t Read from STATUS_REGISTER : %04x", m_CPStatusReg.Hex); DEBUG_LOG(COMMANDPROCESSOR, "(r) status: iBP %s | fReadIdle %s | fCmdIdle %s | iOvF %s | iUndF %s" - , m_CPStatusReg.Breakpoint ? "ON" : "OFF" - , m_CPStatusReg.ReadIdle ? "ON" : "OFF" - , m_CPStatusReg.CommandIdle ? "ON" : "OFF" - , m_CPStatusReg.OverflowHiWatermark ? "ON" : "OFF" - , m_CPStatusReg.UnderflowLoWatermark ? "ON" : "OFF" + , m_CPStatusReg.Breakpoint ? "ON" : "OFF" + , m_CPStatusReg.ReadIdle ? "ON" : "OFF" + , m_CPStatusReg.CommandIdle ? "ON" : "OFF" + , m_CPStatusReg.OverflowHiWatermark ? "ON" : "OFF" + , m_CPStatusReg.UnderflowLoWatermark ? "ON" : "OFF" ); } @@ -527,12 +527,12 @@ void SetCpControlRegister() } DEBUG_LOG(COMMANDPROCESSOR, "\t GPREAD %s | BP %s | Int %s | OvF %s | UndF %s | LINK %s" - , fifo.bFF_GPReadEnable ? "ON" : "OFF" - , fifo.bFF_BPEnable ? "ON" : "OFF" - , fifo.bFF_BPInt ? "ON" : "OFF" - , m_CPCtrlReg.FifoOverflowIntEnable ? "ON" : "OFF" - , m_CPCtrlReg.FifoUnderflowIntEnable ? "ON" : "OFF" - , m_CPCtrlReg.GPLinkEnable ? "ON" : "OFF" + , fifo.bFF_GPReadEnable ? "ON" : "OFF" + , fifo.bFF_BPEnable ? "ON" : "OFF" + , fifo.bFF_BPInt ? "ON" : "OFF" + , m_CPCtrlReg.FifoOverflowIntEnable ? "ON" : "OFF" + , m_CPCtrlReg.FifoUnderflowIntEnable ? "ON" : "OFF" + , m_CPCtrlReg.GPLinkEnable ? "ON" : "OFF" ); } diff --git a/Source/Core/VideoCommon/DriverDetails.cpp b/Source/Core/VideoCommon/DriverDetails.cpp index e25cd4e9bd..7ecad228ba 100644 --- a/Source/Core/VideoCommon/DriverDetails.cpp +++ b/Source/Core/VideoCommon/DriverDetails.cpp @@ -74,21 +74,21 @@ namespace DriverDetails case VENDOR_NVIDIA: case VENDOR_TEGRA: m_driver = DRIVER_NVIDIA; - break; + break; case VENDOR_ATI: m_driver = DRIVER_ATI; - break; + break; case VENDOR_INTEL: m_driver = DRIVER_INTEL; - break; + break; case VENDOR_IMGTEC: m_driver = DRIVER_IMGTEC; - break; + break; case VENDOR_VIVANTE: m_driver = DRIVER_VIVANTE; - break; + break; default: - break; + break; } for(auto& bug : m_known_bugs) diff --git a/Source/Core/VideoCommon/PixelEngine.h b/Source/Core/VideoCommon/PixelEngine.h index 6631f4ea5c..9bbf42eec8 100644 --- a/Source/Core/VideoCommon/PixelEngine.h +++ b/Source/Core/VideoCommon/PixelEngine.h @@ -48,8 +48,8 @@ union UPEAlphaReadReg u16 Hex; struct { - u16 ReadMode : 2; - u16 : 14; + u16 ReadMode : 2; + u16 : 14; }; }; diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp index eb9d79ed3d..fe6db69520 100644 --- a/Source/Core/VideoCommon/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/PixelShaderGen.cpp @@ -1046,14 +1046,14 @@ void SampleTexture(T& out, const char *texcoords, const char *texswap, int texma static const char *tevAlphaFuncsTable[] = { - "(false)", // NEVER - "(prev.a <= %s - (0.25/255.0))", // LESS - "(abs( prev.a - %s ) < (0.5/255.0))", // EQUAL - "(prev.a < %s + (0.25/255.0))", // LEQUAL - "(prev.a >= %s + (0.25/255.0))", // GREATER - "(abs( prev.a - %s ) >= (0.5/255.0))", // NEQUAL - "(prev.a > %s - (0.25/255.0))", // GEQUAL - "(true)" // ALWAYS + "(false)", // NEVER + "(prev.a <= %s - (0.25/255.0))", // LESS + "(abs( prev.a - %s ) < (0.5/255.0))", // EQUAL + "(prev.a < %s + (0.25/255.0))", // LEQUAL + "(prev.a >= %s + (0.25/255.0))", // GREATER + "(abs( prev.a - %s ) >= (0.5/255.0))", // NEQUAL + "(prev.a > %s - (0.25/255.0))", // GEQUAL + "(true)" // ALWAYS }; static const char *tevAlphaFunclogicTable[] = @@ -1124,14 +1124,14 @@ static inline void WriteAlphaTest(T& out, pixel_shader_uid_data& uid_data, API_T static const char *tevFogFuncsTable[] = { - "", // No Fog - "", // ? - "", // Linear - "", // ? - "\tfog = 1.0 - exp2(-8.0 * fog);\n", // exp - "\tfog = 1.0 - exp2(-8.0 * fog * fog);\n", // exp2 - "\tfog = exp2(-8.0 * (1.0 - fog));\n", // backward exp - "\tfog = 1.0 - fog;\n fog = exp2(-8.0 * fog * fog);\n" // backward exp2 + "", // No Fog + "", // ? + "", // Linear + "", // ? + "\tfog = 1.0 - exp2(-8.0 * fog);\n", // exp + "\tfog = 1.0 - exp2(-8.0 * fog * fog);\n", // exp2 + "\tfog = exp2(-8.0 * (1.0 - fog));\n", // backward exp + "\tfog = 1.0 - fog;\n fog = exp2(-8.0 * fog * fog);\n" // backward exp2 }; template @@ -1153,7 +1153,7 @@ static inline void WriteFog(T& out, pixel_shader_uid_data& uid_data) else { // orthographic - // ze = a*Zs (here, no B_SHF) + // ze = a*Zs (here, no B_SHF) out.Write("\tfloat ze = " I_FOG"[1].x * zCoord;\n"); } diff --git a/Source/Core/VideoCommon/TextureDecoder_x64.cpp b/Source/Core/VideoCommon/TextureDecoder_x64.cpp index 3913513206..0911c6a289 100644 --- a/Source/Core/VideoCommon/TextureDecoder_x64.cpp +++ b/Source/Core/VideoCommon/TextureDecoder_x64.cpp @@ -2447,25 +2447,25 @@ PC_TexFormat TexDecoder_DecodeRGBA8FromTmem(u8* dst, const u8 *src_ar, const u8 const char* texfmt[] = { // pixel - "I4", "I8", "IA4", "IA8", - "RGB565", "RGB5A3", "RGBA8", "0x07", - "C4", "C8", "C14X2", "0x0B", - "0x0C", "0x0D", "CMPR", "0x0F", + "I4", "I8", "IA4", "IA8", + "RGB565", "RGB5A3", "RGBA8", "0x07", + "C4", "C8", "C14X2", "0x0B", + "0x0C", "0x0D", "CMPR", "0x0F", // Z-buffer - "0x10", "Z8", "0x12", "Z16", - "0x14", "0x15", "Z24X8", "0x17", - "0x18", "0x19", "0x1A", "0x1B", - "0x1C", "0x1D", "0x1E", "0x1F", + "0x10", "Z8", "0x12", "Z16", + "0x14", "0x15", "Z24X8", "0x17", + "0x18", "0x19", "0x1A", "0x1B", + "0x1C", "0x1D", "0x1E", "0x1F", // pixel + copy - "CR4", "0x21", "CRA4", "CRA8", - "0x24", "0x25", "CYUVA8", "CA8", - "CR8", "CG8", "CB8", "CRG8", - "CGB8", "0x2D", "0x2E", "0x2F", + "CR4", "0x21", "CRA4", "CRA8", + "0x24", "0x25", "CYUVA8", "CA8", + "CR8", "CG8", "CB8", "CRG8", + "CGB8", "0x2D", "0x2E", "0x2F", // Z + copy - "CZ4", "0x31", "0x32", "0x33", - "0x34", "0x35", "0x36", "0x37", - "0x38", "CZ8M", "CZ8L", "0x3B", - "CZ16L", "0x3D", "0x3E", "0x3F", + "CZ4", "0x31", "0x32", "0x33", + "0x34", "0x35", "0x36", "0x37", + "0x38", "CZ8M", "CZ8L", "0x3B", + "CZ16L", "0x3D", "0x3E", "0x3F", }; const unsigned char sfont_map[] = { diff --git a/Source/Core/VideoCommon/VertexLoader.cpp b/Source/Core/VideoCommon/VertexLoader.cpp index d3806aeaa7..31ab1f7eaa 100644 --- a/Source/Core/VideoCommon/VertexLoader.cpp +++ b/Source/Core/VideoCommon/VertexLoader.cpp @@ -844,15 +844,15 @@ void VertexLoader::SetupRunVertices(int vtx_attr_group, int primitive, int const g_nativeVertexFmt = m_NativeFmt; // Load position and texcoord scale factors. - m_VtxAttr.PosFrac = g_VtxAttr[vtx_attr_group].g0.PosFrac; - m_VtxAttr.texCoord[0].Frac = g_VtxAttr[vtx_attr_group].g0.Tex0Frac; - m_VtxAttr.texCoord[1].Frac = g_VtxAttr[vtx_attr_group].g1.Tex1Frac; - m_VtxAttr.texCoord[2].Frac = g_VtxAttr[vtx_attr_group].g1.Tex2Frac; - m_VtxAttr.texCoord[3].Frac = g_VtxAttr[vtx_attr_group].g1.Tex3Frac; - m_VtxAttr.texCoord[4].Frac = g_VtxAttr[vtx_attr_group].g2.Tex4Frac; - m_VtxAttr.texCoord[5].Frac = g_VtxAttr[vtx_attr_group].g2.Tex5Frac; - m_VtxAttr.texCoord[6].Frac = g_VtxAttr[vtx_attr_group].g2.Tex6Frac; - m_VtxAttr.texCoord[7].Frac = g_VtxAttr[vtx_attr_group].g2.Tex7Frac; + m_VtxAttr.PosFrac = g_VtxAttr[vtx_attr_group].g0.PosFrac; + m_VtxAttr.texCoord[0].Frac = g_VtxAttr[vtx_attr_group].g0.Tex0Frac; + m_VtxAttr.texCoord[1].Frac = g_VtxAttr[vtx_attr_group].g1.Tex1Frac; + m_VtxAttr.texCoord[2].Frac = g_VtxAttr[vtx_attr_group].g1.Tex2Frac; + m_VtxAttr.texCoord[3].Frac = g_VtxAttr[vtx_attr_group].g1.Tex3Frac; + m_VtxAttr.texCoord[4].Frac = g_VtxAttr[vtx_attr_group].g2.Tex4Frac; + m_VtxAttr.texCoord[5].Frac = g_VtxAttr[vtx_attr_group].g2.Tex5Frac; + m_VtxAttr.texCoord[6].Frac = g_VtxAttr[vtx_attr_group].g2.Tex6Frac; + m_VtxAttr.texCoord[7].Frac = g_VtxAttr[vtx_attr_group].g2.Tex7Frac; pVtxAttr = &m_VtxAttr; posScale = fractionTable[m_VtxAttr.PosFrac]; @@ -913,43 +913,43 @@ void VertexLoader::SetVAT(u32 _group0, u32 _group1, u32 _group2) vat.g1.Hex = _group1; vat.g2.Hex = _group2; - m_VtxAttr.PosElements = vat.g0.PosElements; - m_VtxAttr.PosFormat = vat.g0.PosFormat; - m_VtxAttr.PosFrac = vat.g0.PosFrac; - m_VtxAttr.NormalElements = vat.g0.NormalElements; - m_VtxAttr.NormalFormat = vat.g0.NormalFormat; - m_VtxAttr.color[0].Elements = vat.g0.Color0Elements; - m_VtxAttr.color[0].Comp = vat.g0.Color0Comp; - m_VtxAttr.color[1].Elements = vat.g0.Color1Elements; - m_VtxAttr.color[1].Comp = vat.g0.Color1Comp; - m_VtxAttr.texCoord[0].Elements = vat.g0.Tex0CoordElements; - m_VtxAttr.texCoord[0].Format = vat.g0.Tex0CoordFormat; - m_VtxAttr.texCoord[0].Frac = vat.g0.Tex0Frac; - m_VtxAttr.ByteDequant = vat.g0.ByteDequant; - m_VtxAttr.NormalIndex3 = vat.g0.NormalIndex3; + m_VtxAttr.PosElements = vat.g0.PosElements; + m_VtxAttr.PosFormat = vat.g0.PosFormat; + m_VtxAttr.PosFrac = vat.g0.PosFrac; + m_VtxAttr.NormalElements = vat.g0.NormalElements; + m_VtxAttr.NormalFormat = vat.g0.NormalFormat; + m_VtxAttr.color[0].Elements = vat.g0.Color0Elements; + m_VtxAttr.color[0].Comp = vat.g0.Color0Comp; + m_VtxAttr.color[1].Elements = vat.g0.Color1Elements; + m_VtxAttr.color[1].Comp = vat.g0.Color1Comp; + m_VtxAttr.texCoord[0].Elements = vat.g0.Tex0CoordElements; + m_VtxAttr.texCoord[0].Format = vat.g0.Tex0CoordFormat; + m_VtxAttr.texCoord[0].Frac = vat.g0.Tex0Frac; + m_VtxAttr.ByteDequant = vat.g0.ByteDequant; + m_VtxAttr.NormalIndex3 = vat.g0.NormalIndex3; - m_VtxAttr.texCoord[1].Elements = vat.g1.Tex1CoordElements; - m_VtxAttr.texCoord[1].Format = vat.g1.Tex1CoordFormat; - m_VtxAttr.texCoord[1].Frac = vat.g1.Tex1Frac; - m_VtxAttr.texCoord[2].Elements = vat.g1.Tex2CoordElements; - m_VtxAttr.texCoord[2].Format = vat.g1.Tex2CoordFormat; - m_VtxAttr.texCoord[2].Frac = vat.g1.Tex2Frac; - m_VtxAttr.texCoord[3].Elements = vat.g1.Tex3CoordElements; - m_VtxAttr.texCoord[3].Format = vat.g1.Tex3CoordFormat; - m_VtxAttr.texCoord[3].Frac = vat.g1.Tex3Frac; - m_VtxAttr.texCoord[4].Elements = vat.g1.Tex4CoordElements; - m_VtxAttr.texCoord[4].Format = vat.g1.Tex4CoordFormat; + m_VtxAttr.texCoord[1].Elements = vat.g1.Tex1CoordElements; + m_VtxAttr.texCoord[1].Format = vat.g1.Tex1CoordFormat; + m_VtxAttr.texCoord[1].Frac = vat.g1.Tex1Frac; + m_VtxAttr.texCoord[2].Elements = vat.g1.Tex2CoordElements; + m_VtxAttr.texCoord[2].Format = vat.g1.Tex2CoordFormat; + m_VtxAttr.texCoord[2].Frac = vat.g1.Tex2Frac; + m_VtxAttr.texCoord[3].Elements = vat.g1.Tex3CoordElements; + m_VtxAttr.texCoord[3].Format = vat.g1.Tex3CoordFormat; + m_VtxAttr.texCoord[3].Frac = vat.g1.Tex3Frac; + m_VtxAttr.texCoord[4].Elements = vat.g1.Tex4CoordElements; + m_VtxAttr.texCoord[4].Format = vat.g1.Tex4CoordFormat; - m_VtxAttr.texCoord[4].Frac = vat.g2.Tex4Frac; - m_VtxAttr.texCoord[5].Elements = vat.g2.Tex5CoordElements; - m_VtxAttr.texCoord[5].Format = vat.g2.Tex5CoordFormat; - m_VtxAttr.texCoord[5].Frac = vat.g2.Tex5Frac; - m_VtxAttr.texCoord[6].Elements = vat.g2.Tex6CoordElements; - m_VtxAttr.texCoord[6].Format = vat.g2.Tex6CoordFormat; - m_VtxAttr.texCoord[6].Frac = vat.g2.Tex6Frac; - m_VtxAttr.texCoord[7].Elements = vat.g2.Tex7CoordElements; - m_VtxAttr.texCoord[7].Format = vat.g2.Tex7CoordFormat; - m_VtxAttr.texCoord[7].Frac = vat.g2.Tex7Frac; + m_VtxAttr.texCoord[4].Frac = vat.g2.Tex4Frac; + m_VtxAttr.texCoord[5].Elements = vat.g2.Tex5CoordElements; + m_VtxAttr.texCoord[5].Format = vat.g2.Tex5CoordFormat; + m_VtxAttr.texCoord[5].Frac = vat.g2.Tex5Frac; + m_VtxAttr.texCoord[6].Elements = vat.g2.Tex6CoordElements; + m_VtxAttr.texCoord[6].Format = vat.g2.Tex6CoordFormat; + m_VtxAttr.texCoord[6].Frac = vat.g2.Tex6Frac; + m_VtxAttr.texCoord[7].Elements = vat.g2.Tex7CoordElements; + m_VtxAttr.texCoord[7].Format = vat.g2.Tex7CoordFormat; + m_VtxAttr.texCoord[7].Frac = vat.g2.Tex7Frac; if(!m_VtxAttr.ByteDequant) { ERROR_LOG(VIDEO, "ByteDequant is set to zero"); diff --git a/Source/Core/VideoCommon/VertexLoader_Color.cpp b/Source/Core/VideoCommon/VertexLoader_Color.cpp index e32af6226c..38492fed41 100644 --- a/Source/Core/VideoCommon/VertexLoader_Color.cpp +++ b/Source/Core/VideoCommon/VertexLoader_Color.cpp @@ -29,11 +29,11 @@ __forceinline void _SetCol(u32 val) //BARG -> AABBGGRR __forceinline void _SetCol4444(u16 val) { - u32 col = (val & 0xF0); // col = 000000R0; - col |= (val & 0xF ) << 12; // col |= 0000G000; - col |= (((u32)val) & 0xF000) << 8; // col |= 00B00000; - col |= (((u32)val) & 0x0F00) << 20; // col |= A0000000; - col |= col >> 4; // col = A0B0G0R0 | 0A0B0G0R; + u32 col = (val & 0xF0); // col = 000000R0; + col |= (val & 0xF ) << 12; // col |= 0000G000; + col |= (((u32)val) & 0xF000) << 8; // col |= 00B00000; + col |= (((u32)val) & 0x0F00) << 20; // col |= A0000000; + col |= col >> 4; // col = A0B0G0R0 | 0A0B0G0R; _SetCol(col); } diff --git a/Source/Core/VideoCommon/VertexLoader_Normal.h b/Source/Core/VideoCommon/VertexLoader_Normal.h index f74d0e9e7d..34f8736237 100644 --- a/Source/Core/VideoCommon/VertexLoader_Normal.h +++ b/Source/Core/VideoCommon/VertexLoader_Normal.h @@ -25,34 +25,34 @@ public: private: enum ENormalType { - NRM_NOT_PRESENT = 0, - NRM_DIRECT = 1, - NRM_INDEX8 = 2, - NRM_INDEX16 = 3, + NRM_NOT_PRESENT = 0, + NRM_DIRECT = 1, + NRM_INDEX8 = 2, + NRM_INDEX16 = 3, NUM_NRM_TYPE }; enum ENormalFormat { - FORMAT_UBYTE = 0, - FORMAT_BYTE = 1, - FORMAT_USHORT = 2, - FORMAT_SHORT = 3, - FORMAT_FLOAT = 4, + FORMAT_UBYTE = 0, + FORMAT_BYTE = 1, + FORMAT_USHORT = 2, + FORMAT_SHORT = 3, + FORMAT_FLOAT = 4, NUM_NRM_FORMAT }; enum ENormalElements { - NRM_NBT = 0, - NRM_NBT3 = 1, + NRM_NBT = 0, + NRM_NBT3 = 1, NUM_NRM_ELEMENTS }; enum ENormalIndices { - NRM_INDICES1 = 0, - NRM_INDICES3 = 1, + NRM_INDICES1 = 0, + NRM_INDICES3 = 1, NUM_NRM_INDICES }; diff --git a/Source/Core/VideoCommon/VertexShaderManager.cpp b/Source/Core/VideoCommon/VertexShaderManager.cpp index 4632d098c4..f4d5b13dbc 100644 --- a/Source/Core/VideoCommon/VertexShaderManager.cpp +++ b/Source/Core/VideoCommon/VertexShaderManager.cpp @@ -146,22 +146,22 @@ static void ViewportCorrectionMatrix(Matrix44& result) float intendedWd = 2.0f * xfregs.viewport.wd; float intendedHt = -2.0f * xfregs.viewport.ht; - if (intendedWd < 0.f) - { - intendedX += intendedWd; - intendedWd = -intendedWd; - } - if (intendedHt < 0.f) - { - intendedY += intendedHt; - intendedHt = -intendedHt; - } + if (intendedWd < 0.f) + { + intendedX += intendedWd; + intendedWd = -intendedWd; + } + if (intendedHt < 0.f) + { + intendedY += intendedHt; + intendedHt = -intendedHt; + } // fit to EFB size - float X = (intendedX >= 0.f) ? intendedX : 0.f; - float Y = (intendedY >= 0.f) ? intendedY : 0.f; - float Wd = (X + intendedWd <= EFB_WIDTH) ? intendedWd : (EFB_WIDTH - X); - float Ht = (Y + intendedHt <= EFB_HEIGHT) ? intendedHt : (EFB_HEIGHT - Y); + float X = (intendedX >= 0.f) ? intendedX : 0.f; + float Y = (intendedY >= 0.f) ? intendedY : 0.f; + float Wd = (X + intendedWd <= EFB_WIDTH) ? intendedWd : (EFB_WIDTH - X); + float Ht = (Y + intendedHt <= EFB_HEIGHT) ? intendedHt : (EFB_HEIGHT - Y); Matrix44::LoadIdentity(result); if (Wd == 0 || Ht == 0) diff --git a/Source/Core/VideoCommon/VideoConfig.h b/Source/Core/VideoCommon/VideoConfig.h index d9e0f7eaac..6afb84f697 100644 --- a/Source/Core/VideoCommon/VideoConfig.h +++ b/Source/Core/VideoCommon/VideoConfig.h @@ -18,10 +18,10 @@ #include // Log in two categories, and save three other options in the same byte -#define CONF_LOG 1 -#define CONF_PRIMLOG 2 -#define CONF_SAVETARGETS 8 -#define CONF_SAVESHADERS 16 +#define CONF_LOG 1 +#define CONF_PRIMLOG 2 +#define CONF_SAVETARGETS 8 +#define CONF_SAVESHADERS 16 enum AspectMode {