summaryrefslogtreecommitdiff
path: root/apps/plugins/xrick/scr_xrick.c
diff options
context:
space:
mode:
authorSebastian Leonhardt <sebastian.leonhardt@web.de>2016-01-08 01:05:36 +0100
committerSolomon Peachy <pizza@shaftnet.org>2024-06-30 17:24:16 -0400
commit102c3742487dba76ec72d5f56a2c3041344b2d68 (patch)
tree4931ad34d2cc0bac56d9984b9ead355d012ad63a /apps/plugins/xrick/scr_xrick.c
parent6f1e67e5e318ba2fd0f5ec1892c7b6633ec6521c (diff)
downloadrockbox-102c3742487dba76ec72d5f56a2c3041344b2d68.tar.gz
rockbox-102c3742487dba76ec72d5f56a2c3041344b2d68.zip
added xrick game
original xrick code by 'BigOrno' at: http://www.bigorno.net/xrick/ Rockbox port, plus bugfixes at: https://github.com/pierluigi-vicinanza/xrick Further changes: * Additonal fixes from g#3026 * Port to modern plugin API * Add Pluginlib keymap fallback * Support all >1bpp screens * Fix build warnings in miniz * Better error message when resources are missing Change-Id: Id83928bc2539901b0221692f65cbca41389c58e7
Diffstat (limited to 'apps/plugins/xrick/scr_xrick.c')
-rw-r--r--apps/plugins/xrick/scr_xrick.c101
1 files changed, 101 insertions, 0 deletions
diff --git a/apps/plugins/xrick/scr_xrick.c b/apps/plugins/xrick/scr_xrick.c
new file mode 100644
index 0000000000..00798ec123
--- /dev/null
+++ b/apps/plugins/xrick/scr_xrick.c
@@ -0,0 +1,101 @@
1/*
2 * xrick/scr_xrick.c
3 *
4 * Copyright (C) 1998-2002 BigOrno (bigorno@bigorno.net).
5 * Copyright (C) 2008-2014 Pierluigi Vicinanza.
6 * All rights reserved.
7 *
8 * The use and distribution terms for this software are contained in the file
9 * named README, which can be found in the root of this distribution. By
10 * using this software in any fashion, you are agreeing to be bound by the
11 * terms of this license.
12 *
13 * You must not remove this notice, or any other, from this software.
14 */
15
16#include "xrick/screens.h"
17
18#include "xrick/game.h"
19#include "xrick/draw.h"
20#include "xrick/control.h"
21#include "xrick/data/img.h"
22#include "xrick/system/system.h"
23
24/*
25 * global vars
26 */
27size_t screen_nbr_imapsl = 0;
28U8 *screen_imapsl = NULL;
29
30size_t screen_nbr_imapstesps = 0;
31screen_imapsteps_t *screen_imapsteps = NULL;
32
33size_t screen_nbr_imapsofs = 0;
34U8 *screen_imapsofs = NULL;
35
36size_t screen_nbr_imaptext = 0;
37U8 **screen_imaptext = NULL;
38
39size_t screen_nbr_hiscores = 0;
40hiscore_t *screen_highScores = NULL;
41
42#ifdef GFXPC
43U8 *screen_imainhoft = NULL;
44U8 *screen_imainrdt = NULL;
45U8 *screen_imaincdc = NULL;
46U8 *screen_congrats = NULL;
47#endif
48U8 *screen_gameovertxt = NULL;
49U8 *screen_pausedtxt = NULL;
50
51
52/*
53 * Display XRICK splash screen
54 *
55 * return: SCREEN_RUNNING, SCREEN_DONE, SCREEN_EXIT
56 */
57U8
58screen_xrick(void)
59{
60 static U8 seq = 0;
61 static U8 wait = 0;
62
63 if (seq == 0) {
64 sysvid_clear();
65 draw_img(img_splash);
66 game_rects = &draw_SCREENRECT;
67 seq = 1;
68 }
69
70 switch (seq) {
71 case 1: /* wait */
72 if (wait++ > 0x2) {
73#ifdef ENABLE_SOUND
74 game_setmusic(soundBullet, 1);
75#endif
76 seq = 2;
77 wait = 0;
78 }
79 break;
80
81 case 2: /* wait */
82 if (wait++ > 0x20) {
83 seq = 99;
84 wait = 0;
85 }
86 }
87
88 if (control_test(Control_EXIT)) /* check for exit request */
89 return SCREEN_EXIT;
90
91 if (seq == 99) { /* we're done */
92 sysvid_clear();
93 sysvid_setGamePalette();
94 seq = 0;
95 return SCREEN_DONE;
96 }
97
98 return SCREEN_RUNNING;
99}
100
101/* eof */