2 ; $Source: x:/prj/tech/libsrc/dev2d/RCS/vgaasm.asm $
5 ; $Date: 1996/10/16 16:07:00 $
9 ; This file is part of the 2d library.
21 ; The most crashproof piece of code I've ever seen:
26 ; takes (x,y) position of new focus in eax, edx.
33 ; save new (x,y) position of screen.
35 mov [ebx+GRS_SCREEN_X
],ax
36 mov [ebx+GRS_SCREEN_Y
],dx
38 mov ebx,_grd_screen_canvas
39 ; calculate start address = bits-base + y*row + x/4.
40 mov ecx,[ebx+GRS_CANVAS_BM
+GRS_BITMAP_BITS
]
41 mov eax,[ebx+GRS_CANVAS_BM
+GRS_BITMAP_ROW
]
47 ;update visible_canvas
48 mov edx,_grd_visible_canvas
49 mov [edx+GRS_CANVAS_BM
+GRS_BITMAP_BITS
],ecx
53 ; set VGA start address.
68 ; takes start in eax, count in edx, pal_data ebx
71 ; don't bomb if count is <= 0.
77 lea ecx,[edx+2*edx] ; ecx = 3*count
78 ; send start to notify pel of upcoming read.
81 ; read r,g,b values in order from pel data register.
85 shl al,2 ;fix up 6-bit values for 2d
96 ; takes start in eax, count in edx, pal_data ebx
99 ; don't bomb if count is <= 0.
105 lea ecx,[edx+2*edx] ; ecx = 3*count
106 ; send start to notify pel of upcoming write.
109 ; send r,g,b values in order to pel data register.
113 shr al,2 ;fix up 8-bit values for vga
124 ; returns 1 if horizontal retrace is in progress.
125 public vga_stat_htrace_
135 ; returns 1 if horizontal retrace is in progress.
136 public vga_stat_vtrace_
147 ; takes width in pixels in eax.
148 public vga_set_width_