diff options
author | Treeki <treeki@gmail.com> | 2012-02-12 22:46:57 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2012-02-12 22:46:57 +0100 |
commit | 5c351b910bd4f25a5fdc122d34c435bee28aa861 (patch) | |
tree | 34621344c5f4aa55f9f4a697db770dc5b5b77641 /src/heapbar.S | |
parent | 46cb2c50bc4f7dfe55085d842cdc77f225fabf06 (diff) | |
download | kamek-5c351b910bd4f25a5fdc122d34c435bee28aa861.tar.gz kamek-5c351b910bd4f25a5fdc122d34c435bee28aa861.zip |
updated the memory debugging code (HeapBar) a bit
Diffstat (limited to 'src/heapbar.S')
-rw-r--r-- | src/heapbar.S | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/src/heapbar.S b/src/heapbar.S index 4f86fbe..83b0c3a 100644 --- a/src/heapbar.S +++ b/src/heapbar.S @@ -1,18 +1,9 @@ # memory debugger - fun! # GX stuff is implemented in C++, this just gets the lowlevel info -#ifndef __MWERKS__ -.set r0,0; .set r1,1; .set r2,2; .set r3,3; .set r4,4 -.set r5,5; .set r6,6; .set r7,7; .set r8,8; .set r9,9 -.set r10,10; .set r11,11; .set r12,12; .set r13,13; .set r14,14 -.set r15,15; .set r16,16; .set r17,17; .set r18,18; .set r19,19 -.set r20,20; .set r21,21; .set r22,22; .set r23,23; .set r24,24 -.set r25,25; .set r26,26; .set r27,27; .set r28,28; .set r29,29 -.set r30,30; .set r31,31; .set f0,0; .set f2,2; .set f3,3 -#endif - #define HEAP_EGGRootMEM1 1 #define HEAP_EGGRootMEM2 2 +#define HEAP_Archive 3 .extern cppGXStart .extern cppGXEnd @@ -20,6 +11,10 @@ .extern MEMGetTotalFreeSizeForExpHeap .extern GameHeap1 .extern GameHeap2 +.extern ArchiveHeap +.extern OSReport +.extern dSys_c__RootHeapMEM1 +.extern dSys_c__RootHeapMEM2 .set sp,1 .set rtoc,2 @@ -32,8 +27,6 @@ .global doHeapBar doHeapBar: - blr - stwu sp, -0x10(sp) mflr r0 stw r0, 0x14(sp) @@ -63,7 +56,23 @@ doHeapBar: lwz r3, 0(r3) li r4, HEAP_EGGRootMEM2 bl asmProcessHeap + + lis r3, ArchiveHeap@h + ori r3, r3, ArchiveHeap@l + lwz r3, 0(r3) + li r4, HEAP_Archive + bl asmProcessHeap + lis r3, dSys_c__RootHeapMEM2@h + ori r3, r3, dSys_c__RootHeapMEM2@l + lwz r3, 0(r3) + lwz r3, 0x10(r3) + lwz r4, 0x18(r3) + lwz r5, 0x1C(r3) + lis r3, THE_THING@h + ori r3, r3, THE_THING@l + bl OSReport + bl cppGXEnd lwz this, 0xC(sp) @@ -116,3 +125,8 @@ asmProcessHeap: mtlr r0 addi sp, sp, 0x10 blr + +.data +THE_THING: .string "A thing: %x - %x\n" +.align 4 + |