mirror of
https://github.com/WiIIiam278/breaking-bad-ds.git
synced 2025-06-19 17:25:45 -04:00

* Fix wrong line endings * Fixup launch tasks * Fixup nflib lib dir * Fixup debugger, improve dialogue save tracking * Fixup typo * Improve stability of game end logic * Dialogue text fixes * Fix SFX bug on Hank's mineral screen * Bump to 1.0.6 * Add SFX to cracking minigame
28 lines
633 B
C++
28 lines
633 B
C++
#include "debug.h"
|
|
|
|
// Routine taken from https://devkitpro.org/viewtopic.php?t=3057
|
|
|
|
extern u8 *fake_heap_end; // current heap start
|
|
extern u8 *fake_heap_start; // current heap end
|
|
|
|
u8* getHeapStart() {
|
|
return fake_heap_start;
|
|
}
|
|
|
|
u8* getHeapEnd() {
|
|
return (u8*)sbrk(0);
|
|
}
|
|
|
|
u8* getHeapLimit() {
|
|
return fake_heap_end;
|
|
}
|
|
|
|
int getMemUsed() { // returns the amount of used memory in bytes
|
|
struct mallinfo mi = mallinfo();
|
|
return mi.uordblks;
|
|
}
|
|
|
|
int getMemFree() { // returns the amount of free memory in bytes
|
|
struct mallinfo mi = mallinfo();
|
|
return mi.fordblks + (getHeapLimit() - getHeapEnd());
|
|
} |