summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/core.cpp8
-rw-r--r--src/core/hw/hw.cpp7
-rw-r--r--src/core/hw/lcd.cpp9
-rw-r--r--src/core/memory.cpp41
-rw-r--r--src/core/telemetry_session.cpp5
5 files changed, 1 insertions, 69 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index e5f299f26..ae1eb2430 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -4,7 +4,6 @@
4 4
5#include <memory> 5#include <memory>
6#include <utility> 6#include <utility>
7#include "audio_core/audio_core.h"
8#include "common/logging/log.h" 7#include "common/logging/log.h"
9#include "core/arm/dynarmic/arm_dynarmic.h" 8#include "core/arm/dynarmic/arm_dynarmic.h"
10#include "core/arm/unicorn/arm_unicorn.h" 9#include "core/arm/unicorn/arm_unicorn.h"
@@ -19,7 +18,6 @@
19#include "core/loader/loader.h" 18#include "core/loader/loader.h"
20#include "core/memory_setup.h" 19#include "core/memory_setup.h"
21#include "core/settings.h" 20#include "core/settings.h"
22#include "network/network.h"
23#include "video_core/video_core.h" 21#include "video_core/video_core.h"
24 22
25namespace Core { 23namespace Core {
@@ -156,7 +154,6 @@ System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) {
156 HW::Init(); 154 HW::Init();
157 Kernel::Init(system_mode); 155 Kernel::Init(system_mode);
158 Service::Init(); 156 Service::Init();
159 AudioCore::Init();
160 GDBStub::Init(); 157 GDBStub::Init();
161 158
162 if (!VideoCore::Init(emu_window)) { 159 if (!VideoCore::Init(emu_window)) {
@@ -184,7 +181,6 @@ void System::Shutdown() {
184 181
185 // Shutdown emulation session 182 // Shutdown emulation session
186 GDBStub::Shutdown(); 183 GDBStub::Shutdown();
187 AudioCore::Shutdown();
188 VideoCore::Shutdown(); 184 VideoCore::Shutdown();
189 Service::Shutdown(); 185 Service::Shutdown();
190 Kernel::Shutdown(); 186 Kernel::Shutdown();
@@ -193,10 +189,6 @@ void System::Shutdown() {
193 cpu_core = nullptr; 189 cpu_core = nullptr;
194 app_loader = nullptr; 190 app_loader = nullptr;
195 telemetry_session = nullptr; 191 telemetry_session = nullptr;
196 if (auto room_member = Network::GetRoomMember().lock()) {
197 Network::GameInfo game_info{};
198 room_member->SendGameInfo(game_info);
199 }
200 192
201 LOG_DEBUG(Core, "Shutdown OK"); 193 LOG_DEBUG(Core, "Shutdown OK");
202} 194}
diff --git a/src/core/hw/hw.cpp b/src/core/hw/hw.cpp
index 8499f2ce6..a751b1d62 100644
--- a/src/core/hw/hw.cpp
+++ b/src/core/hw/hw.cpp
@@ -4,8 +4,6 @@
4 4
5#include "common/common_types.h" 5#include "common/common_types.h"
6#include "common/logging/log.h" 6#include "common/logging/log.h"
7#include "core/hw/aes/key.h"
8#include "core/hw/gpu.h"
9#include "core/hw/hw.h" 7#include "core/hw/hw.h"
10#include "core/hw/lcd.h" 8#include "core/hw/lcd.h"
11 9
@@ -30,7 +28,6 @@ inline void Read(T& var, const u32 addr) {
30 case VADDR_GPU + 0xD000: 28 case VADDR_GPU + 0xD000:
31 case VADDR_GPU + 0xE000: 29 case VADDR_GPU + 0xE000:
32 case VADDR_GPU + 0xF000: 30 case VADDR_GPU + 0xF000:
33 GPU::Read(var, addr);
34 break; 31 break;
35 case VADDR_LCD: 32 case VADDR_LCD:
36 LCD::Read(var, addr); 33 LCD::Read(var, addr);
@@ -59,7 +56,6 @@ inline void Write(u32 addr, const T data) {
59 case VADDR_GPU + 0xD000: 56 case VADDR_GPU + 0xD000:
60 case VADDR_GPU + 0xE000: 57 case VADDR_GPU + 0xE000:
61 case VADDR_GPU + 0xF000: 58 case VADDR_GPU + 0xF000:
62 GPU::Write(addr, data);
63 break; 59 break;
64 case VADDR_LCD: 60 case VADDR_LCD:
65 LCD::Write(addr, data); 61 LCD::Write(addr, data);
@@ -86,15 +82,12 @@ void Update() {}
86 82
87/// Initialize hardware 83/// Initialize hardware
88void Init() { 84void Init() {
89 AES::InitKeys();
90 GPU::Init();
91 LCD::Init(); 85 LCD::Init();
92 LOG_DEBUG(HW, "initialized OK"); 86 LOG_DEBUG(HW, "initialized OK");
93} 87}
94 88
95/// Shutdown hardware 89/// Shutdown hardware
96void Shutdown() { 90void Shutdown() {
97 GPU::Shutdown();
98 LCD::Shutdown(); 91 LCD::Shutdown();
99 LOG_DEBUG(HW, "shutdown OK"); 92 LOG_DEBUG(HW, "shutdown OK");
100} 93}
diff --git a/src/core/hw/lcd.cpp b/src/core/hw/lcd.cpp
index 2aa89de18..763ac1c4d 100644
--- a/src/core/hw/lcd.cpp
+++ b/src/core/hw/lcd.cpp
@@ -8,7 +8,6 @@
8#include "core/hw/hw.h" 8#include "core/hw/hw.h"
9#include "core/hw/lcd.h" 9#include "core/hw/lcd.h"
10#include "core/tracer/recorder.h" 10#include "core/tracer/recorder.h"
11#include "video_core/debug_utils/debug_utils.h"
12 11
13namespace LCD { 12namespace LCD {
14 13
@@ -40,14 +39,6 @@ inline void Write(u32 addr, const T data) {
40 } 39 }
41 40
42 g_regs[index] = static_cast<u32>(data); 41 g_regs[index] = static_cast<u32>(data);
43
44 // Notify tracer about the register write
45 // This is happening *after* handling the write to make sure we properly catch all memory reads.
46 if (Pica::g_debug_context && Pica::g_debug_context->recorder) {
47 // addr + GPU VBase - IO VBase + IO PBase
48 Pica::g_debug_context->recorder->RegisterWritten<T>(
49 addr + HW::VADDR_LCD - 0x1EC00000 + 0x10100000, data);
50 }
51} 42}
52 43
53// Explicitly instantiate template functions because we aren't defining this in the header: 44// Explicitly instantiate template functions because we aren't defining this in the header:
diff --git a/src/core/memory.cpp b/src/core/memory.cpp
index 01ec231f6..74a598852 100644
--- a/src/core/memory.cpp
+++ b/src/core/memory.cpp
@@ -4,7 +4,6 @@
4 4
5#include <array> 5#include <array>
6#include <cstring> 6#include <cstring>
7#include "audio_core/audio_core.h"
8#include "common/assert.h" 7#include "common/assert.h"
9#include "common/common_types.h" 8#include "common/common_types.h"
10#include "common/logging/log.h" 9#include "common/logging/log.h"
@@ -311,7 +310,6 @@ u8* GetPhysicalPointer(PAddr address) {
311 target_pointer = vram.data() + offset_into_region; 310 target_pointer = vram.data() + offset_into_region;
312 break; 311 break;
313 case DSP_RAM_PADDR: 312 case DSP_RAM_PADDR:
314 target_pointer = AudioCore::GetDspMemory().data() + offset_into_region;
315 break; 313 break;
316 case FCRAM_PADDR: 314 case FCRAM_PADDR:
317 for (const auto& region : Kernel::memory_regions) { 315 for (const auto& region : Kernel::memory_regions) {
@@ -413,53 +411,16 @@ void RasterizerMarkRegionCached(PAddr start, u64 size, int count_delta) {
413 } 411 }
414} 412}
415 413
416void RasterizerFlushRegion(PAddr start, u64 size) { 414void RasterizerFlushRegion(PAddr start, u64 size) {}
417 if (VideoCore::g_renderer != nullptr) {
418 VideoCore::g_renderer->Rasterizer()->FlushRegion(start, size);
419 }
420}
421 415
422void RasterizerFlushAndInvalidateRegion(PAddr start, u64 size) { 416void RasterizerFlushAndInvalidateRegion(PAddr start, u64 size) {
423 // Since pages are unmapped on shutdown after video core is shutdown, the renderer may be 417 // Since pages are unmapped on shutdown after video core is shutdown, the renderer may be
424 // null here 418 // null here
425 if (VideoCore::g_renderer != nullptr) {
426 VideoCore::g_renderer->Rasterizer()->FlushAndInvalidateRegion(start, size);
427 }
428} 419}
429 420
430void RasterizerFlushVirtualRegion(VAddr start, u64 size, FlushMode mode) { 421void RasterizerFlushVirtualRegion(VAddr start, u64 size, FlushMode mode) {
431 // Since pages are unmapped on shutdown after video core is shutdown, the renderer may be 422 // Since pages are unmapped on shutdown after video core is shutdown, the renderer may be
432 // null here 423 // null here
433 if (VideoCore::g_renderer != nullptr) {
434 VAddr end = start + size;
435
436 auto CheckRegion = [&](VAddr region_start, VAddr region_end) {
437 if (start >= region_end || end <= region_start) {
438 // No overlap with region
439 return;
440 }
441
442 VAddr overlap_start = std::max(start, region_start);
443 VAddr overlap_end = std::min(end, region_end);
444
445 PAddr physical_start = TryVirtualToPhysicalAddress(overlap_start).value();
446 u32 overlap_size = static_cast<u32>(overlap_end - overlap_start);
447
448 auto* rasterizer = VideoCore::g_renderer->Rasterizer();
449 switch (mode) {
450 case FlushMode::Flush:
451 rasterizer->FlushRegion(physical_start, overlap_size);
452 break;
453 case FlushMode::FlushAndInvalidate:
454 rasterizer->FlushAndInvalidateRegion(physical_start, overlap_size);
455 break;
456 }
457 };
458
459 CheckRegion(LINEAR_HEAP_VADDR, LINEAR_HEAP_VADDR_END);
460 CheckRegion(NEW_LINEAR_HEAP_VADDR, NEW_LINEAR_HEAP_VADDR_END);
461 CheckRegion(VRAM_VADDR, VRAM_VADDR_END);
462 }
463} 424}
464 425
465u8 Read8(const VAddr addr) { 426u8 Read8(const VAddr addr) {
diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp
index 560c8af55..4e402bc58 100644
--- a/src/core/telemetry_session.cpp
+++ b/src/core/telemetry_session.cpp
@@ -12,11 +12,6 @@
12#include "core/settings.h" 12#include "core/settings.h"
13#include "core/telemetry_session.h" 13#include "core/telemetry_session.h"
14 14
15#ifdef ENABLE_WEB_SERVICE
16#include "web_service/telemetry_json.h"
17#include "web_service/verify_login.h"
18#endif
19
20namespace Core { 15namespace Core {
21 16
22static const char* CpuVendorToStr(Common::CPUVendor vendor) { 17static const char* CpuVendorToStr(Common::CPUVendor vendor) {