Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
2.1 KiB

  1. ;---------------------------Module-Header------------------------------;
  2. ; Module Name: vgaregs.asm
  3. ;
  4. ; Copyright (c) 1992 Microsoft Corporation
  5. ;-----------------------------------------------------------------------;
  6. ;-----------------------------------------------------------------------;
  7. ; VOID vInitRegs(void)
  8. ;
  9. ; Sets the VGA's data control registers to their default states.
  10. ;
  11. ;-----------------------------------------------------------------------;
  12. .386
  13. .model small,c
  14. assume cs:FLAT,ds:FLAT,es:FLAT,ss:FLAT
  15. assume fs:nothing,gs:nothing
  16. .xlist
  17. include stdcall.inc ;calling convention cmacros
  18. include i386\strucs.inc
  19. include i386\driver.inc
  20. include i386\egavga.inc
  21. .list
  22. .code
  23. cProc vInitRegs,4,< \
  24. uses esi edi ebx, \
  25. ppdev: ptr PDEV >
  26. mov esi,ppdev
  27. ; Initialize sequencer to its defaults (all planes enabled, index
  28. ; pointing to Map Mask).
  29. mov dx,VGA_BASE + SEQ_ADDR
  30. mov ax,(MM_ALL shl 8) + SEQ_MAP_MASK
  31. out dx,ax
  32. ; Initialize graphics controller to its defaults (set/reset disabled for
  33. ; all planes, no rotation & ALU function == replace, write mode 0 & read
  34. ; mode 0, color compare ignoring all planes (read mode 1 reads always
  35. ; return 0ffh, handy for ANDing), and the bit mask == 0ffh, gating all
  36. ; bytes from the CPU.
  37. mov dl,GRAF_ADDR
  38. mov ax,(0 shl 8) + GRAF_ENAB_SR
  39. out dx,ax
  40. mov ax,(DR_SET shl 8) + GRAF_DATA_ROT
  41. out dx,ax
  42. ; Default to read mode 0, write mode 0:
  43. mov edx,VGA_BASE + GRAF_ADDR
  44. mov ah,byte ptr [esi].pdev_ulrm0_wmX[0]
  45. mov al,GRAF_MODE
  46. out dx,ax ;write mode 0, read mode 0
  47. mov ax,(0 shl 8) + GRAF_CDC
  48. out dx,ax
  49. mov ax,(0FFh shl 8) + GRAF_BIT_MASK
  50. out dx,ax
  51. cRet vInitRegs
  52. endProc vInitRegs
  53. end
  54.