graph.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. #ifndef __GRAPH
  2. #define __GRAPH
  3. #include <default.h>
  4. /* Begin Auto-Generated Part */
  5. #define BITMAP_HDR_SIZE 4
  6. #define LCD_MEM ((void*)0x4C00)
  7. #define LCD_SIZE 3840
  8. #ifndef __HAVE_Bool
  9. #define __HAVE_Bool
  10. enum Bool{FALSE,TRUE};
  11. #endif
  12. #ifndef __HAVE_WIN_COORDS
  13. #define __HAVE_WIN_COORDS
  14. typedef short WIN_COORDS;
  15. #endif
  16. #ifndef __HAVE_WIN_RECT
  17. #define __HAVE_WIN_RECT
  18. typedef struct{short x0,y0,x1,y1;}WIN_RECT;
  19. #endif
  20. #ifndef __HAVE_Attrs
  21. #define __HAVE_Attrs
  22. enum Attrs{A_REVERSE,A_NORMAL,A_XOR,A_SHADED,A_REPLACE,A_OR,A_AND,A_THICK1,A_SHADE_V,A_SHADE_H,A_SHADE_NS,A_SHADE_PS};
  23. #endif
  24. #ifndef __HAVE_BITMAP
  25. #define __HAVE_BITMAP
  26. typedef struct{unsigned short NumRows,NumCols;unsigned char Data[];}BITMAP;
  27. #endif
  28. #ifndef __HAVE_BoxAttrs
  29. #define __HAVE_BoxAttrs
  30. enum BoxAttrs{B_NORMAL=0x10,B_ROUNDED=0x20,B_DOUBLE=0x40,B_CUT=0x80};
  31. #endif
  32. #ifndef __HAVE_Fonts
  33. #define __HAVE_Fonts
  34. enum Fonts{F_4x6,F_6x8,F_8x10};
  35. #endif
  36. #ifndef __HAVE_ICON
  37. #define __HAVE_ICON
  38. typedef struct{unsigned short i[16];}ICON;
  39. #endif
  40. typedef char LCD_BUFFER[LCD_SIZE];
  41. typedef struct{unsigned char Count;struct{signed char Attr,x0,y0,x1,y1;}Data[];}MULTI_LINE;
  42. #ifndef __HAVE_pICON
  43. #define __HAVE_pICON
  44. typedef unsigned short*pICON;
  45. #endif
  46. #ifndef __HAVE_SCR_COORDS
  47. #define __HAVE_SCR_COORDS
  48. typedef unsigned char SCR_COORDS;
  49. #endif
  50. #ifndef __HAVE_SCR_RECT
  51. #define __HAVE_SCR_RECT
  52. typedef union{struct{unsigned char x0,y0,x1,y1;}xy;unsigned long l;}SCR_RECT;
  53. #endif
  54. #ifndef __HAVE_SCR_STATE
  55. #define __HAVE_SCR_STATE
  56. typedef struct{void*ScrAddr;unsigned char XMax,YMax;short CurFont,CurAttr,CurX,CurY;SCR_RECT CurClip;}SCR_STATE;
  57. #endif
  58. #define ScrRect ((SCR_RECT*const)(_rom_call_addr(2F)))
  59. #define BitmapGet _rom_call(void,(const SCR_RECT*,void*),185)
  60. #define BitmapInit _rom_call(void,(const SCR_RECT*,void*),186)
  61. #define BitmapPut _rom_call(void,(short,short,const void*,const SCR_RECT*,short),187)
  62. #define BitmapSize _rom_call(unsigned short,(const SCR_RECT*),188)
  63. #define ClrScr _rom_call(void,(void),19E)
  64. #define ClearScreen ClrScr
  65. #define DisplayOff() (pokeIO_bclr(0x600015,0))
  66. #define DisplayOn() (pokeIO_bset(0x600015,0))
  67. #define DrawChar _rom_call(void,(short,short,char,short),1A4)
  68. #define DrawClipChar _rom_call(void,(short,short,short,const SCR_RECT*,short),191)
  69. #define DrawClipEllipse _rom_call(void,(short,short,short,short,const SCR_RECT*,short),192)
  70. #define DrawClipLine _rom_call(void,(const WIN_RECT*,const SCR_RECT*,short),193)
  71. #define DrawClipPix _rom_call(void,(short,short),194)
  72. #define DrawClipRect _rom_call(void,(const WIN_RECT*,const SCR_RECT*,short),195)
  73. #define DrawFkey _rom_call(void,(short,short,short,short),1A5)
  74. #define DrawIcon _rom_call(void,(short,short,const void*,short),1A6)
  75. #define DrawLine _rom_call(void,(short,short,short,short,short),1A7)
  76. #define DrawMultiLines _rom_call(void,(short,short,const void*),196)
  77. #define DrawPix _rom_call(void,(short,short,short),1A8)
  78. #define DrawStr _rom_call(void,(short,short,const char*,short),1A9)
  79. #define DrawStrXY DrawStr
  80. #define DrawStrWidth _rom_call(short,(const char*,short),197)
  81. #define FillLines2 _rom_call(void,(const WIN_RECT*,const WIN_RECT*,const SCR_RECT*,short),199)
  82. #define FillTriangle _rom_call(void,(short,short,short,short,short,short,const SCR_RECT*,short),198)
  83. #define FontCharWidth _rom_call(short,(short),190)
  84. #define FontGetSys _rom_call(unsigned char,(void),18E)
  85. #define FontSetSys _rom_call(unsigned char,(short),18F)
  86. #define GetPix _rom_call(short,(short,short),19F)
  87. #define LCD_restore(b) ((void)(_rom_call(void,(),26A)(LCD_MEM,(const void*)(b),(long)LCD_SIZE)))
  88. #define LCD_save(b) ((void)(_rom_call(void,(),26A)((void*)(b),LCD_MEM,(long)LCD_SIZE)))
  89. #define LineTo _rom_call(void,(short,short),19C)
  90. #define DrawTo LineTo
  91. #define MakeWinRect _rom_call(WIN_RECT*,(short,short,short,short),2C)
  92. #define MoveTo _rom_call(void,(short,short),19D)
  93. #define PortRestore _rom_call(void,(void),1A3)
  94. #define PortSet _rom_call(void,(void*,short,short),1A2)
  95. #define QScrRectOverlap _rom_call(short,(const SCR_RECT*,const SCR_RECT*),18D)
  96. #define RestoreScrState _rom_call(void,(const void*),1A1)
  97. #define SaveScrState _rom_call(void,(void*),1A0)
  98. #define ScrRectFill _rom_call(void,(const SCR_RECT*,const SCR_RECT*,short),189)
  99. #define ScrRectOverlap _rom_call(short,(const SCR_RECT*,const SCR_RECT*,SCR_RECT*),18A)
  100. #define ScrRectScroll _rom_call(void,(const SCR_RECT*,const SCR_RECT*,short,short),18B)
  101. #define ScrRectShift _rom_call(void,(const SCR_RECT*,const SCR_RECT*,short,short),18C)
  102. #define ScrToHome _rom_call(SCR_RECT*,(SCR_RECT*),2E)
  103. #define ScrToWin _rom_call(WIN_RECT*,(const SCR_RECT*),2D)
  104. #define SetCurAttr _rom_call(short,(short),19A)
  105. #define SetCurClip _rom_call(void,(const SCR_RECT*),19B)
  106. #if MIN_AMS>=200
  107. #define CalcBitmapSize _rom_call(unsigned short,(BITMAP*),3EF)
  108. #define ClientToScr _rom_call(void,(const SCR_RECT*,const SCR_RECT*,SCR_RECT*),42C)
  109. #define DrawStrWidthP _rom_call(unsigned short,(const char*,short,short),3EE)
  110. #define MakeScrRect _rom_call(SCR_RECT*,(short,short,short,short,SCR_RECT*),42D)
  111. #endif
  112. /* End Auto-Generated Part */
  113. #define ScreenClear ClrScr
  114. #endif