/src/nds/ds_win.h
C Header | 94 lines | 29 code | 11 blank | 54 comment | 0 complexity | c4af5ec2dac970a7afdd0a7d864ac79f MD5 | raw file
1 2#ifndef DS_WIN_H 3#define DS_WIN_H 4 5//#include "hack.h" 6 7extern struct window_procs nds_procs; 8extern bool nds_draw_text; 9extern u8 nds_updated; 10 11/* 12typedef 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 19typedef struct { 20 nds_nhmenuitem* f; 21 nds_nhmenuitem* l; 22 //char prompt[BUFSZ]; 23 u8 width; 24} nds_nhmenu; 25 26typedef 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 44extern 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 64extern short glyph2tile[]; 65 66bool has_event(); 67u16 get_event(); 68void put_key_event(u8 c); 69void put_mouse_event(u8 x, u8 y); 70//winid find_unused_window(int dir); 71void more_print(const char*); 72//void nds_win_updated(winid); 73void do_more(); 74 75void nds_raw_print(const char *); 76void nds_raw_print_bold(const char *); 77//void nds_putstr(winid, int, const char *); 78//void nds_clear_nhwindow(winid); 79int nds_nhgetch(void); 80//void nds_curs(winid, int, int); 81void 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); 90void nds_exit_nhwindows(const char *); 91 92 93#endif 94