WWMOUSE.ASM 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662
  1. ;
  2. ; Command & Conquer Red Alert(tm)
  3. ; Copyright 2025 Electronic Arts Inc.
  4. ;
  5. ; This program is free software: you can redistribute it and/or modify
  6. ; it under the terms of the GNU General Public License as published by
  7. ; the Free Software Foundation, either version 3 of the License, or
  8. ; (at your option) any later version.
  9. ;
  10. ; This program is distributed in the hope that it will be useful,
  11. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ; GNU General Public License for more details.
  14. ;
  15. ; You should have received a copy of the GNU General Public License
  16. ; along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. ;
  18. ;***************************************************************************
  19. ;** C O N F I D E N T I A L --- W E S T W O O D A S S O C I A T E S **
  20. ;***************************************************************************
  21. ;* *
  22. ;* Project Name : Westwood 32 bit Library *
  23. ;* *
  24. ;* File Name : BITBLIT.ASM *
  25. ;* *
  26. ;* Programmer : Philip W. Gorrow *
  27. ;* *
  28. ;* Start Date : December 12, 1995 *
  29. ;* *
  30. ;* *
  31. ;*-------------------------------------------------------------------------*
  32. ;* Functions: *
  33. ;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
  34. IDEAL
  35. P386
  36. MODEL USE32 FLAT
  37. LOCALS ??
  38. INCLUDE "drawbuff.inc"
  39. INCLUDE "gbuffer.inc"
  40. INCLUDE "shape.inc"
  41. INCLUDE ".\mouse.inc"
  42. GLOBAL C LCW_Uncompress:NEAR
  43. GLOBAL C Get_Shape_Uncomp_Size :NEAR
  44. GLOBAL C Get_Shape_Width :NEAR
  45. GLOBAL C Get_Shape_Original_Height :NEAR
  46. GLOBAL _ShapeBuffer :DWORD
  47. CODESEG
  48. ;***************************************************************************
  49. ;* MOUSE_SHADOW_BUFFER -- Handles storing and restoring the mouse buffer *
  50. ;* *
  51. ;* INPUT: MouseClass * - pointer to mouse class data *
  52. ;* GraphicBufferClass * - screen to draw the mouse on *
  53. ;* int x - x position to store the mouse at *
  54. ;* int y - y position to store the mouse at *
  55. ;* int store - whether to store buffer or save *
  56. ;* *
  57. ;* OUTPUT: none *
  58. ;* *
  59. ;* Note: The x and y that this routine expects to receive are based on *
  60. ;* the mouse cursor position. This routine automatically adjusts *
  61. ;* for hot spot, so that adjustment should not be made prior to *
  62. ;* this point. *
  63. ;* *
  64. ;* PROTO: void Mouse_Shadow_Buffer(GraphicBufferClass *src/dest, *
  65. ;* void *buffer
  66. ;* int x_pixel, *
  67. ;* int y_pixel, *
  68. ;* int store); *
  69. ;* *
  70. ;* HISTORY: *
  71. ;* 10/27/1994 PWG : Created. *
  72. ;*=========================================================================*
  73. GLOBAL C Mouse_Shadow_Buffer:NEAR
  74. PROC Mouse_Shadow_Buffer C NEAR
  75. USES eax,ebx,ecx,edx,edi,esi
  76. ARG this: DWORD
  77. ARG src_dst_obj: DWORD
  78. ARG buffer:DWORD
  79. ARG x: DWORD
  80. ARG y: DWORD
  81. ARG hotx: DWORD
  82. ARG hoty: DWORD
  83. ARG store: DWORD
  84. local x0: dword
  85. local y0: dword
  86. local x1: dword
  87. local y1: dword
  88. local buffx0: dword
  89. local buffy0: dword
  90. ;*=========================================================================*
  91. ; Direction flag must be forward in this routine.
  92. ;*=========================================================================*
  93. cld
  94. ;*===================================================================
  95. ;* Copy of X, Y, Width and Height into local registers
  96. ;*===================================================================
  97. mov esi, [this] ; get offset to mouse data
  98. mov edi, [src_dst_obj] ; get offset to mouse data
  99. mov eax, [x]
  100. mov ebx, [y]
  101. sub eax, [hotx]
  102. sub ebx, [hoty]
  103. mov [x0], eax
  104. mov [y0], ebx
  105. add eax, [(MouseType esi).CursorWidth]
  106. add ebx, [(MouseType esi).CursorHeight]
  107. mov [x1], eax
  108. mov [y1], ebx
  109. mov [buffx0], 0
  110. mov eax, [buffer]
  111. mov [buffy0], eax
  112. ;*===================================================================
  113. ;* Bounds check source X.
  114. ;*===================================================================
  115. xor eax, eax
  116. xor edx, edx
  117. mov ecx, [x0]
  118. mov ebx, [x1]
  119. shld eax, ecx, 1
  120. shld edx, ebx, 1
  121. mov ecx, [x0]
  122. mov ebx, [x1]
  123. sub ecx, [(GraphicViewPort edi).GVPWidth]
  124. sub ebx, [(GraphicViewPort edi).GVPWidth]
  125. dec ecx
  126. dec ebx
  127. shld eax, ecx, 1
  128. shld edx, ebx, 1
  129. mov ecx, [y0]
  130. mov ebx, [y1]
  131. shld eax, ecx, 1
  132. shld edx, ebx, 1
  133. mov ecx, [y0]
  134. mov ebx, [y1]
  135. sub ecx, [(GraphicViewPort edi).GVPHeight]
  136. sub ebx, [(GraphicViewPort edi).GVPHeight]
  137. dec ecx
  138. dec ebx
  139. shld eax, ecx, 1
  140. shld edx, ebx, 1
  141. xor al, 5
  142. xor dl, 5
  143. mov ah, al
  144. test dl, al
  145. jnz ??out
  146. or al, dl
  147. jz ??not_clip
  148. test ah, 1000b
  149. jz ??scr_left_ok
  150. mov ebx, [x0]
  151. neg ebx
  152. mov [buffx0], ebx
  153. mov [x0], 0
  154. ??scr_left_ok:
  155. test ah, 0010b
  156. jz ??scr_bottom_ok
  157. mov ebx, [y0]
  158. neg ebx
  159. imul ebx, [(MouseType esi).CursorWidth]
  160. add [buffy0], ebx
  161. mov [y0], 0
  162. ??scr_bottom_ok:
  163. test dl, 0100b
  164. jz ??scr_right_ok
  165. mov eax, [(GraphicViewPort edi).GVPWidth] ; get width into register
  166. mov [x1], eax
  167. ??scr_right_ok:
  168. test dl, 0001b
  169. jz ??not_clip
  170. mov eax, [(GraphicViewPort edi).GVPHeight] ; get width into register
  171. mov [y1], eax
  172. ??not_clip:
  173. ;*===================================================================
  174. ;* Get the offset into the screen.
  175. ;*===================================================================
  176. mov eax, [y0]
  177. mov edx, [(GraphicViewPort edi).GVPWidth]
  178. add edx, [(GraphicViewPort edi).GVPXAdd]
  179. add edx, [(GraphicViewPort edi).GVPPitch]
  180. imul eax, edx
  181. add eax, [x0]
  182. mov edi, [(GraphicViewPort edi).GVPOffset]
  183. add edi, eax
  184. ;*===================================================================
  185. ;* Adjust the source for the top clip.
  186. ;*===================================================================
  187. mov ebx, [(MouseType esi).CursorWidth] ; turn this into an offset
  188. mov esi, [buffy0] ; edx points to source
  189. add esi, [buffx0] ; plus clipped lines
  190. ;*===================================================================
  191. ;* Calculate the bytes per row add value
  192. ;*===================================================================
  193. mov eax, [x1]
  194. mov ecx, [y1]
  195. sub eax, [x0]
  196. jle ??out
  197. sub ecx, [y0]
  198. jle ??out
  199. sub edx, eax
  200. sub ebx, eax
  201. push ebp
  202. cmp [store], 1 ; are we storing page?
  203. je ??store_entry ; if so go to store
  204. ;*===================================================================
  205. ;* Handle restoring the buffer to the visible page
  206. ;*===================================================================
  207. mov ebp, ecx
  208. ??restore_loop:
  209. mov ecx, eax ; get number to really write
  210. rep movsb ; store them into the buffer
  211. add esi, ebx ; move past right clipped pixels
  212. add edi, edx ; adjust dest to next line
  213. dec ebp ; decrement number of rows to do
  214. jnz ??restore_loop ; if more to do, do it
  215. pop ebp
  216. ret
  217. ;*===================================================================
  218. ;* Handle soting the visible page into the Mouse Shadow Buffer
  219. ;*===================================================================
  220. ??store_entry:
  221. xchg esi, edi ; xchg the source and the dest
  222. mov ebp, ecx
  223. ??store_loop:
  224. mov ecx, eax ; get number to really write
  225. rep movsb ; store them into the buffer
  226. add esi, edx ; move past right clipped pixels
  227. add edi, ebx ; adjust dest to next line
  228. dec ebp ; decrement number of rows to do
  229. jnz ??store_loop ; if more to do, do it
  230. pop ebp
  231. ??out:
  232. ret
  233. ENDP Mouse_Shadow_Buffer
  234. ;***************************************************************************
  235. ;* DRAW_MOUSE -- Handles drawing the mouse cursor *
  236. ;* *
  237. ;* INPUT: MouseClass * - pointer to mouse class data *
  238. ;* GraphicBufferClass * - screen to draw the mouse on *
  239. ;* int x - x position to store the mouse at *
  240. ;* int y - y position to store the mouse at *
  241. ;* *
  242. ;* Note: The x and y that this routine expects to receive are based on *
  243. ;* the mouse cursor position. This routine automatically adjusts *
  244. ;* for hot spot, so that adjustment should not be made prior to *
  245. ;* this point. *
  246. ;* *
  247. ;* PROTO: void Draw_Mouse( MouseClass * mouse_data, *
  248. ;* GraphicBufferClass *destination, *
  249. ;* int x_pixel, *
  250. ;* int y_pixel); *
  251. ;* *
  252. ;* HISTORY: *
  253. ;* 10/27/1994 PWG : Created. *
  254. ;*=========================================================================*
  255. GLOBAL C Draw_Mouse:NEAR
  256. PROC Draw_Mouse C NEAR
  257. USES eax,ebx,ecx,edx,edi,esi
  258. ARG this:DWORD
  259. ARG dest:DWORD
  260. ARG mousex:DWORD
  261. ARG mousey:DWORD
  262. local x0:dword
  263. local y0:dword
  264. local x1:dword
  265. local y1:dword
  266. local buffx0:dword
  267. local buffy0:dword
  268. mov esi, [this] ; get 32 bit offset to mouse data
  269. mov edi, [dest] ; get 32 bit offset to dest buffer
  270. ;*===================================================================
  271. ;* Copy of X, Y, Width and Height into local registers
  272. ;*===================================================================
  273. mov eax, [mousex]
  274. mov ebx, [mousey]
  275. sub eax, [(MouseType esi).MouseXHot]
  276. sub ebx, [(MouseType esi).MouseYHot]
  277. mov [x0], eax
  278. mov [y0], ebx
  279. add eax,[(MouseType esi).CursorWidth]
  280. add ebx,[(MouseType esi).CursorHeight]
  281. mov [x1], eax
  282. mov [y1], ebx
  283. mov [buffx0], 0
  284. mov eax, [(MouseType esi).MouseCursor]
  285. mov [buffy0], eax
  286. ;*===================================================================
  287. ;* Bounds check source X. Y.
  288. ;*===================================================================
  289. xor eax, eax
  290. xor edx, edx
  291. mov ecx, [x0]
  292. mov ebx, [x1]
  293. shld eax, ecx, 1
  294. shld edx, ebx, 1
  295. mov ecx, [x0]
  296. mov ebx, [x1]
  297. sub ecx, [(GraphicViewPort edi).GVPWidth]
  298. sub ebx, [(GraphicViewPort edi).GVPWidth]
  299. dec ecx
  300. dec ebx
  301. shld eax, ecx, 1
  302. shld edx, ebx, 1
  303. mov ecx, [y0]
  304. mov ebx, [y1]
  305. shld eax, ecx, 1
  306. shld edx, ebx, 1
  307. mov ecx, [y0]
  308. mov ebx, [y1]
  309. sub ecx, [(GraphicViewPort edi).GVPHeight]
  310. sub ebx, [(GraphicViewPort edi).GVPHeight]
  311. dec ecx
  312. dec ebx
  313. shld eax, ecx, 1
  314. shld edx, ebx, 1
  315. xor al, 5
  316. xor dl, 5
  317. mov ah, al
  318. test dl, al
  319. jnz ??out
  320. or al, dl
  321. jz ??not_clip
  322. test ah, 1000b
  323. jz ??scr_left_ok
  324. mov ebx, [x0]
  325. neg ebx
  326. mov [buffx0], ebx
  327. mov [x0], 0
  328. ??scr_left_ok:
  329. test ah, 0010b
  330. jz ??scr_bottom_ok
  331. mov ebx, [y0]
  332. neg ebx
  333. imul ebx, [(MouseType esi).CursorWidth]
  334. add [buffy0], ebx
  335. mov [y0], 0
  336. ??scr_bottom_ok:
  337. test dl, 0100b
  338. jz ??scr_right_ok
  339. mov eax, [(GraphicViewPort edi).GVPWidth] ; get width into register
  340. mov [x1] , eax
  341. ??scr_right_ok:
  342. test dl, 0001b
  343. jz ??not_clip
  344. mov eax, [(GraphicViewPort edi).GVPHeight] ; get width into register
  345. mov [y1] , eax
  346. ??not_clip:
  347. ;*===================================================================
  348. ;* Get the offset into the screen.
  349. ;*===================================================================
  350. mov eax, [y0]
  351. mov edx, [(GraphicViewPort edi).GVPWidth]
  352. add edx, [(GraphicViewPort edi).GVPXAdd]
  353. add edx, [(GraphicViewPort edi).GVPPitch]
  354. imul eax, edx
  355. add eax, [x0]
  356. mov edi, [(GraphicViewPort edi).GVPOffset]
  357. add edi, eax
  358. ;*===================================================================
  359. ;* Adjust the source for the top clip.
  360. ;*===================================================================
  361. mov ebx, [(MouseType esi).CursorWidth] ; turn this into an offset
  362. mov esi, [buffy0] ; edx points to source
  363. add esi, [buffx0] ; plus clipped lines
  364. ;*===================================================================
  365. ;* Calculate the bytes per row add value
  366. ;*===================================================================
  367. mov eax, [x1]
  368. mov ecx, [y1]
  369. sub eax, [x0]
  370. jle ??out
  371. sub ecx, [y0]
  372. jle ??out
  373. sub edx, eax
  374. sub ebx, eax
  375. ;*===================================================================
  376. ;* Handle restoring the buffer to the visible page
  377. ;*===================================================================
  378. ??top_loop:
  379. mov ah, al
  380. ??inner_loop:
  381. mov ch, [esi]
  382. inc esi
  383. test ch, ch
  384. jz ??inc_edi
  385. mov [edi], ch
  386. ??inc_edi:
  387. inc edi
  388. dec ah
  389. jnz ??inner_loop
  390. add esi, ebx ; move past right clipped pixels
  391. add edi, edx ; adjust dest to next line
  392. dec cl ; decrement number of rows to do
  393. jnz ??top_loop ; if more to do, do it
  394. ??out:
  395. ret
  396. ENDP Draw_Mouse
  397. ;***************************************************************************
  398. ;* SET_MOUSE_CURSOR -- Sets the shape to be used as the mouse. *
  399. ;* *
  400. ;* This will inform the system of the shape desired as the mouse *
  401. ;* cursor. *
  402. ;* *
  403. ;* INPUT: xhotspot -- Offset of click point into shape. *
  404. ;* *
  405. ;* yhotspot -- Offset of click point into shape. *
  406. ;* *
  407. ;* cursor -- Shape to use as the new mouse shape. *
  408. ;* *
  409. ;* OUTPUT: Returns with a pointer to the original mouse shape. *
  410. ;* *
  411. ;* PROTO: VOID *Set_Mouse_Cursor( int xhotspot, *
  412. ;* int yhotspot, *
  413. ;* void *cursor); *
  414. ;* *
  415. ;* HISTORY: *
  416. ;* 02/13/1992 JLB : Created. *
  417. ;*=========================================================================*
  418. GLOBAL C ASM_Set_Mouse_Cursor:NEAR
  419. PROC ASM_Set_Mouse_Cursor C NEAR
  420. USES ebx,ecx,edx,esi,edi
  421. ARG this:DWORD ; pointer to mouse cursor struct
  422. ARG xhotspot:DWORD ; the x hot spot of the mouse
  423. ARG yhotspot:DWORD ; the y hot spot of the mouse
  424. ARG cursor:DWORD ; ptr to the new mouse cursor
  425. LOCAL datasize:DWORD
  426. LOCAL stype:WORD
  427. LOCAL swidth:DWORD ; Shape width.
  428. LOCAL sheight:DWORD ; Shape height.
  429. LOCAL ssize:DWORD ; Size of raw shape.
  430. ;*=========================================================================*
  431. ; Direction flag must be forward in this routine.
  432. ;*=========================================================================*
  433. cld
  434. mov esi,[this] ; get offset of real mode data start
  435. ;-------------------------------------------------------------------
  436. ; Calculate the size of the buffer needed.
  437. ;-------------------------------------------------------------------
  438. push [cursor]
  439. call Get_Shape_Uncomp_Size
  440. pop edx
  441. mov [datasize],eax
  442. push [cursor]
  443. call Get_Shape_Width
  444. pop edx
  445. mov [swidth],eax
  446. cmp eax,[(MouseType esi).MaxWidth]
  447. jg ??end
  448. push [cursor]
  449. call Get_Shape_Original_Height
  450. pop edx
  451. mov [sheight],eax
  452. cmp eax,[(MouseType esi).MaxHeight]
  453. jg ??end
  454. mov ebx,[sheight]
  455. mov eax,[swidth]
  456. imul ebx,eax
  457. ??copy_mouse:
  458. mov edi,[(MouseType esi).MouseCursor] ; set edi to point to mouse buffer
  459. mov esi,[cursor] ; set esi to point to mouse shape
  460. mov ax,[esi] ; get the shape type byte
  461. mov [stype],ax ; save off the shape type
  462. test ax,MAKESHAPE_NOCOMP ; is it marked as no compression?
  463. je ??comp_shape ; if not go to the comped shape code
  464. ??copy_type:
  465. test [stype],MAKESHAPE_COMPACT ; if the shape a 16 color shape?
  466. jne ??16_color_copy ; if it is then go handle it
  467. ??normal_copy:
  468. ;-------------------------------------------------------------------
  469. ;* Uncompressed NORMAL shapes just get run-length uncompressed
  470. ;-------------------------------------------------------------------
  471. add esi,10 ; adjust past header of shape
  472. mov eax,[swidth] ; load up the width
  473. mul [sheight] ; find size of shape in pixels
  474. mov edx,eax ; save this in number of bytes
  475. xor ecx,ecx ; clear high of loop variable
  476. ??norm_unrle:
  477. mov al,[esi] ; get a byte out of the file
  478. inc esi ; increment to the next pos
  479. or al,al ; set the flags on register state
  480. jz ??norm_trans ; if its a zero its transparent
  481. mov [edi],al ; write out the pixel to dest
  482. inc edi ; move to next dest position
  483. dec edx ; we have now written another pix
  484. jnz ??norm_unrle ; if more to write then do it
  485. jmp ??done_copy ; otherwise we are all done
  486. ??norm_trans:
  487. mov cl,[esi] ; get how many zeros to write
  488. sub edx,ecx
  489. inc esi ; increment the source position
  490. xor al,al ; clear out al cuz we're writing zeros
  491. rep stosb ; write all of them out
  492. or edx,edx
  493. jnz ??norm_unrle ; if more to do then do it
  494. jmp ??done_copy ; otherwise we are done
  495. ??16_color_copy:
  496. ;-------------------------------------------------------------------
  497. ;* Uncompressed 16 color shapes just get remaped and UN-RLE'd
  498. ;-------------------------------------------------------------------
  499. add esi,10 ; adjust past header of shape
  500. mov ebx,esi ; save of position of remap
  501. add esi,16 ; move past remap table
  502. mov eax,[swidth] ; load up the width
  503. mul [sheight] ; load up the height
  504. mov edx,eax ; save this in number of bytes
  505. xor eax,eax ; clear high of lookup variable
  506. xor ecx,ecx ; clear high of loop variable
  507. ??16_color_unrle:
  508. mov al,[esi] ; get a byte out of the file
  509. inc esi ; increment to the next pos
  510. or al,al ; set the flags on register state
  511. jz ??16_color_trans ; if its a zero its transparent
  512. mov al,[ebx+eax] ; remap the pixel from 16 color table
  513. mov [edi],al ; store it out to the dest address
  514. inc edi ; move to next dest address
  515. dec edx ; we have now written a pixel
  516. jnz ??16_color_unrle
  517. jmp ??done_copy
  518. ??16_color_trans:
  519. mov cl,[esi] ; get how many zeros to write
  520. sub edx,ecx ; subtract off count ahead of time
  521. inc esi ; increment the source position
  522. xor al,al ; clear out al cuz we're writing zeros
  523. rep stosb ; write all of them out
  524. or edx,edx ; or edx to test for zero
  525. jnz ??16_color_unrle
  526. jmp ??done_copy
  527. ;-------------------------------------------------------------------
  528. ; Deal with the compressed shape by copying it into the shape
  529. ; staging buffer.
  530. ;-------------------------------------------------------------------
  531. ??comp_shape:
  532. mov edi,[ShapeBuffer] ; get a pointer to ShapeBuffer
  533. mov ax,[esi] ; load in the shape type
  534. add esi,2 ; increment the shape pointer
  535. or ax,MAKESHAPE_NOCOMP ; make the shape as uncompressed
  536. mov [stype],ax ; save off the shape type
  537. mov [edi],ax ; write out uncompressed shape
  538. add edi,2
  539. ;-------------------------------------------------------------------
  540. ; Process the shape header information and copy it over to the new
  541. ; location.
  542. ;-------------------------------------------------------------------
  543. mov ecx,4 ; transfer height, width, org and
  544. test eax,MAKESHAPE_COMPACT ; is it a 16 color shape?
  545. je ??copy_head ; no - don't worry about it
  546. add ecx,8 ; otherwise adjust ecx for header
  547. ??copy_head:
  548. rep movsw ; copy the necessary bytes
  549. mov eax,[datasize] ; get uncompressed length
  550. push eax ; push as third param
  551. push edi ; push the destination offset
  552. push esi ; push the source offset
  553. call LCW_Uncompress ; do the uncompress
  554. pop eax
  555. pop eax
  556. pop eax
  557. mov esi,[this]
  558. mov edi,[(MouseType esi).MouseCursor] ; set edi to point to mouse buffer
  559. mov esi,[ShapeBuffer]
  560. jmp ??copy_type
  561. ??done_copy:
  562. mov esi,[this] ; get offset of real mode data start
  563. mov eax,[xhotspot] ; get the mouse cursors x hotspot
  564. mov [(MouseType esi).MouseXHot],eax
  565. mov eax,[yhotspot] ; get the mouse cursors y hotspot
  566. mov [(MouseType esi).MouseYHot],eax
  567. mov ebx,[sheight] ; get shape height
  568. mov [(MouseType esi).CursorHeight],ebx
  569. mov ebx,[swidth]
  570. mov [(MouseType esi).CursorWidth],ebx
  571. ;-------------------------------------------------------------------
  572. ; Final cleanup and exit.
  573. ;-------------------------------------------------------------------
  574. ??end:
  575. push [cursor]
  576. push [(MouseType esi).PrevCursor]
  577. pop eax
  578. pop [(MouseType esi).PrevCursor]
  579. ret ; and return back to the world
  580. ENDP ASM_Set_Mouse_Cursor
  581. END