summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Wasserka <NeoBrainX@gmail.com>2014-07-11 19:01:14 +0200
committerTony Wasserka <NeoBrainX@gmail.com>2014-07-23 00:33:08 +0200
commitbbc6f314eb56ab1cf0a4b800750130de515cdd0f (patch)
treef05690797c7e3a0c95074ee64e64ceb6f0a4a37e
parentGPU: Add display transfer configuration. (diff)
downloadyuzu-bbc6f314eb56ab1cf0a4b800750130de515cdd0f.tar
yuzu-bbc6f314eb56ab1cf0a4b800750130de515cdd0f.tar.gz
yuzu-bbc6f314eb56ab1cf0a4b800750130de515cdd0f.tar.bz2
yuzu-bbc6f314eb56ab1cf0a4b800750130de515cdd0f.tar.lz
yuzu-bbc6f314eb56ab1cf0a4b800750130de515cdd0f.tar.xz
yuzu-bbc6f314eb56ab1cf0a4b800750130de515cdd0f.tar.zst
yuzu-bbc6f314eb56ab1cf0a4b800750130de515cdd0f.zip
-rw-r--r--src/core/hw/gpu.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/core/hw/gpu.cpp b/src/core/hw/gpu.cpp
index a400338b5..e05e1b023 100644
--- a/src/core/hw/gpu.cpp
+++ b/src/core/hw/gpu.cpp
@@ -177,7 +177,25 @@ inline void Write(u32 addr, const T data) {
case Registers::DisplayTriggerTransfer:
g_regs.display_transfer.trigger = data;
if (g_regs.display_transfer.trigger & 1) {
- // TODO: Perform display transfer!
+ u8* source_pointer = Memory::GetPointer(g_regs.display_transfer.GetPhysicalInputAddress());
+ u8* dest_pointer = Memory::GetPointer(g_regs.display_transfer.GetPhysicalOutputAddress());
+
+
+ // TODO: Perform display transfer correctly!
+ for (int y = 0; y < g_regs.display_transfer.output_height; ++y) {
+ // TODO: Copy size is just guesswork!
+ memcpy(dest_pointer + y * g_regs.display_transfer.output_width * 4,
+ source_pointer + y * g_regs.display_transfer.input_width * 4,
+ g_regs.display_transfer.output_width * 4);
+ }
+
+ // Clear previous contents until we implement proper buffer clearing
+ memset(source_pointer, 0x20, g_regs.display_transfer.input_width*g_regs.display_transfer.input_height*4);
+ DEBUG_LOG(GPU, "DisplayTriggerTransfer: %x bytes from %x(%xx%x)-> %x(%xx%x), dst format %x",
+ g_regs.display_transfer.output_height * g_regs.display_transfer.output_width * 4,
+ g_regs.display_transfer.GetPhysicalInputAddress(), (int)g_regs.display_transfer.input_width, (int)g_regs.display_transfer.input_height,
+ g_regs.display_transfer.GetPhysicalOutputAddress(), (int)g_regs.display_transfer.output_width, (int)g_regs.display_transfer.output_height,
+ (int)g_regs.display_transfer.output_format);
}
break;