From 50d960d99f0783799f81236d9225a6940606fe38 Mon Sep 17 00:00:00 2001
From: Ian C <ianc@noddybox.co.uk>
Date: Thu, 11 Jan 2007 23:49:35 +0000
Subject: *** empty log message ***

---
 arm9/source/main.c | 27 +++++++++++++++++++--------
 source/main.c      | 27 +++++++++++++++++++--------
 2 files changed, 38 insertions(+), 16 deletions(-)

diff --git a/arm9/source/main.c b/arm9/source/main.c
index 0f996bb..d0d0434 100644
--- a/arm9/source/main.c
+++ b/arm9/source/main.c
@@ -83,14 +83,11 @@ static void Timer(void)
     {
     static int c=0;
     char s[32];
-    sprintf(s,"%d",(c++)/50);
+    sprintf(s,"C:%d H:%d",(c++)/50,IPC->heartbeat);
     FB_Print(s,0,184-10,FB_RGB(31,31,31),FB_RGB(10,10,10));
     }
 
-    if (wifi_enabled)
-    {
-	Wifi_Timer(50);
-    }
+    Wifi_Timer(50);
 }
 
 static void ARM9_SyncToARM7(void)
@@ -193,7 +190,7 @@ static void Splash(void)
     y += 8;
 
 #ifndef DS81_DISABLE_FAT
-    res = fatInitialise(32,true);
+    res = fatInitDefault();
 #endif
 
     if (res)
@@ -353,7 +350,6 @@ static void ConfigNetwork(void)
     REG_IPC_FIFO_TX = wifi_pass;
 
     Wifi_SetSyncHandler(ARM9_SyncToARM7);
-    wifi_enabled = TRUE;
 
     FB_Centre("Waiting for WIFI...",10,FB_RGB(31,31,31),-1);
 
@@ -369,9 +365,23 @@ static void ConfigNetwork(void)
 
     FB_Centre("Waiting for WIFI...",10,FB_RGB(31,31,31),-1);
 
+    wifi_enabled = TRUE;
+
     FB_Centre("Using WFC settings...",20,FB_RGB(31,31,31),-1);
     Wifi_AutoConnect();
 
+    /*
+    {
+    static Wifi_AccessPoint p;
+    static unsigned char key[32];
+
+    strcpy(p.ssid,"NODDYBOX_WAP");
+    p.ssid_len=strlen(p.ssid);
+    p.channel=11;
+    Wifi_ConnectAP(&p,0,0,key);
+    }
+    */
+
     FB_Centre("Waiting for association...",30,FB_RGB(31,31,31),-1);
     exit_loop = FALSE;
 
@@ -411,7 +421,7 @@ int main(int argc, char *argv[])
 
     powerON(POWER_ALL_2D);
 
-    /* Set up main text screen and grab the ROM character data
+    /* Set up main text screen and load the ROM character data
     */
     videoSetMode(MODE_0_2D | DISPLAY_BG0_ACTIVE);
 
@@ -457,6 +467,7 @@ int main(int argc, char *argv[])
     irqSet(IRQ_TIMER3,Timer);
     TIMER3_DATA = TIMER_FREQ_256(20);
     TIMER3_CR = TIMER_ENABLE | TIMER_IRQ_REQ | TIMER_DIV_256;
+    irqEnable(IRQ_TIMER3);
 
     irqSet(IRQ_FIFO_NOT_EMPTY,ARM9_Fifo);
     irqEnable(IRQ_FIFO_NOT_EMPTY);
diff --git a/source/main.c b/source/main.c
index 0f996bb..d0d0434 100644
--- a/source/main.c
+++ b/source/main.c
@@ -83,14 +83,11 @@ static void Timer(void)
     {
     static int c=0;
     char s[32];
-    sprintf(s,"%d",(c++)/50);
+    sprintf(s,"C:%d H:%d",(c++)/50,IPC->heartbeat);
     FB_Print(s,0,184-10,FB_RGB(31,31,31),FB_RGB(10,10,10));
     }
 
-    if (wifi_enabled)
-    {
-	Wifi_Timer(50);
-    }
+    Wifi_Timer(50);
 }
 
 static void ARM9_SyncToARM7(void)
@@ -193,7 +190,7 @@ static void Splash(void)
     y += 8;
 
 #ifndef DS81_DISABLE_FAT
-    res = fatInitialise(32,true);
+    res = fatInitDefault();
 #endif
 
     if (res)
@@ -353,7 +350,6 @@ static void ConfigNetwork(void)
     REG_IPC_FIFO_TX = wifi_pass;
 
     Wifi_SetSyncHandler(ARM9_SyncToARM7);
-    wifi_enabled = TRUE;
 
     FB_Centre("Waiting for WIFI...",10,FB_RGB(31,31,31),-1);
 
@@ -369,9 +365,23 @@ static void ConfigNetwork(void)
 
     FB_Centre("Waiting for WIFI...",10,FB_RGB(31,31,31),-1);
 
+    wifi_enabled = TRUE;
+
     FB_Centre("Using WFC settings...",20,FB_RGB(31,31,31),-1);
     Wifi_AutoConnect();
 
+    /*
+    {
+    static Wifi_AccessPoint p;
+    static unsigned char key[32];
+
+    strcpy(p.ssid,"NODDYBOX_WAP");
+    p.ssid_len=strlen(p.ssid);
+    p.channel=11;
+    Wifi_ConnectAP(&p,0,0,key);
+    }
+    */
+
     FB_Centre("Waiting for association...",30,FB_RGB(31,31,31),-1);
     exit_loop = FALSE;
 
@@ -411,7 +421,7 @@ int main(int argc, char *argv[])
 
     powerON(POWER_ALL_2D);
 
-    /* Set up main text screen and grab the ROM character data
+    /* Set up main text screen and load the ROM character data
     */
     videoSetMode(MODE_0_2D | DISPLAY_BG0_ACTIVE);
 
@@ -457,6 +467,7 @@ int main(int argc, char *argv[])
     irqSet(IRQ_TIMER3,Timer);
     TIMER3_DATA = TIMER_FREQ_256(20);
     TIMER3_CR = TIMER_ENABLE | TIMER_IRQ_REQ | TIMER_DIV_256;
+    irqEnable(IRQ_TIMER3);
 
     irqSet(IRQ_FIFO_NOT_EMPTY,ARM9_Fifo);
     irqEnable(IRQ_FIFO_NOT_EMPTY);
-- 
cgit v1.2.3