source: trunk/bootcode/regular/videoio.asm@ 162

Last change on this file since 162 was 162, checked in by Ben Rietbroek, 8 years ago

Removed some ancient debugging stuff [v1.1.1-testing]

CAUTION:
This is a testbuild !
AirBoot uses the BIOS to access disks and a small coding error can trash
partition tables or other vital disk structures. You are advised to make
backups of TRACK0 and EBRs before using this testbuild. More info at:
https://rousseaux.github.io/netlabs.air-boot/pdf/AirBoot-v1.1.0-manual.pdf

File size: 26.1 KB
Line 
1; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
2;
3; This file is part of AiR-BOOT
4;
5; AiR-BOOT is free software: you can redistribute it and/or modify it under
6; the terms of the GNU General Public License as published by the Free
7; Software Foundation, either version 3 of the License, or (at your option)
8; any later version.
9;
10; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
11; WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
12; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13; details.
14;
15; You should have received a copy of the GNU General Public License along with
16; AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
17;
18;---------------------------------------------------------------------------
19; AiR-BOOT / VIDEO I/O
20;---------------------------------------------------------------------------
21
22IFDEF MODULE_NAMES
23DB 'VIDEOIO',0
24ENDIF
25
26VideoIO_WaitRetrace Proc Near Uses ax dx
27 mov dx, 3DAh
28 VIOWR_Jump1:
29 in al, dx
30 test al, 8
31 jnz VIOWR_Jump1
32 VIOWR_Jump2:
33 in al, dx
34 test al, 8
35 jz VIOWR_Jump2
36 ret
37VideoIO_WaitRetrace EndP
38
39
40
41; Holds the current position. Yeah, I know this is in the code area, but who
42; cares :))
43TextPosY db 0h
44TextPosX db 0h
45TextColorFore db 7h
46TextColorBack db 0h
47
48; In: CH - Cursor Column, CL - Cursor Row (Start at 1,1)
49; Destroyed: None
50VideoIO_Locate Proc Near Uses cx
51 or ch, ch
52 jz VIOL_IgnoreY
53 dec ch
54 mov TextPosY, ch
55 VIOL_IgnoreY:
56 or cl, cl
57 jz VIOL_IgnoreX
58 dec cl
59 mov TextPosX, cl
60 VIOL_IgnoreX:
61 ret
62VideoIO_Locate EndP
63
64; In: CH - Cursor Column, CL - Center Cursor Row (Start at 1,1)
65; DX - Length to use for centering
66; Destroyed: None
67VideoIO_LocateToCenter Proc Near Uses cx dx
68 shr dl, 1 ; Length / 2
69 sub cl, dl
70 call VideoIO_Locate
71 ret
72VideoIO_LocateToCenter EndP
73
74; In: CH - Color Fore, CL - Color Back
75; Destroyed: None
76VideoIO_Color Proc Near Uses cx
77 mov TextColorFore, CH
78 mov TextColorBack, CL
79 ret
80VideoIO_Color EndP
81
82VideoIO_CursorOff Proc Near Uses ax cx
83 mov ax, 0102h ; 02 for fixup on AMI BIOS
84 mov cx, 1000h
85 int 10h ; Clears cursor
86 ret
87VideoIO_CursorOff EndP
88
89VideoIO_CursorOn Proc Near Uses ax cx
90 mov ax, 0102h ; 02 for fixup on AMI BIOS
91 mov cx, 0F0Eh
92 int 10h ; Builds cursor
93 ret
94VideoIO_CursorOn EndP
95
96VideoIO_CursorSet Proc Near Uses ax bx dx
97 mov ah, 02h
98 xor bh, bh
99 mov dh, TextPosY
100 mov dl, TextPosX
101 int 10h
102 ret
103VideoIO_CursorSet EndP
104
105; Sets DI which is used across many video routines !
106VideoIO_Internal_SetRegs Proc Near Uses bx
107 mov ax, VideoIO_Segment
108 mov es, ax
109 ;movzx ax, TextPosY
110 mov al,TextPosY
111 mov ah,0
112
113 mov bl, 160
114 mul bl
115 xor bh, bh
116 mov bl, TextPosX
117 shl bl, 1
118 add ax, bx
119 mov di, ax ; Location at ES:DI
120 mov ah, TextColorFore
121 mov al, TextColorBack
122 shl al, 4
123 or ah, al ; Color Attribute in AH
124 ret
125VideoIO_Internal_SetRegs EndP
126
127; In: SI - String to Print (EOS is 0)
128; Destroyed: SI
129VideoIO_Print Proc Near Uses ax es di
130 call VideoIO_Internal_SetRegs
131 VIOP_Loop:
132 lodsb
133 or al, al
134 jz VIOP_End
135 mov es:[di], al
136 mov es:[di+1], ah
137 add di, 2
138 inc TextPosX
139 jmp VIOP_Loop
140 VIOP_End:
141 ret
142VideoIO_Print EndP
143
144; In: SI - String to Print (EOS is 0)
145; Destroyed: SI
146VideoIO_PrintLikeLenOfName Proc Near Uses cx es di
147 push si
148 xor cx, cx
149 VIOPLLON_Loop:
150 lodsb
151 inc cx
152 or al, al
153 jnz VIOPLLON_Loop
154 pop si
155 call GetLenOfName ; Gets the real length...tricky ;)
156 jz VIOPLLON_Nul
157 call VideoIO_FixedPrint ; we are lazy :)
158 VIOPLLON_Nul:
159 ret
160VideoIO_PrintLikeLenOfName EndP
161
162; In: SI - String to Print
163; CL - Len Of String
164; Destroyed: SI
165VideoIO_FixedPrint Proc Near Uses es di
166 or cl, cl
167 jz VIOFP_NoString
168 call VideoIO_Internal_SetRegs
169 VIOFP_Loop:
170 lodsb
171 mov es:[di], al
172 mov es:[di+1], ah
173 add di, 2
174 inc [TextPosX]
175 dec cl
176 jnz VIOFP_Loop
177 VIOFP_NoString:
178 ret
179VideoIO_FixedPrint EndP
180
181; Rousseau:
182; Turn off blinking
183; http://www.ctyme.com/intr/rb-0088.htm does not mention this
184VideoIO_NoBlinking Proc Near Uses ax bx
185 mov bx,0
186 mov ax,1003h
187 int 10h
188 ret
189VideoIO_NoBlinking EndP
190
191; In: AL - Single Char to Print
192; Destroyed: None
193VideoIO_PrintSingleChar Proc Near Uses ax bx es di
194 mov bl, al
195 call VideoIO_Internal_SetRegs
196 mov es:[di], bl
197 mov es:[di+1], ah
198 inc TextPosX
199 ret
200VideoIO_PrintSingleChar EndP
201
202
203IF 0
204; Print dec-byte to screen
205; This outputs 1 to 3 characters
206; In: AL - byte to send
207; Out: AL - byte sent
208; Destroyed: None
209VideoIO_PrintDecByte Proc Near Uses ax
210 call CONV_BinToPBCD ; Convert to PBCD
211 mov dx, ax ; Save PBCD value
212 shr ah, 4 ; Move digit count to low nibble
213 cmp ah, 3 ; Less than 3 digits ?
214 jb @F ; Yep, skip digit with index 2
215 mov al, dh ; Get byte with digit
216 and al, 0fh ; Mask it out
217 add al, '0' ; To ASCII
218 call VideoIO_PrintSingleChar
219 @@:
220 shr dh, 4 ; Move digit count to low nibble
221 cmp dh, 2 ; Less that 2 digits ?
222 jb @F ; Yep, skip digit with index 1
223 mov al, dl ; Get byte with digit
224 shr al, 4 ; Move to lower nibble
225 add al, '0' ; To ASCII
226 call VideoIO_PrintSingleChar
227 @@:
228 mov al, dl ; Get byte with digit
229 and al, 0fh ; Mask it out
230 add al, '0' ; To ASCII
231 call VideoIO_PrintSingleChar
232 ret
233VideoIO_PrintDecByte EndP
234ENDIF
235
236
237; Print hex-byte to screen
238; This outputs two characters
239; In: AL - byte to send
240; Out: AL - byte sent
241; Destroyed: None
242VideoIO_PrintHexByte Proc Near Uses ax
243 call CONV_BinToAsc ; Returns high hex-nibble in AH, low hex-nibble in AL
244 xchg al,ah ; High hex-nibble first
245 call VideoIO_PrintSingleChar ; Output to screen
246 xchg al,ah ; Low hex-nibble next
247 call VideoIO_PrintSingleChar ; Output to screen
248 ret
249VideoIO_PrintHexByte EndP
250
251
252; Print hex-word to screen
253; This outputs four characters
254; In: AX - word to send
255; Out: AX - word sent
256; Destroyed: None
257VideoIO_PrintHexWord Proc Near
258 xchg al,ah ; High byte first
259 call VideoIO_PrintHexByte ; Output to screen
260 xchg al,ah ; low byte next
261 call VideoIO_PrintHexByte ; Output to screen
262 ret
263VideoIO_PrintHexWord EndP
264
265
266; Print hex-dword to screen
267; This outputs eight characters
268; In: DX:AX - dword to send
269; Out: DX:AX - dword sent
270; Destroyed: None
271VideoIO_PrintHexDWord Proc Near
272 xchg ax,dx
273 call VideoIO_PrintHexWord ; High word first
274 xchg ax,dx
275 call VideoIO_PrintHexWord ; Low word next
276 ret
277VideoIO_PrintHexDWord EndP
278
279
280; Print hex-qword to screen
281; This outputs sixteen characters
282; In: BX:CX:DX:AX - qword to send
283; Out: BX:CX:DX:AX - qword sent
284; Destroyed: None
285VideoIO_PrintHexQWord Proc Near
286 xchg dx,bx
287 xchg ax,cx
288 call VideoIO_PrintHexDWord ; High dword first
289 xchg dx,bx
290 xchg ax,cx
291 call VideoIO_PrintHexDWord ; Low dword next
292 ret
293VideoIO_PrintHexQWord EndP
294
295
296
297
298
299; In: AL - Single Char to Print
300; CL - Times to print it
301; Destroyed: None
302VideoIO_PrintSingleMultiChar Proc Near Uses ax bx cx es di
303 or cl, cl
304 jz VIOPSMC_NoChars
305 mov bl, al
306 call VideoIO_Internal_SetRegs
307 VIOPSMC_Loop:
308 mov es:[di], bl
309 mov es:[di+1], ah
310 add di, 2
311 inc TextPosX
312 dec cl
313 jnz VIOPSMC_Loop
314 VIOPSMC_NoChars:
315 ret
316VideoIO_PrintSingleMultiChar EndP
317
318; Will print a number to screen (2 bytes t.m. 0-99)
319; In: AL - Single Byte to Print
320; Destroyed: None
321VideoIO_PrintByteNumber Proc Near Uses ax bx dx es di
322 cmp al, 99
323 ja VIOPBN_DoNotWriteAnything
324 ;movzx bx, al
325 mov bl,al
326 mov bh,0
327
328 call VideoIO_Internal_SetRegs
329 cmp bl, 10
330 jb VIOPBN_Lower10
331 push ax
332 ;movzx ax, bl
333 mov al,bl
334 mov ah,0
335
336 mov dl, 10
337 div dl
338 mov bh, al ; BH = Upper Number
339 mov bl, ah ; BL = Rest
340 pop ax
341 VIOPBN_Lower10:
342 add bh, 30h
343 add bl, 30h
344 mov es:[di], bh
345 mov es:[di+1], ah
346 mov es:[di+2], bl
347 mov es:[di+3], ah
348 VIOPBN_DoNotWriteAnything:
349 add TextPosX, 2
350 ret
351VideoIO_PrintByteNumber EndP
352
353; Will print a number to screen (dynamic bytes from 0 to 255)
354; In: AL - Single Byte to Print
355; Destroyed: None
356VideoIO_PrintByteDynamicNumber Proc Near Uses ax bx cx dx es di ; Rousseau: cx was missing from push-list
357 xor cl, cl
358 mov bh, al
359 call VideoIO_Internal_SetRegs
360 xchg bh, ah ; Exchange backgroundcolor with Number
361 cmp ah, 10
362 jb VIOPBDN_Lower10
363 cmp ah, 100
364 jb VIOPBDN_Lower100
365 ;movzx ax, ah
366 mov al,ah
367 mov ah,0
368
369 mov dl, 100
370 div dl
371 add al, 30h
372 mov es:[di], al
373 mov es:[di+1], bh
374 inc TextPosX
375 add di, 2
376 VIOPBDN_Lower100:
377 ;movzx ax, ah
378 mov al,ah
379 mov ah,0
380
381 mov dl, 10
382 div dl
383 add al, 30h
384 mov es:[di], al
385 mov es:[di+1], bh
386 inc TextPosX
387 add di, 2
388 VIOPBDN_Lower10:
389 add ah, 30h
390 mov es:[di], ah
391 mov es:[di+1], bh
392 inc TextPosX
393 add di, 2
394 ret
395VideoIO_PrintByteDynamicNumber EndP
396
397
398; In: AL - Zeichen zum Zeichnen, CL - Wie oft
399; Destroyed: None Important
400VideoIO_Internal_MakeWinDown Proc Near Uses dx di
401 ;movzx dx, cl
402 mov dl,cl
403 mov dh,0
404
405 mov bl, al
406 call VideoIO_Internal_SetRegs
407 mov al, bl
408 VIOIMWD_Loop:
409 mov es:[di], al
410 mov es:[di+1], ah
411 add di, 160
412 inc TextPosY
413 dec dx
414 jnz VIOIMWD_Loop
415 ret
416VideoIO_Internal_MakeWinDown EndP
417
418; In: AL - Zeichen zum Zeichnen, CL - Wie oft
419; Destroyed: None Important
420VideoIO_Internal_MakeWinRight Proc Near Uses dx di
421 ;movzx dx, cl
422 mov dl,cl
423 mov dh,0
424
425 mov bl, al
426 call VideoIO_Internal_SetRegs
427 mov al, bl
428 VIOIMWR_Loop:
429 mov es:[di], al
430 mov es:[di+1], ah
431 add di, 2
432 inc TextPosX
433 dec dx
434 jnz VIOIMWR_Loop
435 ret
436VideoIO_Internal_MakeWinRight EndP
437
438WinBeginPosY db 0h
439WinBeginPosX db 0h
440WinEndPosY db 0h
441WinEndPosX db 0h
442WinCharRight db 0CDh
443WinCharDown db 0B3h
444WinCharBB db 0D5h
445WinCharBE db 0B8h
446WinCharEB db 0D4h
447WinCharEE db 0BEh
448
449; In: BX - Begin Position, DX - End Position
450; Destroyed: BX DX
451VideoIO_MakeWindow Proc Near Uses ax bx cx es di
452 mov WinBeginPosY, bh
453 mov WinBeginPosX, bl
454 mov WinEndPosY, dh
455 mov WinEndPosX, dl
456 mov cx, bx
457 inc ch
458 call VideoIO_Locate ; StartPos left line
459 mov cl, WinEndPosY
460 sub cl, WinBeginPosY
461 dec cl
462 mov al, WinCharDown
463 push cx
464 call VideoIO_Internal_MakeWinDown
465 mov ch, WinBeginPosY
466 mov cl, WinEndPosX
467 inc ch
468 call VideoIO_Locate ; StartPos right line
469 pop cx
470 mov al, WinCharDown
471 call VideoIO_Internal_MakeWinDown
472 ; Left & Right are already done...
473 mov ch, WinBeginPosY
474 mov cl, WinBeginPosX
475 call VideoIO_Locate ; StartPos upper line
476 mov al, WinCharBB
477 call VideoIO_PrintSingleChar
478 mov cl, WinEndPosX
479 sub cl, WinBeginPosX
480 dec cl
481 mov al, WinCharRight
482 push cx
483 call VideoIO_Internal_MakeWinRight
484 mov al, WinCharBE
485 call VideoIO_PrintSingleChar
486 mov ch, WinEndPosY
487 mov cl, WinBeginPosX
488 call VideoIO_Locate ; StartPos lower line
489 mov al, WinCharEB
490 call VideoIO_PrintSingleChar
491 pop cx
492 mov al, WinCharRight
493 call VideoIO_Internal_MakeWinRight
494 mov al, WinCharEE
495 call VideoIO_PrintSingleChar
496 ; Frame done, now just filling...
497 mov bh, WinEndPosY
498 sub bh, WinBeginPosY
499 dec bh
500 mov bl, WinEndPosX
501 sub bl, WinBeginPosX
502 dec bl
503
504 VIOIMW_Loop:
505 mov ch, WinBeginPosY
506 add ch, bh
507 mov cl, WinBeginPosX
508 inc cl
509 call VideoIO_Locate
510
511 mov al, 20h
512 mov cl, bl
513 push bx
514 call VideoIO_Internal_MakeWinRight
515 pop bx
516 dec bh
517 jnz VIOIMW_Loop
518 ret
519VideoIO_MakeWindow EndP
520
521; In: AX - Segment to copy B800 to...
522; Destroyed: BX DX
523VideoIO_BackUpTo Proc Near Uses cx ds si es di
524 mov es, ax
525 mov ax, 0B800h
526 mov ds, ax
527 xor si, si
528 xor di, di
529 mov cx, 800h ; Copy 1000h bytes
530 rep movsw
531 ret
532VideoIO_BackUpTo EndP
533
534VideoIO_RestoreFrom Proc Near Uses cx ds si es di
535 mov ds, ax
536 mov ax, 0B800h
537 mov es, ax
538 xor si, si
539 xor di, di
540 mov cx, 800h ; Copy 1000h bytes
541 rep movsw
542 ret
543VideoIO_RestoreFrom EndP
544
545; In: CL - Total Length of String
546; DS:SI - Actual String
547; Out: Carry Set if String was ENTERd
548; Destroyed: *none*
549VideoIO_LetUserEditString Proc Near Uses ax bx cx dx si es di
550 local StartPosX:byte, LastPosX:byte
551 local StringLen:byte
552
553 or cl, cl
554 jnz VIOLUES_LenNotNUL
555 clc
556 ret
557
558 VIOLUES_LenNotNUL:
559 mov al, TextPosX
560 inc al
561 mov StartPosX, al
562 mov StringLen, cl
563
564 push cx
565 call VideoIO_Internal_SetRegs ; ES:DI - Pos on Screen at Start
566
567 xor ch, ch
568 call GetLenOfName ; CX - Actual Length of String
569 mov dl, cl
570
571 ; Set Cursor behind String and turn it on...
572 add cl, StartPosX
573 call VideoIO_Locate
574 call VideoIO_CursorSet
575 call VideoIO_CursorOn ; Set and turn cursor on
576
577 ; ES:DI - Screen-Position to Start of String
578 ; DL - Position in String (relative to begin, base=0)
579
580 VIOLUES_Loop:
581 mov ah, 0
582 int 16h
583 cmp ah, Keys_ESC
584 je VIOLUES_KeyESC
585 cmp ah, Keys_ENTER
586 je VIOLUES_KeyENTER
587 cmp ah, Keys_Backspace
588 je VIOLUES_KeyBACKSPACE
589 ; Check for valid char...
590 cmp al, 32
591 jb VIOLUES_Loop
592 cmp al, 166
593 ja VIOLUES_Loop
594 ; Okay, Character to add to string
595 cmp dl, StringLen ; String "full" ?
596 jae VIOLUES_Loop
597 ;movzx bx, dl
598 mov bl,dl
599 mov bh,0
600
601 shl bx, 1
602 mov es:[di+bx], al
603 inc dl
604 VIOLUES_UpdateCursor:
605 mov cl, dl
606 add cl, StartPosX
607 call VideoIO_Locate
608 call VideoIO_CursorSet
609 jmp VIOLUES_Loop
610
611 VIOLUES_KeyBACKSPACE:
612 or dl, dl ; String "empty" ?
613 jz VIOLUES_Loop
614 mov al, ' '
615 dec dl
616 ;movzx bx, dl
617 mov bl,dl
618 mov bh,0
619
620 shl bx, 1
621 mov es:[di+bx], al
622 jmp VIOLUES_UpdateCursor
623
624 VIOLUES_KeyESC:
625 pop cx
626 call VideoIO_CursorOff ; Bye Bye cursor
627 clc
628 ret
629
630 VIOLUES_KeyENTER:
631 pop cx
632 ; ENTERd, so copy data to String-Pointer...
633 VIOLUES_CopyLoop:
634 mov al, es:[di]
635 add di, 2
636 mov ds:[si], al
637 inc si
638 dec cl
639 jnz VIOLUES_CopyLoop
640 ; Finally Cursor off-line...
641 call VideoIO_CursorOff
642 stc
643 ret
644VideoIO_LetUserEditString EndP
645
646
647
648;
649; Rousseau Additions.
650;
651
652
653; Function Template
654;ProcName Proc Near Uses ax bx cx dx si es di
655;ProcName EndP
656
657
658;
659; Clear the current page
660;
661VideoIO_ClearScreen Proc Near Uses ax bx cx dx si es di
662 mov al, 0 ; clear entire window
663 mov bh,07h ; Attribute for new lines
664 xor cx,cx ; Row, Column ULC
665 xor dx,dx
666 dec dx ; Row, Column LRC (does this corrupt other pages ?)
667 mov ah, 06h ; Function Code
668 int 10h ; Do It !
669 ret
670VideoIO_ClearScreen EndP
671
672;
673; Set position to teletype cursor
674;
675VideoIO_SyncPos Proc Near Uses ax bx cx dx
676 pushf
677 mov bh, 0
678 mov ah, 03h
679 int 10h
680 mov [TextPosX], dl
681 mov [TextPosY], dh
682 popf
683 ret
684VideoIO_SyncPos EndP
685
686;
687; Put the Build Information at the POST BIOS screen.
688;
689VideoIO_PrintBuildInfo Proc Near Uses ax cx si di
690 ; Print header.
691 mov si, offset build_info
692 call MBR_Teletype
693
694 ; Prepare info in temorary buffer.
695 mov si,offset bld_level_date_start
696 mov cx,offset bld_level_date_end
697 sub cx,si
698 mov di,offset Scratch
699 cld
700 rep movsb
701
702 ; Fill spaces until assembler specification.
703 mov al,' '
704 mov cx,37
705 rep stosb
706
707 ; Copy assembler specification.
708 IFDEF JWASM
709 mov al,'['
710 stosb
711 mov si,offset jwasm_txt
712 ELSEIFDEF TASM
713 mov al,' '
714 stosb
715 mov al,'['
716 stosb
717 mov si,offset tasm_txt
718
719 ELSEIFDEF WASM
720 mov al,' '
721 stosb
722 mov al,'['
723 stosb
724 mov si,offset wasm_txt
725 ELSEIFDEF MASM
726 mov al,' '
727 stosb
728 mov al,'['
729 stosb
730 mov si,offset masm_txt
731 ELSE
732 mov al,' '
733 stosb
734 mov al,'['
735 stosb
736 mov si,offset unknown_txt
737 ENDIF
738
739 VideoIO_PrintBuildInfo_a1:
740 lodsb
741 test al,al
742 jz VideoIO_PrintBuildInfo_e1
743 stosb
744 jmp VideoIO_PrintBuildInfo_a1
745 VideoIO_PrintBuildInfo_e1:
746 mov al,']'
747 stosb
748
749 ; Insert NULL Terminator.
750 xor al,al
751 stosb
752
753 ; Print Info.
754 mov si, offset Scratch
755 call MBR_TeletypeNL
756 ret
757VideoIO_PrintBuildInfo EndP
758
759
760; ;mov ch, 21 ; y
761; mov cl, 1 ; x
762; call VideoIO_Locate
763; mov ch, 15 ; fgc
764; mov cl, 0 ; bgc
765; call VideoIO_Color
766
767
768 ; Rousseau:
769; mov al, [NewPartitions]
770 ;call VideoIO_PrintByteDynamicNumber
771; mov al, [CFG_Partitions]
772 ;call VideoIO_PrintByteDynamicNumber
773; ret
774;VideoIO_DBG_WriteString EndP
775
776
777; Dump the disk-info.
778; Disk number is in DL.
779VideoIO_DumpDiskInfo Proc Near uses ax bx cx dx
780
781 VideoIO_DumpDiskInfo_next_disk:
782 push dx
783 xor ax,ax
784 mov al,[TextPosY]
785 push ax
786
787 mov ax,21
788 mov dh,dl
789 and dh,01111111b
790 mul dh
791 mov dh,al
792
793 mov [TextPosX],dh
794
795 mov si, offset [Disk]
796 call VideoIO_Print
797 mov al,dl
798
799 ; NIET GOED, GAAT FOUT > 9, HEX PRINT GEBRUIKEN !!
800 shr al,4
801 add al,'0'
802 call VideoIO_PrintSingleChar
803 mov al,dl
804 and al,01111111b
805 add al,'0'
806 call VideoIO_PrintSingleChar
807 mov al,'h'
808 call VideoIO_PrintSingleChar
809
810 inc [TextPosY]
811 mov [TextPosX],dh
812
813 mov al,'-'
814 mov cl,17
815 call VideoIO_PrintSingleMultiChar
816
817 ;~ inc [TextPosY]
818 ;~ mov [TextPosX],dh
819 ;~ mov si, offset BiosCyls
820 ;~ call VideoIO_Print
821
822 ;~ push dx
823 ;~ mov bx,offset BIOS_Cyls
824 ;~ xor dh,dh
825 ;~ and dl,01111111b
826 ;~ shl dx,1
827 ;~ shl dx,1
828 ;~ add bx,dx
829 ;~ mov ax,[bx]
830 ;~ mov dx,[bx+02]
831 ;~ call VideoIO_PrintHexDWord
832 ;~ pop dx
833
834 inc [TextPosY]
835 mov [TextPosX],dh
836 mov si, offset BiosHeads
837 call VideoIO_Print
838
839 push dx
840 mov bx,offset BIOS_Heads
841 xor dh,dh
842 and dl,01111111b
843 shl dx,1
844 shl dx,1
845 add bx,dx
846 mov ax,[bx]
847 mov dx,[bx+02]
848 call VideoIO_PrintHexDWord
849 pop dx
850
851 inc [TextPosY]
852 mov [TextPosX],dh
853 mov si, offset BiosSecs
854 call VideoIO_Print
855
856 push dx
857 mov bx,offset BIOS_Secs
858 xor dh,dh
859 and dl,01111111b
860 shl dx,1
861 shl dx,1
862 add bx,dx
863 mov ax,[bx]
864 mov dx,[bx+02]
865 call VideoIO_PrintHexDWord
866 pop dx
867
868 inc [TextPosY]
869 mov [TextPosX],dh
870 mov si, offset LvmSecs
871 call VideoIO_Print
872
873 push dx
874 ; Offset of array containing LVM SPT values for each disk found
875 mov bx,offset [TrueSecs]
876 ; DX to index
877 xor dh,dh
878 and dl,01111111b
879 shl dx,1
880 shl dx,1
881 add bx,dx
882 ; Get LVM SPT
883 mov ax,[bx]
884 mov dx,[bx+02]
885 call VideoIO_PrintHexDWord
886 pop dx
887
888 inc [TextPosY]
889 mov [TextPosX],dh
890 mov si, offset BiosLBA
891 call VideoIO_Print
892
893 push dx
894 mov bx,offset BIOS_TotalSecs
895 xor dh,dh
896 and dl,01111111b
897 shl dx,1
898 shl dx,1
899 shl dx,1
900 add bx,dx
901 mov ax,[bx]
902 mov dx,[bx+02]
903 call VideoIO_PrintHexDWord
904 pop dx
905
906 inc [TextPosY]
907 mov [TextPosX],dh
908
909 pop ax
910 mov [TextPosY],al
911 pop dx
912
913 inc dl
914 mov al,dl
915 and al,01111111b
916 cmp al,[TotalHarddiscs]
917 jae VideoIO_DumpDiskInfo_end
918 jmp VideoIO_DumpDiskInfo_next_disk
919
920 VideoIO_DumpDiskInfo_end:
921 mov [TextPosX],0
922 add [TextPosY],6
923 ret
924VideoIO_DumpDiskInfo EndP
925
926
927;
928; Set position to teletype cursor
929;
930VideoIO_ShowWaitDots Proc
931 pusha
932 ; Color white on black
933 mov ch,7
934 mov cl,0
935 call VideoIO_Color
936 ; Locate cursor for output of debug-info
937 mov ch,8
938 mov cl,1
939 call VideoIO_Locate
940
941 ; Print dots with interval.
942 mov cx,10
943 VideoIO_ShowWaitDots_next_dot:
944 mov al,'.'
945 call VideoIO_PrintSingleChar
946 ; Value 30 is about 1.5 seconds
947 mov al,1
948 call TIMER_WaitTicCount
949 loop VideoIO_ShowWaitDots_next_dot
950 popa
951 ret
952VideoIO_ShowWaitDots EndP
953
954
955
956; Disk Info to Dump to AB LogScreen
957Disk db "DISK ",0
958;BiosCyls db "Cyls :",0
959BiosHeads db "Heads :",0
960BiosSecs db "Secs :",0
961LvmSecs db "SecsLVM :",0
962BiosLBA db "LBA Secs:",0
963
964
965HugeBootDisk db "Boot Disk is Huge : ",0
966DisksFound db "Disks Found : ",0
967PartitionsFound db "Partitions Found : ",0
968;AutoStartPart db "Auto Start Partition : ",0
969
970Phase1 db "OS/2 Install Phase 1 : ",0
971
972
973ShowMenu db "Press TAB to return to the AiR-BOOT Menu",0
974;ShowBootLog db "Press TAB to see the Boot Log...",0
975
976Yes db "YES",0
977No db "NO",0
978;~ On db "ON",0
979;~ Off db "OFF",0
980;~ None db "NONE",0
981;~ Active db "ACTIVE",0
982NotActive db "NOT ACTIVE",0
983
984; New Line for use by MBR_Teletype
985NL db 0dh, 0ah, 0
Note: See TracBrowser for help on using the repository browser.