summaryrefslogtreecommitdiff
path: root/source/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/main.c')
-rw-r--r--source/main.c62
1 files changed, 60 insertions, 2 deletions
diff --git a/source/main.c b/source/main.c
index 1da90c2..1a3aa8c 100644
--- a/source/main.c
+++ b/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);