Angband
ds_win.h
Go to the documentation of this file.
1 
2 #ifndef DS_WIN_H
3 #define DS_WIN_H
4 
5 //#include "hack.h"
6 
7 extern struct window_procs nds_procs;
8 extern bool nds_draw_text;
9 extern u8 nds_updated;
10 
11 /*
12 typedef struct NDS_MENU_ITEM_STRUCT{
13  struct NDS_MENU_ITEM_STRUCT* n;
14  u8 acc, gacc;
15  char title[80];
16  menu_item mi;
17 } nds_nhmenuitem;
18 
19 typedef struct {
20  nds_nhmenuitem* f;
21  nds_nhmenuitem* l;
22  //char prompt[BUFSZ];
23  u8 width;
24 } nds_nhmenu;
25 
26 typedef struct {
27  u16 type;
28  u16 cx, cy; // in chars/tiles
29  u16 x, y; // in chars/tiles
30 #define wrote_this_turn x // WIN_MESSAGE only
31 #define center_x x // WIN_MAP only
32 #define center_y y // WIN_MAP only
33 // for compatibility with old ds_gfx.c:
34 //#define center_pos x // WIN_MAP only
35  nds_nhmenu m;
36  u16* data; // what to draw on the screen
37  u16* text; // text buffer for later display (NHW_MENU, NHW_TEXT)
38  u16 cols, rows;
39  boolean vis;
40 } nds_nhwindow;
41 
42 #define MAX_WINDOWS 8 // if you change this, you must also change the size
43  // of nds_updated in this file and ds_winhelp.c
44 extern nds_nhwindow wins[MAX_WINDOWS];
45 // only need WIN_TEXT for windows 3-7 = 0x014000 bytes
46 // WIN_TEXT(0) = 0x06874000 - 0x06878000, WIN_TEXT(3) = 0x06880000 - 0x06884000,
47 // WIN_TEXT(7) = 0x06890000 - 0x06894000
48 // memory used is vram banks E & F
49 #define WIN_TEXT(w) ((u16*)(0x06874000 + (0x4000 * (w))))
50 */
51 #define MAX_EBUF 512 // max of 512 events in queue = 1024 bytes
52 #define MEVENT_FLAG (1<<15)
53 #define EVENT_SET (1<<14)
54 #define EVENT_X(e) ((u8)((e) & 0x7F))
55 #define EVENT_Y(e) ((u8)(((e) & 0xF8) >> 7))
56 #define EVENT_C(e) ((u8)((e) & 0xFF))
57 #define IS_MEVENT(e) ((e) & MEVENT_FLAG)
58 
59 #define MORE_MSG "--More--"
60 #define MORE_LEN 8
61 #define LINE_LEN 85
62 #define LINE_LIMIT ((LINE_LEN)-(MORE_LEN))
63 
64 extern short glyph2tile[];
65 
66 bool has_event();
67 u16 get_event();
68 void put_key_event(u8 c);
69 void put_mouse_event(u8 x, u8 y);
70 //winid find_unused_window(int dir);
71 void more_print(const char*);
72 //void nds_win_updated(winid);
73 void do_more();
74 
75 void nds_raw_print(const char *);
76 void nds_raw_print_bold(const char *);
77 //void nds_putstr(winid, int, const char *);
78 //void nds_clear_nhwindow(winid);
79 int nds_nhgetch(void);
80 //void nds_curs(winid, int, int);
81 void nds_getlin2(const char*, char*, int);
82 //winid nds_create_nhwindow(int);
83 //void nds_destroy_nhwindow(winid);
84 //void nds_display_nhwindow(winid, boolEAN_P);
85 //void nds_start_menu(winid);
86 //void nds_add_menu(winid, int, const ANY_P *, CHAR_P, CHAR_P, int, const char *, boolEAN_P);
87 //void nds_end_menu(winid, const char*);
88 //int nds_select_menu(winid, int, menu_item**);
89 //void nds_free_menu(winid);
90 void nds_exit_nhwindows(const char *);
91 
92 
93 #endif
94 
struct window_procs nds_procs
void do_more()
void more_print(const char *)
bool has_event()
Definition: main-nds.c:555
int nds_nhgetch(void)
short glyph2tile[]
u16 get_event()
Definition: main-nds.c:561
void nds_raw_print(const char *)
Definition: main-nds.c:1367
void nds_raw_print_bold(const char *)
bool nds_draw_text
u8 nds_updated
Definition: main-nds.c:553
void nds_getlin2(const char *, char *, int)
void put_key_event(u8 c)
void put_mouse_event(u8 x, u8 y)
void nds_exit_nhwindows(const char *)