diff options
-rw-r--r-- | melonDS.cbp | 8 | ||||
-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 |
6 files changed, 107 insertions, 2 deletions
diff --git a/melonDS.cbp b/melonDS.cbp index 7834a0e..58f86a6 100644 --- a/melonDS.cbp +++ b/melonDS.cbp @@ -100,6 +100,8 @@ <Unit filename="melon.rc"> <Option compilerVar="WINDRES" /> </Unit> + <Unit filename="src/AREngine.cpp" /> + <Unit filename="src/AREngine.h" /> <Unit filename="src/ARM.cpp" /> <Unit filename="src/ARM.h" /> <Unit filename="src/ARMInterpreter.cpp" /> @@ -279,6 +281,10 @@ <Unit filename="src/types.h" /> <Unit filename="src/version.h" /> <Unit filename="xp.manifest" /> - <Extensions /> + <Extensions> + <code_completion /> + <envvars /> + <debugger /> + </Extensions> </Project> </CodeBlocks_project_file> 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() |