onscreen log output fix

git-svn-id: svn://kolibrios.org@6501 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
pathoswithin 2016-08-25 19:18:19 +00:00
parent 80ebd71171
commit 5f44c836b1

View File

@ -4812,49 +4812,41 @@ sys_msg_board_dword:
msg_board_data_size = 65536 ; Must be power of two msg_board_data_size = 65536 ; Must be power of two
uglobal uglobal
msg_board_data rb msg_board_data_size msg_board_data rb msg_board_data_size
msg_board_count dd 0x0 msg_board_count dd ?
endg
iglobal
msg_board_pos dd 42*6*65536+10 ; for printing debug output on the screen
endg endg
sys_msg_board: sys_msg_board:
; ebx=1 -> write, cl = byte to write
; ebx=1 : write : bl byte to write ; ebx=2 -> read, ecx=0 -> no data, ecx=1 -> data in al
; ebx=2 : read : ebx=0 -> no data, ebx=1 -> data in al push eax ebx
push eax ebx ; Save eax and ebx, since we're restoring their order required.
mov eax, ebx mov eax, ebx
mov ebx, ecx mov ebx, ecx
mov ecx, [msg_board_count] mov ecx, [msg_board_count]
cmp eax, 1 cmp eax, 1
jne .smbl1 jne .read
if defined debug_com_base if defined debug_com_base
push dx ax push dx ax
@@: ; wait for empty transmit register
@@: ; Wait for empty transmit register (yes, this slows down system..)
mov dx, debug_com_base+5 mov dx, debug_com_base+5
in al, dx in al, dx
test al, 1 shl 5 test al, 1 shl 5
jz @r jz @r
mov dx, debug_com_base ; Output the byte mov dx, debug_com_base ; Output the byte
mov al, bl mov al, bl
out dx, al out dx, al
pop ax dx pop ax dx
end if end if
mov [msg_board_data+ecx], bl mov [msg_board_data+ecx], bl
; // if debug_direct_print == 1
cmp byte [debug_direct_print], 1 cmp byte [debug_direct_print], 1
jnz @f jnz .end
pusha pusha
iglobal
msg_board_pos dd (42*6)*65536+10 ; for printing debug output on the screen
endg
lea edx, [msg_board_data+ecx] lea edx, [msg_board_data+ecx]
mov ecx, 0x40FFFFFF mov ecx, 0x40FFFFFF
mov ebx, [msg_board_pos] mov ebx, [msg_board_pos]
@ -4863,37 +4855,52 @@ endg
call dtext call dtext
popa popa
add word [msg_board_pos+2], 6 add word [msg_board_pos+2], 6
cmp word [msg_board_pos+2], 105*6
jnc @f
cmp bl, 10 cmp bl, 10
jnz @f jnz .end
mov word [msg_board_pos+2], (42*6) @@:
mov word [msg_board_pos+2], 42*6
add word [msg_board_pos], 10 add word [msg_board_pos], 10
mov ax, word [_display.width] mov eax, [_display.height]
cmp word [msg_board_pos], ax sub eax, 10
jb @f cmp ax, word [msg_board_pos]
jnc @f
mov word [msg_board_pos], 10 mov word [msg_board_pos], 10
@@: @@:
; // end if
if 0
pusha pusha
mov al, bl mov eax, [msg_board_pos]
mov edx, 402h movzx ebx, ax
out dx, al shr eax, 16
mov edx, 105*6
xor ecx, ecx
mov edi, 1
mov esi, 9
@@:
call hline
inc ebx
dec esi
jnz @b
popa popa
end if .end:
inc ecx inc ecx
and ecx, msg_board_data_size - 1 and ecx, msg_board_data_size - 1
mov [msg_board_count], ecx mov [msg_board_count], ecx
.ret:
pop ebx eax pop ebx eax
ret ret
.smbl1:
cmp eax, 2
jne .smbl2
test ecx, ecx
jz .smbl21
add esp, 8 ; Returning data in ebx and eax, so no need to restore them. @@:
mov [esp+32], ecx
mov [esp+20], ecx
jmp .ret
.read:
cmp eax, 2
jne .ret
test ecx, ecx
jz @b
add esp, 8 ; returning data in ebx and eax, so no need to restore them
mov eax, msg_board_data+1 mov eax, msg_board_data+1
mov ebx, msg_board_data mov ebx, msg_board_data
movzx edx, byte [ebx] movzx edx, byte [ebx]
@ -4902,12 +4909,6 @@ end if
mov [esp + 32], edx ;eax mov [esp + 32], edx ;eax
mov [esp + 20], dword 1 mov [esp + 20], dword 1
ret ret
.smbl21:
mov [esp+32], ecx
mov [esp+20], ecx
.smbl2:
pop ebx eax
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 66 sys function. ;; ;; 66 sys function. ;;