1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-25 20:22:30 +01:00

Success log level fixed

This commit is contained in:
Nekotekina 2015-02-27 21:11:07 +03:00
parent 233f2e478a
commit d62e95d0f8
6 changed files with 49 additions and 52 deletions

View File

@ -50,9 +50,9 @@ namespace Log
enum LogSeverity : u32
{
Success = 0,
Notice,
Notice = 0,
Warning,
Success,
Error,
};

View File

@ -652,6 +652,11 @@ namespace PPU_instr
r12, r13, r14, r15, r16, r17, r18, r19, r20, r21,
r22, r23, r24, r25, r26, r27, r28, r29, r30, r31
};
enum
{
cr0, cr1, cr2, cr3, cr4, cr5, cr6, cr7
};
}
namespace implicts
@ -667,20 +672,31 @@ namespace PPU_instr
static auto BCTRL = std::bind(BCCTR, 0x10 | 0x04, 0, 0, 1);
static auto MTCTR = std::bind(MTSPR, (0x1 << 5) | 0x8, std::placeholders::_1);
enum
{
cr0, cr1, cr2, cr3, cr4, cr5, cr6, cr7
};
inline u32 BNE(u32 cr, s32 imm) { return BC(4, 2 | cr << 2, imm, 0, 0); }
inline u32 BEQ(u32 cr, s32 imm) { return BC(12, 2 | cr << 2, imm, 0, 0); }
inline u32 BGT(u32 cr, s32 imm) { return BC(12, 1 | cr << 2, imm, 0, 0); }
inline u32 BNE(s32 imm) { return BNE(0, imm); }
inline u32 BEQ(s32 imm) { return BEQ(0, imm); }
inline u32 BNE(s32 imm) { return BNE(cr0, imm); }
inline u32 BEQ(s32 imm) { return BEQ(cr0, imm); }
inline u32 BGT(s32 imm) { return BGT(cr0, imm); }
inline u32 CMPDI(u32 cr, u32 reg, u32 imm) { return CMPI(cr, 1, reg, imm); }
inline u32 CMPDI(u32 reg, u32 imm) { return CMPDI(cr0, reg, imm); }
inline u32 CMPWI(u32 cr, u32 reg, u32 imm) { return CMPI(cr, 0, reg, imm); }
inline u32 CMPWI(u32 reg, u32 imm) { return CMPWI(cr0, reg, imm); }
inline u32 CMPLDI(u32 cr, u32 reg, u32 imm) { return CMPLI(cr, 1, reg, imm); }
inline u32 CMPLDI(u32 reg, u32 imm) { return CMPLDI(cr0, reg, imm); }
inline u32 CMPLWI(u32 cr, u32 reg, u32 imm) { return CMPLI(cr, 0, reg, imm); }
inline u32 CMPLWI(u32 reg, u32 imm) { return CMPLWI(cr0, reg, imm); }
inline u32 EXTRDI(u32 x, u32 y, u32 n, u32 b) { return RLDICL(x, y, b + n, 64 - b, false); }
inline u32 SRDI(u32 x, u32 y, u32 n) { return RLDICL(x, y, 64 - n, n, false); }
inline u32 CLRLDI(u32 x, u32 y, u32 n) { return RLDICL(x, y, 0, n, false); }
}
using namespace lists;
using namespace implicts;
#undef bind_instr

View File

@ -292,7 +292,7 @@ void hook_ppu_func(vm::ptr<u32> base, u32 pos, u32 size)
if (found)
{
LOG_NOTICE(LOADER, "Function '%s' hooked (addr=0x%x)", sub.name, (base + pos).addr());
LOG_SUCCESS(LOADER, "Function '%s' hooked (addr=0x%x)", sub.name, (base + pos).addr());
sub.found++;
base[pos] = HACK(sub.index | EIF_PERFORM_BLR);
}

View File

@ -21,37 +21,13 @@ Module sys_libc("sys_libc", []()
using namespace PPU_instr;
REG_SUB(sys_libc, "", sys_libc_func::, memcpy,
{ SPET_MASKED_OPCODE, 0x2ba50007, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x78630020, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x78840020, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x7c6b1b78, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x419d0070, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x2c250000, 0xffffffff },
se_op(CMPLDI(cr7, r5, 7)),
se_op(CLRLDI(r3, r3, 32)),
se_op(CLRLDI(r4, r4, 32)),
se_op(MR(r11, r3)),
se_op(BGT(cr7, XXX & 0xff)),
se_op(CMPDI(r5, 0)),
se_opt(MR(r9, r3)),
{ SPET_MASKED_OPCODE, 0x4d820020, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x28a5000f, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x40850024, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x78ace8c2, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x7d8903a6, 0xffffffff },
{ SPET_MASKED_OPCODE, 0xe8e40000, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x38a5fff8, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x38840008, 0xffffffff },
{ SPET_MASKED_OPCODE, 0xf8eb0000, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x396b0008, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x4200ffec, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x2c250000, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x4d820020, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x7ca903a6, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x88040000, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x38840001, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x980b0000, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x396b0001, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x4200fff0, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x4e800020, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x7ce903a6, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x8d04ffff, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x38a5ffff, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x9d0bffff, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x4200fff4, 0xffffffff },
{ SPET_MASKED_OPCODE, 0x48000034, 0xffffffff },
);
});

View File

@ -29,20 +29,22 @@ struct wxWriter : Log::LogListener
wxTextAttr m_color_white;
wxTextAttr m_color_yellow;
wxTextAttr m_color_red;
wxTextAttr m_color_green;
MTRingbuffer<char, BUFFER_MAX_SIZE> messages;
std::atomic<bool> newLog;
bool inited;
wxWriter(wxTextCtrl* p_log, wxTextCtrl* p_tty) :
m_color_white(wxColour(255, 255, 255)) ,
m_color_yellow(wxColour(255, 255, 0)) ,
m_color_red(wxColour(255, 0, 0)) ,
m_log(p_log),
m_tty(p_tty),
newLog(false),
inited(false)
wxWriter(wxTextCtrl* p_log, wxTextCtrl* p_tty)
: m_color_white(wxColour(255, 255, 255))
, m_color_yellow(wxColour(255, 255, 0))
, m_color_red(wxColour(255, 0, 0))
, m_color_green(wxColour(0, 255, 0))
, m_log(p_log)
, m_tty(p_tty)
, newLog(false)
, inited(false)
{
m_log->Bind(EVT_LOG_COMMAND, [this](wxCommandEvent &evt){this->write(evt);});
m_log->Bind(EVT_LOG_COMMAND, [this](wxCommandEvent &evt){ this->write(evt); });
}
wxWriter(wxWriter &other) = delete;
@ -83,6 +85,9 @@ struct wxWriter : Log::LogListener
case Log::Error:
llogcon->SetDefaultStyle(m_color_red);
break;
case Log::Success:
llogcon->SetDefaultStyle(m_color_green);
break;
default:
break;
}

View File

@ -487,8 +487,8 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
cbox_camera_type->Append("USB Video Class 1.1");
cbox_hle_loglvl->Append("All");
cbox_hle_loglvl->Append("Success");
cbox_hle_loglvl->Append("Warnings");
cbox_hle_loglvl->Append("Success");
cbox_hle_loglvl->Append("Errors");
cbox_hle_loglvl->Append("Nothing");