summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar bunnei2014-04-27 12:41:25 -0400
committerGravatar bunnei2014-04-27 12:41:25 -0400
commita6c925112a4e97feb21a8ae577f2993d0617cb1f (patch)
tree7f2a8c71696400e0b6e0568c7e0da51add715044 /src/core
parentadded helper functions to mem_map to convert physical addresses to virtual ad... (diff)
downloadyuzu-a6c925112a4e97feb21a8ae577f2993d0617cb1f.tar.gz
yuzu-a6c925112a4e97feb21a8ae577f2993d0617cb1f.tar.xz
yuzu-a6c925112a4e97feb21a8ae577f2993d0617cb1f.zip
hackish but working way to set the framebuffer location to VRAM (used in ARM11 demos tested thus far, e.g. yeti3DS)
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/gsp.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/core/hle/service/gsp.cpp b/src/core/hle/service/gsp.cpp
index 24e9f18dc..88c1f1a0f 100644
--- a/src/core/hle/service/gsp.cpp
+++ b/src/core/hle/service/gsp.cpp
@@ -23,8 +23,8 @@ enum {
23 23
24/// Read a GSP GPU hardware register 24/// Read a GSP GPU hardware register
25void ReadHWRegs(Service::Interface* self) { 25void ReadHWRegs(Service::Interface* self) {
26 static const u32 framebuffer_1[] = {LCD::VRAM_TOP_LEFT_FRAME1, LCD::VRAM_TOP_RIGHT_FRAME1}; 26 static const u32 framebuffer_1[] = {LCD::PADDR_VRAM_TOP_LEFT_FRAME1, LCD::PADDR_VRAM_TOP_RIGHT_FRAME1};
27 static const u32 framebuffer_2[] = {LCD::VRAM_TOP_LEFT_FRAME2, LCD::VRAM_TOP_RIGHT_FRAME2}; 27 static const u32 framebuffer_2[] = {LCD::PADDR_VRAM_TOP_LEFT_FRAME2, LCD::PADDR_VRAM_TOP_RIGHT_FRAME2};
28 28
29 u32* cmd_buff = (u32*)HLE::GetPointer(HLE::CMD_BUFFER_ADDR + Service::kCommandHeaderOffset); 29 u32* cmd_buff = (u32*)HLE::GetPointer(HLE::CMD_BUFFER_ADDR + Service::kCommandHeaderOffset);
30 u32 reg_addr = cmd_buff[1]; 30 u32 reg_addr = cmd_buff[1];
@@ -33,14 +33,20 @@ void ReadHWRegs(Service::Interface* self) {
33 33
34 switch (reg_addr) { 34 switch (reg_addr) {
35 35
36 // NOTE: Calling SetFramebufferLocation here is a hack... Not sure the correct way yet to set
37 // whether the framebuffers should be in VRAM or GSP heap, but from what I understand, if the
38 // user application is reading from either of these registers, then its going to be in VRAM.
39
36 // Top framebuffer 1 addresses 40 // Top framebuffer 1 addresses
37 case REG_FRAMEBUFFER_1: 41 case REG_FRAMEBUFFER_1:
42 LCD::SetFramebufferLocation(LCD::FRAMEBUFFER_LOCATION_VRAM);
38 memcpy(dst, framebuffer_1, size); 43 memcpy(dst, framebuffer_1, size);
39 break; 44 break;
40 45
41 // Top framebuffer 2 addresses 46 // Top framebuffer 2 addresses
42 case REG_FRAMEBUFFER_2: 47 case REG_FRAMEBUFFER_2:
43 memcpy(dst, framebuffer_1, size); 48 LCD::SetFramebufferLocation(LCD::FRAMEBUFFER_LOCATION_VRAM);
49 memcpy(dst, framebuffer_2, size);
44 break; 50 break;
45 51
46 default: 52 default: