Advertisement
MoonWatcherMD

MD/G Scroll - scroll.h

Dec 22nd, 2012
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.04 KB | None | 0 0
  1. #ifndef _SCROLL_H_
  2. #define _SCROLL_H_ 1
  3.  
  4.  
  5.  
  6. typedef struct
  7. {
  8.     u16  width;
  9.     u16  height;
  10.     u16  nbColors;
  11.     u32  ptrPal;
  12.     u16  nbTiles;
  13.     u32  ptrTiles;
  14.     u16  nbLayers;
  15.     u32 *maps;
  16. }
  17. MAPPY_RES;
  18.  
  19.  
  20. typedef struct
  21. {
  22.     s32 x;
  23.     s32 y;
  24.  
  25.     MAPPY_RES *res;
  26.     u8  pal;
  27.     u16 vram;
  28.     u16 plan;
  29.     u8  level;
  30.  
  31.     s8 scrollH;
  32.     s8 scrollV;
  33.  
  34.     s32 plan_x;
  35.     s32 plan_y;
  36. }
  37. SCROLL;
  38.  
  39.  
  40.  
  41.  
  42. u16  scroll_init     ( u16 plan, MAPPY_RES *res, u16 pal );
  43. void scroll_show     ( u16 plan );
  44. void scroll_move     ( u16 plan, s8 *x, s8 *y );
  45. s8   scroll_move_x   ( u16 plan, s8 value );
  46. s8   scroll_move_y   ( u16 plan, s8 value );
  47. void scroll_update   ( u16 plan );
  48. void scroll_repeat   ( u16 plan, BOOL x, BOOL y );
  49. void scroll_repeat_x ( u16 plan, BOOL repeat );
  50. void scroll_repeat_y ( u16 plan, BOOL repeat );
  51.  
  52. static s32  _trunc  ( s32 value, s32 max );
  53. static void _col    ( SCROLL scr, s32 column );
  54. static void _row    ( SCROLL scr, s32 row    );
  55. //static s8   _limits ( BOOL repeat, s16 pos, s8 value, u16 length, u16 screen );
  56.  
  57.  
  58.  
  59. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement