NTR_Launcher/arm7/source/main.c
ApacheThunder 1cacb30405 Updates for better stability™
Removed some features that would see little use like the TWL mode option
and the enable SD option. MBK init code moved and always used. Sets MBK
to proper values for NTR mode (as documented in No$GBA).

Since this build is now intended to be launched from a patched DSi
System Menu, the touch screen mode change code has been removed and and
this no longer requires a custom libnds build that isn't really
available anywhere right now. :P
2017-07-25 19:48:11 -05:00

68 lines
1.6 KiB
C
Executable File

/*
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 "resetslot.h"
#include "fifocheck.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 );
i2cWriteRegister(0x4A, 0x12, 0x00); // Press power-button for auto-reset
i2cWriteRegister(0x4A, 0x70, 0x01); // Bootflag = Warmboot/SkipHealthSafety
fifoWaitValue32(FIFO_USER_01);
if(fifoCheckValue32(FIFO_USER_02)) {
if(fifoCheckValue32(FIFO_USER_04)) { TWL_ResetSlot1(); } else { PowerOnSlot(); }
}
fifoSendValue32(FIFO_USER_03, 1);
while (1) {
fifocheck();
swiWaitForVBlank();
}
}