From 14cf862e2235da14978d3f577c983cfbecc4d59c Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 6 Jun 2017 19:48:17 -0700 Subject: [PATCH 1/4] GE Debugger: Gah, fix some pointer size errors. Happened to be 8 bytes, but not on 32-bit, of course. --- GPU/Debugger/Record.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GPU/Debugger/Record.cpp b/GPU/Debugger/Record.cpp index 7140e0b4a6..2e8ec2c429 100644 --- a/GPU/Debugger/Record.cpp +++ b/GPU/Debugger/Record.cpp @@ -383,7 +383,7 @@ static void WriteRecording() { const std::string filename = GenRecordingFilename(); FILE *fp = File::OpenCFile(filename, "wb"); - fwrite(HEADER, sizeof(HEADER), 1, fp); + fwrite(HEADER, 8, 1, fp); fwrite(&VERSION, sizeof(VERSION), 1, fp); u32 sz = (u32)commands.size(); @@ -1003,7 +1003,7 @@ bool RunMountedReplay(const std::string &filename) { pspFileSystem.ReadFile(fp, header, sizeof(header)); pspFileSystem.ReadFile(fp, (u8 *)&version, sizeof(version)); - if (memcmp(header, HEADER, sizeof(HEADER)) != 0 || version != VERSION) { + if (memcmp(header, HEADER, sizeof(header)) != 0 || version != VERSION) { ERROR_LOG(SYSTEM, "Invalid GE dump or unsupported version"); pspFileSystem.CloseFile(fp); return false; From a6f56769a8264ec335c74ab3bdf64f20bdba097b Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 6 Jun 2017 19:49:42 -0700 Subject: [PATCH 2/4] SoftGPU: Avoid some compile warnings. Remove some no-longer used funcs, add some switch default logs. --- GPU/Software/Rasterizer.cpp | 16 ---------------- GPU/Software/TransformUnit.cpp | 7 +++++++ 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/GPU/Software/Rasterizer.cpp b/GPU/Software/Rasterizer.cpp index cc7eaa5df0..0e691e755c 100644 --- a/GPU/Software/Rasterizer.cpp +++ b/GPU/Software/Rasterizer.cpp @@ -39,22 +39,6 @@ namespace Rasterizer { -//static inline int orient2d(const DrawingCoords& v0, const DrawingCoords& v1, const DrawingCoords& v2) -static inline int orient2d(const ScreenCoords& v0, const ScreenCoords& v1, const ScreenCoords& v2) -{ - return ((int)v1.x-(int)v0.x)*((int)v2.y-(int)v0.y) - ((int)v1.y-(int)v0.y)*((int)v2.x-(int)v0.x); -} - -static inline int orient2dIncX(int dY01) -{ - return dY01; -} - -static inline int orient2dIncY(int dX01) -{ - return -dX01; -} - // Only OK on x64 where our stack is aligned #if defined(_M_SSE) && !defined(_M_IX86) static inline __m128 Interpolate(const __m128 &c0, const __m128 &c1, const __m128 &c2, int w0, int w1, int w2, float wsum) { diff --git a/GPU/Software/TransformUnit.cpp b/GPU/Software/TransformUnit.cpp index 17b473b8a3..12dec65ea6 100644 --- a/GPU/Software/TransformUnit.cpp +++ b/GPU/Software/TransformUnit.cpp @@ -348,6 +348,9 @@ void TransformUnit::SubmitPrimitive(void* vertices, void* indices, GEPrimitiveTy case GE_PRIM_POINTS: Clipper::ProcessPoint(data[0]); break; + + default: + _dbg_assert_msg_(G3D, false, "Unexpected prim type: %d", prim_type); } } break; @@ -474,6 +477,10 @@ void TransformUnit::SubmitPrimitive(void* vertices, void* indices, GEPrimitiveTy } break; } + + default: + ERROR_LOG(G3D, "Unexpected prim type: %d", prim_type); + break; } host->GPUNotifyDraw(); From e24216e55b1ef2bb0d94efdcbb480bce589bc094 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 6 Jun 2017 19:50:19 -0700 Subject: [PATCH 3/4] UI: Add some missing overrides. --- UI/TouchControlLayoutScreen.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/UI/TouchControlLayoutScreen.cpp b/UI/TouchControlLayoutScreen.cpp index ca99089358..08e1159b04 100644 --- a/UI/TouchControlLayoutScreen.cpp +++ b/UI/TouchControlLayoutScreen.cpp @@ -48,7 +48,7 @@ public: scale_ = theScale_; } - virtual bool IsDown() { + bool IsDown() override { // Don't want the button to enlarge and throw the user's perspective // of button size off whack. return false; @@ -118,7 +118,7 @@ public: squareVisible_ = visible; } - void Draw(UIContext &dc) { + void Draw(UIContext &dc) override { float opacity = g_Config.iTouchButtonOpacity / 100.0f; uint32_t colorBg = colorAlpha(GetButtonColor(), opacity); @@ -151,19 +151,15 @@ public: } }; - void GetContentDimensions(const UIContext &dc, float &w, float &h) const{ + void GetContentDimensions(const UIContext &dc, float &w, float &h) const override { const AtlasImage &image = dc.Draw()->GetAtlas()->images[roundId_]; w = (2 * baseActionButtonSpacing * spacing_) + image.w * scale_; h = (2 * baseActionButtonSpacing * spacing_) + image.h * scale_; } - virtual float GetSpacing() const { return spacing_; } - virtual void SetSpacing(float s) { spacing_ = s; } - - virtual void SavePosition() { - DragDropButton::SavePosition(); - } + float GetSpacing() const override { return spacing_; } + void SetSpacing(float s) override { spacing_ = s; } private: bool circleVisible_, crossVisible_, triangleVisible_, squareVisible_; @@ -180,7 +176,7 @@ public: : DragDropButton(x, y, -1, -1, scale), spacing_(spacing) { } - void Draw(UIContext &dc) { + void Draw(UIContext &dc) override { float opacity = g_Config.iTouchButtonOpacity / 100.0f; uint32_t colorBg = colorAlpha(GetButtonColor(), opacity); @@ -204,14 +200,14 @@ public: } } - void GetContentDimensions(const UIContext &dc, float &w, float &h) const{ + void GetContentDimensions(const UIContext &dc, float &w, float &h) const override { const AtlasImage &image = dc.Draw()->GetAtlas()->images[I_DIR]; w = 2 * D_pad_Radius * spacing_ + image.w * scale_; h = 2 * D_pad_Radius * spacing_ + image.h * scale_; }; - float GetSpacing() const { return spacing_; } - virtual void SetSpacing(float s) { spacing_ = s; } + float GetSpacing() const override { return spacing_; } + void SetSpacing(float s) override { spacing_ = s; } private: float &spacing_; From 21fbacd993bc70cbb782394540cd644aea00ef3a Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 6 Jun 2017 23:25:42 -0700 Subject: [PATCH 4/4] Build: Include Roboto in buildscripts. --- CMakeLists.txt | 10 +++++++--- android/ab.cmd | 1 + android/ab.sh | 1 + android/buildassets.sh | 4 ++++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d79c4444a..83f56c3aa1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1748,11 +1748,15 @@ set(NativeAssets android/assets/ui_atlas.zim assets/lang assets/shaders - assets/ppge_atlas.zim + assets/Roboto-Condensed.ttf + assets/7z.png assets/compat.ini - assets/langregion.ini assets/gamecontrollerdb.txt - assets/unknown.png) + assets/langregion.ini + assets/ppge_atlas.zim + assets/rargray.png + assets/unknown.png + assets/zip.png) if(HEADLESS) diff --git a/android/ab.cmd b/android/ab.cmd index 1354c35a67..6befeb03b3 100644 --- a/android/ab.cmd +++ b/android/ab.cmd @@ -3,6 +3,7 @@ xcopy ..\assets\lang assets\lang\ /s /y