mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-04 11:47:13 +00:00
Minor changes in RSXTexture.h and PKG Loader
* Moved RSXTexture from RSXThread.h to RSXTexture.h * Renamed RSXTexture::Getmipmap to RSXTexture::GetMipmap * Used more GCM texture format constants in GLGSRender.h * PKG Loader: Added an "Overwrite?" dialog in case the folder dest+titleID (i.e. "/dev_hdd0/game/"+titleID) already exists. Note that in that case, the game won't be installed regardless of the option you choose on the dialog.
This commit is contained in:
parent
5f9e60c45f
commit
17b877e448
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
62
rpcs3/Emu/GS/RSXTexture.h
Normal file
62
rpcs3/Emu/GS/RSXTexture.h
Normal file
@ -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);
|
||||
};
|
@ -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;
|
||||
|
@ -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(),
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user