Code: Select all
setRegs:
mov si, offset regs825
push cs
pop ds
mov dx, 3C2h
lodsb
out dx, al
IODELAY
mov dx, 3DAh
lodsb
out dx, al
IODELAY
xor cl, cl
mov dx, 3C4h
l1:
lodsb
xchg al, ah
mov al, cl
out dx, ax
IODELAY
inc cl
cmp cl, 4
jbe l1
mov dx, 3D4h
mov ax, 0E11h
out dx, ax
IODELAY
xor cl, cl
;mov dx, 3D4h
l2:
lodsb
xchg al, ah
mov al, cl
out dx, ax
IODELAY
inc cl
cmp cl, 18h
jbe l2
xor cl, cl
mov dx, 3CEh
l3:
lodsb
xchg al, ah
mov al, cl
out dx, ax
IODELAY
inc cl
cmp cl, 8
jbe l3
mov dx, 3DAh
in al, dx
xor cl, cl
mov dx, 3C0h
l4:
in ax, dx
mov al, cl
out dx, al
IODELAY
lodsb
out dx, al
IODELAY
inc cl
cmp cl, 14h
jbe l4
mov al, 20h
out dx, al
IODELAY
cld
; out 3c4H, 0402H ;Mask reg; enable write to map 2
; out 3c4H, 0704H ;Memory Mode reg ; alpha, ext mem, non-interleaved
; out 3ceH, 0005H ;Graphics Mode reg; non-interleaved access
; out 3ceH, 0406H ;Graphics Misc reg; map char gen RAM to a000:0
; out 3ceH, 0204H ;Graphics ReadMapSelect reg; enable read chargen RAM
MOV AX, 0a000h
MOV ES, AX
MOV DX, 03C4h
MOV AX, 0402h ; seq.mapmask = !0, !1, 2, !3
OUT DX, AX
IODELAY
MOV AX, 0704h ; seq.font A=0 B=0
OUT DX, AX
IODELAY
MOV DX, 03CEh
MOV AX, 0005h ; gx.modereg = !256, !shift, !OE, writemode_0
OUT DX, AX
IODELAY
MOV AX, 0406h ; gx.miscreg = map_b8000, !HostOE, !graphics
OUT DX, AX
IODELAY
mov ax,0204h
out dx,ax
IODELAY
; set font to garbage
MOV CX, 01000h
XOR DI, DI
mov si, offset Font
lop: stosw
stosw
stosw
stosw
stosw
stosw
stosw
stosw
add di,16
dec cx
jnz lop
; out 3c4H, 0302H ;Mask reg; disable write to map 2
; out 3c4H, 0304H ;Memory Mode reg; alpha, ext mem, interleaved
; out 3ceH, 1005H ;Graphics Mode reg; interleaved access
; out 3ceH, 0e06H ;Graphics Misc reg; regen buffer to b800:0
; out 3ceH, 0004H ;Graphics ReadMapSelect reg; disable read chargen RAM
;restore VGA state to normal operation
mov ax, 0302h
out dx, ax
IODELAY
mov ax, 0304h
out dx, ax
IODELAY
mov dx, 03ceh
mov ax, 1005h
out dx, ax
IODELAY
mov ax, 0E06h
out dx, ax
IODELAY
mov ax,0004h
out dx,ax
IODELAY
mov ax, 0B800h
mov es,ax
mov di,0
mov al,'O' ; буква O
mov ah,7 ; белым по черному
mov cx,10 ; один раз
rep stosw
hlt
regs825:
; MISC
db 67h, 00h
; SEQ
db 03h, 00h, 03h, 00h, 02h
; CRTC
db 5Fh, 4Fh, 50h, 82h, 55h, 81h, 0BFh, 1Fh
db 00h, 4Fh, 0Dh, 0Eh, 00h, 00h, 00h, 50h
db 9Ch, 0Eh, 8Fh, 28h, 1Fh, 96h, 0B9h, 0A3h
db 0FFh
; GC
db 00h, 00h, 00h, 00h, 00h, 10h, 0Eh, 00h
db 0FFh
; AC
db 00h, 01h, 02h, 03h, 04h, 05h, 14h, 07h
db 38h, 39h, 3Ah, 3Bh, 3Ch, 3Dh, 3Eh, 3Fh
db 0Ch, 00h, 0Fh, 08h, 00h
Font: здесь шрифт