Kód:
void SetVideoMode80x30()
{
asm {
mov ax, 3 // nahozeni modu 80x25 pres BIOS
int 0x10
mov dx, 0x3c4 // sequencer adress register
mov al, 0 // reset
out dx, al
mov al, 1 // synchronni smazani sequenceru
inc dx
out dx, al // zachovani obsahu obrazovky
dec dx // sequencer adress register
mov dx, 0x3d4
mov al, 0x17 // mode control
out dx, al
inc dx // mode control register
in al, dx
and al, 0x7f
out dx, al
dec dx // sequencer adress register
mov al, 0x11 // light pen low
out dx, al
inc dx // light pen low register
in al, dx
and al, 0x7f
out dx, al
mov dx, 0x3cc
in al, dx // al <- nastaveni miscellaneous output registeru
or al, 0x0c0 // zmena radkovani 400 (80x25) na 480 (80x30)
mov dx, 0x3c2 // miscellaneous output register
out dx, al
mov dx, 0x3d4
mov al, 6 // vertical character display
out dx, al
mov al, 0x0b
inc dx // vertical character display register
out dx, al
dec dx // sequencer adress register
mov al, 7 // vertical synchronization position
out dx, al
mov al, 0x3e
inc dx // vertical synchronisation position register
out dx, al
dec dx // sequencer adress register
mov al, 9 // max raster address
out dx, al
mov al, 0x4f
inc dx // max raster address register
out dx, al
dec dx // sequencer adress register
mov al, 0x10 // light pen high
out dx, al
mov al, 0x0ea
inc dx // light pen high register
out dx, al
dec dx // sequencer adress register
mov al, 0x11 // light pen low
out dx, al
mov al, 0x8c
inc dx // light pen low register
out dx, al
dec dx // sequencer adress register
mov al, 0x12 // vertical end scan line
out dx, al
mov al, 0x0df
inc dx // vertical end scan line register
out dx, al
dec dx // sequencer adress register
mov al, 0x15 // vertical start blanking
out dx, al
mov al, 0x0e7
inc dx // vertical start blanking register
out dx, al
dec dx // sequencer adress register
mov al, 0x16 //vertical end blanking
out dx, al
mov al, 4
inc dx // vertical end blanking register
out dx, al
dec dx // sequencer adress register
mov al, 0x11 // light pen low
out dx, al
inc dx // light pen low register
in al, dx
or al, 0x80
out dx, al
dec dx // sequencer adress register
mov al, 0x17 // mode control
out dx, al
inc dx // mode control register
in al, dx
or al, 0x80
out dx, al
mov dx, 0x3c4 // sequender adress register
mov al, 0 // reset sequencer
out dx, al
mov al, 3
inc dx // reset sequencer register
out dx, al
}
}
nahodenie s5 na 80x25: