From d1434fecca2252b9581ff6a43ed0c761bbc73f3c Mon Sep 17 00:00:00 2001 From: Treeki Date: Sun, 14 Oct 2012 06:10:47 +0200 Subject: aaaaaaaaaaaaaaaaaaaaa --- src/heapbar.S | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/src/heapbar.S b/src/heapbar.S index 4e728e2..45dcc19 100644 --- a/src/heapbar.S +++ b/src/heapbar.S @@ -46,6 +46,7 @@ doHeapBar: ori r3, r3, GameHeap1@l lwz r3, 0(r3) li r4, HEAP_EGGRootMEM1 + li r5, 0 bl asmProcessHeap #lwz r3, 0x1C(this) @@ -55,12 +56,14 @@ doHeapBar: ori r3, r3, GameHeap2@l lwz r3, 0(r3) li r4, HEAP_EGGRootMEM2 + li r5, 0 bl asmProcessHeap lis r3, ArchiveHeap@h ori r3, r3, ArchiveHeap@l lwz r3, 0(r3) li r4, HEAP_Archive + li r5, 0 bl asmProcessHeap lis r3, dSys_c__RootHeapMEM2@h @@ -84,18 +87,21 @@ doHeapBar: blr +.global asmProcessHeap asmProcessHeap: - stwu sp, -0x10(sp) + stwu sp, -0x20(sp) mflr r0 - stw r0, 0x14(sp) + stw r0, 0x24(sp) - stw r31, 0xC(sp) - stw r30, 0x8(sp) + stw r31, 0x1C(sp) + stw r30, 0x18(sp) + stw r29, 0x14(sp) mr r31, r3 mr r30, r4 + mr r29, r5 # get all the required data from the heap # cppProcessHeap(u32 freeSize, u32 heapSize, int heapID, char *name) @@ -119,16 +125,29 @@ asmProcessHeap: sub r4, r8, r7 # heapSize = heapEnd - heapStart probably # now do it + cmpwi r29, 1 + beq justreport bl cppProcessHeap - - lwz r30, 0x8(sp) - lwz r31, 0xC(sp) - lwz r0, 0x14(sp) + b gdhbdgdfg +justreport: + mr r5, r4 + mr r4, r3 + lis r3, dgdfgdfg@h + ori r3, r3, dgdfgdfg@l + crclr 4*cr1+eq + bl OSReport +gdhbdgdfg: + + lwz r29, 0x14(sp) + lwz r30, 0x18(sp) + lwz r31, 0x1C(sp) + lwz r0, 0x24(sp) mtlr r0 - addi sp, sp, 0x10 + addi sp, sp, 0x20 blr .data THE_THING: .string "A thing: %x - %x and %x\n" +dgdfgdfg: .string "FREE: %x SIZE: %x\n" .align 4 -- cgit v1.2.3