2023-10-03 14:19:17 +00:00
|
|
|
// SPDX-FileCopyrightText: 2019-2023 Connor McLaughlin <stenzek@gmail.com>
|
2022-12-04 11:03:45 +00:00
|
|
|
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
|
|
|
|
|
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
|
|
|
|
2023-10-03 14:19:17 +00:00
|
|
|
namespace CPU::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-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);
|
2021-04-26 11:57:00 +00:00
|
|
|
u32 WriteMemoryByte(u32 address, u32 value);
|
|
|
|
u32 WriteMemoryHalfWord(u32 address, u32 value);
|
2020-08-08 05:15:56 +00:00
|
|
|
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);
|
2021-04-26 11:57:00 +00:00
|
|
|
void UncheckedWriteMemoryByte(u32 address, u32 value);
|
|
|
|
void UncheckedWriteMemoryHalfWord(u32 address, u32 value);
|
2020-08-08 06:44:12 +00:00
|
|
|
void UncheckedWriteMemoryWord(u32 address, u32 value);
|
|
|
|
|
2023-10-03 14:19:17 +00:00
|
|
|
} // namespace CPU::Recompiler::Thunks
|