summaryrefslogtreecommitdiff
path: root/source/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/main.c')
-rw-r--r--source/main.c151
1 files changed, 111 insertions, 40 deletions
diff --git a/source/main.c b/source/main.c
index 0cab2ab..e8b4c6b 100644
--- a/source/main.c
+++ b/source/main.c
@@ -28,11 +28,18 @@
#include "gui.h"
#include "z80.h"
#include "spec.h"
+#include "snap.h"
#include "keyboard.h"
#include "error.h"
#include "splashimg_bin.h"
+/* Put tape image includes here
+*/
+#include "manic_miner_bin.h"
+#include "ant3d_bin.h"
+#include "thrust_bin.h"
+
/* ---------------------------------------- STATIC DATA
*/
static const char *main_menu[]=
@@ -55,6 +62,40 @@ typedef enum
MenuDefineJoystick
} MenuOpt;
+static struct
+{
+ const u8 *tape;
+ const u32 *len;
+ const char *name;
+ const char *author;
+} tape_image_list[] =
+ {
+ {
+ manic_miner_bin,
+ &manic_miner_bin_size,
+ "Manic Miner",
+ "Matt Smith"
+ },
+
+ {
+ ant3d_bin,
+ &ant3d_bin_size,
+ "3D Ant Attack",
+ "Sandy White & Angela Sutherland"
+ },
+
+ {
+ thrust_bin,
+ &thrust_bin_size,
+ "Thrust",
+ "Jeremy Smith & D.Lowe"
+ },
+
+ /* List terminated with 0s
+ */
+ {0}
+ };
+
/* ---------------------------------------- DISPLAY FUNCS
*/
@@ -65,7 +106,7 @@ static void VBlankFunc(void)
static void Splash(void)
{
- static const char *text[]=
+ static const char *start_text[]=
{
"DS-SPEC",
"\177 2006 Ian C",
@@ -73,19 +114,13 @@ static void Splash(void)
"SPECTRUM ROM",
"\177 Amstrad PLC",
" ",
- "Manic Miner",
- "by Matthew Smith",
- " ",
- "Ant Attack by",
- "Sandy White/Angela Sutherland",
- " ",
- "Thrust by",
- "Jeremy Smith and D.Lowe",
- " ",
- "Only play these images if",
- "you legallly own a copy.",
+ NULL
+ };
+
+ static const char *end_text[]=
+ {
" ",
- "PRESS A TO CONTINUE",
+ "PRESS START",
" ",
"http://www.noddybox.co.uk/",
NULL
@@ -93,6 +128,7 @@ static void Splash(void)
sImage img;
int f;
+ int y;
loadPCX(splashimg_bin,&img);
image8to16(&img);
@@ -107,12 +143,37 @@ static void Splash(void)
FB_Box(0,0,SCREEN_WIDTH,SCREEN_HEIGHT,FB_RGB(31,31,31));
- for(f=0;text[f];f++)
+ y=10;
+
+ for(f=0;start_text[f];f++)
+ {
+ FB_Centre(start_text[f],y,FB_RGB(31,31,31),-1);
+ y+=8;
+ }
+
+ for(f=0;f<3 && tape_image_list[f].tape;f++)
+ {
+ FB_Centre(tape_image_list[f].name,y,FB_RGB(31,31,0),-1);
+ y+=8;
+ FB_Centre(tape_image_list[f].author,y,FB_RGB(0,31,31),-1);
+ y+=8;
+ FB_Centre(" ",y,FB_RGB(31,31,31),-1);
+ y+=8;
+ }
+
+ if (tape_image_list[f].tape)
{
- FB_Centre(text[f],10+f*8,FB_RGB(31,31,31),-1);
+ FB_Centre("...more...",y,FB_RGB(31,31,31),-1);
+ y+=8;
}
- while(!(keysDown() & KEY_A))
+ for(f=0;end_text[f];f++)
+ {
+ FB_Centre(end_text[f],y,FB_RGB(31,31,31),-1);
+ y+=8;
+ }
+
+ while(!(keysDown() & KEY_START))
{
swiWaitForVBlank();
}
@@ -170,6 +231,15 @@ int main(int argc, char *argv[])
SPECInit(BG_GFX,z80);
SK_DisplayKeyboard(BG_GFX_SUB);
+ SK_SetSticky(SK_CAPS,1);
+ SK_SetSticky(SK_SYMBOL,1);
+
+ if (tape_image_list[0].tape)
+ {
+ TAPSetTape(tape_image_list[0].tape,
+ *tape_image_list[0].len);
+ }
+
while(1)
{
SoftKeyEvent ev;
@@ -182,26 +252,33 @@ int main(int argc, char *argv[])
{
case SK_ABOUT:
case SK_CONFIG:
- switch(GUI_Menu(main_menu))
+ if (ev.pressed)
{
- case MenuReset:
- SPECReset(z80);
- break;
-
- case MenuSelectTape:
- break;
-
- case MenuStickyOn:
- break;
-
- case MenuStickyOff:
- break;
-
- case MenuDefineJoystick:
- break;
+ switch(GUI_Menu(main_menu))
+ {
+ case MenuReset:
+ SPECReset(z80);
+ break;
+
+ case MenuSelectTape:
+ break;
+
+ case MenuStickyOn:
+ SK_SetSticky(SK_CAPS,1);
+ SK_SetSticky(SK_SYMBOL,1);
+ break;
+
+ case MenuStickyOff:
+ SK_SetSticky(SK_CAPS,0);
+ SK_SetSticky(SK_SYMBOL,0);
+ break;
+
+ case MenuDefineJoystick:
+ break;
+ }
+
+ SK_DisplayKeyboard(BG_GFX_SUB);
}
-
- SK_DisplayKeyboard(BG_GFX_SUB);
break;
default:
@@ -209,11 +286,5 @@ int main(int argc, char *argv[])
break;
}
}
-
- {
- static int pressed=0;
- SPECHandleKey(SK_P,pressed);
- pressed=!pressed;
- }
}
}