Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 3708 → Rev 5039

/drivers/video/vidintel.asm
13,18 → 13,19
predefined_width = 0;1366
predefined_height = 0;768
 
; standard driver stuff
format MS COFF
; standard driver stuff; target OS version = 0.80
format PE DLL native 0.80
entry START
__DEBUG__ equ 1
__DEBUG_LEVEL__ equ 1
section '.flat' readable writable executable
include '../proc32.inc'
include '../struct.inc'
include '../macros.inc'
;include 'fdo.inc'
 
DEBUG = 1
 
include 'proc32.inc'
include 'imports.inc'
 
public START
public version
 
section '.flat' code readable align 16
; the start procedure (see the description above)
START:
; 1. Detect device. Abort if not found.
42,11 → 43,11
call SetMode
; 4. Cleanup and return.
.return0_cleanup:
stdcall FreeKernelSpace, esi
invoke FreeKernelSpace, esi
.return0:
pop esi
xor eax, eax
ret 4
ret
 
; check that there is Intel videocard
; if so, map MMIO registers and set internal variables
59,7 → 60,7
push esi
push 10h
push esi
call PciRead32
invoke PciRead32
; 1b. loword(eax) = ax = VendorID, hiword(eax) = DeviceID.
; Test whether we have Intel chipset.
cmp ax, 8086h
71,7 → 72,7
mov edi, pciid_text
call WriteWord
mov esi, hellomsg
call SysMsgBoardStr
invoke SysMsgBoardStr
popa
; 1d. Test whether we know this DeviceID.
; If this is the case, remember the position of the device in line of Intel cards;
88,7 → 89,7
; 1e. Continue saying hi with positive intonation.
pusha
mov esi, knownmsg
call SysMsgBoardStr
invoke SysMsgBoardStr
popa
; 2. Prepare MMIO region to control the card.
; 2a. Read MMIO physical address from PCI config space.
99,7 → 100,7
@@:
push 10h
push esi
call PciRead32
invoke PciRead32
; 2b. Mask out PCI region type, lower 4 bits.
and al, not 0xF
; 2c. Create virtual mapping of the physical memory.
106,7 → 107,7
push 1Bh
push 100000h
push eax
call MapIoMem
invoke MapIoMem
; 3. Return.
xchg esi, eax
.return:
115,7 → 116,7
.return_unknown_pciid:
pusha
mov esi, unknownmsg
call SysMsgBoardStr
invoke SysMsgBoardStr
popa
ret
 
217,7 → 218,7
test cl, cl
jns .dumploop
mov esi, edidmsg
call SysMsgBoardStr
invoke SysMsgBoardStr
popa
end if
; 7. Test whether EDID is good.
383,7 → 384,7
or byte [edx+10183h], 80h ; DSPACNTR: enable Display Plane A
sti
; 2. Notify the kernel that resolution has changed.
call GetDisplay
invoke GetDisplay
mov edx, [width]
mov dword [eax+8], edx
mov edx, [height]
392,10 → 393,14
mov eax, [width]
dec eax
dec edx
call SetScreen
invoke SetScreen
.return:
ret
 
include '../peimport.inc'
data fixups
end data
 
align 4
hellomsg db 'Intel videocard detected, PciId=8086:'
pciid_text db '0000'
409,9 → 414,6
db 0
end if
 
version:
dd 0x50005
 
width dd predefined_width
height dd predefined_height