From 73a685f5a17852b6990c0810d0f1f0984c2c358f Mon Sep 17 00:00:00 2001 From: Ian C Date: Sat, 28 Oct 2006 23:28:31 +0000 Subject: Updates from work away --- arm9/source/main.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 60 insertions(+), 2 deletions(-) (limited to 'arm9/source/main.c') 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 #include +#include #include +#include #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); -- cgit v1.2.3