diff options
| author | 2014-07-11 19:01:14 +0200 | |
|---|---|---|
| committer | 2014-07-23 00:33:08 +0200 | |
| commit | bbc6f314eb56ab1cf0a4b800750130de515cdd0f (patch) | |
| tree | f05690797c7e3a0c95074ee64e64ceb6f0a4a37e /src/core/hw/gpu.cpp | |
| parent | GPU: Add display transfer configuration. (diff) | |
| download | yuzu-bbc6f314eb56ab1cf0a4b800750130de515cdd0f.tar.gz yuzu-bbc6f314eb56ab1cf0a4b800750130de515cdd0f.tar.xz yuzu-bbc6f314eb56ab1cf0a4b800750130de515cdd0f.zip | |
GPU: Properly implement display transfers.
Diffstat (limited to 'src/core/hw/gpu.cpp')
| -rw-r--r-- | src/core/hw/gpu.cpp | 20 |
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) { | |||
| 177 | case Registers::DisplayTriggerTransfer: | 177 | case Registers::DisplayTriggerTransfer: |
| 178 | g_regs.display_transfer.trigger = data; | 178 | g_regs.display_transfer.trigger = data; |
| 179 | if (g_regs.display_transfer.trigger & 1) { | 179 | if (g_regs.display_transfer.trigger & 1) { |
| 180 | // TODO: Perform display transfer! | 180 | u8* source_pointer = Memory::GetPointer(g_regs.display_transfer.GetPhysicalInputAddress()); |
| 181 | u8* dest_pointer = Memory::GetPointer(g_regs.display_transfer.GetPhysicalOutputAddress()); | ||
| 182 | |||
| 183 | |||
| 184 | // TODO: Perform display transfer correctly! | ||
| 185 | for (int y = 0; y < g_regs.display_transfer.output_height; ++y) { | ||
| 186 | // TODO: Copy size is just guesswork! | ||
| 187 | memcpy(dest_pointer + y * g_regs.display_transfer.output_width * 4, | ||
| 188 | source_pointer + y * g_regs.display_transfer.input_width * 4, | ||
| 189 | g_regs.display_transfer.output_width * 4); | ||
| 190 | } | ||
| 191 | |||
| 192 | // Clear previous contents until we implement proper buffer clearing | ||
| 193 | memset(source_pointer, 0x20, g_regs.display_transfer.input_width*g_regs.display_transfer.input_height*4); | ||
| 194 | DEBUG_LOG(GPU, "DisplayTriggerTransfer: %x bytes from %x(%xx%x)-> %x(%xx%x), dst format %x", | ||
| 195 | g_regs.display_transfer.output_height * g_regs.display_transfer.output_width * 4, | ||
| 196 | g_regs.display_transfer.GetPhysicalInputAddress(), (int)g_regs.display_transfer.input_width, (int)g_regs.display_transfer.input_height, | ||
| 197 | g_regs.display_transfer.GetPhysicalOutputAddress(), (int)g_regs.display_transfer.output_width, (int)g_regs.display_transfer.output_height, | ||
| 198 | (int)g_regs.display_transfer.output_format); | ||
| 181 | } | 199 | } |
| 182 | break; | 200 | break; |
| 183 | 201 | ||