diff options
author | Ian C <ianc@noddybox.co.uk> | 2006-10-28 23:28:31 +0000 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2006-10-28 23:28:31 +0000 |
commit | 73a685f5a17852b6990c0810d0f1f0984c2c358f (patch) | |
tree | 2d6bed133b7c59b2787c544a153798c723c64d16 /arm9/source/main.c | |
parent | 6fe1a8fd4735ce006d69cf8bb23df8f7adea7b41 (diff) |
Updates from work away
Diffstat (limited to 'arm9/source/main.c')
-rw-r--r-- | arm9/source/main.c | 62 |
1 files changed, 60 insertions, 2 deletions
diff --git a/arm9/source/main.c b/arm9/source/main.c index 1da90c2..1a3aa8c 100644 --- a/arm9/source/main.c +++ b/arm9/source/main.c @@ -22,7 +22,9 @@ #include <stdlib.h> #include <stdio.h> +#include <string.h> #include <nds.h> +#include <fat.h> #include "framebuffer.h" #include "gui.h" @@ -42,6 +44,7 @@ static const char *main_menu[]= "Select Tape", "Sticky Shift On", "Sticky Shift Off", + "Map Joypad to Keys", "Cancel", NULL }; @@ -52,6 +55,7 @@ typedef enum MenuSelectTape, MenuStickyOn, MenuStickyOff, + MenuMapJoypad } MenuOpt; @@ -74,11 +78,17 @@ static void Splash(void) "PRESS A TO CONTINUE", " ", "http://www.noddybox.co.uk/", + " ", + " ", + " ", + " ", + "Checking for FAT device...", NULL }; sImage img; int f; + int y; FB_Clear(); @@ -87,9 +97,53 @@ static void Splash(void) FB_Blit(&img,0,0); + y=10; + for(f=0;text[f];f++) { - FB_Centre(text[f],10+f*8,FB_RGB(31,31,31),-1); + FB_Centre(text[f],y,FB_RGB(31,31,31),-1); + y+=8; + } + + y+=8; + + if (fatInitialise(32,true)) + { + ZX81EnableFileSystem(TRUE); + + FB_Centre("Found a FAT device.",y,FB_RGB(31,31,31),-1); + y+=8; + + 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); + y+=8; + + FB_Centre("then you should be able to load",y,FB_RGB(31,31,31),-1); + y+=8; + + FB_Centre("GAME.P with the command",y,FB_RGB(31,31,31),-1); + y+=8; + + FB_Centre("LOAD \"GAME\"",y,FB_RGB(31,31,31),-1); + y+=8; + } + else + { + ZX81EnableFileSystem(FALSE); + + FB_Centre("Sorry, but you don't have a",y,FB_RGB(31,31,31),-1); + y+=8; + + FB_Centre("supported FAT device.",y,FB_RGB(31,31,31),-1); + y+=8; + + FB_Centre("Only the internal tape",y,FB_RGB(31,31,31),-1); + y+=8; + + FB_Centre("files can be used.",y,FB_RGB(31,31,31),-1); + y+=8; } ZX81DisplayString("10 print '%the zx81 is ace%'\n20 goto 10"); @@ -153,7 +207,7 @@ int main(int argc, char *argv[]) if (!z80) { - return EXIT_FAILURE; + GUI_Alert(TRUE,"Failed to initialise\nthe Z80 CPU emulation!"); } ZX81Init((uint16*)SCREEN_BASE_BLOCK(0), z80); @@ -195,6 +249,10 @@ int main(int argc, char *argv[]) case MenuStickyOff: SK_SetSticky(SK_SHIFT,0); break; + + case MenuMapJoypad: + SK_DisplayKeyboard(BG_GFX_SUB); + break; } SK_DisplayKeyboard(BG_GFX_SUB); |