source: xtideuniversalbios/trunk/Assembly_Library/Src/Display/Display.asm@ 598

Last change on this file since 598 was 592, checked in by Krister Nordvall, 6 years ago

Changes:

  • The problem with NASM in the previous revision (r591) has been fixed.
  • The colors used by the boot menu and hotkey bar can now be customized by selecting one of a number of pre-defined color themes. Suggestions for additional themes are more than welcome!
  • Large builds are now 10 KB. Small builds are still 8 KB with the exception of the Tiny build which is now 4 KB. In other words, builds are now as small as possible to make it easier to combine them with other BIOSes.
  • Added code to the library to improve drive error handling. XTIDECFG can now handle "Drive Not Ready" errors.
  • Fixed a couple of potential bugs in AtaID.asm (AtaID_GetMaxPioModeToAXandMinCycleTimeToCX); 1) ATA1.bPioMode was treated as a WORD variable. 2) ATA2.bPIOSupp was assumed to be non-zero which would result in PIO mode 3 being returned if the assumption was wrong.
  • Made the same changes in the equivalent function used by BIOSDRVS (DisplayPioModeInformationUsingAtaInfoFromDSBX in AtaInfo.asm).
  • Fixed a bug from r587 in PDC20x30.asm in PDC20x30_GetMaxPioModeToALandMinPioCycleTimeToBX.
  • Fixed a bug from r523 in XTIDECFG where Auto Configure would only set the IRQ on one IDE interface on AT-builds.
  • XTIDECFG will now restore the default settings for the "Serial port virtual device" when reselecting it in the list of device types. This makes it behave consistently for all device types.
  • The eAAM macro is now used regardless if USE_UNDOC_INTEL is defined or not because it is apparently supported on all processors including the NEC V20/V30 CPUs.
  • Renamed the EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS define to EXCLUDE_FROM_XUB.
  • Added a define to exclude unused library code from BIOSDRVS (EXCLUDE_FROM_BIOSDRVS). This makes it a lot smaller than in previous revisions.
  • All unnecessary CLD-instructions are now under a new define 'CLD_NEEDED' which is only enabled for the BIOS. It is disabled for XTIDECFG and BIOSDRVS but can be enabled if needed by adding this define to the respective makefile. This change was made because these unnecessary instructions are wasteful and should never be needed. In fact, they only serve to hide bugs (in other peoples code) which I strongly believe should be avoided. I recommend people making their own BIOSes from source to not use this define as it's extremely unlikely to be needed.
  • Updated the copyright info in SerDrive and changed an URL to point to the new site.
  • Updated the copyright info and version number in BIOSDRVS.
  • Updated the copyright info in XTIDECFG.
  • Optimizations in general.
File size: 4.6 KB
RevLine 
[41]1; Project name : Assembly Library
2; Description : Display Library functions for CALL_DISPLAY_LIBRARY macro
3; that users should use to make library call.
4
[376]5;
[526]6; XTIDE Universal BIOS and Associated Tools
7; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2013 by XTIDE Universal BIOS Team.
[376]8;
9; This program is free software; you can redistribute it and/or modify
10; it under the terms of the GNU General Public License as published by
11; the Free Software Foundation; either version 2 of the License, or
12; (at your option) any later version.
[526]13;
[376]14; This program is distributed in the hope that it will be useful,
15; but WITHOUT ANY WARRANTY; without even the implied warranty of
16; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
[526]17; GNU General Public License for more details.
[376]18; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
[526]19;
[376]20
[41]21; Section containing code
22SECTION .text
23
24;--------------------------------------------------------------------
25; DisplayFunctionFromDI
26; Parameters:
27; DI: Function to call (DISPLAY_LIB.functionName)
28; Others: Depends on function to call (DX cannot be parameter)
29; Returns:
30; Depends on function to call
31; Corrupts registers:
32; AX (unless used as a return register), DI
33;--------------------------------------------------------------------
[369]34ALIGN DISPLAY_JUMP_ALIGN
[41]35Display_FunctionFromDI:
36 push es
37 push ds
38 push dx
39
[592]40%ifdef CLD_NEEDED
[41]41 cld
[592]42%endif
[41]43 LOAD_BDA_SEGMENT_TO ds, dx
[177]44 mov dx, di
[41]45 les di, [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition]
46 call dx
47 mov [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition], di
48
49 pop dx
50 pop ds
51 pop es
52 ret
53
54;--------------------------------------------------------------------
[177]55; Display_FormatNullTerminatedStringFromCSSI
[41]56; Parameters:
57; Same as DisplayPrint_FormattedNullTerminatedStringFromCSSI
58; Returns:
59; Stack variables will be cleaned
60; Corrupts registers:
61; AX
62;--------------------------------------------------------------------
[369]63ALIGN DISPLAY_JUMP_ALIGN
[177]64Display_FormatNullTerminatedStringFromCSSI:
[101]65 pop ax ; Discard return address to inside Display_FunctionFromDI
[41]66 call DisplayPrint_FormattedNullTerminatedStringFromCSSI
67 mov [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition], di
68
69 pop dx
70 pop ds
71 pop es
72
73 pop ax ; Pop return address
74 mov sp, bp ; Clean stack variables
75 jmp ax
76
77
[181]78 %define InitializeDisplayContext DisplayContext_Initialize
79
[592]80%ifndef EXCLUDE_FROM_XUB
[181]81 %define SetCharacterPointerFromBXAX DisplayContext_SetCharacterPointerFromBXAX
[133]82%endif
[181]83 %define SetCharOutputFunctionFromAXwithAttribFlagInBL DisplayContext_SetCharOutputFunctionFromAXwithAttribFlagInBL
84 %define SetCharacterOutputParameterFromAX DisplayContext_SetCharacterOutputParameterFromAX
85 %define SetCharacterAttributeFromAL DisplayContext_SetCharacterAttributeFromAL
86 %define SetCursorShapeFromAX DisplayCursor_SetShapeFromAX
87 %define SetCursorCoordinatesFromAX DisplayCursor_SetCoordinatesFromAX
[370]88%ifndef EXCLUDE_FROM_XTIDECFG
[181]89 %define SetNewPageFromAL DisplayPage_SetFromAL
[370]90%endif
[181]91 %define SynchronizeDisplayContextToHardware DisplayContext_SynchronizeToHardware
[41]92
[592]93%ifndef EXCLUDE_FROM_XUB
[181]94 %define GetCharacterPointerToBXAX DisplayContext_GetCharacterPointerToBXAX
[133]95%endif
[181]96 %define GetSoftwareCoordinatesToAX DisplayCursor_GetSoftwareCoordinatesToAX
97 %define GetColumnsToALandRowsToAH DisplayPage_GetColumnsToALandRowsToAH
[41]98
[181]99 %define FormatNullTerminatedStringFromCSSI Display_FormatNullTerminatedStringFromCSSI
[592]100%ifndef EXCLUDE_FROM_XUB
[590]101 %define PrintSignedWordFromAXWithBaseInBL DisplayPrint_SignedWordFromAXWithBaseInBL
[134]102%endif
[590]103 %define PrintWordFromAXWithBaseInBL DisplayPrint_WordFromAXWithBaseInBL
[592]104%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG
[323]105 %define PrintQWordFromSSBPwithBaseInBX DisplayPrint_QWordFromSSBPwithBaseInBX
106%endif
[181]107 %define PrintCharBufferFromBXSIwithLengthInCX DisplayPrint_CharacterBufferFromBXSIwithLengthInCX
108 %define PrintNullTerminatedStringFromBXSI DisplayPrint_NullTerminatedStringFromBXSI
109 %define PrintNullTerminatedStringFromCSSI DisplayPrint_NullTerminatedStringFromCSSI
110 %define PrintRepeatedCharacterFromALwithCountInCX DisplayPrint_RepeatCharacterFromALwithCountInCX
111 %define PrintCharacterFromAL DisplayPrint_CharacterFromAL
112 %define PrintNewlineCharacters DisplayPrint_Newline
[592]113%ifndef EXCLUDE_FROM_XUB
[181]114 %define ClearAreaWithHeightInAHandWidthInAL DisplayPrint_ClearAreaWithHeightInAHandWidthInAL
[134]115%endif
[181]116 %define ClearScreenWithCharInALandAttrInAH DisplayPrint_ClearScreenWithCharInALandAttributeInAH
[177]117
Note: See TracBrowser for help on using the repository browser.