- Timestamp:
- Jun 25, 2018, 10:29:27 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 94 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Assembly_Library/Inc/BiosFunctions.inc
r510 r592 6 6 ; BIOS interrupts 7 7 BIOS_VIDEO_INTERRUPT_10h EQU 10h 8 BIOS_EQUIPMENT_INTERRUPT_11h EQU 11h 8 9 BIOS_DISK_INTERRUPT_13h EQU 13h 9 10 BIOS_SYSTEM_INTERRUPT_15h EQU 15h -
trunk/Assembly_Library/Inc/Debug.inc
r590 r592 24 24 mov bl, %2 25 25 CALL_DISPLAY_LIBRARY PrintWordFromAXWithBaseInBL 26 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS26 %ifndef EXCLUDE_FROM_XUB 27 27 call Keyboard_RemoveAllKeystrokesFromBuffer 28 28 %endif … … 52 52 mov al, %1 53 53 CALL_DISPLAY_LIBRARY PrintCharacterFromAL 54 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS54 %ifndef EXCLUDE_FROM_XUB 55 55 call Keyboard_RemoveAllKeystrokesFromBuffer 56 56 %endif … … 95 95 %macro WAIT_ANY_KEY_TO_CONTINUE 0 96 96 push ax 97 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS97 %ifndef EXCLUDE_FROM_XUB 98 98 call Keyboard_RemoveAllKeystrokesFromBuffer 99 99 %endif -
trunk/Assembly_Library/Inc/Display.inc
r590 r592 61 61 .InitializeDisplayContext resb 2 62 62 63 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS63 %ifndef EXCLUDE_FROM_XUB 64 64 .SetCharacterPointerFromBXAX resb 2 65 65 %endif … … 74 74 .SynchronizeDisplayContextToHardware resb 2 75 75 76 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS76 %ifndef EXCLUDE_FROM_XUB 77 77 .GetCharacterPointerToBXAX resb 2 78 78 %endif … … 81 81 82 82 .FormatNullTerminatedStringFromCSSI resb 2 83 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS83 %ifndef EXCLUDE_FROM_XUB 84 84 .PrintSignedWordFromAXWithBaseInBL resb 2 85 85 %endif 86 86 .PrintWordFromAXWithBaseInBL resb 2 87 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOSOR EXCLUDE_FROM_XTIDECFG87 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG 88 88 .PrintQWordFromSSBPwithBaseInBX resb 2 89 89 %endif … … 94 94 .PrintCharacterFromAL resb 2 95 95 .PrintNewlineCharacters resb 2 96 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS96 %ifndef EXCLUDE_FROM_XUB 97 97 .ClearAreaWithHeightInAHandWidthInAL resb 2 98 98 %endif -
trunk/Assembly_Library/Inc/DosFunctions.inc
r589 r592 6 6 ; DOS interrupts 7 7 DOS_INTERRUPT_21h EQU 21h 8 DOS_CTRL_C_CTRL_BREAK_HANDLER_23h EQU 23h 8 9 DOS_CRITICAL_ERROR_HANDLER_24h EQU 24h 9 10 DOS_TSR_MULTIPLEX_INTERRUPT_2Fh EQU 2Fh … … 31 32 FIND_FIRST_MATCHING_FILE EQU 4Eh ; DOS 2+ 32 33 FIND_NEXT_MATCHING_FILE EQU 4Fh ; DOS 2+ 34 GET_EXTENDED_ERROR_INFORMATION EQU 59h ; DOS 3.0+ 33 35 34 36 ; DOS errors -
trunk/Assembly_Library/Inc/Emulate.inc
r589 r592 60 60 61 61 ;-------------------------------------------------------------------- 62 ; Find String In String 63 ; 64 ; FSIS 65 ; Parameters: 66 ; %1: String to search for (case-insensitive) 67 ; %2: String to search in 68 ; Returns: 69 ; strpos: Position of %1 in %2 if found, 0 if not found 70 ;-------------------------------------------------------------------- 71 %macro FSIS 2.nolist 72 %defstr s1 %1 73 %defstr s2 %2 74 %strlen sl1 s1 75 %strlen sl2 s2 76 %assign strpos 0 77 %if sl1 <= sl2 78 %assign strpos sl2 - sl1 + 1 79 %rep strpos 80 %substr %%ss s2 strpos, sl1 81 %ifidni %%ss, s1 82 %exitrep 83 %else 84 %assign strpos strpos - 1 85 %endif 86 %endrep 87 %endif 88 %endmacro 89 90 91 ;-------------------------------------------------------------------- 62 92 ; The undocumented instruction SALC (Set AL According to CF). 63 93 ; Available on all Intel processors and truly compatible clones. … … 108 138 ;-------------------------------------------------------------------- 109 139 ; The AAM instruction (ASCII Adjust after Multiplication). 110 ; Available on all Intel processors and truly compatible clones.111 ; Does not work on the NEC V20/V30 or Sony CXQ70108 processors112 ; unless %1 is 10 (0Ah).113 140 ; 114 141 ; eAAM … … 152 179 %macro eBSF 2 153 180 %ifndef USE_386 154 push cx155 181 cmp WORD %2, BYTE 0 ; Source operand is zero? 156 182 je SHORT %%Return ; If so, return with ZF set 157 183 158 184 ; Set destination to zero and load mask for bit 0 185 push cx 159 186 xor %1, %1 160 187 mov cx, 1 … … 163 190 %%BitLoop: 164 191 test %2, cx ; Bit set? 165 jnz SHORT %% Return; If so, return with ZF cleared192 jnz SHORT %%PopAndReturn; If so, return with ZF cleared 166 193 shl cx, 1 ; Prepare to test next bit 167 194 inc %1 ; Increment bit index 168 195 jmp SHORT %%BitLoop ; Loop until bit found 169 %% Return:196 %%PopAndReturn: 170 197 pop cx 198 %%Return: 171 199 ;----------------------------------- 172 200 %else … … 193 221 %macro eBSR 2 194 222 %ifndef USE_386 195 push cx196 223 cmp WORD %2, BYTE 0 ; Source operand is zero? 197 224 je SHORT %%Return ; If so, return with ZF set 198 225 199 226 ; Load mask for highest order bit 227 push cx 200 228 mov cx, 1<<15 201 229 mov %1, 15 … … 204 232 %%BitLoop: 205 233 test %2, cx ; Bit set? 206 jnz SHORT %% Return; If so, return with ZF cleared234 jnz SHORT %%PopAndReturn; If so, return with ZF cleared 207 235 shr cx, 1 ; Prepare to test next bit 208 236 dec %1 ; Decrement bit index 209 237 jmp SHORT %%BitLoop ; Loop until bit found 210 %% Return:238 %%PopAndReturn: 211 239 pop cx 240 %%Return: 212 241 ;----------------------------------- 213 242 %else … … 260 289 261 290 %macro eCMOVE 2 262 eCMOVZ 291 eCMOVZ %1, %2 263 292 %endmacro 264 293 265 294 %macro eCMOVNE 2 266 eCMOVNZ 295 eCMOVNZ %1, %2 267 296 %endmacro 268 297 269 298 %macro eCMOVB 2 270 jnb SHORT %%Return 271 mov %1, %2 272 %%Return: 299 eCMOVC %1, %2 273 300 %endmacro 274 301 … … 289 316 ; Conditional Set. 290 317 ; 291 ; e CSETcc318 ; eSETcc 292 319 ; Parameters: 293 320 ; %1: Destination data … … 297 324 ; Flags 298 325 ;-------------------------------------------------------------------- 299 %macro e CSETZ 1326 %macro eSETZ 1 300 327 mov %1, 0 ; Clear while preserving flags 301 328 jnz SHORT %%Return ; Nothing to set … … 304 331 %endmacro 305 332 306 %macro e CSETNZ 1333 %macro eSETNZ 1 307 334 mov %1, 0 ; Clear while preserving flags 308 335 jz SHORT %%Return ; Nothing to set … … 339 366 xor dh, dh 340 367 %else ; SI, DI, BP (all may be used in effective address) 341 push ax 342 mov al, %2 343 xor ah, ah 344 xchg ax, %1 345 pop ax 368 FSIS %1, %2 369 %if strpos 370 push ax 371 mov al, %2 372 xor ah, ah 373 xchg %1, ax 374 pop ax 375 %else 376 xchg %1, ax 377 mov al, %2 378 xor ah, ah 379 xchg %1, ax 380 %endif 346 381 %endif 347 382 ;----------------------------------- … … 484 519 ; eSEG_STR 485 520 ; Parameters: 486 ; %1: REP/REP NE or REPEprefix521 ; %1: REP/REPE/REPZ or REPNE/REPNZ prefix 487 522 ; %2: Source segment override (destination is always ES) 488 523 ; %3: String instruction … … 491 526 ; FLAGS for cmps and scas only 492 527 ; Corrupts registers: 493 ; Nothing528 ; FLAGS 494 529 ;-------------------------------------------------------------------- 495 530 %macro eSEG_STR 3 … … 499 534 %2 ; SEG is the prefix that won't be lost 500 535 %3 ; String instruction 536 FSIS cmps, %3 537 %ifn strpos 538 FSIS scas, %3 539 %endif 540 %if strpos ; Must preserve FLAGS 501 541 jcxz %%End ; Jump to end if no repeats left (preserves FLAGS) 502 542 jmp SHORT %%Loop ; Loop while repeats left 503 543 %%End: 544 %else ; No need to preserve FLAGS 545 inc cx 546 loop %%Loop 547 %endif 504 548 %else ; No bug on V20/V30 and later, don't know about 188/186 505 549 %2 … … 556 600 %ifdef USE_386 557 601 %if %2 = 1 558 add %1, %1 ; Same size but faster on 386 and 486. Fails if %1 is a memory operand. 602 FSIS ], %1 603 %if strpos 604 eSHIFT_IM %1, %2, shl 605 %else 606 add %1, %1 ; Same size but faster on 386 and 486. 607 %endif 559 608 %else 560 609 eSHIFT_IM %1, %2, shl … … 582 631 %ifdef USE_386 583 632 %if %2 = 1 584 adc %1, %1 ; Same size but faster on 386 and 486. Fails if %1 is a memory operand. 633 FSIS ], %1 634 %if strpos 635 eSHIFT_IM %1, %2, rcl 636 %else 637 adc %1, %1 ; Same size but faster on 386 and 486. 638 %endif 585 639 %else 586 640 eSHIFT_IM %1, %2, rcl -
trunk/Assembly_Library/Inc/Macros.inc
r566 r592 18 18 ; %1 19 19 ;-------------------------------------------------------------------- 20 %macro SKIP2B 1 20 %macro SKIP2B 1.nolist 21 21 %ifidni %1, f 22 22 db 03Dh ; Opcode byte for CMP AX, <immed> -
trunk/Assembly_Library/Inc/Math.inc
r589 r592 23 23 jb %%Return ; If so, return 24 24 mov %1, %2 ; Copy %2 to %1 25 ALIGN JUMP_ALIGN26 25 %%Return: 27 26 %endmacro … … 31 30 jl %%Return ; If so, return 32 31 mov %1, %2 ; Copy %2 to %1 33 ALIGN JUMP_ALIGN34 32 %%Return: 35 33 %endmacro … … 51 49 ja %%Return ; If so, return 52 50 mov %1, %2 ; Copy %2 to %1 53 ALIGN JUMP_ALIGN54 51 %%Return: 55 52 %endmacro … … 59 56 jg %%Return ; If so, return 60 57 mov %1, %2 ; Copy %2 to %1 61 ALIGN JUMP_ALIGN62 58 %%Return: 63 59 %endmacro … … 67 63 ; SHL_DXAX 68 64 ; Parameters: 69 ; %1: Number of bits to shift 65 ; %1: Number of bits to shift. Can be (in preferred order) CX, CL or an immediate value. 70 66 ; Returns: 71 67 ; DX:AX Shifted value … … 74 70 ;-------------------------------------------------------------------- 75 71 %macro SHL_DXAX 1 72 %ifdef USE_386 76 73 %ifnidni %1, cx 74 ; %1 is CL or an immediate 75 shld dx, ax, %1 76 shl ax, %1 77 %else 78 ; %1 is CX 79 shld dx, ax, cl 80 shl ax, cl 81 %endif 82 %else 83 %ifidni %1, cl 84 ; %1 is CL 85 xor ch, ch 86 %elifnidni %1, cx 87 ; %1 is an immediate 77 88 mov cx, %1 78 89 %endif … … 82 93 eRCL_IM dx, 1 83 94 loop .ShiftNextBit 95 %endif 84 96 %endmacro 85 97 … … 88 100 ; SHR_DXAX 89 101 ; Parameters: 90 ; %1: Number of bits to shift 102 ; %1: Number of bits to shift. Can be (in preferred order) CX, CL or an immediate value. 91 103 ; Returns: 92 104 ; DX:AX Shifted value … … 95 107 ;-------------------------------------------------------------------- 96 108 %macro SHR_DXAX 1 109 %ifdef USE_386 97 110 %ifnidni %1, cx 111 ; %1 is CL or an immediate 112 shrd ax, dx, %1 113 shr dx, %1 114 %else 115 ; %1 is CX 116 shrd ax, dx, cl 117 shr dx, cl 118 %endif 119 %else 120 %ifidni %1, cl 121 ; %1 is CL 122 xor ch, ch 123 %elifnidni %1, cx 124 ; %1 is an immediate 98 125 mov cx, %1 99 126 %endif … … 103 130 rcr ax, 1 104 131 loop .ShiftNextBit 132 %endif 105 133 %endmacro 106 134 -
trunk/Assembly_Library/Inc/Menu.inc
r525 r592 159 159 SCROLL_THUMB_CHARACTER EQU BLOCK_FULL_FOREGROUND 160 160 161 NO_ITEM_SELECTED EQU -1161 ;NO_ITEM_SELECTED EQU -1 162 162 NO_ITEM_HIGHLIGHTED EQU -1 163 163 NO_TIMEOUT_USED EQU 0 -
trunk/Assembly_Library/Src/AssemblyLibrary.asm
r526 r592 90 90 %endif 91 91 %include "Char.asm" 92 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS92 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 93 93 %include "String.asm" 94 94 %include "StringProcess.asm" … … 106 106 107 107 %ifdef INCLUDE_TIME_LIBRARY 108 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS108 %ifndef EXCLUDE_FROM_XUB 109 109 %include "Delay.asm" 110 110 %ifndef EXCLUDE_FROM_XTIDECFG … … 119 119 %define UTIL_SIZE_JUMP_ALIGN 1 120 120 %endif 121 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 122 %include "Bit.asm" 121 %ifndef EXCLUDE_FROM_XUB 122 %ifndef EXCLUDE_FROM_BIOSDRVS 123 %include "Bit.asm" 124 %endif 125 %include "Math.asm" 123 126 %endif 124 %include "Math.asm" 125 %include "Registers.asm" 126 %include "Reboot.asm" 127 %include "Memory.asm" 127 %ifndef EXCLUDE_FROM_BIOSDRVS 128 %include "Registers.asm" 129 %include "Reboot.asm" 130 %include "Memory.asm" 131 %endif 128 132 %include "Size.asm" 129 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS133 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 130 134 %include "Sort.asm" 131 135 %endif -
trunk/Assembly_Library/Src/Display/CgaSnow.asm
r583 r592 106 106 ; AX, CX, DX 107 107 ;-------------------------------------------------------------------- 108 %ifdef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS108 %ifdef EXCLUDE_FROM_XUB 109 109 %ifdef MODULE_STRINGS_COMPRESSED 110 110 %define EXCLUDE -
trunk/Assembly_Library/Src/Display/Display.asm
r590 r592 38 38 push dx 39 39 40 %ifdef CLD_NEEDED 40 41 cld 42 %endif 41 43 LOAD_BDA_SEGMENT_TO ds, dx 42 44 mov dx, di … … 76 78 %define InitializeDisplayContext DisplayContext_Initialize 77 79 78 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS80 %ifndef EXCLUDE_FROM_XUB 79 81 %define SetCharacterPointerFromBXAX DisplayContext_SetCharacterPointerFromBXAX 80 82 %endif … … 89 91 %define SynchronizeDisplayContextToHardware DisplayContext_SynchronizeToHardware 90 92 91 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS93 %ifndef EXCLUDE_FROM_XUB 92 94 %define GetCharacterPointerToBXAX DisplayContext_GetCharacterPointerToBXAX 93 95 %endif … … 96 98 97 99 %define FormatNullTerminatedStringFromCSSI Display_FormatNullTerminatedStringFromCSSI 98 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS100 %ifndef EXCLUDE_FROM_XUB 99 101 %define PrintSignedWordFromAXWithBaseInBL DisplayPrint_SignedWordFromAXWithBaseInBL 100 102 %endif 101 103 %define PrintWordFromAXWithBaseInBL DisplayPrint_WordFromAXWithBaseInBL 102 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOSOR EXCLUDE_FROM_XTIDECFG104 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG 103 105 %define PrintQWordFromSSBPwithBaseInBX DisplayPrint_QWordFromSSBPwithBaseInBX 104 106 %endif … … 109 111 %define PrintCharacterFromAL DisplayPrint_CharacterFromAL 110 112 %define PrintNewlineCharacters DisplayPrint_Newline 111 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS113 %ifndef EXCLUDE_FROM_XUB 112 114 %define ClearAreaWithHeightInAHandWidthInAL DisplayPrint_ClearAreaWithHeightInAHandWidthInAL 113 115 %endif -
trunk/Assembly_Library/Src/Display/DisplayContext.asm
r588 r592 110 110 ; AX, DI 111 111 ;-------------------------------------------------------------------- 112 %ifdef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS112 %ifdef EXCLUDE_FROM_XUB 113 113 %ifndef MODULE_BOOT_MENU 114 114 %define EXCLUDE … … 116 116 %endif 117 117 118 %ifndef EXCLUDE 118 %ifndef EXCLUDE OR EXCLUDE_FROM_BIOSDRVS 119 119 ALIGN DISPLAY_JUMP_ALIGN 120 120 DisplayContext_Push: … … 170 170 mov ds, di ; Restore DS 171 171 ret 172 %endif ; EXCLUDE 172 %endif ; EXCLUDE OR EXCLUDE_FROM_BIOSDRVS 173 173 %undef EXCLUDE 174 174 … … 184 184 ; AX, DI 185 185 ;-------------------------------------------------------------------- 186 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS186 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 187 187 ALIGN DISPLAY_JUMP_ALIGN 188 188 DisplayContext_PrepareOffScreenBufferInESBXwithLengthInCX: … … 202 202 pop ds 203 203 ret 204 %endif ; EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS204 %endif ; EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 205 205 206 206 … … 215 215 ; AX 216 216 ;-------------------------------------------------------------------- 217 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS217 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 218 218 ALIGN DISPLAY_JUMP_ALIGN 219 219 DisplayContext_SetCharacterPointerFromBXAX: … … 235 235 ; Nothing 236 236 ;-------------------------------------------------------------------- 237 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS237 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 238 238 ALIGN DISPLAY_JUMP_ALIGN 239 239 DisplayContext_GetCharacterPointerToBXAX: … … 244 244 245 245 246 %ifdef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS246 %ifdef EXCLUDE_FROM_XUB 247 247 %ifndef MODULE_BOOT_MENU 248 248 %define EXCLUDE … … 282 282 ;-------------------------------------------------------------------- 283 283 %ifndef EXCLUDE ; 2 of 3 284 %ifndef EXCLUDE_FROM_BIOSDRVS 284 285 ALIGN DISPLAY_JUMP_ALIGN 285 286 DisplayContext_SetCharacterAttributeFromAL: … … 287 288 ret 288 289 %endif 290 %endif 289 291 290 292 … … 300 302 ;-------------------------------------------------------------------- 301 303 %ifndef EXCLUDE ; 3 of 3 304 %ifndef EXCLUDE_FROM_BIOSDRVS 302 305 ALIGN DISPLAY_JUMP_ALIGN 303 306 DisplayContext_SetCharacterOutputParameterFromAX: … … 305 308 ret 306 309 %endif 310 %endif 307 311 308 312 %undef EXCLUDE … … 318 322 ; Nothing 319 323 ;-------------------------------------------------------------------- 320 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS OR EXCLUDE_FROM_XTIDECFG324 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG OR EXCLUDE_FROM_BIOSDRVS 321 325 ALIGN DISPLAY_JUMP_ALIGN 322 326 DisplayContext_GetCharacterOutputParameterToDX: -
trunk/Assembly_Library/Src/Display/DisplayCursor.asm
r526 r592 48 48 ; Nothing 49 49 ;-------------------------------------------------------------------- 50 %ifdef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS50 %ifdef EXCLUDE_FROM_XUB 51 51 %ifndef MODULE_BOOT_MENU 52 52 %define EXCLUDE … … 54 54 %endif 55 55 56 %ifndef EXCLUDE 56 %ifndef EXCLUDE OR EXCLUDE_FROM_BIOSDRVS 57 57 ALIGN DISPLAY_JUMP_ALIGN 58 58 DisplayCursor_SetShapeFromAX: -
trunk/Assembly_Library/Src/Display/DisplayFormat.asm
r590 r592 142 142 143 143 .rgcFormatCharToLookupIndex: 144 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS144 %ifndef EXCLUDE_FROM_XUB 145 145 db "aIAduxsSctz-+%" 146 146 %else … … 150 150 ALIGN WORD_ALIGN 151 151 .rgfnFormatSpecifierParser: 152 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS152 %ifndef EXCLUDE_FROM_XUB 153 153 dw a_FormatAttributeForNextCharacter 154 154 %endif 155 155 dw I_FormatDashForZero 156 156 dw A_FormatAttributeForRemainingString 157 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS157 %ifndef EXCLUDE_FROM_XUB 158 158 dw d_FormatSignedDecimalWord 159 159 %endif … … 161 161 dw x_FormatHexadecimalWord 162 162 dw s_FormatStringFromSegmentCS 163 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS163 %ifndef EXCLUDE_FROM_XUB 164 164 dw S_FormatStringFromFarPointer 165 165 %endif 166 166 dw c_FormatCharacter 167 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS167 %ifndef EXCLUDE_FROM_XUB 168 168 dw t_FormatRepeatCharacter 169 169 %endif 170 170 dw z_FormatStringFromSegmentZero 171 171 dw PrepareToPrependParameterWithSpaces 172 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS172 %ifndef EXCLUDE_FROM_XUB 173 173 dw PrepareToAppendSpacesAfterParameter 174 174 dw percent_FormatPercent … … 308 308 ; AX, BX, DX 309 309 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 310 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS310 %ifndef EXCLUDE_FROM_XUB 311 311 ALIGN DISPLAY_JUMP_ALIGN 312 312 a_FormatAttributeForNextCharacter: … … 330 330 ret 331 331 332 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS332 %ifndef EXCLUDE_FROM_XUB 333 333 ALIGN DISPLAY_JUMP_ALIGN 334 334 d_FormatSignedDecimalWord: … … 391 391 ret 392 392 393 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS393 %ifndef EXCLUDE_FROM_XUB 394 394 ALIGN DISPLAY_JUMP_ALIGN 395 395 S_FormatStringFromFarPointer: … … 408 408 jmp DisplayPrint_CharacterFromAL 409 409 410 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS410 %ifndef EXCLUDE_FROM_XUB 411 411 ALIGN DISPLAY_JUMP_ALIGN 412 412 t_FormatRepeatCharacter: -
trunk/Assembly_Library/Src/Display/DisplayPage.asm
r589 r592 31 31 ; AX, DX 32 32 ;-------------------------------------------------------------------- 33 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS OR EXCLUDE_FROM_XTIDECFG33 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG OR EXCLUDE_FROM_BIOSDRVS 34 34 ALIGN DISPLAY_JUMP_ALIGN 35 35 DisplayPage_SetFromAL: … … 41 41 42 42 43 %ifdef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS43 %ifdef EXCLUDE_FROM_XUB 44 44 %define EXCLUDE 45 45 %ifdef MODULE_HOTKEYS OR MODULE_BOOT_MENU … … 48 48 %endif 49 49 50 %ifndef EXCLUDE 50 %ifndef EXCLUDE OR EXCLUDE_FROM_BIOSDRVS 51 51 ;-------------------------------------------------------------------- 52 52 ; DisplayPage_GetColumnsToALandRowsToAH -
trunk/Assembly_Library/Src/Display/DisplayPrint.asm
r590 r592 94 94 ; AX, BH, DX 95 95 ;-------------------------------------------------------------------- 96 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS96 %ifndef EXCLUDE_FROM_XUB 97 97 ALIGN DISPLAY_JUMP_ALIGN 98 98 DisplayPrint_SignedWordFromAXWithBaseInBL: … … 163 163 ; AX, DX, [SS:BP] 164 164 ;-------------------------------------------------------------------- 165 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOSOR EXCLUDE_FROM_XTIDECFG165 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG 166 166 ALIGN DISPLAY_JUMP_ALIGN 167 167 DisplayPrint_QWordFromSSBPwithBaseInBX: … … 194 194 ; AX, DX 195 195 ;-------------------------------------------------------------------- 196 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS196 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 197 197 ALIGN DISPLAY_JUMP_ALIGN 198 198 DisplayPrint_CharacterBufferFromBXSIwithLengthInCX: … … 261 261 ; AX, DX 262 262 ;-------------------------------------------------------------------- 263 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS263 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 264 264 ALIGN DISPLAY_JUMP_ALIGN 265 265 DisplayPrint_ClearAreaWithHeightInAHandWidthInAL: … … 292 292 %endif 293 293 294 %ifdef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS294 %ifdef EXCLUDE_FROM_XUB 295 295 %define EXCLUDE 296 296 %ifndef MODULE_STRINGS_COMPRESSED -
trunk/Assembly_Library/Src/File/Directory.asm
r526 r592 99 99 ; Nothing 100 100 ;-------------------------------------------------------------------- 101 %ifndef EXCLUDE_FROM_XTIDECFG 101 102 ALIGN JUMP_ALIGN 102 103 Directory_GetMatchCountToAXforSearchStringInDSSIwithAttributesInCX: … … 115 116 pop dx 116 117 ret 118 %endif 117 119 118 120 -
trunk/Assembly_Library/Src/File/DosCritical.asm
r526 r592 1 ; File name : DosCritical.asm2 1 ; Project name : Assembly Library 3 ; Created date : 1.9.20104 ; Last update : 2.9.20105 ; Author : Tomi Tilli6 2 ; Description : DOS Critical Error Handler (24h) replacements. 7 3 … … 22 18 ; 23 19 20 ; Note! Only DOS functions 01h - 0Ch, 30h and 59h can be called from a Critical Error Handler. 24 21 25 22 ; DOS Critical Error Handler return values … … 28 25 .retryOperation resb 1 29 26 .terminateProgramAsThoughInt21hAH4ChCalled resb 1 30 .failSystemCallInProgress resb 1 27 .failSystemCallInProgress resb 1 ; Needs DOS 3.1+ 31 28 endstruc 32 29 … … 83 80 84 81 ;-------------------------------------------------------------------- 82 ; DosCritical_CustomHandler 83 ; Parameters: 84 ; Nothing 85 ; Returns: 86 ; Nothing 87 ; Corrupts registers: 88 ; Nothing 89 ;-------------------------------------------------------------------- 90 ALIGN JUMP_ALIGN 91 DosCritical_CustomHandler: 92 add sp, 6 ; Remove the INT 24h return address and flags from stack 93 94 mov ah, GET_EXTENDED_ERROR_INFORMATION ; Requires DOS 3.0+ 95 xor bx, bx 96 int DOS_INTERRUPT_21h 97 mov [cs:bLastCriticalError], al 98 99 pop ax 100 pop bx 101 pop cx 102 pop dx 103 pop si 104 pop di 105 pop bp 106 pop ds 107 pop es 108 iret ; Return from the INT 21h call 109 110 bLastCriticalError: db 0 111 112 113 ;-------------------------------------------------------------------- 85 114 ; DosCritical_HandlerToIgnoreAllErrors 86 115 ; Parameters: … … 95 124 mov al, CRITICAL_ERROR_ACTION.ignoreErrorAndContinueProcessingRequest 96 125 iret 126 -
trunk/Assembly_Library/Src/File/Drive.asm
r589 r592 30 30 ; Nothing 31 31 ;-------------------------------------------------------------------- 32 %ifndef EXCLUDE_FROM_XTIDECFG 32 33 ALIGN JUMP_ALIGN 33 34 Drive_GetNumberOfAvailableDrivesToAX: … … 42 43 pop dx 43 44 ret 45 %endif 44 46 45 47 -
trunk/Assembly_Library/Src/File/FileIO.asm
r526 r592 35 35 ; AX, BX 36 36 ;-------------------------------------------------------------------- 37 %ifndef EXCLUDE_FROM_XTIDECFG 37 38 ALIGN JUMP_ALIGN 38 39 FileIO_CreateWithPathInDSSIandAttributesInCX: … … 40 41 SKIP2B bx 41 42 ; Fall to FileIO_OpenWithPathInDSSIandFileAccessInAL 43 %endif 42 44 43 45 ;-------------------------------------------------------------------- -
trunk/Assembly_Library/Src/Keyboard/Keyboard.asm
r589 r592 37 37 ; DX 38 38 ;-------------------------------------------------------------------- 39 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS39 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 40 40 ALIGN KEYBOARD_JUMP_ALIGN 41 41 Keyboard_ReadUserInputtedWordWhilePrinting: … … 87 87 ; AX 88 88 ;-------------------------------------------------------------------- 89 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS89 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 90 90 ALIGN KEYBOARD_JUMP_ALIGN 91 91 Keyboard_ReadUserInputtedStringToESDIWhilePrinting: … … 98 98 xor bx, bx ; Zero character counter 99 99 dec cx ; Decrement buffer size for NULL 100 %ifdef CLD_NEEDED 100 101 cld 102 %endif 101 103 ALIGN KEYBOARD_JUMP_ALIGN 102 104 .GetCharacterFromUser: … … 197 199 xor al, al ; Set ZF and clear CF 198 200 ret 199 %endif ; EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS201 %endif ; EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 200 202 201 203 … … 209 211 ; AX 210 212 ;-------------------------------------------------------------------- 211 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS213 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 212 214 ALIGN KEYBOARD_JUMP_ALIGN 213 215 Keyboard_PrintBackspace: … … 230 232 ; AX 231 233 ;-------------------------------------------------------------------- 232 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS234 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 233 235 ALIGN KEYBOARD_JUMP_ALIGN 234 236 Keyboard_PlayBellForUnwantedKeystroke: … … 246 248 ; AX 247 249 ;-------------------------------------------------------------------- 248 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS250 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 249 251 ALIGN KEYBOARD_JUMP_ALIGN 250 252 Keyboard_PrintInputtedCharacter: … … 266 268 ; AX 267 269 ;-------------------------------------------------------------------- 268 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS; Only used when debugging270 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS ; Only used when debugging 269 271 ALIGN KEYBOARD_JUMP_ALIGN 270 272 Keyboard_RemoveAllKeystrokesFromBuffer: … … 289 291 ; Nothing 290 292 ;-------------------------------------------------------------------- 291 %ifdef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS293 %ifdef EXCLUDE_FROM_XUB 292 294 %define EXCLUDE 293 295 %ifdef MODULE_HOTKEYS OR MODULE_BOOT_MENU -
trunk/Assembly_Library/Src/LibSizeCheck.asm
r526 r592 20 20 21 21 ; Include .inc files 22 %define EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS22 %define EXCLUDE_FROM_XUB 23 23 ;%define INCLUDE_DISPLAY_LIBRARY 24 24 ;%define INCLUDE_FILE_LIBRARY -
trunk/Assembly_Library/Src/Menu/Dialog/DialogFile.asm
r589 r592 249 249 ALIGN JUMP_ALIGN 250 250 AppendFileFromDTAinDSSItoOffScreenBuffer: 251 call .FilterCurrentDirectory ; We never want "." 252 call .FilterUpDirectoryWhenInRoot ; No ".." when in root directory 251 cmp WORD [si+DTA.szFile], CURRENTDIR_CHARACTERS 252 je SHORT .Return ; We never want "." 253 test dl, dl 254 jnz SHORT .NotInRootDirectory 255 cmp WORD [si+DTA.szFile], UPDIR_CHARACTERS 256 je SHORT .Return ; No ".." when in root directory 257 .NotInRootDirectory: 253 258 inc cx ; Nothing filtered so increment files/directories 254 259 … … 262 267 pop si 263 268 pop bp 264 ret 265 266 ;-------------------------------------------------------------------- 267 ; .FilterCurrentDirectory 268 ; .FilterUpDirectoryWhenInRoot 269 ; Parameters: 270 ; DL: Zero if root directory selected 271 ; DS:SI: Ptr to DTA containing file information 272 ; Returns: 273 ; Nothing 274 ; Returns from AppendFileToBufferInESDIfromDtaInDSSI when filtering 275 ; Corrupts registers: 276 ; AX 277 ;-------------------------------------------------------------------- 278 ALIGN JUMP_ALIGN 279 .FilterCurrentDirectory: 280 cmp WORD [si+DTA.szFile], CURRENTDIR_CHARACTERS 281 je SHORT .DoFilter 282 ret 283 284 ALIGN JUMP_ALIGN 285 .FilterUpDirectoryWhenInRoot: 286 test dl, dl ; Set ZF if root directory selected 287 jnz SHORT .ReturnWithoutFiltering 288 cmp WORD [si+DTA.szFile], UPDIR_CHARACTERS 289 jne SHORT .ReturnWithoutFiltering 290 .DoFilter: 291 add sp, BYTE 2 ; Remove return address from stack 292 ALIGN JUMP_ALIGN, ret 293 .ReturnWithoutFiltering: 269 .Return: 294 270 ret 295 271 … … 473 449 ALIGN JUMP_ALIGN 474 450 GetInfoLinesToCXandDialogFlagsToAX: 475 xor ax, ax476 call GetDialogFlagsToAL477 jmp Bit_GetSetCountToCXfromAX451 ePUSH_T ax, Bit_GetSetCountToCXfromAX 452 xor ah, ah 453 ; Fall to GetDialogFlagsToAL 478 454 479 455 ;-------------------------------------------------------------------- … … 696 672 call .ChangeDriveToUserSelectionFromIoInDSSI 697 673 add sp, BYTE DRIVE_DIALOG_IO_size 674 .UserCancelledDriveChange: 698 675 ret 699 676 … … 729 706 jne SHORT .UserCancelledDriveChange 730 707 708 ; Install our Custom Critical Error Handler to catch "Drive Not Ready" errors. This handler only works on DOS 3.0+ systems 709 ; but that should be OK because only DOS 3.1+ will trigger it. Under older DOS versions drives are enumerated using 710 ; GET_DOS_DRIVE_PARAMETER_BLOCK_FOR_SPECIFIC_DRIVE which will access the drive so we know it is available at this point. 711 mov dx, DosCritical_CustomHandler 712 call DosCritical_InstallNewHandlerFromCSDX 713 714 ; Save the current drive on stack in case the selected drive is not ready and the user decides to cancel the change. 715 call Drive_GetDefaultToAL 716 xchg dx, ax 717 718 .RetryDrive: 719 push dx ; Save the previous current drive to stack 720 731 721 mov dl, [si+DRIVE_DIALOG_IO.bReturnDriveNumber] 732 722 call Drive_SetDefaultFromDL 723 724 ; Now we must try to force a media access to catch "Drive Not Ready". 725 push ds 726 push ss 727 pop ds 728 ePUSH_T ax, CURRENTDIR_CHARACTERS 729 mov cx, FLG_FILEATTR_DIRECTORY 730 mov dx, sp 731 mov ax, FIND_FIRST_MATCHING_FILE<<8 732 int DOS_INTERRUPT_21h 733 pop ax 734 pop ds 735 736 pop dx ; Restore the previous current drive from stack 737 738 xchg ah, [cs:bLastCriticalError] ; Zero bLastCriticalError and fetch error code to AH 739 cmp ah, ERR_DOS_DRIVE_NOT_READY 740 jne SHORT .DriveIsReady 741 742 mov bx, g_szDlgDriveNotReady 743 call Dialogs_DisplayYesNoResponseDialogWithTitleStringInBX 744 jz SHORT .RetryDrive 745 ; The user cancelled the drive change. Restore current drive to what it was previously. 746 call Drive_SetDefaultFromDL 747 jmp DosCritical_RestoreDosHandler 748 749 .DriveIsReady: 750 call DosCritical_RestoreDosHandler 733 751 jmp RefreshFilesToDisplay 734 .UserCancelledDriveChange:735 ret736 752 737 753 -
trunk/Assembly_Library/Src/Menu/MenuAttributes.asm
r526 r592 91 91 92 92 .rgcColorAttributes: 93 ; Classic (default theme) 93 94 istruc ATTRIBUTE_CHARS 94 95 at ATTRIBUTE_CHARS.cBordersAndBackground, db COLOR_ATTRIBUTE(COLOR_YELLOW, COLOR_BLUE) … … 100 101 at ATTRIBUTE_CHARS.cNormalTimeout, db COLOR_ATTRIBUTE(COLOR_GREEN, COLOR_BLUE) 101 102 iend 103 ColorTheme equ MenuAttribute_GetToAXfromTypeInSI.rgcColorAttributes 102 104 103 105 .rgcBlackAndWhiteAttributes: ; Only COLOR_WHITE, COLOR_BRIGHT_WHITE and COLOR_BLACK should be used -
trunk/Assembly_Library/Src/Menu/MenuBorders.asm
r583 r592 87 87 ; AX, BX, CX, DX, SI, DI 88 88 ;-------------------------------------------------------------------- 89 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS89 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG 90 90 ALIGN MENU_JUMP_ALIGN 91 91 MenuBorders_RefreshItemBorders: -
trunk/Assembly_Library/Src/Menu/MenuInit.asm
r532 r592 114 114 ; AX, BX, DX 115 115 ;-------------------------------------------------------------------- 116 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS116 %ifndef EXCLUDE_FROM_XUB 117 117 ALIGN MENU_JUMP_ALIGN 118 118 MenuInit_CloseMenuIfExitEventAllows: … … 138 138 139 139 140 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS140 %ifndef EXCLUDE_FROM_XUB 141 141 ;-------------------------------------------------------------------- 142 142 ; MenuInit_HighlightItemFromAX … … 168 168 mov ax, [bp+MENUINIT.wHighlightedItem] 169 169 ret 170 %endif ; EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS170 %endif ; EXCLUDE_FROM_XUB 171 171 172 172 … … 183 183 ; Nothing 184 184 ;-------------------------------------------------------------------- 185 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 185 %ifndef EXCLUDE_FROM_XUB 186 %ifndef EXCLUDE_FROM_XTIDECFG 186 187 ALIGN MENU_JUMP_ALIGN 187 188 MenuInit_SetTitleHeightFromAL: … … 193 194 mov [bp+MENUINIT.bInfoLines], al 194 195 ret 196 %endif ; EXCLUDE_FROM_XTIDECFG 195 197 196 198 ALIGN MENU_JUMP_ALIGN … … 198 200 mov [bp+MENUINIT.wItems], ax 199 201 ret 200 %endif 202 %endif ; EXCLUDE_FROM_XUB 201 203 202 204 … … 212 214 ; Nothing 213 215 ;-------------------------------------------------------------------- 214 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 216 %ifndef EXCLUDE_FROM_XUB 217 %ifndef EXCLUDE_FROM_XTIDECFG 215 218 ALIGN MENU_JUMP_ALIGN 216 219 MenuInit_SetUserDataFromDSSI: … … 218 221 mov [bp+MENU.dwUserData+2], ds 219 222 ret 223 %endif ; EXCLUDE_FROM_XTIDECFG 220 224 221 225 ALIGN MENU_JUMP_ALIGN … … 223 227 lds si, [bp+MENU.dwUserData] 224 228 ret 225 %endif 229 %endif ; EXCLUDE_FROM_XUB -
trunk/Assembly_Library/Src/Menu/MenuLocation.asm
r583 r592 55 55 ; Nothing 56 56 ;-------------------------------------------------------------------- 57 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS57 %ifndef EXCLUDE_FROM_XUB 58 58 MenuLocation_GetItemBordersTopLeftCoordinatesToAX: 59 59 %endif -
trunk/Assembly_Library/Src/Menu/MenuText.asm
r583 r592 32 32 ; AX, BX, CX, DX, SI, DI 33 33 ;-------------------------------------------------------------------- 34 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS34 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG 35 35 ALIGN MENU_JUMP_ALIGN 36 36 MenuText_ClearTitleArea: -
trunk/Assembly_Library/Src/Serial/SerialServer.asm
r568 r592 61 61 push ax ; working copy on the top of the stack 62 62 63 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS ; DF already cleared in Int13h.asm 63 %ifndef EXCLUDE_FROM_XUB ; DF already cleared in Int13h.asm 64 %ifdef CLD_NEEDED 64 65 cld 66 %endif 65 67 %endif 66 68 -
trunk/Assembly_Library/Src/String/Char.asm
r526 r592 51 51 ; Nothing 52 52 ;-------------------------------------------------------------------- 53 %ifdef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS53 %ifdef EXCLUDE_FROM_XUB 54 54 %ifndef MODULE_HOTKEYS 55 55 %define EXCLUDE … … 57 57 %endif 58 58 59 %ifndef EXCLUDE 59 %ifndef EXCLUDE OR EXCLUDE_FROM_BIOSDRVS 60 60 ALIGN STRING_JUMP_ALIGN 61 61 Char_IsLowerCaseLetterInAL: … … 76 76 ; Nothing 77 77 ;-------------------------------------------------------------------- 78 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS78 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 79 79 ALIGN STRING_JUMP_ALIGN 80 80 Char_IsUpperCaseLetterInAL: … … 95 95 ; Nothing 96 96 ;-------------------------------------------------------------------- 97 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS97 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 98 98 ALIGN STRING_JUMP_ALIGN 99 99 Char_IsHexadecimalDigitInAL: … … 136 136 ; Nothing 137 137 ;-------------------------------------------------------------------- 138 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS138 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 139 139 ALIGN STRING_JUMP_ALIGN 140 140 Char_ConvertIntegerToALfromDigitInALwithBaseInBX: … … 166 166 ; Nothing 167 167 ;-------------------------------------------------------------------- 168 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS168 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 169 169 ALIGN STRING_JUMP_ALIGN 170 170 Char_CharIsValid: … … 174 174 175 175 176 %ifdef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS176 %ifdef EXCLUDE_FROM_XUB 177 177 %ifndef MODULE_HOTKEYS 178 178 %define EXCLUDE … … 201 201 ; Nothing 202 202 ;-------------------------------------------------------------------- 203 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS203 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 204 204 ALIGN STRING_JUMP_ALIGN 205 205 Char_ALtoLowerCaseLetter: … … 218 218 ; Nothing 219 219 ;-------------------------------------------------------------------- 220 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS220 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 221 221 ALIGN STRING_JUMP_ALIGN 222 222 Char_ALtoUpperCaseLetter: … … 237 237 ; Nothing 238 238 ;-------------------------------------------------------------------- 239 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS239 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 240 240 Char_ChangeCaseInAL: 241 241 xor al, 32 … … 254 254 ; Nothing 255 255 ;-------------------------------------------------------------------- 256 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS256 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 257 257 ALIGN STRING_JUMP_ALIGN 258 258 Char_GetFilterFunctionToDXforNumericBaseInBX: -
trunk/Assembly_Library/Src/Time/TimerTicks.asm
r526 r592 48 48 ; CX 49 49 ;-------------------------------------------------------------------- 50 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS50 %ifndef EXCLUDE_FROM_XUB 51 51 %ifndef EXCLUDE_FROM_XTIDECFG 52 52 ALIGN JUMP_ALIGN … … 64 64 div cx ; Divide DX:AX by CX, Minutes to AX, remainder ticks to DX 65 65 ret 66 %endif ; EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS67 68 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOSOR EXCLUDE_FROM_XTIDECFG66 %endif ; EXCLUDE_FROM_XUB 67 68 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG 69 69 ALIGN JUMP_ALIGN 70 70 TimerTicks_GetSecondsToAXandRemainderTicksToDXfromTicksInDX: … … 80 80 81 81 82 %ifdef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS82 %ifdef EXCLUDE_FROM_XUB 83 83 %ifndef MODULE_BOOT_MENU 84 84 %define EXCLUDE … … 164 164 ; Nothing 165 165 ;-------------------------------------------------------------------- 166 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS166 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG 167 167 ALIGN JUMP_ALIGN 168 168 TimerTicks_GetElapsedToAXandResetDSBX: … … 184 184 ; Nothing 185 185 ;-------------------------------------------------------------------- 186 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS186 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG 187 187 ALIGN JUMP_ALIGN 188 188 TimerTicks_GetElapsedToAXfromDSBX: … … 202 202 ; Nothing 203 203 ;-------------------------------------------------------------------- 204 %ifdef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS204 %ifdef EXCLUDE_FROM_XUB 205 205 %ifndef MODULE_BOOT_MENU OR MODULE_HOTKEYS 206 206 %define EXCLUDE -
trunk/Assembly_Library/Src/Util/Bit.asm
r526 r592 24 24 ; Bit_GetSetCountToCXfromDXAX 25 25 ; Parameters 26 ; DX:AX: 26 ; DX:AX: Source DWORD 27 27 ; Returns: 28 28 ; CX: Number of bits set in DX:AX … … 58 58 push ax 59 59 60 xor cx, cx60 mov cx, -1 61 61 ALIGN JUMP_ALIGN 62 .BitScanLoop: 62 .IncrementCX: 63 inc cx 64 .ShiftLoop: 63 65 shr ax, 1 64 jz SHORT .LastBitInCF 65 adc cl, ch 66 jmp SHORT .BitScanLoop 67 ALIGN JUMP_ALIGN 68 .LastBitInCF: 69 adc cl, ch 66 jc SHORT .IncrementCX 67 jnz SHORT .ShiftLoop 70 68 71 69 pop ax … … 95 93 ret 96 94 95 97 96 ;-------------------------------------------------------------------- 98 97 ; Bit_SetToAXfromIndexInCL … … 115 114 pop dx 116 115 ret 116 -
trunk/Assembly_Library/Src/Util/Math.asm
r589 r592 33 33 ; AX 34 34 ;-------------------------------------------------------------------- 35 %ifndef EXCLUDE_FROM_XTIDE _UNIVERSAL_BIOS OR EXCLUDE_FROM_XTIDECFG35 %ifndef EXCLUDE_FROM_XTIDECFG 36 36 ALIGN JUMP_ALIGN 37 37 Math_DivQWatSSBPbyCX: 38 %if 139 xor dx, dx40 mov ax, [bp+6] ; Load highest divident WORD to DX:AX41 div cx42 mov [bp+6], ax ; Store quotient43 44 mov ax, [bp+4]45 div cx46 mov [bp+4], ax47 48 mov ax, [bp+2]49 div cx50 mov [bp+2], ax51 52 mov ax, [bp]53 div cx54 mov [bp], ax55 ret56 %else ; ~157 ; This is about half the size compared to the above code but it's not tested which is why it's commented away.58 38 push di 59 39 mov di, 6 … … 65 45 dec di 66 46 dec di 67 jns .Next47 jns SHORT .Next 68 48 pop di 69 49 ret 70 %endif ; 171 50 %endif 72 51 … … 83 62 ; Nothing 84 63 ;-------------------------------------------------------------------- 85 %ifndef EXCLUDE_FROM_XTIDECFG 64 %ifndef EXCLUDE_FROM_XTIDECFG OR EXCLUDE_FROM_BIOSDRVS 86 65 ALIGN JUMP_ALIGN 87 66 Math_DivDXAXbyCX: -
trunk/Assembly_Library/Src/Util/Memory.asm
r580 r592 24 24 ; OPTIMIZE_STRING_OPERATION 25 25 ; Parameters 26 ; %1: Repeat instruction 27 ; %2: String instruction without size (for example MOVS and not MOVSB or MOVSW) 26 ; %1: String instruction without size (only MOVS and STOS is supported) 28 27 ; CX: Number of BYTEs to operate 29 ; DS:SI: Ptr to source data 28 ; DS:SI: Ptr to source data (for MOVS) 30 29 ; ES:DI: Ptr to destination 31 30 ; Returns: 31 ; CF: Cleared 32 ; CX: Zero 32 33 ; SI, DI: Updated by number of bytes operated 33 34 ; Corrupts registers: 34 35 ; Nothing 35 36 ;-------------------------------------------------------------------- 36 %macro OPTIMIZE_STRING_OPERATION 2 37 push cx 38 39 shr cx, 1 ; Operate with WORDs for performance 40 jz %%HandleRemainingByte 41 %1 %2w 42 %%HandleRemainingByte: 43 jnc SHORT %%OperationCompleted 44 %2b 45 46 ALIGN JUMP_ALIGN 47 %%OperationCompleted: 48 pop cx 37 %macro OPTIMIZE_STRING_OPERATION 1 38 shr cx, 1 39 rep %1w 40 eRCL_IM cx, 1 41 rep %1b 49 42 %endmacro 50 43 … … 57 50 ; ES:DI: Ptr to destination buffer 58 51 ; Returns: 52 ; CF: Cleared 59 53 ; SI, DI: Updated by number of bytes copied 60 54 ; Corrupts registers: 61 55 ; Nothing 62 56 ;-------------------------------------------------------------------- 63 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS57 %ifndef EXCLUDE_FROM_XUB 64 58 ALIGN JUMP_ALIGN 65 59 Memory_CopyCXbytesFromDSSItoESDI: 66 OPTIMIZE_STRING_OPERATION rep, movs 60 push cx 61 OPTIMIZE_STRING_OPERATION movs 62 pop cx 67 63 ret 68 64 %endif … … 77 73 ; Nothing 78 74 ; Corrupts registers: 79 ; Nothing75 ; CX 80 76 ;-------------------------------------------------------------------- 81 77 %ifdef INCLUDE_MENU_LIBRARY … … 102 98 ; DI: Updated by number of BYTEs stored 103 99 ; Corrupts registers: 104 ; AX 100 ; AX, CX 105 101 ;-------------------------------------------------------------------- 106 102 ALIGN JUMP_ALIGN … … 118 114 ; DI: Updated by number of BYTEs stored 119 115 ; Corrupts registers: 120 ; Nothing116 ; CX 121 117 ;-------------------------------------------------------------------- 122 ALIGN JUMP_ALIGN123 118 Memory_StoreCXbytesFromAccumToESDI: 124 OPTIMIZE_STRING_OPERATION rep,stos119 OPTIMIZE_STRING_OPERATION stos 125 120 ret 126 121 … … 135 130 ; AX 136 131 ;-------------------------------------------------------------------- 137 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS132 %ifndef EXCLUDE_FROM_XUB 138 133 ALIGN JUMP_ALIGN 139 134 Memory_ReserveCXbytesFromStackToDSSI: -
trunk/Assembly_Library/Src/Util/Reboot.asm
r526 r592 44 44 mov al, 0FEh ; System reset (AT+ keyboard controller) 45 45 out 64h, al ; Reset computer (AT+) 46 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS46 %ifndef EXCLUDE_FROM_XUB 47 47 %ifdef INCLUDE_TIME_LIBRARY 48 48 mov ax, 10 -
trunk/Assembly_Library/Src/Util/Registers.asm
r526 r592 59 59 %endif 60 60 61 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS61 %ifndef EXCLUDE_FROM_XUB 62 62 ALIGN JUMP_ALIGN 63 63 Registers_CopySSBPtoDSSI: … … 91 91 ; 92 92 ;-------------------------------------------------------------------- 93 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOSOR EXCLUDE_FROM_XTIDECFG93 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG 94 94 ALIGN JUMP_ALIGN 95 95 Registers_NormalizeESSI: 96 96 mov cx, si 97 and si, byte 0fh98 jmp Registers_NormalizeFinish97 and si, BYTE 0Fh 98 jmp SHORT Registers_NormalizeFinish 99 99 100 100 ALIGN JUMP_ALIGN 101 101 Registers_NormalizeESDI: 102 102 mov cx, di 103 and di, byte 0fh103 and di, BYTE 0Fh 104 104 ;;; fall-through 105 105 -
trunk/Assembly_Library/Src/Util/Size.asm
r580 r592 70 70 jae SHORT Size_DivideSizeInBXDXAXby1024andIncrementMagnitudeInCX 71 71 add sp, BYTE 2 ; Clean return address from stack 72 xchg si, cx ; CX = Remainder (0...1023), SI = Magnitude73 72 74 73 ; Convert remainder to tenths 75 xchg bx, ax ; Store AX 76 mov al, 5 ; AH = 0 77 mul cx ; DX:AX = remainder * (10 / 2) 78 %ifdef USE_186 79 shr ax, 9 ; Divide AX by (1024 / 2) 80 %else 81 shr ax, 1 82 mov al, ah 83 cbw 84 %endif 85 xchg cx, ax ; CX = tenths 86 xchg ax, bx 74 mov bx, 640 75 xchg bx, ax ; BX = Size, AX = (10 / 1024) * 65536 76 mul si ; DX = Remainder * (10 / 1024) 77 xchg dx, ax 78 xchg cx, ax ; CX = Tenths, AX = Magnitude 79 xchg bx, ax ; AX = Size, BX = Magnitude 87 80 88 81 ; Convert magnitude to character 89 mov dl, [cs: si+.rgbMagnitudeToChar]82 mov dl, [cs:bx+.rgbMagnitudeToChar] 90 83 91 84 pop si … … 154 147 ; Nothing 155 148 ;-------------------------------------------------------------------- 156 %ifdef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS149 %ifdef EXCLUDE_FROM_XUB 157 150 %ifdef USE_386 158 151 %define EXCLUDE -
trunk/Assembly_Library/Src/Util/Sort.asm
r526 r592 63 63 push cx 64 64 65 %ifdef CLD_NEEDED 65 66 cld 67 %endif 66 68 mov cx, di ; Restore item size to CX 67 69 xor ax, ax ; Zero starting index … … 191 193 192 194 cmp ax, dx ; If (left <= right) 193 jg SHORT ArrangeItemsInRangeAXtoDXtoBothSidesOfPivotInESDI195 jg SHORT .BreakLoopSinceAllItemsExamined 194 196 call SwapItemsFromIndexesAXandDX 195 197 inc ax -
trunk/BIOS_Drive_Information_Tool/Src/AtaInfo.asm
r558 r592 71 71 72 72 ; Print L-CHS generated by XTIDE Universal BIOS 73 call DisplayX TUBcompatibilityInfoUsingAtaInfoFromDSBX73 call DisplayXUBcompatibilityInfoUsingAtaInfoFromDSBX 74 74 75 75 .SkipAtaInfoSinceError: … … 80 80 81 81 ;-------------------------------------------------------------------- 82 ; Display XTUBcompatibilityInfoUsingAtaInfoFromDSBX82 ; DisplayPCHSusingAtaInfoFromDSBX 83 83 ; Parameters: 84 84 ; BX: Offset to ATA Information … … 193 193 DisplayPioModeInformationUsingAtaInfoFromDSBX: 194 194 ; Load standard timings (up to PIO-2) 195 mov ax, [bx+ATA1.bPioMode] 195 mov al, [bx+ATA1.bPioMode] 196 cbw 196 197 mov si, ax 197 shlsi, 1 ; Shift for WORD lookup198 eSHL_IM si, 1 ; Shift for WORD lookup 198 199 mov dx, [si+.rgwStandardPioTimings] ; Load min cycle time 199 200 mov cx, -1 ; IORDY not supported … … 203 204 jz SHORT .NoAdvancedPioModesSupported 204 205 205 mov si, [bx+ATA2.bPIOSupp] ; Advanced mode flags 206 mov si, 0FFh 207 and si, [bx+ATA2.bPIOSupp] ; Advanced mode flags 208 jz SHORT .NoAdvancedPioModesSupported 206 209 .IncrementPioMode: 207 210 inc ax … … 222 225 223 226 ;-------------------------------------------------------------------- 224 ; DisplayX TUBcompatibilityInfoUsingAtaInfoFromDSBX227 ; DisplayXUBcompatibilityInfoUsingAtaInfoFromDSBX 225 228 ; Parameters: 226 229 ; BX: Offset to ATA Information … … 230 233 ; AX, BX, CX, DX, BP, SI, DI 231 234 ;-------------------------------------------------------------------- 232 DisplayX TUBcompatibilityInfoUsingAtaInfoFromDSBX:235 DisplayXUBcompatibilityInfoUsingAtaInfoFromDSBX: 233 236 ; Display header 234 mov ax, g_szX TUBversion235 mov si, g_szX TUB237 mov ax, g_szXUBversion 238 mov si, g_szXUB 236 239 call Print_FormatStringFromSIwithParameterInAX 237 240 -
trunk/BIOS_Drive_Information_Tool/Src/Print.asm
r589 r592 149 149 xor dh, dh 150 150 mov si, dx 151 shlsi, 1 ; Shift for WORD lookup151 eSHL_IM si, 1 ; Shift for WORD lookup 152 152 push WORD [si+.rgszXlateModeToString] 153 153 … … 197 197 ;-------------------------------------------------------------------- 198 198 Print_NameFromAtaInfoInBX: 199 %ifdef CLD_NEEDED 199 200 cld 201 %endif 202 mov bp, sp 200 203 lea si, [bx+ATA1.strModel] 204 push si 201 205 mov di, si 202 206 mov cx, A1_MODEL_NUMBER_LENGTH/2 … … 211 215 stosb ; Terminate with NULL 212 216 213 mov bp, sp214 lea si, [bx+ATA1.strModel]215 push si216 217 mov si, g_szFormatDrvName 217 218 jmp SHORT JumpToFormatNullTerminatedStringFromSI -
trunk/BIOS_Drive_Information_Tool/Src/Strings.asm
r590 r592 21 21 SECTION .data 22 22 23 g_szProgramName: db "BIOS Drive Information Tool v1.0. 2",CR,LF24 db "(C) 2012-201 6by XTIDE Universal BIOS Team",CR,LF23 g_szProgramName: db "BIOS Drive Information Tool v1.0.3",CR,LF 24 db "(C) 2012-2018 by XTIDE Universal BIOS Team",CR,LF 25 25 db "Released under GNU GPL v2",CR,LF 26 26 db "http://xtideuniversalbios.org/",CR,LF,NULL … … 42 42 g_szBlockMode: db " Block mode : Set to %u from max %u sectors",CR,LF,NULL 43 43 g_szPIO: db " PIO mode : Max %u, Min cycle times: %u ns, with IORDY %d ns",CR,LF,NULL 44 g_szX TUB: db "XTIDE Universal BIOS %s generates following L-CHS...",CR,LF,NULL45 g_szX TUBversion:db ROM_VERSION_STRING ; This one is NULL terminated44 g_szXUB: db "XTIDE Universal BIOS %s generates following L-CHS...",CR,LF,NULL 45 g_szXUBversion: db ROM_VERSION_STRING ; This one is NULL terminated 46 46 47 47 g_szOldInfoHeader: db "Old INT 13h information from AH=08h and AH=15h...",CR,LF,NULL -
trunk/BIOS_Drive_Information_Tool/makefile
r359 r592 52 52 # Assembler preprocessor defines. # 53 53 ################################################################# 54 DEFINES = 54 DEFINES = EXCLUDE_FROM_BIOSDRVS 55 55 DEFINES_XT = ELIMINATE_CGA_SNOW 56 56 DEFINES_XTPLUS = USE_186 ELIMINATE_CGA_SNOW … … 98 98 ASFLAGS += $(IHEADERS) # Set header file directory paths 99 99 ASFLAGS += -Worphan-labels # Warn about labels without colon 100 ASFLAGS += -O 9# Optimize operands to their shortest forms100 ASFLAGS += -Ox # Optimize operands to their shortest forms 101 101 102 102 … … 130 130 @upx -qq --8086 --ultra-brute $(TARGET).$(EXTENSION) 131 131 @echo Done! XT version is ready for release. 132 133 xt_unused: xt 134 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XT) -o"$(TARGET)_xt_unused.asm" -E -DCHECK_FOR_UNUSED_ENTRYPOINTS 135 @perl ..\Tools\unused.pl $(TARGET)_xt.lst $(TARGET)_xt_unused.asm 136 -
trunk/Serial_Server/library/Checksum.cpp
r589 r592 343 343 } 344 344 345 bbuff[ rand() % 512 ] ^= bit[ rand() % 8];345 bbuff[ rand() & 511 ] ^= bit[ rand() & 7 ]; 346 346 347 347 if( b > 0 ) -
trunk/Serial_Server/library/Image.cpp
r589 r592 131 131 sect = 63; 132 132 } 133 else if( (totallba % 16) != 0 || ((totallba/16) % 63) != 0 )133 else if( (totallba & 15) != 0 || ((totallba/16) % 63) != 0 ) 134 134 { 135 135 log( -1, "'%s', file size does not match standard CHS geometry (x:16:63), please specify geometry explicitly with -g", name ); -
trunk/Serial_Server/win32/Win32.cpp
r589 r592 37 37 char *bannerStrings[] = { 38 38 "SerDrive - XTIDE Universal BIOS Serial Drive Server", 39 "Copyright (C) 2012-201 3by XTIDE Universal BIOS Team",39 "Copyright (C) 2012-2018 by XTIDE Universal BIOS Team", 40 40 "Released under GNU GPL v2, with ABSOLUTELY NO WARRANTY", 41 41 ROM_VERSION_STRING, … … 49 49 "http://www.gnu.org/licenses/gpl-2.0.html", 50 50 "", 51 "Visit the wiki on http://code.google.com/p/xtideuniversalbios for detailed", 52 "serial drive usage directions.", 51 "Visit the wiki on http://xtideuniversalbios.org for detailed usage directions.", 53 52 "", 54 53 "Usage: SerDrive [options] imagefile [[slave-options] slave-imagefile]", -
trunk/XTIDE_Universal_BIOS/Inc/BootVars.inc
r589 r592 28 28 ; Number of times to retry booting before accepting error 29 29 BOOT_READ_RETRY_TIMES EQU 3 30 31 32 30 33 31 ; Pre-boot variables. These do not exist after successful boot to OS. … … 69 67 %endif ; MODULE_HOTKEYS 70 68 69 ; MAX_HARD_DISK_NAME_LENGTH must be defined ahead of the DRVDETECTINFO structure to avoid problems with NASM 70 MAX_HARD_DISK_NAME_LENGTH EQU 30 ; Bytes reserved for drive name 71 71 72 struc DRVDETECTINFO 72 73 .StartOfDrvDetectInfo: … … 79 80 endstruc 80 81 81 ; Boot Menu Information Table. These are generated for all XTIDE Universal82 ; BIOS drives. Available only until boot is successful.83 MAX_HARD_DISK_NAME_LENGTH EQU 30 ; Bytes reserved for drive name84 82 DPT_DRVDETECTINFO_SIZE_MULTIPLIER EQU DRVDETECTINFO_size / LARGEST_DPT_SIZE 85 83 86 87 84 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS 88 89 85 %if MAX_HARD_DISK_NAME_LENGTH % 2 <> 0 90 86 %error "MAX_HARD_DISK_NAME_LENGTH needs to be a multiple of 2, memory is moved with word operations." 91 87 %endif 92 93 %if DRVDETECTINFO_size % LARGEST_DPT_SIZE <> 094 %error "DRVDETECTINFO's size must be an even multiple of DPT's size. Add or remove padding at the bottom of DRVDETECTINFO to bring the two sizes into alignment. As DRVDETECTINFO is only used at boot time, with plenty of memory to consume, it is OK to waste some space here."95 %endif96 97 %if DRVDETECTINFO.szDrvName <> 098 %error "DRVDETECTINFO.szDrvName is assumed to be the first member of struc DRVDETECTINFO, in BootMenuPrint_RefreshItem"99 %endif100 101 88 %endif 102 89 -
trunk/XTIDE_Universal_BIOS/Inc/IdeIO.inc
r589 r592 57 57 %ifndef MODULE_8BIT_IDE ; Standard IDE controllers only 58 58 59 eMOVZX bx, [di+DPT.bIdevarsOffset] 59 60 %ifnidni %1, dx 60 61 mov dx, %1 61 62 %endif 62 eMOVZX bx, BYTE [di+DPT.bIdevarsOffset]63 63 add dx, [cs:bx+IDEVARS.wControlBlockPort] 64 64 out dx, al -
trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc
r589 r592 35 35 .wDisplayMode resb 2 ; Display mode for boot menu 36 36 .wBootTimeout resb 2 ; Boot Menu selection timeout in system timer ticks 37 .pColorTheme resb 2 ; Ptr to the color attribute struc used by the boot menu and hotkey bar 37 38 .bIdeCnt resb 1 ; Number of available IDE controllers 38 39 .bBootDrv resb 1 ; Default drive to boot from … … 182 183 endstruc 183 184 184 ; Bit defines for DRVPARAMS.wFlags 185 ; Bit defines for DRVPARAMS.wFlags - these flags are accessed as bytes so changes here might require changes elsewhere 185 186 MASK_DRVPARAMS_WRITECACHE EQU (3<<0) ; Bits 0...1, Drive internal write cache settings (must start at bit 0) 186 187 DEFAULT_WRITE_CACHE EQU 0 ; Must be 0 -
trunk/XTIDE_Universal_BIOS/Inc/Version.inc
r584 r592 20 20 21 21 ; Flash signature revisions: 22 ; XTIDE206 Added support for Color Themes 22 23 ; XTIDE205 Added DEVICE_8BIT_XTCF_PIO16_WITH_BIU_OFFLOAD after other XT-CF 23 24 ; PIO modes (prevents empty indexes in PIO jump tables) … … 48 49 %define TITLE_STRING TITLE_STRING_START, TITLE_STRING_END 49 50 %define ROM_VERSION_STRING "v2.0.0",BETA,"3+ (",__DATE__,")",NULL 50 %define FLASH_SIGNATURE "XTIDE20 5" ; Do not terminate with NULL51 %define FLASH_SIGNATURE "XTIDE206" ; Do not terminate with NULL 51 52 52 53 -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm
r589 r592 200 200 %ifdef MODULE_IRQ 201 201 test BYTE [bp+IDEPACK.bDeviceControl], FLG_DEVCONTROL_nIEN 202 %ifdef USE_386 203 jnz IdeWait_IRQorStatusFlagInBLwithTimeoutInBH 204 %else 202 205 jz SHORT .PollStatusFlagInsteadOfWaitIrq 203 206 jmp IdeWait_IRQorStatusFlagInBLwithTimeoutInBH 204 207 .PollStatusFlagInsteadOfWaitIrq: 205 208 %endif 209 %endif ; MODULE_IRQ 206 210 jmp IdeWait_PollStatusFlagInBLwithTimeoutInBH 207 211 -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeDPT.asm
r582 r592 121 121 jnz SHORT .ChangeTo32bitDevice 122 122 123 and BYTE [di+DPT.bFlagsHigh], ~FLGH_DPT_IORDY ; No IORDY supported if need to limit123 and [di+DPT.bFlagsHigh], ah ; Mask off FLGH_DPT_IORDY if IORDY not supported 124 124 MIN_U [di+DPT_ADVANCED_ATA.bPioMode], al 125 125 mov [di+DPT_ADVANCED_ATA.wMinPioCycleTime], bx -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/JrIdeTransfer.asm
r545 r592 147 147 lds di, [bp+MEMPIOVARS.fpDPT] ; DPT now in DS:DI 148 148 %ifdef USE_386 149 movzx cx, BYTE[bp+MEMPIOVARS.bSectorsDone]149 movzx cx, [bp+MEMPIOVARS.bSectorsDone] 150 150 %else 151 151 mov ch, 0 ; Preserve CF -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm
r589 r592 97 97 sti ; Enable interrupts 98 98 %endif 99 %ifdef CLD_NEEDED 99 100 cld ; String instructions to increment pointers 101 %endif 100 102 ePUSHA 101 103 push ds … … 193 195 194 196 ; Push old INT 13h handler and restore registers 197 %ifdef USE_386 198 push DWORD [RAMVARS.fpOldI13h] 199 %else 195 200 push WORD [RAMVARS.fpOldI13h+2] 196 201 push WORD [RAMVARS.fpOldI13h] 202 %endif 197 203 mov bx, [bp+IDEPACK.intpack+INTPACK.bx] 198 204 mov di, [bp+IDEPACK.intpack+INTPACK.di] -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm
r567 r592 126 126 mov cx, NUMBER_OF_IDEVARS 127 127 128 . loop:128 .Loop: 129 129 call FindDPT_MasterOrSingleForIdevarsOffsetInDL 130 130 jc SHORT .ControllerNotAvailable … … 162 162 .ControllerNotAvailable: 163 163 add dl, IDEVARS_size ; move Idevars pointer forward 164 loop . loop164 loop .Loop 165 165 ret -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH1Eh_XTCF.asm
r589 r592 121 121 ; 122 122 ; Also note that some machines, noteably the Olivetti M24 (also known as 123 ; the AT&T PC6300 and Xerox 6060), have hardware errors in the BIU logic,124 ; resulting in reversed byte ordering. Therefore, XTCF_8BIT_PIO_MODE is125 ; the default transfer mode for best system compatibility.123 ; the AT&T PC6300 or Xerox 6060 or Logabax Persona 1600), have hardware errors 124 ; in the BIU logic, resulting in reversed byte ordering. Therefore, 125 ; XTCF_8BIT_PIO_MODE is the default transfer mode for best system compatibility. 126 126 127 127 -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH41h_CheckIfExtensionsPresent.asm
r567 r592 46 46 47 47 mov BYTE [bp+IDEPACK.intpack+INTPACK.ah], EBIOS_VERSION 48 mov WORD [bp+IDEPACK.intpack+INTPACK.bx], 0AA55h48 not WORD [bp+IDEPACK.intpack+INTPACK.bx] ; 55AAh = AA55h 49 49 50 50 %ifdef MODULE_COMPATIBLE_TABLES … … 75 75 ;-------------------------------------------------------------------- 76 76 AH41h_GetSupportBitsToCX: 77 %ifdef USE_AT ; Always in Full mode 78 %ifndef MODULE_8BIT_IDE OR MODULE_SERIAL 79 mov cx, ENHANCED_DRIVE_ACCESS_SUPPORT | ENHANCED_DISK_DRIVE_SUPPORT 80 %else 81 mov cx, ENHANCED_DRIVE_ACCESS_SUPPORT 82 cmp BYTE [di+DPT_ATA.bDevice], DEVICE_8BIT_ATA 83 jae SHORT .DoNotSetEDDflag 84 or cl, ENHANCED_DISK_DRIVE_SUPPORT 85 %endif 86 %else ; ~USE_AT 77 87 mov cx, ENHANCED_DRIVE_ACCESS_SUPPORT 78 88 79 89 ; DPTE needs buffer from RAM so do not return it in lite mode 80 %ifndef USE_AT81 90 test BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_FULLMODE 82 91 jz SHORT .DoNotSetEDDflag 83 %endif84 92 85 93 %ifdef MODULE_8BIT_IDE OR MODULE_SERIAL … … 91 99 92 100 or cl, ENHANCED_DISK_DRIVE_SUPPORT ; AH=48h returns DPTE 101 %endif ; USE_AT 93 102 .DoNotSetEDDflag: 94 103 ret -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Address.asm
r589 r592 110 110 and al, MASKL_DPT_TRANSLATEMODE 111 111 112 ;;; 0: ADDRESSING_MODE_NORMAL112 ;;; 0: TRANSLATEMODE_NORMAL 113 113 jz SHORT DoNotConvertLCHS 114 114 115 ;;; 1: ADDRESSING_MODE_LARGE115 ;;; 1: TRANSLATEMODE_LARGE 116 116 test al, FLGL_DPT_ASSISTED_LBA 117 117 jz SHORT ConvertLargeModeLCHStoPCHS 118 118 119 ;;; 2: ADDRESSING_MODE_ASSISTED_LBA119 ;;; 2: TRANSLATEMODE_ASSISTED_LBA 120 120 ; Fall to ConvertAssistedLBAModeLCHStoLBARegisterValues 121 121 -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm
r567 r592 30 30 Int19h_BootLoaderHandler: 31 31 sti ; Enable interrupts 32 %ifdef CLD_NEEDED 32 33 cld ; String instructions to increment pointers 34 %endif 33 35 %ifdef MODULE_VERY_LATE_INIT 34 36 LOAD_BDA_SEGMENT_TO ds, ax ; Load BDA segment (zero) to DS -
trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/AdvAtaInit.asm
r589 r592 60 60 ; AX: ID WORD specific for detected controller 61 61 ; Returns: 62 ; AL: Max supported PIO mode 63 ; AH: FLGH_DPT_IORDY if IORDY supported, zero otherwise62 ; AL: Max supported PIO mode (only if ZF set) 63 ; AH: ~FLGH_DPT_IORDY if IORDY not supported, -1 otherwise (only if ZF set) 64 64 ; BX: Min PIO cycle time (only if ZF set) 65 65 ; ZF: Set if PIO limit necessary -
trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/PDC20x30.asm
r589 r592 127 127 128 128 ; PDC20230C and PDC20630 clears the bit we set at the beginning 129 in al, dx 129 in al, dx ; 1F2h 130 130 dec dx 131 131 dec dx ; Base port … … 139 139 ; AX: ID WORD specific for detected controller 140 140 ; Returns: 141 ; AL: Max supported PIO mode 142 ; AH: FLGH_DPT_IORDY if IORDY supported, zero otherwise141 ; AL: Max supported PIO mode (only if ZF set) 142 ; AH: ~FLGH_DPT_IORDY if IORDY not supported, -1 otherwise (only if ZF set) 143 143 ; BX: Min PIO cycle time (only if ZF set) 144 144 ; ZF: Set if PIO limit necessary … … 148 148 ;-------------------------------------------------------------------- 149 149 PDC20x30_GetMaxPioModeToALandMinPioCycleTimeToBX: 150 cmp ah, ID_PDC20 630151 j e SHORT .Return ; No need to limit anything152 mov ax, 2; Limit PIO to 2 for ID_PDC20230150 cmp ah, ID_PDC20230 151 jne SHORT .Return ; No need to limit anything for ID_PDC20630 152 mov ax, (~FLGH_DPT_IORDY & 0FFh) << 8 | 2 ; Limit PIO to 2 for ID_PDC20230 153 153 mov bx, PIO_2_MIN_CYCLE_TIME_NS 154 stc155 154 .Return: 156 155 ret … … 206 205 ;-------------------------------------------------------------------- 207 206 SetSpeedForDriveInCX: 208 eMOVZX bx, BYTE [di+DPT_ADVANCED_ATA.bPioMode] 209 MIN_U bl, 2 ; Limit to PIO2 210 mov bl, [cs:bx+.rgbPioModeToPDCspeedValue] 207 mov bx, .rgbPioModeToPDCspeedValue 208 mov al, [di+DPT_ADVANCED_ATA.bPioMode] 209 MIN_U al, 2 ; Limit to PIO2 210 cs xlat 211 xchg bx, ax 211 212 212 213 add dx, BYTE SECTOR_NUMBER_REGISTER -
trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/Vision.asm
r589 r592 131 131 ; AH: QDI Vision Controller ID 132 132 ; Returns: 133 ; AL: Max supported PIO mode 134 ; AH: FLGH_DPT_IORDY if IORDY supported, zero otherwise133 ; AL: Max supported PIO mode (only if ZF set) 134 ; AH: ~FLGH_DPT_IORDY if IORDY not supported, -1 otherwise (only if ZF set) 135 135 ; BX: Min PIO Cycle Time (only if ZF set) 136 136 ; ZF: Set if PIO limit necessary … … 142 142 cmp ah, ID_QD6500 143 143 jne SHORT .NoNeedToLimitForQD6580 144 145 mov ax, 2 ; Limit to PIO 2 because QD6500 does not support IORDY 144 mov ax, (~FLGH_DPT_IORDY & 0FFh) << 8 | 2 ; Limit to PIO 2 because QD6500 does not support IORDY 146 145 mov bx, PIO_2_MIN_CYCLE_TIME_NS 147 146 .NoNeedToLimitForQD6580: -
trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm
r580 r592 104 104 ; DX: User defined P-CHS to L-CHS translate mode 105 105 ; Corrupts registers: 106 ; AX, BX , CX106 ; AX, BX 107 107 ;-------------------------------------------------------------------- 108 108 AtaID_ModifyESSIforUserDefinedLimitsAndReturnTranslateModeInDX: … … 113 113 pop ds 114 114 115 ; Load User Defined CHS or LBA to CX:AX116 mov d x, [bx+DRVPARAMS.wFlags]115 ; Load User Defined CHS or LBA to BX:AX 116 mov dl, [bx+DRVPARAMS.wFlags] ; Only load the flags we actually need 117 117 mov ax, [bx+DRVPARAMS.wCylinders] ; Or .dwMaximumLBA 118 mov cx, [bx+DRVPARAMS.wHeadsAndSectors] ; Or .dwMaximumLBA+2118 mov bx, [bx+DRVPARAMS.wHeadsAndSectors] ; Or .dwMaximumLBA+2 119 119 120 120 push es … … 127 127 ; Apply new CHS and disable LBA (we also want to set CHS addressing) 128 128 mov [si+ATA1.wCylCnt], ax 129 eMOVZX ax, cl129 eMOVZX ax, bl 130 130 mov [si+ATA1.wHeadCnt], ax 131 mov al, ch131 mov al, bh 132 132 mov [si+ATA1.wSPT], ax 133 133 and BYTE [si+ATA1.wCaps+1], ~(A1_wCaps_LBA>>8) … … 140 140 141 141 ; Apply new LBA and disable LBA48 142 cmp cx, [si+ATA1.dwLBACnt+2]142 cmp bx, [si+ATA1.dwLBACnt+2] 143 143 ja SHORT .NoUserDefinedLBA ; Do not set larger than drive 144 144 jb SHORT .StoreNewLBA … … 147 147 .StoreNewLBA: 148 148 mov [si+ATA1.dwLBACnt], ax 149 mov [si+ATA1.dwLBACnt+2], cx149 mov [si+ATA1.dwLBACnt+2], bx 150 150 and BYTE [si+ATA6.wSetSup83+1], ~(A6_wSetSup83_LBA48>>8) 151 151 .NoUserDefinedLBA: … … 173 173 AtaID_GetMaxPioModeToAXandMinCycleTimeToCX: 174 174 ; Get PIO mode and cycle time for PIO 0...2 175 mov bx, [es:si+ATA1.bPioMode] 176 mov ax, bx ; AH = 0, AL = PIO mode 0, 1 or 2 177 eSHL_IM bx, 1 ; Shift for WORD lookup 175 %ifdef USE_386 176 movzx ax, [es:si+ATA1.bPioMode] ; AH = 0, AL = PIO mode 0, 1 or 2 177 %else 178 mov al, [es:si+ATA1.bPioMode] 179 cbw 180 %endif 181 mov bx, ax 182 eSHL_IM bx, 1 ; Shift for WORD lookup 178 183 mov cx, [cs:bx+.rgwPio0to2CycleTimeInNanosecs] 179 184 180 185 ; Check if IORDY is supported 181 186 test BYTE [es:si+ATA2.wCaps+1], A2_wCaps_IORDY >> 8 182 jz SHORT .ReturnPioTimings ; No PIO 3 or higher if no IORDY183 mov ah, FLGH_DPT_IORDY 187 jz SHORT .ReturnPioTimings ; No PIO 3 or higher if no IORDY 188 mov ah, FLGH_DPT_IORDY ; *FIXME* Actually, CF specification v4.1 says that use of IORDY is invalid for PIO modes 5 and 6. 184 189 185 190 ; Check if Advanced PIO modes are supported (3 and above) … … 187 192 jz SHORT .ReturnPioTimings 188 193 189 ; Get Advanced PIO mode 190 ; (Hard Disks supports up to 4 but CF cards can support 5 and 6)191 mov bl, [es:si+ATA2.bPIOSupp]194 ; Get Advanced PIO mode (Hard Disks supports up to 4 but CF cards can support 5 and 6) 195 or bh, [es:si+ATA2.bPIOSupp] 196 jz SHORT .ReturnPioTimings 192 197 .CheckNextFlag: 193 198 inc ax 194 shr b l, 1199 shr bh, 1 195 200 jnz SHORT .CheckNextFlag 196 201 MIN_U al, 6 ; Make sure not above lookup tables -
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm
r589 r592 150 150 push bp 151 151 mov bp, sp 152 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS 153 %if DRVDETECTINFO.szDrvName = 0 154 push bx 155 %else 152 156 lea si, [bx+DRVDETECTINFO.szDrvName] 153 157 push si 158 %endif 159 %endif 154 160 mov si, g_szDriveName 155 161 jmp SHORT DetectPrint_FormatCSSIfromParamsInSSBP -
trunk/XTIDE_Universal_BIOS/Src/Initialization/FloppyDrive.asm
r567 r592 190 190 LOAD_BDA_SEGMENT_TO ds, ax 191 191 mov al, [BDA.wEquipment] ; Load Equipment WORD low byte 192 and al, 0C1h ; Leave bits 7..6 and 0 193 eAAM 64 194 add al, ah ; AL = Floppy Drive count 192 195 pop ds 193 194 %ifdef USE_UNDOC_INTEL195 and al, 0C1h196 eAAM 64197 %else198 mov ah, al ; Copy it to AH199 and ax, 0C001h ; Leave bits 15..14 and 0200 eROL_IM ah, 2 ; EW low byte bits 7..6 to 1..0201 %endif ; USE_UNDOC_INTEL202 203 add al, ah ; AL = Floppy Drive count204 196 %endif ; USE_AT 205 197 -
trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm
r589 r592 239 239 .ClearBitFrom8259MaskRegister: 240 240 push cx 241 xchg ax, cx ; IRQ index to CL 241 xchg cx, ax ; IRQ index to CL 242 in al, dx ; Read Interrupt Mask Register 242 243 mov ch, ~1 ; Load bit mask to be rotated 243 244 rol ch, cl ; Rotate mask to correct position for clearing 244 in al, dx ; Read Interrupt Mask Register245 245 and al, ch ; Clear wanted bit 246 246 out dx, al ; Write modified Interrupt Mask Register -
trunk/XTIDE_Universal_BIOS/Src/Main.asm
r589 r592 32 32 33 33 ; We must define included libraries before including "AssemblyLibrary.inc". 34 %define EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS; Exclude unused library functions34 %define EXCLUDE_FROM_XUB ; Exclude unused library functions 35 35 %ifdef MODULE_BOOT_MENU 36 36 %define MENUEVENT_INLINE_OFFSETS ; Only one menu required, save space and inline offsets … … 81 81 %ifdef MODULE_BOOT_MENU 82 82 at ROMVARS.wBootTimeout, dw BOOT_MENU_DEFAULT_TIMEOUT 83 at ROMVARS.pColorTheme, dw ColorTheme ; Offset to the ATTRIBUTE_CHARS struc that holds the color theme 83 84 %endif 84 85 at ROMVARS.bIdeCnt, db 2 ; Number of supported controllers … … 105 106 at ROMVARS.ideVars2+IDEVARS.wControlBlockPort, dw DEVICE_ATA_TERTIARY_PORTCTRL 106 107 at ROMVARS.ideVars2+IDEVARS.bDevice, db DEVICE_16BIT_ATA 107 at ROMVARS.ideVars2+IDEVARS.bIRQ, db 0 108 at ROMVARS.ideVars2+IDEVARS.bIRQ, db 0 ; Should be 11 on the GSI Inc. Model 2C 108 109 at ROMVARS.ideVars2+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, dw DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION) 109 110 at ROMVARS.ideVars2+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, dw DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION) … … 112 113 at ROMVARS.ideVars3+IDEVARS.wControlBlockPort, dw DEVICE_ATA_QUATERNARY_PORTCTRL 113 114 at ROMVARS.ideVars3+IDEVARS.bDevice, db DEVICE_16BIT_ATA 114 at ROMVARS.ideVars3+IDEVARS.bIRQ, db 0 115 at ROMVARS.ideVars3+IDEVARS.bIRQ, db 0 ; Should be 10 on the GSI Inc. Model 2C 115 116 at ROMVARS.ideVars3+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, dw DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION) 116 117 at ROMVARS.ideVars3+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, dw DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION) … … 127 128 %ifdef MODULE_BOOT_MENU 128 129 at ROMVARS.wBootTimeout, dw BOOT_MENU_DEFAULT_TIMEOUT 130 at ROMVARS.pColorTheme, dw ColorTheme ; Offset to the ATTRIBUTE_CHARS struc that holds the color theme 129 131 %endif 130 132 at ROMVARS.bIdeCnt, db 1 … … 301 303 302 304 305 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS 303 306 ; Although it's very unlikely to happen, we give warnings for builds that cannot be automatically checksummed due to the size being too large. 304 307 ; In some cases it's theoretically possible to checksum the build anyway (manually) which is why these are warnings and not errors. … … 309 312 %endif 310 313 %endif 311 %elif ($-$$) = BIOS_SIZE ; A large build.314 %elif ($-$$) = BIOS_SIZE ; A large or tiny build. 312 315 %warning "This build is too large to be auto-checksummed!" 313 316 %endif 317 %endif -
trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuEvent.asm
r567 r592 141 141 142 142 ; Store default Menuitem (=default drive to boot from) 143 eMOVZX dx, BYTE[cs:ROMVARS.bBootDrv]143 eMOVZX dx, [cs:ROMVARS.bBootDrv] 144 144 call GetMenuitemToDXforDriveInDL 145 145 mov [bp+MENUINIT.wHighlightedItem], dx -
trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrint.asm
r589 r592 54 54 test dl, dl 55 55 js SHORT .go 56 mov bl, ( (g_szFloppyDrv)-$$ & 0xff); and revisit the earlier assumption...56 mov bl, (g_szFloppyDrv - $$) & 0xff ; and revisit the earlier assumption... 57 57 58 58 .go: -
trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrintCfg.asm
r568 r592 63 63 ;; with AL clear, and so we exchange AL and AH after the multiply for the final result. 64 64 ;; 65 %ifdef USE_186 66 imul ax, g_szAddressingModes_Displacement << (8-TRANSLATEMODE_FIELD_POSITION) 67 %else 65 68 mov cx, g_szAddressingModes_Displacement << (8-TRANSLATEMODE_FIELD_POSITION) 66 69 mul cx 70 %endif 67 71 xchg al, ah ; AL = always zero after above multiplication 68 72 add ax, g_szAddressingModes -
trunk/XTIDE_Universal_BIOS/Src/Menus/HotkeyBar.asm
r568 r592 407 407 sbb di, BYTE 1 ; Sub CF if Floppy Drive 408 408 xchg ax, cx 409 mov [es:di], al409 stosb 410 410 stc ; Valid hotkey scancode returned in AL 411 411 -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AtaGeometry.asm
r580 r592 114 114 ; slower. The speed difference doesn't matter on AT systems. 115 115 .UseAssistedLBA: 116 call GetSectorCountToDXAXfromCHSinAXBLBH 117 call ConvertChsSectorCountFromDXAXtoLbaAssistedLCHSinAXBLBH 118 xor cx, cx ; No bits to shift 116 ; Fall to GetSectorCountToDXAXfromCHSinAXBLBH 117 118 119 ;-------------------------------------------------------------------- 120 ; GetSectorCountToDXAXfromCHSinAXBLBH 121 ; Parameters: 122 ; AX: Number of cylinders (1...16383) 123 ; BL: Number of heads (1...255) 124 ; BH: Number of sectors per track (1...63) 125 ; Returns: 126 ; DX:AX: Total number of CHS addressable sectors 127 ; Corrupts registers: 128 ; BX 129 ;-------------------------------------------------------------------- 130 GetSectorCountToDXAXfromCHSinAXBLBH: 131 xchg ax, bx 132 mul ah ; AX = Heads * Sectors per track 133 mul bx 134 ; Fall to ConvertChsSectorCountFromDXAXtoLbaAssistedLCHSinAXBLBH 135 136 137 ;-------------------------------------------------------------------- 138 ; LBA assist calculation (or Assisted LBA) 139 ; 140 ; This algorithm translates P-CHS sector count up to largest possible 141 ; L-CHS sector count (1024, 255, 63). Note that INT 13h interface allows 142 ; 256 heads but DOS supports up to 255 head. That is why BIOSes never 143 ; use 256 heads. 144 ; 145 ; L-CHS parameters generated here require the drive to use LBA addressing. 146 ; 147 ; Here is the algorithm: 148 ; If cylinders > 8192 149 ; Variable CH = Total CHS Sectors / 63 150 ; Divide (CH - 1) by 1024 and add 1 151 ; Round the result up to the nearest of 16, 32, 64, 128 and 255. This is the value to be used for the number of heads. 152 ; Divide CH by the number of heads. This is the value to be used for the number of cylinders. 153 ; 154 ; ConvertChsSectorCountFromDXAXtoLbaAssistedLCHSinAXBLBH: 155 ; Parameters: 156 ; DX:AX: Total number of P-CHS sectors for CHS addressing 157 ; (max = 16383 * 16 * 63 = 16,514,064) 158 ; Returns: 159 ; AX: Number of cylinders (?...1027) 160 ; BL: Number of heads (16, 32, 64, 128 or 255) 161 ; BH: Number of sectors per track (always 63) 162 ; CX: Number of bits shifted (0) 163 ; DL: TRANSLATEMODE_ASSISTED_LBA 164 ; Corrupts registers: 165 ; DH 166 ;-------------------------------------------------------------------- 167 ConvertChsSectorCountFromDXAXtoLbaAssistedLCHSinAXBLBH: 168 ; Value CH = Total sector count / 63 169 ; Max = 16,514,064 / 63 = 262128 170 mov cx, LBA_ASSIST_SPT ; CX = 63 171 172 ; --- Math_DivDXAXbyCX inlined (and slightly modified) since it's only used here 173 xor bx, bx 174 xchg bx, ax 175 xchg dx, ax 176 div cx 177 xchg ax, bx 178 div cx 179 mov dx, bx 180 ; --- 181 182 push ax 183 push dx ; Value CH stored for later use 184 185 ; BX:DX:AX = Value CH - 1 186 ; Max = 262128 - 1 = 262127 187 xor bx, bx 188 sub ax, BYTE 1 189 sbb dx, bx 190 191 ; AX = Number of heads = ((Value CH - 1) / 1024) + 1 192 ; Max = (262127 / 1024) + 1 = 256 193 call Size_DivideSizeInBXDXAXby1024 ; Preserves CX and returns with BH cleared 194 pop dx 195 inc ax ; + 1 196 197 ; Heads must be 16, 32, 64, 128 or 255 (round up to the nearest) 198 ; Max = 255 199 mov bl, 16 ; Min number of heads 200 .CompareNextValidNumberOfHeads: 201 cmp ax, bx 202 jbe SHORT .NumberOfHeadsNowInBX 203 eSHL_IM bx, 1 ; Double number of heads 204 jpo SHORT .CompareNextValidNumberOfHeads ; Reached 256 heads? 205 dec bx ; If so, limit heads to 255 206 .NumberOfHeadsNowInBX: 207 208 ; DX:AX = Number of cylinders = Value CH (without - 1) / number of heads 209 ; Max = 262128 / 255 = 1027 210 pop ax ; Value CH back to DX:AX 211 div bx 212 213 xchg bh, cl ; Sectors per Track to BH, zero to CL (CX) 119 214 mov dl, TRANSLATEMODE_ASSISTED_LBA 215 ReturnLCHSinAXBLBH: 120 216 ret 121 217 … … 136 232 mov bl, [es:si+ATA1.wHeadCnt] ; Heads (1...16) 137 233 mov bh, [es:si+ATA1.wSPT] ; Sectors per Track (1...63) 138 ret139 140 141 ;--------------------------------------------------------------------142 ; GetSectorCountToDXAXfromCHSinAXBLBH143 ; Parameters:144 ; AX: Number of cylinders (1...16383)145 ; BL: Number of heads (1...255)146 ; BH: Number of sectors per track (1...63)147 ; Returns:148 ; DX:AX: Total number of CHS addressable sectors149 ; Corrupts registers:150 ; BX151 ;--------------------------------------------------------------------152 GetSectorCountToDXAXfromCHSinAXBLBH:153 xchg ax, bx154 mul ah ; AX = Heads * Sectors per track155 mul bx156 234 ret 157 235 … … 175 253 ; Do a standard ECHS translation 176 254 ; 255 ; *FIXME* The above algorithm seems to be conflicting with info found here 256 ; https://web.archive.org/web/20000817071418/http://www.firmware.com:80/support/bios/over4gb.htm 257 ; which says that Revised ECHS is used when the cylinder count is > 8191. 258 ; 177 259 ; ConvertPCHfromAXBLtoRevisedEnhancedCHinAXBL: 178 260 ; Parameters: … … 183 265 ; BL: Number of L-CHS heads (?...240) 184 266 ; CX: Number of bits shifted (0...3) 185 ; DX: ADDRESSING_MODE_NORMAL or ADDRESSING_MODE_LARGE267 ; DX: TRANSLATEMODE_NORMAL or TRANSLATEMODE_LARGE 186 268 ; Corrupts registers: 187 269 ; Nothing … … 271 353 ret 272 354 273 274 ;--------------------------------------------------------------------275 ; LBA assist calculation (or Assisted LBA)276 ;277 ; This algorithm translates P-CHS sector count up to largest possible278 ; L-CHS sector count (1024, 255, 63). Note that INT 13h interface allows279 ; 256 heads but DOS supports up to 255 head. That is why BIOSes never280 ; use 256 heads.281 ;282 ; L-CHS parameters generated here require the drive to use LBA addressing.283 ;284 ; Here is the algorithm:285 ; If cylinders > 8192286 ; Variable CH = Total CHS Sectors / 63287 ; Divide (CH 1) by 1024 and add 1288 ; Round the result up to the nearest of 16, 32, 64, 128 and 255. This is the value to be used for the number of heads.289 ; Divide CH by the number of heads. This is the value to be used for the number of cylinders.290 ;291 ; ConvertChsSectorCountFromDXAXtoLbaAssistedLCHSinAXBLBH:292 ; Parameters:293 ; DX:AX: Total number of P-CHS sectors for CHS addressing294 ; (max = 16383 * 16 * 63 = 16,514,064)295 ; Returns:296 ; AX: Number of cylinders (?...1027)297 ; BL: Number of heads (16, 32, 64, 128 or 255)298 ; BH: Number of sectors per track (always 63)299 ; Corrupts registers:300 ; CX, DX301 ;--------------------------------------------------------------------302 ConvertChsSectorCountFromDXAXtoLbaAssistedLCHSinAXBLBH:303 ; Value CH = Total sector count / 63304 ; Max = 16,514,064 / 63 = 262128305 mov cx, LBA_ASSIST_SPT ; CX = 63306 call Math_DivDXAXbyCX ; Preserves CX307 push dx308 push ax ; Value CH stored for later use309 310 ; BX:DX:AX = Value CH - 1311 ; Max = 262128 - 1 = 262127312 xor bx, bx313 sub ax, BYTE 1314 sbb dx, bx315 316 ; AX = Number of heads = ((Value CH - 1) / 1024) + 1317 ; Max = (262127 / 1024) + 1 = 256318 call Size_DivideSizeInBXDXAXby1024 ; Preserves CX319 inc ax ; + 1320 321 ; Heads must be 16, 32, 64, 128 or 255 (round up to the nearest)322 ; Max = 255323 mov cl, 16 ; Min number of heads324 .CompareNextValidNumberOfHeads:325 cmp ax, cx326 jbe SHORT .NumberOfHeadsNowInCX327 eSHL_IM cx, 1 ; Double number of heads328 jpo SHORT .CompareNextValidNumberOfHeads ; Reached 256 heads?329 dec cx ; If so, limit heads to 255330 .NumberOfHeadsNowInCX:331 mov bx, cx ; Number of heads are returned in BL332 mov bh, LBA_ASSIST_SPT ; Sectors per Track333 334 ; DX:AX = Number of cylinders = Value CH (without - 1) / number of heads335 ; Max = 262128 / 255 = 1027336 pop ax337 pop dx ; Value CH back to DX:AX338 div cx339 340 ; Return L-CHS341 ReturnLCHSinAXBLBH:342 ret -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/DrvDetectInfo.asm
r591 r592 46 46 47 47 add si, BYTE ATA1.strModel ; DS:SI now points drive name (Clears CF) 48 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS 48 49 %if DRVDETECTINFO.szDrvName = 0 49 50 mov di, bx 50 51 %else 51 52 lea di, [bx+DRVDETECTINFO.szDrvName] ; ES:DI now points to name destination 53 %endif 52 54 %endif 53 55 mov cx, MAX_HARD_DISK_NAME_LENGTH / 2 ; Max number of WORDs allowed … … 78 80 ;-------------------------------------------------------------------- 79 81 DriveDetectInfo_ConvertDPTtoBX: 82 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS 80 83 %if DPT_DRVDETECTINFO_SIZE_MULTIPLIER = 2 81 84 %if BOOTVARS.rgDrvDetectInfo & 1 ; Should never be odd but better safe than sorry 82 lea ax, [di-RAMVARS_size]83 eSHL_IM ax, 184 add ax, BOOTVARS.rgDrvDetectInfo85 lea bx, [di-RAMVARS_size] 86 eSHL_IM bx, 1 87 add bx, BOOTVARS.rgDrvDetectInfo 85 88 %else 86 lea ax, [di-RAMVARS_size+(BOOTVARS.rgDrvDetectInfo/2)] 87 ; eSHL_IM ax, 1 ; *FIXME* For some reason this will cause NASM to crap itself. 88 shl ax, 1 ; So this will have to suffice for now. 89 lea bx, [di-RAMVARS_size+(BOOTVARS.rgDrvDetectInfo/2)] 90 eSHL_IM bx, 1 89 91 %endif 92 %else 93 %ifdef USE_186 94 lea bx, [di-RAMVARS_size] 95 imul bx, DPT_DRVDETECTINFO_SIZE_MULTIPLIER 96 add bx, BOOTVARS.rgDrvDetectInfo 90 97 %else 91 98 lea ax, [di-RAMVARS_size] ; subtract off base of DPTs … … 93 100 mul bl 94 101 add ax, BOOTVARS.rgDrvDetectInfo ; add base of DRVDETECTINFO 102 xchg bx, ax 95 103 %endif 96 xchg bx, ax 104 %endif 105 %endif 97 106 ret -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/RamVars.asm
r567 r592 31 31 ; DS: RAMVARS segment 32 32 ; Corrupts registers: 33 ; AX, CX, D I33 ; AX, CX, DX, DI 34 34 ;-------------------------------------------------------------------- 35 35 RamVars_Initialize: 36 36 push es 37 ; Fall to .StealMemoryForRAMVARS38 37 39 ;--------------------------------------------------------------------40 ; .StealMemoryForRAMVARS41 ; Parameters:42 ; Nothing43 ; Returns:44 ; DS: RAMVARS segment45 ; Corrupts registers:46 ; AX, CL47 ;--------------------------------------------------------------------48 .StealMemoryForRAMVARS:49 38 %ifndef USE_AT 50 39 mov ax, LITE_MODE_RAMVARS_SEGMENT … … 56 45 mov al, [cs:ROMVARS.bStealSize] 57 46 sub [BDA.wBaseMem], ax 58 mov ax, [BDA.wBaseMem]59 47 %ifdef USE_186 60 shl ax, 6 ; Segment to first stolen kB (*=40h)48 imul ax, [BDA.wBaseMem], 64 61 49 %else 62 mov cl, 663 shl ax, cl50 mov al, 64 51 mul WORD [BDA.wBaseMem] 64 52 %endif 65 ; Fall to .InitializeRamvars66 53 67 ;--------------------------------------------------------------------68 ; .InitializeRamvars69 ; Parameters:70 ; AX: RAMVARS segment71 ; Returns:72 ; DS: RAMVARS segment73 ; Corrupts registers:74 ; AX, CX, DI, ES75 ;--------------------------------------------------------------------76 54 .InitializeRamvars: 55 xor di, di 77 56 mov ds, ax 78 57 mov es, ax 79 58 mov cx, RAMVARS_size 80 xor di, di81 59 call Memory_ZeroESDIwithSizeInCX 82 60 mov WORD [RAMVARS.wDrvDetectSignature], RAMVARS_DRV_DETECT_SIGNATURE … … 121 99 .GetStolenSegmentToDS: 122 100 LOAD_BDA_SEGMENT_TO ds, di 101 ;%ifdef USE_186 102 ; imul di, [BDA.wBaseMem], 64 ; 2 bytes less but slower, especially on 386/486 processors 103 ;%else 123 104 mov di, [BDA.wBaseMem] ; Load available base memory size in kB 124 105 eSHL_IM di, 6 ; Segment to first stolen kB (*=40h) 106 ;%endif 125 107 ALIGN JUMP_ALIGN 126 108 .LoopStolenKBs: -
trunk/XTIDE_Universal_BIOS/makefile
r589 r592 41 41 # USE_AT Use features supported on AT and later systems (not available on XT) # 42 42 # USE_UNDOC_INTEL Optimizations for Intel CPU:s - do NOT use on NEC V20/V30/Sony CPU:s # 43 # CLD_NEEDED Only needed for compatibility with buggy software/BIOSes # 43 44 # # 44 45 # ** AT Builds only (when USE_AT is defined) # … … 103 104 # Assembler preprocessor defines. # 104 105 ################################################################# 105 DEFINES_COMMON = MODULE_STRINGS_COMPRESSED MODULE_HOTKEYS MODULE_8BIT_IDE MODULE_EBIOS MODULE_SERIAL MODULE_SERIAL_FLOPPY MODULE_POWER_MANAGEMENT RESERVE_DIAGNOSTIC_CYLINDER NO_ATAID_VALIDATION 106 DEFINES_COMMON = MODULE_STRINGS_COMPRESSED MODULE_HOTKEYS MODULE_8BIT_IDE MODULE_EBIOS MODULE_SERIAL MODULE_SERIAL_FLOPPY MODULE_POWER_MANAGEMENT RESERVE_DIAGNOSTIC_CYLINDER NO_ATAID_VALIDATION CLD_NEEDED 106 107 DEFINES_COMMON_LARGE = MODULE_BOOT_MENU MODULE_8BIT_IDE_ADVANCED MODULE_COMPATIBLE_TABLES 107 108 … … 114 115 DEFINES_AT_LARGE = $(DEFINES_AT) $(DEFINES_COMMON_LARGE) 115 116 116 DEFINES_XT_TINY = MODULE_STRINGS_COMPRESSED MODULE_8BIT_IDE NO_ATAID_VALIDATION 117 DEFINES_XT_TINY = MODULE_STRINGS_COMPRESSED MODULE_8BIT_IDE NO_ATAID_VALIDATION CLD_NEEDED 117 118 DEFINES_386_8K = $(DEFINES_AT) USE_386 MODULE_ADVANCED_ATA 118 119 … … 125 126 ################### 126 127 127 # Target size of the ROM, used in main.asm for number of 512B blocks and by checksum Perl script below128 BIOS_SIZE = 8192 # For BIOS header (use even multiplier!) 129 ROMSIZE = $(BIOS_SIZE) # Size of binary to build when building with make checksum 130 BIOS_SIZE_ LARGE = 12288131 ROMSIZE_LARGE = $(BIOS_SIZE_LARGE) 128 # Target size of the BIOS, used in main.asm for number of 512B blocks (CNT_ROM_BLOCKS) and by checksum Perl script below ('make checksum'). 129 # Note! The size must be a multiple of 2 KB for compatibility reasons. 130 BIOS_SIZE_TINY = 4096 131 BIOS_SIZE_SMALL = 8192 132 BIOS_SIZE_LARGE = 10240 132 133 133 134 # Add -D in front of every preprocessor define declaration 134 DEFS_XT = $(DEFINES_XT:%=-D%) -DBIOS_SIZE=$(BIOS_SIZE )135 DEFS_XTPLUS = $(DEFINES_XTPLUS:%=-D%) -DBIOS_SIZE=$(BIOS_SIZE )136 DEFS_AT = $(DEFINES_AT:%=-D%) -DBIOS_SIZE=$(BIOS_SIZE )135 DEFS_XT = $(DEFINES_XT:%=-D%) -DBIOS_SIZE=$(BIOS_SIZE_SMALL) 136 DEFS_XTPLUS = $(DEFINES_XTPLUS:%=-D%) -DBIOS_SIZE=$(BIOS_SIZE_SMALL) 137 DEFS_AT = $(DEFINES_AT:%=-D%) -DBIOS_SIZE=$(BIOS_SIZE_SMALL) 137 138 DEFS_XT_LARGE = $(DEFINES_XT_LARGE:%=-D%) -DBIOS_SIZE=$(BIOS_SIZE_LARGE) 138 139 DEFS_XTPLUS_LARGE = $(DEFINES_XTPLUS_LARGE:%=-D%) -DBIOS_SIZE=$(BIOS_SIZE_LARGE) 139 140 DEFS_AT_LARGE = $(DEFINES_AT_LARGE:%=-D%) -DBIOS_SIZE=$(BIOS_SIZE_LARGE) 140 DEFS_XT_TINY = $(DEFINES_XT_TINY:%=-D%) -DBIOS_SIZE=$(BIOS_SIZE )141 DEFS_386_8K = $(DEFINES_386_8K:%=-D%) -DBIOS_SIZE=$(BIOS_SIZE )141 DEFS_XT_TINY = $(DEFINES_XT_TINY:%=-D%) -DBIOS_SIZE=$(BIOS_SIZE_TINY) 142 DEFS_386_8K = $(DEFINES_386_8K:%=-D%) -DBIOS_SIZE=$(BIOS_SIZE_SMALL) 142 143 DEFS_ALL_FEATURES = $(DEFINES_ALL_FEATURES:%=-D%) 143 144 … … 220 221 strings: src\Strings.asm 221 222 @$(AS) src\Strings.asm $(ASFLAGS) $(DEFS_AT_LARGE) -DCHECK_FOR_UNUSED_ENTRYPOINTS -DMODULE_STRINGS_COMPRESSED_PRECOMPRESS -o build\Strings.bin -l build\StringsPrecompress.lst 222 @perl ..\ tools\StringsCompress.pl < build\StringsPrecompress.lst > src\StringsCompressed.asm223 @perl ..\Tools\StringsCompress.pl < build\StringsPrecompress.lst > src\StringsCompressed.asm 223 224 @echo StringsCompressed.asm updated! 224 225 … … 228 229 229 230 checksum: all 230 @perl ..\ tools\checksum.pl $(TARGET)_tiny.bin $(ROMSIZE)231 @perl ..\ tools\checksum.pl $(TARGET)_xt.bin $(ROMSIZE)232 @perl ..\ tools\checksum.pl $(TARGET)_xtp.bin $(ROMSIZE)233 @perl ..\ tools\checksum.pl $(TARGET)_at.bin $(ROMSIZE)234 @perl ..\ tools\checksum.pl $(TARGET)_xtl.bin $(ROMSIZE_LARGE)235 @perl ..\ tools\checksum.pl $(TARGET)_xtpl.bin $(ROMSIZE_LARGE)236 @perl ..\ tools\checksum.pl $(TARGET)_atl.bin $(ROMSIZE_LARGE)237 @perl ..\ tools\checksum.pl $(TARGET)_386.bin $(ROMSIZE)231 @perl ..\Tools\checksum.pl $(TARGET)_tiny.bin $(BIOS_SIZE_TINY) 232 @perl ..\Tools\checksum.pl $(TARGET)_xt.bin $(BIOS_SIZE_SMALL) 233 @perl ..\Tools\checksum.pl $(TARGET)_xtp.bin $(BIOS_SIZE_SMALL) 234 @perl ..\Tools\checksum.pl $(TARGET)_at.bin $(BIOS_SIZE_SMALL) 235 @perl ..\Tools\checksum.pl $(TARGET)_xtl.bin $(BIOS_SIZE_LARGE) 236 @perl ..\Tools\checksum.pl $(TARGET)_xtpl.bin $(BIOS_SIZE_LARGE) 237 @perl ..\Tools\checksum.pl $(TARGET)_atl.bin $(BIOS_SIZE_LARGE) 238 @perl ..\Tools\checksum.pl $(TARGET)_386.bin $(BIOS_SIZE_SMALL) 238 239 239 240 unused: … … 241 242 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_ALL_FEATURES) $(DEFS_XT) $(DEFS_XT_PLUS) $(DEFS_AT) $(DEFS_XT_LARGE) $(DEFS_XTPLUS_LARGE) $(DEFS_AT_LARGE) $(DEFS_XT_TINY) $(DEFS_386_8K) -o"$(TARGET)_unused.asm" -l"$(TARGET)_unused.lst" 242 243 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_ALL_FEATURES) $(DEFS_XT) $(DEFS_XT_PLUS) $(DEFS_AT) $(DEFS_XT_LARGE) $(DEFS_XTPLUS_LARGE) $(DEFS_AT_LARGE) $(DEFS_XT_TINY) $(DEFS_386_8K) -o"$(TARGET)_unused.asm" -E -DCHECK_FOR_UNUSED_ENTRYPOINTS 243 @perl ..\ tools\unused.pl $(TARGET)_unused.lst $(TARGET)_unused.asm244 @perl ..\Tools\unused.pl $(TARGET)_unused.lst $(TARGET)_unused.asm 244 245 @echo "XT Small" 245 246 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XT) -o"$(TARGET)_unused_xt.asm" -l"$(TARGET)_unused_xt.lst" 246 247 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XT) -o"$(TARGET)_unused_xt.asm" -E -DCHECK_FOR_UNUSED_ENTRYPOINTS 247 @perl ..\ tools\unused.pl $(TARGET)_unused_xt.lst $(TARGET)_unused_xt.asm248 @perl ..\Tools\unused.pl $(TARGET)_unused_xt.lst $(TARGET)_unused_xt.asm 248 249 @echo "XT Large" 249 250 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XT_LARGE) -o"$(TARGET)_unused_xtl.asm" -l"$(TARGET)_unused_xtl.lst" 250 251 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XT_LARGE) -o"$(TARGET)_unused_xtl.asm" -E -DCHECK_FOR_UNUSED_ENTRYPOINTS 251 @perl ..\ tools\unused.pl $(TARGET)_unused_xtl.lst $(TARGET)_unused_xtl.asm252 @perl ..\Tools\unused.pl $(TARGET)_unused_xtl.lst $(TARGET)_unused_xtl.asm 252 253 @echo "AT Small" 253 254 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_AT) -o"$(TARGET)_unused_at.asm" -l"$(TARGET)_unused_at.lst" 254 255 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_AT) -o"$(TARGET)_unused_at.asm" -E -DCHECK_FOR_UNUSED_ENTRYPOINTS 255 @perl ..\ tools\unused.pl $(TARGET)_unused_at.lst $(TARGET)_unused_at.asm256 @perl ..\Tools\unused.pl $(TARGET)_unused_at.lst $(TARGET)_unused_at.asm 256 257 @echo "AT Large" 257 258 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_AT_LARGE) -o"$(TARGET)_unused_atl.asm" -l"$(TARGET)_unused_atl.lst" 258 259 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_AT_LARGE) -o"$(TARGET)_unused_atl.asm" -E -DCHECK_FOR_UNUSED_ENTRYPOINTS 259 @perl ..\ tools\unused.pl $(TARGET)_unused_atl.lst $(TARGET)_unused_atl.asm260 261 260 @perl ..\Tools\unused.pl $(TARGET)_unused_atl.lst $(TARGET)_unused_atl.asm 261 262 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Variables.inc
r583 r592 34 34 struc CFGVARS 35 35 .pMenupage resb 2 ; Offset to MENUPAGE to display 36 .wFlags resb 2 ; Program flags 36 .wFlags resb 2 ; Program flags - Only the low byte is used currently and code depend on this 37 37 .wImageSizeInWords resb 2 ; Size in words for loaded ROM or FILE 38 38 .wEepromSegment resb 2 ; Segment where EEPROM is located … … 44 44 endstruc 45 45 46 ; Bit defines for CFGVARS.wFlags 46 ; Bit defines for CFGVARS.wFlags (changes here might require changes elsewhere) 47 47 FLG_CFGVARS_FILELOADED EQU (1<<0) ; BIOS is loaded from file 48 48 FLG_CFGVARS_ROMLOADED EQU (1<<1) ; BIOS is loaded from EEPROM -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/AutoConfigure.asm
r526 r592 43 43 call ResetIdevarsToDefaultValues 44 44 call DetectIdePortsAndDevices 45 call EnableInterruptsFor PrimaryAndSecondaryControllers45 call EnableInterruptsForAllStandardControllers 46 46 call StoreAndDisplayNumberOfControllers 47 47 … … 55 55 ; Parameters: 56 56 ; DS:DI: Ptr to ROMVARS 57 ; ES:DI: Ptr to ROMVARS 57 58 ; Returns: 58 59 ; Nothing … … 123 124 124 125 ;-------------------------------------------------------------------- 125 ; EnableInterruptsFor PrimaryAndSecondaryControllers126 ; EnableInterruptsForAllStandardControllers 126 127 ; Parameters: 127 128 ; DS:DI: Ptr to ROMVARS … … 130 131 ; Nothing 131 132 ; Corrupts registers: 132 ; AX , ES133 ;-------------------------------------------------------------------- 134 ALIGN JUMP_ALIGN 135 EnableInterruptsFor PrimaryAndSecondaryControllers:133 ; AX 134 ;-------------------------------------------------------------------- 135 ALIGN JUMP_ALIGN 136 EnableInterruptsForAllStandardControllers: 136 137 jcxz .NoControllersDetected 137 138 call Buffers_IsXTbuildLoaded … … 148 149 inc ax ; 15 149 150 cmp WORD [di+IDEVARS.wBasePort], DEVICE_ATA_SECONDARY_PORT 151 152 %if 0 153 je SHORT .EnableIrqAL 154 155 ; Defaults on the GSI Inc. Model 2C EIDE controller 156 mov al, 11 157 cmp WORD [di+IDEVARS.wBasePort], DEVICE_ATA_TERTIARY_PORT 158 je SHORT .EnableIrqAL 159 160 dec ax ; 10 161 cmp WORD [di+IDEVARS.wBasePort], DEVICE_ATA_QUATERNARY_PORT 162 %endif 163 150 164 jne SHORT .DoNotEnableIRQ 151 165 … … 153 167 mov [di+IDEVARS.bIRQ], al 154 168 .DoNotEnableIRQ: 169 add di, IDEVARS_size 155 170 loop .CheckNextController 156 171 pop cx -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/BiosFile.asm
r589 r592 44 44 call FileIO_CloseUsingHandleFromBX 45 45 call DisplayFileLoadedSuccessfully 46 jmp SHORT .Return 46 pop ds 47 ret 47 48 48 49 .DisplayErrorMessage: 49 50 call FileIO_CloseUsingHandleFromBX 50 51 call DisplayFailedToLoadFile 51 ALIGN JUMP_ALIGN52 .Return:53 52 pop ds 54 53 ret … … 117 116 pop es 118 117 mov di, g_cfgVars+CFGVARS.szOpenedFile 118 %ifdef CLD_NEEDED 119 119 cld 120 %endif 120 121 call String_CopyDSSItoESDIandGetLengthToCX 121 122 clc -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Buffers.asm
r589 r592 49 49 ALIGN JUMP_ALIGN 50 50 Buffers_IsXtideUniversalBiosLoaded: 51 test WORD[cs:g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_FILELOADED | FLG_CFGVARS_ROMLOADED51 test BYTE [cs:g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_FILELOADED | FLG_CFGVARS_ROMLOADED 52 52 jnz SHORT .FileOrBiosLoaded 53 or cl, 1; Clear ZF53 test sp, sp ; Clear ZF 54 54 ret 55 55 … … 76 76 add di, BYTE ROMVARS.rgbSign 77 77 mov cx, XTIDE_SIGNATURE_LENGTH / 2 78 %ifdef CLD_NEEDED 78 79 cld 80 %endif 79 81 eSEG_STR repe, cs, cmpsw 80 82 … … 91 93 ; Cleared if some other (AT, 386) build is loaded 92 94 ; Corrupts registers: 93 ; DI, ES95 ; Nothing 94 96 ;-------------------------------------------------------------------- 95 97 ALIGN JUMP_ALIGN 96 98 Buffers_IsXTbuildLoaded: 97 99 %strlen BUILD_TYPE_OFFSET TITLE_STRING_START 100 push es 101 push di 98 102 call Buffers_GetFileBufferToESDI 99 103 cmp WORD [es:di+ROMVARS.szTitle+BUILD_TYPE_OFFSET+1], 'XT' ; +1 is for '(' 104 pop di 105 pop es 100 106 ret 101 107 %undef BUILD_TYPE_OFFSET … … 105 111 ; Buffers_NewBiosWithSizeInDXCXandSourceInAXhasBeenLoadedForConfiguration 106 112 ; Parameters: 107 ; A X: EEPROM source (FLG_CFGVARS_FILELOADED or FLG_CFGVARS_ROMLOADED)113 ; AL: EEPROM source (FLG_CFGVARS_FILELOADED or FLG_CFGVARS_ROMLOADED) 108 114 ; DX:CX: EEPROM size in bytes 109 115 ; Returns: 110 116 ; Nothing 111 117 ; Corrupts registers: 112 ; AX,CX, DX118 ; CX, DX 113 119 ;-------------------------------------------------------------------- 114 120 ALIGN JUMP_ALIGN 115 121 Buffers_NewBiosWithSizeInDXCXandSourceInAXhasBeenLoadedForConfiguration: 116 and WORD[cs:g_cfgVars+CFGVARS.wFlags], ~(FLG_CFGVARS_FILELOADED | FLG_CFGVARS_ROMLOADED | FLG_CFGVARS_UNSAVED)117 or WORD [cs:g_cfgVars+CFGVARS.wFlags], ax122 and BYTE [cs:g_cfgVars+CFGVARS.wFlags], ~(FLG_CFGVARS_FILELOADED | FLG_CFGVARS_ROMLOADED | FLG_CFGVARS_UNSAVED) 123 or [cs:g_cfgVars+CFGVARS.wFlags], al 118 124 shr dx, 1 119 125 rcr cx, 1 … … 135 141 ALIGN JUMP_ALIGN 136 142 Buffers_SetUnsavedChanges: 137 or WORD[cs:g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_UNSAVED143 or BYTE [cs:g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_UNSAVED 138 144 ret 139 145 140 146 ALIGN JUMP_ALIGN 141 147 Buffers_ClearUnsavedChanges: 142 and WORD[cs:g_cfgVars+CFGVARS.wFlags], ~FLG_CFGVARS_UNSAVED148 and BYTE [cs:g_cfgVars+CFGVARS.wFlags], ~FLG_CFGVARS_UNSAVED 143 149 ret 144 150 … … 155 161 ALIGN JUMP_ALIGN 156 162 Buffers_SaveChangesIfFileLoaded: 157 mov ax, [cs:g_cfgVars+CFGVARS.wFlags] 158 and ax, BYTE (FLG_CFGVARS_FILELOADED | FLG_CFGVARS_UNSAVED) 159 cmp ax, BYTE (FLG_CFGVARS_FILELOADED | FLG_CFGVARS_UNSAVED) 160 jne SHORT .NothingToSave 161 call Dialogs_DisplaySaveChangesDialog 163 mov al, [cs:g_cfgVars+CFGVARS.wFlags] 164 and al, FLG_CFGVARS_FILELOADED | FLG_CFGVARS_UNSAVED 165 jz SHORT .NothingToSave 166 jpo SHORT .NothingToSave 167 mov bx, g_szDlgSaveChanges 168 call Dialogs_DisplayYesNoResponseDialogWithTitleStringInBX 162 169 jnz SHORT .NothingToSave 163 170 jmp BiosFile_SaveUnsavedChanges … … 181 188 182 189 eMOVZX di, [cs:g_cfgVars+CFGVARS.bEepromType] 183 mov cx, [cs:di+g_rgwEepromTypeToSizeInWords] 190 ;%if g_rgwEepromTypeToSizeInWords = 0 ; *FIXME* It really is but NASM won't accept this. 191 mov cx, [cs:di] 192 ;%else 193 ; mov cx, [cs:di+g_rgwEepromTypeToSizeInWords] 194 ;%endif 184 195 sub cx, [cs:g_cfgVars+CFGVARS.wImageSizeInWords] ; CX = WORDs to append 185 196 jbe SHORT .NoNeedToAppendZeroes … … 187 198 call Buffers_GetFileBufferToESDI 188 199 mov ax, [cs:g_cfgVars+CFGVARS.wImageSizeInWords] 189 shlax, 1200 eSHL_IM ax, 1 190 201 add di, ax ; ES:DI now point first unused image byte 191 202 xor ax, ax 203 %ifdef CLD_NEEDED 192 204 cld 205 %endif 193 206 rep stosw 194 207 ALIGN JUMP_ALIGN … … 214 227 call Buffers_GetFileBufferToESDI 215 228 call EEPROM_GetXtideUniversalBiosSizeFromESDItoDXCX 229 %ifdef CLD_NEEDED 230 cld 231 %endif 216 232 217 233 ; Compatibility fix for 3Com 3C503 cards where the ASIC returns 8080h as the last two bytes of the ROM. … … 223 239 jne SHORT .BiosSizeIsNot8K 224 240 ; The BIOS size is 8K and therefore a potential candidate for a 3Com 3C503 card. 225 dec cx 226 dec cx 241 mov cl, (8192 - 3) & 0FFh 227 242 mov ah, 3 228 243 ALIGN JUMP_ALIGN … … 230 245 .SumNextByte: 231 246 add al, [es:di] 232 .NextChecksumByte:233 247 inc di 234 248 loop .SumNextByte 249 .NextChecksumByte: 235 250 neg al 236 mov [es:di], al 237 inc cx 251 stosb 238 252 dec ah 239 253 jnz SHORT .NextChecksumByte … … 306 320 307 321 ;-------------------------------------------------------------------- 308 ; Buffers_GetFileBufferToESDI309 322 ; Buffers_GetFlashComparisonBufferToESDI 310 323 ; Buffers_GetFileDialogItemBufferToESDI 324 ; Buffers_GetFileBufferToESDI 311 325 ; Parameters: 312 326 ; Nothing … … 320 334 Buffers_GetFileDialogItemBufferToESDI: 321 335 call Buffers_GetFileBufferToESDI 322 push di323 336 mov di, es 324 add di, 1000h ; Third 64k page 325 mov es, di 326 pop di 327 ret 328 ALIGN JUMP_ALIGN 337 SKIP2B f 329 338 Buffers_GetFileBufferToESDI: 330 339 mov di, cs -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Dialogs.asm
r526 r592 41 41 mov cx, DIALOG_INPUT_size 42 42 call Memory_ReserveCXbytesFromStackToDSSI 43 call InitializeDialogInputFromDSSI44 43 mov [si+DIALOG_INPUT.fszTitle], di 45 44 jmp SHORT DisplayMessageDialogWithMessageInCSDXandDialogInputInDSSI … … 65 64 mov cx, DIALOG_INPUT_size 66 65 call Memory_ReserveCXbytesFromStackToDSSI 67 call InitializeDialogInputFromDSSI68 66 mov WORD [si+DIALOG_INPUT.fszTitle], g_szNotificationDialog 69 67 jmp SHORT DisplayMessageDialogWithMessageInCSDXandDialogInputInDSSI … … 123 121 124 122 ;-------------------------------------------------------------------- 125 ; Dialogs_DisplayQuitDialog 126 ; Dialogs_DisplaySaveChangesDialog 123 ; Dialogs_DisplayYesNoResponseDialogWithTitleStringInBX 127 124 ; Parameters: 125 ; BX: Offset to dialog title string 128 126 ; SS:BP: Menu handle 129 127 ; Returns: … … 134 132 ;-------------------------------------------------------------------- 135 133 ALIGN JUMP_ALIGN 136 Dialogs_Display QuitDialog:134 Dialogs_DisplayYesNoResponseDialogWithTitleStringInBX: 137 135 push ds 138 136 … … 140 138 call Memory_ReserveCXbytesFromStackToDSSI 141 139 call InitializeDialogInputFromDSSI 142 mov WORD [si+DIALOG_INPUT.fszTitle], g_szDlgExitToDos 143 jmp Dialogs_DisplayQuitAndSaveChangesDialogsSharedEnding 144 145 146 ALIGN JUMP_ALIGN 147 Dialogs_DisplaySaveChangesDialog: 148 push ds 149 150 mov cx, DIALOG_INPUT_size 151 call Memory_ReserveCXbytesFromStackToDSSI 152 call InitializeDialogInputFromDSSI 153 mov WORD [si+DIALOG_INPUT.fszTitle], g_szDlgSaveChanges 154 Dialogs_DisplayQuitAndSaveChangesDialogsSharedEnding: 140 mov [si+DIALOG_INPUT.fszTitle], bx 155 141 mov WORD [si+DIALOG_INPUT.fszItems], g_szMultichoiceBooleanFlag 156 142 CALL_MENU_LIBRARY GetSelectionToAXwithInputInDSSI 157 143 add sp, BYTE DIALOG_INPUT_size 158 cmp ax, BYTE 1 ; 1= YES144 dec ax ; -1 = NO, 0 = YES 159 145 160 146 pop ds -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/EEPROM.asm
r589 r592 50 50 ; DX:CX: BIOS size in bytes 51 51 ; Corrupts registers: 52 ; AX,BX, SI, DI52 ; BX, SI, DI 53 53 ;-------------------------------------------------------------------- 54 54 ALIGN JUMP_ALIGN … … 61 61 call LoadBytesFromRomToRamBuffer 62 62 63 call EEPROM_GetXtideUniversalBiosSizeFromESDItoDXCX64 63 pop es 65 64 ret … … 90 89 ; Nothing 91 90 ; Returns: 92 ; CF: Setif EEPROM was found93 ; Clearedif EEPROM not found94 ; Corrupts registers: 95 ; AX, BX, CX, SI, DI91 ; CF: Cleared if EEPROM was found 92 ; Set if EEPROM not found 93 ; Corrupts registers: 94 ; BX, CX, SI 96 95 ;-------------------------------------------------------------------- 97 96 ALIGN JUMP_ALIGN … … 107 106 ; SI: Offset to first byte to load 108 107 ; Returns: 109 ; CF: Setif EEPROM was found110 ; Clearedif EEPROM not found111 ; Corrupts registers: 112 ; AX, BX, CX, SI108 ; CF: Cleared if EEPROM was found 109 ; Set if EEPROM not found 110 ; Corrupts registers: 111 ; BX, SI 113 112 ;-------------------------------------------------------------------- 114 113 ALIGN JUMP_ALIGN … … 119 118 120 119 call EEPROM_FindXtideUniversalBiosROMtoESDI 121 j nc SHORT .XtideUniversalBiosNotFound120 jc SHORT .XtideUniversalBiosNotFound 122 121 push es 123 122 pop ds ; DS:SI points to ROM … … 126 125 mov di, si ; ES:DI points to RAM buffer 127 126 127 %ifdef CLD_NEEDED 128 128 cld 129 call Memory_CopyCXbytesFromDSSItoESDI 130 stc129 %endif 130 call Memory_CopyCXbytesFromDSSItoESDI ; Clears CF 131 131 132 132 .XtideUniversalBiosNotFound: … … 143 143 ; Returns: 144 144 ; ES:DI: EEPROM segment 145 ; CF: Setif EEPROM was found146 ; Clearedif EEPROM not found147 ; Corrupts registers: 148 ; AX,BX145 ; CF: Cleared if EEPROM was found 146 ; Set if EEPROM not found 147 ; Corrupts registers: 148 ; BX 149 149 ;-------------------------------------------------------------------- 150 150 ALIGN JUMP_ALIGN … … 159 159 mov es, bx ; Possible ROM segment to ES 160 160 call Buffers_IsXtideUniversalBiosSignatureInESDI 161 je SHORT .RomFound 161 je SHORT .RomFound ; If equal, CF=0 162 162 add bx, 80h ; Increment by 2kB (minimum possible distance from the beginning of one option ROM to the next) 163 163 jnc SHORT .SegmentLoop ; Loop until segment overflows 164 clc165 jmp SHORT .ReturnWithoutUpdatingCF166 ALIGN JUMP_ALIGN167 164 .RomFound: 168 stc169 .ReturnWithoutUpdatingCF:170 165 pop cx 171 166 pop si … … 191 186 call Buffers_GetFlashComparisonBufferToESDI 192 187 eMOVZX bx, [cs:g_cfgVars+CFGVARS.bEepromType] 193 mov cx, [cs:bx+g_rgwEepromTypeToSizeInWords] 188 %ifdef CLD_NEEDED 194 189 cld 190 %endif 191 ;%if g_rgwEepromTypeToSizeInWords = 0 ; *FIXME* It really is but NASM won't accept this. 192 mov cx, [cs:bx] 193 ;%else 194 ; mov cx, [cs:bx+g_rgwEepromTypeToSizeInWords] 195 ;%endif 195 196 rep movsw 196 197 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Flash.asm
r568 r592 78 78 ALIGN JUMP_ALIGN 79 79 Flash_SinglePageWithFlashvarsInSSBP: 80 %ifdef CLD_NEEDED 80 81 cld 82 %endif 81 83 call AreSourceAndDestinationPagesEqualFromFlashvarsInSSBP 82 84 je SHORT .NoNeedToFlashThePage ; CF cleared … … 305 307 ALIGN JUMP_ALIGN 306 308 WaitUntilEepromPageWriteHasCompleted: 307 call .InitializeTimeoutCounterForEepromPollingWithFlashvarsInSSBP308 mov es, [bp+FLASHVARS.fpNextDestinationPage+2]309 mov di, [bp+FLASHVARS.wLastOffsetWritten]310 ALIGN JUMP_ALIGN311 .PollEeprom:312 call .HasWriteCycleCompleted313 je SHORT .PageWriteCompleted ; CF cleared314 call TimerTicks_GetTimeoutTicksLeftToAXfromDSBX315 jnc SHORT .PollEeprom316 ALIGN JUMP_ALIGN317 .PageWriteCompleted:318 ret319 320 ;--------------------------------------------------------------------321 ; .InitializeTimeoutCounterForEepromPollingWithFlashvarsInSSBP322 ; Parameters:323 ; SS:BP: Ptr to FLASHVARS324 ; Returns:325 ; DS:BX: Ptr to timeout counter variable326 ; Corrupts registers:327 ; AX328 ;--------------------------------------------------------------------329 ALIGN JUMP_ALIGN330 .InitializeTimeoutCounterForEepromPollingWithFlashvarsInSSBP:331 309 push ss 332 310 pop ds 333 311 lea bx, [bp+FLASHVARS.wTimeoutCounter] 334 312 mov ax, EEPROM_POLLING_TIMEOUT_TICKS 335 jmp TimerTicks_InitializeTimeoutFromAX 336 337 ;-------------------------------------------------------------------- 338 ; .HasWriteCycleCompleted 339 ; Parameters: 340 ; ES:DI: Ptr to last written byte in EEPROM 341 ; SS:BP: Ptr to FLASHVARS 342 ; Returns: 343 ; ZF: Set if write cycle has completed 344 ; Cleared if write cycle in progress 345 ; Corrupts registers: 346 ; AX 347 ;-------------------------------------------------------------------- 348 ALIGN JUMP_ALIGN 349 .HasWriteCycleCompleted: 350 mov ah, [es:di] ; Load byte from EEPROM 351 mov al, [bp+FLASHVARS.bLastByteWritten] 352 and ax, 8080h ; Clear all but bit 7 from both bytes 353 cmp al, ah ; Set ZF if high bits are the same 354 ret 355 313 call TimerTicks_InitializeTimeoutFromAX 314 mov es, [bp+FLASHVARS.fpNextDestinationPage+2] 315 mov di, [bp+FLASHVARS.wLastOffsetWritten] 316 ALIGN JUMP_ALIGN 317 .PollEeprom: 318 mov al, [es:di] ; Load byte from EEPROM 319 xor al, [bp+FLASHVARS.bLastByteWritten] ; Clear SF if the most significant bits are the same 320 jns SHORT .PageWriteCompleted ; With CF cleared 321 call TimerTicks_GetTimeoutTicksLeftToAXfromDSBX 322 jnc SHORT .PollEeprom 323 ALIGN JUMP_ALIGN, ret 324 .PageWriteCompleted: 325 ret 356 326 357 327 ;-------------------------------------------------------------------- -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/IdeAutodetect.asm
r589 r592 118 118 ; example Promise FloppyMAX has Control Block at STANDARD_CONTROL_BLOCK_OFFSET but Sound Blaster 16 (CT2290) 119 119 ; use DEVICE_ATA_SECONDARY_PORTCTRL for Tertiary and Quaternary even though only Secondary should use that. 120 call Change DifferentControlBlockAddressToSI121 j eSHORT .RedetectTertiaryOrQuaternaryWithDifferentControlBlockAddress120 call ChangeControlBlockAddressInSI 121 jz SHORT .RedetectTertiaryOrQuaternaryWithDifferentControlBlockAddress 122 122 123 123 … … 130 130 mov si, dx 131 131 add si, BYTE XTCF_CONTROL_BLOCK_OFFSET 132 shlbx, 1 ; SHL 1 register offsets for XT-CF132 eSHL_IM bx, 1 ; SHL 1 register offsets for XT-CF 133 133 call DetectIdeDeviceFromPortsDXandSIwithOffsetsInBLandBH 134 134 mov al, DEVICE_8BIT_XTCF_PIO8 … … 233 233 234 234 ;-------------------------------------------------------------------- 235 ; Change DifferentControlBlockAddressToSI235 ; ChangeControlBlockAddressInSI 236 236 ; Parameters: 237 237 ; DX: IDE Base Port address … … 241 241 ; Cleared if different control block address is not possible 242 242 ; Corrupts registers: 243 ; AH244 ;-------------------------------------------------------------------- 245 Change DifferentControlBlockAddressToSI:243 ; Nothing 244 ;-------------------------------------------------------------------- 245 ChangeControlBlockAddressInSI: 246 246 cmp si, 368h 247 247 je SHORT .TrySecondAlternative … … 252 252 je SHORT .TryLastAlternative 253 253 cmp si, 3E0h 254 je SHORT .TryLastAlternative 255 ret ; Return with ZF cleared 254 jne SHORT .Return ; With ZF cleared 256 255 257 256 .TryLastAlternative: … … 260 259 .TrySecondAlternative: 261 260 sub si, BYTE 8h ; 368h to 360h, 3E8h to 3E0h 262 xor ah, ah ; Set ZF 261 cmp sp, sp ; Set ZF 262 .Return: 263 263 ret 264 264 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Main.asm
r589 r592 132 132 call Buffers_Clear 133 133 call EEPROM_FindXtideUniversalBiosROMtoESDI 134 j nc SHORT .InitializationCompleted134 jc SHORT .InitializationCompleted 135 135 mov [CFGVARS.wEepromSegment], es 136 136 .InitializationCompleted: -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/MenuEvents.asm
r526 r592 84 84 pop ds 85 85 86 mov WORD [si+MENUINIT.wItems], ax 87 mov WORD [si+MENUINIT.bTitleLines], TITLE_LINES_IN_MENU 88 mov WORD [si+MENUINIT.bInfoLines], INFO_LINES_IN_MENU 86 mov [si+MENUINIT.wItems], ax 87 mov WORD [si+MENUINIT.wTitleAndInfoLines], INFO_LINES_IN_MENU << 8 | TITLE_LINES_IN_MENU 89 88 mov BYTE [si+MENUINIT.bWidth], MENU_WIDTH 90 89 CALL_DISPLAY_LIBRARY GetColumnsToALandRowsToAH … … 112 111 ALIGN JUMP_ALIGN 113 112 .QuitProgram: 114 call Dialogs_DisplayQuitDialog 113 mov bx, g_szDlgExitToDos 114 call Dialogs_DisplayYesNoResponseDialogWithTitleStringInBX 115 115 jz SHORT .ExitToDOS 116 116 clc … … 169 169 ALIGN JUMP_ALIGN 170 170 .RefreshItemFromCX: 171 cmp cx, NO_ITEM_HIGHLIGHTED 172 je SHORT .NothingToRefresh 171 inc cx ; NO_ITEM_HIGHLIGHTED ? 172 jz SHORT .NothingToRefresh 173 dec cx 173 174 call Menupage_GetActiveMenupageToDSDI 174 175 call Menupage_GetCXthVisibleMenuitemToDSSIfromDSDI … … 185 186 ALIGN JUMP_ALIGN 186 187 .RefreshInformation: 187 cmp cx, NO_ITEM_HIGHLIGHTED 188 je SHORT .NothingToRefresh 188 inc cx ; NO_ITEM_HIGHLIGHTED ? 189 jz SHORT .NothingToRefresh 190 dec cx 189 191 call Menupage_GetActiveMenupageToDSDI 190 192 call Menupage_GetCXthVisibleMenuitemToDSSIfromDSDI … … 213 215 ALIGN JUMP_ALIGN 214 216 .PrintLoadStatus: 215 mov a x, [g_cfgVars+CFGVARS.wFlags]216 test a x, FLG_CFGVARS_FILELOADED217 mov al, [g_cfgVars+CFGVARS.wFlags] 218 test al, FLG_CFGVARS_FILELOADED 217 219 jnz SHORT .PrintNameOfLoadedFile 218 test a x, FLG_CFGVARS_ROMLOADED220 test al, FLG_CFGVARS_ROMLOADED 219 221 mov si, g_szEEPROM 220 222 jnz SHORT .PrintNameOfLoadedFileOrEeprom … … 253 255 ALIGN JUMP_ALIGN 254 256 .PrintStatusOfUnsavedChanges: 255 test WORD[g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_UNSAVED257 test BYTE [g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_UNSAVED 256 258 jz SHORT .ReturnSinceNothingToPrint 257 259 mov si, g_szUnsaved -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menuitem.asm
r567 r592 53 53 call Memory_ReserveCXbytesFromStackToDSSI 54 54 call InitializeDialogInputInDSSIfromMenuitemInESDI 55 mov ax, [es:di+MENUITEM.itemValue +ITEM_VALUE.szMultichoice]55 mov ax, [es:di+MENUITEM.itemValue+ITEM_VALUE.szMultichoice] 56 56 mov [si+DIALOG_INPUT.fszItems], ax 57 57 push di … … 59 59 pop di 60 60 61 cmp ax, BYTE NO_ITEM_SELECTED 62 je SHORT .NothingToChange 61 inc ax ; NO_ITEM_SELECTED ? 62 jz SHORT .NothingToChange 63 dec ax 63 64 call Registers_CopyESDItoDSSI 64 65 call Menuitem_StoreValueFromAXtoMenuitemInDSSI … … 70 71 ;-------------------------------------------------------------------- 71 72 ; Menuitem_ActivateHexInputForMenuitemInDSSI 72 ; Parameters: 73 ; DS:SI: Ptr to MENUITEM 74 ; Returns: 75 ; Nothing 73 ; Menuitem_ActivateUnsignedInputForMenuitemInDSSI 74 ; Parameters: 75 ; DS:SI: Ptr to MENUITEM 76 ; Returns: 77 ; CF: Cleared if value inputted 78 ; Set if user cancellation 76 79 ; Corrupts registers: 77 80 ; AX, BX, CX, SI, DI, ES 78 81 ;-------------------------------------------------------------------- 79 ALIGN JUMP_ALIGN80 82 Menuitem_ActivateHexInputForMenuitemInDSSI: 83 mov bl, 16 84 SKIP2B ax 85 Menuitem_ActivateUnsignedInputForMenuitemInDSSI: 86 mov bl, 10 87 81 88 call Registers_CopyDSSItoESDI 82 83 89 mov cx, WORD_DIALOG_IO_size 84 90 call Memory_ReserveCXbytesFromStackToDSSI 85 91 call InitializeDialogInputInDSSIfromMenuitemInESDI 86 mov BYTE [si+WORD_DIALOG_IO.bNumericBase], 16 87 jmp SHORT ContinueWordInput 88 89 ;-------------------------------------------------------------------- 90 ; Menuitem_ActivateUnsignedInputForMenuitemInDSSI 91 ; Parameters: 92 ; DS:SI: Ptr to MENUITEM 93 ; Returns: 94 ; CF: Cleared if value inputted 95 ; Set if user cancellation 96 ; Corrupts registers: 97 ; AX, BX, CX, SI, DI, ES 98 ;-------------------------------------------------------------------- 99 ALIGN JUMP_ALIGN 100 Menuitem_ActivateUnsignedInputForMenuitemInDSSI: 101 call Registers_CopyDSSItoESDI 102 103 mov cx, WORD_DIALOG_IO_size 104 call Memory_ReserveCXbytesFromStackToDSSI 105 call InitializeDialogInputInDSSIfromMenuitemInESDI 106 mov BYTE [si+WORD_DIALOG_IO.bNumericBase], 10 107 ContinueWordInput: 108 mov ax, [es:di+MENUITEM.itemValue + ITEM_VALUE.wMinValue] 92 mov [si+WORD_DIALOG_IO.bNumericBase], bl 93 mov ax, [es:di+MENUITEM.itemValue+ITEM_VALUE.wMinValue] 109 94 mov [si+WORD_DIALOG_IO.wMin], ax 110 mov ax, [es:di+MENUITEM.itemValue +ITEM_VALUE.wMaxValue]95 mov ax, [es:di+MENUITEM.itemValue+ITEM_VALUE.wMaxValue] 111 96 mov [si+WORD_DIALOG_IO.wMax], ax 112 97 push di … … 138 123 ALIGN JUMP_ALIGN 139 124 InitializeDialogInputInDSSIfromMenuitemInESDI: 140 mov ax, [es:di+MENUITEM.itemValue +ITEM_VALUE.szDialogTitle]125 mov ax, [es:di+MENUITEM.itemValue+ITEM_VALUE.szDialogTitle] 141 126 mov [si+DIALOG_INPUT.fszTitle], ax 142 127 mov [si+DIALOG_INPUT.fszTitle+2], cs … … 162 147 ALIGN JUMP_ALIGN 163 148 Menuitem_StoreValueFromAXtoMenuitemInDSSI: 149 %if 0 150 ; 3 bytes more but this will always invoke the Writer, even if it's an invalid item type (which might be useful). 164 151 eMOVZX bx, [si+MENUITEM.bType] 165 152 cmp bl, TYPE_MENUITEM_HEX 153 %else 154 ; This will only invoke the Writer for valid item types. 155 mov bx, -TYPE_MENUITEM_MULTICHOICE & 0FFh 156 add bl, [si+MENUITEM.bType] 157 jnc SHORT .InvalidItemType 158 cmp bl, TYPE_MENUITEM_HEX - TYPE_MENUITEM_MULTICHOICE 159 %endif 166 160 ja SHORT .InvalidItemType 167 161 … … 169 163 add di, [si+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset] 170 164 171 push bx 172 mov bx,[si+MENUITEM.itemValue+ITEM_VALUE.fnValueWriter] 173 test bx,bx 174 jz SHORT .NoWriter 175 call bx 176 .NoWriter: 165 push WORD [cs:bx+.rgfnJumpToStoreValueBasedOnItemType] 166 mov bx, [si+MENUITEM.itemValue+ITEM_VALUE.fnValueWriter] 167 test bx, bx 168 jnz SHORT .InvokeWriter 169 .InvalidItemType: 177 170 pop bx 178 179 jmp [cs:bx+.rgfnJumpToStoreValueBasedOnItemType] 180 .InvalidItemType: 181 ret 171 .InvokeWriter: 172 jmp bx ; The Writer can freely corrupt BX 182 173 183 174 ALIGN WORD_ALIGN 184 175 .rgfnJumpToStoreValueBasedOnItemType: 185 dw .InvalidItemType ; TYPE_MENUITEM_PAGEBACK186 dw .InvalidItemType ; TYPE_MENUITEM_PAGENEXT187 dw .InvalidItemType ; TYPE_MENUITEM_ACTION176 ; dw .InvalidItemType ; TYPE_MENUITEM_PAGEBACK 177 ; dw .InvalidItemType ; TYPE_MENUITEM_PAGENEXT 178 ; dw .InvalidItemType ; TYPE_MENUITEM_ACTION 188 179 dw .StoreMultichoiceValueFromAXtoESDIwithItemInDSSI ; TYPE_MENUITEM_MULTICHOICE 189 180 dw .StoreByteOrWordValueFromAXtoESDIwithItemInDSSI ; TYPE_MENUITEM_UNSIGNED … … 237 228 jz .StoreByteOrWordValueFromAXtoESDIwithItemInDSSI 238 229 239 shlax, 1 ; Shift for WORD lookup230 eSHL_IM ax, 1 ; Shift for WORD lookup 240 231 add bx, ax 241 232 mov ax, [bx] ; Lookup complete … … 317 308 ; AX: Menuitem value 318 309 ; Corrupts registers: 319 ; BX310 ; Nothing 320 311 ;-------------------------------------------------------------------- 321 312 ALIGN JUMP_ALIGN … … 330 321 test BYTE [si+MENUITEM.bFlags], FLG_MENUITEM_BYTEVALUE 331 322 jz SHORT .NoConvertWordToByteValue 332 xor ah, ah 333 323 xor ah, ah ; conversion needs to happen before call to the reader, 324 ; in case the reader unpacks the byte to a word 334 325 335 326 .NoConvertWordToByteValue: … … 338 329 jz SHORT .NoReader 339 330 340 call bx 331 call bx ; The Reader can freely corrupt BX, DI and ES 341 332 342 333 .NoReader: -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/MenuitemPrint.asm
r590 r592 168 168 MenuitemPrint_WriteLookupValueStringToBufferInESDIfromUnshiftedItemInDSSI: 169 169 call Menuitem_GetValueToAXfromMenuitemInDSSI 170 shlax, 1170 eSHL_IM ax, 1 171 171 jmp SHORT PrintLookupValueFromAXtoBufferInESDI 172 172 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/BootMenuSettingsMenu.asm
r580 r592 1 1 ; Project name : XTIDE Universal BIOS Configurator v2 2 ; Description : "Boot Menu Settings" menu structs and functions.2 ; Description : "Boot settings" menu structs and functions. 3 3 4 4 ; … … 26 26 at MENUPAGE.fnEnter, dw BootMenuSettingsMenu_EnterMenuOrModifyItemVisibility 27 27 at MENUPAGE.fnBack, dw ConfigurationMenu_EnterMenuOrModifyItemVisibility 28 at MENUPAGE.wMenuitems, dw 628 at MENUPAGE.wMenuitems, dw 7 29 29 iend 30 30 … … 55 55 iend 56 56 57 g_MenuitemBootMnuStngsColorTheme: 58 istruc MENUITEM 59 at MENUITEM.fnActivate, dw Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI 60 at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteLookupValueStringToBufferInESDIfromUnshiftedItemInDSSI 61 at MENUITEM.szName, dw g_szItemColorTheme 62 at MENUITEM.szQuickInfo, dw g_szNfoColorTheme 63 at MENUITEM.szHelp, dw g_szHelpColorTheme 64 at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE | FLG_MENUITEM_MODIFY_MENU 65 at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOICE 66 at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw ROMVARS.pColorTheme ; Only ever read - never modified 67 at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgColorTheme 68 at MENUITEM.itemValue + ITEM_VALUE.szMultichoice, dw g_szMultichoiceColorTheme 69 at MENUITEM.itemValue + ITEM_VALUE.rgwChoiceToValueLookup, dw NULL 70 at MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup, dw g_rgszValueToStringLookupForColorTheme 71 at MENUITEM.itemValue + ITEM_VALUE.fnValueReader, dw ReadColorTheme 72 at MENUITEM.itemValue + ITEM_VALUE.fnValueWriter, dw WriteColorTheme 73 iend 74 57 75 g_MenuitemBootMnuStngsFloppyDrives: 58 76 istruc MENUITEM … … 116 134 at MENUITEM.itemValue + ITEM_VALUE.wMaxValue, dw 1092 117 135 iend 118 119 120 g_rgwChoiceToValueLookupForEnableBootMenu:121 dw FALSE122 dw BOOT_MENU_DEFAULT_TIMEOUT123 136 124 137 g_rgwChoiceToValueLookupForDisplayModes: … … 146 159 dw g_szValueBootFloppyDrvs4 147 160 161 g_rgszValueToStringLookupForColorTheme: 162 dw g_szValueColorTheme0 163 dw g_szValueColorTheme1 164 dw g_szValueColorTheme2 165 dw g_szValueColorTheme3 166 dw g_szValueColorTheme4 167 dw g_szValueColorTheme5 168 169 ColorThemeTable: 170 ; Classic (default) 171 db COLOR_ATTRIBUTE(COLOR_YELLOW, COLOR_BLUE) ; .cBordersAndBackground 172 db COLOR_ATTRIBUTE(COLOR_GRAY, COLOR_BLACK) ; .cShadow 173 db COLOR_ATTRIBUTE(COLOR_BRIGHT_WHITE, COLOR_BLUE) ; .cTitle 174 db COLOR_ATTRIBUTE(COLOR_WHITE, COLOR_BLUE) ; .cItem 175 db COLOR_ATTRIBUTE(COLOR_BRIGHT_WHITE, COLOR_CYAN) ; .cHighlightedItem 176 db COLOR_ATTRIBUTE(COLOR_RED, COLOR_BLUE) | FLG_COLOR_BLINK ; .cHurryTimeout 177 db COLOR_ATTRIBUTE(COLOR_GREEN, COLOR_BLUE) ; .cNormalTimeout 178 ; Argon Blue 179 db COLOR_ATTRIBUTE(COLOR_LIGHT_BLUE, COLOR_BLACK) ; .cBordersAndBackground 180 db COLOR_ATTRIBUTE(COLOR_GRAY, COLOR_BLACK) ; .cShadow 181 db COLOR_ATTRIBUTE(COLOR_BRIGHT_WHITE, COLOR_BLACK) ; .cTitle 182 db COLOR_ATTRIBUTE(COLOR_WHITE, COLOR_BLACK) ; .cItem 183 db COLOR_ATTRIBUTE(COLOR_LIGHT_BLUE, COLOR_BLACK) ; .cHighlightedItem 184 db COLOR_ATTRIBUTE(COLOR_LIGHT_BLUE, COLOR_BLACK) | FLG_COLOR_BLINK ; .cHurryTimeout 185 db COLOR_ATTRIBUTE(COLOR_LIGHT_BLUE, COLOR_BLACK) ; .cNormalTimeout 186 ; Neon Red 187 db COLOR_ATTRIBUTE(COLOR_LIGHT_RED, COLOR_BLACK) ; .cBordersAndBackground 188 db COLOR_ATTRIBUTE(COLOR_GRAY, COLOR_BLACK) ; .cShadow 189 db COLOR_ATTRIBUTE(COLOR_BRIGHT_WHITE, COLOR_BLACK) ; .cTitle 190 db COLOR_ATTRIBUTE(COLOR_WHITE, COLOR_BLACK) ; .cItem 191 db COLOR_ATTRIBUTE(COLOR_LIGHT_RED, COLOR_BLACK) ; .cHighlightedItem 192 db COLOR_ATTRIBUTE(COLOR_LIGHT_RED, COLOR_BLACK) | FLG_COLOR_BLINK ; .cHurryTimeout 193 db COLOR_ATTRIBUTE(COLOR_LIGHT_RED, COLOR_BLACK) ; .cNormalTimeout 194 ; Phosphor Green 195 db COLOR_ATTRIBUTE(COLOR_LIGHT_GREEN, COLOR_BLACK) ; .cBordersAndBackground 196 db COLOR_ATTRIBUTE(COLOR_GRAY, COLOR_BLACK) ; .cShadow 197 db COLOR_ATTRIBUTE(COLOR_BRIGHT_WHITE, COLOR_BLACK) ; .cTitle 198 db COLOR_ATTRIBUTE(COLOR_WHITE, COLOR_BLACK) ; .cItem 199 db COLOR_ATTRIBUTE(COLOR_LIGHT_GREEN, COLOR_BLACK) ; .cHighlightedItem 200 db COLOR_ATTRIBUTE(COLOR_LIGHT_GREEN, COLOR_BLACK) | FLG_COLOR_BLINK ; .cHurryTimeout 201 db COLOR_ATTRIBUTE(COLOR_LIGHT_GREEN, COLOR_BLACK) ; .cNormalTimeout 202 ; Moon Surface 203 db COLOR_ATTRIBUTE(COLOR_GRAY, COLOR_BLACK) ; .cBordersAndBackground 204 db COLOR_ATTRIBUTE(COLOR_GRAY, COLOR_BLACK) ; .cShadow 205 db COLOR_ATTRIBUTE(COLOR_BRIGHT_WHITE, COLOR_BLACK) ; .cTitle 206 db COLOR_ATTRIBUTE(COLOR_WHITE, COLOR_BLACK) ; .cItem 207 db COLOR_ATTRIBUTE(COLOR_BROWN, COLOR_BLACK) ; .cHighlightedItem 208 db COLOR_ATTRIBUTE(COLOR_BRIGHT_WHITE, COLOR_BLACK) | FLG_COLOR_BLINK ; .cHurryTimeout 209 db COLOR_ATTRIBUTE(COLOR_WHITE, COLOR_BLACK) ; .cNormalTimeout 210 ; Toxic Waste 211 db COLOR_ATTRIBUTE(COLOR_LIGHT_GREEN, COLOR_BLACK) ; .cBordersAndBackground 212 db COLOR_ATTRIBUTE(COLOR_GRAY, COLOR_BLACK) ; .cShadow 213 db COLOR_ATTRIBUTE(COLOR_LIGHT_GREEN, COLOR_BLACK) ; .cTitle 214 db COLOR_ATTRIBUTE(COLOR_LIGHT_CYAN, COLOR_BLACK) ; .cItem 215 db COLOR_ATTRIBUTE(COLOR_LIGHT_CYAN, COLOR_BLUE) ; .cHighlightedItem 216 db COLOR_ATTRIBUTE(COLOR_LIGHT_RED, COLOR_BLACK) | FLG_COLOR_BLINK ; .cHurryTimeout 217 db COLOR_ATTRIBUTE(COLOR_LIGHT_RED, COLOR_BLACK) ; .cNormalTimeout 218 EndOfColorThemeTable: 219 CountOfThemes equ (EndOfColorThemeTable-ColorThemeTable) / ATTRIBUTE_CHARS_size 220 148 221 149 222 ; Section containing code … … 166 239 call .EnableOrDisableScanForSerialDrives 167 240 call .EnableOrDisableDefaultBootDrive 241 call .EnableOrDisableColorThemeSelection 168 242 call .EnableOrDisableBootMenuSelectionTimeout 169 243 mov si, g_MenupageForBootMenuSettingsMenu … … 202 276 mov bx, g_MenuitemBootMnuStngsDefaultBootDrive 203 277 test ax, FLG_ROMVARS_MODULE_HOTKEYS | FLG_ROMVARS_MODULE_BOOT_MENU 278 jmp SHORT .DisableMenuitemFromCSBXifZFset 279 280 281 ;-------------------------------------------------------------------- 282 ; .EnableOrDisableColorThemeSelection 283 ; Parameters: 284 ; AX: ROMVARS.wFlags 285 ; SS:BP: Menu handle 286 ; Returns: 287 ; Nothing 288 ; Corrupts registers: 289 ; BX 290 ;-------------------------------------------------------------------- 291 ALIGN JUMP_ALIGN 292 .EnableOrDisableColorThemeSelection: 293 mov bx, g_MenuitemBootMnuStngsColorTheme 294 test ax, FLG_ROMVARS_MODULE_BOOT_MENU 204 295 jmp SHORT .DisableMenuitemFromCSBXifZFset 205 296 … … 244 335 245 336 ;-------------------------------------------------------------------- 246 ; MENUITEM value reader functions 247 ; Parameters: 248 ; AX: Value from MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset 249 ; DS:SI: Ptr to MENUITEM 250 ; ES:DI: Ptr to value variable 251 ; Returns: 252 ; AX: Value with possible modifications 253 ; Corrupts registers: 254 ; Nothing 255 ;-------------------------------------------------------------------- 256 ALIGN JUMP_ALIGN 257 ValueReaderForEnableBootMenu: 258 test ax, ax 259 jz SHORT .NoNeedToModify 260 mov ax, TRUE<<1 261 .NoNeedToModify: 337 ; ReadColorTheme 338 ; Parameters: 339 ; AX: Value read from the ROMVARS location 340 ; ES:DI: ROMVARS location where the value was just read from 341 ; DS:SI: MENUITEM pointer 342 ; Returns: 343 ; AX: Value that the MENUITEM system will interact with and display 344 ; Corrupts registers: 345 ; BX, DI, ES 346 ;-------------------------------------------------------------------- 347 ALIGN JUMP_ALIGN 348 ReadColorTheme: 349 push ds 350 351 push es ; ES -> DS 352 pop ds 353 push cs ; CS -> ES 354 pop es 355 356 mov di, EndOfColorThemeTable-1 ; ES:DI now points to the end of the last theme in the table of available themes in XTIDECFG 357 xor bx, bx 358 359 push si 360 push cx 361 mov cx, CountOfThemes 362 std 363 .NextTheme: 364 push cx 365 mov cl, ATTRIBUTE_CHARS_size 366 mov si, ax ; [ROMVARS.pColorTheme] to SI 367 dec si 368 add si, cx ; DS:SI now points to the end of the ColorTheme in the loaded BIOS 369 sub di, bx ; Update the pointer to the end of the next theme in the table 370 371 ; We verify that the theme in the loaded BIOS exists in our table. If it doesn't exist then that most likely means 372 ; the loaded BIOS doesn't contain MODULE_BOOT_MENU and the theme actually isn't a theme - it's code. Either way, 373 ; we don't trust it enough to copy it over as corrupt/invalid settings could render the UI in XTIDECFG unreadable. 374 repe cmpsb 375 mov bx, cx 376 pop cx 377 loopne .NextTheme 378 cld 379 mov ax, cx 380 jne SHORT .SkipCopy 381 382 ; Copy the color theme fron the loaded BIOS overwriting XTIDECFG's own theme 383 inc si 384 mov di, ColorTheme ; ES:DI now points to ColorTheme in XTIDECFG 385 386 mov cl, ATTRIBUTE_CHARS_size 387 call Memory_CopyCXbytesFromDSSItoESDI 388 389 .SkipCopy: 390 pop cx 391 pop si 392 pop ds 262 393 ret 394 395 396 ;-------------------------------------------------------------------- 397 ; WriteColorTheme 398 ; Parameters: 399 ; AX: Value that the MENUITEM system was interacting with 400 ; ES:DI: ROMVARS location where the value is to be stored 401 ; DS:SI: MENUITEM pointer 402 ; Returns: 403 ; AX: Value to actually write to ROMVARS 404 ; Corrupts registers: 405 ; Nothing 406 ;-------------------------------------------------------------------- 407 ALIGN JUMP_ALIGN 408 WriteColorTheme: 409 push cx 410 push si 411 push di 412 413 mov cx, ATTRIBUTE_CHARS_size 414 mul cl ; Multiply with the menu choice index 415 mov si, ColorThemeTable 416 add si, ax 417 mov ax, [es:di] ; Fetch the ptr to ColorTheme 418 mov di, ax 419 420 call Memory_CopyCXbytesFromDSSItoESDI 421 422 pop di 423 pop si 424 pop cx 425 ret 426 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/ConfigurationMenu.asm
r589 r592 245 245 ; Nothing 246 246 ; Corrupts registers: 247 ; BX , DI, ES247 ; BX 248 248 ;-------------------------------------------------------------------- 249 249 ALIGN JUMP_ALIGN … … 262 262 ; Nothing 263 263 ; Corrupts registers: 264 ; AX, BX , CX264 ; AX, BX 265 265 ;-------------------------------------------------------------------- 266 266 ALIGN JUMP_ALIGN … … 268 268 call Buffers_GetRomvarsFlagsToAX 269 269 mov bx, g_MenuitemConfigurationKiBtoStealFromRAM 270 test a x, FLG_ROMVARS_FULLMODE270 test al, FLG_ROMVARS_FULLMODE 271 271 jz SHORT .DisableMenuitemFromCSBX 272 272 jmp SHORT .EnableMenuitemFromCSBX … … 319 319 ; All, except segments 320 320 ;-------------------------------------------------------------------- 321 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS 322 %if (ROMVARS.ideVars0 | ROMVARS.ideVars1 | ROMVARS.ideVars2 | ROMVARS.ideVars3) & 0FF00h = 0 323 PrimaryIdeController: 324 mov bl, ROMVARS.ideVars0 & 0FFh 325 SKIP2B f 326 SecondaryIdeController: 327 mov bl, ROMVARS.ideVars1 & 0FFh 328 SKIP2B f 329 TertiaryIdeController: 330 mov bl, ROMVARS.ideVars2 & 0FFh 331 SKIP2B f 332 QuaternaryIdeController: 333 mov bl, ROMVARS.ideVars3 & 0FFh 334 xor bh, bh 335 ; Fall to DisplayIdeControllerMenu 336 %else 321 337 ALIGN JUMP_ALIGN 322 338 PrimaryIdeController: … … 338 354 mov bx, ROMVARS.ideVars3 339 355 ; Fall to DisplayIdeControllerMenu 356 %endif 357 %endif 340 358 341 359 ALIGN JUMP_ALIGN … … 383 401 ; Nothing 384 402 ; Corrupts registers: 385 ; A ll403 ; AX, BX, CX, DX 386 404 ;---------------------------------------------------------------------- 387 405 ConfigurationMenu_CheckAndMoveSerialDrivesToBottom: … … 428 446 ; move serial to end of list, others up 429 447 ; 448 %ifdef CLD_NEEDED 430 449 cld 431 450 %endif 432 451 mov ax, di ; save end pointer of list after scan 433 434 452 sub sp, IDEVARS_size ; copy serial to temporary space on stack 435 436 453 mov di, sp 437 454 … … 439 456 pop es 440 457 458 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS 441 459 %if IDEVARS_size & 1 442 460 mov cl, IDEVARS_size … … 446 464 rep movsw 447 465 %endif 466 %endif 448 467 449 468 lea di, [si-IDEVARS_size] ; move up all the idevars below the serial, by one slot 450 451 469 mov cx, ax ; restore end pointer of list, subtract off end of serial idevars 452 470 sub cx, si … … 462 480 ; di is already at last IDEVARS position 463 481 482 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS 464 483 %if IDEVARS_size & 1 465 484 mov cl, IDEVARS_size … … 469 488 rep movsw 470 489 %endif 490 %endif 471 491 472 492 add sp, IDEVARS_size … … 476 496 477 497 mov dh, 1 ; set flag that we have done a relocation 478 479 498 jmp SHORT .outerLoop 480 499 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/FlashMenu.asm
r589 r592 185 185 pop ds 186 186 187 cmp WORD [ cs:g_cfgVars+CFGVARS.wEepromSegment], 0188 jne .alreadySet187 cmp WORD [g_cfgVars+CFGVARS.wEepromSegment], 0 188 jne SHORT .AlreadySet 189 189 190 190 push es 191 191 push di 192 192 call EEPROM_FindXtideUniversalBiosROMtoESDI 193 push es 194 pop ax 193 mov ax, es 195 194 pop di 196 195 pop es 197 j c .storeEepromSegment196 jnc SHORT .StoreEepromSegment 198 197 mov ax, DEFAULT_EEPROM_SEGMENT 199 .storeEepromSegment: 200 mov WORD [cs:g_cfgVars+CFGVARS.wEepromSegment], ax 201 202 .alreadySet: 203 198 .StoreEepromSegment: 199 mov [g_cfgVars+CFGVARS.wEepromSegment], ax 200 201 .AlreadySet: 204 202 mov si, g_MenupageForFlashMenu 205 203 jmp Menupage_ChangeToNewMenupageInDSSI … … 256 254 ALIGN JUMP_ALIGN, ret 257 255 .ImageFitsInSelectedEeprom: 256 .DoNotGenerateChecksumByte: 258 257 ret 259 258 … … 271 270 call EEPROM_LoadFromRomToRamComparisonBuffer 272 271 call Buffers_AppendZeroesIfNeeded 273 test WORD[cs:g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_CHECKSUM272 test BYTE [cs:g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_CHECKSUM 274 273 jz SHORT .DoNotGenerateChecksumByte 275 274 jmp Buffers_GenerateChecksum 276 .DoNotGenerateChecksumByte:277 ret278 275 279 276 ;-------------------------------------------------------------------- … … 349 346 .GetSelectedEepromSizeInWordsToAX: 350 347 eMOVZX bx, [cs:g_cfgVars+CFGVARS.bEepromType] 351 mov ax, [cs:bx+g_rgwEepromTypeToSizeInWords] 348 ;%if g_rgwEepromTypeToSizeInWords = 0 ; *FIXME* It really is but NASM won't accept this. 349 mov ax, [cs:bx] 350 ;%else 351 ; mov ax, [cs:bx+g_rgwEepromTypeToSizeInWords] 352 ;%endif 352 353 ret 353 354 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/IdeControllerMenu.asm
r589 r592 135 135 at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgIdeCmdPort 136 136 at MENUITEM.itemValue + ITEM_VALUE.wMinValue, dw 8h 137 at MENUITEM.itemValue + ITEM_VALUE.wMaxValue, dw 3 f8h137 at MENUITEM.itemValue + ITEM_VALUE.wMaxValue, dw 3F8h 138 138 at MENUITEM.itemValue + ITEM_VALUE.fnValueReader, dw IdeControllerMenu_SerialReadPort 139 139 at MENUITEM.itemValue + ITEM_VALUE.fnValueWriter, dw IdeControllerMenu_SerialWritePort … … 306 306 mov [cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 307 307 308 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS 309 %if IDEVARS.wBasePort = 0 310 mov [cs:g_MenuitemIdeControllerCommandBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], bx 311 %else 308 312 lea ax, [bx+IDEVARS.wBasePort] 309 313 mov [cs:g_MenuitemIdeControllerCommandBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 310 314 %endif 315 316 %if IDEVARS.bSerialPort = 0 317 mov [cs:g_MenuitemIdeControllerSerialPort+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], bx 318 %else 311 319 lea ax, [bx+IDEVARS.bSerialPort] 312 320 mov [cs:g_MenuitemIdeControllerSerialPort+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 321 %endif 322 %endif 313 323 314 324 lea ax, [bx+IDEVARS.bSerialBaud] … … 361 371 ALIGN JUMP_ALIGN 362 372 .EnableOrDisableCommandBlockPort: 363 mov bx, [ cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]373 mov bx, [g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset] 364 374 call Buffers_GetRomvarsValueToAXfromOffsetInBX 365 375 mov bx, g_MenuitemIdeControllerCommandBlockAddress … … 380 390 ALIGN JUMP_ALIGN 381 391 .EnableOrDisableControlBlockPort: 382 mov bx, [ cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]392 mov bx, [g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset] 383 393 call Buffers_GetRomvarsValueToAXfromOffsetInBX 384 394 mov bx, g_MenuitemIdeControllerControlBlockAddress … … 404 414 jz SHORT .DisableMenuitemFromCSBX 405 415 406 mov bx, [ cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]416 mov bx, [g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset] 407 417 call Buffers_GetRomvarsValueToAXfromOffsetInBX 408 418 mov bx, g_MenuitemIdeControllerEnableInterrupt … … 424 434 ALIGN JUMP_ALIGN 425 435 .EnableOrDisableIRQchannelSelection: 426 mov bx, [ cs:g_MenuitemIdeControllerEnableInterrupt+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]436 mov bx, [g_MenuitemIdeControllerEnableInterrupt+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset] 427 437 call Buffers_GetRomvarsValueToAXfromOffsetInBX 428 438 mov bx, g_MenuitemIdeControllerIdeIRQ … … 453 463 454 464 465 ;-------------------------------------------------------------------- 466 ; .EnableOrDisableSerial 467 ; Parameters: 468 ; SS:BP: Menu handle 469 ; Returns: 470 ; Nothing 471 ; Corrupts registers: 472 ; AX, BX 473 ;-------------------------------------------------------------------- 455 474 .EnableOrDisableSerial: 456 475 mov bx, g_MenuitemIdeControllerSerialBaud … … 463 482 call DisableMenuitemFromCSBX 464 483 465 mov bx, [ cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]484 mov bx, [g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset] 466 485 call Buffers_GetRomvarsValueToAXfromOffsetInBX 467 486 cmp al, DEVICE_SERIAL_PORT 468 jne .DisableAllSerial487 jne SHORT .DisableAllSerial 469 488 470 489 mov bx, g_MenuitemIdeControllerSerialCOM … … 474 493 call EnableMenuitemFromCSBX 475 494 476 mov bx, [ cs:g_MenuitemIdeControllerSerialCOM+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]495 mov bx, [g_MenuitemIdeControllerSerialCOM+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset] 477 496 call Buffers_GetRomvarsValueToAXfromOffsetInBX 478 497 mov bx, g_MenuitemIdeControllerSerialPort … … 483 502 ret 484 503 504 485 505 ;-------------------------------------------------------------------- 486 506 ; MENUITEM activation functions (.fnActivate) … … 531 551 jmp MasterSlaveMenu_EnterMenuOrModifyItemVisibility 532 552 533 ;------------------------------------------------------------------------------------------ 534 ; 535 ; Reader/Writer Routines 536 ; 537 ; For serial drives, we pack the port number and baud rate into a single byte, and thus 538 ; we need to take care to properly read/write just the bits we need. In addition, since 539 ; we use the Port/PortCtrl bytes in a special way for serial drives, we need to properly 540 ; default the values stored in both these words when switching in and out of the Serial 541 ; device choice. 542 ; 543 ; Writers: 544 ; Parameters: 545 ; AX: Value that the MENUITEM system was interacting with 546 ; ES:DI: ROMVARS location where the value is to be stored 553 554 ;-------------------------------------------------------------------- 555 ; IdeControllerMenu_WriteDevice 556 ; 557 ; Sets default values to ports and other device dependent stuff 558 ; 559 ; Parameters: 560 ; AX: IDE controller/Device type menu choice index 561 ; ES:DI: Ptr to IDEVARS.bDevice 547 562 ; DS:SI: MENUITEM pointer 548 563 ; Returns: 549 ; AX: Value to actually write to ROMVARS 550 ; Corrupts registers: 551 ; AX 552 ; 553 ; Readers: 554 ; Parameters: 555 ; AX: Value read from the ROMVARS location 556 ; ES:DI: ROMVARS location where the value was just read from 557 ; DS:SI: MENUITEM pointer 558 ; Returns: 559 ; AX: Value that the MENUITEM system will interact with and display 560 ; Corrupts registers: 561 ; AX 562 ; 563 ALIGN JUMP_ALIGN 564 WriterForXTCFwindow: 565 xor al, al 566 SKIP2B f 567 ReaderForXTCFwindow: 568 xor ah, ah 569 xchg al, ah 570 ret 571 572 564 ; AX: IDE controller/Device type menu choice index 565 ; Corrupts registers: 566 ; BX, DX 567 ;-------------------------------------------------------------------- 573 568 ALIGN JUMP_ALIGN 574 569 IdeControllerMenu_WriteDevice: 575 push bx576 570 push di 577 571 push ax … … 581 575 582 576 ; Note! AL is the choice index, not device code 583 shl al, 1 ; Selection to device code 584 585 ; Restore ports and other stuff to default values 577 eSHL_IM al, 1 ; Selection to device code 586 578 jz SHORT .StandardIdeDevice ; DEVICE_16BIT_ATA 587 579 … … 603 595 div bl 604 596 mov bx, .rgbLowByteOfStdIdeInterfacePorts 605 xlat 597 xlat ; DS=CS so no segment override needed 606 598 mov ah, 1 ; DEVICE_ATA_*_PORT >> 8 607 599 mov bh, 3 ; DEVICE_ATA_*_PORTCTRL >> 8 … … 622 614 623 615 .SupportForDeviceNotAvailable: 624 push dx625 616 mov dx, g_szUnsupportedDevice 626 617 call Dialogs_DisplayErrorFromCSDX 627 pop dx628 618 629 619 ; Restore device type to the previous value … … 631 621 mov al, bl ; Previous device type to AL 632 622 shr al, 1 ; Device code to choice index 633 jmp SHORT .DoneWithNoChangeOfDevice 623 pop di 624 ret 634 625 635 626 .NotSerialDevice: … … 670 661 671 662 .ChangingToSerial: 672 cmp bl, DEVICE_SERIAL_PORT 673 je SHORT .Done ; if we were already serial, nothing to do 674 663 ; 664 ; For serial drives, we pack the port number and baud rate into a single byte, and thus 665 ; we need to take care to properly read/write just the bits we need. In addition, since 666 ; we use the Port/PortCtrl bytes in a special way for serial drives, we need to properly 667 ; default the values stored in both these words when switching in and out of the Serial 668 ; device choice. 669 ; 670 mov al, SERIAL_DEFAULT_COM 675 671 mov BYTE [es:di+IDEVARS.bSerialBaud-IDEVARS.wBasePort], SERIAL_DEFAULT_BAUD 676 mov BYTE [es:di+IDEVARS.bIRQ-IDEVARS.wBasePort], 0 ; Clear .bIRQ to keep the boot menu from printing it 677 678 mov al, SERIAL_DEFAULT_COM 672 mov [es:di+IDEVARS.bIRQ-IDEVARS.wBasePort], ah ; Clear .bIRQ to keep the boot menu from printing it 673 679 674 sub di, IDEVARS.wBasePort - IDEVARS.bSerialCOMPortChar 680 675 call IdeControllerMenu_SerialWriteCOM … … 683 678 .Done: 684 679 pop ax 685 .DoneWithNoChangeOfDevice: 686 pop di ; IDEVARS.bDevice 687 pop bx 680 pop di 688 681 ret 689 682 690 ; 691 ; Doesn't modify COM character (unless it is not recognized, which would be an error case), 692 ; But does update the port address based on COM port selection 693 ; 683 684 ;-------------------------------------------------------------------- 685 ; IdeControllerMenu_SerialWriteCOM 686 ; 687 ; Updates the port address based on COM port selection 688 ; 689 ; Parameters: 690 ; AL: COM port 691 ; ES:DI: Ptr to IDEVARS.bSerialCOMPortChar 692 ; DS:SI: MENUITEM pointer 693 ; Returns: 694 ; Nothing 695 ; Corrupts registers: 696 ; BX 697 ;-------------------------------------------------------------------- 694 698 ALIGN JUMP_ALIGN 695 699 IdeControllerMenu_SerialWriteCOM: 696 700 push ax 697 push bx698 701 push si 699 702 700 mov si, g_rgbChoiceToValueLookupForCOM 701 mov bx, PackedCOMPortAddresses 702 703 .loop: 704 mov ah, [bx] 705 706 cmp ah, (SERIAL_DEFAULT_CUSTOM_PORT >> 2) 707 je .notFound 708 709 cmp al, [si] 710 je .found 711 703 mov bx, PackedCOMPortAddresses - 1 704 mov si, g_rgbChoiceToValueLookupForCOM - 2 705 706 .Loop: 707 inc bx 712 708 inc si 713 709 inc si 714 inc bx 715 716 jmp .loop 717 718 .notFound: 719 mov al, 'x' 720 721 .found: 710 711 mov ah, [bx] 712 cmp ah, SERIAL_DEFAULT_CUSTOM_PORT >> 2 713 je SHORT .NotFound 714 715 cmp al, [si] 716 jne SHORT .Loop 717 718 .NotFound: 722 719 mov [es:di+IDEVARS.bSerialPort-IDEVARS.bSerialCOMPortChar], ah 723 720 724 721 pop si 725 pop bx726 722 pop ax 727 728 723 ret 729 724 730 725 726 ;-------------------------------------------------------------------- 727 ; IdeControllerMenu_SerialReadPort 731 728 ; 732 729 ; Packed Port (byte) -> Numeric Port (word) 733 730 ; 731 ; Parameters: 732 ; AX: Value read from the ROMVARS location 733 ; ES:DI: ROMVARS location where the value was just read from 734 ; DS:SI: MENUITEM pointer 735 ; Returns: 736 ; AX: Value that the MENUITEM system will interact with and display 737 ; Corrupts registers: 738 ; Nothing 739 ;-------------------------------------------------------------------- 734 740 ALIGN JUMP_ALIGN 735 741 IdeControllerMenu_SerialReadPort: … … 738 744 ret 739 745 746 747 ;-------------------------------------------------------------------- 748 ; IdeControllerMenu_SerialWritePort 740 749 ; 741 750 ; Numeric Port (word) -> Packed Port (byte) 742 ; And convert from Custom to a defined COM port if we match one of the pre-defined COM port numbers 743 ; 751 ; 752 ; And convert from Custom to a defined COM port if we 753 ; match one of the pre-defined COM port numbers 754 ; 755 ; Parameters: 756 ; AX: Value that the MENUITEM system was interacting with 757 ; ES:DI: ROMVARS location where the value is to be stored 758 ; DS:SI: MENUITEM pointer 759 ; Returns: 760 ; AX: Value to actually write to ROMVARS 761 ; Corrupts registers: 762 ; BX 763 ;-------------------------------------------------------------------- 744 764 ALIGN JUMP_ALIGN 745 765 IdeControllerMenu_SerialWritePort: 746 push bx747 766 push si 748 767 749 768 eSHR_IM ax, 2 750 and al, 0feh ; force 8-byte boundary 751 752 mov si, g_rgbChoiceToValueLookupForCOM 753 mov bx, PackedCOMPortAddresses ; loop, looking for port address in known COM address list 754 755 .loop: 756 mov ah, [si] 757 cmp ah, 'x' 758 je .found 759 760 cmp al, [bx] 761 je .found 762 769 and al, 0FEh ; Force 8-byte boundary 770 771 mov si, g_rgbChoiceToValueLookupForCOM - 2 772 mov bx, PackedCOMPortAddresses - 1 ; Loop, looking for port address in known COM address list 773 774 .Loop: 763 775 inc si 764 776 inc si 765 777 inc bx 766 778 767 jmp .loop 768 769 .found: 779 mov ah, [si] 780 cmp ah, 'x' 781 je SHORT .Found 782 783 cmp al, [bx] 784 jne SHORT .Loop 785 786 .Found: 770 787 mov [es:di+IDEVARS.bSerialCOMPortChar-IDEVARS.bSerialPort], ah 771 788 772 789 pop si 773 pop bx774 775 790 ret 776 791 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MainMenu.asm
r546 r592 155 155 .EnableOrDisableXtideRomItems: 156 156 call EEPROM_FindXtideUniversalBiosROMtoESDI 157 j nc SHORT .DisableAllRomItems157 jc SHORT .DisableAllRomItems 158 158 or BYTE [g_MenuitemMainMenuLoadXtideUniversalBiosFromRom+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE 159 159 call Buffers_IsXtideUniversalBiosLoaded … … 201 201 ALIGN JUMP_ALIGN 202 202 .EnableOrDisableFlashEeprom: 203 test WORD[g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_FILELOADED | FLG_CFGVARS_ROMLOADED203 test BYTE [g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_FILELOADED | FLG_CFGVARS_ROMLOADED 204 204 jz SHORT .DisableFlashEeprom 205 205 or BYTE [g_MenuitemMainMenuFlashEeprom+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE … … 222 222 ALIGN JUMP_ALIGN 223 223 .EnableOrDisableSave: 224 test WORD[g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_FILELOADED224 test BYTE [g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_FILELOADED 225 225 jz SHORT .DisableSave 226 226 or BYTE [g_MenuitemMainMenuSaveFile+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE … … 257 257 add si, BYTE FILE_DIALOG_IO.szFile 258 258 call BiosFile_LoadFileFromDSSItoRamBuffer 259 call LoadColorTheme 260 ; *FIXME* Will load themes even from unrecognized versions of the BIOS which isn't really a problem but still 'unexpected behaviour' and therefore a bug. 259 261 call MainMenu_EnterMenuOrModifyItemVisibility 260 262 .CancelFileLoading: … … 272 274 mov dx, g_szDlgMainLoadROM 273 275 call Dialogs_DisplayNotificationFromCSDX 276 call LoadColorTheme 274 277 jmp MainMenu_EnterMenuOrModifyItemVisibility 275 278 … … 281 284 call Buffers_SetUnsavedChanges 282 285 mov dx, g_szDlgMainLoadStngs 283 jmp Dialogs_DisplayNotificationFromCSDX 284 286 call Dialogs_DisplayNotificationFromCSDX 287 call EEPROM_FindXtideUniversalBiosROMtoESDI 288 call LoadColorTheme.FromROM 289 jmp MainMenu_EnterMenuOrModifyItemVisibility 290 291 292 ;-------------------------------------------------------------------- 293 ; LoadColorTheme 294 ; Parameters: 295 ; ES: ROMVARS segment (only when loading theme from ROM) 296 ; Returns: 297 ; Nothing 298 ; Corrupts registers: 299 ; AX, BX, DI, ES 300 ;-------------------------------------------------------------------- 301 ALIGN JUMP_ALIGN 302 LoadColorTheme: 303 call Buffers_GetFileBufferToESDI 304 .FromROM: 305 mov ax, [es:ROMVARS.pColorTheme] 306 jmp ReadColorTheme 307 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MasterSlaveMenu.asm
r583 r592 196 196 dw DISABLE_WRITE_CACHE 197 197 dw ENABLE_WRITE_CACHE 198 199 198 g_rgszChoiceToStringLookupForWriteCache: 200 199 dw g_szValueBootDispModeDefault … … 207 206 dw TRANSLATEMODE_ASSISTED_LBA 208 207 dw TRANSLATEMODE_AUTO 209 210 208 g_rgszChoiceToStringLookupForXlateMode: 211 209 dw g_szValueDrvXlateNormal … … 229 227 ALIGN JUMP_ALIGN 230 228 MasterSlaveMenu_InitializeToDrvparamsOffsetInBX: 229 push ds 230 231 push cs 232 pop ds 233 234 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS 235 %if DRVPARAMS.wFlags = 0 236 mov ax, bx 237 %else 231 238 lea ax, [bx+DRVPARAMS.wFlags] 232 mov [cs:g_MenuitemMasterSlaveBlockModeTransfers+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 233 mov [cs:g_MenuitemMasterSlaveChsTranslateMode+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 234 mov [cs:g_MenuitemMasterSlaveWriteCache+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 235 mov [cs:g_MenuitemMasterSlaveUserCHS+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 236 mov [cs:g_MenuitemMasterSlaveUserLBA+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 239 %endif 240 %endif 241 mov [g_MenuitemMasterSlaveBlockModeTransfers+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 242 mov [g_MenuitemMasterSlaveChsTranslateMode+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 243 mov [g_MenuitemMasterSlaveWriteCache+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 244 mov [g_MenuitemMasterSlaveUserCHS+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 245 mov [g_MenuitemMasterSlaveUserLBA+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 237 246 238 247 lea ax, [bx+DRVPARAMS.wCylinders] 239 mov [ cs:g_MenuitemMasterSlaveCylinders+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax248 mov [g_MenuitemMasterSlaveCylinders+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 240 249 241 250 lea ax, [bx+DRVPARAMS.bHeads] 242 mov [ cs:g_MenuitemMasterSlaveHeads+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax251 mov [g_MenuitemMasterSlaveHeads+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 243 252 244 253 lea ax, [bx+DRVPARAMS.bSect] 245 mov [ cs:g_MenuitemMasterSlaveSectors+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax254 mov [g_MenuitemMasterSlaveSectors+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 246 255 247 256 lea ax, [bx+DRVPARAMS.dwMaximumLBA] 248 mov [cs:g_MenuitemMasterSlaveUserLbaValue+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 257 mov [g_MenuitemMasterSlaveUserLbaValue+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 258 259 pop ds 249 260 ret 250 261 … … 283 294 mov bx, [g_MenuitemMasterSlaveUserLBA+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset] 284 295 call Buffers_GetRomvarsValueToAXfromOffsetInBX 285 test a x, FLG_DRVPARAMS_USERLBA296 test al, FLG_DRVPARAMS_USERLBA 286 297 jnz SHORT .DisableCHSandEnableLBA 287 test a x, FLG_DRVPARAMS_USERCHS298 test al, FLG_DRVPARAMS_USERCHS 288 299 jnz SHORT .EnableCHSandDisableLBA 289 300 … … 320 331 ALIGN JUMP_ALIGN 321 332 .EnableOrDisableCHandS: 322 mov bx, [ cs:g_MenuitemMasterSlaveUserCHS+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]333 mov bx, [g_MenuitemMasterSlaveUserCHS+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset] 323 334 call Buffers_GetRomvarsValueToAXfromOffsetInBX 324 test a x, FLG_DRVPARAMS_USERCHS335 test al, FLG_DRVPARAMS_USERCHS 325 336 jz SHORT .DisableCHandS 326 test a x, FLG_DRVPARAMS_USERLBA337 test al, FLG_DRVPARAMS_USERLBA 327 338 jnz SHORT .DisableCHandS 328 339 … … 355 366 ALIGN JUMP_ALIGN 356 367 .EnableOrDisableUserLbaValue: 357 mov bx, [ cs:g_MenuitemMasterSlaveUserLBA+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]368 mov bx, [g_MenuitemMasterSlaveUserLBA+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset] 358 369 call Buffers_GetRomvarsValueToAXfromOffsetInBX 359 370 mov bx, g_MenuitemMasterSlaveUserLbaValue 360 test a x, FLG_DRVPARAMS_USERCHS371 test al, FLG_DRVPARAMS_USERCHS 361 372 jnz SHORT .DisableMenuitemFromCSBX 362 test a x, FLG_DRVPARAMS_USERLBA373 test al, FLG_DRVPARAMS_USERLBA 363 374 jz SHORT .DisableMenuitemFromCSBX 364 375 ; Fall to .EnableMenuitemFromCSBX … … 443 454 ALIGN JUMP_ALIGN 444 455 MasterSlaveMenu_WriteCHSFlag: 445 test word[es:di], FLG_DRVPARAMS_USERCHS446 jnz .alreadySet456 test BYTE [es:di], FLG_DRVPARAMS_USERCHS 457 jnz SHORT .AlreadySet 447 458 448 459 push ax … … 466 477 pop ax 467 478 468 . alreadySet:479 .AlreadySet: 469 480 ret 470 481 … … 475 486 ALIGN JUMP_ALIGN 476 487 MasterSlaveMenu_WriteLBAFlag: 477 test word[es:di], FLG_DRVPARAMS_USERLBA478 jnz .alreadySet488 test BYTE [es:di], FLG_DRVPARAMS_USERLBA 489 jnz SHORT .AlreadySet 479 490 480 491 push ax … … 490 501 pop ax 491 502 492 . alreadySet:503 .AlreadySet: 493 504 ret 505 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm
r590 r592 42 42 g_szYes: db "Yes",NULL 43 43 44 ; Exitmessages44 ; General Yes/No response type dialog messages 45 45 g_szDlgExitToDos: db "Exit to DOS?",NULL 46 46 g_szDlgSaveChanges: db "Do you want to save changes to XTIDE Universal BIOS image file?",NULL 47 47 g_szDlgDriveNotReady: db "Drive not ready! Retry?",NULL 48 48 49 49 ; Generic dialog strings … … 92 92 g_szNfoMainFlash: db "Flash loaded BIOS image to EEPROM.",NULL 93 93 g_szNfoMainSave: db "Save BIOS changes back to original file from which it was loaded.",NULL 94 g_szNfoMainLicense: db "XTIDE Universal BIOS and XTIDECFG Copyright (C) 2009-2010 by Tomi Tilli, 2011-201 6by XTIDE Universal BIOS Team."94 g_szNfoMainLicense: db "XTIDE Universal BIOS and XTIDECFG Copyright (C) 2009-2010 by Tomi Tilli, 2011-2018 by XTIDE Universal BIOS Team." 95 95 db " Released under GNU GPL v2, with ABSOLUTELY NO WARRANTY. Press ENTER for more details...",NULL 96 96 g_szNfoMainHomePage: db "Visit http://xtideuniversalbios.org (home page) and http://vcfed.org/forum (support)",NULL 97 97 98 98 g_szHelpMainLicense: db "XTIDE Universal BIOS and XTIDECFG Configuration program are Copyright 2009-2010 by Tomi Tilli," 99 db " 2011-201 6by XTIDE Universal BIOS Team. Released under GNU GPL v2. This software comes with ABSOLUTELY NO WARRANTY."99 db " 2011-2018 by XTIDE Universal BIOS Team. Released under GNU GPL v2. This software comes with ABSOLUTELY NO WARRANTY." 100 100 db " This is free software, and you are welcome to redistribute it under certain conditions." 101 101 db " See the LICENSE.TXT file that was included with this distribution," … … 423 423 g_szItemBootDrive: db "Default boot drive",NULL 424 424 g_szItemBootDispMode: db "Display Mode",NULL 425 g_szItemColorTheme: db "Color Theme",NULL 425 426 g_szItemBootFloppyDrvs: db "Number of Floppy Drives",NULL 426 427 g_szItemSerialDetect: db "Scan for Serial Drives",NULL … … 429 430 g_szDlgBootDrive: db "Enter default drive number (0xh for Floppy Drives, 8xh for Hard Disks).",NULL 430 431 g_szDlgBootDispMode: db "Select display mode.",NULL 432 g_szDlgColorTheme: db "Select color theme.",NULL 431 433 g_szDlgBootFloppyDrvs: db "Select number of Floppy Drives in system.",NULL 432 434 g_szDlgSerialDetect: db "Scan for serial drives?",NULL … … 435 437 g_szNfoBootDrive: db "Default boot drive.",NULL 436 438 g_szNfoDispMode: db "Display mode to set when booting.",NULL 439 g_szNfoColorTheme: db "Color theme used by the boot menu and the hotkey bar.",NULL 437 440 g_szNfoBootFloppyDrvs: db "Number of Floppy Drives in system.",NULL 438 441 g_szNfoSerialDetect: db "Scans all standard COM ports for serial drives." … … 442 445 db " When timer goes to zero, currently selected drive will be booted automatically." 443 446 db " Timeout can be disabled by setting this to 0.",NULL 444 445 447 g_szHelpBootDrive: db "Drive to be set selected by default when Boot Menu is displayed.",NULL 446 448 g_szHelpColorTheme: db "Pick a theme from a list of several pre-defined themes to customize the colors used by the boot menu and, if" 449 db " available, the hotkey bar. Selecting a theme or loading a BIOS, or its settings, from file or from ROM will" 450 db " make XTIDECFG apply the theme to itself for easy preview. The ability to preview themes requires that" 451 db " XTIDECFG is running in a display mode that can display colors. In other words, you may configure the" 452 db " BIOS on a machine with a monochrome graphics adapter and not be able to preview the theme but the BIOS will" 453 db " still use the selected theme when installed in a machine with a color graphics adapter.",NULL 447 454 g_szHelpBootFloppyDrvs: db "Detecting the correct number of floppy drives might fail when using a floppy controller with its own BIOS." 448 455 db " A minimum number of floppy drives can be specified to force non-detected drives to appear on boot menu.",NULL 449 450 456 g_szHelpSerialDetect: db "Set to Yes, at the end of normal drive detection, COM ports 1-7 (in reverse order) will be scanned for a connection" 451 457 db " to a serial drive server. This option provides flexibility with the COM port and baud rate to be used," … … 468 474 g_szValueBootDispModeCO80: db "CO80",NULL 469 475 g_szValueBootDispModeMono: db "Mono",NULL 476 477 g_szMultichoiceColorTheme: db "Classic (default)",LF 478 db "Argon Blue",LF 479 db "Neon Red",LF 480 db "Phosphor Green",LF 481 db "Moon Surface",LF 482 db "Toxic Waste",NULL 483 g_szValueColorTheme0: db "Classic",NULL 484 g_szValueColorTheme1: db "Argon",NULL 485 g_szValueColorTheme2: db "Neon",NULL 486 g_szValueColorTheme3: db "Phosphor",NULL 487 g_szValueColorTheme4: db "Moon",NULL 488 g_szValueColorTheme5: db "Toxic",NULL 470 489 471 490 g_szMultichoiceBootFloppyDrvs: db "Autodetect",LF -
trunk/XTIDE_Universal_BIOS_Configurator_v2/makefile
r481 r592 100 100 ASFLAGS += $(IHEADERS) # Set header file directory paths 101 101 ASFLAGS += -Worphan-labels # Warn about labels without colon 102 ASFLAGS += -O 9# Optimize operands to their shortest forms102 ASFLAGS += -Ox # Optimize operands to their shortest forms 103 103 104 104 … … 135 135 xt_unused: xt 136 136 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XT) -o"$(TARGET)_xt_unused.asm" -E -DCHECK_FOR_UNUSED_ENTRYPOINTS 137 @perl ..\ tools\unused.pl $(TARGET)_xt.lst $(TARGET)_xt_unused.asm137 @perl ..\Tools\unused.pl $(TARGET)_xt.lst $(TARGET)_xt_unused.asm 138 138
Note:
See TracChangeset
for help on using the changeset viewer.