Changeset 30 for trunk/BOOTCODE/REGULAR/VIDEOIO.ASM
- Timestamp:
- May 6, 2011, 4:25:19 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BOOTCODE/REGULAR/VIDEOIO.ASM
r29 r30 19 19 ; AiR-BOOT / VIDEO I/O 20 20 ;--------------------------------------------------------------------------- 21 22 IFDEF ModuleNames 23 DB 'VIDEOIO',0 24 ENDIF 21 25 22 26 VideoIO_WaitRetrace Proc Near Uses ax dx … … 32 36 ret 33 37 VideoIO_WaitRetrace EndP 38 39 34 40 35 41 ; Holds the current position. Yeah, I know this is in the code area, but who … … 100 106 mov ax, VideoIO_Segment 101 107 mov es, ax 102 movzx ax, TextPosY 108 ;movzx ax, TextPosY 109 mov al,TextPosY 110 mov ah,0 111 103 112 mov bl, 160 104 113 mul bl … … 169 178 VideoIO_FixedPrint EndP 170 179 180 ; Rousseau: 181 ; Turn off blinking 182 ; http://www.ctyme.com/intr/rb-0088.htm does not mention this 183 VideoIO_NoBlinking Proc Near Uses ax bx 184 mov bx,0 185 mov ax,1003h 186 int 10h 187 ret 188 VideoIO_NoBlinking EndP 189 171 190 ; In: AL - Single Char to Print 172 191 ; Destroyed: None … … 179 198 ret 180 199 VideoIO_PrintSingleChar EndP 200 201 202 203 ; Print hex-byte to screen 204 ; This outputs two characters 205 ; In: AL - byte to send 206 ; Out: AL - byte sent 207 ; Destroyed: None 208 VideoIO_PrintHexByte Proc Near Uses ax 209 call CONV_BinToAsc ; Returns high hex-nibble in AH, low hex-nibble in AL 210 xchg al,ah ; High hex-nibble first 211 call VideoIO_PrintSingleChar ; Output to screen 212 xchg al,ah ; Low hex-nibble next 213 call VideoIO_PrintSingleChar ; Output to screen 214 ret 215 VideoIO_PrintHexByte EndP 216 217 218 ; Print hex-word to screen 219 ; This outputs four characters 220 ; In: AX - word to send 221 ; Out: AX - word sent 222 ; Destroyed: None 223 VideoIO_PrintHexWord Proc Near 224 xchg al,ah ; High byte first 225 call VideoIO_PrintHexByte ; Output to screen 226 xchg al,ah ; low byte next 227 call VideoIO_PrintHexByte ; Output to screen 228 ret 229 VideoIO_PrintHexWord EndP 230 231 232 ; Print hex-dword to screen 233 ; This outputs eight characters 234 ; In: DX:AX - dword to send 235 ; Out: DX:AX - dword sent 236 ; Destroyed: None 237 VideoIO_PrintHexDWord Proc Near 238 xchg ax,dx 239 call VideoIO_PrintHexWord ; High word first 240 xchg ax,dx 241 call VideoIO_PrintHexWord ; Low word next 242 ret 243 VideoIO_PrintHexDWord EndP 244 245 246 ; Print hex-qword to screen 247 ; This outputs sixteen characters 248 ; In: BX:CX:DX:AX - qword to send 249 ; Out: BX:CX:DX:AX - qword sent 250 ; Destroyed: None 251 VideoIO_PrintHexQWord Proc Near 252 xchg dx,bx 253 xchg ax,cx 254 call VideoIO_PrintHexDWord ; High dword first 255 xchg dx,bx 256 xchg ax,cx 257 call VideoIO_PrintHexDWord ; Low dword next 258 ret 259 VideoIO_PrintHexQWord EndP 260 261 262 263 181 264 182 265 ; In: AL - Single Char to Print … … 205 288 cmp al, 99 206 289 ja VIOPBN_DoNotWriteAnything 207 movzx bx, al 290 ;movzx bx, al 291 mov bl,al 292 mov bh,0 293 208 294 call VideoIO_Internal_SetRegs 209 295 cmp bl, 10 210 296 jb VIOPBN_Lower10 211 297 push ax 212 movzx ax, bl 298 ;movzx ax, bl 299 mov al,bl 300 mov ah,0 301 213 302 mov dl, 10 214 303 div dl … … 231 320 ; In: AL - Single Byte to Print 232 321 ; Destroyed: None 233 VideoIO_PrintByteDynamicNumber Proc Near Uses ax bx dx es di322 VideoIO_PrintByteDynamicNumber Proc Near Uses ax bx cx dx es di ; Rousseau: cx was missing from push-list 234 323 xor cl, cl 235 324 mov bh, al … … 240 329 cmp ah, 100 241 330 jb VIOPBDN_Lower100 242 movzx ax, ah 331 ;movzx ax, ah 332 mov al,ah 333 mov ah,0 334 243 335 mov dl, 100 244 336 div dl … … 249 341 add di, 2 250 342 VIOPBDN_Lower100: 251 movzx ax, ah 343 ;movzx ax, ah 344 mov al,ah 345 mov ah,0 346 252 347 mov dl, 10 253 348 div dl … … 270 365 ; Destroyed: None Important 271 366 VideoIO_Internal_MakeWinDown Proc Near Uses dx di 272 movzx dx, cl 367 ;movzx dx, cl 368 mov dl,cl 369 mov dh,0 370 273 371 mov bl, al 274 372 call VideoIO_Internal_SetRegs … … 281 379 dec dx 282 380 jnz VIOIMWD_Loop 283 ret 381 ret 284 382 VideoIO_Internal_MakeWinDown EndP 285 383 … … 287 385 ; Destroyed: None Important 288 386 VideoIO_Internal_MakeWinRight Proc Near Uses dx di 289 movzx dx, cl 387 ;movzx dx, cl 388 mov dl,cl 389 mov dh,0 390 290 391 mov bl, al 291 392 call VideoIO_Internal_SetRegs … … 298 399 dec dx 299 400 jnz VIOIMWR_Loop 300 ret 401 ret 301 402 VideoIO_Internal_MakeWinRight EndP 302 403 … … 366 467 sub bl, WinBeginPosX 367 468 dec bl 368 469 369 470 VIOIMW_Loop: 370 471 mov ch, WinBeginPosY … … 439 540 call VideoIO_CursorSet 440 541 call VideoIO_CursorOn ; Set and turn cursor on 441 542 442 543 ; ES:DI - Screen-Position to Start of String 443 544 ; DL - Position in String (relative to begin, base=0) … … 460 561 cmp dl, StringLen ; String "full" ? 461 562 jae VIOLUES_Loop 462 movzx bx, dl 563 ;movzx bx, dl 564 mov bl,dl 565 mov bh,0 566 463 567 shl bx, 1 464 568 mov es:[di+bx], al … … 476 580 mov al, ' ' 477 581 dec dl 478 movzx bx, dl 582 ;movzx bx, dl 583 mov bl,dl 584 mov bh,0 585 479 586 shl bx, 1 480 587 mov es:[di+bx], al … … 502 609 ret 503 610 VideoIO_LetUserEditString EndP 611 612 613 614 ; 615 ; Rousseau Additions. 616 ; 617 618 619 ; Function Template 620 ;ProcName Proc Near Uses ax bx cx dx si es di 621 ;ProcName EndP 622 623 624 ; 625 ; Clear the current page 626 ; 627 VideoIO_ClearScreen Proc Near Uses ax bx cx dx si es di 628 mov al, 0 ; clear entire window 629 mov bh,07h ; Attribute for new lines 630 xor cx,cx ; Row, Column ULC 631 xor dx,dx 632 dec dx ; Row, Column LRC (does this corrupt other pages ?) 633 mov ah, 06h ; Function Code 634 int 10h ; Do It ! 635 ret 636 VideoIO_ClearScreen EndP 637 638 ; 639 ; Rousseau: added 640 ; Set poosition to teletype cursor 641 ; 642 VideoIO_SyncPos Proc Near Uses ax bx cx dx 643 pushf 644 mov bh, 0 645 mov ah, 03h 646 int 10h 647 mov [TextPosX], dl 648 mov [TextPosY], dh 649 popf 650 ret 651 VideoIO_SyncPos EndP 652 653 654 655 VideoIO_DBG_WriteString Proc Near Uses ax bx cx dx si es di 656 mov ch, [CFG_Partitions] ; y 657 add ch, 7 658 add ch, [CFG_IncludeFloppy] 659 push cx 660 mov cl, 1 ; x 661 call VideoIO_Locate 662 mov ch, 15 ; fgc 663 mov cl, 0 ; bgc 664 call VideoIO_Color 665 mov si, offset ShowBootLog 666 call VideoIO_Print 667 pop cx 668 inc ch 669 670 ;mov ch, 21 ; y 671 mov cl, 1 ; x 672 call VideoIO_Locate 673 mov ch, 15 ; fgc 674 mov cl, 0 ; bgc 675 call VideoIO_Color 676 677 678 ; Rousseau: 679 mov al, [NewPartitions] 680 ;call VideoIO_PrintByteDynamicNumber 681 mov al, [CFG_Partitions] 682 ;call VideoIO_PrintByteDynamicNumber 683 ret 684 VideoIO_DBG_WriteString EndP 685 686 687 ; Dump the disk-info. 688 ; Disk number is in DL. 689 VideoIO_DumpDiskInfo Proc Near 690 691 VideoIO_DumpDiskInfo_next_disk: 692 push dx 693 xor ax,ax 694 mov al,[TextPosY] 695 push ax 696 697 mov ax,21 698 mov dh,dl 699 and dh,01111111b 700 mul dh 701 mov dh,al 702 703 mov [TextPosX],dh 704 705 mov si, offset Disk 706 call VideoIO_Print 707 mov al,dl 708 709 ; NIET GOED, GAAT FOUT > 9, HEX PRINT GEBRUIKEN !! 710 shr al,4 711 add al,'0' 712 call VideoIO_PrintSingleChar 713 mov al,dl 714 and al,01111111b 715 add al,'0' 716 call VideoIO_PrintSingleChar 717 mov al,'h' 718 call VideoIO_PrintSingleChar 719 720 inc [TextPosY] 721 mov [TextPosX],dh 722 723 mov al,'-' 724 mov cl,17 725 call VideoIO_PrintSingleMultiChar 726 727 inc [TextPosY] 728 mov [TextPosX],dh 729 mov si, offset BiosCyls 730 call VideoIO_Print 731 732 push dx 733 mov bx,offset BIOS_Cyls 734 xor dh,dh 735 and dl,01111111b 736 shl dx,1 737 shl dx,1 738 add bx,dx 739 mov ax,[bx] 740 mov dx,[bx+02] 741 call VideoIO_PrintHexDWord 742 pop dx 743 744 inc [TextPosY] 745 mov [TextPosX],dh 746 mov si, offset BiosHeads 747 call VideoIO_Print 748 749 push dx 750 mov bx,offset BIOS_Heads 751 xor dh,dh 752 and dl,01111111b 753 shl dx,1 754 shl dx,1 755 add bx,dx 756 mov ax,[bx] 757 mov dx,[bx+02] 758 call VideoIO_PrintHexDWord 759 pop dx 760 761 inc [TextPosY] 762 mov [TextPosX],dh 763 mov si, offset BiosSecs 764 call VideoIO_Print 765 766 push dx 767 mov bx,offset BIOS_Secs 768 xor dh,dh 769 and dl,01111111b 770 shl dx,1 771 shl dx,1 772 add bx,dx 773 mov ax,[bx] 774 mov dx,[bx+02] 775 call VideoIO_PrintHexDWord 776 pop dx 777 778 inc [TextPosY] 779 mov [TextPosX],dh 780 mov si, offset LvmSecs 781 call VideoIO_Print 782 783 push dx 784 mov bx,offset TrueSecs 785 xor dh,dh 786 and dl,01111111b 787 shl dx,1 788 shl dx,1 789 add bx,dx 790 mov ax,[bx] 791 mov dx,[bx+02] 792 call VideoIO_PrintHexDWord 793 pop dx 794 795 inc [TextPosY] 796 mov [TextPosX],dh 797 mov si, offset BiosLBA 798 call VideoIO_Print 799 800 push dx 801 mov bx,offset BIOS_TotalSecs 802 xor dh,dh 803 and dl,01111111b 804 shl dx,1 805 shl dx,1 806 shl dx,1 807 add bx,dx 808 mov ax,[bx] 809 mov dx,[bx+02] 810 call VideoIO_PrintHexDWord 811 pop dx 812 813 inc [TextPosY] 814 mov [TextPosX],dh 815 816 pop ax 817 mov [TextPosY],al 818 pop dx 819 820 inc dl 821 mov al,dl 822 and al,01111111b 823 cmp al,[TotalHarddiscs] 824 jae VideoIO_DumpDiskInfo_end 825 jmp VideoIO_DumpDiskInfo_next_disk 826 827 VideoIO_DumpDiskInfo_end: 828 mov [TextPosX],0 829 add [TextPosY],6 830 ret 831 VideoIO_DumpDiskInfo EndP 832 833 834 835 ; Disk Info to Dump to AB LogScreen 836 Disk: db "DISK ",0 837 BiosCyls: db "Cyls :",0 838 BiosHeads: db "Heads :",0 839 BiosSecs: db "Secs :",0 840 LvmSecs: db "SecsLVM :",0 841 BiosLBA: db "LBA Secs:",0 842 843 844 HugeBootDisk: db "Boot Disk is Huge : ",0 845 DisksFound: db "Disks Found : ",0 846 PartitionsFound: db "Partitions Found : ",0 847 ;AutoStartPart: db "Auto Start Partition : ",0 848 849 Phase1: db "eCS Install Phase 1 : ",0 850 851 852 ShowMenu: db "Press TAB to return to the AiR-BOOT Menu",0 853 ShowBootLog: db "Press TAB to see the Boot Log...",0 854 855 Yes: db "YES",0 856 No: db "NO",0 857 On: db "ON",0 858 Off: db "OFF",0 859 None: db "NONE",0 860 Active: db "ACTIVE",0 861 NotActive: db "NOT ACTIVE",0 862 863 ; New Line for use by MBR_Teletype 864 NL: db 0dh, 0ah, 0
Note:
See TracChangeset
for help on using the changeset viewer.