-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRENDERB.ASM
47 lines (25 loc) · 1.32 KB
/
RENDERB.ASM
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
;//////////////////////////////////////////////////////////////////////////////
;
;This function simply copies the double buffer into the video buffer. Note
;it uses the 32 bit instructions and registers for a little bit more speed
;eventhough the video ram access will ultimately be the bottleneck
;
;//////////////////////////////////////////////////////////////////////////////
.MODEL MEDIUM,C ; use medium memory model C function names
.CODE ; begin the code segment
EXTRN double_buffer:DWORD ; the double buffer is elsewhere
EXTRN video_buffer:DWORD ; the video buffer is elsewhere
PUBLIC Render_Buffer_32 ; export function name to linker
Render_Buffer_32 PROC FAR C ; this function is C callable and far
.386 ; use 80386 stuff
push ds ; save the data segment register
cld ; set direction to foward
lds si, double_buffer ; make source for move the double buffer
les di, video_buffer ; make destination the video buffer
mov cx,320*152/4 ; move the whole 3-D portion of the screen
rep movsd ; do it
pop ds ; restore registers
ret ; blaze!!
Render_Buffer_32 ENDP
END