Skip to content

Commit

Permalink
lay base for AR cheatzorz. baahahhhh
Browse files Browse the repository at this point in the history
  • Loading branch information
Arisotura committed Feb 14, 2020
1 parent 2944575 commit 106b9a6
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 2 deletions.
8 changes: 7 additions & 1 deletion melonDS.cbp
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down Expand Up @@ -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>
55 changes: 55 additions & 0 deletions src/AREngine.cpp
Original file line number Diff line number Diff line change
@@ -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
}

}
33 changes: 33 additions & 0 deletions src/AREngine.h
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
project(core)

add_library(core STATIC
AREngine.cpp
ARM.cpp
ARMInterpreter.cpp
ARMInterpreter_ALU.cpp
Expand Down
5 changes: 4 additions & 1 deletion src/GPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <string.h>
#include "NDS.h"
#include "GPU.h"
u64 vbltime;
#include "AREngine.h"

namespace GPU
{
Expand Down Expand Up @@ -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)
{
Expand Down
7 changes: 7 additions & 0 deletions src/NDS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "SPI.h"
#include "RTC.h"
#include "Wifi.h"
#include "AREngine.h"
#include "Platform.h"


Expand Down Expand Up @@ -177,6 +178,8 @@ bool Init()
if (!RTC::Init()) return false;
if (!Wifi::Init()) return false;

if (!AREngine::Init()) return false;

return true;
}

Expand All @@ -198,6 +201,8 @@ void DeInit()
SPI::DeInit();
RTC::DeInit();
Wifi::DeInit();

AREngine::DeInit();
}


Expand Down Expand Up @@ -500,6 +505,8 @@ void Reset()
SPI::Reset();
RTC::Reset();
Wifi::Reset();

AREngine::Reset();
}

void Stop()
Expand Down

0 comments on commit 106b9a6

Please sign in to comment.