diff options
author | StapleButter <thetotalworm@gmail.com> | 2017-02-07 22:23:46 +0100 |
---|---|---|
committer | StapleButter <thetotalworm@gmail.com> | 2017-02-07 22:23:46 +0100 |
commit | 0562410de25266f70d16045987c9b39fd8366057 (patch) | |
tree | 73faccb584295ad32bb0bb044c634877a758619d /NDSCart.cpp | |
parent | 86cdf283231fd4485c4731f6cbbe08e5cb4ae731 (diff) |
* lay base for 3D engine
* add failure reporting to Init functions, and DeInit functions
* GPU-related notes
* readme update
Diffstat (limited to 'NDSCart.cpp')
-rw-r--r-- | NDSCart.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/NDSCart.cpp b/NDSCart.cpp index 523f575..8553991 100644 --- a/NDSCart.cpp +++ b/NDSCart.cpp @@ -53,15 +53,21 @@ void Write_Flash(u8 val, bool islast); void Write_Discover(u8 val, bool islast); -void Init() +bool Init() { SRAM = NULL; Discover_Buffer = NULL; + return true; +} + +void DeInit() +{ + if (SRAM) delete[] SRAM; + if (Discover_Buffer) delete[] Discover_Buffer; } void Reset() { - // } void LoadSave(char* path) @@ -69,6 +75,8 @@ void LoadSave(char* path) if (SRAM) delete[] SRAM; if (Discover_Buffer) delete[] Discover_Buffer; + Discover_Buffer = NULL; + strncpy(SRAMPath, path, 255); SRAMPath[255] = '\0'; @@ -553,9 +561,16 @@ void Key2_Encrypt(u8* data, u32 len) } -void Init() +bool Init() +{ + if (!NDSCart_SRAM::Init()) return false; + + return true; +} + +void DeInit() { - NDSCart_SRAM::Init(); + NDSCart_SRAM::DeInit(); } void Reset() |