home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 23 / IOPROG_23.ISO / SOFT / ASM / KVL27EOS.ZIP / VESA.DOC < prev    next >
Encoding:
Text File  |  1998-11-20  |  21.2 KB  |  890 lines

  1. 1. MACRO-INSTRUCTIONS
  2.  
  3.    Some of them are neccesary to make the program work other are included
  4.    for your convenience.
  5.  
  6.    ALL MACROS DESTROY THE EAX REGISTER!
  7.  
  8.  
  9. 2. INCLUDE VESA.ASH -- VESA BIOS MACROS AND VARIABLES.
  10.  
  11. DON'T CHANGE THESE VARS, THEY'RE MODIFIED BY MACROS.
  12. USE THEM TO GET VARIOUS INFORMATION.
  13.  
  14. VESAWidth:DWORD         screen width in pixels
  15. VESAHeight:DWORD        screen height in pixels
  16. VESAStartX:DWORD        virtual screen's upper left corner
  17. VESAStartY:DWORD        virtual screen's upper left corner
  18. VESABank:WORD           current bank
  19. VESABuffer:BYTE:256     this is filled with usefull information after VESAInit
  20. ScrBuff:DWORD           pointer to screen buffer (rarely used)
  21.  
  22.  
  23. You may change these variables...
  24. These vars are preset so you don't have to change them if you like the settings.
  25.  
  26. ButtonFont:DWORD        pointer to font used in 3D buttons
  27. ButtonFg:BYTE           foreground color (text)
  28. ButtonBg:BYTE           backgroung color
  29. ButtonU1:BYTE           upper edge (lighter) color
  30. ButtonU2:BYTE           upper edge (darker) color
  31. ButtonL1:BYTE           lower edge (lighter) color
  32. ButtonL2:BYTE           lower edge (darker) color
  33. ButtonBd:BYTE           border color (useally black)
  34. WindowFont:DWORD        pointer to font used in 3D windows
  35. WindowFg:BYTE           foreground color
  36. WindowBg:BYTE           background color
  37. WindowU:BYTE            upper edge color (this should be lighter than lower edge)
  38. WindowL:BYTE            lower edge color
  39.  
  40.  
  41. ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  42. ;; VESAInit  ->  buffer
  43. ;; Checks for VESA BIOS and returns SVGA information.
  44. ;;
  45. ;; Expects:    nothing
  46. ;;
  47. ;; Returns:    VESABuffer = info
  48. ;;
  49. ;; Note:    ALL REGISTERS *DESTROYED*
  50. ;;              YOU MUST USE THIS MACRO BEFORE USING OTHER FUNCTIONS!
  51. ;;
  52.  
  53.  
  54. ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  55. ;; GetModeInfo (mode)  ->  AX,buffer
  56. ;; Returns info on bank switching and virtual screen size.
  57. ;;
  58. ;; Expects:    mode (word)
  59. ;;
  60. ;; Returns:    AH    = status (0--ok, 1--error)
  61. ;;        AL    = VESA BIOS installed (4Fh--yes)
  62. ;;        VESABuffer = info
  63. ;;
  64.  
  65.  
  66. ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  67. ;; SetMode (mode)  ->  AX
  68. ;; Set video mode.
  69. ;;
  70. ;; Expects:    mode = [1--640x480 | 2--800x600 | 3--1024x768]
  71. ;;
  72. ;; Returns:    AH    = status (0--ok, 1--error)
  73. ;;        AL    = VESA BIOS installed (4Fh--yes)
  74. ;;
  75.  
  76.  
  77. ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  78. ;; GetMode ()  ->  BX,AX
  79. ;; Returns current mode.
  80. ;;
  81. ;; Expects:    nothing
  82. ;;
  83. ;; Returns:    BX    = mode (bit 15 ignored)
  84. ;;        AH    = status (0--ok, 1--error)
  85. ;;        AL    = VESA BIOS installed (4Fh--yes)
  86. ;;
  87.  
  88.  
  89. ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  90. ;; SetBank (bank)  ->  AX (DX may be modified if an error occurs).
  91. ;; Hooks bank to window A.
  92. ;;
  93. ;; Expects:    bank (word)
  94. ;;
  95. ;; Returns:    ZF    = status (ZY--ok, ZN--error)
  96. ;;        AH    = status (0--ok, 1--error)
  97. ;;        AL    = VESA BIOS installed (4Fh--yes)
  98. ;;
  99. ;;
  100.  
  101.  
  102. ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  103. ;; SetScanLen (width)  ->  AX,BX,CX,DX
  104. ;; Sets virtual screen width.
  105. ;;
  106. ;; Expects:    width (word) in pixels
  107. ;;
  108. ;; Returns:    AH    = status (0--ok, 1--error)
  109. ;;        AL    = VESA BIOS installed (4Fh--yes)
  110. ;;        BX    = bytes per line
  111. ;;        CX    = virtual screen width in pixels
  112. ;;        DX    = maximal number of lines
  113. ;;
  114.  
  115.  
  116. ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  117. ;; GetScanLen ()  ->  AX,BX,CD,DX
  118. ;; Returns virtual screen width.
  119. ;;
  120. ;; Expects:    nothing
  121. ;;
  122. ;; Returns:    AH    = status (0--ok, 1--error)
  123. ;;        AL    = VESA BIOS installed (4Fh--yes)
  124. ;;        BX    = bytes per line
  125. ;;        CX    = virtual screen width in pixels
  126. ;;        DX    = maximal number of lines
  127. ;;
  128.  
  129.  
  130. ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  131. ;; SetScreenStart (first column,first line)  ->  AX
  132. ;; Sets position of the virtual screen's upper-left corner.
  133. ;;
  134. ;; Expects:    column # displayed first (word) -- 388
  135. ;;        line # displayed first (word) -- 0
  136. ;;
  137. ;; Returns:    AH    = status (0--ok, 1--error)
  138. ;;        AL    = VESA BIOS installed (4Fh--yes)
  139. ;;
  140.  
  141.  
  142. ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  143. ;; SetDACPal (bits per RGB)  ->  AX
  144. ;; Sets number of bits per RGB.
  145. ;;
  146. ;; Expects:    number of bits per RGB (byte)
  147. ;;
  148. ;; Returns:    AH    = status (0--ok, 1--error)
  149. ;;        AL    = VESA BIOS installed (4Fh--yes)
  150. ;;
  151.  
  152.  
  153. ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  154. ;; GetDACPal ()  ->  BX,AX
  155. ;; Returns number of bits per RGB.
  156. ;;
  157. ;; Expects:    nothing
  158. ;;
  159. ;; Returns:    BH    = number of bits per RGB
  160. ;;        AH    = status (0--ok, 1--error)
  161. ;;        AL    = VESA BIOS installed (4Fh--yes)
  162. ;;
  163.  
  164.  
  165. ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  166. ;; ButtonCol (Fg,Bg,U1,U2,L1,L2,Bd)
  167. ;; Sets Button colors.
  168. ;;
  169. ;; Expects:    Fg,Bg,U1,U2,L1,L2,Bd
  170. ;; 
  171. ;; Returns:    nothing
  172. ;;
  173. ;; Note:        this macro allows you to change button colors easily,
  174. ;;              you don't have to use 7 mov instructions.
  175. ;;
  176.  
  177.  
  178. ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  179. ;; WindowCol (Fg,Bg,U,L)
  180. ;; Sets Window colors.
  181. ;;
  182. ;; Expects:    Fg,Bg,U,L
  183. ;; 
  184. ;; Returns:    nothing
  185. ;;
  186. ;; Note:        look above.
  187. ;;
  188.  
  189.  
  190.  
  191.  
  192. 3. INCLUDE MOUSEX.ASH -- MOUSE DRIVER EXTENTION MACROS.
  193.  
  194. DON'T CHANGE THESE TWO, USE THEM TO CHECK CURRENT MOUSE POSITION.
  195.  
  196. MouseX:DWORD
  197. MouseY:DWORD
  198.  
  199.  
  200. Put here pointers to YOUR procedures that scroll the screen when the mouse 
  201. cursor touches one of the screen edges.
  202.  
  203. MouseUp:DWORD
  204. MouseDown:DWORD
  205. MouseLeft:DWORD
  206. MouseRight:DWORD
  207.  
  208. See MouseScrollOn and MouseScrollOff below.
  209.  
  210.  
  211. ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  212. ;; MouseInit ()
  213. ;; Resets mouse driver and the extention, passes screen width and heigth,
  214. ;; Centers mouse cursor and turns if off.
  215. ;;
  216. ;; NOTE: ALLWAYS USE THIS MACRO AFTER SWITCHING TO A DIFFERENT MODE.
  217. ;;
  218. ;; Expects:    nothing
  219. ;;
  220. ;; Returns:    BX    = button data
  221. ;;
  222.  
  223.  
  224. ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  225. ;; MouseOn ()
  226. ;; Turns the mouse cursor on.
  227. ;;
  228. ;; Expects:    nothing
  229. ;;
  230. ;; Returns:    nothing
  231. ;;
  232.  
  233.  
  234. ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  235. ;; MouseOff ()
  236. ;; Turns the mouse cursor off.
  237. ;;
  238. ;; Expects:    nothing
  239. ;;
  240. ;; Returns:    nothing
  241. ;;
  242.  
  243.  
  244. ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  245. ;; MouseB ()
  246. ;; Gets mouse button status.
  247. ;;
  248. ;; Expects:    nothing
  249. ;;
  250. ;; Returns:    BX    = button status
  251. ;;              bit 0--left
  252. ;;                  1--right
  253. ;;                  2--middle
  254. ;;        CX    = X-Pos
  255. ;;        DX    = Y-Pos
  256. ;;
  257.  
  258.  
  259. ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  260. ;; MousePos (X,Y)
  261. ;; Changes the cursor's position.
  262. ;;
  263. ;; Expects:    X    = x-pos (word)
  264. ;;        Y    = y-pos (word)
  265. ;;
  266. ;; Returns:    CF    = status [0--ok|1--error]
  267. ;;
  268.  
  269.  
  270. ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  271. ;; MouseCursor (OFFSET to bitmap)
  272. ;; Changes the mouse cursor bitmap.
  273. ;;
  274. ;; Expects:    OFFSET to bitmap
  275. ;;
  276. ;; Returns:    nothing
  277. ;;
  278.  
  279.  
  280. ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  281. ;; MouseScrollOn
  282. ;; Turns scrolling on.
  283. ;;
  284. ;; Expects:    nothing
  285. ;;
  286. ;; Returns:    nothing
  287. ;;
  288.  
  289.  
  290. ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  291. ;; MouseScrollOff
  292. ;; Turns scrolling off.
  293. ;;
  294. ;; Expects:    nothing
  295. ;;
  296. ;; Returns:    nothing
  297. ;;
  298.  
  299.  
  300.  
  301.  
  302. 4. INCLUDE EDAY.ASH -- EVERY DAY MACROS (you don't have to use them).
  303.  
  304.  
  305. LF        EQU    0Dh,0Ah
  306. EOM        EQU    0Dh,0Ah,'$'
  307.  
  308.  
  309. ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  310. ;; Term -- terminates the program.
  311. ;;
  312. ;; Expects:    nothing
  313. ;;
  314. ;; Returns:    nothing
  315. ;;
  316. ;; Note:        It's a good idea to use this macro in your program since
  317. ;;              it disables the mouse driver extention and resets the screen
  318. ;;              mode to default.
  319. ;;
  320.  
  321.  
  322. ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  323. ;; Kill (offset) -- terminates the program with an error message.
  324. ;;
  325. ;; Expects:    offset to ASCII$ string
  326. ;;
  327. ;; Returns:    nothing
  328. ;;
  329. ;; Note:    The EOS function Exit_Error couses an error under Windows 95,
  330. ;;        that's why I made my own.
  331. ;;
  332.  
  333.  
  334. ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  335. ;; GetClock ()    
  336. ;; Returns timer ticks in EAX.
  337. ;;
  338. ;; Expects:    nothing
  339. ;;
  340. ;; Returns:    EAX    = timer ticks since last reset.
  341. ;;
  342. ;; Note:    Fq    = 1.19318 MHz
  343. ;;            18.2 t/s
  344. ;;            65536 t/h
  345. ;;
  346.  
  347.  
  348. ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  349. ;; ClockSync ()    
  350. ;; Waits until the clock triggers.
  351. ;;
  352. ;; Expects:    nothing
  353. ;;
  354. ;; Returns:    EAX    = timer
  355. ;;
  356.  
  357.  
  358. ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  359. ;; DosF (func #)    
  360. ;; Calls dos function via int 21h.
  361. ;;
  362. ;; Expects:    funtcion number (byte)
  363. ;;
  364. ;; Returns:    *
  365. ;;
  366.  
  367.  
  368. ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  369. ;; PutChar (char)
  370. ;; Displays a character with Ctrl-Break check.
  371. ;;
  372. ;; Expects:    char (byte)
  373. ;;
  374. ;; Returns:    nothing
  375. ;;
  376.  
  377.  
  378. ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  379. ;; Print (offset)
  380. ;; Displays a string.
  381. ;;
  382. ;; Expects:    offset (ASCII$ string)
  383. ;;
  384. ;; Returns:    nothing
  385. ;;
  386.  
  387.  
  388. ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  389. ;; GetKey ()  ->  AH,AL
  390. ;; Reads a key without echo and Ctrl-Break check.
  391. ;;
  392. ;; Expects:    nothing
  393. ;;
  394. ;; Returns:    AH    = scan code
  395. ;;        AL    = ASCII char
  396. ;;
  397.  
  398.  
  399. ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  400. ;; KeyPressed ()  ->  ZF,AH,AL
  401. ;; Checks if a character is ready.
  402. ;;
  403. ;; Expects:    nothing
  404. ;;
  405. ;; Returns:    ZF    = [0--ready, 1--not ready]
  406. ;;        AH    = scan code
  407. ;;        AL    = ASCII char
  408. ;;
  409.  
  410.  
  411. ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  412. ;; GetChar ()  ->  AL
  413. ;; Reads and echos a character with Crtl-Break check.
  414. ;;
  415. ;; Expects:    nothing
  416. ;;
  417. ;; Returns:    AL    = char
  418. ;;
  419.  
  420.  
  421. ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  422. ;; Beep
  423. ;;
  424. ;; Expects:    nothing
  425. ;;
  426. ;; Returns:    nothing
  427. ;;
  428.  
  429.  
  430. ;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  431. ;; CMOSr (address)
  432. ;;
  433. ;; Expects:    address
  434. ;;
  435. ;; Returns:    AL = data
  436. ;;
  437.  
  438.  
  439.  
  440.  
  441. 5. EDAY.OBJ -- EVERY DAY FUNCTIONS.
  442.  
  443.  
  444. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  445. ; Convert -- Converts value in EAX to dec string.
  446. ;
  447. ; Expects:    EAX    = value
  448. ;        EDI    = buffer
  449. ;        CF    = [0--unsigned,1--signed]
  450. ;
  451. ; Returns:    ASCIIZ string in buffer.
  452. ;
  453.  
  454.  
  455. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  456. ; ConvertH -- Converts value in EAX to hex string.
  457. ;
  458. ; Expects:    EAX    = value
  459. ;        EDI    = buffer
  460. ;        CF    = word [0--DD|1--DW]
  461. ;
  462. ; Returns:    ASCIIZ string.
  463. ;
  464.  
  465.  
  466. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  467. ; CheckCPU
  468. ;
  469. ; Expects:    nothing
  470. ;
  471. ; Returns:    AH    = CPU type
  472. ;
  473. ; Notes:    AH...    0--8086
  474. ;            1--186
  475. ;            2--286
  476. ;            3--386
  477. ;            4--486
  478. ;            5--Pentium
  479. ;            6--Pentium II
  480. ;
  481. ; ALL REGISTERS *DESTROYED*
  482. ;
  483.  
  484.  
  485. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  486. ; CPUID
  487. ;
  488. ; Expects:    EDI    = buffer (13 bytes)
  489. ;
  490. ; Returns:    EAX    = CPU type [0--not avaible]
  491. ;        EDX    = CPU info
  492. ;        [EDI]    = ASCIIZ CPU name (allways)
  493. ;
  494. ; Notes:    ALL REGISTERS *DESTROYED*
  495. ;
  496.  
  497.  
  498.  
  499.  
  500. 6. VESA.OBJ -- BASIC FUNCTIONS.
  501.  
  502. All functions in this library are invoked with CALL instruction
  503. (except UseButtons).
  504.  
  505. USEFUL TIPS:
  506.  
  507. 1. Functions that use x and y coordinates usually expect them in ECX and EDX.
  508. 2. Block functions expect x and y size in EAX and EBX,
  509.    ESI is the source and EDI the destination.
  510. 3. In text output functions EBX is the font offset.
  511. 4. ALLMOST ALL FUNCTIONS RETURN STATUS IN CARRY FLAG (CF).
  512.    If it's set (CF=1) an error has occured, useally due to invalid coordinates.
  513.    For example, if you try to draw a pixel "outside" the screen.
  514.  
  515.  
  516. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  517. ; PutBlock  --  displays a block.
  518. ;
  519. ; Expects:    ECX    = x-position of upper-left corner [0..n]
  520. ;        EDX    = y-position of upper-left corner [0..n]
  521. ;        EAX    = x-size [1..n]
  522. ;        EBX    = y-size [1..n]
  523. ;        ESI    = block
  524. ;        CF    = raster adjust (1--yes, 0--no sync)
  525. ;                         If you want flicker free animation set CF=1.
  526. ;
  527. ; Returns:    CF    = status (CN--ok, CY--error)
  528. ;
  529.  
  530.  
  531. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  532. ; GetBlock  --  gets block from video memory.
  533. ;
  534. ; Expects:    ECX    = x-position of upper-left corner [0..n]
  535. ;        EDX    = y-position of upper-left corner [0..n]
  536. ;        EAX    = x-size [1..n]
  537. ;        EBX    = y-size [1..n]
  538. ;        EDI    = offset
  539. ;
  540. ; Returns:    CF    = status (CN--ok, CY--error)
  541. ;
  542.  
  543.  
  544. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  545. ; FillBlock  --  displays a one-color-block.
  546. ;
  547. ; Expects:    ECX    = x-position of upper-left corner [0..n]
  548. ;        EDX    = y-position of upper-left corner [0..n]
  549. ;        EAX    = x-size [1..n]
  550. ;        EBX    = y-size [1..n]
  551. ;        BP    = color [0..255]
  552. ;        CF    = raster adjust (1--yes, 0--no sync)
  553. ;                         If you want flicker free animation set CF=1.
  554. ;
  555. ; Returns:    CF    = status (CN--ok, CY--error)
  556. ;
  557.  
  558.  
  559. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  560. ; PutPixel  --  displays a pixel.
  561. ;
  562. ; Expects:    AL    = color
  563. ;        ECX    = x-position [0..n]
  564. ;        EDX    = y-position [0..n]
  565. ;
  566. ; Returns:    CF    = status (CN--ok, CY--error)
  567. ;
  568.  
  569.  
  570. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  571. ; GetPixel  --  gets a pixel.
  572. ;
  573. ; Expects:    ECX    = x-position [0..n]
  574. ;        EDX    = y-position [0..n]
  575. ;
  576. ; Returns:    CF    = status (CN--ok, CY--error)
  577. ;        AL    = color
  578. ;        AH    * DESTROYED *
  579. ;
  580.  
  581.  
  582. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  583. ; PutLine  -- displays a line (X1,Y1) -> (X2,Y2) (X1<X2)
  584. ;
  585. ; Expects:    AL    = color
  586. ;        ECX    = X1
  587. ;        EDX    = Y1
  588. ;        ESI    = X2
  589. ;        EDI    = Y2
  590. ;
  591. ; Returns:    CF    = status [0--ok|1--error]
  592. ;
  593.  
  594.  
  595. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  596. ; SetPal -- sets a n-color RGB pal.
  597. ;
  598. ; Expects:    ECX    = number of colors [1..256]
  599. ;        ESI    = pal offset (color #0)
  600. ;
  601. ; Returns:    CF    = status (CN--ok, CY--error)
  602. ;
  603.  
  604.  
  605. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  606. ; SetGrayPal -- sets a gray scale pal.
  607. ;
  608. ; Expects:    nothing
  609. ;
  610. ; Returns:    nothing
  611. ;
  612.  
  613.  
  614. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  615. ; SetNulPal -- sets a nul pal (black).
  616. ;
  617. ; Expects:    nothing
  618. ;
  619. ; Returns:    nothing
  620. ;
  621.  
  622.  
  623. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  624. ; LoadPal -- loads pal from disk.
  625. ;
  626. ; Expects:    EDX    = filespec offset
  627. ;
  628. ; Returns:    nothing
  629. ;
  630.  
  631.  
  632. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  633. ; PutGpxText  --  displays text.
  634. ;
  635. ; Expects:    AL    = color
  636. ;        ECX    = x-position
  637. ;        EDX    = y-position
  638. ;        ESI    = text offset (0Ah = cr and line feed)
  639. ;        EBX    = font offset
  640. ;
  641. ; Returns:    CF    = status (CN--ok, CY--error)
  642. ;
  643.  
  644.  
  645. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  646. ; PutGpxChar  --  displays char.
  647. ;
  648. ; Expects:    AL    = color
  649. ;        AH    = char
  650. ;        ECX    = x-position
  651. ;        EDX    = y-position
  652. ;        EBX    = font offset
  653. ;
  654. ; Returns:    CF    = status (CN--ok, CY--error)
  655. ;
  656.  
  657.  
  658. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  659. ; Input  --  reads and echos ASCIIZ string.
  660. ;
  661. ; Expects:    AL    = Fg color
  662. ;        AH    = Bg color
  663. ;        ECX    = x-position
  664. ;        EDX    = y-position
  665. ;        EBX    = font offset
  666. ;        EDI    = buffer
  667. ;        ESI    = string length
  668. ;
  669. ; Returns:    CF    = status (CN--ok, CY--error)
  670. ;        EAX    = length
  671. ;
  672.  
  673.  
  674. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  675. ; WipeScr  --  erases the screen using specified color.
  676. ;
  677. ; Expects:    AL    = color
  678. ;        AH    = mode [0..1]
  679. ;                0--normal (fastest)
  680. ;                1--use horizontal lines
  681. ;
  682. ; Returns:    CF    = status (CN--ok, CY--error)
  683. ;
  684.  
  685.  
  686.  
  687.  
  688. 7. VESA2.OBJ -- DISPLAY GIF AND SCI PICTURES.
  689.  
  690.  
  691. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  692. ; ShowGIF  --  displays a 256 color GIF.
  693. ;
  694. ; Expects:    EBX    = filespec (ASCIIZ - zero terminated string)
  695. ;        CF    = center [0--no | 1--yes]
  696. ;        ECX    = X-position (CY)
  697. ;        EDX    = Y-position (CY)
  698. ;
  699. ; Returns:    CF    = status (CN--ok, CY--error)
  700. ;
  701.  
  702.  
  703. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  704. ; ShowColoRIX  --  displays a picture in ColoRIX format.
  705. ;
  706. ; Expects:    EBX    = filespec (ASCIIZ - zero terminated string)
  707. ;        CF    = center [0--no | 1--yes]
  708. ;        ECX    = X-position (CY)
  709. ;        EDX    = Y-position (CY)
  710. ;
  711. ; Returns:    CF    = status (CN--ok, CY--error)
  712. ;
  713.  
  714.  
  715.  
  716.  
  717. 8. VESA3.OBJ -- BUFFERED PIXEL AND LINE DRAWING (RARELY USED).
  718.  
  719.  
  720. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  721. ; InitScrBuff
  722. ;
  723. ; Expects:    nothing
  724. ;
  725. ; Returns:    CF    = status [0--ok|1--error]
  726. ;
  727.  
  728.  
  729. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  730. ; KillScrBuff  --  deallocates memory used by screen buffer.
  731. ;
  732. ; Expects:    nothing
  733. ;
  734. ; Returns:    CF    = status [0--ok|1--error]
  735. ;
  736.  
  737.  
  738. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  739. ; PutScrBuff  --  displays screen buffer in 640x480x256 mode.
  740. ;
  741. ; Expects:    EBX    = number of lines to spare at the bottom
  742. ;              of the screen [0-70]
  743. ;        CF    = raster adjust [0--no|1--sync]
  744. ;
  745. ; Returns:    CF    = status [0--ok|1--error]
  746. ;
  747.  
  748.  
  749. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  750. ; GetScrBuff  --  copies screen to buffer in 640x480x256 mode.
  751. ;
  752. ; Expects:    EBX    = number of lines to spare at the bottom
  753. ;              of the screen [0-70]
  754. ;
  755. ; Returns:    CF    = status [0--ok|1--error]
  756. ;
  757.  
  758.  
  759. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  760. ; FastLine  -- displays (buffered) a line (X1,Y1) -> (X2,Y2) (X1<X2)
  761. ;
  762. ; Expects:    AL    = color
  763. ;        ECX    = X1
  764. ;        EDX    = Y1
  765. ;        ESI    = X2
  766. ;        EDI    = Y2
  767. ;
  768. ; Returns:    CF    = status [0--ok|1--error]
  769. ;
  770.  
  771.  
  772. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  773. ; FastPixel
  774. ;
  775. ; Expects:    AL    = color
  776. ;        ECX    = X
  777. ;        EDX    = Y
  778. ;
  779. ; Returns:    CF    = status [0--ok|1--error]
  780. ;
  781.  
  782.  
  783.  
  784.  
  785. 9. VESA4.OBJ -- 3D BUTTONS, 3D WINDOWS, DIALOGS.
  786.  
  787. THE ONLY FUNCTION YOU'LL NEED IS PutDialog, OTHER FUNCTIONS ARE USED BY IT.
  788. I ADDED THEM SO THAT YOU CAN CREATE CUSTOM DIALOGS.
  789.  
  790.  
  791. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  792. ; PutButton -- displays a 3D button.
  793. ;
  794. ; Expects:    AH    = mode [0--normal|1--depressed]
  795. ;        EBX    = button structure offset
  796. ;             
  797. ;               ButtonFont = font offset (8x16, rows: 0,1,12,13,14,15 ignored)
  798. ;
  799. ; Returns:    CF    = status [0--ok|1--error]
  800. ;
  801. ; Note:         INTERNAL FUNCTION USED BY PutDialog.
  802. ;
  803.  
  804.  
  805. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  806. ; ShowButtons -- displays 3D button structure.
  807. ;
  808. ; Expects:    EBX    = struc offset
  809. ;
  810. ;               ButtonFont = font offset (8x16, rows: 0,1,12,13,14,15 ignored)
  811. ;
  812. ; Notes:    Button1 DBu    <Func,X,Y,TL,"TEXT">
  813. ;            .
  814. ;            .
  815. ;            BuTerm
  816. ;
  817. ;        TYPE -- LENGTH
  818. ;        0h    1 (18x20)
  819. ;        4h    3 (34x20)
  820. ;        8h    8 (74x20)
  821. ;    special    Ch    1 (18x20)
  822. ;
  823. ; Returns:    CF    = status [0--ok|1--error]
  824. ;
  825. ; Note:         INTERNAL FUNCTION USED BY PutDialog.
  826. ;
  827.  
  828.  
  829. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  830. ; UseButtons -- JMP|CALL
  831. ;
  832. ; Expects:    EBX    = struc offset
  833. ;        EDX    = right button func (0--none)
  834. ;        CY    = refresh
  835. ;
  836. ;               ButtonFont = font offset (8x16, rows: 0,1,12,13,14,15 ignored)
  837. ;
  838. ; Returns:    nothing
  839. ;
  840. ; Note:        ALL REGISTERS *DESTROYED*
  841. ;
  842. ; Note:         INTERNAL FUNCTION USED BY PutDialog.
  843. ;
  844.  
  845.  
  846. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  847. ; PutWindow -- displays a 3D window.
  848. ;
  849. ; Expects:    EBX    = struc offset
  850. ;
  851. ; Notes:     Name    WinDef        <Xpos,YPos,X-Size,Y-Size>
  852. ;            WinTitle    "Text"
  853. ;            WinText        XPos,Ypos,"Text"
  854. ;            WinTxt        XCur,YCur,"Text"
  855. ;            WinH        XPos,YPos,X-Size,Y-Size
  856. ;            WinHText    XPos,YPos,Length,"Text"
  857. ;            WinL        XPos,YPos,X-Size,Y-Size
  858. ;            WinLText    XPos,YPos,Length,"Text"
  859. ;            WinEnds
  860. ;
  861. ; Returns:    CF    = status [0--ok|1--error]
  862. ;
  863. ; Note:         INTERNAL FUNCTION USED BY PutDialog.
  864. ;
  865.  
  866.  
  867. ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  868. ; PutDialog -- displays a 3D window and button structure.
  869. ;
  870. ; Expects:    EBX    = struc offset
  871. ;
  872. ;               WindowFont = font offset 
  873. ;               ButtonFont = font offset (8x16, rows: 0,1,12,13,14,15 ignored)
  874. ;
  875. ; Notes:    Name    Dialog <WindowStruc,ButtonStruc,[RightMouseClick,Proc]>
  876. ;               WindowStruc -- pointer
  877. ;               ButtonStruc -- pointer
  878. ;               RightMouseClick (optional) -- pointer to your procedure
  879. ;               Proc (optional) -- pointer to your procedure invoked before
  880. ;                               the buttons are "turned on", so you can display
  881. ;                               all other stuff that PutDialog doesn't have.
  882. ;
  883. ;               Retc -- return from proc and continue current dialog
  884. ;               Retx -- return from proc and exit current dialog
  885. ;
  886. ; Returns:    CF    = status [0--ok|1--error]
  887. ;
  888. ; Note:        ALL REGISTERS *DESTROYED*
  889. ;
  890.