From ded9d63afa70d2d68f1ae9e3a684b69c9208840e Mon Sep 17 00:00:00 2001 From: ManDude <7569514+ManDude@users.noreply.github.com> Date: Sat, 14 Aug 2021 21:05:38 +0100 Subject: [PATCH] fixes --- game/graphics/gfx.h | 10 +++++----- game/kernel/kmachine.cpp | 4 ++-- game/sce/libpad.h | 36 ++++++++++++++++++------------------ game/system/newpad.h | 8 ++++---- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/game/graphics/gfx.h b/game/graphics/gfx.h index aa81b4ed93..3b89a57c38 100644 --- a/game/graphics/gfx.h +++ b/game/graphics/gfx.h @@ -43,13 +43,13 @@ struct GfxSettings { // than older versions static constexpr u64 CURRENT_VERSION = 0x0000'0000'0002'0001; - u64 version; // the version of this settings struct + u64 version; // the version of this settings struct const GfxRendererModule* renderer; // which rendering pipeline to use. - int vsync; // (temp) number of screen update per frame - bool debug; // graphics debugging + int vsync; // (temp) number of screen update per frame + bool debug; // graphics debugging - Pad::MappingInfo pad_mapping_info; // button mapping - Pad::MappingInfo pad_mapping_info_backup; // button mapping backup (see newpad.h) + Pad::MappingInfo pad_mapping_info; // button mapping + Pad::MappingInfo pad_mapping_info_backup; // button mapping backup (see newpad.h) }; namespace Gfx { diff --git a/game/kernel/kmachine.cpp b/game/kernel/kmachine.cpp index 08147155ad..6f61f62ded 100644 --- a/game/kernel/kmachine.cpp +++ b/game/kernel/kmachine.cpp @@ -520,10 +520,10 @@ Ptr CPadGetData(u64 cpad_info) { } break; case 78: // pressure mode request check - if (scePadGetReqState(cpad->number, 0) == 1) { + if (scePadGetReqState(cpad->number, 0) == scePadReqStateFailed) { cpad->state = 76; } - if (scePadGetReqState(cpad->number, 0) == 0) { + if (scePadGetReqState(cpad->number, 0) == scePadReqStateComplete) { cpad->state = 99; } break; diff --git a/game/sce/libpad.h b/game/sce/libpad.h index 04fa75dd01..5574da73cb 100644 --- a/game/sce/libpad.h +++ b/game/sce/libpad.h @@ -10,31 +10,31 @@ #define SCE_PAD_DMA_BUFFER_SIZE 0x100 // pad status -#define scePadStateDiscon 0 -#define scePadStateFindPad 1 +#define scePadStateDiscon 0 +#define scePadStateFindPad 1 #define scePadStateFindCTP1 2 -#define scePadStateExecCmd 5 -#define scePadStateStable 6 -#define scePadStateError 7 -#define scePadStateClosed 99 +#define scePadStateExecCmd 5 +#define scePadStateStable 6 +#define scePadStateError 7 +#define scePadStateClosed 99 // pad mode info checks -#define InfoModeCurID 1 -#define InfoModeCurExID 2 +#define InfoModeCurID 1 +#define InfoModeCurExID 2 #define InfoModeCurExOffs 3 -#define InfoModeIdTable 4 +#define InfoModeIdTable 4 // pad async request states -#define scePadReqStateComplete 0 -#define scePadReqStateFaild 1 // lol -#define scePadReqStateFailed 1 -#define scePadReqStateBusy 2 +#define scePadReqStateComplete 0 +#define scePadReqStateFaild 1 // lol +#define scePadReqStateFailed 1 +#define scePadReqStateBusy 2 // pad actuator info checks -#define InfoActFunc 1 -#define InfoActSub 2 -#define InfoActSize 3 -#define InfoActCurr 4 +#define InfoActFunc 1 +#define InfoActSub 2 +#define InfoActSize 3 +#define InfoActCurr 4 namespace ee { @@ -59,4 +59,4 @@ int scePadGetReqState(int port, int slot); int scePadInfoAct(int port, int slot, int actno, int term); int scePadInfoPressMode(int port, int slot); int scePadEnterPressMode(int port, int slot); -} +} // namespace ee diff --git a/game/system/newpad.h b/game/system/newpad.h index 7d0d9b7e9a..0514b48c9f 100644 --- a/game/system/newpad.h +++ b/game/system/newpad.h @@ -17,7 +17,7 @@ namespace Pad { -static constexpr int CONTROLLER_COUNT = 2; // support 2 controllers. +static constexpr int CONTROLLER_COUNT = 2; // support 2 controllers. // mirrors goal enum pad-buttons. used as indices to an array! enum class Button { @@ -50,9 +50,9 @@ enum class Button { }; struct MappingInfo { - bool debug = true; // debug mode - bool input_mode = false; // input mode for controller mapping - bool buffer_mode = true; // use buffered inputs + bool debug = true; // debug mode + bool input_mode = false; // input mode for controller mapping + bool buffer_mode = true; // use buffered inputs int pad_mapping[CONTROLLER_COUNT][(int)Pad::Button::Max]; // controller button mapping // TODO complex button mapping & key macros (e.g. shift+x for l2+r2 press etc.) };