-
Notifications
You must be signed in to change notification settings - Fork 0
/
ID_VH_A.ASM
110 lines (84 loc) · 1.33 KB
/
ID_VH_A.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
; ID_VL.ASM
IDEAL
MODEL MEDIUM,C
INCLUDE 'ID_VL.EQU'
SCREENSEG = 0a000h
UPDATEWIDE = 20
UPDATEHIGH = 13
DATASEG
EXTRN bufferofs :WORD
EXTRN displayofs :WORD
EXTRN ylookup :WORD
EXTRN linewidth :WORD
EXTRN blockstarts :WORD ;offsets from drawofs for each update block
EXTRN update :BYTE
CODESEG
;=================
;
; VH_UpdateScreen
;
;=================
PROC VH_UpdateScreen
PUBLIC VH_UpdateScreen
USES si,di
mov dx,SC_INDEX
mov ax,SC_MAPMASK+15*256
out dx,ax
mov dx,GC_INDEX
mov al,GC_MODE
out dx,al
inc dx
in al,dx
and al,252
or al,1
out dx,al
mov bx,UPDATEWIDE*UPDATEHIGH-1 ; bx is the tile number
mov dx,[linewidth]
;
; see if the tile needs to be copied
;
@@checktile:
test [update+bx],1
jnz @@copytile
@@next:
dec bx
jns @@checktile
;
; done
;
mov dx,GC_INDEX+1
in al,dx
and al,NOT 3
or al,0
out dx,al
ret
;
; copy a tile
;
@@copytile:
mov [update+bx],0
shl bx,1
mov si,[blockstarts+bx]
shr bx,1
mov di,si
add si,[bufferofs]
add di,[displayofs]
mov ax,SCREENSEG
mov ds,ax
REPT 16
mov al,[si]
mov [di],al
mov al,[si+1]
mov [di+1],al
mov al,[si+2]
mov [di+2],al
mov al,[si+3]
mov [di+3],al
add si,dx
add di,dx
ENDM
mov ax,ss
mov ds,ax
jmp @@next
ENDP
END