diff options
Diffstat (limited to 'source')
| -rw-r--r-- | source/framebuffer.c | 2 | ||||
| -rw-r--r-- | source/gui.c | 2 | ||||
| -rw-r--r-- | source/keyboard.c | 2 | ||||
| -rw-r--r-- | source/main.c | 213 | ||||
| -rw-r--r-- | source/tapes.c | 2 | ||||
| -rw-r--r-- | source/zx81.c | 2 | 
6 files changed, 1 insertions, 222 deletions
| diff --git a/source/framebuffer.c b/source/framebuffer.c index 65bedc9..4a4b03d 100644 --- a/source/framebuffer.c +++ b/source/framebuffer.c @@ -23,8 +23,6 @@  #include <nds.h>  #include <string.h> -#include "ds81_global.h" -  /* ---------------------------------------- STATIC DATA  */  #define WIDTH	256 diff --git a/source/gui.c b/source/gui.c index e505330..713ad02 100644 --- a/source/gui.c +++ b/source/gui.c @@ -23,8 +23,6 @@  #include <nds.h>  #include <string.h> -#include "ds81_global.h" -  #include "framebuffer.h" diff --git a/source/keyboard.c b/source/keyboard.c index 76f16e6..eb50310 100644 --- a/source/keyboard.c +++ b/source/keyboard.c @@ -22,8 +22,6 @@  #include <nds.h> -#include "ds81_global.h" -  #include "keyboard.h"  #include "framebuffer.h"  #include "keyb_bin.h" diff --git a/source/main.c b/source/main.c index d0d0434..29f4448 100644 --- a/source/main.c +++ b/source/main.c @@ -25,12 +25,6 @@  #include <string.h>  #include <nds.h>  #include <fat.h> -#include <dswifi9.h> - -#include "ds81_ipc.h" - -#include "ds81_global.h" -#include "ds81_fader.h"  #include "framebuffer.h"  #include "gui.h" @@ -51,7 +45,6 @@ static const char *main_menu[]=  	    "Sticky Shift On",  	    "Sticky Shift Off",  	    "Map Joypad to Keys", -	    "Select Web Server (WFC)",  	    "Cancel",  	    NULL  	}; @@ -63,85 +56,15 @@ typedef enum      MenuStickyOn,      MenuStickyOff,      MenuMapJoypad, -    MenuConfigNetwork  } MenuOpt; - -/* Hope ints are atomic...  Having said that we are on the one processor so -   I doubt it'll mess up.  Which are usually famous last words. -*/ -static volatile int wifi_enabled = FALSE; - -static u32 main_heartbeat; - -  /* ---------------------------------------- IRQ FUNCS  */ -static void Timer(void) -{ -    { -    static int c=0; -    char s[32]; -    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)); -    } - -    Wifi_Timer(50); -} - -static void ARM9_SyncToARM7(void) -{ -    REG_IPC_FIFO_TX = DS81_WIFI_SYNC_IPC; -} - - -static void ARM9_Fifo(void) -{ -    static int c=0; -    u32 v; - -    v = REG_IPC_FIFO_RX; - -    { -    char s[32]; -    sprintf(s,"%d:%x     ",c++,v); -    FB_Print(s,0,184,FB_RGB(31,31,31),FB_RGB(10,10,10)); -    } - -    if (v == DS81_WIFI_SYNC_IPC) -    { -    	Wifi_Sync(); -    } -} - -  /* ---------------------------------------- DISPLAY FUNCS  */  static void VBlankFunc(void)  { -#if 0 -    char t[32]; - -    if (IPC->rtc_hours < 12) -    { -	sprintf(t,"%2.2d:%2.2d:%2.2d",IPC->rtc_hours, -				      IPC->rtc_minutes, -				      IPC->rtc_seconds); -    } -    else -    { -	sprintf(t,"%2.2d:%2.2d:%2.2d",IPC->rtc_hours-40, -				      IPC->rtc_minutes, -				      IPC->rtc_seconds); -    } - -    FB_Print(t,192,0,FB_RGB(31,31,31),FB_RGB(10,10,10)); - -    sprintf(t,"H:%8.8x  M:%8.8x",IPC->heartbeat,main_heartbeat); -    FB_Print(t,0,0,FB_RGB(31,31,31),FB_RGB(10,10,10)); -#endif -      scanKeys();  } @@ -203,7 +126,7 @@ static void Splash(void)  	FB_Centre("If you place .P tape files in",y,FB_RGB(31,31,31),-1);  	y += 8; -	FB_Centre("the top directory or ZX81TAPE",y,FB_RGB(31,31,31),-1); +	FB_Centre("the top directory or ZX81SNAP",y,FB_RGB(31,31,31),-1);  	y += 8;  	FB_Centre("then you should be able to load",y,FB_RGB(31,31,31),-1); @@ -297,122 +220,6 @@ static void MapJoypad(void)  } -/* ---------------------------------------- NETWORK CONFIGURATION -*/ -static const char *AssocStatus(enum WIFI_ASSOCSTATUS s, int *exit_loop) -{ -    switch(s) -    { -	case ASSOCSTATUS_DISCONNECTED: -	    return "Not trying to connect..."; - -	case ASSOCSTATUS_SEARCHING: -	    return "Searching for AP..."; - -	case ASSOCSTATUS_AUTHENTICATING: -	    return "Connecting (authenticate)..."; - -	case ASSOCSTATUS_ASSOCIATING: -	    return "Connecting (associating)..."; - -	case ASSOCSTATUS_ACQUIRINGDHCP: -	    return "Requesting IP address..."; - -	case ASSOCSTATUS_ASSOCIATED: -	    *exit_loop = 1; -	    return "Associated"; - -	case ASSOCSTATUS_CANNOTCONNECT: -	    *exit_loop = 1; -	    return "Cannot connect"; - -    	default: -	    *exit_loop = 1; -	    return "Unknown status"; -    } -} - -static void ConfigNetwork(void) -{ -    int col; -    int coli; -    u32 wifi_pass; -    enum WIFI_ASSOCSTATUS assoc; -    int exit_loop; - -    FB_Clear(); - -    FB_Centre("Initialising WIFI...",0,FB_RGB(31,31,31),-1); - -    wifi_pass = Wifi_Init(WIFIINIT_OPTION_USELED); - -    REG_IPC_FIFO_TX = DS81_WIFI_INIT_IPC; -    REG_IPC_FIFO_TX = wifi_pass; - -    Wifi_SetSyncHandler(ARM9_SyncToARM7); - -    FB_Centre("Waiting for WIFI...",10,FB_RGB(31,31,31),-1); - -    col = 31; -    coli = -1; - -    while(Wifi_CheckInit() == 0) -    { -	FB_Centre("Waiting for WIFI...",10,FB_RGB(col,col,col),-1); -	DS81_BOUNCE(col,coli); -	swiWaitForVBlank(); -    } - -    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; - -    while(!exit_loop) -    { -	assoc = Wifi_AssocStatus(); - -	FB_Centre(AssocStatus(assoc,&exit_loop),40,FB_RGB(col,col,col),-1); -	DS81_BOUNCE(col,coli); -	swiWaitForVBlank(); -    } - -    FB_Centre(AssocStatus(assoc,&exit_loop),40,FB_RGB(31,31,31),-1); - -    FB_Centre("Press a key...",60,FB_RGB(31,31,31),-1); - -    while(!keysDown()) -    { -	swiWaitForVBlank(); -    } - -    while(keysHeld()) -    { -	swiWaitForVBlank(); -    } - -    SK_DisplayKeyboard(BG_GFX_SUB); -    swiWaitForVBlank(); -} - -  /* ---------------------------------------- MAIN  */  int main(int argc, char *argv[]) @@ -460,18 +267,6 @@ int main(int argc, char *argv[])      irqSet(IRQ_VBLANK,VBlankFunc);      irqEnable(IRQ_VBLANK); -    REG_IPC_FIFO_CR = IPC_FIFO_ENABLE | IPC_FIFO_RECV_IRQ; - -    TIMER3_CR = 0; - -    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); -      /* All required stuff initialised      */      keysSetRepeat(30,15); @@ -499,8 +294,6 @@ int main(int argc, char *argv[])      {  	SoftKeyEvent ev; -	main_heartbeat++; -      	Z80Exec(z80);  	while(SK_GetEvent(&ev)) @@ -532,10 +325,6 @@ int main(int argc, char *argv[])  			    case MenuMapJoypad:  				MapJoypad();  			    	break; - -			    case MenuConfigNetwork: -			    	ConfigNetwork(); -				break;  			}  			SK_DisplayKeyboard(BG_GFX_SUB); diff --git a/source/tapes.c b/source/tapes.c index 5c49346..bc5ac8b 100644 --- a/source/tapes.c +++ b/source/tapes.c @@ -22,8 +22,6 @@  #include <nds.h> -#include "ds81_global.h" -  #include "tapes.h"  #include "framebuffer.h"  #include "keyboard.h" diff --git a/source/zx81.c b/source/zx81.c index 41ff686..d6edaa0 100644 --- a/source/zx81.c +++ b/source/zx81.c @@ -28,8 +28,6 @@  #include <ctype.h>  #include <nds.h> -#include "ds81_global.h" -  #include "zx81.h"  #include "gui.h" | 
