comparison src/ljds.h @ 0:c84446dfb3f5

initial add
author paulo@localhost
date Fri, 13 Mar 2009 00:39:12 -0700
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e640ae5e5a62
1 /* DS frontend for LOCKJAW, an implementation of the Soviet Mind Game
2
3 Copyright (C) 2006 Damian Yerrick <tepples+lj@spamcop.net>
4
5 This work is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
19 Original game concept and design by Alexey Pajitnov.
20 The Software is not sponsored or endorsed by Alexey Pajitnov, Elorg,
21 or The Tetris Company LLC.
22
23 */
24
25 #ifndef LJDS_H
26 #define LJDS_H
27
28 #include <nds.h>
29 #include <stdlib.h>
30 #include "ljcontrol.h"
31
32 //#define SPR_VRAM(x) ((u32 *)(0x06420000 + 32 * x))
33 #define SPR_VRAM(x) ((u32 *)(0x06400000 + 32 * x))
34 #define MAINOAM ((SpriteEntry *)0x07000000)
35
36 #define PATRAM4(x, tn) ((u32 *)(BG_TILE_RAM(0) | (((x) << 14) + ((tn) << 5)) ))
37
38 #ifndef MAP
39 typedef u16 NAMETABLE[32][32];
40
41 #define MAP ((NAMETABLE *)BG_MAP_RAM(0))
42 #define MAP_HFLIP 0x0400
43 #define MAP_VFLIP 0x0800
44 #define MAP_FLIP 0x0c00
45 #define MAP_PALETTE(x) ((x) << 12)
46 #endif
47
48 struct LJPCView {
49 const u16 *sndData[4];
50 u8 sndLeft[4];
51 };
52
53 #define KEY_TOUCH_RIGHT (KEY_RIGHT << 8)
54 #define KEY_TOUCH_LEFT (KEY_LEFT << 8)
55 #define KEY_TOUCH_UP (KEY_UP << 8)
56 #define KEY_TOUCH_DOWN (KEY_DOWN << 8)
57
58 extern short mouse_x, mouse_y;
59 extern LJBits mouse_b;
60
61 void textout(const char *str, int x, int y, int c);
62 void isr(void);
63 void cls(void);
64 void vsync(void);
65 LJBits readPad(unsigned int player);
66 extern volatile int curTime;
67
68 void install_sound(void);
69 void gba_poll_sound(struct LJPCView *v);
70 void gba_play_sound(struct LJPCView *v, int effect);
71
72 extern unsigned char customPrefs[];
73 void options(LJView *view, unsigned char *prefs);
74
75 int needLidSleep(void);
76 void debrief(const LJView *v);
77 #endif