mirror of
https://github.com/pound-emu/pound.git
synced 2025-12-12 19:36:57 +00:00
Reorganization of source & Clang-Format
This commit is contained in:
parent
3693ac72cb
commit
4d4f0c8490
9 changed files with 28 additions and 36 deletions
2
3rd_Party/rem
vendored
2
3rd_Party/rem
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit cf9cff6039b68239cec122b425eba04f9acfcd9c
|
||||
Subproject commit 2db639ed5715224a42c0d4f3ec070e4c4d6d26ac
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<h1 align="center">
|
||||
<img src="/assets/Logo(1024x1024).webp" height="150px">
|
||||
<img src="/resources/Logo(1024x1024).webp" height="150px">
|
||||
<br><br>
|
||||
<img src="https://img.shields.io/github/stars/pound-emu/pound" width="100">
|
||||
<a href="https://github.com/pound-emu/pound/actions?query=branch%3Amain">
|
||||
|
|
@ -15,7 +15,9 @@
|
|||
|
||||
Join the [**Pound Discord Server**](https://discord.gg/aMmTmKsVC7)!
|
||||
|
||||
**Pound** is an early-stage emulator for the **Nintendo Switch 2**, targeting **Android**, **macOS** (Intel and ARM), **Windows**, and **Linux** (Intel and ARM).
|
||||
**Pound** is an early-stage emulator for the **Nintendo Switch 2**, targeting **Windows**, **Linux** and **macOS** (Intel).
|
||||
|
||||
Future Supports: **Android**, **macOS ARM**
|
||||
|
||||
> [!IMPORTANT]
|
||||
> Pound is still in early development — don't expect miracles.
|
||||
|
|
@ -25,7 +27,7 @@ Initial focus is on implementing the **CPU**, leveraging its architectural simil
|
|||
|
||||
## How to Compile Pound
|
||||
|
||||
See the [**compilation guide**](/docs/compguide.md) for detailed instructions.
|
||||
See the [**compilation guide**](/resources/docs/compguide.md) for detailed instructions.
|
||||
|
||||
|
||||
## Codebase
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
# Assets folder
|
||||
|
||||
dir: /assets/
|
||||
|
||||
This is where all of the assets for the repository and application belong (e.g branding, firmware dumps, images, demo videos)
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
# Firmware dump folder
|
||||
|
||||
dir: /assets/fw/
|
||||
|
||||
This is where your dumped firmware will go (will be used heavily during buildtime)
|
||||
|
|
@ -12,9 +12,13 @@ struct CPU {
|
|||
static constexpr size_t MEM_SIZE = 64 * 1024;
|
||||
u8 memory[MEM_SIZE];
|
||||
|
||||
CPU() { std::memset(memory, 0, MEM_SIZE); }
|
||||
CPU() {
|
||||
std::memset(memory, 0, MEM_SIZE);
|
||||
}
|
||||
|
||||
u64 &x(int i) { return regs[i]; }
|
||||
u64& x(int i) {
|
||||
return regs[i];
|
||||
}
|
||||
|
||||
u8 read_byte(u64 addr) {
|
||||
if (addr >= MEM_SIZE) {
|
||||
|
|
|
|||
|
|
@ -14,22 +14,21 @@
|
|||
|
||||
using JitFunc = void (*)();
|
||||
|
||||
void JIT::translate_and_run(CPU &cpu) {
|
||||
void JIT::translate_and_run(CPU& cpu) {
|
||||
|
||||
// TODO: Create REM Context
|
||||
create_rem_context(nullptr, nullptr, nullptr, nullptr, nullptr);
|
||||
// TODO: Create REM Context
|
||||
create_rem_context(nullptr, nullptr, nullptr, nullptr, nullptr);
|
||||
|
||||
#ifdef WIN32
|
||||
u8 *code = (u8 *)VirtualAlloc(NULL, 64, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
|
||||
u8* code = (u8*)VirtualAlloc(NULL, 64, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
|
||||
#else
|
||||
u8 *code = (u8 *)mmap(nullptr, 64, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANON, -1, 0);
|
||||
u8* code = (u8*)mmap(nullptr, 64, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANON, -1, 0);
|
||||
#endif
|
||||
|
||||
size_t offset = 0;
|
||||
|
||||
// Decode mock instructions from cpu.memory
|
||||
if (cpu.memory[0] == 0x05)
|
||||
{ // MOVZ placeholder
|
||||
if (cpu.memory[0] == 0x05) { // MOVZ placeholder
|
||||
code[offset++] = 0x48; // mov rax, imm64
|
||||
code[offset++] = 0xB8;
|
||||
u64 imm = 5;
|
||||
|
|
@ -37,8 +36,7 @@ create_rem_context(nullptr, nullptr, nullptr, nullptr, nullptr);
|
|||
offset += 8;
|
||||
}
|
||||
|
||||
if (cpu.memory[4] == 0x03)
|
||||
{ // ADD placeholder
|
||||
if (cpu.memory[4] == 0x03) { // ADD placeholder
|
||||
code[offset++] = 0x48; // add rax, imm32
|
||||
code[offset++] = 0x05;
|
||||
u32 addval = 3;
|
||||
|
|
@ -50,8 +48,7 @@ create_rem_context(nullptr, nullptr, nullptr, nullptr, nullptr);
|
|||
|
||||
JitFunc fn = reinterpret_cast<JitFunc>(code);
|
||||
u64 result;
|
||||
asm volatile(
|
||||
"call *%1\n"
|
||||
asm volatile("call *%1\n"
|
||||
"mov %%rax, %0\n"
|
||||
: "=r"(result)
|
||||
: "r"(fn)
|
||||
|
|
|
|||
|
|
@ -4,8 +4,7 @@
|
|||
|
||||
#include "ARM/cpu.h"
|
||||
|
||||
class JIT
|
||||
{
|
||||
class JIT {
|
||||
public:
|
||||
void translate_and_run(CPU &cpu);
|
||||
void translate_and_run(CPU& cpu);
|
||||
};
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
Loading…
Add table
Add a link
Reference in a new issue