| 1 |
/*--------------------------------------------------------------------------------- |
| 2 |
|
| 3 |
default ARM7 core |
| 4 |
|
| 5 |
Copyright (C) 2005 |
| 6 |
Michael Noland (joat) |
| 7 |
Jason Rogers (dovoto) |
| 8 |
Dave Murphy (WinterMute) |
| 9 |
|
| 10 |
This software is provided 'as-is', without any express or implied |
| 11 |
warranty. In no event will the authors be held liable for any |
| 12 |
damages arising from the use of this software. |
| 13 |
|
| 14 |
Permission is granted to anyone to use this software for any |
| 15 |
purpose, including commercial applications, and to alter it and |
| 16 |
redistribute it freely, subject to the following restrictions: |
| 17 |
|
| 18 |
1. The origin of this software must not be misrepresented; you |
| 19 |
must not claim that you wrote the original software. If you use |
| 20 |
this software in a product, an acknowledgment in the product |
| 21 |
documentation would be appreciated but is not required. |
| 22 |
2. Altered source versions must be plainly marked as such, and |
| 23 |
must not be misrepresented as being the original software. |
| 24 |
3. This notice may not be removed or altered from any source |
| 25 |
distribution. |
| 26 |
|
| 27 |
---------------------------------------------------------------------------------*/ |
| 28 |
#include <nds.h> |
| 29 |
#include <dswifi7.h> |
| 30 |
#include <maxmod7.h> |
| 31 |
|
| 32 |
//--------------------------------------------------------------------------------- |
| 33 |
void VcountHandler() { |
| 34 |
//--------------------------------------------------------------------------------- |
| 35 |
inputGetAndSend(); |
| 36 |
} |
| 37 |
|
| 38 |
//--------------------------------------------------------------------------------- |
| 39 |
void VblankHandler(void) { |
| 40 |
//--------------------------------------------------------------------------------- |
| 41 |
Wifi_Update(); |
| 42 |
} |
| 43 |
|
| 44 |
|
| 45 |
//--------------------------------------------------------------------------------- |
| 46 |
int main() { |
| 47 |
//--------------------------------------------------------------------------------- |
| 48 |
irqInit(); |
| 49 |
fifoInit(); |
| 50 |
|
| 51 |
// read User Settings from firmware |
| 52 |
readUserSettings(); |
| 53 |
|
| 54 |
// Start the RTC tracking IRQ |
| 55 |
initClockIRQ(); |
| 56 |
|
| 57 |
SetYtrigger(80); |
| 58 |
|
| 59 |
installWifiFIFO(); |
| 60 |
installSoundFIFO(); |
| 61 |
|
| 62 |
mmInstall(FIFO_MAXMOD); |
| 63 |
|
| 64 |
installSystemFIFO(); |
| 65 |
|
| 66 |
irqSet(IRQ_VCOUNT, VcountHandler); |
| 67 |
irqSet(IRQ_VBLANK, VblankHandler); |
| 68 |
|
| 69 |
irqEnable( IRQ_VBLANK | IRQ_VCOUNT | IRQ_NETWORK); |
| 70 |
|
| 71 |
//try to crash the emulator by using invalid parameters for these SWI |
| 72 |
asm volatile ("mov r0, #0xFF0000\n"); |
| 73 |
asm volatile ("swi 0x1A0000\n"); |
| 74 |
asm volatile ("swi 0x1B0000\n"); |
| 75 |
asm volatile ("swi 0x1C0000\n"); |
| 76 |
|
| 77 |
// Keep the ARM7 mostly idle |
| 78 |
while (1) swiWaitForVBlank(); |
| 79 |
} |
| 80 |
|
| 81 |
|