2019-11-19 10:30:04 +00:00
|
|
|
#pragma once
|
2020-07-31 07:09:18 +00:00
|
|
|
#include "cpu_code_cache.h"
|
2019-12-28 04:04:15 +00:00
|
|
|
#include "cpu_types.h"
|
2019-11-19 10:30:04 +00:00
|
|
|
|
2019-12-28 04:04:15 +00:00
|
|
|
namespace CPU {
|
|
|
|
struct CodeBlockInstruction;
|
|
|
|
|
2020-07-31 07:09:18 +00:00
|
|
|
namespace Recompiler::Thunks {
|
2019-11-19 10:30:04 +00:00
|
|
|
|
2020-07-31 07:09:18 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// Trampolines for calling back from the JIT
|
|
|
|
// Needed because we can't cast member functions to void*...
|
|
|
|
// TODO: Abuse carry flag or something else for exception
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
bool InterpretInstruction();
|
2020-08-19 13:26:57 +00:00
|
|
|
bool InterpretInstructionPGXP();
|
2020-08-29 12:07:33 +00:00
|
|
|
void CheckAndUpdateICache(u32 pc, u32 line_count);
|
2020-07-31 07:09:18 +00:00
|
|
|
|
|
|
|
// Memory access functions for the JIT - MSB is set on exception.
|
2020-08-08 05:15:56 +00:00
|
|
|
u64 ReadMemoryByte(u32 address);
|
|
|
|
u64 ReadMemoryHalfWord(u32 address);
|
|
|
|
u64 ReadMemoryWord(u32 address);
|
|
|
|
u32 WriteMemoryByte(u32 address, u8 value);
|
|
|
|
u32 WriteMemoryHalfWord(u32 address, u16 value);
|
|
|
|
u32 WriteMemoryWord(u32 address, u32 value);
|
2020-07-31 07:09:18 +00:00
|
|
|
|
2020-08-08 06:44:12 +00:00
|
|
|
// Unchecked memory access variants. No alignment or bus exceptions.
|
|
|
|
u32 UncheckedReadMemoryByte(u32 address);
|
|
|
|
u32 UncheckedReadMemoryHalfWord(u32 address);
|
|
|
|
u32 UncheckedReadMemoryWord(u32 address);
|
|
|
|
void UncheckedWriteMemoryByte(u32 address, u8 value);
|
|
|
|
void UncheckedWriteMemoryHalfWord(u32 address, u16 value);
|
|
|
|
void UncheckedWriteMemoryWord(u32 address, u32 value);
|
|
|
|
|
2020-10-18 04:43:55 +00:00
|
|
|
void UpdateFastmemMapping();
|
2020-08-08 06:44:12 +00:00
|
|
|
|
2020-07-31 07:09:18 +00:00
|
|
|
} // namespace Recompiler::Thunks
|
2019-12-28 04:04:15 +00:00
|
|
|
|
2020-11-20 15:56:51 +00:00
|
|
|
} // namespace CPU
|