mirror of
https://github.com/ran-j/PS2Recomp.git
synced 2026-09-26 08:51:05 -04:00
75d729ce40
* refactor: from guest threads to EE scheduler * feat: bad wip mpeg fix for code veronica * feat: cheap copy from host feat: small perf o vsync tick * feat: added EE clock Hz fix: fix MPEG out of sync with new EE refactor * fix: fix lotr tests * fix: fix cri dtx loading fix: fix wrong mmi instruction translation fix: fix thread info params feat: added EE timers decoder and consumer feat: split SFI and IOP memory to prevent collision and overrides * feat: revert wrong changes * refactor: change GS architecture * feat: IOP emulator refactor: codegen to catch callbacks on mips code feat: added a lot of entries or IOP emulator * feat: analyzer resolve the complete constant-producing sequence with five-instruction backward scan stopped at LUI and therefore * feat: remove recompiled version of GetRomName refactor: split IOP emulator logic feat: added more HLE IOP modules feat: added ps2_path * eat: enhance ELF parser with improved callable entry detection and control flow analysis * feat: update memory hint handling and enhance entry point discovery logic * feat: add SET_GPR_ZE32 macro for zero-extending loads with unsigned semantics * refactor: Refactor PS2 IOP Host Adapter and Memory Management feat: Added PS2Vfs for virtual file system operations, including file opening, reading, writing, and path resolution. feat: Improve VIF1 data processing to handle GIF image packets more efficiently. * feat: added a lot of tests * fix: fix texture caching feat: wip multi version on dbcman * feat: remove LLE IOPs
38 lines
995 B
C++
38 lines
995 B
C++
#pragma once
|
|
|
|
#include <array>
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
#include <cstring>
|
|
|
|
namespace GSMem
|
|
{
|
|
class TexturePageCache
|
|
{
|
|
public:
|
|
static constexpr uint32_t kPageSize = 8192u;
|
|
|
|
void Invalidate() noexcept
|
|
{
|
|
m_pageBase = UINT32_MAX;
|
|
}
|
|
|
|
// byteAddress is the wrapped, swizzled VRAM address. The returned
|
|
// pointer is valid only until the next miss or invalidation.
|
|
const uint8_t* Resolve(const uint8_t* vram, uint32_t byteAddress) noexcept
|
|
{
|
|
const uint32_t pageBase = byteAddress & ~(kPageSize - 1u);
|
|
if (m_pageBase != pageBase)
|
|
{
|
|
std::memcpy(m_bytes.data(), vram + pageBase, kPageSize);
|
|
m_pageBase = pageBase;
|
|
}
|
|
return m_bytes.data() + (byteAddress & (kPageSize - 1u));
|
|
}
|
|
|
|
private:
|
|
alignas(64) std::array<uint8_t, kPageSize> m_bytes{};
|
|
uint32_t m_pageBase = UINT32_MAX;
|
|
};
|
|
}
|