summaryrefslogtreecommitdiff
path: root/src/core/hw/gpu.h
diff options
context:
space:
mode:
authorGravatar Tony Wasserka2014-08-03 01:46:47 +0200
committerGravatar Tony Wasserka2014-08-12 13:32:56 +0200
commit7b6a7d7dfb92d7a6d3537ea8b0339c2170d7eb84 (patch)
tree2b005f3358a228136e7711ddac790ed54bb67b1f /src/core/hw/gpu.h
parentGSP: Fix a major regression introduced in ffda035c, due to which no display t... (diff)
downloadyuzu-7b6a7d7dfb92d7a6d3537ea8b0339c2170d7eb84.tar.gz
yuzu-7b6a7d7dfb92d7a6d3537ea8b0339c2170d7eb84.tar.xz
yuzu-7b6a7d7dfb92d7a6d3537ea8b0339c2170d7eb84.zip
Pica/GPU: Change hardware registers to use physical addresses rather than virtual ones.
This cleans up the mess that address reading/writing had become and makes the code a *lot* more sensible. This adds a physical<->virtual address converter to mem_map.h. For further accuracy, we will want to properly extend this to support a wider range of address regions. For now, this makes simply homebrew applications work in a good manner though.
Diffstat (limited to 'src/core/hw/gpu.h')
-rw-r--r--src/core/hw/gpu.h66
1 files changed, 0 insertions, 66 deletions
diff --git a/src/core/hw/gpu.h b/src/core/hw/gpu.h
index 3065da891..d20311a00 100644
--- a/src/core/hw/gpu.h
+++ b/src/core/hw/gpu.h
@@ -249,72 +249,6 @@ static_assert(sizeof(Regs) == 0x1000 * sizeof(u32), "Invalid total size of regis
249 249
250extern Regs g_regs; 250extern Regs g_regs;
251 251
252enum {
253 TOP_ASPECT_X = 0x5,
254 TOP_ASPECT_Y = 0x3,
255
256 TOP_HEIGHT = 240,
257 TOP_WIDTH = 400,
258 BOTTOM_WIDTH = 320,
259
260 // Physical addresses in FCRAM (chosen arbitrarily)
261 PADDR_TOP_LEFT_FRAME1 = 0x201D4C00,
262 PADDR_TOP_LEFT_FRAME2 = 0x202D4C00,
263 PADDR_TOP_RIGHT_FRAME1 = 0x203D4C00,
264 PADDR_TOP_RIGHT_FRAME2 = 0x204D4C00,
265 PADDR_SUB_FRAME1 = 0x205D4C00,
266 PADDR_SUB_FRAME2 = 0x206D4C00,
267 // Physical addresses in FCRAM used by ARM9 applications
268/* PADDR_TOP_LEFT_FRAME1 = 0x20184E60,
269 PADDR_TOP_LEFT_FRAME2 = 0x201CB370,
270 PADDR_TOP_RIGHT_FRAME1 = 0x20282160,
271 PADDR_TOP_RIGHT_FRAME2 = 0x202C8670,
272 PADDR_SUB_FRAME1 = 0x202118E0,
273 PADDR_SUB_FRAME2 = 0x20249CF0,*/
274
275 // Physical addresses in VRAM
276 // TODO: These should just be deduced from the ones above
277 PADDR_VRAM_TOP_LEFT_FRAME1 = 0x181D4C00,
278 PADDR_VRAM_TOP_LEFT_FRAME2 = 0x182D4C00,
279 PADDR_VRAM_TOP_RIGHT_FRAME1 = 0x183D4C00,
280 PADDR_VRAM_TOP_RIGHT_FRAME2 = 0x184D4C00,
281 PADDR_VRAM_SUB_FRAME1 = 0x185D4C00,
282 PADDR_VRAM_SUB_FRAME2 = 0x186D4C00,
283 // Physical addresses in VRAM used by ARM9 applications
284/* PADDR_VRAM_TOP_LEFT_FRAME2 = 0x181CB370,
285 PADDR_VRAM_TOP_RIGHT_FRAME1 = 0x18282160,
286 PADDR_VRAM_TOP_RIGHT_FRAME2 = 0x182C8670,
287 PADDR_VRAM_SUB_FRAME1 = 0x182118E0,
288 PADDR_VRAM_SUB_FRAME2 = 0x18249CF0,*/
289};
290
291/// Framebuffer location
292enum FramebufferLocation {
293 FRAMEBUFFER_LOCATION_UNKNOWN, ///< Framebuffer location is unknown
294 FRAMEBUFFER_LOCATION_FCRAM, ///< Framebuffer is in the GSP heap
295 FRAMEBUFFER_LOCATION_VRAM, ///< Framebuffer is in VRAM
296};
297
298/**
299 * Sets whether the framebuffers are in the GSP heap (FCRAM) or VRAM
300 * @param
301 */
302void SetFramebufferLocation(const FramebufferLocation mode);
303
304/**
305 * Gets a read-only pointer to a framebuffer in memory
306 * @param address Physical address of framebuffer
307 * @return Returns const pointer to raw framebuffer
308 */
309const u8* GetFramebufferPointer(const u32 address);
310
311u32 GetFramebufferAddr(const u32 address);
312
313/**
314 * Gets the location of the framebuffers
315 */
316FramebufferLocation GetFramebufferLocation(u32 address);
317
318template <typename T> 252template <typename T>
319void Read(T &var, const u32 addr); 253void Read(T &var, const u32 addr);
320 254