graphlib.h 10 KB

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