early-access version 1276
This commit is contained in:
parent
cb7b6ecaea
commit
950150dc52
7 changed files with 3 additions and 89 deletions
|
@ -1,7 +1,7 @@
|
||||||
yuzu emulator early access
|
yuzu emulator early access
|
||||||
=============
|
=============
|
||||||
|
|
||||||
This is the source code for early-access 1275.
|
This is the source code for early-access 1276.
|
||||||
|
|
||||||
## Legal Notice
|
## Legal Notice
|
||||||
|
|
||||||
|
|
2
dist/yuzu.desktop
vendored
2
dist/yuzu.desktop
vendored
|
@ -6,7 +6,7 @@ GenericName=Switch Emulator
|
||||||
Comment=Nintendo Switch video game console emulator
|
Comment=Nintendo Switch video game console emulator
|
||||||
Icon=yuzu
|
Icon=yuzu
|
||||||
TryExec=yuzu
|
TryExec=yuzu
|
||||||
Exec=env QT_QPA_PLATFORMTHEME=gtk3 yuzu %f
|
Exec=yuzu %f
|
||||||
Categories=Game;Emulator;Qt;
|
Categories=Game;Emulator;Qt;
|
||||||
MimeType=application/x-nx-nro;application/x-nx-nso;
|
MimeType=application/x-nx-nro;application/x-nx-nso;
|
||||||
Keywords=Switch;Nintendo;
|
Keywords=Switch;Nintendo;
|
|
@ -136,8 +136,6 @@ add_library(common STATIC
|
||||||
math_util.h
|
math_util.h
|
||||||
memory_detect.cpp
|
memory_detect.cpp
|
||||||
memory_detect.h
|
memory_detect.h
|
||||||
memory_hook.cpp
|
|
||||||
memory_hook.h
|
|
||||||
microprofile.cpp
|
microprofile.cpp
|
||||||
microprofile.h
|
microprofile.h
|
||||||
microprofileui.h
|
microprofileui.h
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "common/memory_hook.h"
|
|
||||||
#include "common/virtual_buffer.h"
|
#include "common/virtual_buffer.h"
|
||||||
|
|
||||||
namespace Common {
|
namespace Common {
|
||||||
|
@ -23,23 +22,6 @@ enum class PageType : u8 {
|
||||||
RasterizerCachedMemory,
|
RasterizerCachedMemory,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SpecialRegion {
|
|
||||||
enum class Type {
|
|
||||||
DebugHook,
|
|
||||||
IODevice,
|
|
||||||
} type;
|
|
||||||
|
|
||||||
MemoryHookPointer handler;
|
|
||||||
|
|
||||||
[[nodiscard]] bool operator<(const SpecialRegion& other) const {
|
|
||||||
return std::tie(type, handler) < std::tie(other.type, other.handler);
|
|
||||||
}
|
|
||||||
|
|
||||||
[[nodiscard]] bool operator==(const SpecialRegion& other) const {
|
|
||||||
return std::tie(type, handler) == std::tie(other.type, other.handler);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A (reasonably) fast way of allowing switchable and remappable process address spaces. It loosely
|
* A (reasonably) fast way of allowing switchable and remappable process address spaces. It loosely
|
||||||
* mimics the way a real CPU page table works.
|
* mimics the way a real CPU page table works.
|
||||||
|
|
|
@ -44,27 +44,12 @@ struct Memory::Impl {
|
||||||
MapPages(page_table, base / PAGE_SIZE, size / PAGE_SIZE, target, Common::PageType::Memory);
|
MapPages(page_table, base / PAGE_SIZE, size / PAGE_SIZE, target, Common::PageType::Memory);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapIoRegion(Common::PageTable& page_table, VAddr base, u64 size,
|
|
||||||
Common::MemoryHookPointer mmio_handler) {
|
|
||||||
UNIMPLEMENTED();
|
|
||||||
}
|
|
||||||
|
|
||||||
void UnmapRegion(Common::PageTable& page_table, VAddr base, u64 size) {
|
void UnmapRegion(Common::PageTable& page_table, VAddr base, u64 size) {
|
||||||
ASSERT_MSG((size & PAGE_MASK) == 0, "non-page aligned size: {:016X}", size);
|
ASSERT_MSG((size & PAGE_MASK) == 0, "non-page aligned size: {:016X}", size);
|
||||||
ASSERT_MSG((base & PAGE_MASK) == 0, "non-page aligned base: {:016X}", base);
|
ASSERT_MSG((base & PAGE_MASK) == 0, "non-page aligned base: {:016X}", base);
|
||||||
MapPages(page_table, base / PAGE_SIZE, size / PAGE_SIZE, 0, Common::PageType::Unmapped);
|
MapPages(page_table, base / PAGE_SIZE, size / PAGE_SIZE, 0, Common::PageType::Unmapped);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddDebugHook(Common::PageTable& page_table, VAddr base, u64 size,
|
|
||||||
Common::MemoryHookPointer hook) {
|
|
||||||
UNIMPLEMENTED();
|
|
||||||
}
|
|
||||||
|
|
||||||
void RemoveDebugHook(Common::PageTable& page_table, VAddr base, u64 size,
|
|
||||||
Common::MemoryHookPointer hook) {
|
|
||||||
UNIMPLEMENTED();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool IsValidVirtualAddress(const Kernel::Process& process, const VAddr vaddr) const {
|
bool IsValidVirtualAddress(const Kernel::Process& process, const VAddr vaddr) const {
|
||||||
const auto& page_table = process.PageTable().PageTableImpl();
|
const auto& page_table = process.PageTable().PageTableImpl();
|
||||||
const auto [pointer, type] = page_table.pointers[vaddr >> PAGE_BITS].PointerType();
|
const auto [pointer, type] = page_table.pointers[vaddr >> PAGE_BITS].PointerType();
|
||||||
|
@ -740,25 +725,10 @@ void Memory::MapMemoryRegion(Common::PageTable& page_table, VAddr base, u64 size
|
||||||
impl->MapMemoryRegion(page_table, base, size, target);
|
impl->MapMemoryRegion(page_table, base, size, target);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Memory::MapIoRegion(Common::PageTable& page_table, VAddr base, u64 size,
|
|
||||||
Common::MemoryHookPointer mmio_handler) {
|
|
||||||
impl->MapIoRegion(page_table, base, size, std::move(mmio_handler));
|
|
||||||
}
|
|
||||||
|
|
||||||
void Memory::UnmapRegion(Common::PageTable& page_table, VAddr base, u64 size) {
|
void Memory::UnmapRegion(Common::PageTable& page_table, VAddr base, u64 size) {
|
||||||
impl->UnmapRegion(page_table, base, size);
|
impl->UnmapRegion(page_table, base, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Memory::AddDebugHook(Common::PageTable& page_table, VAddr base, u64 size,
|
|
||||||
Common::MemoryHookPointer hook) {
|
|
||||||
impl->AddDebugHook(page_table, base, size, std::move(hook));
|
|
||||||
}
|
|
||||||
|
|
||||||
void Memory::RemoveDebugHook(Common::PageTable& page_table, VAddr base, u64 size,
|
|
||||||
Common::MemoryHookPointer hook) {
|
|
||||||
impl->RemoveDebugHook(page_table, base, size, std::move(hook));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Memory::IsValidVirtualAddress(const Kernel::Process& process, const VAddr vaddr) const {
|
bool Memory::IsValidVirtualAddress(const Kernel::Process& process, const VAddr vaddr) const {
|
||||||
return impl->IsValidVirtualAddress(process, vaddr);
|
return impl->IsValidVirtualAddress(process, vaddr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "common/memory_hook.h"
|
|
||||||
|
|
||||||
namespace Common {
|
namespace Common {
|
||||||
struct PageTable;
|
struct PageTable;
|
||||||
|
@ -77,17 +76,6 @@ public:
|
||||||
*/
|
*/
|
||||||
void MapMemoryRegion(Common::PageTable& page_table, VAddr base, u64 size, PAddr target);
|
void MapMemoryRegion(Common::PageTable& page_table, VAddr base, u64 size, PAddr target);
|
||||||
|
|
||||||
/**
|
|
||||||
* Maps a region of the emulated process address space as a IO region.
|
|
||||||
*
|
|
||||||
* @param page_table The page table of the emulated process.
|
|
||||||
* @param base The address to start mapping at. Must be page-aligned.
|
|
||||||
* @param size The amount of bytes to map. Must be page-aligned.
|
|
||||||
* @param mmio_handler The handler that backs the mapping.
|
|
||||||
*/
|
|
||||||
void MapIoRegion(Common::PageTable& page_table, VAddr base, u64 size,
|
|
||||||
Common::MemoryHookPointer mmio_handler);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unmaps a region of the emulated process address space.
|
* Unmaps a region of the emulated process address space.
|
||||||
*
|
*
|
||||||
|
@ -97,28 +85,6 @@ public:
|
||||||
*/
|
*/
|
||||||
void UnmapRegion(Common::PageTable& page_table, VAddr base, u64 size);
|
void UnmapRegion(Common::PageTable& page_table, VAddr base, u64 size);
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds a memory hook to intercept reads and writes to given region of memory.
|
|
||||||
*
|
|
||||||
* @param page_table The page table of the emulated process
|
|
||||||
* @param base The starting address to apply the hook to.
|
|
||||||
* @param size The size of the memory region to apply the hook to, in bytes.
|
|
||||||
* @param hook The hook to apply to the region of memory.
|
|
||||||
*/
|
|
||||||
void AddDebugHook(Common::PageTable& page_table, VAddr base, u64 size,
|
|
||||||
Common::MemoryHookPointer hook);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Removes a memory hook from a given range of memory.
|
|
||||||
*
|
|
||||||
* @param page_table The page table of the emulated process.
|
|
||||||
* @param base The starting address to remove the hook from.
|
|
||||||
* @param size The size of the memory region to remove the hook from, in bytes.
|
|
||||||
* @param hook The hook to remove from the specified region of memory.
|
|
||||||
*/
|
|
||||||
void RemoveDebugHook(Common::PageTable& page_table, VAddr base, u64 size,
|
|
||||||
Common::MemoryHookPointer hook);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether or not the supplied address is a valid virtual
|
* Checks whether or not the supplied address is a valid virtual
|
||||||
* address for the given process.
|
* address for the given process.
|
||||||
|
|
|
@ -4,8 +4,6 @@ add_executable(tests
|
||||||
common/fibers.cpp
|
common/fibers.cpp
|
||||||
common/param_package.cpp
|
common/param_package.cpp
|
||||||
common/ring_buffer.cpp
|
common/ring_buffer.cpp
|
||||||
core/arm/arm_test_common.cpp
|
|
||||||
core/arm/arm_test_common.h
|
|
||||||
core/core_timing.cpp
|
core/core_timing.cpp
|
||||||
tests.cpp
|
tests.cpp
|
||||||
video_core/buffer_base.cpp
|
video_core/buffer_base.cpp
|
||||||
|
|
Loading…
Reference in a new issue