summaryrefslogtreecommitdiff
path: root/apps/plugins/pacbox/pacbox.h
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2006-03-13 01:42:11 +0000
committerDave Chapman <dave@dchapman.com>2006-03-13 01:42:11 +0000
commitad8b24d90c1599421202f44dba94a645501ca81d (patch)
treebefb64af540365dede1ff98216e7c3cd334b48e2 /apps/plugins/pacbox/pacbox.h
parentb1b0e42ddd03a677523c67135302393fa9f8b19c (diff)
downloadrockbox-ad8b24d90c1599421202f44dba94a645501ca81d.tar.gz
rockbox-ad8b24d90c1599421202f44dba94a645501ca81d.zip
Various improvements and code re-organisation: Optimised assembler LCD rendering function for the iPod 5G by me and an optimisations to the sprite drawing routines courtesy of stripwax (these improvements make pacbox almost realtime on the iPod 5G). MENU+SELECT now brings up the menu on the iPod instead of the hold switch.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9018 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/pacbox/pacbox.h')
-rw-r--r--apps/plugins/pacbox/pacbox.h91
1 files changed, 91 insertions, 0 deletions
diff --git a/apps/plugins/pacbox/pacbox.h b/apps/plugins/pacbox/pacbox.h
new file mode 100644
index 0000000000..84bd8a7be8
--- /dev/null
+++ b/apps/plugins/pacbox/pacbox.h
@@ -0,0 +1,91 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Pacbox - a Pacman Emulator for Rockbox
11 *
12 * Based on PIE - Pacman Instructional Emulator
13 *
14 * Copyright (c) 1997-2003,2004 Alessandro Scotti
15 * http://www.ascotti.org/
16 *
17 * All files in this archive are subject to the GNU General Public License.
18 * See the file COPYING in the source tree root for full license agreement.
19 *
20 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 * KIND, either express or implied.
22 *
23 ****************************************************************************/
24
25/* Platform-specific defines - used in both C and ASM files */
26
27#ifndef _PACBOX_H
28#define _PACBOX_H
29
30#include "config.h"
31
32#if CONFIG_KEYPAD == IPOD_4G_PAD
33
34#define PACMAN_UP BUTTON_RIGHT
35#define PACMAN_DOWN BUTTON_LEFT
36#define PACMAN_LEFT BUTTON_MENU
37#define PACMAN_RIGHT BUTTON_PLAY
38#define PACMAN_1UP BUTTON_SELECT
39#define PACMAN_COIN BUTTON_SELECT
40#define PACMAN_MENU (BUTTON_MENU | BUTTON_SELECT)
41
42#elif CONFIG_KEYPAD == IRIVER_H100_PAD || CONFIG_KEYPAD == IRIVER_H300_PAD
43
44#define PACMAN_UP BUTTON_RIGHT
45#define PACMAN_DOWN BUTTON_LEFT
46#define PACMAN_LEFT BUTTON_UP
47#define PACMAN_RIGHT BUTTON_DOWN
48#define PACMAN_1UP BUTTON_SELECT
49#define PACMAN_2UP BUTTON_ON
50#define PACMAN_COIN BUTTON_REC
51#define PACMAN_MENU BUTTON_MODE
52
53#elif CONFIG_KEYPAD == GIGABEAT_PAD
54
55#define PACMAN_UP BUTTON_UP
56#define PACMAN_DOWN BUTTON_DOWN
57#define PACMAN_LEFT BUTTON_LEFT
58#define PACMAN_RIGHT BUTTON_RIGHT
59#define PACMAN_1UP BUTTON_SELECT
60#define PACMAN_2UP BUTTON_POWER
61#define PACMAN_COIN BUTTON_A
62#define PACMAN_MENU BUTTON_MENU
63
64#elif CONFIG_KEYPAD == IAUDIO_X5_PAD
65
66#define PACMAN_UP BUTTON_RIGHT
67#define PACMAN_DOWN BUTTON_LEFT
68#define PACMAN_LEFT BUTTON_UP
69#define PACMAN_RIGHT BUTTON_DOWN
70#define PACMAN_1UP BUTTON_SELECT
71#define PACMAN_2UP BUTTON_POWER
72#define PACMAN_COIN BUTTON_REC
73#define PACMAN_MENU BUTTON_PLAY
74
75#endif
76
77#if (LCD_HEIGHT >= 288)
78#define XOFS ((LCD_WIDTH-224)/2)
79#define YOFS ((LCD_HEIGHT-288)/2)
80#elif (LCD_WIDTH >= 288)
81#define XOFS ((LCD_WIDTH-288)/2)
82#define YOFS ((LCD_HEIGHT-224)/2)
83#elif (LCD_WIDTH >= 220)
84#define XOFS ((LCD_WIDTH-(288*3/4))/2)
85#define YOFS ((LCD_HEIGHT-(224*3/4))/2)
86#elif (LCD_WIDTH >= 144)
87#define XOFS ((LCD_WIDTH-288/2)/2)
88#define YOFS ((LCD_HEIGHT-224/2)/2)
89#endif
90
91#endif