Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ps2xRuntime/include/ps2_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ struct alignas(16) R5900Context

// Reset COP0 registers
cop0_random = 47; // Start at maximum value
// cop0_status = 0x400000; // BEV set, ERL clear, kernel mode
// 0x00400000 = BEV (Boot Exception Vectors).
// 0x00000000 = Normal mode (after BIOS handoff).
cop0_status = 0x00000000;
// Status as the EE kernel leaves it at handoff. IE (bit 0) and EIE
// (bit 16) are separate enables and guest code reads both; libkernel's
// StartThread refuses to run while IE is clear.
cop0_status = 0x00010001; // EIE | IE
cop0_prid = 0x00002e20; // CPU ID for R5900

in_delay_slot = false;
Expand Down
4 changes: 3 additions & 1 deletion ps2xRuntime/src/lib/ps2_runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,9 @@ PS2Runtime::PS2Runtime()
}
#endif

std::memset(&m_cpuContext, 0, sizeof(m_cpuContext));
// Assign rather than memset: R5900Context's constructor zeroes itself and
// then applies the COP0 reset values, which a memset here would discard.
m_cpuContext = R5900Context{};

// R0 is always zero in MIPS
m_cpuContext.r[0] = _mm_set1_epi32(0);
Expand Down