home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / Ti / Magazine / Tests / DOORSOSD.ZIP / graphlib.h < prev    next >
Encoding:
Text File  |  1999-03-31  |  10.7 KB  |  375 lines

  1. ;-------------------------------------------------------------
  2. ;    Graphlib: graphical functions
  3. ;        by the Doors Team
  4. ;    xvassor@mail.dotcom.fr   or    deucalion@mail.dotcom.fr
  5. ;        http://start.at/doors
  6. ;-------------------------------------------------------------
  7.  
  8. graphlib::fill    equ    graphlib@0000
  9. ;--------------------------------------------------------------
  10. ;fill(x,y,width,height,color)
  11. ;
  12. ;   Fills the rectangle delimited by x, y, width and lenght with 
  13. ;  the specified color
  14. ;
  15. ;Input:    d0.w = x
  16. ;    d1.w = y
  17. ;    d2.w = width
  18. ;    d3.w = height
  19. ;    d4.w = color:    0 -> Video Invert
  20. ;            1 -> White
  21. ;            2 -> Black
  22. ;
  23. ;Output: nothing
  24. ;    NO REGISTERS DESTROYED
  25. ;--------------------------------------------------------------
  26.  
  27.  
  28. graphlib::put_sprite    equ    graphlib@0001
  29. ;--------------------------------------------------------------
  30. ;put_sprite(x,y,sprite)
  31. ;
  32. ;   Puts the sprite pointed to by a0 on the screen 
  33. ;  at (d0,d1)
  34. ;
  35. ;Input:    d0.w = x
  36. ;    d1.w = y
  37. ;    a0.l = adress of the sprite & the mask
  38. ;
  39. ;    Sprite format is:
  40. ; sprite:    dc.w    5     ;-> height of the sprite
  41. ;        dc.w    1    ;width in bytes
  42. ;        dc.b    %11111000
  43. ;        dc.b    %01110000
  44. ;        dc.b    %00100000
  45. ;        dc.b    %01110000
  46. ;        dc.b    %11111000
  47. ;
  48. ; mask:        dc.b    %11111000
  49. ;        dc.b    %11111000
  50. ;        dc.b    %11111000
  51. ;        dc.b    %11111000
  52. ;        dc.b    %11111000
  53. ;
  54. ;Output: nothing
  55. ;    NO REGISTERS DESTROYED
  56. ;--------------------------------------------------------------
  57. graphlib::put_sprite2        equ    graphlib@000C
  58. ;--------------------------------------------------------------
  59. ;put_sprite(x,y,sprite,maskadress)
  60. ;
  61. ;   Puts the sprite pointed to by a0 on the screen 
  62. ;  at (d0,d1). The adress of the mask is a2
  63. ;
  64. ;Input:    d0.w = x
  65. ;    d1.w = y
  66. ;    a0.l = adress of the sprite
  67. ;    a2.l = adress of the mask
  68. ;    Sprite format is:
  69. ; sprite:    dc.w    5     ;-> height of the sprite
  70. ;        dc.w    1    ;width in bytes
  71. ;        dc.b    %11111000
  72. ;        dc.b    %01110000
  73. ;        dc.b    %00100000
  74. ;        dc.b    %01110000
  75. ;        dc.b    %11111000
  76. ;
  77. ;    (...)
  78. ;
  79. ; mask:        dc.b    %11111000
  80. ;        dc.b    %11111000
  81. ;        dc.b    %11111000
  82. ;        dc.b    %11111000
  83. ;        dc.b    %11111000
  84. ;
  85. ;
  86. ;Output: nothing
  87. ;    NO REGISTERS DESTROYED
  88. ;--------------------------------------------------------------
  89.  
  90. graphlib::put_sprite_mask    equ    graphlib@000B
  91. ;--------------------------------------------------------------
  92. ;put_sprite_mask(x,y,mask,sprite)
  93. ;
  94. ;    Does the same as put_sprite, but you don't have to create
  95. ;    a mask sprite after the sprite itself
  96. ;    Instead, you have to define a 'constant mask'
  97. ;    For example %00000000 as a constant mask will make all
  98. ;    zeroes of you sprite being transparent
  99. ;
  100. ;Input:    d0.w = x
  101. ;    d1.w = y
  102. ;    d3.b = constant mask
  103. ;    a0.l = adress of the sprite & the mask
  104. ;
  105. ;    Sprite format is:
  106. ; sprite:    dc.w    5     ;-> height of the sprite
  107. ;        dc.w    1    ;width in bytes
  108. ;        dc.b    %11111000
  109. ;        dc.b    %01110000
  110. ;        dc.b    %00100000
  111. ;        dc.b    %01110000
  112. ;        dc.b    %11111000
  113. ;
  114. ;Output: nothing
  115. ;    NO REGISTERS DESTROYED
  116. ;--------------------------------------------------------------
  117.  
  118. graphlib::smallbox    equ    graphlib@0002
  119. ;--------------------------------------------------------------
  120. ;smallbox(title)
  121. ;
  122. ;  Draws a box in the middle of the screen
  123. ;
  124. ;Input:    a0.l = title of the box
  125. ;
  126. ;Output: nothing
  127. ;    NO REGISTERS DESTROYED
  128. ;--------------------------------------------------------------
  129.  
  130. graphlib::box        equ    graphlib@0003
  131. ;--------------------------------------------------------------
  132. ;box(x,y,width,height)
  133. ;
  134. ;    Draws a box at (x,y)
  135. ;Input: d0.w = x
  136. ;    d1.w = y
  137. ;    d2.w = width
  138. ;    d3.w = height
  139. ;    a0.l = title of the box
  140. ;    NO REGISTERS DESTROYED
  141. ;--------------------------------------------------------------
  142.  
  143. graphlib::frame     equ    graphlib@0004
  144. ;--------------------------------------------------------------
  145. ;frame(x,y,width,height)
  146. ;
  147. ;  Draws a frame at (x,y)
  148. ;
  149. ;Input: d0.w = x
  150. ;    d1.w = y
  151. ;    d4.w = width
  152. ;    d5.w = height
  153. ;    NO REGISTERS DESTROYED
  154. ;--------------------------------------------------------------
  155.  
  156. graphlib::clr_scr    equ    graphlib@0005
  157. ;--------------------------------------------------------------
  158. ;clr_scr(void)
  159. ;
  160. ;   clears the entire screen
  161. ;    NO REGISTERS DESTROYED
  162. ;--------------------------------------------------------------
  163.  
  164. graphlib::clr_scr2    equ    graphlib@0014    
  165. ;--------------------------------------------------------------
  166. ;clr_scr(void)
  167. ;
  168. ;   clears the screen except the status line
  169. ;    NO REGISTERS DESTROYED
  170. ;--------------------------------------------------------------
  171.  
  172. graphlib::vert      equ    graphlib@0006
  173. ;--------------------------------------------------------------
  174. ;vert(x,y1,y2)
  175. ;
  176. ;   Draws a vertical line
  177. ;
  178. ;Input:    d0.w = x
  179. ;    d1.w = y1
  180. ;    d2.w = y2
  181. ;
  182. ;Output: nothing
  183. ;    NO REGISTERS DESTROYED
  184. ;--------------------------------------------------------------
  185.  
  186. graphlib::horiz     equ    graphlib@0007
  187. ;--------------------------------------------------------------
  188. ;horiz(x1,y,x2,color)
  189. ;
  190. ;   Draws an horizontal line in the specified color
  191. ;
  192. ;Input:    d0.w = x1
  193. ;    d1.w = y
  194. ;    d2.w = x2
  195. ;    d3.w = color      0 -> Video Invert
  196. ;            1 -> White
  197. ;            2 -> Black
  198. ;
  199. ;Output: nothing
  200. ;    NO REGISTERS DESTROYED
  201. ;--------------------------------------------------------------
  202.  
  203. graphlib::bigbox    equ    graphlib@0008
  204. ;--------------------------------------------------------------
  205. ;bigbox(void)
  206. ;
  207. ;  Draws a big box in the middle of the screen
  208. ;
  209. ;Input:    a0.l = title of the box
  210. ;
  211. ;Output: nothing
  212. ;    NO REGISTERS DESTROYED
  213. ;--------------------------------------------------------------
  214.  
  215. graphlib::scrtomem    equ    graphlib@0009
  216. ;--------------------------------------------------------------
  217. ;scrtomem(x,y,lenght,width)
  218. ;
  219. ;This function copies a part of the screen to memory.
  220. ;
  221. ;Input:    d0.w = X of top left-hand corner in bytes(0<X<30)
  222. ;    d1.w = Y of top left-hand corner (0<Y<128)
  223. ;    d2.w = width in bytes (0<d2<30)  
  224. ;    d3.w = height (0<d3<128)         
  225. ;
  226. ;Output: d4.w = handle to the memory containg the part of the screen.
  227. ;    d4.w = 0 -> Not enough memory to save the screen
  228. ;    NO REGISTERS DESTROYED
  229. ;
  230. ;NOTE:This function doesn't use real coordinates because it would take much more place
  231. ;--------------------------------------------------------------
  232.  
  233. graphlib::memtoscr    equ    graphlib@000A
  234. ;--------------------------------------------------------------
  235. ;memtoscr(x,y,lenght,width,handle)
  236. ;
  237. ;This function copies a handle in memory to screen.
  238. ;
  239. ;Input:    d0.w = X of top left-hand corner in bytes(0<X<30)
  240. ;    d1.w = Y of top left-hand corner (0<Y<128)
  241. ;    d2.w = width in bytes (0<d2<30) 
  242. ;    d3.w = height (0<d3<128)    
  243. ;    d4.w = handle previously created by memtoscr(containing the
  244. ;                    part of the screen to restore)
  245. ;
  246. ;Output:nothing
  247. ;    NO REGISTERS DESTROYED
  248. ;--------------------------------------------------------------
  249.  
  250. ;--------------------------------------------------------------
  251. ; line()
  252. ;
  253. ; Function: Draws a line, _FAST_
  254. ;
  255. ; Input:    D0.W = X1
  256. ;           D1.W = Y1
  257. ;           D2.W = X2
  258. ;           D3.W = Y2
  259. ;           A0   = Address to top left corner (usually $4C00)
  260. ;              
  261. ;----------------------------------------------------------------------
  262. graphlib::line        equ    graphlib@0017
  263.  
  264. graphlib::choosescreen    equ    graphlib@000D
  265. ;--------------------------------------------------------------
  266. ;    graphlib::choosescreen is a word sized variable.
  267. ;
  268. ;    If it is null, the adress of the screen for every graphlib
  269. ;     function will be LCD_MEM
  270. ;    Else, the adress of the bitplane you want graphlib to use on
  271. ;     will be stored in a1
  272. ;
  273. ;    This allows you, for example, to use all graphlib functions
  274. ;     with grayscale !
  275. ;--------------------------------------------------------------
  276.  
  277.  
  278. graphlib::show_dialog equ    graphlib@0015
  279. ;----------------------------------------------------------------------------
  280. ; show_dialog()
  281. ;
  282. ; Function: Displays a dialog box.
  283. ;
  284. ; input: A6=pointer to dialog struct
  285. ; output: nothing
  286. ;
  287. ;Dialog struct:
  288. ;0(a6).w : x1 (top-left)
  289. ;2(a6).w : y1 (top-left)
  290. ;4(a6).w : x2 (down-right)
  291. ;6(a6).w : y2 (down-right)
  292. ;8(a6).w : x of the string relative to x1
  293. ;10(a6).w :y of the string relative to y1
  294. ;12(a6).l : adress of the string
  295. ;
  296. ;example of dialog structure
  297. ;
  298. ;dial    dc.w    10,15,50,40,10,5
  299. ;    dc.l    str
  300. ;
  301. ;str    dc.b    "HELLO !",0
  302. ;----------------------------------------------------------------------------
  303.  
  304. graphlib::clear_dialog equ    graphlib@0016
  305. ;----------------------------------------------------------------------------
  306. ; clear_dialog()
  307. ;
  308. ; Function: Erases the last dialog box drawn by show_dialog(). The area
  309. ;           previously under the dialog will need to be redrawn.
  310. ;
  311. ; input:  nothing
  312. ; output: nothing
  313. ;----------------------------------------------------------------------------
  314.  
  315. graphlib::erase_rect        equ    graphlib@0018
  316. ;----------------------------------------------------------------------------
  317. ; erase_rect(rect r)
  318. ;
  319. ; Function: Fills the rectangle {r} with solid white.
  320. ;
  321. ; Return: nothing
  322. ;----------------------------------------------------------------------------
  323.  
  324. graphlib::frame_rect        equ    graphlib@0019
  325. ;----------------------------------------------------------------------------
  326. ; frame_rect(rect r)
  327. ;
  328. ; Function: Draws the rectangle frame {r}.
  329. ;
  330. ; Return: nothing
  331. ;----------------------------------------------------------------------------
  332.  
  333. graphlib::gray2    equ    graphlib@000E
  334. ;----------------------------------------------------------------------------
  335. ; gray2(void)
  336. ;
  337. ; Function: Deactivate gray scale display
  338. ;
  339. ; Return: d0 = 0
  340. ;----------------------------------------------------------------------------
  341.  
  342. graphlib::gray4    equ    graphlib@000F
  343. ;----------------------------------------------------------------------------
  344. ; gray4(void)
  345. ;
  346. ; Function: Activate 4 shade gray scale display
  347. ;
  348. ; Return: D0.L = nonzero:success, zero=failure
  349. ;----------------------------------------------------------------------------
  350.  
  351. graphlib::gray7    equ    graphlib@0010
  352. ;----------------------------------------------------------------------------
  353. ; gray7(void)
  354. ;
  355. ; Function: Activate 7 shade gray scale display
  356. ;
  357. ; Return: D0.L = nonzero:success, zero=failure
  358. ;----------------------------------------------------------------------------
  359.  
  360. graphlib::plane0    equ    graphlib@0011
  361. ;--------------------------------------------------------------
  362. ;plane0 is the adress of the 1st bitplane (always = LCD_MEM)
  363. ;--------------------------------------------------------------
  364.  
  365. graphlib::plane1    equ    graphlib@0012
  366. ;--------------------------------------------------------------
  367. ;plane1 is the adress of the 2nd bitplane
  368. ;--------------------------------------------------------------
  369.  
  370. graphlib::plane2    equ    graphlib@0013
  371. ;--------------------------------------------------------------
  372. ;plane2 is the adress of the 3rd bitplane
  373. ;--------------------------------------------------------------
  374.  
  375. graphlib::getlength    equ    graphlib@001A