Skip to content

Commit

Permalink
Minor code cleanup and reformatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Gamer64ytb committed Jul 26, 2024
1 parent 2321c67 commit 24f0861
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 45 deletions.
2 changes: 1 addition & 1 deletion dist/qt_themes/default/icons/index.theme
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ Size=16

[48x48]
Size=48

[256x256]
Size=256
1 change: 0 additions & 1 deletion src/citra_qt/debugger/registers.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include <memory>
#include <QDockWidget>
#include "common/common_types.h"

class QTreeWidget;
class QTreeWidgetItem;
Expand Down
35 changes: 23 additions & 12 deletions src/core/arm/dynarmic/arm_dynarmic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,41 +25,50 @@ class DynarmicUserCallbacks final : public Dynarmic::A32::UserCallbacks {
: parent(parent), svc_context(parent.system), memory(parent.memory) {}
~DynarmicUserCallbacks() = default;

std::uint8_t MemoryRead8(VAddr vaddr) override {
u8 MemoryRead8(VAddr vaddr) override {
return memory.Read8(vaddr);
}
std::uint16_t MemoryRead16(VAddr vaddr) override {

u16 MemoryRead16(VAddr vaddr) override {
return memory.Read16(vaddr);
}
std::uint32_t MemoryRead32(VAddr vaddr) override {

u32 MemoryRead32(VAddr vaddr) override {
return memory.Read32(vaddr);
}
std::uint64_t MemoryRead64(VAddr vaddr) override {

u64 MemoryRead64(VAddr vaddr) override {
return memory.Read64(vaddr);
}

void MemoryWrite8(VAddr vaddr, std::uint8_t value) override {
void MemoryWrite8(VAddr vaddr, u8 value) override {
memory.Write8(vaddr, value);
}
void MemoryWrite16(VAddr vaddr, std::uint16_t value) override {

void MemoryWrite16(VAddr vaddr, u16 value) override {
memory.Write16(vaddr, value);
}
void MemoryWrite32(VAddr vaddr, std::uint32_t value) override {

void MemoryWrite32(VAddr vaddr, u32 value) override {
memory.Write32(vaddr, value);
}
void MemoryWrite64(VAddr vaddr, std::uint64_t value) override {

void MemoryWrite64(VAddr vaddr, u64 value) override {
memory.Write64(vaddr, value);
}

bool MemoryWriteExclusive8(u32 vaddr, u8 value, u8 expected) override {
return memory.WriteExclusive8(vaddr, value, expected);
}

bool MemoryWriteExclusive16(u32 vaddr, u16 value, u16 expected) override {
return memory.WriteExclusive16(vaddr, value, expected);
}

bool MemoryWriteExclusive32(u32 vaddr, u32 value, u32 expected) override {
return memory.WriteExclusive32(vaddr, value, expected);
}

bool MemoryWriteExclusive64(u32 vaddr, u64 value, u64 expected) override {
return memory.WriteExclusive64(vaddr, value, expected);
}
Expand All @@ -70,7 +79,7 @@ class DynarmicUserCallbacks final : public Dynarmic::A32::UserCallbacks {
pc, MemoryReadCode(pc).value(), num_instructions);
}

void CallSVC(std::uint32_t swi) override {
void CallSVC(u32 swi) override {
svc_context.CallSVC(swi);
}

Expand Down Expand Up @@ -103,14 +112,16 @@ class DynarmicUserCallbacks final : public Dynarmic::A32::UserCallbacks {
pc, MemoryReadCode(pc).value());
}

void AddTicks(std::uint64_t ticks) override {
void AddTicks(u64 ticks) override {
parent.GetTimer().AddTicks(ticks);
}
std::uint64_t GetTicksRemaining() override {

u64 GetTicksRemaining() override {
s64 ticks = parent.GetTimer().GetDowncount();
return static_cast<u64>(ticks <= 0 ? 0 : ticks);
}
std::uint64_t GetTicksForCode(bool is_thumb, VAddr, std::uint32_t instruction) override {

u64 GetTicksForCode(bool is_thumb, VAddr, u32 instruction) override {
return Core::TicksForInstruction(is_thumb, instruction);
}

Expand Down
4 changes: 2 additions & 2 deletions src/core/core_timing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ void Timing::UnscheduleEvent(const TimingEventType* event_type, std::uintptr_t u
std::make_heap(timer->event_queue.begin(), timer->event_queue.end(), std::greater<>());
}
}
// TODO:remove events from ts_queue
// TODO: remove events from ts_queue
}

void Timing::RemoveEvent(const TimingEventType* event_type) {
Expand All @@ -134,7 +134,7 @@ void Timing::RemoveEvent(const TimingEventType* event_type) {
std::make_heap(timer->event_queue.begin(), timer->event_queue.end(), std::greater<>());
}
}
// TODO:remove events from ts_queue
// TODO: remove events from ts_queue
}

void Timing::SetCurrentTimer(std::size_t core_id) {
Expand Down
2 changes: 1 addition & 1 deletion src/core/file_sys/archive_extsavedata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ std::string GetExtSaveDataPath(std::string_view mount_point, const Path& path) {
ExtSaveDataArchivePath path_data;
std::memcpy(&path_data, vec_data.data(), sizeof(path_data));

return fmt::format("{}{:08X}/{:08X}/", mount_point, path_data.save_high, path_data.save_low);
return fmt::format("{}{:08x}/{:08x}/", mount_point, path_data.save_high, path_data.save_low);
}

std::string GetExtDataContainerPath(std::string_view mount_point, bool shared) {
Expand Down
2 changes: 1 addition & 1 deletion src/core/file_sys/archive_systemsavedata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ std::string GetSystemSaveDataPath(std::string_view mount_point, const Path& path
u32 save_high;
std::memcpy(&save_low, &vec_data[4], sizeof(u32));
std::memcpy(&save_high, &vec_data[0], sizeof(u32));
return fmt::format("{}{:08X}/{:08X}/", mount_point, save_low, save_high);
return fmt::format("{}{:08x}/{:08x}/", mount_point, save_low, save_high);
}

std::string GetSystemSaveDataContainerPath(std::string_view mount_point) {
Expand Down
39 changes: 13 additions & 26 deletions src/video_core/renderer_opengl/post_processing_opengl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,15 @@ uniform sampler2D color_texture;
uniform sampler2D color_texture_r;
// Interfacing functions
float4 Sample()
{
float4 Sample() {
return texture(color_texture, frag_tex_coord);
}
float4 SampleLocation(float2 location)
{
float4 SampleLocation(float2 location) {
return texture(color_texture, location);
}
float4 SampleLayer(int layer)
{
float4 SampleLayer(int layer) {
if(layer == 0)
return texture(color_texture, frag_tex_coord);
else
Expand All @@ -74,53 +71,43 @@ float4 SampleLayer(int layer)
#define SampleOffset(offset) textureOffset(color_texture, frag_tex_coord, offset)
float2 GetResolution()
{
float2 GetResolution() {
return i_resolution.xy;
}
float2 GetInvResolution()
{
float2 GetInvResolution() {
return i_resolution.zw;
}
float2 GetIResolution()
{
float2 GetIResolution() {
return i_resolution.xy;
}
float2 GetIInvResolution()
{
float2 GetIInvResolution() {
return i_resolution.zw;
}
float2 GetWindowResolution()
{
float2 GetWindowResolution() {
return o_resolution.xy;
}
float2 GetInvWindowResolution()
{
float2 GetInvWindowResolution() {
return o_resolution.zw;
}
float2 GetOResolution()
{
float2 GetOResolution() {
return o_resolution.xy;
}
float2 GetOInvResolution()
{
float2 GetOInvResolution() {
return o_resolution.zw;
}
float2 GetCoordinates()
{
float2 GetCoordinates() {
return frag_tex_coord;
}
void SetOutput(float4 color_in)
{
void SetOutput(float4 color_in) {
color = color_in;
}
Expand Down
2 changes: 1 addition & 1 deletion src/video_core/shader/generator/spv_shader_gen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,4 +270,4 @@ std::vector<u32> GenerateTrivialVertexShader(bool use_clip_planes) {
return module.Assemble();
}

} // namespace Pica::Shader::Generator::SPIRV
} // namespace Pica::Shader::Generator::SPIRV

0 comments on commit 24f0861

Please sign in to comment.