mirror of
https://github.com/shadergz/cosmic-station.git
synced 2025-02-17 03:57:28 +00:00
Virtual memory is now separated into a link
subdirectory
This commit is contained in:
parent
353b5dc6e7
commit
cd49ba2488
@ -3,8 +3,6 @@
|
||||
#include <memory>
|
||||
|
||||
#include <console/virtual_devices.h>
|
||||
#include <console/global_memory.h>
|
||||
|
||||
#include <paper_log.h>
|
||||
|
||||
namespace zenith {
|
||||
|
@ -1,25 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <memory>
|
||||
|
||||
#include <os/host_memory.h>
|
||||
|
||||
namespace console {
|
||||
namespace blocks {
|
||||
struct DoubleRDRAMChips {
|
||||
os::MappedMemory<uint8_t> rdMemoryBlock{static_cast<uint64_t>(1024 * 1024 * 1024 * 32)};
|
||||
};
|
||||
}
|
||||
|
||||
class GlobalMemory {
|
||||
public:
|
||||
GlobalMemory()
|
||||
: memoryBlockInt()
|
||||
{}
|
||||
auto getEEMemories() {
|
||||
return memoryBlockInt.rdMemoryBlock;
|
||||
}
|
||||
blocks::DoubleRDRAMChips memoryBlockInt{};
|
||||
};
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <console/global_memory.h>
|
||||
#include <link/global_memory.h>
|
||||
|
||||
#include <eeiv/ee_engine.h>
|
||||
#include <iop/iop_core.h>
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <functional>
|
||||
#include <impl_types.h>
|
||||
|
||||
namespace eeiv::ext {
|
||||
namespace eeiv::cop {
|
||||
static constexpr uint cop0RegCount1{31};
|
||||
|
||||
union Cop0Status {
|
||||
|
@ -2,13 +2,10 @@
|
||||
|
||||
#include <eeiv/cop0.h>
|
||||
#include <os/neon_types.h>
|
||||
|
||||
#include <console/global_memory.h>
|
||||
#include <link/global_memory.h>
|
||||
|
||||
namespace eeiv {
|
||||
enum EEExecutionMode {
|
||||
// Translate opcode by opcode in an instruction table, accuracy is guaranteed
|
||||
Interpreter,
|
||||
// Increases instruction decoding speed through cache blocks, which is faster
|
||||
// than a simple interpreter
|
||||
CachedInterpreter,
|
||||
@ -24,15 +21,16 @@ namespace eeiv {
|
||||
|
||||
void resetCore();
|
||||
private:
|
||||
EEExecutionMode m_execModel{EEExecutionMode::Interpreter};
|
||||
EEExecutionMode m_execModel{EEExecutionMode::CachedInterpreter};
|
||||
|
||||
std::shared_ptr<console::GlobalMemory> m_glbMemory;
|
||||
os::MappedMemory<uint8_t> m_mainRamBlock;
|
||||
|
||||
union eeRegister {
|
||||
eeRegister()
|
||||
: dw{0, 0} {}
|
||||
os::native128 qw;
|
||||
: dw{0, 0}
|
||||
{}
|
||||
os::machVec128 qw;
|
||||
uint64_t dw[2];
|
||||
uint32_t words[4];
|
||||
uint16_t hw[8];
|
||||
@ -41,6 +39,6 @@ namespace eeiv {
|
||||
eeRegister* m_gprs;
|
||||
|
||||
uint32_t m_eePC{};
|
||||
ext::CoProcessor0 m_copCPU0{};
|
||||
cop::CoProcessor0 m_copCPU0{};
|
||||
};
|
||||
}
|
||||
|
13
app/src/main/cpp/zenith/link/global_memory.h
Normal file
13
app/src/main/cpp/zenith/link/global_memory.h
Normal file
@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <os/host_memory.h>
|
||||
|
||||
namespace console {
|
||||
class GlobalMemory {
|
||||
public:
|
||||
auto getEEMemories() {
|
||||
return mainMemoryBlock;
|
||||
}
|
||||
os::MappedMemory<uint8_t> mainMemoryBlock{static_cast<uint64_t>(1024 * 1024 * 1024 * 32)};
|
||||
};
|
||||
}
|
@ -3,13 +3,13 @@
|
||||
#include <arm_neon.h>
|
||||
|
||||
namespace os {
|
||||
struct native128 {
|
||||
native128(uint64_t qWord0 = 0, uint64_t qWord1 = 0) {
|
||||
struct machVec128 {
|
||||
machVec128(uint64_t qWord0 = 0, uint64_t qWord1 = 0) {
|
||||
vec128 = vsetq_lane_u64(qWord0, vec128, 0);
|
||||
vec128 = vsetq_lane_u64(qWord1, vec128, 1);
|
||||
}
|
||||
|
||||
native128() {
|
||||
machVec128() {
|
||||
uint64x2_t mask{vmovq_n_u64(0xFFFFFFFFFFFFFFFFull)};
|
||||
// The mask will be combined with the first value passed to vsetq_lane_u64 to form
|
||||
// the value to be stored
|
||||
@ -18,7 +18,7 @@ namespace os {
|
||||
|
||||
vec128 = vandq_u64(vec128, mask);
|
||||
}
|
||||
void operator=(const native128& super) {
|
||||
void operator=(const machVec128& super) {
|
||||
vec128 = super.vec128;
|
||||
}
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user