Changeset 50 in xtideuniversalbios for trunk/Assembly_Library/Src/Display
- Timestamp:
- Oct 9, 2010, 5:47:26 PM (14 years ago)
- google:author:
- aitotat
- Location:
- trunk/Assembly_Library/Src/Display
- Files:
-
- 2 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 -
trunk/Assembly_Library/Src/Display/DisplayContext.asm
r48 r50 2 2 ; Project name : Assembly Library 3 3 ; Created date : 25.6.2010 4 ; Last update : 5.10.20104 ; Last update : 9.10.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Functions for managing display context. … … 20 20 ALIGN JUMP_ALIGN 21 21 DisplayContext_Initialize: 22 call .DetectAndSetDisplaySegment 22 call .DetectAndSetDisplaySegment ; and .InitializeFlags 23 23 mov WORD [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fnCharOut], DEFAULT_CHARACTER_OUTPUT 24 24 mov WORD [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.wCursorShape], CURSOR_NORMAL 25 25 mov BYTE [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.bAttribute], SCREEN_BACKGROUND_ATTRIBUTE 26 mov BYTE [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.bFlags], FLG_CONTEXT_ATTRIBUTES27 28 26 xor ax, ax 29 27 call DisplayCursor_SetCoordinatesFromAX 30 jmp SHORTDisplayContext_SynchronizeToHardware28 jmp DisplayContext_SynchronizeToHardware 31 29 32 30 ;-------------------------------------------------------------------- … … 37 35 ; Nothing 38 36 ; Corrupts registers: 39 ; Nothing37 ; AX, DX 40 38 ;-------------------------------------------------------------------- 41 39 .DetectAndSetDisplaySegment: 42 mov WORD [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition+2], COLOR_TEXT_SEGMENT40 mov ax, COLOR_TEXT_SEGMENT 43 41 cmp BYTE [VIDEO_BDA.bMode], MDA_TEXT_MODE 44 jne SHORT .Return 45 sub WORD [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition+2], COLOR_TEXT_SEGMENT - MONO_TEXT_SEGMENT 46 .Return: 42 jne SHORT .StoreSegmentToDisplayContext 43 mov ax, MONO_TEXT_SEGMENT 44 .StoreSegmentToDisplayContext: 45 mov [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition+2], ax 46 ; Fall to InitializeFlags 47 48 ;-------------------------------------------------------------------- 49 ; .InitializeFlags 50 ; Parameters: 51 ; DS: BDA segment (zero) 52 ; Returns: 53 ; Nothing 54 ; Corrupts registers: 55 ; AX, DX 56 ;-------------------------------------------------------------------- 57 .InitializeFlags: 58 mov dl, FLG_CONTEXT_ATTRIBUTES 59 call CgaSnow_IsCgaPresent 60 jnc SHORT .DoNotSetCgaFlag 61 or dl, FLG_CONTEXT_CGA 62 .DoNotSetCgaFlag: 63 mov [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.bFlags], dl 47 64 ret 48 65 … … 188 205 ; Nothing 189 206 ; Corrupts registers: 190 ; Nothing207 ; BL 191 208 ;-------------------------------------------------------------------- 192 209 ALIGN JUMP_ALIGN 193 210 DisplayContext_SetCharOutputFunctionFromAXwithAttribFlagInBL: 211 and bl, FLG_CONTEXT_ATTRIBUTES 212 and BYTE [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.bFlags], ~FLG_CONTEXT_ATTRIBUTES 213 or [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.bFlags], bl 194 214 mov [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fnCharOut], ax 195 mov [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.bFlags], bl196 215 ret 197 216
Note:
See TracChangeset
for help on using the changeset viewer.