Changeset 50 in xtideuniversalbios for trunk/Assembly_Library/Src/Display/CgaSnow.asm
- Timestamp:
- Oct 9, 2010, 5:47:26 PM (15 years ago)
- google:author:
- aitotat
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Assembly_Library/Src/Display/CgaSnow.asm
r49 r50 2 2 ; Project name : Assembly Library 3 3 ; Created date : 8.10.2010 4 ; Last update : 8.10.20104 ; Last update : 9.10.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Functions for preventing CGA snow. … … 8 8 ; Section containing code 9 9 SECTION .text 10 11 ;-------------------------------------------------------------------- 12 ; CgaSnow_IsCgaPresent 13 ; Parameters: 14 ; DS: BDA segment (zero) 15 ; Returns: 16 ; CF: Set if CGA detected 17 ; Cleared if CGA not detected 18 ; Corrupts registers: 19 ; AX 20 ;-------------------------------------------------------------------- 21 ALIGN JUMP_ALIGN 22 CgaSnow_IsCgaPresent: 23 cmp WORD [BDA.wVidPort], CGA_STATUS_REGISTER - OFFSET_TO_CGA_STATUS_REGISTER 24 jne SHORT .CgaNotFound 25 call DisplayPage_GetColumnsToALandRowsToAH 26 cmp ah, [BDA.bVidRows] ; Video rows stored only by EGA and later 27 je SHORT .CgaNotFound ; Must be EGA or later 28 stc 29 ret 30 ALIGN JUMP_ALIGN 31 .CgaNotFound: 32 clc 33 ret 10 34 11 35 … … 29 53 ALIGN JUMP_ALIGN 30 54 CgaSnow_Stosb: 31 call Load AndVerifyStatusRegisterFromBDA32 j neSHORT .StosbWithoutWaitSinceUnknownPort55 call LoadCgaStatusRegisterAddressToDXifCgaPresent 56 jz SHORT .StosbWithoutWaitSinceUnknownPort 33 57 34 58 mov ah, al … … 44 68 CgaSnow_Stosw: 45 69 push bx 46 call Load AndVerifyStatusRegisterFromBDA47 j neSHORT .StoswWithoutWaitSinceUnknownPort70 call LoadCgaStatusRegisterAddressToDXifCgaPresent 71 jz SHORT .StoswWithoutWaitSinceUnknownPort 48 72 49 73 xchg bx, ax … … 71 95 ALIGN JUMP_ALIGN 72 96 CgaSnow_Scasb: 73 call Load AndVerifyStatusRegisterFromBDA74 j neSHORT .ScasbWithoutWaitSinceUnknownPort97 call LoadCgaStatusRegisterAddressToDXifCgaPresent 98 jz SHORT .ScasbWithoutWaitSinceUnknownPort 75 99 76 100 mov ah, al … … 98 122 ALIGN JUMP_ALIGN 99 123 CgaSnow_RepMovsb: 100 call Load AndVerifyStatusRegisterFromBDA101 j neSHORT .RepMovsbWithoutWaitSinceUnknownPort124 call LoadCgaStatusRegisterAddressToDXifCgaPresent 125 jz SHORT .RepMovsbWithoutWaitSinceUnknownPort 102 126 103 127 .MovsbNextByte: … … 115 139 116 140 ;-------------------------------------------------------------------- 117 ; Load AndVerifyStatusRegisterFromBDA141 ; LoadCgaStatusRegisterAddressToDXifCgaPresent 118 142 ; Parameters: 119 143 ; DS: BDA segment (zero) 120 144 ; Returns: 121 145 ; DX: CGA Status Register Address 122 ; ZF: Set if CGA Base Port found in BDA 146 ; ZF: Set if CGA not present 147 ; Cleared if CGA present 123 148 ; Corrupts registers: 124 149 ; Nothing 125 150 ;-------------------------------------------------------------------- 126 151 ALIGN JUMP_ALIGN 127 LoadAndVerifyStatusRegisterFromBDA: 128 mov dx, [BDA.wVidPort] 129 add dl, OFFSET_TO_CGA_STATUS_REGISTER 130 cmp dx, CGA_STATUS_REGISTER 131 je SHORT .CheckIfEgaOrLater 132 ret 133 134 ALIGN JUMP_ALIGN 135 .CheckIfEgaOrLater: 136 push ax 137 call DisplayPage_GetColumnsToALandRowsToAH 138 cmp ah, [BDA.bVidRows] ; Video rows stored only by EGA and later 139 lahf 140 xor ah, 1<<6 ; Invert ZF 141 sahf 142 pop ax 152 LoadCgaStatusRegisterAddressToDXifCgaPresent: 153 test BYTE [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.bFlags], FLG_CONTEXT_CGA 154 jz SHORT .NoCgaDetected 155 mov dx, CGA_STATUS_REGISTER 156 ALIGN JUMP_ALIGN, ret 157 .NoCgaDetected: 143 158 ret 144 159
Note:
See TracChangeset
for help on using the changeset viewer.