/src/nds/ds_win.h

https://bitbucket.org/ekolis/jackband · C Header · 94 lines · 29 code · 11 blank · 54 comment · 0 complexity · c4af5ec2dac970a7afdd0a7d864ac79f MD5 · raw file

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