diff --git a/rpcs3/Emu/GS/GL/GLGSRender.h b/rpcs3/Emu/GS/GL/GLGSRender.h index b0ea63df71..e3875f665d 100644 --- a/rpcs3/Emu/GS/GL/GLGSRender.h +++ b/rpcs3/Emu/GS/GL/GLGSRender.h @@ -175,10 +175,10 @@ public: default: ConLog.Error("Init tex error: Bad tex format (0x%x | %s | 0x%x)", format, is_swizzled ? "swizzled" : "linear", tex.GetFormat() & 0x40); break; } - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, tex.Getmipmap() - 1); - glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, tex.Getmipmap() > 1); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, tex.GetMipmap() - 1); + glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, tex.GetMipmap() > 1); - if(format != 0x81 && format != 0x94) + if(format != CELL_GCM_TEXTURE_B8 && format != CELL_GCM_TEXTURE_X16) { u8 remap_a = tex.GetRemap() & 0x3; u8 remap_r = (tex.GetRemap() >> 2) & 0x3; @@ -245,7 +245,7 @@ public: //Unbind(); - if(is_swizzled && format == 0x85) + if(is_swizzled && format == CELL_GCM_TEXTURE_A8R8G8B8) { free(unswizzledPixels); } diff --git a/rpcs3/Emu/GS/RSXTexture.cpp b/rpcs3/Emu/GS/RSXTexture.cpp index 9ac888c8e9..966e97a0af 100644 --- a/rpcs3/Emu/GS/RSXTexture.cpp +++ b/rpcs3/Emu/GS/RSXTexture.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "RSXThread.h" +#include "RSXTexture.h" RSXTexture::RSXTexture() { @@ -70,7 +70,7 @@ u8 RSXTexture::GetFormat() const return ((methodRegisters[NV4097_SET_TEXTURE_FORMAT + (m_index*32)] >> 8) & 0xff); } -u16 RSXTexture::Getmipmap() const +u16 RSXTexture::GetMipmap() const { return ((methodRegisters[NV4097_SET_TEXTURE_FORMAT + (m_index*32)] >> 16) & 0xffff); } @@ -199,4 +199,4 @@ void RSXTexture::SetControl3(u16 depth, u32 pitch) { m_depth = depth; m_pitch = pitch; -} \ No newline at end of file +} diff --git a/rpcs3/Emu/GS/RSXTexture.h b/rpcs3/Emu/GS/RSXTexture.h new file mode 100644 index 0000000000..8b87a9d7d9 --- /dev/null +++ b/rpcs3/Emu/GS/RSXTexture.h @@ -0,0 +1,62 @@ +#pragma once + +class RSXTexture +{ + u8 m_index; + +public: + u32 m_pitch; + u16 m_depth; + +public: + RSXTexture(); + RSXTexture(u8 index); + void Init(); + + // Offset + u32 GetOffset() const; + + // Format + u8 GetLocation() const; + bool isCubemap() const; + u8 GetBorderType() const; + u8 GetDimension() const; + u8 GetFormat() const; + u16 GetMipmap() const; + + // Address + u8 GetWrapS() const; + u8 GetWrapT() const; + u8 GetWrapR() const; + u8 GetUnsignedRemap() const; + u8 GetZfunc() const; + u8 GetGamma() const; + u8 GetAnisoBias() const; + u8 GetSignedRemap() const; + + // Control0 + bool IsEnabled() const; + u16 GetMinLOD() const; + u16 GetMaxLOD() const; + u8 GetMaxAniso() const; + bool IsAlphaKillEnabled() const; + + // Control1 + u32 GetRemap() const; + + // Filter + u16 GetBias() const; + u8 GetMinFilter() const; + u8 GetMagFilter() const; + u8 GetConvolutionFilter() const; + bool isASigned() const; + bool isRSigned() const; + bool isGSigned() const; + bool isBSigned() const; + + // Image Rect + u16 GetWidth() const; + u16 GetHeight() const; + + void SetControl3(u16 depth, u32 pitch); +}; diff --git a/rpcs3/Emu/GS/RSXThread.h b/rpcs3/Emu/GS/RSXThread.h index bfe5256ddb..3063520c2e 100644 --- a/rpcs3/Emu/GS/RSXThread.h +++ b/rpcs3/Emu/GS/RSXThread.h @@ -1,5 +1,6 @@ #pragma once #include "GCM.h" +#include "RSXTexture.h" #include "RSXVertexProgram.h" #include "RSXFragmentProgram.h" #include "Emu/SysCalls/Callback.h" @@ -15,67 +16,6 @@ enum Method extern u32 methodRegisters[0xffff]; u32 GetAddress(u32 offset, u8 location); -class RSXTexture -{ - u8 m_index; - -public: - u32 m_pitch; - u16 m_depth; - -public: - RSXTexture(); - RSXTexture(u8 index); - void Init(); - - // Offset - u32 GetOffset() const; - - // Format - u8 GetLocation() const; - bool isCubemap() const; - u8 GetBorderType() const; - u8 GetDimension() const; - u8 GetFormat() const; - u16 Getmipmap() const; - - // Address - u8 GetWrapS() const; - u8 GetWrapT() const; - u8 GetWrapR() const; - u8 GetUnsignedRemap() const; - u8 GetZfunc() const; - u8 GetGamma() const; - u8 GetAnisoBias() const; - u8 GetSignedRemap() const; - - // Control0 - bool IsEnabled() const; - u16 GetMinLOD() const; - u16 GetMaxLOD() const; - u8 GetMaxAniso() const; - bool IsAlphaKillEnabled() const; - - // Control1 - u32 GetRemap() const; - - // Filter - u16 GetBias() const; - u8 GetMinFilter() const; - u8 GetMagFilter() const; - u8 GetConvolutionFilter() const; - bool isASigned() const; - bool isRSigned() const; - bool isGSigned() const; - bool isBSigned() const; - - // Image Rect - u16 GetWidth() const; - u16 GetHeight() const; - - void SetControl3(u16 depth, u32 pitch); -}; - struct RSXVertexData { u32 frequency; diff --git a/rpcs3/Gui/RSXDebugger.cpp b/rpcs3/Gui/RSXDebugger.cpp index e49614c029..a1df62713e 100644 --- a/rpcs3/Gui/RSXDebugger.cpp +++ b/rpcs3/Gui/RSXDebugger.cpp @@ -548,7 +548,7 @@ void RSXDebugger::GetTexture() m_list_texture->SetItem(i, 3, wxString::Format("%dD", render.m_textures[i].GetDimension())); m_list_texture->SetItem(i, 4, render.m_textures[i].IsEnabled() ? "True" : "False"); m_list_texture->SetItem(i, 5, wxString::Format("0x%x", render.m_textures[i].GetFormat())); - m_list_texture->SetItem(i, 6, wxString::Format("0x%x", render.m_textures[i].Getmipmap())); + m_list_texture->SetItem(i, 6, wxString::Format("0x%x", render.m_textures[i].GetMipmap())); m_list_texture->SetItem(i, 7, wxString::Format("0x%x", render.m_textures[i].m_pitch)); m_list_texture->SetItem(i, 8, wxString::Format("%dx%d", render.m_textures[i].GetWidth(), diff --git a/rpcs3/Loader/PKG.cpp b/rpcs3/Loader/PKG.cpp index fa861df607..fba5988eb6 100644 --- a/rpcs3/Loader/PKG.cpp +++ b/rpcs3/Loader/PKG.cpp @@ -12,7 +12,7 @@ PKGLoader::PKGLoader(wxFile& f) : pkg_f(f) bool PKGLoader::Install(std::string dest, bool show) { // Initial checks - if(!pkg_f.IsOpened()) + if (!pkg_f.IsOpened()) return false; dest = wxGetCwd() + dest; @@ -26,6 +26,12 @@ bool PKGLoader::Install(std::string dest, bool show) std::string decryptedFile = wxGetCwd() + "/dev_hdd1/" + titleID + ".dec"; if (wxDirExists(dest+titleID)) { + wxMessageDialog d_overwrite(NULL, "Another installation was found. Do you want to overwrite it?", "PKG Decrypter / Installer", wxYES_NO|wxCENTRE); + if (d_overwrite.ShowModal() != wxID_YES) { + ConLog.Error("PKG Loader: Another installation found in: %s", wxString(titleID).wx_str()); + return false; + } + // TODO: Remove the following two lines and remove the folder dest+titleID ConLog.Error("PKG Loader: Another installation found in: %s", wxString(titleID).wx_str()); return false; }