Merge branch 'main' into eggXfb

This commit is contained in:
Elijah Thomas
2024-05-05 12:47:02 -04:00
committed by GitHub
17 changed files with 939 additions and 91 deletions
+6 -2
View File
@@ -76,7 +76,9 @@ d/d_heap.cpp:
.text start:0x80054B00 end:0x80054F30
.ctors start:0x804DB680 end:0x804DB684
.rodata start:0x804DE008 end:0x804DE188
.sbss start:0x805751A8 end:0x805751D0
.data start:0x8050D440 end:0x8050D458
.sbss start:0x805751A8 end:0x805751CC
.bss start:0x80597740 end:0x80597758
d/d_main.cpp:
.text start:0x80054F30 end:0x80055170
@@ -311,11 +313,13 @@ egg/core/eggStream.cpp:
egg/core/eggAllocator.cpp:
.text start:0x804952D0 end:0x804953F0
.data start:0x8056E8D0 end:0x8056E8E8
.sdata2 start:0x8057F2F0 end:0x8057F2F8
egg/core/eggHeap.cpp:
.text start:0x804953F0 end:0x80495AB0
.data start:0x8056E8E8 end:0x8056E980
.sbss start:0x80576740 end:0x80576770
.sdata start:0x80574ED8 end:0x80574EE8
.sbss start:0x80576740 end:0x8057676C
.bss start:0x80673AE8 end:0x80673B10
egg/core/eggExpHeap.cpp:
+48 -48
View File
@@ -2212,8 +2212,8 @@ fn_80054550 = .text:0x80054550; // type:function size:0x31C
fn_80054870 = .text:0x80054870; // type:function size:0x25C
fn_80054AD0 = .text:0x80054AD0; // type:function size:0x10
fn_80054AE0 = .text:0x80054AE0; // type:function size:0x14
fn_80054B00 = .text:0x80054B00; // type:function size:0x40
fn_80054B40 = .text:0x80054B40; // type:function size:0x20
__dt__14dHeapAllocatorFv = .text:0x80054B00; // type:function size:0x40
onAlloc__14dHeapAllocatorFPQ23EGG12HeapAllocArg = .text:0x80054B40; // type:function size:0x20
init__5dHeapFPCcUlPQ23EGG4Heap = .text:0x80054B60; // type:function size:0x64
createWork1Heap__5dHeapFUlPQ23EGG4Heap = .text:0x80054BD0; // type:function size:0x18
createWork2Heap__5dHeapFUlPQ23EGG4Heap = .text:0x80054BF0; // type:function size:0x18
@@ -2224,15 +2224,15 @@ createLayoutEx2Heap__5dHeapFUlPQ23EGG4Heap = .text:0x80054C70; // type:function
createLayoutResHeap__5dHeapFUlPQ23EGG4Heap = .text:0x80054C90; // type:function size:0x18
createFontHeap__5dHeapFUlPQ23EGG4Heap = .text:0x80054CB0; // type:function size:0x18
createHBMHeap__5dHeapFUlPQ23EGG4Heap = .text:0x80054CD0; // type:function size:0x18
fn_80054CF0 = .text:0x80054CF0; // type:function size:0x88
fn_80054D80 = .text:0x80054D80; // type:function size:0x98
fn_80054E20 = .text:0x80054E20; // type:function size:0x88
fn_80054EB0 = .text:0x80054EB0; // type:function size:0x4
initCallbacks__14dHeapAllocatorFv = .text:0x80054CF0; // type:function size:0x88
allocCallback__18dHeapAllocatorBaseFPQ23EGG12HeapAllocArg = .text:0x80054D80; // type:function size:0x98
freeCallback__18dHeapAllocatorBaseFPQ23EGG11HeapFreeArg = .text:0x80054E20; // type:function size:0x88
onFree__18dHeapAllocatorBaseFPQ23EGG11HeapFreeArg = .text:0x80054EB0; // type:function size:0x4
__nw__FUl = .text:0x80054EC0; // type:function size:0xC
fn_80054ED0 = .text:0x80054ED0; // type:function size:0xC
__nwa__FUl = .text:0x80054ED0; // type:function size:0xC
__dl__FPv = .text:0x80054EE0; // type:function size:0x8
fn_80054EF0 = .text:0x80054EF0; // type:function size:0x8
fn_80054F00 = .text:0x80054F00; // type:function size:0x30
__dla__FPv = .text:0x80054EF0; // type:function size:0x8
__sinit_\d_heap_cpp = .text:0x80054F00; // type:function size:0x30
fn_80054F30 = .text:0x80054F30; // type:function size:0x4
fn_80054F40 = .text:0x80054F40; // type:function size:0x4
fn_80054F50 = .text:0x80054F50; // type:function size:0x38
@@ -21996,9 +21996,9 @@ fn_803AA830 = .text:0x803AA830; // type:function size:0x18
BATConfig = .text:0x803AA850; // type:function size:0x120 scope:local
fn_803AA970 = .text:0x803AA970; // type:function size:0x44
__OSInitMemoryProtection = .text:0x803AA9C0; // type:function size:0xCC scope:global
fn_803AAA90 = .text:0x803AAA90; // type:function size:0x38
fn_803AAAD0 = .text:0x803AAAD0; // type:function size:0xDC
fn_803AABB0 = .text:0x803AABB0; // type:function size:0xC8
OSInitMutex = .text:0x803AAA90; // type:function size:0x38
OSLockMutex = .text:0x803AAAD0; // type:function size:0xDC
OSUnlockMutex = .text:0x803AABB0; // type:function size:0xC8
fn_803AAC80 = .text:0x803AAC80; // type:function size:0x6C
fn_803AACF0 = .text:0x803AACF0; // type:function size:0xBC
fn_803AADB0 = .text:0x803AADB0; // type:function size:0x6C
@@ -22146,7 +22146,7 @@ VISetPreRetraceCallback = .text:0x803B3E50; // type:function size:0x44
fn_803B3EA0 = .text:0x803B3EA0; // type:function size:0x44
fn_803B3EF0 = .text:0x803B3EF0; // type:function size:0x118
fn_803B4010 = .text:0x803B4010; // type:function size:0x200
fn_803B4210 = .text:0x803B4210; // type:function size:0x548
VIInit = .text:0x803B4210; // type:function size:0x548
VIWaitForRetrace = .text:0x803B4760; // type:function size:0x54
fn_803B47C0 = .text:0x803B47C0; // type:function size:0x2A8
fn_803B4A70 = .text:0x803B4A70; // type:function size:0xE0
@@ -22161,7 +22161,7 @@ VIGetRetraceCount = .text:0x803B5940; // type:function size:0x8
fn_803B5950 = .text:0x803B5950; // type:function size:0x9C
fn_803B59F0 = .text:0x803B59F0; // type:function size:0x90
VIGetTvFormat = .text:0x803B5A80; // type:function size:0x60 scope:global
fn_803B5AE0 = .text:0x803B5AE0; // type:function size:0x3C
VIGetDTVStatus = .text:0x803B5AE0; // type:function size:0x3C
fn_803B5B20 = .text:0x803B5B20; // type:function size:0x234
fn_803B5D60 = .text:0x803B5D60; // type:function size:0x54
fn_803B5DC0 = .text:0x803B5DC0; // type:function size:0xF8
@@ -22562,7 +22562,7 @@ fn_803CC1F0 = .text:0x803CC1F0; // type:function size:0x14C
fn_803CC340 = .text:0x803CC340; // type:function size:0x1C0
fn_803CC500 = .text:0x803CC500; // type:function size:0x16C
fn_803CC670 = .text:0x803CC670; // type:function size:0x140
fn_803CC7B0 = .text:0x803CC7B0; // type:function size:0x18C
MEMFindContainHeap = .text:0x803CC7B0; // type:function size:0x18C
fn_803CC940 = .text:0x803CC940; // type:function size:0x22C
fn_803CCB70 = .text:0x803CCB70; // type:function size:0xDC
fn_803CCC50 = .text:0x803CCC50; // type:function size:0xC8
@@ -22588,7 +22588,7 @@ fn_803CDA40 = .text:0x803CDA40; // type:function size:0x84
fn_803CDAD0 = .text:0x803CDAD0; // type:function size:0xD0
fn_803CDBA0 = .text:0x803CDBA0; // type:function size:0x10
fn_803CDBB0 = .text:0x803CDBB0; // type:function size:0x8
fn_803CDBC0 = .text:0x803CDBC0; // type:function size:0x10
MEMAllocFromAllocator = .text:0x803CDBC0; // type:function size:0x10
fn_803CDBD0 = .text:0x803CDBD0; // type:function size:0x10
fn_803CDBE0 = .text:0x803CDBE0; // type:function size:0x1C
fn_803CDC00 = .text:0x803CDC00; // type:function size:0x18
@@ -22731,12 +22731,12 @@ fn_803D5E60 = .text:0x803D5E60; // type:function size:0x104
fn_803D5F70 = .text:0x803D5F70; // type:function size:0xC
fn_803D5F80 = .text:0x803D5F80; // type:function size:0x21C
fn_803D61A0 = .text:0x803D61A0; // type:function size:0x338
fn_803D64E0 = .text:0x803D64E0; // type:function size:0x54
SCGetAspectRatio = .text:0x803D64E0; // type:function size:0x54
fn_803D6540 = .text:0x803D6540; // type:function size:0x74
fn_803D65C0 = .text:0x803D65C0; // type:function size:0x54
SCGetEuRgb60Mode = .text:0x803D65C0; // type:function size:0x54
fn_803D6620 = .text:0x803D6620; // type:function size:0xC
SCGetLanguage = .text:0x803D6630; // type:function size:0x6C scope:global
fn_803D66A0 = .text:0x803D66A0; // type:function size:0x54
SCGetProgressiveMode = .text:0x803D66A0; // type:function size:0x54
fn_803D6700 = .text:0x803D6700; // type:function size:0x54
fn_803D6760 = .text:0x803D6760; // type:function size:0x54
fn_803D67C0 = .text:0x803D67C0; // type:function size:0x40
@@ -26184,12 +26184,12 @@ getUncompressedSize__Q23EGG14StreamDecompRLFPCv = .text:0x80495290; // type:func
getHeaderSize__Q23EGG14StreamDecompRLFv = .text:0x804952A0; // type:function size:0x8
getUncompressedSize__Q23EGG14StreamDecompLZFPCv = .text:0x804952B0; // type:function size:0x8
getHeaderSize__Q23EGG14StreamDecompLZFv = .text:0x804952C0; // type:function size:0x8
egg_allocator_pfAlloc = .text:0x804952D0; // type:function size:0x1C
egg_allocator_pfFree = .text:0x804952F0; // type:function size:0x14
MEMInitAllocatorForHeap = .text:0x80495310; // type:function size:0x1C
__ct__Q23EGG9AllocatorFPQ23EGG4Heapl = .text:0x80495330; // type:function size:0x50
MEM_AllocFor_Heap__FP12MEMAllocatorUi = .text:0x804952D0; // type:function size:0x1C scope:local
MEM_FreeFor_Heap__FP12MEMAllocatorPv = .text:0x804952F0; // type:function size:0x14 scope:local
MEMInitAllocatorFor_Heap__FP12MEMAllocatoriPv = .text:0x80495310; // type:function size:0x1C
__ct__Q23EGG9AllocatorFPQ23EGG4Heapi = .text:0x80495330; // type:function size:0x50
__dt__Q23EGG9AllocatorFv = .text:0x80495380; // type:function size:0x40
alloc__Q23EGG9AllocatorFUl = .text:0x804953C0; // type:function size:0x14
alloc__Q23EGG9AllocatorFUi = .text:0x804953C0; // type:function size:0x14
free__Q23EGG9AllocatorFPv = .text:0x804953E0; // type:function size:0x10
initialize__Q23EGG4HeapFv = .text:0x804953F0; // type:function size:0x40
__ct__Q23EGG4HeapFP12MEMiHeapHead = .text:0x80495430; // type:function size:0x90
@@ -26204,12 +26204,12 @@ dump__Q23EGG4HeapFv = .text:0x804958A0; // type:function size:0x4
dumpAll__Q23EGG4HeapFv = .text:0x804958B0; // type:function size:0xEC
becomeCurrentHeap__Q23EGG4HeapFv = .text:0x804959A0; // type:function size:0x58
_becomeCurrentHeapWithoutLock__Q23EGG4HeapFv = .text:0x80495A00; // type:function size:0x3C
initAllocator__Q23EGG4HeapFPQ23EGG9Allocatorl = .text:0x80495A40; // type:function size:0x14
initAllocator__Q23EGG4HeapFPQ23EGG9Allocatori = .text:0x80495A40; // type:function size:0x14
__nw__FUlPv = .text:0x80495A60; // type:function size:0x8
__nw__FUlPQ23EGG4HeapUi = .text:0x80495A70; // type:function size:0x10
__nwa__FUl = .text:0x80495A80; // type:function size:0x10
__nwa__FUlUi = .text:0x80495A90; // type:function size:0x8
__nwa__FUlPQ23EGG4HeapUi = .text:0x80495AA0; // type:function size:0x10
__nw__FUlPQ23EGG4Heapi = .text:0x80495A70; // type:function size:0x10
__nw__FUlPQ23EGG9Allocator = .text:0x80495A80; // type:function size:0x10
__nwa__FUli = .text:0x80495A90; // type:function size:0x8
__nwa__FUlPQ23EGG4Heapi = .text:0x80495AA0; // type:function size:0x10
__ct__Q23EGG7ExpHeapFP12MEMiHeapHead = .text:0x80495AB0; // type:function size:0x3C
__dt__Q23EGG7ExpHeapFv = .text:0x80495AF0; // type:function size:0x74
create__Q23EGG7ExpHeapFPvUlUs = .text:0x80495B70; // type:function size:0xB8
@@ -26301,7 +26301,7 @@ initialize__Q23EGG5VideoFP16_GXRenderModeObjPCQ33EGG5Video16RenderModeObjSet = .
configure__Q23EGG5VideoFP16_GXRenderModeObjPCQ33EGG5Video16RenderModeObjSet = .text:0x804986F0; // type:function size:0x104
getTickPerVRetrace__Q23EGG5VideoFUi = .text:0x80498800; // type:function size:0x60
getTickPerVRetrace__Q23EGG5VideoFv = .text:0x80498860; // type:function size:0x24
getStandardRenderModeObj__Q23EGG5VideoFv = .text:0x80498890; // type:function size:0x148
getStandardRenderModeObj__Q23EGG5VideoFPCQ33EGG5Video16RenderModeObjSet = .text:0x80498890; // type:function size:0x148
init__Q23EGG3XfbFUsUsPQ23EGG4Heap = .text:0x804989E0; // type:function size:0x74
__ct__Q23EGG3XfbFPQ23EGG4Heap = .text:0x80498A60; // type:function size:0x64
calcBufferSize__Q23EGG3XfbFUsUs = .text:0x80498AD0; // type:function size:0x14
@@ -30707,7 +30707,7 @@ lbl_8050D37C = .data:0x8050D37C; // type:object size:0x24
lbl_8050D3A0 = .data:0x8050D3A0; // type:object size:0x10 data:string
lbl_8050D3B0 = .data:0x8050D3B0; // type:object size:0x14
lbl_8050D3C4 = .data:0x8050D3C4; // type:object size:0x7C
lbl_8050D440 = .data:0x8050D440; // type:object size:0x18
__vt__14dHeapAllocator = .data:0x8050D440; // type:object size:0x18
lbl_8050D458 = .data:0x8050D458; // type:object size:0xC data:string
lbl_8050D464 = .data:0x8050D464; // type:object size:0x10
lbl_8050D474 = .data:0x8050D474; // type:object size:0x10
@@ -37094,9 +37094,9 @@ lbl_8056E870 = .data:0x8056E870; // type:object size:0x18
lbl_8056E888 = .data:0x8056E888; // type:object size:0x18
lbl_8056E8A0 = .data:0x8056E8A0; // type:object size:0x18
lbl_8056E8B8 = .data:0x8056E8B8; // type:object size:0x18
lbl_8056E8D0 = .data:0x8056E8D0; // type:object size:0x18
__vt__Q23EGG9Allocator = .data:0x8056E8D0; // type:object size:0x14
lbl_8056E8E8 = .data:0x8056E8E8; // type:object size:0x68
lbl_8056E950 = .data:0x8056E950; // type:object size:0x30
__vt__Q23EGG4Heap = .data:0x8056E950; // type:object size:0x30
lbl_8056E980 = .data:0x8056E980; // type:object size:0x10
lbl_8056E990 = .data:0x8056E990; // type:object size:0x10
lbl_8056E9A0 = .data:0x8056E9A0; // type:object size:0x30
@@ -39735,7 +39735,7 @@ layoutExHeap__5dHeap = .sbss:0x805751B8; // type:object size:0x4 data:4byte
layoutEx2Heap__5dHeap = .sbss:0x805751BC; // type:object size:0x4 data:4byte
layoutResHeap__5dHeap = .sbss:0x805751C0; // type:object size:0x4 data:4byte
fontHeap__5dHeap = .sbss:0x805751C4; // type:object size:0x4 data:4byte
HBMHeap__5dHeap = .sbss:0x805751C8; // type:object size:0x8 data:4byte
HBMHeap__5dHeap = .sbss:0x805751C8; // type:object size:0x4 data:4byte
lbl_805751D0 = .sbss:0x805751D0; // type:object size:0x8 data:4byte
lbl_805751D8 = .sbss:0x805751D8; // type:object size:0x4 data:4byte
lbl_805751DC = .sbss:0x805751DC; // type:object size:0x4 data:4byte
@@ -40880,16 +40880,16 @@ lbl_80576728 = .sbss:0x80576728; // type:object size:0x8 data:byte
lbl_80576730 = .sbss:0x80576730; // type:object size:0x8 data:byte
lbl_80576738 = .sbss:0x80576738; // type:object size:0x8 data:4byte
sCurrentHeap__Q23EGG4Heap = .sbss:0x80576740; // type:object size:0x4 data:4byte
lbl_80576744 = .sbss:0x80576744; // type:object size:0x4 data:4byte
lbl_80576748 = .sbss:0x80576748; // type:object size:0x4 data:4byte
lbl_8057674C = .sbss:0x8057674C; // type:object size:0x4 data:4byte
lbl_80576750 = .sbss:0x80576750; // type:object size:0x4 data:4byte
lbl_80576754 = .sbss:0x80576754; // type:object size:0x4 data:4byte
lbl_80576758 = .sbss:0x80576758; // type:object size:0x4 data:4byte
lbl_8057675C = .sbss:0x8057675C; // type:object size:0x4 data:4byte
lbl_80576760 = .sbss:0x80576760; // type:object size:0x4 data:4byte
lbl_80576764 = .sbss:0x80576764; // type:object size:0x4 data:4byte
lbl_80576768 = .sbss:0x80576768; // type:object size:0x8 data:4byte
sIsHeapListInitialized__Q23EGG4Heap = .sbss:0x80576744; // type:object size:0x4 data:4byte
sAllocatableHeap__Q23EGG4Heap = .sbss:0x80576748; // type:object size:0x4 data:4byte
sErrorCallback__Q23EGG4Heap = .sbss:0x8057674C; // type:object size:0x4 data:4byte
sAllocCallback__Q23EGG4Heap = .sbss:0x80576750; // type:object size:0x4 data:4byte
sFreeCallback__Q23EGG4Heap = .sbss:0x80576754; // type:object size:0x4 data:4byte
sErrorCallbackArg__Q23EGG4Heap = .sbss:0x80576758; // type:object size:0x4 data:4byte
sAllocCallbackArg__Q23EGG4Heap = .sbss:0x8057675C; // type:object size:0x4 data:4byte
sFreeCallbackArg__Q23EGG4Heap = .sbss:0x80576760; // type:object size:0x4 data:4byte
sCreateCallback__Q23EGG4Heap = .sbss:0x80576764; // type:object size:0x4 data:4byte
sDestroyCallback__Q23EGG4Heap = .sbss:0x80576768; // type:object size:0x4 data:4byte
sOldSwitchThreadCallback__Q23EGG6Thread = .sbss:0x80576770; // type:object size:0x4 data:4byte
lbl_80576778 = .sbss:0x80576778; // type:object size:0x8 data:4byte
mConfigData__Q23EGG10BaseSystem = .sbss:0x80576780; // type:object size:0x4 data:4byte
@@ -47590,7 +47590,7 @@ lbl_8057F2DC = .sdata2:0x8057F2DC; // type:object size:0x4 data:float
lbl_8057F2E0 = .sdata2:0x8057F2E0; // type:object size:0x4 data:float
lbl_8057F2E4 = .sdata2:0x8057F2E4; // type:object size:0x4 data:float
lbl_8057F2E8 = .sdata2:0x8057F2E8; // type:object size:0x8 data:float
lbl_8057F2F0 = .sdata2:0x8057F2F0; // type:object size:0x8
eggAllocatorFuncs = .sdata2:0x8057F2F0; // type:object size:0x8 scope:local
lbl_8057F2F8 = .sdata2:0x8057F2F8; // type:object size:0x4 data:float
lbl_8057F300 = .sdata2:0x8057F300; // type:object size:0x8 data:double
lbl_8057F308 = .sdata2:0x8057F308; // type:object size:0x4 data:float
@@ -48129,7 +48129,7 @@ lbl_805975C0 = .bss:0x805975C0; // type:object size:0x48
lbl_80597608 = .bss:0x80597608; // type:object size:0x10
lbl_80597618 = .bss:0x80597618; // type:object size:0xA8
lbl_805976C0 = .bss:0x805976C0; // type:object size:0x80 data:byte
lbl_80597740 = .bss:0x80597740; // type:object size:0x18 data:4byte
sAllocator__14dHeapAllocator = .bss:0x80597740; // type:object size:0x18 data:4byte
lbl_80597758 = .bss:0x80597758; // type:object size:0x318
lbl_80597A70 = .bss:0x80597A70; // type:object size:0x10
lbl_80597A80 = .bss:0x80597A80; // type:object size:0x8B70 data:float
@@ -49345,8 +49345,8 @@ lbl_80673A8C = .bss:0x80673A8C; // type:object size:0x1C data:byte
lbl_80673AA8 = .bss:0x80673AA8; // type:object size:0x20 data:float
lbl_80673AC8 = .bss:0x80673AC8; // type:object size:0x10
lbl_80673AD8 = .bss:0x80673AD8; // type:object size:0x10
lbl_80673AE8 = .bss:0x80673AE8; // type:object size:0x10
lbl_80673AF8 = .bss:0x80673AF8; // type:object size:0x18
sHeapList__Q23EGG4Heap = .bss:0x80673AE8; // type:object size:0xC
sRootMutex__Q23EGG4Heap = .bss:0x80673AF8; // type:object size:0x18
sThreadList__Q23EGG6Thread = .bss:0x80673B10; // type:object size:0xC
clear_z_tobj__29@unnamed@eggAsyncDisplay_cpp@ = .bss:0x80673B20; // type:object size:0x20 scope:local
lbl_80673B40 = .bss:0x80673B40; // type:object size:0x10C0 data:4byte
+4 -3
View File
@@ -330,7 +330,7 @@ config.libs = [
Object(Matching, "nw4r/ut/ut_list.cpp"),
Object(Matching, "nw4r/ut/ut_LinkList.cpp"),
Object(Matching, "nw4r/ut/ut_binaryFileFormat.cpp"),
Object(NonMatching, "nw4r/ut/ut_CharStrmReader.cpp"),
Object(Matching, "nw4r/ut/ut_CharStrmReader.cpp"),
Object(Matching, "nw4r/ut/ut_IOStream.cpp"),
Object(Matching, "nw4r/ut/ut_TagProcessorBase.cpp"),
Object(Matching, "nw4r/ut/ut_FileStream.cpp"),
@@ -353,7 +353,7 @@ config.libs = [
Object(NonMatching, "egg/core/eggDvdFile.cpp"),
Object(NonMatching, "egg/core/eggDvdRipper.cpp"),
Object(NonMatching, "egg/core/eggStream.cpp"),
Object(NonMatching, "egg/core/eggAllocator.cpp"),
Object(Matching, "egg/core/eggAllocator.cpp"),
Object(NonMatching, "egg/core/eggHeap.cpp"),
Object(NonMatching, "egg/core/eggExpHeap.cpp"),
Object(NonMatching, "egg/core/eggFrmHeap.cpp"),
@@ -365,7 +365,8 @@ config.libs = [
Object(Matching, "egg/core/eggDisplay.cpp"),
Object(Matching, "egg/core/eggColorFader.cpp"),
Object(Matching, "egg/core/eggAsyncDisplay.cpp"),
Object(NonMatching, "egg/core/eggVideo.cpp"),
Object(Matching, "egg/core/eggXfb.cpp"),
Object(Matching, "egg/core/eggVideo.cpp"),
Object(Matching, "egg/core/eggXfb.cpp"),
Object(NonMatching, "egg/core/eggXfbManager.cpp"),
Object(NonMatching, "egg/core/eggGraphicsFifo.cpp"),
+79
View File
@@ -0,0 +1,79 @@
#ifndef D_HEAP_ALLOC
#define D_HEAP_ALLOC
#include <egg/core/eggHeap.h>
class dHeapAllocatorBase {
public:
/* vtable at 0x00 */
dHeapAllocatorBase()
: mCallbacksInitialized(0), mPreviousAllocCallback(nullptr), mPreviousAllocCallbackArg(nullptr),
mPreviousFreeCallback(nullptr), mPreviousFreeCallbackArg(nullptr) {}
inline void doInitCallbacks() {
if (!mCallbacksInitialized) {
mCallbacksInitialized = 1;
void *oldAllocCallbackArg = EGG::Heap::sAllocCallbackArg;
void *oldFreeCallbackArg = EGG::Heap::sFreeCallbackArg;
EGG::HeapAllocCallback oldAllocCallback = EGG::Heap::sAllocCallback;
EGG::HeapFreeCallback oldFreeCallback = EGG::Heap::sFreeCallback;
EGG::Heap::sAllocCallback = &allocCallback;
EGG::Heap::sAllocCallbackArg = this;
mPreviousAllocCallback = oldAllocCallback;
mPreviousAllocCallbackArg = oldAllocCallbackArg;
EGG::Heap::sFreeCallback = &freeCallback;
EGG::Heap::sFreeCallbackArg = this;
mPreviousFreeCallback = oldFreeCallback;
mPreviousFreeCallbackArg = oldFreeCallbackArg;
}
}
static void allocCallback(EGG::HeapAllocArg *arg) {
dHeapAllocatorBase *allocator = (dHeapAllocatorBase *)(arg->userArg);
allocator->onAlloc(arg);
if (allocator->mPreviousAllocCallback) {
EGG::HeapAllocArg chainArg = *arg;
chainArg.userArg = allocator->mPreviousAllocCallbackArg;
(allocator->mPreviousAllocCallback)(&chainArg);
}
};
static void freeCallback(EGG::HeapFreeArg *arg) {
dHeapAllocatorBase *allocator = (dHeapAllocatorBase *)(arg->userArg);
EGG::HeapFreeArg chainArg;
allocator->onFree(arg);
if (allocator->mPreviousFreeCallback) {
chainArg = *arg;
chainArg.userArg = allocator->mPreviousFreeCallbackArg;
(allocator->mPreviousFreeCallback)(&chainArg);
}
}
virtual ~dHeapAllocatorBase() {}
virtual void onAlloc(EGG::HeapAllocArg *arg){};
virtual void onFree(EGG::HeapFreeArg *arg){};
/* 0x04 */ bool mCallbacksInitialized;
/* 0x08 */ EGG::HeapAllocCallback mPreviousAllocCallback;
/* 0x0C */ void *mPreviousAllocCallbackArg;
/* 0x10 */ EGG::HeapFreeCallback mPreviousFreeCallback;
/* 0x14 */ void *mPreviousFreeCallbackArg;
};
void *operator new(size_t size);
void *operator new[](size_t size);
void operator delete(void *ptr);
void operator delete[](void *ptr);
class dHeapAllocator : public dHeapAllocatorBase {
public:
dHeapAllocator() {}
virtual ~dHeapAllocator() {}
virtual void onAlloc(EGG::HeapAllocArg *arg);
static void initCallbacks();
static dHeapAllocator sAllocator;
};
#endif
+2 -3
View File
@@ -3,9 +3,8 @@
#include "rvl/MEM.h"
#include <common.h>
// /* 80495310 */ MEMInitAllocatorFor_Heap(MEMAllocator* alloc, s32 align, void* heap);
// /* 804952f0 */ MEM_AllocFor_Heap(MEMAllocator* alloc, void* block);
// /* 804952d0 */ MEM_AllocFor_Heap(MEMAllocator* alloc, u32 size, s32 align);
/* 80495310 */ void MEMInitAllocatorFor_Heap(MEMAllocator* alloc, s32 align, void* heap);
namespace EGG {
class Heap;
class Allocator : public MEMAllocator {
+20 -14
View File
@@ -17,14 +17,15 @@ namespace EGG {
class Allocator;
struct HeapAllocArg {
int userArg; // 00
u32 size; // 04
int align; // 08
Heap *heap; // 0C heap to allocate in
void *userArg; // 00
u32 size; // 04
int align; // 08
Heap *heap; // 0C heap to allocate in
int another; // 10
inline HeapAllocArg() : userArg(0), size(0), align(0), heap(nullptr) {}
};
typedef void (*HeapAllocCallback)(HeapAllocArg &arg);
typedef void (*HeapAllocCallback)(HeapAllocArg *arg);
struct HeapErrorArg {
const char *msg;
@@ -32,13 +33,14 @@ struct HeapErrorArg {
inline HeapErrorArg() {}
};
typedef void (*ErrorCallback)(void *);
typedef void (*ErrorCallback)(HeapErrorArg *);
struct HeapFreeArg {
u32 arg1; // Idk the args
u32 arg2;
void *userArg;
int arg1;
int arg2;
};
typedef void (*HeapFreeCallback)(void *);
typedef void (*HeapFreeCallback)(HeapFreeArg *);
typedef void (*HeapCreateCallback)(void *);
typedef void (*HeapDestroyCallback)(void *);
@@ -101,7 +103,7 @@ public:
/* 804957c0 */ static void free(void *memBlock, Heap *heap);
/* 80495830 */ void dispose();
/* 804958a0 */ void dump();
/* 804958b0 */ void dumpAll();
/* 804958b0 */ static void dumpAll();
/* 804959a0 */ Heap *becomeCurrentHeap();
/* 80495a00 */ Heap *_becomeCurrentHeapWithoutLock();
@@ -138,6 +140,11 @@ public:
inline int getArenaEnd() {
return (int)mHeapHandle->end;
}
inline const char *getName() {
return mName;
}
/* 80673ae8 */ static nw4r::ut::List sHeapList;
/* 80673af8 */ static OSMutex sRootMutex;
/* 80576740 */ static Heap *sCurrentHeap;
@@ -152,13 +159,12 @@ public:
/* 80576764 */ static HeapCreateCallback sCreateCallback;
/* 80576764 */ static HeapDestroyCallback sDestroyCallback;
};
} // namespace EGG
/* 80495a60 */ void *operator new(size_t, void *p);
/* 80495a70 */ void *operator new(size_t size, EGG::Heap *heap, u32 align);
/* 80495a70 */ void *operator new(size_t size, EGG::Heap *heap, int align);
/* 80495a80 */ void *operator new(size_t size, EGG::Allocator *alloc);
/* 80495a90 */ void *operator new[](size_t size, u32 align);
/* 80495aa0 */ void *operator new[](size_t size, EGG::Heap *heap, u32 align);
/* 80495a90 */ void *operator new[](size_t size, int align);
/* 80495aa0 */ void *operator new[](size_t size, EGG::Heap *heap, int align);
#endif
+4 -4
View File
@@ -11,21 +11,21 @@ namespace EGG {
class Video {
public:
struct RenderModeObjSet {
GXRenderModeObj *table[10];
const GXRenderModeObj *table[10];
};
public:
/* 0x00 */ GXRenderModeObj const *pRenderMode;
/* 0x00 */ GXRenderModeObj *pRenderMode;
/* 0x04 */ TBitFlag<u8> mFlag;
/* 0x08 */ u32 mConfiguredTime;
public:
/* inline */ Video() : pRenderMode(0), mFlag(), mConfiguredTime(){};
/* 80498690 */ void initialize(GXRenderModeObj *, const RenderModeObjSet *);
/* 804986f0 */ void configure(GXRenderModeObj *, const RenderModeObjSet *);
/* 804986f0 */ GXRenderModeObj *configure(GXRenderModeObj *, const RenderModeObjSet *);
/* 80498800 */ static u32 getTickPerVRetrace(u32 tvFormat);
/* 80498860 */ static u32 getTickPerVRetrace();
/* 80498890 */ static GXRenderModeObj *getStandardRenderModeObj(RenderModeObjSet *);
/* 80498890 */ static const GXRenderModeObj *getStandardRenderModeObj(const RenderModeObjSet *);
public:
/* inline */ void setBlack(bool b) {
+2 -3
View File
@@ -14,9 +14,8 @@ public:
inline void makeAllZero() {
value = T();
}
inline TBitFlag() {
makeAllZero();
}
inline TBitFlag() {}
inline TBitFlag(T value): value(value) {}
inline T makeMask(u8 bit) const {
return 1 << bit;
}
+4
View File
@@ -24,6 +24,10 @@ typedef struct _GXRenderModeObj {
void GXSetCopyFilter(u8, const u8[12][2], u8, const u8[7]);
void GXSetCopyClear(GXColor, u32 zClear);
void GXSetDispCopySrc(u16 left, u16 top, u16 width, u16 height);
f32 GXGetYScaleFactor(u16 height, u16 width);
u16 GXGetNumXfbLines(u16 height, f32 scale);
void GXSetDispCopyDst(u16 width, u16 height);
u32 GXSetDispCopyYScale(f32 scale);
extern GXRenderModeObj GXNtsc480IntDf;
extern GXRenderModeObj GXMpal480IntDf;
+1 -1
View File
@@ -19,7 +19,7 @@ typedef struct MEMAllocatorFuncs {
typedef struct MEMAllocator {
const MEMAllocatorFuncs *funcs; // at 0x0
struct MEMiHeapHead *heap; // at 0x4
void *heap; // at 0x4
u32 heapParam1; // at 0x8
u32 heapParam2; // at 0xC
} MEMAllocator;
+57 -9
View File
@@ -1,4 +1,5 @@
#include <d/d_heap.h>
#include <d/d_heap_alloc.h>
dHeap dHeap::work1Heap;
dHeap dHeap::work2Heap;
@@ -9,6 +10,22 @@ dHeap dHeap::layoutEx2Heap;
dHeap dHeap::layoutResHeap;
dHeap dHeap::fontHeap;
dHeap dHeap::HBMHeap;
dHeapAllocator dHeapAllocator::sAllocator;
extern u8 lbl_80571C58;
extern "C" void fn_802DE710();
// TODO TU splits?
void dHeapAllocator::onAlloc(EGG::HeapAllocArg *arg) {
if (arg->heap != nullptr) {
return;
}
if (lbl_80571C58 == 0) {
return;
}
fn_802DE710();
}
EGG::ExpHeap *dHeap::init(const char *name, size_t size, EGG::Heap *parent) {
heap = EGG::ExpHeap::create(size, parent, 4);
@@ -18,30 +35,61 @@ EGG::ExpHeap *dHeap::init(const char *name, size_t size, EGG::Heap *parent) {
}
return heap;
}
void dHeap::createWork1Heap(size_t size, EGG::Heap *parent) {
work1Heap.init("ゲーム用作業用ヒープ(dHeap::work1Heap)", size, parent);
static const char name[] = "ゲーム用作業用ヒープ(dHeap::work1Heap)";
work1Heap.init(name, size, parent);
}
void dHeap::createWork2Heap(size_t size, EGG::Heap *parent) {
work2Heap.init("ゲーム用作業用ヒープ(dHeap::work2Heap)", size, parent);
static const char name[] = "ゲーム用作業用ヒープ(dHeap::work2Heap)";
work2Heap.init(name, size, parent);
}
void dHeap::createWorkExHeap(size_t size, EGG::Heap *parent) {
workExHeap.init("ゲーム用拡張作業用ヒープ(dHeap::workExHeap)", size, parent);
static const char name[] = "ゲーム用拡張作業用ヒープ(dHeap::workExHeap)";
workExHeap.init(name, size, parent);
}
void dHeap::createLayoutHeap(size_t size, EGG::Heap *parent) {
layoutHeap.init("レイアウト作業用ヒープ(dHeap::layoutHeap)", size, parent);
static const char name[] = "レイアウト作業用ヒープ(dHeap::layoutHeap)";
layoutHeap.init(name, size, parent);
}
void dHeap::createLayoutExHeap(size_t size, EGG::Heap *parent) {
layoutExHeap.init("レイアウト拡張作業用ヒープ(dHeap::layoutExHeap)", size, parent);
static const char name[] = "レイアウト拡張作業用ヒープ(dHeap::layoutExHeap)";
layoutExHeap.init(name, size, parent);
}
void dHeap::createLayoutEx2Heap(size_t size, EGG::Heap *parent) {
layoutEx2Heap.init("レイアウト拡張作業用ヒープ2(dHeap::layoutEx2Heap)", size, parent);
static const char name[] = "レイアウト拡張作業用ヒープ2(dHeap::layoutEx2Heap)";
layoutEx2Heap.init(name, size, parent);
}
void dHeap::createLayoutResHeap(size_t size, EGG::Heap *parent) {
layoutResHeap.init("レイアウトリソース用ヒープ(dHeap::layoutResHeap)", size, parent);
static const char name[] = "レイアウトリソース用ヒープ(dHeap::layoutResHeap)";
layoutResHeap.init(name, size, parent);
}
void dHeap::createFontHeap(size_t size, EGG::Heap *parent) {
fontHeap.init("フォント用ヒープ(dHeap::fontHeap)", size, parent);
static const char name[] = "フォント用ヒープ(dHeap::fontHeap)";
fontHeap.init(name, size, parent);
}
void dHeap::createHBMHeap(size_t size, EGG::Heap *parent) {
HBMHeap.init("HBM用ヒープ(dHeap::HBMHeap)", size, parent);
static const char name[] = "HBM用ヒープ(dHeap::HBMHeap)";
HBMHeap.init(name, size, parent);
}
// TODO this doesn't match (many more stack stores)
void dHeapAllocator::initCallbacks() {
sAllocator.doInitCallbacks();
}
void *operator new(size_t size) {
return EGG::Heap::alloc(size, 0x04, nullptr);
}
void *operator new[](size_t size) {
return EGG::Heap::alloc(size, 0x04, nullptr);
}
void operator delete(void *ptr) {
return EGG::Heap::free(ptr, nullptr);
}
void operator delete[](void *ptr) {
return EGG::Heap::free(ptr, nullptr);
}
+42
View File
@@ -0,0 +1,42 @@
#include <egg/core/eggAllocator.h>
#include <egg/core/eggHeap.h>
/* 804952d0 */ static void *MEM_AllocFor_Heap(MEMAllocator* alloc, u32 size) {
return static_cast<EGG::Heap*>(static_cast<EGG::Allocator*>(alloc)->heap)->alloc(size, alloc->heapParam1);
}
/* 804952f0 */ static void MEM_FreeFor_Heap(MEMAllocator* alloc, void* block) {
return static_cast<EGG::Heap*>(static_cast<EGG::Allocator*>(alloc)->heap)->free(block);
}
const MEMAllocatorFuncs eggAllocatorFuncs = {
&MEM_AllocFor_Heap,
&MEM_FreeFor_Heap,
};
// TODO this is used from eggHeap for some reason. Figure out
// the correct privacy boundary later.
/* 80495310 */ void MEMInitAllocatorFor_Heap(MEMAllocator* alloc, s32 align, void* heap) {
alloc->funcs = &eggAllocatorFuncs;
alloc->heap = heap;
alloc->heapParam1 = align;
alloc->heapParam2 = 0;
}
namespace EGG {
/* 80495330 */ Allocator::Allocator(Heap *heap, s32 align) : mHeap(heap), align(align) {
MEMInitAllocatorFor_Heap(this, align, heap);
}
/* 80495380 */ Allocator::~Allocator() {}
/* 804953c0 */ void *Allocator::alloc(u32 size) {
return Heap::alloc(size, align, mHeap);
}
/* 804953e0 */ void Allocator::free(void *block) {
Heap::free(block, mHeap);
}
} // namespace EGG
+1 -1
View File
@@ -6,7 +6,7 @@
/* 80497930 */
EGG::ColorFader::ColorFader(float startX, float startY, float lengthX, float lengthY, nw4r::ut::Color color,
Fader::EStatus initialStatus)
: mStartX(startX), mStartY(startY), mEndX(startX + lengthX), mEndY(startY + lengthY), mFrame(0x14), mFadeTimer(0) {
: mStartX(startX), mStartY(startY), mEndX(startX + lengthX), mEndY(startY + lengthY), mFrame(0x14), mFadeTimer(0), mFlags(0) {
setColor(color);
setStatus(initialStatus);
mFlags.setBit(1);
+3 -3
View File
@@ -16,13 +16,13 @@ u32 Display::sTickPeriod = ((OS_BUS_CLOCK_SPEED >> 2)/125000)*300 >> 3;
/* 80497570 */
Display::Display(u8 maxRetrace) :
mMaxRetraces(maxRetrace),
mScreenStateFlag(),
mScreenStateFlag(0),
mRetraceCount(0),
mFrameCount(0),
mClearColor(0x808080ff),
mClearZ(0xFFFFFF),
mBeginTick(0),
mFlag()
mFlag(0)
{
mFlag.setBit(mFlag_SetClear);
mFlag.setBit(mFlag_WaitForRetrace);
@@ -99,4 +99,4 @@ void Display::calcFrequency() {
mBeginTick = endTick;
}
} // namespace EGG
} // namespace EGG
+206
View File
@@ -0,0 +1,206 @@
#include <egg/core/eggAllocator.h>
#include <egg/core/eggHeap.h>
#include <nw4r/ut/ut_list.h>
namespace EGG {
/* 80673ae8 */ nw4r::ut::List Heap::sHeapList;
/* 80673af8 */ OSMutex Heap::sRootMutex;
/* 80576740 */ Heap *Heap::sCurrentHeap;
/* 80576744 */ int Heap::sIsHeapListInitialized;
/* 80576748 */ Heap *Heap::sAllocatableHeap;
/* 8057674c */ ErrorCallback Heap::sErrorCallback;
/* 80576750 */ HeapAllocCallback Heap::sAllocCallback;
/* 80576754 */ HeapFreeCallback Heap::sFreeCallback;
/* 80576758 */ void *Heap::sErrorCallbackArg;
/* 8057675c */ void *Heap::sAllocCallbackArg;
/* 80576760 */ void *Heap::sFreeCallbackArg;
/* 80576764 */ HeapCreateCallback Heap::sCreateCallback;
/* 80576764 */ HeapDestroyCallback Heap::sDestroyCallback;
/* 804953f0 */ void Heap::initialize() {
nw4r::ut::List_Init(&sHeapList, 0x1c /* todo offsetof() */);
OSInitMutex(&sRootMutex);
sIsHeapListInitialized = true;
}
/* 80495430 */ Heap::Heap(MEMiHeapHead *head) : mHeapHandle(head), mParentBlock(nullptr), mName("NoName"), mFlag() {
mFlag.value = 0;
nw4r::ut::List_Init(&mChildren, 0x8 /* todo offsetof() */);
OSLockMutex(&sRootMutex);
nw4r::ut::List_Append(&sHeapList, this);
OSUnlockMutex(&sRootMutex);
}
/* 804954c0 */ Heap::~Heap() {
OSLockMutex(&sRootMutex);
nw4r::ut::List_Remove(&sHeapList, this);
OSUnlockMutex(&sRootMutex);
}
/* 80495560 */ void *Heap::alloc(size_t size, s32 align, Heap *heap) {
Heap *currentHeap = sCurrentHeap;
Thread *thread = Thread::findThread(OSGetCurrentThread());
Heap *threadHeap = nullptr;
if (thread != nullptr && (threadHeap = thread->mAllocatableHeap, threadHeap != nullptr)) {
heap = threadHeap;
}
if (sAllocatableHeap != nullptr) {
if (heap == nullptr) {
heap = currentHeap;
}
if (heap != sAllocatableHeap) {
// TODO small instshuffle here, related to regshuffle problems
OSReport("cannot allocate from heap %x(%s) : allocatable heap is %x(%s)\n", heap, heap->getName(),
sAllocatableHeap, sAllocatableHeap->getName());
OSReport("\tthread heap=%x(%s)\n", threadHeap, threadHeap != nullptr ? threadHeap->getName() : "none");
if (sErrorCallback != nullptr) {
HeapErrorArg arg;
arg.msg = "disable_but";
arg.userdata = sErrorCallbackArg;
sErrorCallback(&arg);
}
dumpAll();
return nullptr;
}
}
if (heap == nullptr) {
heap = currentHeap;
}
void *ptr = nullptr;
if (heap) {
ptr = heap->alloc(size, align);
}
return ptr;
}
/* 80495690 */ Heap *Heap::findHeap(MEMiHeapHead *head) {
Heap *heap = nullptr;
OSLockMutex(&sRootMutex);
if (sIsHeapListInitialized) {
Heap *heap2 = nullptr;
while ((heap2 = (Heap *)nw4r::ut::List_GetNext(&sHeapList, heap2))) {
if (heap2->mHeapHandle == head) {
heap = heap2;
break;
}
}
}
OSUnlockMutex(&sRootMutex);
return heap;
}
/* 80495730 */ Heap *Heap::findParentHeap() {
Heap *retHeap = nullptr;
MEMiHeapHead *heap = MEMFindContainHeap(mHeapHandle);
if (heap) {
retHeap = findHeap(heap);
}
return retHeap;
}
extern "C" MEMiHeapHead *fn_803CC670(const void *memBlock);
/* 80495780 */ Heap *Heap::findContainHeap(const void *memBlock) {
Heap *retHeap = nullptr;
MEMiHeapHead *heap = fn_803CC670(memBlock);
if (heap) {
retHeap = findHeap(heap);
}
return retHeap;
}
/* 804957c0 */ void Heap::free(void *ptr, Heap *heap) {
if (heap == nullptr) {
MEMiHeapHead *iheap = fn_803CC670(ptr);
if (iheap == nullptr) {
return;
}
heap = findHeap(iheap);
if (heap == nullptr) {
return;
}
}
heap->free(ptr);
}
/* 80495830 */ void Heap::dispose() {
mFlag.setBit(1);
Heap *heap;
while ((heap = (Heap *)nw4r::ut::List_GetFirst(&mChildren)) != nullptr) {
heap->~Heap();
}
mFlag.resetBit(1);
}
/* 804958a0 */ void Heap::dump() {}
// TODO: This debugging function with stripped out error reports doesn't match yet
/* 804958b0 */ void Heap::dumpAll() {
u32 mem[2] = {0, 0};
OSLockMutex(&sRootMutex);
for (Heap *heap = nullptr; heap != nullptr; heap = (Heap *)nw4r::ut::List_GetNext(&sHeapList, &heap)) {
Heap *childHeap = nullptr;
Heap *parentHeap = heap->findParentHeap();
if ((u32)heap < 0x90000000) {
mem[0] += heap->getAllocatableSize(4);
} else {
mem[1] += heap->getAllocatableSize(4);
}
while ((childHeap = (Heap *)nw4r::ut::List_GetNext(&sHeapList, childHeap)) != nullptr) {
if (parentHeap == childHeap) {
break;
}
}
}
OSUnlockMutex(&sRootMutex);
}
/* 804959a0 */ Heap *Heap::becomeCurrentHeap() {
OSLockMutex(&sRootMutex);
Heap *h = sCurrentHeap;
sCurrentHeap = this;
OSUnlockMutex(&sRootMutex);
return h;
}
/* 80495a00 */ Heap *Heap::_becomeCurrentHeapWithoutLock() {
Heap *h = sCurrentHeap;
sCurrentHeap = this;
DCStoreRange(&sCurrentHeap, sizeof(sCurrentHeap));
return h;
}
// TODO
extern "C" void MEMInitAllocatorForHeap(Allocator *alloc, s32 align, Heap *heap);
// TODO this could be an inline virtual function
/* 80495a40 */ void Heap::initAllocator(Allocator *alloc, s32 align) {
MEMInitAllocatorForHeap(alloc, align, this);
}
} // namespace EGG
/* 80495a60 */ void *operator new(size_t, void *p) {
return p;
}
/* 80495a70 */ void *operator new(size_t size, EGG::Heap *heap, int align) {
return EGG::Heap::alloc(size, align, heap);
}
/* 80495a80 */ void *operator new(size_t size, EGG::Allocator *alloc) {
return MEMAllocFromAllocator(alloc->getHandle(), size);
}
/* 80495a90 */ void *operator new[](size_t size, int align) {
return EGG::Heap::alloc(size, align, nullptr);
}
/* 80495aa0 */ void *operator new[](size_t size, EGG::Heap *heap, int align) {
return EGG::Heap::alloc(size, align, heap);
}
+406
View File
@@ -0,0 +1,406 @@
#include <egg/core/eggVideo.h>
#include <rvl/OS/OSHardware.h>
#include <rvl/OS/OSTime.h>
#include <rvl/SC/scapi.h>
namespace {
const GXRenderModeObj gRMO_Pal60_640x456Prog_16x9 = {
0, // tvInfo
640, // fbWidth
456, // efbHeight
456, // xfbHeight
25, // viXOrigin
12, // viYOrigin
670, // viWidth
456, // viHeight
1, // xfbMode
0, // field_rendering
0, // aa
{
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
}, // sample_pattern
{7, 7, 12, 12, 12, 7, 7} // vFilter
};
const GXRenderModeObj gRMO_Pal60_640x456IntDf_16x9 = {
2, // tvInfo
640, // fbWidth
456, // efbHeight
456, // xfbHeight
25, // viXOrigin
12, // viYOrigin
670, // viWidth
456, // viHeight
0, // xfbMode
0, // field_rendering
0, // aa
{
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
}, // sample_pattern
{0, 0, 21, 22, 21, 0, 0} // vFilter
};
const GXRenderModeObj gRMO_Pal50_640x456IntDf_16x9 = {
4, // tvInfo
640, // fbWidth
456, // efbHeight
542, // xfbHeight
27, // viXOrigin
16, // viYOrigin
666, // viWidth
542, // viHeight
1, // xfbMode
0, // field_rendering
0, // aa
{
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
}, // sample_pattern
{7, 7, 12, 12, 12, 7, 7} // vFilter
};
const GXRenderModeObj gRMO_Ntsc_640x456Prog_16x9 = {
20, // tvInfo
640, // fbWidth
456, // efbHeight
456, // xfbHeight
25, // viXOrigin
12, // viYOrigin
670, // viWidth
456, // viHeight
1, // xfbMode
0, // field_rendering
0, // aa
{
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
}, // sample_pattern
{7, 7, 12, 12, 12, 7, 7} // vFilter
};
const GXRenderModeObj gRMO_Ntsc_640x456IntDf_16x9 = {
22, // tvInfo
640, // fbWidth
456, // efbHeight
456, // xfbHeight
25, // viXOrigin
12, // viYOrigin
670, // viWidth
456, // viHeight
0, // xfbMode
0, // field_rendering
0, // aa
{
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
}, // sample_pattern
{0, 0, 21, 22, 21, 0, 0} // vFilter
};
const GXRenderModeObj gRMO_Pal60_640x456Prog_4x3 = {
0, // tvInfo
640, // fbWidth
456, // efbHeight
456, // xfbHeight
17, // viXOrigin
12, // viYOrigin
686, // viWidth
456, // viHeight
1, // xfbMode
0, // field_rendering
0, // aa
{
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
}, // sample_pattern
{7, 7, 12, 12, 12, 7, 7} // vFilter
};
const GXRenderModeObj gRMO_Pal60_640x456IntDf_4x3 = {
2, // tvInfo
640, // fbWidth
456, // efbHeight
456, // xfbHeight
17, // viXOrigin
12, // viYOrigin
686, // viWidth
456, // viHeight
0, // xfbMode
0, // field_rendering
0, // aa
{
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
}, // sample_pattern
{0, 0, 21, 22, 21, 0, 0} // vFilter
};
const GXRenderModeObj gRMO_Pal50_640x456IntDf_4x3 = {
4, // tvInfo
640, // fbWidth
456, // efbHeight
542, // xfbHeight
19, // viXOrigin
16, // viYOrigin
682, // viWidth
542, // viHeight
1, // xfbMode
0, // field_rendering
0, // aa
{
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
}, // sample_pattern
{7, 7, 12, 12, 12, 7, 7} // vFilter
};
const GXRenderModeObj gRMO_Ntsc_640x456Prog_4x3 = {
20, // tvInfo
640, // fbWidth
456, // efbHeight
456, // xfbHeight
17, // viXOrigin
12, // viYOrigin
686, // viWidth
456, // viHeight
1, // xfbMode
0, // field_rendering
0, // aa
{
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
}, // sample_pattern
{7, 7, 12, 12, 12, 7, 7} // vFilter
};
const GXRenderModeObj gRMO_Ntsc_640x456IntDf_4x3 = {
22, // tvInfo
640, // fbWidth
456, // efbHeight
456, // xfbHeight
17, // viXOrigin
12, // viYOrigin
686, // viWidth
456, // viHeight
0, // xfbMode
0, // field_rendering
0, // aa
{
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
{6, 6},
}, // sample_pattern
{0, 0, 21, 22, 21, 0, 0} // vFilter
};
} // namespace
namespace EGG {
const EGG::Video::RenderModeObjSet renderModes = {{&gRMO_Pal60_640x456Prog_16x9, &gRMO_Pal60_640x456IntDf_16x9,
&gRMO_Pal50_640x456IntDf_16x9, &gRMO_Ntsc_640x456Prog_16x9, &gRMO_Ntsc_640x456IntDf_16x9,
&gRMO_Pal60_640x456Prog_4x3, &gRMO_Pal60_640x456IntDf_4x3, &gRMO_Pal50_640x456IntDf_4x3,
&gRMO_Ntsc_640x456Prog_4x3, &gRMO_Ntsc_640x456IntDf_4x3}};
/* 80498690 */ void Video::initialize(GXRenderModeObj *obj, const RenderModeObjSet *set) {
VIInit();
configure(obj, set);
}
/* 804986f0 */ GXRenderModeObj *Video::configure(GXRenderModeObj *obj, const RenderModeObjSet *set) {
GXRenderModeObj *oldMode = pRenderMode;
if (set == nullptr) {
set = &renderModes;
}
if (obj == nullptr) {
// Cast away constness. In an incredibly cursed way, adding proper
// const correctness to this class changes regalloc
obj = (GXRenderModeObj *)getStandardRenderModeObj(set);
}
if (pRenderMode != obj) {
pRenderMode = obj;
VISetBlack(true);
VIConfigure(obj);
VIFlush();
mConfiguredTime = OSGetTick();
mFlag.setBit(0);
u16 efbWidth = obj->fbWidth;
u16 efbHeight = obj->efbHeight;
f32 factor = GXGetYScaleFactor(efbHeight, obj->xfbHeight);
u16 lines = GXGetNumXfbLines(efbHeight, factor);
GXSetDispCopySrc(0, 0, efbWidth, efbHeight);
GXSetDispCopyDst(efbWidth, lines);
GXSetDispCopyYScale(factor);
VIWaitForRetrace();
VIWaitForRetrace();
}
return oldMode;
}
// Random function that pretends to do an int to float
// cast here, for float ordering issues
f32 itof(u32 n) {
return n;
}
// TODO VITvFormat
/* 80498800 */ u32 Video::getTickPerVRetrace(u32 tvFormat) {
f32 val = tvFormat - 1 <= VI_TV_FMT_PAL ? 50.0f : 59.94f;
return (u32)((OS_BUS_CLOCK_SPEED >> 2) / val);
}
/* 80498860 */ u32 Video::getTickPerVRetrace() {
return getTickPerVRetrace(VIGetTvFormat());
}
/* 80498890 */ const GXRenderModeObj *Video::getStandardRenderModeObj(const RenderModeObjSet *set) {
bool pmode = SCGetProgressiveMode() == 1;
bool rbg60mode = SCGetEuRgb60Mode() == 1;
bool aspect = SCGetAspectRatio() == 0;
bool dtvstatus = VIGetDTVStatus() == 1;
u32 tvFormat = VIGetTvFormat();
bool isNtscLike;
switch (tvFormat) {
case VI_TV_FMT_NTSC:
isNtscLike = true;
break;
case VI_TV_FMT_PAL:
case VI_TV_FMT_EURGB60:
isNtscLike = false;
break;
default:
isNtscLike = true;
}
if (dtvstatus && pmode) {
if (isNtscLike) {
if (aspect) {
return set->table[1];
} else {
return set->table[6];
}
} else if (aspect) {
return set->table[4];
} else {
return set->table[9];
}
} else if (isNtscLike) {
if (aspect) {
return set->table[0];
} else {
return set->table[5];
}
} else if (rbg60mode) {
if (aspect) {
return set->table[3];
} else {
return set->table[8];
}
} else if (aspect) {
return set->table[2];
}
return set->table[7];
}
} // namespace EGG
+54
View File
@@ -0,0 +1,54 @@
#include <nw4r/ut/ut_CharStrmReader.h>
namespace nw4r {
namespace ut {
namespace {
bool IsSJISLeadByte(u8 c) {
return ((c >= 0x81) && (c < 0xA0)) || c >= 0xe0;
}
} // namespace
u16 CharStrmReader::ReadNextCharUTF8() {
u16 code;
if (!(GetChar<u8>(0) & 0x80)) {
code = GetChar<u8>(0);
StepStrm<u8>(1);
} else if ((GetChar<u8>(0) & 0xe0) == 0xC0) {
code = ((GetChar<u8>(0) & 0x1F) << 6) | GetChar<u8>(1) & 0x3F;
StepStrm<u8>(2);
} else {
code = ((GetChar<u8>(0) & 0x1F) << 12) | ((GetChar<u8>(1) & 0x3F) << 6) | (GetChar<u8>(2) & 0x3F);
StepStrm<u8>(3);
}
return code;
}
u16 CharStrmReader::ReadNextCharUTF16() {
u16 code = GetChar<u16>(0);
StepStrm<u16>(1);
return code;
}
u16 CharStrmReader::ReadNextCharCP1252() {
u16 code = GetChar<u8>(0);
StepStrm<u8>(1);
return code;
}
u16 CharStrmReader::ReadNextCharSJIS() {
u16 code = GetChar<u8>(0);
if (IsSJISLeadByte((u8)code)) {
code = GetChar<u8>(1) | (GetChar<u8>(0) << 8);
StepStrm<u8>(2);
} else {
code = GetChar<u8>(0);
StepStrm<u8>(1);
}
return code;
}
} // namespace ut
} // namespace nw4r