Guest User

Untitled

a guest
Feb 19th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.68 KB | None | 0 0
  1. putAxes PROC
  2. push ebx
  3. push esi
  4. push edi
  5.  
  6. mov ecx , ddheight ; # of scanlines
  7. mov edi , [ddsd.lpSurface] ; pixel output SETS UP INITIAL POINTER
  8.  
  9. mov xaxis, 0
  10. mov yaxis, 0
  11.  
  12. mov ecx, xaxis
  13.  
  14.  
  15. @@centre:
  16. mov ebx, ddwidth ; move full screen width in pixels to ebx
  17. mov eax, xaxis ; move x into eax
  18. sub ebx, eax ; move across from left to right x number of pixels
  19. mov ebx, 4 ; move the size of a pixel into ebx
  20. mul ebx ; mul size of pixel by number of pixels
  21. add edi, eax ; add the total starting from the start of the screen to make edi equal to the x coordinate
  22. mov ebx, 512 ; mov y to ebx
  23. mov eax, [ddsd.lPitch] ; mov the width of a row (1 y unit) into eax
  24. mul ebx ; mul number of rows by y coordinate
  25. add edi, eax ; add the product to edi
  26.  
  27. @@pixel:
  28. mov eax, 4000000000 ; mov a colour into eax
  29. mov [edi], eax ; mov the colour into edi (which is the total of x pixels from the left + y rows down) and write the pixel
  30.  
  31. @@horizontal:
  32.  
  33. inc ecx ; pixel counter
  34. cmp ecx, 1280
  35. je @@vertical
  36. add edi, 4
  37. jmp @@pixel
  38.  
  39. @@vertical:
  40. mov edi , [ddsd.lpSurface] ; pixel output SETS UP INITIAL POINTER
  41. mov ebx, ddwidth ; move full screen width in pixels to ebx
  42. mov eax, 640 ; move x into eax
  43. sub ebx, eax ; move across from left to right x number of pixels
  44. mov ebx, 4 ; move the size of a pixel into ebx
  45. mul ebx ; mul size of pixel by number of pixels
  46. add edi, eax
  47. mov ecx, 0 ; mov y start into ecx (row counter)
  48. mov eax, [ddsd.lPitch] ; mov the width of a row (1 y unit) into eax
  49. mul ebx ; mul number of rows by y coordinate
  50. add edi, eax ; add the product to edi
  51.  
  52. @@drawvert:
  53. mov eax, 4000000000 ; mov a colour into eax
  54. mov [edi], eax ; mov the colour into edi (which is the total of x pixels from the left + y rows down) and write the pixel
  55. inc ecx
  56. cmp ecx, 1024
  57. je @@end
  58. add edi, [ddsd.lPitch]
  59. jmp @@drawvert
  60.  
  61. @@end:
  62.  
  63.  
  64. pop edi
  65. pop esi
  66. pop ebx
  67.  
  68.  
  69. ret
  70. putAxes ENDP
Add Comment
Please, Sign In to add comment