more rsx texture (control1)

and fixed crash of rsx debugger
This commit is contained in:
elisha464 2014-02-10 18:34:30 +02:00
parent bc38af04a5
commit 48115b153e
5 changed files with 27 additions and 40 deletions

View File

@ -158,10 +158,10 @@ public:
if(format != 0x81 && format != 0x94)
{
u8 remap_a = tex.m_remap & 0x3;
u8 remap_r = (tex.m_remap >> 2) & 0x3;
u8 remap_g = (tex.m_remap >> 4) & 0x3;
u8 remap_b = (tex.m_remap >> 6) & 0x3;
u8 remap_a = tex.GetRemap() & 0x3;
u8 remap_r = (tex.GetRemap() >> 2) & 0x3;
u8 remap_g = (tex.GetRemap() >> 4) & 0x3;
u8 remap_b = (tex.GetRemap() >> 6) & 0x3;
static const int gl_remap[] =
{

View File

@ -3,7 +3,6 @@
RSXTexture::RSXTexture()
: m_bias(0)
, m_remap(0xE4)
, m_min_filter(1)
, m_mag_filter(2)
{
@ -12,7 +11,6 @@ RSXTexture::RSXTexture()
RSXTexture::RSXTexture(u8 index)
: m_bias(0)
, m_remap(0xE4)
, m_min_filter(1)
, m_mag_filter(2)
{
@ -140,6 +138,11 @@ bool RSXTexture::IsAlphaKillEnabled() const
return ((methodRegisters[NV4097_SET_TEXTURE_CONTROL0 + (m_index*4)] >> 2) & 0x1);
}
u32 RSXTexture::GetRemap() const
{
return (methodRegisters[NV4097_SET_TEXTURE_CONTROL1 + (m_index*4)]);
}
u16 RSXTexture::GetWidth() const
{
return ((methodRegisters[NV4097_SET_TEXTURE_IMAGE_RECT + (m_index*4)] >> 16) & 0xffff);
@ -150,15 +153,6 @@ u16 RSXTexture::GetHeight() const
return ((methodRegisters[NV4097_SET_TEXTURE_IMAGE_RECT + (m_index*4)]) & 0xffff);
}
void RSXTexture::SetControl0(const bool enable, const u16 minlod, const u16 maxlod, const u8 maxaniso)
{
}
void RSXTexture::SetControl1(u32 remap)
{
m_remap = remap;
}
void RSXTexture::SetControl3(u16 depth, u32 pitch)
{
m_depth = depth;

View File

@ -205,13 +205,6 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
case_16(NV4097_SET_TEXTURE_CONTROL0, 0x20):
{
RSXTexture& tex = m_textures[index];
u32 a0 = ARGS(0);
bool enable = a0 >> 31 ? true : false;
u16 minlod = (a0 >> 19) & 0xfff;
u16 maxlod = (a0 >> 7) & 0xfff;
u8 maxaniso = (a0 >> 2) & 0x7;
tex.SetControl0(enable, minlod, maxlod, maxaniso);
}
break;
@ -280,8 +273,6 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, mem32_ptr_t& args, const u3
case_16(NV4097_SET_TEXTURE_CONTROL1, 0x20):
{
RSXTexture& tex = m_textures[index];
tex.SetControl1(ARGS(0));
}
break;

View File

@ -31,8 +31,6 @@ public:
u8 m_g_signed;
u8 m_b_signed;
u32 m_remap;
public:
RSXTexture();
RSXTexture(u8 index);
@ -66,12 +64,13 @@ public:
u8 GetMaxAniso() const;
bool IsAlphaKillEnabled() const;
// Control1
u32 GetRemap() const;
// Image Rect
u16 GetWidth() const;
u16 GetHeight() const;
void SetControl0(const bool enable, const u16 minlod, const u16 maxlod, const u8 maxaniso);
void SetControl1(u32 remap);
void SetControl3(u16 depth, u32 pitch);
void SetFilter(u16 bias, u8 min, u8 mag, u8 conv, u8 a_signed, u8 r_signed, u8 g_signed, u8 b_signed);
};

View File

@ -484,19 +484,22 @@ void RSXDebugger::GetTexture()
for(uint i=0; i<RSXThread::m_textures_count; ++i)
{
m_list_texture->InsertItem(i, wxString::Format("%d", i));
m_list_texture->SetItem(i, 1, wxString::Format("0x%x", GetAddress(render.m_textures[i].GetOffset(), render.m_textures[i].GetLocation())));
m_list_texture->SetItem(i, 2, render.m_textures[i].isCubemap() ? "True" : "False");
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, 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(),
render.m_textures[i].GetHeight()));
if(render.m_textures[i].IsEnabled())
{
m_list_texture->InsertItem(i, wxString::Format("%d", i));
m_list_texture->SetItem(i, 1, wxString::Format("0x%x", GetAddress(render.m_textures[i].GetOffset(), render.m_textures[i].GetLocation())));
m_list_texture->SetItem(i, 2, render.m_textures[i].isCubemap() ? "True" : "False");
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, 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(),
render.m_textures[i].GetHeight()));
m_list_texture->SetItemBackgroundColour(i, wxColour(m_cur_texture == i ? "Wheat" : "White"));
m_list_texture->SetItemBackgroundColour(i, wxColour(m_cur_texture == i ? "Wheat" : "White"));
}
}
}