From 705fd7594abc905021a0e4a9e54fc85e8074a5dd Mon Sep 17 00:00:00 2001 From: DrChat Date: Sat, 17 Feb 2018 10:33:34 -0600 Subject: [PATCH] [Docs] Add more notes on the single-page offset --- docs/cpu.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/cpu.md b/docs/cpu.md index ed9708136..d89722182 100644 --- a/docs/cpu.md +++ b/docs/cpu.md @@ -95,7 +95,18 @@ i.e. virtual 0xA0000000 == physical 0x00000000 Unfortunately, the 0xE0000000-0xFFFFFFFF range is unused in Xenia because it maps to physical memory with a single page offset, which is impossible -to do under the Win32 API. +to do under the Win32 API. We can't fake this either, as this offset is +built into games - see the following sequence: + +``` +srwi r9, r10, 20 # r9 = r10 >> 20 +clrlwi r10, r10, 3 # r10 = r10 & 0x1FFFFFFF (physical address) +addi r11, r9, 0x200 +rlwinm r11, r11, 0,19,19 # r11 = r11 & 0x1000 +add r11, r11, r10 # add 1 page to addresses > 0xE0000000 + +# r11 = addess passed to GPU +``` ## Memory Management