From 72b4675c8f8a0e72c18bb049bafe1aaefb2b8a00 Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Thu, 2 Feb 2023 15:17:33 -0800 Subject: [PATCH] =?UTF-8?q?VideoInterface:=20Fix=20warning:=20declaration?= =?UTF-8?q?=20of=20=E2=80=98state=E2=80=99=20shadows=20a=20previous=20loca?= =?UTF-8?q?l?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/Core/Core/HW/VideoInterface.cpp | 96 +++++++++++++------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/Source/Core/Core/HW/VideoInterface.cpp b/Source/Core/Core/HW/VideoInterface.cpp index 8aa9c2b542..fabd142083 100644 --- a/Source/Core/Core/HW/VideoInterface.cpp +++ b/Source/Core/Core/HW/VideoInterface.cpp @@ -277,38 +277,38 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base) // XFB related MMIOs that require special handling on writes. mmio->Register(base | VI_FB_LEFT_TOP_HI, MMIO::DirectRead(&state.xfb_info_top.Hi), MMIO::ComplexWrite([](Core::System& system, u32, u16 val) { - auto& state = system.GetVideoInterfaceState().GetData(); - state.xfb_info_top.Hi = val; - if (state.xfb_info_top.CLRPOFF) - state.xfb_info_top.POFF = 0; + auto& state_ = system.GetVideoInterfaceState().GetData(); + state_.xfb_info_top.Hi = val; + if (state_.xfb_info_top.CLRPOFF) + state_.xfb_info_top.POFF = 0; })); mmio->Register(base | VI_FB_LEFT_BOTTOM_HI, MMIO::DirectRead(&state.xfb_info_bottom.Hi), MMIO::ComplexWrite([](Core::System& system, u32, u16 val) { - auto& state = system.GetVideoInterfaceState().GetData(); - state.xfb_info_bottom.Hi = val; - if (state.xfb_info_bottom.CLRPOFF) - state.xfb_info_bottom.POFF = 0; + auto& state_ = system.GetVideoInterfaceState().GetData(); + state_.xfb_info_bottom.Hi = val; + if (state_.xfb_info_bottom.CLRPOFF) + state_.xfb_info_bottom.POFF = 0; })); mmio->Register(base | VI_FB_RIGHT_TOP_HI, MMIO::DirectRead(&state.xfb_3d_info_top.Hi), MMIO::ComplexWrite([](Core::System& system, u32, u16 val) { - auto& state = system.GetVideoInterfaceState().GetData(); - state.xfb_3d_info_top.Hi = val; - if (state.xfb_3d_info_top.CLRPOFF) - state.xfb_3d_info_top.POFF = 0; + auto& state_ = system.GetVideoInterfaceState().GetData(); + state_.xfb_3d_info_top.Hi = val; + if (state_.xfb_3d_info_top.CLRPOFF) + state_.xfb_3d_info_top.POFF = 0; })); mmio->Register(base | VI_FB_RIGHT_BOTTOM_HI, MMIO::DirectRead(&state.xfb_3d_info_bottom.Hi), MMIO::ComplexWrite([](Core::System& system, u32, u16 val) { - auto& state = system.GetVideoInterfaceState().GetData(); - state.xfb_3d_info_bottom.Hi = val; - if (state.xfb_3d_info_bottom.CLRPOFF) - state.xfb_3d_info_bottom.POFF = 0; + auto& state_ = system.GetVideoInterfaceState().GetData(); + state_.xfb_3d_info_bottom.Hi = val; + if (state_.xfb_3d_info_bottom.CLRPOFF) + state_.xfb_3d_info_bottom.POFF = 0; })); // MMIOs with unimplemented writes that trigger warnings. mmio->Register( base | VI_VERTICAL_BEAM_POSITION, MMIO::ComplexRead([](Core::System& system, u32) { - auto& state = system.GetVideoInterfaceState().GetData(); - return 1 + (state.half_line_count) / 2; + auto& state_ = system.GetVideoInterfaceState().GetData(); + return 1 + (state_.half_line_count) / 2; }), MMIO::ComplexWrite([](Core::System& system, u32, u16 val) { WARN_LOG_FMT( @@ -317,12 +317,12 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base) })); mmio->Register( base | VI_HORIZONTAL_BEAM_POSITION, MMIO::ComplexRead([](Core::System& system, u32) { - auto& state = system.GetVideoInterfaceState().GetData(); + auto& state_ = system.GetVideoInterfaceState().GetData(); u16 value = static_cast( - 1 + state.h_timing_0.HLW * - (system.GetCoreTiming().GetTicks() - state.ticks_last_line_start) / + 1 + state_.h_timing_0.HLW * + (system.GetCoreTiming().GetTicks() - state_.ticks_last_line_start) / (GetTicksPerHalfLine())); - return std::clamp(value, 1, state.h_timing_0.HLW * 2); + return std::clamp(value, 1, state_.h_timing_0.HLW * 2); }), MMIO::ComplexWrite([](Core::System& system, u32, u16 val) { WARN_LOG_FMT( @@ -335,50 +335,50 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base) // on writes. mmio->Register(base | VI_PRERETRACE_HI, MMIO::DirectRead(&state.interrupt_register[0].Hi), MMIO::ComplexWrite([](Core::System& system, u32, u16 val) { - auto& state = system.GetVideoInterfaceState().GetData(); - state.interrupt_register[0].Hi = val; + auto& state_ = system.GetVideoInterfaceState().GetData(); + state_.interrupt_register[0].Hi = val; UpdateInterrupts(); })); mmio->Register(base | VI_POSTRETRACE_HI, MMIO::DirectRead(&state.interrupt_register[1].Hi), MMIO::ComplexWrite([](Core::System& system, u32, u16 val) { - auto& state = system.GetVideoInterfaceState().GetData(); - state.interrupt_register[1].Hi = val; + auto& state_ = system.GetVideoInterfaceState().GetData(); + state_.interrupt_register[1].Hi = val; UpdateInterrupts(); })); mmio->Register(base | VI_DISPLAY_INTERRUPT_2_HI, MMIO::DirectRead(&state.interrupt_register[2].Hi), MMIO::ComplexWrite([](Core::System& system, u32, u16 val) { - auto& state = system.GetVideoInterfaceState().GetData(); - state.interrupt_register[2].Hi = val; + auto& state_ = system.GetVideoInterfaceState().GetData(); + state_.interrupt_register[2].Hi = val; UpdateInterrupts(); })); mmio->Register(base | VI_DISPLAY_INTERRUPT_3_HI, MMIO::DirectRead(&state.interrupt_register[3].Hi), MMIO::ComplexWrite([](Core::System& system, u32, u16 val) { - auto& state = system.GetVideoInterfaceState().GetData(); - state.interrupt_register[3].Hi = val; + auto& state_ = system.GetVideoInterfaceState().GetData(); + state_.interrupt_register[3].Hi = val; UpdateInterrupts(); })); // Unknown anti-aliasing related MMIO register: puts a warning on log and // needs to shift/mask when reading/writing. mmio->Register(base | VI_UNK_AA_REG_HI, MMIO::ComplexRead([](Core::System& system, u32) { - auto& state = system.GetVideoInterfaceState().GetData(); - return state.unknown_aa_register >> 16; + auto& state_ = system.GetVideoInterfaceState().GetData(); + return state_.unknown_aa_register >> 16; }), MMIO::ComplexWrite([](Core::System& system, u32, u16 val) { - auto& state = system.GetVideoInterfaceState().GetData(); - state.unknown_aa_register = - (state.unknown_aa_register & 0x0000FFFF) | ((u32)val << 16); + auto& state_ = system.GetVideoInterfaceState().GetData(); + state_.unknown_aa_register = + (state_.unknown_aa_register & 0x0000FFFF) | ((u32)val << 16); WARN_LOG_FMT(VIDEOINTERFACE, "Writing to the unknown AA register (hi)"); })); mmio->Register(base | VI_UNK_AA_REG_LO, MMIO::ComplexRead([](Core::System& system, u32) { - auto& state = system.GetVideoInterfaceState().GetData(); - return state.unknown_aa_register & 0xFFFF; + auto& state_ = system.GetVideoInterfaceState().GetData(); + return state_.unknown_aa_register & 0xFFFF; }), MMIO::ComplexWrite([](Core::System& system, u32, u16 val) { - auto& state = system.GetVideoInterfaceState().GetData(); - state.unknown_aa_register = (state.unknown_aa_register & 0xFFFF0000) | val; + auto& state_ = system.GetVideoInterfaceState().GetData(); + state_.unknown_aa_register = (state_.unknown_aa_register & 0xFFFF0000) | val; WARN_LOG_FMT(VIDEOINTERFACE, "Writing to the unknown AA register (lo)"); })); @@ -387,21 +387,21 @@ void RegisterMMIO(MMIO::Mapping* mmio, u32 base) mmio->Register(base | VI_CONTROL_REGISTER, MMIO::DirectRead(&state.display_control_register.Hex), MMIO::ComplexWrite([](Core::System& system, u32, u16 val) { - auto& state = system.GetVideoInterfaceState().GetData(); + auto& state_ = system.GetVideoInterfaceState().GetData(); UVIDisplayControlRegister tmpConfig(val); - state.display_control_register.ENB = tmpConfig.ENB; - state.display_control_register.NIN = tmpConfig.NIN; - state.display_control_register.DLR = tmpConfig.DLR; - state.display_control_register.LE0 = tmpConfig.LE0; - state.display_control_register.LE1 = tmpConfig.LE1; - state.display_control_register.FMT = tmpConfig.FMT; + state_.display_control_register.ENB = tmpConfig.ENB; + state_.display_control_register.NIN = tmpConfig.NIN; + state_.display_control_register.DLR = tmpConfig.DLR; + state_.display_control_register.LE0 = tmpConfig.LE0; + state_.display_control_register.LE1 = tmpConfig.LE1; + state_.display_control_register.FMT = tmpConfig.FMT; if (tmpConfig.RST) { // shuffle2 clear all data, reset to default vals, and enter idle mode - state.display_control_register.RST = 0; - state.interrupt_register = {}; + state_.display_control_register.RST = 0; + state_.interrupt_register = {}; UpdateInterrupts(); }