diff options
author | Arisotura <thetotalworm@gmail.com> | 2020-02-14 19:26:52 +0100 |
---|---|---|
committer | Arisotura <thetotalworm@gmail.com> | 2020-02-14 19:26:52 +0100 |
commit | 106b9a6f24958d33a0f909b3ceb1abf50570b82d (patch) | |
tree | 0c9dae431f91a6f50b5abfcd2fcf2448e14f3378 /src | |
parent | 2944575cbc3cd9afa6f8d64fdcb1908cf8deaf05 (diff) |
lay base for AR cheatzorz. baahahhhh
Diffstat (limited to 'src')
-rw-r--r-- | src/AREngine.cpp | 55 | ||||
-rw-r--r-- | src/AREngine.h | 33 | ||||
-rw-r--r-- | src/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/GPU.cpp | 5 | ||||
-rw-r--r-- | src/NDS.cpp | 7 |
5 files changed, 100 insertions, 1 deletions
diff --git a/src/AREngine.cpp b/src/AREngine.cpp new file mode 100644 index 0000000..9a87d5d --- /dev/null +++ b/src/AREngine.cpp @@ -0,0 +1,55 @@ +/* + Copyright 2016-2019 Arisotura + + This file is part of melonDS. + + melonDS is free software: you can redistribute it and/or modify it under + the terms of the GNU General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + melonDS is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with melonDS. If not, see http://www.gnu.org/licenses/. +*/ + +#include <stdio.h> +#include <string.h> +#include "NDS.h" +#include "AREngine.h" + + +namespace AREngine +{ + +// TODO: more sensible size for this? allocate on demand? +u32 CheatCodes[2 * 1024]; + + +bool Init() +{ + return true; +} + +void DeInit() +{ + // +} + +void Reset() +{ + memset(CheatCodes, 0, sizeof(u32)*2*1024); + + // TODO: acquire codes from a sensible source! +} + + +void RunCheats() +{ + // bahahah +} + +} diff --git a/src/AREngine.h b/src/AREngine.h new file mode 100644 index 0000000..afaf598 --- /dev/null +++ b/src/AREngine.h @@ -0,0 +1,33 @@ +/* + Copyright 2016-2019 Arisotura + + This file is part of melonDS. + + melonDS is free software: you can redistribute it and/or modify it under + the terms of the GNU General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + melonDS is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with melonDS. If not, see http://www.gnu.org/licenses/. +*/ + +#ifndef ARENGINE_H +#define ARENGINE_H + +namespace AREngine +{ + +bool Init(); +void DeInit(); +void Reset(); + +void RunCheats(); + +} + +#endif // ARENGINE_H diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 03a4bfe..3b760ba 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,6 +1,7 @@ project(core) add_library(core STATIC + AREngine.cpp ARM.cpp ARMInterpreter.cpp ARMInterpreter_ALU.cpp diff --git a/src/GPU.cpp b/src/GPU.cpp index 071d5f6..1ac9f50 100644 --- a/src/GPU.cpp +++ b/src/GPU.cpp @@ -20,7 +20,7 @@ #include <string.h> #include "NDS.h" #include "GPU.h" -u64 vbltime; +#include "AREngine.h" namespace GPU { @@ -986,6 +986,9 @@ void StartScanline(u32 line) GPU2D_A->VBlank(); GPU2D_B->VBlank(); GPU3D::VBlank(); + + // TODO: verify when AR cheats actually run! + AREngine::RunCheats(); } else if (VCount == 144) { diff --git a/src/NDS.cpp b/src/NDS.cpp index 47f96c9..0198ea3 100644 --- a/src/NDS.cpp +++ b/src/NDS.cpp @@ -30,6 +30,7 @@ #include "SPI.h" #include "RTC.h" #include "Wifi.h" +#include "AREngine.h" #include "Platform.h" @@ -177,6 +178,8 @@ bool Init() if (!RTC::Init()) return false; if (!Wifi::Init()) return false; + if (!AREngine::Init()) return false; + return true; } @@ -198,6 +201,8 @@ void DeInit() SPI::DeInit(); RTC::DeInit(); Wifi::DeInit(); + + AREngine::DeInit(); } @@ -500,6 +505,8 @@ void Reset() SPI::Reset(); RTC::Reset(); Wifi::Reset(); + + AREngine::Reset(); } void Stop() |