Misc: clang-cl warning clean-up

This commit is contained in:
Stenzek
2023-09-03 14:30:26 +10:00
parent 7f446526d1
commit 80e3d29ab8
52 changed files with 470 additions and 394 deletions

View File

@ -839,12 +839,12 @@ static const char* s_invert_settings[] = {TRANSLATE_NOOP("AnalogController", "No
static const SettingInfo s_settings[] = {
{SettingInfo::Type::Boolean, "ForceAnalogOnReset", TRANSLATE_NOOP("AnalogController", "Force Analog Mode on Reset"),
TRANSLATE_NOOP("AnalogController", "Forces the controller to analog mode when the console is reset/powered on."),
"true"},
"true", nullptr, nullptr, nullptr, nullptr, nullptr, 0.0f},
{SettingInfo::Type::Boolean, "AnalogDPadInDigitalMode",
TRANSLATE_NOOP("AnalogController", "Use Analog Sticks for D-Pad in Digital Mode"),
TRANSLATE_NOOP("AnalogController",
"Allows you to use the analog sticks to control the d-pad in digital mode, as well as the buttons."),
"true"},
"true", nullptr, nullptr, nullptr, nullptr, nullptr, 0.0f},
{SettingInfo::Type::Float, "AnalogDeadzone", TRANSLATE_NOOP("AnalogController", "Analog Deadzone"),
TRANSLATE_NOOP("AnalogController",
"Sets the analog stick deadzone, i.e. the fraction of the stick movement which will be ignored."),

View File

@ -2099,6 +2099,9 @@ void CDROM::ExecuteCommandSecondResponse(void*, TickCount ticks, TickCount ticks
case Command::Stop:
DoStatSecondResponse();
break;
default:
break;
}
s_command_second_response = Command::None;
@ -2731,7 +2734,6 @@ void CDROM::DoSectorRead()
}
else
{
const CDImage::Position pos(CDImage::Position::FromLBA(s_current_lba));
Log_DevPrintf("Sector %u [%s] has invalid subchannel Q", s_current_lba,
LBAToMSFString(s_current_lba).GetCharArray());
}

View File

@ -561,7 +561,8 @@ void LogCurrentState()
CodeBlockKey GetNextBlockKey()
{
CodeBlockKey key = {};
CodeBlockKey key;
key.bits = 0;
key.SetPC(g_state.pc);
key.user_mode = InUserMode();
return key;

View File

@ -31,6 +31,10 @@ union CodeBlockKey
ALWAYS_INLINE u32 GetPCPhysicalAddress() const { return (aligned_pc << 2) & PHYSICAL_MEMORY_ADDRESS_MASK; }
ALWAYS_INLINE CodeBlockKey() = default;
ALWAYS_INLINE CodeBlockKey(const CodeBlockKey& rhs) : bits(rhs.bits) {}
ALWAYS_INLINE CodeBlockKey& operator=(const CodeBlockKey& rhs)
{
bits = rhs.bits;

View File

@ -1353,7 +1353,7 @@ restart_instruction:
WriteRegDelayed(inst.i.rt, sxvalue);
if constexpr (pgxp_mode >= PGXPMode::Memory)
PGXP::CPU_LHx(inst.bits, addr, sxvalue);
PGXP::CPU_LH(inst.bits, addr, sxvalue);
}
break;
@ -1406,7 +1406,7 @@ restart_instruction:
WriteRegDelayed(inst.i.rt, zxvalue);
if constexpr (pgxp_mode >= PGXPMode::Memory)
PGXP::CPU_LHx(inst.bits, addr, zxvalue);
PGXP::CPU_LHU(inst.bits, addr, zxvalue);
}
break;

View File

@ -1476,7 +1476,10 @@ bool CodeGenerator::Compile_Load(const CodeBlockInstruction& cbi)
ConvertValueSizeInPlace(&result, RegSize_32, (cbi.instruction.op == InstructionOp::lh));
if (g_settings.gpu_pgxp_enable)
EmitFunctionCall(nullptr, PGXP::CPU_LHx, Value::FromConstantU32(cbi.instruction.bits), address, result);
{
EmitFunctionCall(nullptr, (cbi.instruction.op == InstructionOp::lhu) ? &PGXP::CPU_LHU : PGXP::CPU_LH,
Value::FromConstantU32(cbi.instruction.bits), address, result);
}
if (address_spec)
{

View File

@ -303,6 +303,8 @@ void CodeGenerator::EmitSignExtend(HostReg to_reg, RegSize to_size, HostReg from
case RegSize_8:
m_emit->movsx(GetHostReg16(to_reg), GetHostReg8(from_reg));
return;
default:
break;
}
}
break;
@ -317,14 +319,17 @@ void CodeGenerator::EmitSignExtend(HostReg to_reg, RegSize to_size, HostReg from
case RegSize_16:
m_emit->movsx(GetHostReg32(to_reg), GetHostReg16(from_reg));
return;
default:
break;
}
}
break;
default:
Panic("Unknown sign-extend combination");
break;
}
Panic("Unknown sign-extend combination");
}
void CodeGenerator::EmitZeroExtend(HostReg to_reg, RegSize to_size, HostReg from_reg, RegSize from_size)
@ -338,6 +343,8 @@ void CodeGenerator::EmitZeroExtend(HostReg to_reg, RegSize to_size, HostReg from
case RegSize_8:
m_emit->movzx(GetHostReg16(to_reg), GetHostReg8(from_reg));
return;
default:
break;
}
}
break;
@ -352,9 +359,14 @@ void CodeGenerator::EmitZeroExtend(HostReg to_reg, RegSize to_size, HostReg from
case RegSize_16:
m_emit->movzx(GetHostReg32(to_reg), GetHostReg16(from_reg));
return;
default:
break;
}
}
break;
default:
break;
}
Panic("Unknown sign-extend combination");
@ -410,6 +422,10 @@ void CodeGenerator::EmitCopyValue(HostReg to_reg, const Value& value)
m_emit->mov(GetHostReg64(to_reg), GetHostReg64(value.host_reg));
}
break;
default:
UnreachableCode();
break;
}
}
@ -479,6 +495,10 @@ void CodeGenerator::EmitAdd(HostReg to_reg, HostReg from_reg, const Value& value
}
}
break;
default:
UnreachableCode();
break;
}
}
@ -548,6 +568,10 @@ void CodeGenerator::EmitSub(HostReg to_reg, HostReg from_reg, const Value& value
}
}
break;
default:
UnreachableCode();
break;
}
}
@ -605,6 +629,10 @@ void CodeGenerator::EmitCmp(HostReg to_reg, const Value& value)
}
}
break;
default:
UnreachableCode();
break;
}
}
@ -1838,6 +1866,10 @@ void CodeGenerator::EmitLoadGuestRAMFastmem(const Value& address, RegSize size,
}
}
break;
default:
UnreachableCode();
break;
}
}
else
@ -1862,6 +1894,10 @@ void CodeGenerator::EmitLoadGuestRAMFastmem(const Value& address, RegSize size,
case RegSize_32:
m_emit->mov(GetHostReg32(result.host_reg), m_emit->dword[GetHostReg64(RARG1) + GetHostReg64(RARG2)]);
break;
default:
UnreachableCode();
break;
}
}
}
@ -1936,6 +1972,10 @@ void CodeGenerator::EmitLoadGuestMemoryFastmem(const CodeBlockInstruction& cbi,
}
}
break;
default:
UnreachableCode();
break;
}
}
else
@ -1963,6 +2003,10 @@ void CodeGenerator::EmitLoadGuestMemoryFastmem(const CodeBlockInstruction& cbi,
case RegSize_32:
m_emit->mov(GetHostReg32(result.host_reg), m_emit->dword[GetHostReg64(RARG1) + GetHostReg64(RARG2)]);
break;
default:
UnreachableCode();
break;
}
}
@ -2191,6 +2235,10 @@ void CodeGenerator::EmitStoreGuestMemoryFastmem(const CodeBlockInstruction& cbi,
}
}
break;
default:
UnreachableCode();
break;
}
}
else
@ -2234,6 +2282,10 @@ void CodeGenerator::EmitStoreGuestMemoryFastmem(const CodeBlockInstruction& cbi,
m_emit->mov(m_emit->dword[GetHostReg64(RARG1) + GetHostReg64(RARG2)], GetHostReg32(value.host_reg));
}
break;
default:
UnreachableCode();
break;
}
}

View File

@ -7,7 +7,9 @@
#include "system.h"
#include "util/state_wrapper.h"
DigitalController::DigitalController(u32 index) : Controller(index) {}
DigitalController::DigitalController(u32 index) : Controller(index)
{
}
DigitalController::~DigitalController() = default;
@ -164,7 +166,7 @@ static const Controller::ControllerBindingInfo s_binding_info[] = {
BUTTON("R1", TRANSLATE_NOOP("DigitalController", "R1"), DigitalController::Button::R1, GenericInputBinding::R1),
BUTTON("L2", TRANSLATE_NOOP("DigitalController", "L2"), DigitalController::Button::L2, GenericInputBinding::L2),
BUTTON("R2", TRANSLATE_NOOP("DigitalController", "R2"), DigitalController::Button::R2, GenericInputBinding::R2),
// clang-format on
// clang-format on
#undef BUTTON
};
@ -172,7 +174,8 @@ static const Controller::ControllerBindingInfo s_binding_info[] = {
static const SettingInfo s_settings[] = {
{SettingInfo::Type::Boolean, "ForcePopnControllerMode",
TRANSLATE_NOOP("DigitalController", "Force Pop'n Controller Mode"),
TRANSLATE_NOOP("DigitalController", "Forces the Digital Controller to act as a Pop'n Controller."), "false"}};
TRANSLATE_NOOP("DigitalController", "Forces the Digital Controller to act as a Pop'n Controller."), "false", nullptr,
nullptr, nullptr, nullptr, nullptr, 0.0f}};
const Controller::ControllerInfo DigitalController::INFO = {ControllerType::DigitalController,
"DigitalController",

View File

@ -38,7 +38,7 @@ enum class SyncMode : u32
};
static constexpr PhysicalMemoryAddress BASE_ADDRESS_MASK = UINT32_C(0x00FFFFFF);
static constexpr PhysicalMemoryAddress ADDRESS_MASK = UINT32_C(0x001FFFFC);
// static constexpr PhysicalMemoryAddress ADDRESS_MASK = UINT32_C(0x001FFFFC);
static u32 GetAddressMask();
static void ClearState();

View File

@ -4330,6 +4330,9 @@ void FullscreenUI::DrawPostProcessingSettingsPage()
ImGui::PopFont();
}
break;
default:
break;
}
}
@ -4590,9 +4593,10 @@ void FullscreenUI::DrawAchievementsLoginWindow()
if (ImGui::BeginPopupModal("Achievements Login", &is_open, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize))
{
ImGui::TextWrapped(FSUI_CSTR("Please enter your user name and password for retroachievements.org."));
ImGui::TextWrapped("%s", FSUI_CSTR("Please enter your user name and password for retroachievements.org."));
ImGui::NewLine();
ImGui::TextWrapped(
"%s",
FSUI_CSTR("Your password will not be saved in DuckStation, an access token will be generated and used instead."));
ImGui::NewLine();
@ -4600,11 +4604,11 @@ void FullscreenUI::DrawAchievementsLoginWindow()
static char username[256] = {};
static char password[256] = {};
ImGui::Text(FSUI_CSTR("User Name: "));
ImGui::TextUnformatted(FSUI_CSTR("User Name: "));
ImGui::SameLine(LayoutScale(200.0f));
ImGui::InputText("##username", username, sizeof(username));
ImGui::Text(FSUI_CSTR("Password: "));
ImGui::TextUnformatted(FSUI_CSTR("Password: "));
ImGui::SameLine(LayoutScale(200.0f));
ImGui::InputText("##password", password, sizeof(password), ImGuiInputTextFlags_Password);
@ -5260,7 +5264,6 @@ void FullscreenUI::DrawSaveStateSelector(bool is_loading)
0.5f;
u32 grid_x = 0;
u32 grid_y = 0;
ImGui::SetCursorPos(ImVec2(start_x, 0.0f));
for (u32 i = 0; i < s_save_state_selector_slots.size(); i++)
{
@ -5455,7 +5458,6 @@ void FullscreenUI::DrawSaveStateSelector(bool is_loading)
if (grid_x == grid_count_x)
{
grid_x = 0;
grid_y++;
ImGui::SetCursorPosX(start_x);
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + item_spacing);
}
@ -5996,7 +5998,6 @@ void FullscreenUI::DrawGameGrid(const ImVec2& heading_size)
SmallString draw_title;
u32 grid_x = 0;
u32 grid_y = 0;
ImGui::SetCursorPos(ImVec2(start_x, 0.0f));
for (const GameList::Entry* entry : s_game_list_sorted_entries)
{
@ -6060,7 +6061,6 @@ void FullscreenUI::DrawGameGrid(const ImVec2& heading_size)
if (grid_x == grid_count_x)
{
grid_x = 0;
grid_y++;
ImGui::SetCursorPosX(start_x);
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + item_spacing);
}
@ -6452,18 +6452,19 @@ void FullscreenUI::DrawAboutWindow()
if (ImGui::BeginPopupModal(FSUI_CSTR("About DuckStation"), &s_about_window_open,
ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize))
{
ImGui::TextWrapped(FSUI_CSTR("DuckStation is a free and open-source simulator/emulator of the Sony PlayStation(TM) "
ImGui::TextWrapped("%s",
FSUI_CSTR("DuckStation is a free and open-source simulator/emulator of the Sony PlayStation(TM) "
"console, focusing on playability, speed, and long-term maintainability."));
ImGui::NewLine();
ImGui::TextWrapped(
FSUI_CSTR("Contributor List: https://github.com/stenzek/duckstation/blob/master/CONTRIBUTORS.md"));
"%s", FSUI_CSTR("Contributor List: https://github.com/stenzek/duckstation/blob/master/CONTRIBUTORS.md"));
ImGui::NewLine();
ImGui::TextWrapped(
FSUI_CSTR("Duck icon by icons8 (https://icons8.com/icon/74847/platforms.undefined.short-title)"));
"%s", FSUI_CSTR("Duck icon by icons8 (https://icons8.com/icon/74847/platforms.undefined.short-title)"));
ImGui::NewLine();
ImGui::TextWrapped(
FSUI_CSTR("\"PlayStation\" and \"PSX\" are registered trademarks of Sony Interactive Entertainment Europe "
"Limited. This software is not affiliated in any way with Sony Interactive Entertainment."));
"%s", FSUI_CSTR("\"PlayStation\" and \"PSX\" are registered trademarks of Sony Interactive Entertainment Europe "
"Limited. This software is not affiliated in any way with Sony Interactive Entertainment."));
ImGui::NewLine();

View File

@ -331,6 +331,15 @@ void GPU::UpdateDMARequest()
m_GPUSTAT.ready_to_send_vram = true;
m_GPUSTAT.ready_to_recieve_dma = m_fifo.IsEmpty();
break;
case BlitterState::DrawingPolyLine:
m_GPUSTAT.ready_to_send_vram = false;
m_GPUSTAT.ready_to_recieve_dma = (m_fifo.GetSize() < m_fifo_size);
break;
default:
UnreachableCode();
break;
}
bool dma_request;
@ -375,6 +384,14 @@ void GPU::UpdateGPUIdle()
case BlitterState::ReadingVRAM:
m_GPUSTAT.gpu_idle = false;
break;
case BlitterState::DrawingPolyLine:
m_GPUSTAT.gpu_idle = false;
break;
default:
UnreachableCode();
break;
}
}
@ -1657,7 +1674,6 @@ bool GPU::RenderDisplay(GPUFramebuffer* target, const Common::Rectangle<s32>& dr
m_display_texture->MakeReadyForSampling();
bool texture_filter_linear = false;
bool bilinear_adjust = false;
struct Uniforms
{
@ -1676,7 +1692,6 @@ bool GPU::RenderDisplay(GPUFramebuffer* target, const Common::Rectangle<s32>& dr
case DisplayScalingMode::BilinearSmooth:
texture_filter_linear = true;
bilinear_adjust = true;
break;
case DisplayScalingMode::BilinearSharp:

View File

@ -6,11 +6,7 @@
#include "util/gpu_device.h"
#include "common/assert.h"
#include "common/log.h"
#include <algorithm>
Log_SetChannel(GPU_SW_Backend);
GPU_SW_Backend::GPU_SW_Backend() : GPUBackend()
{
@ -209,6 +205,9 @@ void ALWAYS_INLINE_RELEASE GPU_SW_Backend::ShadePixel(const GPUBackendDrawComman
color.bits = Truncate16((sum - carry) | (carry - (carry >> 5)));
}
break;
default:
break;
}
// See above.

View File

@ -10,12 +10,14 @@
#include "util/state_wrapper.h"
#include "common/assert.h"
#include "common/log.h"
#include "common/path.h"
#include <array>
#ifdef _DEBUG
#include "common/log.h"
Log_SetChannel(GunCon);
#endif
static constexpr std::array<u8, static_cast<size_t>(GunCon::Button::Count)> s_button_indices = {{13, 3, 14}};
@ -230,7 +232,8 @@ static const Controller::ControllerBindingInfo s_binding_info[] = {
static const SettingInfo s_settings[] = {
{SettingInfo::Type::Path, "CrosshairImagePath", TRANSLATE_NOOP("GunCon", "Crosshair Image Path"),
TRANSLATE_NOOP("GunCon", "Path to an image to use as a crosshair/cursor.")},
TRANSLATE_NOOP("GunCon", "Path to an image to use as a crosshair/cursor."), nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, 0.0f},
{SettingInfo::Type::Float, "CrosshairScale", TRANSLATE_NOOP("GunCon", "Crosshair Image Scale"),
TRANSLATE_NOOP("GunCon", "Scale of crosshair image on screen."), "1.0", "0.0001", "100.0", "0.10", "%.0f%%", nullptr,
100.0f},

View File

@ -1,30 +1,16 @@
/***************************************************************************
* Original copyright notice from PGXP code from Beetle PSX. *
* Copyright (C) 2016 by iCatButler *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
***************************************************************************/
// SPDX-FileCopyrightText: 2016 iCatButler, 2019-2023 Connor McLaughlin <stenzek@gmail.com>
// SPDX-License-Identifier: GPL-2.0+
#include "pgxp.h"
#include "bus.h"
#include "common/log.h"
#include "cpu_core.h"
#include "settings.h"
#include "common/log.h"
#include <climits>
#include <cmath>
Log_SetChannel(PGXP);
namespace PGXP {
@ -50,19 +36,19 @@ enum : u32
#define VALID_ALL (VALID_0 | VALID_1 | VALID_2 | VALID_3)
#define INV_VALID_ALL (ALL ^ VALID_ALL)
typedef struct PGXP_value_Tag
struct PGXP_value
{
float x;
float y;
float z;
union
{
unsigned int flags;
unsigned char compFlags[4];
unsigned short halfFlags[2];
u32 flags;
u8 compFlags[4];
u16 halfFlags[2];
};
unsigned int value;
} PGXP_value;
u32 value;
};
typedef union
{
@ -184,7 +170,7 @@ ALWAYS_INLINE_RELEASE void ValidateAndCopyMem(PGXP_value* dest, u32 addr, u32 va
*dest = PGXP_value_invalid;
}
ALWAYS_INLINE_RELEASE static void ValidateAndCopyMem16(PGXP_value* dest, u32 addr, u32 value, int sign)
ALWAYS_INLINE_RELEASE static void ValidateAndCopyMem16(PGXP_value* dest, u32 addr, u32 value, bool sign)
{
u32 validMask = 0;
psx_value val, mask;
@ -333,13 +319,13 @@ void Shutdown()
}
// Instruction register decoding
#define op(_instr) (_instr >> 26) // The op part of the instruction register
#define func(_instr) ((_instr)&0x3F) // The funct part of the instruction register
#define sa(_instr) ((_instr >> 6) & 0x1F) // The sa part of the instruction register
#define op(_instr) (_instr >> 26) // The op part of the instruction register
#define func(_instr) ((_instr)&0x3F) // The funct part of the instruction register
#define sa(_instr) ((_instr >> 6) & 0x1F) // The sa part of the instruction register
#define rd(_instr) ((_instr >> 11) & 0x1F) // The rd part of the instruction register
#define rt(_instr) ((_instr >> 16) & 0x1F) // The rt part of the instruction register
#define rs(_instr) ((_instr >> 21) & 0x1F) // The rs part of the instruction register
#define imm(_instr) (_instr & 0xFFFF) // The immediate part of the instruction register
#define imm(_instr) (_instr & 0xFFFF) // The immediate part of the instruction register
#define cop2idx(_instr) (((_instr >> 11) & 0x1F) | ((_instr >> 17) & 0x20))
#define SX0 (GTE_regs[12].x)
@ -548,13 +534,13 @@ bool GetPreciseVertex(u32 addr, u32 value, int x, int y, int xOffs, int yOffs, f
}
// Instruction register decoding
#define op(_instr) (_instr >> 26) // The op part of the instruction register
#define func(_instr) ((_instr)&0x3F) // The funct part of the instruction register
#define sa(_instr) ((_instr >> 6) & 0x1F) // The sa part of the instruction register
#define op(_instr) (_instr >> 26) // The op part of the instruction register
#define func(_instr) ((_instr)&0x3F) // The funct part of the instruction register
#define sa(_instr) ((_instr >> 6) & 0x1F) // The sa part of the instruction register
#define rd(_instr) ((_instr >> 11) & 0x1F) // The rd part of the instruction register
#define rt(_instr) ((_instr >> 16) & 0x1F) // The rt part of the instruction register
#define rs(_instr) ((_instr >> 21) & 0x1F) // The rs part of the instruction register
#define imm(_instr) (_instr & 0xFFFF) // The immediate part of the instruction register
#define imm(_instr) (_instr & 0xFFFF) // The immediate part of the instruction register
#define imm_sext(_instr) \
static_cast<s32>(static_cast<s16>(_instr & 0xFFFF)) // The immediate part of the instruction register
@ -569,10 +555,16 @@ void CPU_LBx(u32 instr, u32 addr, u32 rtVal)
CPU_reg[rt(instr)] = PGXP_value_invalid;
}
void CPU_LHx(u32 instr, u32 addr, u32 rtVal)
void CPU_LH(u32 instr, u32 addr, u32 rtVal)
{
// Rt = Mem[Rs + Im] (sign/zero extended)
ValidateAndCopyMem16(&CPU_reg[rt(instr)], addr, rtVal, 1);
// Rt = Mem[Rs + Im] (sign extended)
ValidateAndCopyMem16(&CPU_reg[rt(instr)], addr, rtVal, true);
}
void CPU_LHU(u32 instr, u32 addr, u32 rtVal)
{
// Rt = Mem[Rs + Im] (zero extended)
ValidateAndCopyMem16(&CPU_reg[rt(instr)], addr, rtVal, false);
}
void CPU_SB(u32 instr, u32 addr, u32 rtVal)
@ -782,7 +774,15 @@ void CPU_ADD(u32 instr, u32 rsVal, u32 rtVal)
Validate(&CPU_reg[rs(instr)], rsVal);
Validate(&CPU_reg[rt(instr)], rtVal);
if (rtVal != 0)
if (rtVal == 0)
{
ret = CPU_reg[rs(instr)];
}
else if (rsVal == 0)
{
ret = CPU_reg[rt(instr)];
}
else
{
// iCB: Only require one valid input
if (((CPU_reg[rt(instr)].flags & VALID_01) != VALID_01) != ((CPU_reg[rs(instr)].flags & VALID_01) != VALID_01))
@ -809,10 +809,6 @@ void CPU_ADD(u32 instr, u32 rsVal, u32 rtVal)
ret.halfFlags[0] &= CPU_reg[rt(instr)].halfFlags[0];
}
else
{
ret = CPU_reg[rs(instr)];
}
ret.value = rsVal + rtVal;

View File

@ -1,22 +1,5 @@
/***************************************************************************
* Original copyright notice from PGXP code from Beetle PSX. *
* Copyright (C) 2016 by iCatButler *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
***************************************************************************/
// SPDX-FileCopyrightText: 2016 iCatButler, 2019-2023 Connor McLaughlin <stenzek@gmail.com>
// SPDX-License-Identifier: GPL-2.0+
#pragma once
#include "types.h"
@ -45,7 +28,8 @@ bool GetPreciseVertex(u32 addr, u32 value, int x, int y, int xOffs, int yOffs, f
// -- CPU functions
void CPU_LW(u32 instr, u32 addr, u32 rtVal);
void CPU_LHx(u32 instr, u32 addr, u32 rtVal);
void CPU_LH(u32 instr, u32 addr, u32 rtVal);
void CPU_LHU(u32 instr, u32 addr, u32 rtVal);
void CPU_LBx(u32 instr, u32 addr, u32 rtVal);
void CPU_SB(u32 instr, u32 addr, u32 rtVal);
void CPU_SH(u32 instr, u32 addr, u32 rtVal);

View File

@ -191,14 +191,15 @@ static const Controller::ControllerBindingInfo s_binding_info[] = {
// clang-format off
BUTTON("Left", TRANSLATE_NOOP("PlayStationMouse", "Left Button"), PlayStationMouse::Button::Left, GenericInputBinding::Cross),
BUTTON("Right", TRANSLATE_NOOP("PlayStationMouse", "Right Button"), PlayStationMouse::Button::Right, GenericInputBinding::Circle),
// clang-format on
// clang-format on
#undef BUTTON
};
static const SettingInfo s_settings[] = {
{SettingInfo::Type::Boolean, "RelativeMouseMode", TRANSLATE_NOOP("PlayStationMouse", "Relative Mouse Mode"),
TRANSLATE_NOOP("PlayStationMouse", "Locks the mouse cursor to the window, use for FPS games."), "false"},
TRANSLATE_NOOP("PlayStationMouse", "Locks the mouse cursor to the window, use for FPS games."), "false", nullptr,
nullptr, nullptr, nullptr, nullptr, 0.0f},
};
const Controller::ControllerInfo PlayStationMouse::INFO = {ControllerType::PlayStationMouse,

View File

@ -101,8 +101,6 @@ static std::string GetExecutableNameForImage(ISOReader& iso, bool strip_subdirec
static bool ReadExecutableFromImage(ISOReader& iso, std::string* out_executable_name,
std::vector<u8>* out_executable_data);
static void StallCPU(TickCount ticks);
static bool LoadBIOS(const std::string& override_bios_path);
static void InternalReset();
static void ClearRunningGame();
@ -2927,10 +2925,6 @@ bool SetExpansionROM(const char* filename)
return true;
}
void System::StallCPU(TickCount ticks)
{
CPU::AddPendingTicks(ticks);
}
#endif
Controller* System::GetController(u32 slot)
@ -3207,6 +3201,10 @@ void System::UpdateMultitaps()
Pad::GetMultitap(1)->SetEnable(true, 4);
}
break;
default:
UnreachableCode();
break;
}
}

View File

@ -27,8 +27,7 @@ struct ImageInfo;
struct Hash;
} // namespace BIOS
namespace GameDatabase
{
namespace GameDatabase {
struct Entry;
}
@ -79,7 +78,10 @@ enum : u32
{
// 5 megabytes is sufficient for now, at the moment they're around 4.3MB, or 10.3MB with 8MB RAM enabled.
MAX_SAVE_STATE_SIZE = 11 * 1024 * 1024,
};
enum : s32
{
PER_GAME_SAVE_STATE_SLOTS = 10,
GLOBAL_SAVE_STATE_SLOTS = 10
};
@ -477,8 +479,7 @@ void UpdateMemorySaveStateSettings();
bool LoadRewindState(u32 skip_saves = 0, bool consume_state = true);
void SetRunaheadReplayFlag();
namespace Internal
{
namespace Internal {
/// Called on process startup.
void ProcessStartup();
@ -487,7 +488,7 @@ void ProcessShutdown();
/// Polls input, updates subsystems which are present while paused/inactive.
void IdlePollUpdate();
}
} // namespace Internal
} // namespace System

View File

@ -177,6 +177,9 @@ void Timers::SetGate(u32 timer, bool state)
case SyncMode::FreeRunOnGate:
cs.mode.sync_enable = false;
break;
default:
break;
}
}