mirror of
https://github.com/ApacheThunder/nitrohaxTWL.git
synced 2025-06-19 03:55:45 -04:00

* Original bootloader doesn't currently support TWL carts so a second one is used in those cases. (still unknown if cheat engine will work for them however) * Main code and bootloader updated to account for DSi/3DS consoles.
64 lines
1.7 KiB
C
64 lines
1.7 KiB
C
/*
|
|
NitroHax -- Cheat tool for the Nintendo DS
|
|
Copyright (C) 2008 Michael "Chishm" Chisholm
|
|
|
|
This program 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.
|
|
|
|
This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#include <nds.h>
|
|
#include <nds/arm7/input.h>
|
|
#include <nds/system.h>
|
|
|
|
#include "cheat_engine_arm7.h"
|
|
|
|
void VcountHandler() { inputGetAndSend(); }
|
|
|
|
void VblankHandler(void) { }
|
|
|
|
//---------------------------------------------------------------------------------
|
|
int main(void) {
|
|
//---------------------------------------------------------------------------------
|
|
|
|
irqInit();
|
|
fifoInit();
|
|
|
|
// read User Settings from firmware
|
|
readUserSettings();
|
|
|
|
// Start the RTC tracking IRQ
|
|
initClockIRQ();
|
|
|
|
SetYtrigger(80);
|
|
|
|
installSystemFIFO();
|
|
|
|
irqSet(IRQ_VCOUNT, VcountHandler);
|
|
irqSet(IRQ_VBLANK, VblankHandler);
|
|
|
|
irqEnable( IRQ_VBLANK | IRQ_VCOUNT);
|
|
|
|
if (REG_SNDEXTCNT != 0) {
|
|
i2cWriteRegister(0x4A, 0x12, 0x00); // Press power-button for auto-reset
|
|
i2cWriteRegister(0x4A, 0x70, 0x01); // Bootflag = Warmboot/SkipHealthSafety
|
|
}
|
|
|
|
// Keep the ARM7 mostly idle
|
|
while (1) {
|
|
runCheatEngineCheck();
|
|
swiWaitForVBlank();
|
|
}
|
|
}
|
|
|
|
|