Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- putAxes PROC
- push ebx
- push esi
- push edi
- mov ecx , ddheight ; # of scanlines
- mov edi , [ddsd.lpSurface] ; pixel output SETS UP INITIAL POINTER
- mov xaxis, 0
- mov yaxis, 0
- mov ecx, xaxis
- @@centre:
- mov ebx, ddwidth ; move full screen width in pixels to ebx
- mov eax, xaxis ; move x into eax
- sub ebx, eax ; move across from left to right x number of pixels
- mov ebx, 4 ; move the size of a pixel into ebx
- mul ebx ; mul size of pixel by number of pixels
- add edi, eax ; add the total starting from the start of the screen to make edi equal to the x coordinate
- mov ebx, 512 ; mov y to ebx
- mov eax, [ddsd.lPitch] ; mov the width of a row (1 y unit) into eax
- mul ebx ; mul number of rows by y coordinate
- add edi, eax ; add the product to edi
- @@pixel:
- mov eax, 4000000000 ; mov a colour into eax
- 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
- @@horizontal:
- inc ecx ; pixel counter
- cmp ecx, 1280
- je @@vertical
- add edi, 4
- jmp @@pixel
- @@vertical:
- mov edi , [ddsd.lpSurface] ; pixel output SETS UP INITIAL POINTER
- mov ebx, ddwidth ; move full screen width in pixels to ebx
- mov eax, 640 ; move x into eax
- sub ebx, eax ; move across from left to right x number of pixels
- mov ebx, 4 ; move the size of a pixel into ebx
- mul ebx ; mul size of pixel by number of pixels
- add edi, eax
- mov ecx, 0 ; mov y start into ecx (row counter)
- mov eax, [ddsd.lPitch] ; mov the width of a row (1 y unit) into eax
- mul ebx ; mul number of rows by y coordinate
- add edi, eax ; add the product to edi
- @@drawvert:
- mov eax, 4000000000 ; mov a colour into eax
- 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
- inc ecx
- cmp ecx, 1024
- je @@end
- add edi, [ddsd.lPitch]
- jmp @@drawvert
- @@end:
- pop edi
- pop esi
- pop ebx
- ret
- putAxes ENDP
Add Comment
Please, Sign In to add comment