Small bugfixes and cleanup.

git-svn-id: svn://kolibrios.org@4623 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2014-03-09 21:57:21 +00:00
parent a6a2dda144
commit 2a493360e5
7 changed files with 366 additions and 276 deletions

View File

@ -282,6 +282,23 @@ draw_windowtabs:
cmp [edi + window.data_ptr], 0 cmp [edi + window.data_ptr], 0
jne .more_btn jne .more_btn
; Draw the close window button
mov edi, [window_active]
cmp [edi + window.type], WINDOWTYPE_SERVER ; dont let the user close server window
je @f
; mov eax, 8
mov ebx, [xsize]
sub ebx, 12
shl ebx, 16
mov bx, 12
mov ecx, 6 shl 16 + 12
mov edx, WINDOW_BTN_CLOSE
mov esi, 0x00aa0000 ; red !
mcall
@@:
; Draw the windownames onto the buttons ; Draw the windownames onto the buttons
mov eax, 4 mov eax, 4
@ -305,25 +322,28 @@ draw_windowtabs:
jnz .more jnz .more
.enough: .enough:
; Draw the close window button
mov edi, [window_active]
cmp [edi + window.type], WINDOWTYPE_SERVER ; dont let the user close server window
je @f
mov eax, 8
mov ebx, [xsize]
sub ebx, 12
shl ebx, 16
mov bx, 12
mov ecx, 6 shl 16 + 12
mov edx, WINDOW_BTN_CLOSE
; mov esi, [colors.work_button]
mov esi, 0x00aa0000 ; red !
mcall
@@:
ret ret
highlight_updated_tabs:
mov eax, 4
mov ebx, 10 shl 16 + 15
mov ecx, 0x80aa0000
mov esi, MAX_WINDOWS
mov edi, windows
.more_:
test [edi + window.flags], FLAG_UPDATED
jz .next
lea edx, [edi + window.name]
mcall
.next:
add edi, sizeof.window ; get ptr to next window
cmp [edi + window.data_ptr], 0
je .enough_
add ebx, 125 shl 16
dec esi
jnz .more_
.enough_:
ret

View File

@ -13,7 +13,7 @@
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
version equ '0.19' version equ '0.20'
; connection status ; connection status
STATUS_DISCONNECTED = 0 STATUS_DISCONNECTED = 0
@ -200,7 +200,7 @@ START:
; Welcome user ; Welcome user
mov esi, str_welcome mov esi, str_welcome
call print_text2 call print_asciiz
; Check if parameter contains an URL ; Check if parameter contains an URL
cmp byte[param], 0 cmp byte[param], 0
@ -242,6 +242,7 @@ mainloop:
jne .no_update jne .no_update
call draw_channel_list call draw_channel_list
.no_update: .no_update:
call highlight_updated_tabs
jmp mainloop jmp mainloop
@ -290,8 +291,9 @@ button:
mov ebx, [ebx + window.data_ptr] mov ebx, [ebx + window.data_ptr]
lea esi, [ebx + window_data.names + eax] lea esi, [ebx + window_data.names + eax]
call window_open call window_open
push [window_print] test ebx, ebx
pop [window_active] jz mainloop
mov [window_active], ebx
call redraw call redraw
jmp mainloop jmp mainloop
@ -303,6 +305,11 @@ button:
cmp ax, MAX_WINDOWS cmp ax, MAX_WINDOWS
ja exit ja exit
; Save users scrollbar position
push [scroll1.position]
mov edx, [window_active]
pop [edx + window.users_scroll]
; OK, time to switch to another window. ; OK, time to switch to another window.
mov dx, sizeof.window mov dx, sizeof.window
mul dx mul dx
@ -316,6 +323,9 @@ button:
push [edx + window.text_line_print] push [edx + window.text_line_print]
pop [scroll2.position] pop [scroll2.position]
push [edx + window.users_scroll]
pop [scroll1.position]
call draw_window call draw_window
jmp mainloop jmp mainloop
@ -436,7 +446,7 @@ ctcp_time db '] TIME', 10, 0
has_left_channel db ' has left ', 0 has_left_channel db ' has left ', 0
joins_channel db ' has joined ', 0 joins_channel db ' has joined ', 0
is_now_known_as db ' is now known as ', 0 is_now_known_as db ' is now known as ', 0
has_quit_irc db ' has quit IRC.', 10, 0 has_quit_irc db ' has quit IRC', 10, 0
sets_mode db ' sets mode ', 0 sets_mode db ' sets mode ', 0
str_kicked db ' is kicked from ', 0 str_kicked db ' is kicked from ', 0
@ -445,7 +455,7 @@ str_nickchange db 'Nickname is now ', 0
str_realchange db 'Real name is now ', 0 str_realchange db 'Real name is now ', 0
str_talking db 'Now talking in ', 0 str_talking db 'Now talking in ', 0
str_topic db 'Topic is "', 0 str_topic db 'Topic is "', 0
str_topic_end db '".', 10, 0 str_topic_end db '"', 10, 0
str_setby db 'Set by ', 0 str_setby db 'Set by ', 0
str_connecting db 3, '3* Connecting to ', 0 str_connecting db 3, '3* Connecting to ', 0
@ -456,17 +466,25 @@ str_disconnected db 3, '5* Server disconnected', 10, 0
str_reconnect db 3, '5* Connection reset by user', 10, 0 str_reconnect db 3, '5* Connection reset by user', 10, 0
str_notconnected db 3, '5* Not connected to server', 10, 0 str_notconnected db 3, '5* Not connected to server', 10, 0
str_dotnewline db '.',10, 0
str_newline db 10, 0
str_1 db 3, '13 -', 0 str_1 db 3, '13 -', 0
str_2 db '- ', 0 str_2 db '- ', 0
str_help db 10, 'following commands are available:', 10 str_list db 'list', 0
str_help db 'The following commands are available:', 10
db 10 db 10
db '/nick <nick> : change nickname to <nick>', 10 db '/nick <nick> : change nickname', 10
db '/real <real name> : change real name to <real name>', 10 db '/real <real name> : change real name', 10
db '/server <address> : connect to server <address>', 10 db '/server <address> : connect to server', 10
db '/code <code> : change codepage to cp866, cp1251, or utf8', 10, 0 db '/code <code> : change codepage (cp866, cp1251, or utf8)', 10
db '/join <channel> : join a channel', 10
db '/part <channel> : part from a channel', 10
db '/quit : quit server', 10
db '/msg <user> : send a private message', 10
db '/ctcp <user> : send a message using client to client protocol', 10
db 10
db 'Other commands are send straight to server.', 10
db 10, 0
str_welcome db 3, '3 ___', 3, '7__________', 3, '6_________ ', 3, '4 __ __ __', 10 str_welcome db 3, '3 ___', 3, '7__________', 3, '6_________ ', 3, '4 __ __ __', 10
db 3, '3| \', 3, '7______ \', 3, '6_ ___ \ ', 3, '4 ____ | | |__| ____ _____/ |_', 10 db 3, '3| \', 3, '7______ \', 3, '6_ ___ \ ', 3, '4 ____ | | |__| ____ _____/ |_', 10
@ -584,10 +602,3 @@ quit_msg rb 250
windows rb MAX_WINDOWS*sizeof.window windows rb MAX_WINDOWS*sizeof.window
IM_END: IM_END:

View File

@ -171,10 +171,12 @@ skip_parameter:
cmd_justprint: cmd_justprint:
add esi, 4 add esi, 4
call skip_parameter call skip_parameter ; our nickname
call print_text2
mov esi, str_newline call print_asciiz
call print_text2
mov al, 10
call print_char
ret ret
@ -191,22 +193,22 @@ cmd_notice:
mov byte [esi-1], 0 mov byte [esi-1], 0
push esi push esi
mov esi, str_1 mov esi, str_1
call print_text2 call print_asciiz
mov eax, servercommand+1 mov esi, servercommand+1
mov dl, '!' mov bl, '!'
call print_text call print_string
mov esi, str_2 mov esi, str_2
call print_text2 call print_asciiz
pop esi pop esi
.gogogo: .gogogo:
add esi, 6 add esi, 6
call skip_parameter call skip_parameter
call skip_parameter call skip_parameter
call print_text2 call print_asciiz
mov esi, str_newline mov al, 10
call print_text2 call print_char
ret ret
@ -251,6 +253,8 @@ cmd_privmsg:
push esi push esi
mov esi, servercommand+1 mov esi, servercommand+1
call window_open call window_open
test ebx, ebx
jz .fail2
pop esi pop esi
call skip_parameter ; our own nickname call skip_parameter ; our own nickname
@ -261,6 +265,8 @@ cmd_privmsg:
.channel: .channel:
call window_open call window_open
test ebx, ebx
jz .fail
.print: .print:
; nope, just plain old privmsg, print it using '<nick> message' format ; nope, just plain old privmsg, print it using '<nick> message' format
@ -269,25 +275,29 @@ cmd_privmsg:
end if end if
push esi push esi
mov bl, '<' mov al, '<'
call print_character call print_char
mov eax, servercommand+1 mov esi, servercommand+1
mov dl, '!' mov bl, '!'
call print_text call print_string
mov bl, '>' mov al, '>'
call print_character call print_char
mov bl, ' ' mov al, ' '
call print_character call print_char
pop esi pop esi
call print_text2 call print_asciiz
mov bl, 10 mov al, 10
call print_character call print_char
ret
.fail2:
pop esi
.fail: .fail:
ret ret
@ -355,13 +365,13 @@ cmd_ctcp:
end if end if
mov esi, ctcp_header mov esi, ctcp_header
call print_text2 call print_asciiz
mov esi, servercommand+1 mov esi, servercommand+1
call print_text2 call print_asciiz
mov esi, ctcp_time mov esi, ctcp_time
call print_text2 call print_asciiz
ret ret
@ -374,13 +384,13 @@ cmd_ctcp:
end if end if
mov esi, ctcp_header mov esi, ctcp_header
call print_text2 call print_asciiz
mov esi, servercommand+1 mov esi, servercommand+1
call print_text2 call print_asciiz
mov esi, ctcp_version mov esi, ctcp_version
call print_text2 call print_asciiz
ret ret
@ -392,13 +402,13 @@ cmd_ctcp:
end if end if
mov esi, ctcp_header mov esi, ctcp_header
call print_text2 call print_asciiz
mov esi, servercommand+1 mov esi, servercommand+1
call print_text2 call print_asciiz
mov esi, ctcp_ping mov esi, ctcp_ping
call print_text2 call print_asciiz
ret ret
@ -411,20 +421,20 @@ cmd_ctcp:
end if end if
mov esi, action_header mov esi, action_header
call print_text2 call print_asciiz
mov eax, servercommand+1 ; print nickname mov esi, servercommand+1 ; print nickname
mov dl, '!' mov bl, '!'
call print_text call print_string
mov bl, ' ' mov al, ' '
call print_character call print_char
pop esi pop esi
call print_text2 ; print message call print_asciiz
mov bl, 10 mov al, 10
call print_character call print_char
ret ret
@ -440,10 +450,13 @@ cmd_dcc:
ret ret
.send: .send:
call window_open call window_open
test ebx, ebx
jz .fail
mov [ebx + window.type], WINDOWTYPE_DCC mov [ebx + window.type], WINDOWTYPE_DCC
.fail:
ret ret
@ -520,27 +533,28 @@ cmd_part:
.not_me: .not_me:
push esi push esi
call window_open call window_open
test ebx, ebx
jz .fail2
if TIMESTAMP if TIMESTAMP
call print_timestamp call print_timestamp
end if end if
mov esi, part_header mov esi, part_header
call print_text2 call print_asciiz
mov eax, servercommand+1 mov esi, servercommand+1
mov dl, '!' mov bl, '!'
mov cl, ' ' call print_string
call print_text
mov esi, has_left_channel mov esi, has_left_channel
call print_text2 call print_asciiz
pop esi pop esi
call print_text2 call print_asciiz
mov esi, str_newline mov al, 10
call print_text2 call print_char
mov ebx, [window_print] mov ebx, [window_print]
mov esi, servercommand+1 mov esi, servercommand+1
@ -548,6 +562,11 @@ cmd_part:
ret ret
.fail2:
pop esi
ret
cmd_join: cmd_join:
@ -556,14 +575,14 @@ cmd_join:
jne .fail jne .fail
add esi, 5 ; skip 'JOIN ' add esi, 5 ; skip 'JOIN '
; compare nick: did we join a channel? ; did we join a channel?
mov edi, servercommand+1 mov edi, servercommand+1
call compare_to_nick call compare_to_nick
jne .not_me jne .not_me
push esi push esi
call window_open call window_open
test eax, eax test ebx, ebx
jz .fail jz .fail
mov [ebx + window.type], WINDOWTYPE_CHANNEL mov [ebx + window.type], WINDOWTYPE_CHANNEL
mov [window_active], ebx mov [window_active], ebx
@ -573,17 +592,17 @@ cmd_join:
end if end if
mov esi, join_header mov esi, join_header
call print_text2 call print_asciiz
mov esi, str_talking mov esi, str_talking
call print_text2 call print_asciiz
pop eax pop esi
mov dl, ' ' mov bl, ' '
call print_text call print_string
mov esi, str_dotnewline mov al, 10
call print_text2 call print_char
call draw_window call draw_window
@ -592,26 +611,28 @@ cmd_join:
.not_me: .not_me:
push esi push esi
call window_open call window_open
test ebx, ebx
jz .fail
if TIMESTAMP if TIMESTAMP
call print_timestamp call print_timestamp
end if end if
mov esi, join_header mov esi, join_header
call print_text2 call print_asciiz
mov eax, servercommand+1 mov esi, servercommand+1
mov dl, '!' mov bl, '!'
call print_text call print_string
mov esi, joins_channel mov esi, joins_channel
call print_text2 call print_asciiz
pop esi pop esi
call print_text2 call print_asciiz
mov esi, str_newline mov al, 10
call print_text2 call print_char
mov ebx, [window_print] mov ebx, [window_print]
mov esi, servercommand+1 mov esi, servercommand+1
@ -620,7 +641,7 @@ cmd_join:
ret ret
.fail: .fail:
add esp, 4 pop esi
ret ret
@ -690,20 +711,20 @@ cmd_nick:
end if end if
mov esi, nick_header mov esi, nick_header
call print_text2 call print_asciiz
mov eax, servercommand+1 mov esi, servercommand+1
mov dl, '!' mov bl, '!'
call print_text call print_string
mov esi, is_now_known_as mov esi, is_now_known_as
call print_text2 call print_asciiz
mov esi, [esp + 8] ; FIXME: dont print the 0x0a0d!!! mov esi, [esp + 8]
call print_text2 call print_asciiz
mov esi, str_newline mov al, 10
call print_text2 call print_char
; Now do this for all open windows ; Now do this for all open windows
.next_window: .next_window:
@ -734,6 +755,8 @@ cmd_kick:
; find the channel user has been kicked from ; find the channel user has been kicked from
push esi push esi
call window_open call window_open
test ebx, ebx
jz .fail
push esi push esi
if TIMESTAMP if TIMESTAMP
@ -741,34 +764,37 @@ cmd_kick:
end if end if
mov esi, kick_header mov esi, kick_header
call print_text2 call print_asciiz
pop eax pop esi
mov dl, ' ' mov bl, ' '
call print_text call print_string
mov esi, str_kicked mov esi, str_kicked
call print_text2 call print_asciiz
pop eax pop esi
mov dl, ' ' mov bl, ' '
call print_text call print_string
mov esi, str_by mov esi, str_by
call print_text2 call print_asciiz
mov eax, servercommand+1 mov esi, servercommand+1
mov dl, '!' mov bl, '!'
call print_text call print_string
mov esi, str_dotnewline mov al, 10
call print_text2 call print_char
mov ebx, [window_print] mov ebx, [window_print]
mov esi, servercommand+1 mov esi, servercommand+1
call user_remove call user_remove
ret
.fail: .fail:
pop esi
ret ret
@ -800,14 +826,14 @@ cmd_quit:
end if end if
mov esi, quit_header mov esi, quit_header
call print_text2 call print_asciiz
mov eax, servercommand+1 mov esi, servercommand+1
mov dl, '!' mov bl, '!'
call print_text call print_string
mov esi, has_quit_irc mov esi, has_quit_irc
call print_text2 call print_asciiz
; TODO: check if quit message was given, and print it to the window ; TODO: check if quit message was given, and print it to the window
pop ebx pop ebx
@ -841,20 +867,20 @@ cmd_mode:
end if end if
mov esi, mode_header mov esi, mode_header
call print_text2 call print_asciiz
mov eax, servercommand+1 mov esi, servercommand+1
mov dl, '!' mov bl, '!'
call print_text call print_string
mov esi, sets_mode mov esi, sets_mode
call print_text2 call print_asciiz
pop esi pop esi
call print_text2 call print_asciiz
mov esi, str_newline mov al, 10
call print_text2 call print_char
; TODO: keep track of user modes in username list ; TODO: keep track of user modes in username list
@ -868,21 +894,21 @@ cmd_mode:
end if end if
mov esi, mode_header mov esi, mode_header
call print_text2 call print_asciiz
mov eax, [esp] mov esi, [esp]
mov dl, ' ' mov bl, ' '
call print_text call print_string
mov esi, sets_mode mov esi, sets_mode
call print_text2 call print_asciiz
pop esi pop esi
call skip_parameter call skip_parameter
call print_text2 call print_asciiz
mov esi, str_newline mov al, 10
call print_text2 call print_char
ret ret
@ -894,6 +920,8 @@ cmd_353: ; channel usernames reply
inc esi ; channel type '*', '=' or '@' inc esi ; channel type '*', '=' or '@'
inc esi ; ' ' inc esi ; ' '
call window_open call window_open
test ebx, ebx
jz .fail
; now find window ptr and check if this is the first 353 message ; now find window ptr and check if this is the first 353 message
mov ebx, [window_print] mov ebx, [window_print]
@ -919,6 +947,7 @@ cmd_353: ; channel usernames reply
.done: .done:
call draw_channel_list call draw_channel_list
.fail:
ret ret
@ -931,9 +960,10 @@ cmd_366: ; channel usernames end
add esi, 4 ; skip '366 ' add esi, 4 ; skip '366 '
call skip_parameter call skip_parameter
call window_open call window_open
test ebx, ebx
mov ebx, [window_print] jz .fail
and [ebx + window.flags], not FLAG_RECEIVING_NAMES and [ebx + window.flags], not FLAG_RECEIVING_NAMES
.fail:
ret ret
@ -945,6 +975,8 @@ cmd_topic:
add esi, 4 ; skip '332 ' add esi, 4 ; skip '332 '
call skip_parameter call skip_parameter
call window_open call window_open
test ebx, ebx
jz .fail
if TIMESTAMP if TIMESTAMP
call print_timestamp call print_timestamp
@ -952,16 +984,18 @@ cmd_topic:
push esi push esi
mov esi, topic_header mov esi, topic_header
call print_text2 call print_asciiz
mov esi, str_topic mov esi, str_topic
call print_text2 call print_asciiz
pop esi pop esi
call print_text2 call print_asciiz
mov esi, str_topic_end mov esi, str_topic_end
call print_text2 call print_asciiz
.fail:
ret ret
@ -971,6 +1005,8 @@ cmd_333:
add esi, 4 ; skip '333 ' add esi, 4 ; skip '333 '
call skip_parameter call skip_parameter
call window_open call window_open
test ebx, ebx
jz .fail
if TIMESTAMP if TIMESTAMP
call print_timestamp call print_timestamp
@ -978,32 +1014,46 @@ cmd_333:
push esi push esi
mov esi, topic_header mov esi, topic_header
call print_text2 call print_asciiz
mov esi, str_setby mov esi, str_setby
call print_text2 call print_asciiz
pop eax pop esi
mov dl, '!' mov bl, '!'
call print_text call print_string
mov esi, str_newline mov al, 10
call print_text2 call print_char
.fail: .fail:
ret ret
cmd_322: ; LIST cmd_322: ; LIST
add esi, 4 add esi, 4
mov [window_print], windows ; FIXME
call skip_parameter call skip_parameter
mov eax, esi
mov dl, 13 push esi
call print_text mov esi, str_list
mov esi, str_newline call window_open
call print_text2 test ebx, ebx
jz .fail
mov [window_active], ebx
call draw_windowtabs
pop esi
call print_asciiz
mov al, 10
call print_char
ret
.fail:
pop esi
ret ret

View File

@ -21,11 +21,13 @@ socket_connect:
call print_timestamp call print_timestamp
end if end if
mov esi, str_connecting mov esi, str_connecting
call print_text2 call print_asciiz
mov esi, irc_server_name mov esi, irc_server_name
call print_text2 call print_asciiz
mov esi, str_dotnewline
call print_text2 mov al, 10
call print_char
; update status ; update status
inc [status] ; was STATUS_DISCONNECTED, now STATUS_RESOLVING inc [status] ; was STATUS_DISCONNECTED, now STATUS_RESOLVING
@ -73,7 +75,7 @@ socket_connect:
call print_timestamp call print_timestamp
end if end if
mov esi, str_sockerr mov esi, str_sockerr
call print_text2 call print_asciiz
ret ret
@ -84,7 +86,7 @@ socket_connect:
call print_timestamp call print_timestamp
end if end if
mov esi, str_dnserr mov esi, str_dnserr
call print_text2 call print_asciiz
ret ret
@ -95,7 +97,7 @@ socket_connect:
call print_timestamp call print_timestamp
end if end if
mov esi, str_refused mov esi, str_refused
call print_text2 call print_asciiz
ret ret
@ -104,7 +106,7 @@ socket_connect:
call print_timestamp call print_timestamp
end if end if
mov esi, str_reconnect mov esi, str_reconnect
call print_text2 call print_asciiz
mov esi, quit_msg mov esi, quit_msg
call cmd_usr_quit.with_message call cmd_usr_quit.with_message
@ -249,7 +251,7 @@ socket_receive:
.disconnected: .disconnected:
mov esi, str_disconnected mov esi, str_disconnected
call print_text2 call print_asciiz
mov [status], STATUS_DISCONNECTED mov [status], STATUS_DISCONNECTED
mcall close, [socketnum] mcall close, [socketnum]

View File

@ -52,9 +52,13 @@ text_insert_newlines: ; esi = ASCIIZ string
ret ret
;----------------------------------
; scan untill next line is reached
;
; When you set the direction flag before calling, you can also scan for previous line! ; When you set the direction flag before calling, you can also scan for previous line!
; in: esi ; IN: esi
; out:esi ; OUT: esi
;----------------------------------
text_nextline: text_nextline:
mov ecx, [textbox_width] mov ecx, [textbox_width]
@ -73,52 +77,65 @@ text_nextline:
ret ret
print_text: ; eax = start ptr ;----------------------------------
; dl = end char ; print string
pusha ;
ptr2: ; IN: esi = ptr to string
mov bl, [eax] ; bl = char which marks end of string
; OUT: esi = ptr to end of str
;----------------------------------
print_string:
cmp bl, dl push eax
.loop:
lodsb
cmp al, bl
je .done je .done
test bl, bl cmp al, 13
je .loop
test al, al
jz .done jz .done
call print_character call print_char
jmp .loop
inc eax
jmp ptr2
.done: .done:
popa pop eax
ret ret
;----------------------------------
; print ASCIIZ string
;
; IN: esi = ptr to ASCIIZ string
; OUT: esi = ptr to end of str
;----------------------------------
print_asciiz:
print_text2: ; esi = ptr to ASCIIZ string push eax
pusha
.loop: .loop:
lodsb lodsb
test al, al test al, al
jz .done jz .done
mov bl, al call print_char
call print_character
jmp .loop jmp .loop
.done: .done:
popa pop eax
ret ret
print_character: ;----------------------------------
; print character
;
; IN: al = char to print
; OUT: /
;----------------------------------
print_char:
push esi edi push esi edi
mov esi, [window_print] mov esi, [window_print]
mov edi, [esi + window.text_write] mov edi, [esi + window.text_write]
mov byte[edi], bl stosb
inc edi
cmp edi, [esi + window.text_end] cmp edi, [esi + window.text_end]
jae .uh_ow jae .uh_ow
mov [esi + window.text_write], edi mov [esi + window.text_write], edi
@ -330,33 +347,34 @@ print_timestamp:
pusha pusha
mcall 3 ; get system time mcall 3 ; get system time
mov ebx, eax
mov bl, '[' mov al, '['
call print_character call print_char
mov ecx, TIMESTAMP mov ecx, TIMESTAMP
.loop: .loop:
mov bl, al mov al, bl
shr bl, 4 shr al, 4
add bl, '0' add al, '0'
call print_character call print_char
mov bl, al mov al, bl
and bl, 0x0f and al, 0x0f
add bl, '0' add al, '0'
call print_character call print_char
dec ecx dec ecx
jz .done jz .done
mov bl, ':' mov al, ':'
call print_character call print_char
shr eax, 8 shr ebx, 8
jmp .loop jmp .loop
.done: .done:
mov bl, ']' mov al, ']'
call print_character call print_char
mov bl, ' ' mov al, ' '
call print_character call print_char
popa popa
ret ret

View File

@ -35,25 +35,25 @@ user_parser:
call print_timestamp call print_timestamp
end if end if
mov bl, '<' mov al, '<'
call print_character call print_char
mov esi, user_nick mov esi, user_nick
call print_text2 call print_asciiz
mov bl, '>' mov al, '>'
call print_character call print_char
mov bl, ' ' mov al, ' '
call print_character call print_char
mov eax, [edit1.size] mov eax, [edit1.size]
mov byte[usercommand + eax],0 mov byte[usercommand + eax],0
mov esi, usercommand mov esi, usercommand
call print_text2 call print_asciiz
mov bl, 10 mov al, 10
call print_character call print_char
; and now send it to the server ; and now send it to the server
mov dword[packetbuf], 'PRIV' mov dword[packetbuf], 'PRIV'
@ -92,7 +92,7 @@ user_parser:
.notconnected: .notconnected:
mov esi, str_notconnected mov esi, str_notconnected
call print_text2 call print_asciiz
ret ret
@ -145,7 +145,7 @@ server_command:
.notconnected: .notconnected:
mov esi, str_notconnected mov esi, str_notconnected
call print_text2 call print_asciiz
ret ret
@ -200,20 +200,20 @@ cmd_usr_msg:
end if end if
mov esi, msg_header mov esi, msg_header
call print_text2 call print_asciiz
mov eax, packetbuf+8
mov dl, ' '
call print_text
mov bl, '*'
call print_character
mov esi, packetbuf+8
mov bl, ' ' mov bl, ' '
call print_character call print_string
mov al, '*'
call print_char
mov al, ' '
call print_char
pop esi pop esi
call print_text2 call print_asciiz
.fail: .fail:
ret ret
@ -313,11 +313,13 @@ cmd_usr_nick:
stosb stosb
mov esi, str_nickchange mov esi, str_nickchange
call print_text2 call print_asciiz
mov esi, user_nick mov esi, user_nick
call print_text2 call print_asciiz
mov esi, str_dotnewline
call print_text2 mov al, 10
call print_char
ret ret
@ -343,11 +345,13 @@ cmd_usr_real:
stosb stosb
mov esi, str_realchange mov esi, str_realchange
call print_text2 call print_asciiz
mov esi, user_real_name mov esi, user_real_name
call print_text2 call print_asciiz
mov esi, str_dotnewline
call print_text2 mov al, 10
call print_char
ret ret
@ -394,6 +398,8 @@ cmd_usr_quer:
mov esi, usercommand+7 mov esi, usercommand+7
call window_open call window_open
; test ebx, ebx
; jz .fail
ret ret
@ -402,7 +408,7 @@ cmd_usr_quer:
cmd_usr_help: cmd_usr_help:
mov esi, str_help mov esi, str_help
call print_text2 call print_asciiz
ret ret

View File

@ -82,25 +82,6 @@ window_set_name:
ret ret
window_is_updated:
mov edi, [window_print]
cmp edi, [window_active]
je .skip
test [edi + window.flags], FLAG_UPDATED
jnz .skip
or [edi + window.flags], FLAG_UPDATED
; TODO: make some noise
call draw_windowtabs ; highlight updated tabs
.skip:
ret
window_close: ; closes the 'print' window window_close: ; closes the 'print' window
; Remove the window (overwrite current structure with trailing ones) ; Remove the window (overwrite current structure with trailing ones)
@ -180,6 +161,7 @@ window_find:
; ;
; IN: esi = ptr to ASCIIZ windowname ; IN: esi = ptr to ASCIIZ windowname
; OUT: esi = ptr to next parameter ; OUT: esi = ptr to next parameter
; ebx = window ptr/0 on error
window_open: window_open:
@ -226,5 +208,6 @@ window_open:
mov [window_print], ebx mov [window_print], ebx
ret ret
.error: ; TODO: return error? .error:
xor ebx, ebx
ret ret