- Timestamp:
- Nov 15, 2011, 10:35:17 AM (13 years ago)
- google:author:
- gregli@hotmail.com
- Location:
- trunk
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Assembly_Library/Inc/Display.inc
r177 r186 4 4 %define DISPLAY_INC 5 5 6 %ifndef MODULE_STRINGS_COMPRESSED_PRECOMPRESS 6 7 ;-------------------------------------------------------------------- 7 8 ; Display Library users need to use this macro since it will provide … … 197 198 CGA_STATUS_REGISTER EQU 3DAh 198 199 200 %endif ; MODULE_STRINGS_COMPRESS_PRECOMPRESS 199 201 200 202 ; Control characters for teletype output -
trunk/Assembly_Library/Src/AssemblyLibrary.asm
r172 r186 13 13 %include "DisplayCursor.asm" 14 14 %include "DisplayPage.asm" 15 %include "DisplayPrint.asm" 16 %include "DisplayFormat.asm" 15 %include "DisplayPrint.asm" ; must come before DisplayFormat/DisplayFormatCompressed 16 %ifdef MODULE_STRINGS_COMPRESSED 17 %include "DisplayFormatCompressed.asm" 18 %else 19 %include "DisplayFormat.asm" 20 %endif 17 21 %endif 18 22 -
trunk/Assembly_Library/Src/Display/DisplayPrint.asm
r181 r186 5 5 SECTION .text 6 6 7 7 8 ;-------------------------------------------------------------------- 8 9 ; Supports following formatting types: … … 61 62 pop si 62 63 pop bp 64 63 65 ret 64 66 … … 102 104 ; AX, DX 103 105 ;-------------------------------------------------------------------- 106 107 %ifndef MODULE_STRINGS_COMPRESSED 108 104 109 ALIGN JUMP_ALIGN 105 110 DisplayPrint_WordFromAXWithBaseInBX: … … 131 136 .rgcDigitToCharacter: db "0123456789ABCDEF" 132 137 138 %endif ; MODULE_STRINGS_COMPRESSED 139 133 140 134 141 ;-------------------------------------------------------------------- … … 165 172 166 173 167 ;--------------------------------------------------------------------168 ; DisplayPrint_NullTerminatedStringFromCSSI169 ; Parameters:170 ; CS:SI: Ptr to NULL terminated string171 ; DS: BDA segment (zero)172 ; ES:DI: Ptr to cursor location in video RAM173 ; Returns:174 ; DI: Updated offset to video RAM175 ; Corrupts registers:176 ; AX, DX177 ;--------------------------------------------------------------------178 ALIGN JUMP_ALIGN179 DisplayPrint_NullTerminatedStringFromCSSI:180 push bx181 mov bx, cs182 call DisplayPrint_NullTerminatedStringFromBXSI183 pop bx184 ret185 186 187 ;--------------------------------------------------------------------188 ; DisplayPrint_NullTerminatedStringFromBXSI189 ; Parameters:190 ; DS: BDA segment (zero)191 ; BX:SI: Ptr to NULL terminated string192 ; ES:DI: Ptr to cursor location in video RAM193 ; Returns:194 ; DI: Updated offset to video RAM195 ; Corrupts registers:196 ; AX, DX197 ;--------------------------------------------------------------------198 ALIGN JUMP_ALIGN199 DisplayPrint_NullTerminatedStringFromBXSI:200 push si201 push cx202 203 xor cx, cx204 ALIGN JUMP_ALIGN205 .PrintNextCharacter:206 mov ds, bx ; String segment to DS207 lodsb208 mov ds, cx ; BDA segment to DS209 test al, al ; NULL?210 jz SHORT .EndOfString211 call DisplayPrint_CharacterFromAL212 jmp SHORT .PrintNextCharacter213 214 ALIGN JUMP_ALIGN215 .EndOfString:216 pop cx217 pop si218 ret219 174 220 175 … … 320 275 pop cx 321 276 .NothingToRepeat: 322 ret 323 277 278 ret 279 280 ;-------------------------------------------------------------------- 281 ; DisplayPrint_NullTerminatedStringFromCSSI 282 ; Parameters: 283 ; CS:SI: Ptr to NULL terminated string 284 ; DS: BDA segment (zero) 285 ; ES:DI: Ptr to cursor location in video RAM 286 ; Returns: 287 ; DI: Updated offset to video RAM 288 ; Corrupts registers: 289 ; AX, DX 290 ;-------------------------------------------------------------------- 291 292 %ifndef MODULE_STRINGS_COMPRESSED 293 ;;; 294 ;;; Take care when using this routine with compressed strings (which is why it is disabled). 295 ;;; All strings in CSSI should go through the DisplayFormatCompressed code to be decoded. 296 ;;; 297 ALIGN JUMP_ALIGN 298 DisplayPrint_NullTerminatedStringFromCSSI: 299 push bx 300 mov bx, cs 301 call DisplayPrint_NullTerminatedStringFromBXSI 302 pop bx 303 304 ret 305 %endif 306 307 308 309 310 ;;; 311 ;;; Note that the following routines need to be at the bottom of this file 312 ;;; to accomodate short jumps from the next file (DisplayFormat/DisplayFormatCompressed) 313 ;;; 324 314 325 315 ;-------------------------------------------------------------------- … … 333 323 ; AX, DX 334 324 ;-------------------------------------------------------------------- 335 ALIGN JUMP_ALIGN 325 %ifdef MODULE_STRINGS_COMPRESSED 326 ALIGN JUMP_ALIGN 327 DisplayPrint_Newline_FormatAdjustBP: 328 inc bp ; we didn't need a parameter after all, readjust BP 329 inc bp 330 ;;; fall-through 331 %endif 332 333 ALIGN JUMP_ALIGN 334 336 335 DisplayPrint_Newline: 337 336 mov al, LF … … 344 343 ; Parameters: 345 344 ; AL: Character to display 345 ; Zero value is ignored (no characer is printed) 346 346 ; DS: BDA segment (zero) 347 347 ; ES:DI: Ptr to cursor location in video RAM … … 353 353 ALIGN JUMP_ALIGN 354 354 DisplayPrint_CharacterFromAL: 355 %ifdef MODULE_STRINGS_COMPRESSED 356 test al,al 357 jz DisplayPrint_Ret 358 %endif 355 359 mov ah, [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.bAttribute] 356 360 jmp [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fnCharOut] 361 362 363 364 ;-------------------------------------------------------------------- 365 ; DisplayPrint_NullTerminatedStringFromBXSI 366 ; Parameters: 367 ; DS: BDA segment (zero) 368 ; BX:SI: Ptr to NULL terminated string 369 ; ES:DI: Ptr to cursor location in video RAM 370 ; Returns: 371 ; DI: Updated offset to video RAM 372 ; Corrupts registers: 373 ; AX, DX 374 ;-------------------------------------------------------------------- 375 ALIGN JUMP_ALIGN 376 DisplayPrint_NullTerminatedStringFromBXSI: 377 push si 378 push cx 379 380 xor cx, cx 381 ALIGN JUMP_ALIGN 382 .PrintNextCharacter: 383 mov ds, bx ; String segment to DS 384 lodsb 385 mov ds, cx ; BDA segment to DS 386 test al, al ; NULL? 387 jz SHORT .EndOfString 388 call DisplayPrint_CharacterFromAL 389 jmp SHORT .PrintNextCharacter 390 391 ALIGN JUMP_ALIGN 392 .EndOfString: 393 pop cx 394 pop si 395 396 DisplayPrint_Ret: ; random ret to jump to 397 ret 398 399 -
trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm
r182 r186 66 66 ; CF: Set since menu event was handled successfully 67 67 ; Corrupts registers: 68 ; AX 68 ; AX, DI 69 69 ;-------------------------------------------------------------------- 70 70 ALIGN JUMP_ALIGN 71 71 BootMenuPrint_NullTerminatedStringFromCSSIandSetCF: 72 push di 73 CALL_DISPLAY_LIBRARY PrintNullTerminatedStringFromCSSI 74 pop di 75 stc 76 ret 77 72 ; 73 ; We send all CSSI strings through the Format routine for the case of 74 ; compressed strings, but this doesn't hurt in the non-compressed case either 75 ; (perhaps a little slower, but shouldn't be noticeable to the user) 76 ; and results in smaller code size. 77 ; 78 push bp 79 mov bp,sp 80 jmp BootMenuPrint_FormatCSSIfromParamsInSSBP 78 81 79 82 ;-------------------------------------------------------------------- … … 229 232 cmp bl, FLOPPY_TYPE_525_HD 230 233 ja .ThreeHalf 234 %if g_szFddThreeFive_Displacement = 2 235 inc ax ; compressed string case 236 inc ax 237 %else 231 238 add ax, g_szFddThreeFive_Displacement 239 %endif 232 240 .ThreeHalf: 233 241 push ax ; "5 1/4" or "3 1/2" -
trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrintCfg.asm
r185 r186 21 21 ALIGN JUMP_ALIGN 22 22 BootMenuPrintCfg_ForOurDrive: 23 pop di24 23 mov si, g_szCfgHeader 25 24 call BootMenuPrint_NullTerminatedStringFromCSSIandSetCF 25 pop di 26 26 eMOVZX ax, BYTE [di+DPT.bIdevarsOffset] 27 27 xchg si, ax ; CS:SI now points to IDEVARS … … 91 91 mov al,g_szBusTypeValues_Displacement 92 92 mul BYTE [cs:si+IDEVARS.bDevice] 93 shr ax,1 93 94 shr ax,1 ; divide by 2 since IDEVARS.bDevice is multiplied by 2 95 94 96 add ax,g_szBusTypeValues 95 97 push ax -
trunk/XTIDE_Universal_BIOS/Src/Main.asm
r183 r186 153 153 ; Libraries and data 154 154 %include "AssemblyLibrary.asm" 155 %ifdef MODULE_STRINGS_COMPRESSED 156 %include "StringsCompressed.asm" 157 %else 155 158 %include "Strings.asm" ; For BIOS message strings 159 %endif 156 160 157 161 ; Initialization and drive detection -
trunk/XTIDE_Universal_BIOS/Src/Strings.asm
r185 r186 1 1 ; Project name : XTIDE Universal BIOS 2 2 ; Description : Strings and equates for BIOS messages. 3 4 %ifdef MODULE_STRINGS_COMPRESSED_PRECOMPRESS 5 %include "Display.inc" 6 %endif 3 7 4 8 ; Section containing code … … 19 23 20 24 ; Boot menu bottom of screen strings 21 g_szFDD: db "FDD ",NULL22 g_szHDD: db "HDD ",NULL25 g_szFDD: db "FDD ",NULL 26 g_szHDD: db "HDD ",NULL 23 27 g_szRomBoot: db "ROM Boot",NULL 24 g_szHotkey: db "%A%c%c%A% 8s%A ",NULL28 g_szHotkey: db "%A%c%c%A%s%A ",NULL 25 29 26 30 … … 34 38 g_szCapacity: db "Capacity : ",NULL 35 39 g_szSizeSingle: db "%s%u.%u %ciB",NULL 36 g_szSizeDual: db "%s% 4-u.%u %ciB / %4-u.%u %ciB",LF,CR,NULL40 g_szSizeDual: db "%s%5-u.%u %ciB /%5-u.%u %ciB",LF,CR,NULL 37 41 g_szCfgHeader: db "Addr.",SINGLE_VERTICAL,"Block",SINGLE_VERTICAL,"Bus", SINGLE_VERTICAL,"IRQ", SINGLE_VERTICAL,"Reset",LF,CR,NULL 38 42 g_szCfgFormat: db "%s" ,SINGLE_VERTICAL,"%5-u", SINGLE_VERTICAL,"%s",SINGLE_VERTICAL," %2-I",SINGLE_VERTICAL,"%5-x", NULL … … 98 102 %endif 99 103 100 g_szSelectionTimeout: db DOUBLE_BOTTOM_LEFT_CORNER,DOUBLE_LEFT_HORIZONTAL_TO_SINGLE_VERTICAL,"%ASelection in %2 u s",NULL104 g_szSelectionTimeout: db DOUBLE_BOTTOM_LEFT_CORNER,DOUBLE_LEFT_HORIZONTAL_TO_SINGLE_VERTICAL,"%ASelection in %2-u s",NULL 101 105 102 106 g_szDashForZero: db "- ",NULL -
trunk/XTIDE_Universal_BIOS/makefile
r181 r186 65 65 # Assembler preprocessor defines. # 66 66 ################################################################# 67 DEFINES = INCLUDE_MENU_LIBRARY EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS MODULE_EBIOS MODULE_SERIAL 67 DEFINES = INCLUDE_MENU_LIBRARY EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS MODULE_EBIOS MODULE_SERIAL MODULE_STRINGS_COMPRESSED 68 68 DEFINES_XT = ELIMINATE_CGA_SNOW 69 69 DEFINES_XTPLUS = ELIMINATE_CGA_SNOW USE_186 … … 139 139 @$(RM) $(BUILD_DIR)\*.* 140 140 @echo Deleted "(*.*)" from "$(BUILD_DIR)/" 141 142 src\StringsCompressed.asm: src\Strings.asm src\StringsCompress.pl 143 $(AS) src\Strings.asm $(ASFLAGS) $(DEFS_XT) -DMODULE_STRINGS_COMPRESSED_PRECOMPRESS -o build\Strings.bin -l build\StringsPrecompress.lst 144 perl src\StringsCompress.pl < build\StringsPrecompress.lst > src\StringsCompressed.asm 145 146 $(SRC_ASM): src\StringsCompressed.asm
Note:
See TracChangeset
for help on using the changeset viewer.