gifview, jpegview, trantest, calc, menu, end - small fixes

icon2.lst renamed to icons.dat (it will be easer for new users I hope...)
airc with cp1251 support from mike.dld
kbd with boot-parameter to automatic enabling bus disconnect where it possible

git-svn-id: svn://kolibrios.org@195 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
heavyiron 2006-10-26 14:43:39 +00:00
parent ef2a2e0e6a
commit ae5e114234
21 changed files with 1190 additions and 274 deletions

View File

@ -29,7 +29,7 @@ red:
still: still:
scevent red,key,button scevent red,key,button
fps 290,8,cl_White,cl_Black fps 250,8,cl_White,cl_Black
main_loop: main_loop:
random SCREEN_X,eax random SCREEN_X,eax
@ -85,9 +85,9 @@ draw_window:
int 0x40 int 0x40
xor eax,eax ;Draw window xor eax,eax ;Draw window
mov ebx,100*65536+(SCREEN_X+19) ;x start*65536+x size mov ebx,100*65536+(SCREEN_X+9) ;x start*65536+x size
mov ecx,100*65536+(SCREEN_Y+51) ;y start*65536+y size mov ecx,100*65536+(SCREEN_Y+26) ;y start*65536+y size
mov edx,0x33000000 ;0x33 use skinned window mov edx,0x13000000 ;0x33 use skinned window
mov edi,header mov edi,header
int 0x40 int 0x40

View File

@ -1,4 +1,5 @@
@erase lang.inc @erase lang.inc
@echo lang fix en >lang.inc @echo lang fix en >lang.inc
@fasm gifview.asm gifview @fasm gifview.asm gifview
@erase lang.inc
@pause @pause

View File

@ -1,4 +1,5 @@
@erase lang.inc @erase lang.inc
@echo lang fix ru >lang.inc @echo lang fix ru >lang.inc
@fasm gifview.asm gifview @fasm gifview.asm gifview
@erase lang.inc
@pause @pause

View File

@ -8,11 +8,12 @@
; ;
; COMPILE WITH FASM ; COMPILE WITH FASM
WND_COLOR equ 0x02aabbcc appname equ 'GIF VIEWER'
; input line dimensions ; input line dimensions
INP_X equ 10 shl 16+680 INP_X equ 5 shl 16+680
INP_Y equ 25 shl 16+16 INP_Y equ 5 shl 16+16
INP_XY equ 15 shl 16+30 INP_XY equ 10 shl 16+10
use32 use32
@ -29,7 +30,6 @@ use32
include 'lang.inc' include 'lang.inc'
include 'macros.inc' ; decrease code size (optional) include 'macros.inc' ; decrease code size (optional)
;include '/hd/1/meos/debug.inc'
include 'debug.inc' include 'debug.inc'
COLOR_ORDER equ MENUETOS COLOR_ORDER equ MENUETOS
@ -182,7 +182,7 @@ draw_input:
push edi push edi
cmp [entered],0 cmp [entered],0
jne highlight jne highlight
mov esi,WND_COLOR mov esi,0x00aabbcc
jmp di_draw jmp di_draw
highlight: highlight:
mov esi,0xe0e0e0 mov esi,0xe0e0e0
@ -193,7 +193,7 @@ draw_input:
mov edx,2 mov edx,2
int 0x40 int 0x40
mov eax,4 mov eax,4
mov ecx,0x00107a30 ; èà¨äâ 1 ¨ 梥â ( 0xF0RRGGBB ) mov ecx,0x00107a30
mov ebx,INP_XY mov ebx,INP_XY
mov edx,fn_input mov edx,fn_input
mov esi,[inp_pos] mov esi,[inp_pos]
@ -207,6 +207,12 @@ draw_input:
draw_window: draw_window:
mov eax,48
mov ebx,3
mov ecx,sc
mov edx,sizeof.system_colors
int 0x40
mov eax,12 mov eax,12
mov ebx,1 mov ebx,1
int 0x40 int 0x40
@ -214,24 +220,9 @@ draw_window:
mov eax,0 mov eax,0
mov ebx,50*65536+700 mov ebx,50*65536+700
mov ecx,50*65536+500 mov ecx,50*65536+500
mov edx,WND_COLOR mov edx,[sc.work]
mov esi,0x805080d0 or edx,0x33000000
mov edi,0x005080d0 mov edi,header
int 0x40
mov eax,4
mov ebx,8*65536+8
mov ecx,0x10ddeeff
mov edx,zagolovok
mov esi,zag_konets-zagolovok
int 0x40
mov eax,8
mov ebx,(700-19)*65536+12
mov ecx,5*65536+12
mov edx,1
mov esi,0x6688dd
int 0x40 int 0x40
call draw_input call draw_input
@ -266,7 +257,7 @@ draw_subimage:
movzx edx,[gif_inf.Left] movzx edx,[gif_inf.Left]
shl edx,16 shl edx,16
add edx,eax add edx,eax
add edx,10 shl 16 +45 add edx,5 shl 16 +25
mov eax,7 mov eax,7
int 0x40 int 0x40
.enddraw: .enddraw:
@ -274,15 +265,7 @@ draw_subimage:
; ‡¤¥áì ­ å®¤ïâáï ¤ ­­ë¥ ¯à®£à ¬¬ë: ; ‡¤¥áì ­ å®¤ïâáï ¤ ­­ë¥ ¯à®£à ¬¬ë:
; ¨­â¥àä¥©á ¯à®£à ¬¬ë ¤¢ãï§ëç­ë© - § ¤ ©â¥ ï§ëª ¢ macros.inc header db appname,0 ; áâப  § £®«®¢ª 
zagolovok: ; áâப  § £®«®¢ª 
if lang eq ru
db '<27><>ŽŒŽ<C5BD> GIF'
else
db 'GIF VIEWER'
end if
zag_konets: ; ¨ ¥ñ ª®­¥æ
inp_pos dd inp_end-fn_input inp_pos dd inp_end-fn_input
fn_input: fn_input:
@ -309,6 +292,7 @@ filename:
rb 257 rb 257
;filename_len dd 0 ;filename_len dd 0
entered rd 1 entered rd 1
sc system_colors
imgcount rd 1 imgcount rd 1
img_index rd 1 img_index rd 1

View File

@ -98,8 +98,8 @@ put_image:
cmp [winys],bp cmp [winys],bp
jc .l1 jc .l1
add eax,5 ; offset for boarder add eax,2 ; offset for boarder
add ebx,20 ; offset for title bar add ebx,2 ; offset for title bar
push ax ; pox push ax ; pox
push bx ; pos push bx ; pos
push cx ; size push cx ; size
@ -235,6 +235,12 @@ put_chunk_to_bgr:
draw_window: draw_window:
mov eax,48
mov ebx,3
mov ecx,sc
mov edx,sizeof.system_colors
int 0x40
mov eax,12 mov eax,12
mov ebx,1 mov ebx,1
int 0x40 int 0x40
@ -273,39 +279,26 @@ dw_002:
mov cx, [winys] mov cx, [winys]
xor eax,eax ; DRAW WINDOW xor eax,eax ; DRAW WINDOW
mov edx,[wcolor] mov edx,[sc.work]
add edx,0x13000000 or edx,0x33000000
mov edi,header ; WINDOW LABEL mov edi,header ; WINDOW LABEL
int 0x40 int 0x40
; draw status bar mov eax,8 ; BUTTON 2: slideshow
mov eax, 13 mov ebx,57
movzx ebx, word [winxs]
sub ebx, 5
add ebx, 4*65536
mov cx, [winys]
sub ecx, 19
shl ecx, 16
add ecx, 3
mov edx, 0x00557799
int 0x40
mov eax,8 ; BUTTON 2: filename
mov ebx,4*65536+55
mov cx, [winys] mov cx, [winys]
sub cx, 16 sub cx, 39
shl ecx, 16 shl ecx, 16
add ecx, 12 add ecx, 12
mov esi, 0x00557799 mov esi, [sc.work_button]
mov edx,2 mov edx,2
int 0x40 int 0x40
mov eax,4 ; Button text mov eax,4 ; Button text
movzx ebx, word [winys] movzx ebx, word [winys]
sub ebx, 13 add ebx, 3 shl 16 - 36
add ebx, 6*65536 mov ecx,[sc.work_button_text]
mov ecx,0x00ffffff
mov edx,setname mov edx,setname
mov esi,setnamelen-setname mov esi,setnamelen-setname
int 0x40 int 0x40
@ -313,24 +306,24 @@ dw_002:
mov eax,8 ; BUTTON 3: set as background mov eax,8 ; BUTTON 3: set as background
mov bx, [winxs] mov bx, [winxs]
sub bx, 60 sub bx, 65
shl ebx, 16 shl ebx, 16
mov bx,55 mov bx,55
mov cx, [winys] mov cx, [winys]
sub cx, 16 sub cx, 39
shl ecx, 16 shl ecx, 16
add ecx, 12 add ecx, 12
mov esi, 0x00557799 mov esi, [sc.work_button]
mov edx,3 mov edx,3
int 0x40 int 0x40
mov eax,4 ; Button text mov eax,4 ; Button text
movzx ebx, word [winxs] movzx ebx, word [winxs]
sub ebx, 60 sub ebx, 63
shl ebx,16 shl ebx,16
mov bx, word [winys] mov bx, word [winys]
sub bx,13 sub bx,36
mov ecx,0x00ffffff mov ecx,[sc.work_button_text]
mov edx,setbgr mov edx,setbgr
mov esi,setbgrlen-setbgr mov esi,setbgrlen-setbgr
int 0x40 int 0x40
@ -391,13 +384,12 @@ load_image:
mov eax,13 ; clear picture area mov eax,13 ; clear picture area
movzx ebx, word [winxs] movzx ebx, word [winxs]
sub ebx, 7 add ebx, 1 shl 16 -10
add ebx, 4 * 65536
movzx ecx, word [winys] movzx ecx, word [winys]
sub ecx, 39 sub ecx, 40
add ecx, 20 * 65536 add ecx, 1 shl 16
mov edx,0 mov edx,[sc.work]
int 0x40 int 0x40
mov ebp,[jpeg_st] mov ebp,[jpeg_st]
test ebp,ebp test ebp,ebp
@ -410,10 +402,9 @@ print_strings:
pusha pusha
mov eax,13 ; clear text area mov eax,13 ; clear text area
movzx ebx, word [winxs] movzx ebx, word [winxs]
sub ebx, 64+58 add ebx, 59 shl 16 -125
add ebx, 60*65536
mov cx, [winys] mov cx, [winys]
sub cx, 16 sub cx, 39
shl ecx, 16 shl ecx, 16
add ecx, 12 add ecx, 12
mov edx,0xffffff mov edx,0xffffff
@ -421,8 +412,7 @@ print_strings:
mov eax,4 ; mov eax,4 ;
movzx ebx, word [winys] movzx ebx, word [winys]
sub ebx, 14 add ebx, 61 shl 16 - 37
add ebx, 60*65536
mov ecx,0x000000 mov ecx,0x000000
mov edx,name_string mov edx,name_string
mov esi,60 mov esi,60
@ -529,8 +519,6 @@ winxs dw 0
winys dw 0 winys dw 0
jpeg_st dd 0 jpeg_st dd 0
file_dir dd 0 file_dir dd 0
tcolor dd 0x000000
btcolor dd 0x224466+0x808080
name_string: db '/rd/1/jpegview.jpg',0 name_string: db '/rd/1/jpegview.jpg',0
rb 256 rb 256
.end: .end:
@ -552,6 +540,6 @@ iniciomemoria:
fin: fin:
I_END: I_END:
sc system_colors
fileattr: rb 40 fileattr: rb 40
dirinfo: rb 32+304 dirinfo: rb 32+304

View File

@ -9,32 +9,33 @@
;; ;; ;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
version equ '0.3' version equ '0.4'
use32 use32
org 0x0 org 0x0
db 'MENUET01' ; 8 byte id
dd 0x01 ; required os
dd START ; program start
dd I_END ; program image size
dd 0x100000 ; required amount of memory
dd 0x100000
dd 0,0
db 'MENUET01' ; 8 byte id
dd 0x01 ; required os
dd START ; program start
dd I_END ; program image size
dd 0x100000 ; required amount of memory
dd 0x100000
dd 0,0
include "lang.inc" include "lang.inc"
include "macros.inc" ;include "macros.inc"
irc_server_ip db 192,168,1,1 irc_server_ip db 83,149,74,246 ;server: kolibrios.org
user_nick dd 4 ; length user_nick dd 12 ; length
db 'airc ' ; string db 'kolibri_user ' ; string
user_real_name dd 8 ; length user_real_name dd 14 ; length
db 'Joe User ' ; string db 'KolibriOS User ' ; string
START: ; start of execution START: ; start of execution
mov eax,40 mov eax,40
mov ebx,10000111b mov ebx,10000111b
@ -52,7 +53,7 @@ START: ; start of execution
mov ebp,0 mov ebp,0
mov edx,I_END mov edx,I_END
call draw_window ; at first, draw the window call draw_window ; at first, draw the window
still: still:
@ -62,17 +63,17 @@ still:
mov ebx,1 mov ebx,1
int 0x40 int 0x40
mov eax,11 ; wait here for event mov eax,11 ; wait here for event
int 0x40 int 0x40
call print_status call print_status
cmp eax,1 ; redraw cmp eax,1 ; redraw
je redraw je redraw
cmp eax,2 ; key cmp eax,2 ; key
je main_window_key je main_window_key
cmp eax,3 ; button cmp eax,3 ; button
je button je button
cmp [I_END+120*60],byte 1 cmp [I_END+120*60],byte 1
jne no_main_update jne no_main_update
@ -95,18 +96,18 @@ still:
jmp still jmp still
redraw: ; redraw redraw: ; redraw
call draw_window call draw_window
jmp still jmp still
button: ; button button: ; button
mov eax,17 ; get id mov eax,17 ; get id
int 0x40 int 0x40
cmp ah,1 ; close program cmp ah,1 ; close program
jne noclose jne noclose
mov eax,-1 mov eax,-1
int 0x40 int 0x40
@ -129,7 +130,7 @@ print_status:
mov [status],eax mov [status],eax
cmp [old_status],eax cmp [old_status],eax
je nopr je nopr
mov [old_status],eax mov [old_status],eax
@ -160,7 +161,7 @@ old_status dd 0
socket_commands: socket_commands:
cmp ah,22 ; open socket cmp ah,22 ; open socket
jnz tst3 jnz tst3
mov eax,3 mov eax,3
int 0x40 int 0x40
@ -176,7 +177,7 @@ socket_commands:
tst3: tst3:
cmp ah,23 ; write userinfo cmp ah,23 ; write userinfo
jnz tst4 jnz tst4
mov eax,53 ; user mov eax,53 ; user
@ -234,7 +235,7 @@ socket_commands:
tst4: tst4:
cmp ah,24 ; close socket cmp ah,24 ; close socket
jnz no_24 jnz no_24
mov eax,53 mov eax,53
mov ebx,8 mov ebx,8
@ -257,7 +258,7 @@ main_window_key:
cmp eax,8 cmp eax,8
jne no_bks2 jne no_bks2
cmp [xpos],0 cmp [xpos],0
je still je still
dec [xpos] dec [xpos]
call print_entry call print_entry
jmp still jmp still
@ -269,7 +270,7 @@ main_window_key:
mov [send_string+ebx],al mov [send_string+ebx],al
inc [xpos] inc [xpos]
cmp [xpos],80 cmp [xpos],80
jb noxposdec jb noxposdec
mov [xpos],79 mov [xpos],79
noxposdec: noxposdec:
call print_entry call print_entry
@ -279,7 +280,7 @@ main_window_key:
cmp eax,13 cmp eax,13
jne no_send jne no_send
cmp [xpos],0 cmp [xpos],0
je no_send2 je no_send2
cmp [send_string],byte '/' ; server command cmp [send_string],byte '/' ; server command
jne no_send2 jne no_send2
mov [send_to_server],1 mov [send_to_server],1
@ -329,7 +330,7 @@ print_user_list:
imul edx,120*80 imul edx,120*80
add edx,120*60+8+I_END add edx,120*60+8+I_END
cmp [edx],byte 1 cmp [edx],byte 1
je nonp je nonp
mov edx,ebp mov edx,ebp
imul edx,120*80 imul edx,120*80
@ -345,14 +346,14 @@ print_user_list:
newnss: newnss:
inc edx inc edx
dec eax dec eax
jz startuu jz startuu
asdf: asdf:
cmp [edx],word ' ' cmp [edx],word ' '
jne nodouble jne nodouble
inc edx inc edx
nodouble: nodouble:
cmp [edx],byte ' ' cmp [edx],byte ' '
je newnss je newnss
inc edx inc edx
cmp edx,ebx cmp edx,ebx
jbe asdf jbe asdf
@ -385,7 +386,7 @@ print_user_list:
mov esi,0 mov esi,0
newusers: newusers:
cmp [edx+esi],byte ' ' cmp [edx+esi],byte ' '
je do_print je do_print
inc esi inc esi
cmp esi,20 cmp esi,20
jbe newusers jbe newusers
@ -401,7 +402,7 @@ print_user_list:
inc ebp inc ebp
cmp ebp,10 cmp ebp,10
je nonp je nonp
add ebx,12 add ebx,12
@ -423,6 +424,19 @@ print_user_list:
start_user_list_at dd 0x0 start_user_list_at dd 0x0
recode_to_cp1251:
push esi edx
.loop:
lodsb
cmp al,0x80
jb @f
and eax,0x7F
mov al,[cp866_table+eax]
@@: mov [esi-1],al
dec edx
jnz .loop
pop edx esi
ret
send_data_to_server: send_data_to_server:
@ -445,7 +459,7 @@ send_data_to_server:
mov [text_start],eax mov [text_start],eax
cmp [send_string],byte '/' ; server command cmp [send_string],byte '/' ; server command
je server_command je server_command
mov bl,13 mov bl,13
call print_character call print_character
@ -501,6 +515,8 @@ send_data_to_server:
mov edx,[xpos] mov edx,[xpos]
inc edx inc edx
call recode_to_cp1251
mov eax, 53 ; write message mov eax, 53 ; write message
mov ebx, 7 mov ebx, 7
mov ecx, [socket] mov ecx, [socket]
@ -594,9 +610,9 @@ send_data_to_server:
add edx,send_string-1 add edx,send_string-1
newsip: newsip:
cmp [esi],byte '.' cmp [esi],byte '.'
je sipn je sipn
cmp esi,edx cmp esi,edx
jg sipn jg sipn
movzx ebx,byte [esi] movzx ebx,byte [esi]
inc esi inc esi
imul eax,10 imul eax,10
@ -608,7 +624,7 @@ send_data_to_server:
xor eax,eax xor eax,eax
inc esi inc esi
cmp esi,send_string+30 cmp esi,send_string+30
jg sipnn jg sipnn
inc edi inc edi
cmp edi,irc_server_ip+3 cmp edi,irc_server_ip+3
jbe newsip jbe newsip
@ -653,11 +669,11 @@ send_data_to_server:
mov ebx,eax mov ebx,eax
shl ebx,5 shl ebx,5
cmp dword [channel_list+ebx],dword ' ' cmp dword [channel_list+ebx],dword ' '
je free_found2 je free_found2
add edi,120*80 add edi,120*80
inc eax inc eax
cmp eax,[max_windows] cmp eax,[max_windows]
jb newse2 jb newse2
free_found2: free_found2:
@ -744,7 +760,7 @@ read_incoming_data:
call read_incoming_byte call read_incoming_byte
cmp ecx,-1 cmp ecx,-1
je no_data_in_buffer je no_data_in_buffer
cmp bl,10 cmp bl,10
jne no_start_command jne no_start_command
@ -799,9 +815,9 @@ create_channel_name:
newcase: newcase:
mov al,[esi] mov al,[esi]
cmp eax,'a' cmp eax,'a'
jb nocdec jb nocdec
cmp eax,'z' cmp eax,'z'
jg nocdec jg nocdec
sub al,97-65 sub al,97-65
nocdec: nocdec:
mov [edi],al mov [edi],al
@ -926,11 +942,11 @@ set_channel:
newcase2: newcase2:
mov al,[esi] mov al,[esi]
cmp eax,'#' cmp eax,'#'
jb newcase_over2 jb newcase_over2
cmp eax,'a' cmp eax,'a'
jb nocdec2 jb nocdec2
cmp eax,'z' cmp eax,'z'
jg nocdec2 jg nocdec2
sub al,97-65 sub al,97-65
nocdec2: nocdec2:
mov [edi],al mov [edi],al
@ -964,7 +980,7 @@ set_channel:
jne notfound2 jne notfound2
inc ecx inc ecx
cmp ecx,[channel_temp_length] cmp ecx,[channel_temp_length]
jb stc4 jb stc4
popa popa
jmp found jmp found
@ -976,7 +992,7 @@ set_channel:
add [text_start],120*80 add [text_start],120*80
add ebx,32 add ebx,32
cmp ebx,channel_list+19*32 cmp ebx,channel_list+19*32
jb stcl1 jb stcl1
mov [text_start],I_END mov [text_start],I_END
@ -987,7 +1003,7 @@ set_channel:
ret ret
channel_temp: times 100 db 0 channel_temp: times 100 db 0
channel_temp_length dd 0x0 channel_temp_length dd 0x0
@ -1091,7 +1107,7 @@ analyze_command:
mov ecx,100 mov ecx,100
new_blank: new_blank:
cmp [eax],byte ' ' cmp [eax],byte ' '
je bl_found je bl_found
inc eax inc eax
loop new_blank loop new_blank
mov eax,50 mov eax,50
@ -1125,7 +1141,7 @@ analyze_command:
mov eax,command+10 mov eax,command+10
acl3: acl3:
cmp [eax],byte ':' cmp [eax],byte ':'
je acl4 je acl4
inc eax inc eax
loop acl3 loop acl3
mov eax,10 mov eax,10
@ -1173,7 +1189,7 @@ analyze_command:
no_privmsg: no_privmsg:
cmp [irc_command],'PART' ; channel leave cmp [irc_command],'PART' ; channel leave
jne no_part jne no_part
; compare nick ; compare nick
@ -1220,7 +1236,7 @@ analyze_command:
no_part: no_part:
cmp [irc_command],'JOIN' ; channel join cmp [irc_command],'JOIN' ; channel join
jne no_join jne no_join
; compare nick ; compare nick
@ -1236,11 +1252,11 @@ analyze_command:
mov ebx,eax mov ebx,eax
shl ebx,5 shl ebx,5
cmp dword [channel_list+ebx],dword ' ' cmp dword [channel_list+ebx],dword ' '
je free_found je free_found
add edi,120*80 add edi,120*80
inc eax inc eax
cmp eax,[max_windows] cmp eax,[max_windows]
jb newse jb newse
free_found: free_found:
@ -1305,7 +1321,7 @@ analyze_command:
no_join: no_join:
cmp [irc_command],'NICK' ; nick change cmp [irc_command],'NICK' ; nick change
jne no_nick_change jne no_nick_change
mov [text_start],I_END mov [text_start],I_END
@ -1329,7 +1345,7 @@ analyze_command:
add [text_start],120*80 add [text_start],120*80
cmp [text_start],I_END+120*80*20 cmp [text_start],I_END+120*80*20
jb new_all_channels3 jb new_all_channels3
popa popa
ret ret
@ -1337,7 +1353,7 @@ analyze_command:
no_nick_change: no_nick_change:
cmp [irc_command],'KICK' ; kick cmp [irc_command],'KICK' ; kick
jne no_kick jne no_kick
mov [text_start],I_END mov [text_start],I_END
@ -1375,7 +1391,7 @@ analyze_command:
cmp [irc_command],'QUIT' ; irc quit cmp [irc_command],'QUIT' ; irc quit
jne no_quit jne no_quit
mov [text_start],I_END mov [text_start],I_END
@ -1395,7 +1411,7 @@ analyze_command:
add [text_start],120*80 add [text_start],120*80
cmp [text_start],I_END+120*80*20 cmp [text_start],I_END+120*80*20
jb new_all_channels2 jb new_all_channels2
popa popa
ret ret
@ -1550,7 +1566,7 @@ compare_to_nick:
add edi,1 add edi,1
cmp edi,[user_nick] cmp edi,[user_nick]
jb new_nick_compare jb new_nick_compare
movzx eax,byte [esi] movzx eax,byte [esi]
cmp eax,40 cmp eax,40
@ -1613,9 +1629,9 @@ print_text:
ptr2: ptr2:
mov bl,[eax] mov bl,[eax]
cmp bl,dl cmp bl,dl
je ptr_ret je ptr_ret
cmp bl,0 cmp bl,0
je ptr_ret je ptr_ret
call print_character call print_character
inc eax inc eax
cmp eax,ecx cmp eax,ecx
@ -1630,12 +1646,32 @@ print_text:
ret ret
cp1251_table:
db '?','?','?','?','?','?','?','?' , '?','?','?','?','?','?','?','?' ; 8
db '?','?','?','?','?','?','?','?' , '?','?','?','?','?','?','?','?' ; 9
db '?','?','?','?','?','?','?','?' , $F0,'?','?','?','?','?','?','?' ; A
db '?','?','?','?','?','?','?','?' , $F1,'?','?','?','?','?','?','?' ; B
db $80,$81,$82,$83,$84,$85,$86,$87 , $88,$89,$8A,$8B,$8C,$8D,$8E,$8F ; C
db $90,$91,$92,$93,$94,$95,$96,$97 , $98,$99,$9A,$9B,$9C,$9D,$9E,$9F ; D
db $A0,$A1,$A2,$A3,$A4,$A5,$A6,$A7 , $A8,$A9,$AA,$AB,$AC,$AD,$AE,$AF ; E
db $E0,$E1,$E2,$E3,$E4,$E5,$E6,$E7 , $E8,$E9,$EA,$EB,$EC,$ED,$EE,$EF ; F
cp866_table:
db $C0,$C1,$C2,$C3,$C4,$C5,$C6,$C7 , $C8,$C9,$CA,$CB,$CC,$CD,$CE,$CF ; 8
db $D0,$D1,$D2,$D3,$D4,$D5,$D6,$D7 , $D8,$D9,$DA,$DB,$DC,$DD,$DE,$DF ; 9
db $E0,$E1,$E2,$E3,$E4,$E5,$E6,$E7 , $E8,$E9,$EA,$EB,$EC,$ED,$EE,$EF ; A
db '?','?','?','?','?','?','?','?' , '?','?','?','?','?','?','?','?' ; B
db '?','?','?','?','?','?','?','?' , '?','?','?','?','?','?','?','?' ; C
db '?','?','?','?','?','?','?','?' , '?','?','?','?','?','?','?','?' ; D
db $F0,$F1,$F2,$F3,$F4,$F5,$F6,$F7 , $F8,$F9,$FA,$FB,$FC,$FD,$FE,$FF ; E
db $A8,$B8,'?','?','?','?','?','?' , '?','?','?','?','?','?','?','?' ; F
print_character: print_character:
pusha pusha
cmp bl,13 ; line beginning cmp bl,13 ; line beginning
jne nobol jne nobol
mov ecx,[pos] mov ecx,[pos]
add ecx,1 add ecx,1
@ -1651,7 +1687,7 @@ print_character:
jmp newdata jmp newdata
nobol: nobol:
cmp bl,10 ; line down cmp bl,10 ; line down
jne nolf jne nolf
addx1: addx1:
add [pos],dword 1 add [pos],dword 1
@ -1667,7 +1703,7 @@ print_character:
no_lf_ret: no_lf_ret:
cmp bl,15 ; character cmp bl,15 ; character
jbe newdata jbe newdata
mov eax,[irc_data] mov eax,[irc_data]
@ -1684,7 +1720,7 @@ print_character:
mov ebx,[scroll+4] mov ebx,[scroll+4]
imul ebx,[rxs] imul ebx,[rxs]
cmp eax,ebx cmp eax,ebx
jb noeaxz jb noeaxz
mov esi,[text_start] mov esi,[text_start]
add esi,[rxs] add esi,[rxs]
@ -1749,7 +1785,6 @@ draw_data:
ret ret
read_incoming_byte: read_incoming_byte:
mov eax, 53 mov eax, 53
@ -1760,13 +1795,19 @@ read_incoming_byte:
mov ecx,-1 mov ecx,-1
cmp eax,0 cmp eax,0
je no_more_data je no_more_data
mov eax, 53 mov eax, 53
mov ebx, 3 mov ebx, 3
mov ecx, [socket] mov ecx, [socket]
int 0x40 int 0x40
cmp bl,0x80
jb @f
and ebx,0x7F
mov bl,[cp1251_table+ebx]
@@:
mov ecx,0 mov ecx,0
no_more_data: no_more_data:
@ -1785,7 +1826,7 @@ draw_window:
mov [old_status],300 mov [old_status],300
mov eax,0 ; draw window mov eax,0 ; draw window
mov ebx,5*65536+499 mov ebx,5*65536+499
mov ecx,5*65536+345 mov ecx,5*65536+345
mov edx,[wcolor] mov edx,[wcolor]
@ -1794,33 +1835,33 @@ draw_window:
mov edi,0x00ffffff mov edi,0x00ffffff
int 0x40 int 0x40
mov eax,4 ; label mov eax,4 ; label
mov ebx,9*65536+8 mov ebx,9*65536+8
mov ecx,0x10ffffff mov ecx,0x10ffffff
mov edx,labelt mov edx,labelt
mov esi,labellen-labelt mov esi,labellen-labelt
int 0x40 int 0x40
mov eax,8 ; button: open socket mov eax,8 ; button: open socket
mov ebx,43*65536+22 mov ebx,43*65536+22
mov ecx,229*65536+10 mov ecx,229*65536+10
mov edx,22 mov edx,22
mov esi,[main_button] mov esi,[main_button]
int 0x40 int 0x40
mov eax,8 ; button: send userinfo mov eax,8 ; button: send userinfo
mov ebx,180*65536+22 mov ebx,180*65536+22
mov ecx,229*65536+10 mov ecx,229*65536+10
mov edx,23 mov edx,23
int 0x40 int 0x40
mov eax,8 ; button: close socket mov eax,8 ; button: close socket
mov ebx,317*65536+22 mov ebx,317*65536+22
mov ecx,229*65536+10 mov ecx,229*65536+10
mov edx,24 mov edx,24
int 0x40 int 0x40
mov eax,38 ; line mov eax,38 ; line
mov ebx,5*65536+494 mov ebx,5*65536+494
mov ecx,148*65536+148 mov ecx,148*65536+148
mov edx,[main_line] mov edx,[main_line]
@ -1829,7 +1870,7 @@ draw_window:
; mov edx,0x5555cc ; mov edx,0x5555cc
; int 0x40 ; int 0x40
mov eax,38 ; line mov eax,38 ; line
mov ebx,5*65536+494 mov ebx,5*65536+494
mov ecx,166*65536+166 mov ecx,166*65536+166
int 0x40 int 0x40
@ -1837,7 +1878,7 @@ draw_window:
; mov edx,0x5555cc ; mov edx,0x5555cc
; int 0x40 ; int 0x40
mov eax,38 ; line mov eax,38 ; line
mov ebx,410*65536+410 mov ebx,410*65536+410
mov ecx,22*65536+148 mov ecx,22*65536+148
int 0x40 int 0x40
@ -1845,7 +1886,7 @@ draw_window:
; mov edx,0x5555cc ; mov edx,0x5555cc
; int 0x40 ; int 0x40
mov ebx,25*65536+183 ; info text mov ebx,25*65536+183 ; info text
mov ecx,0x000000 mov ecx,0x000000
mov edx,text mov edx,text
mov esi,70 mov esi,70
@ -1857,7 +1898,7 @@ draw_window:
cmp [edx],byte 'x' cmp [edx],byte 'x'
jne newline jne newline
mov edx,I_END ; text from server mov edx,I_END ; text from server
call draw_channel_text call draw_channel_text
mov eax,12 mov eax,12
@ -1874,20 +1915,20 @@ main_button dd 0x6565cc
text: text:
db ' Real name : Joe User - change with eg /areal Jill User ' db ' Real name : KolibriOS User - change with eg /areal Jill User '
db ' Nick : AIRC - change with eg /anick Jill ' db ' Nick : kolibri_user - change with eg /anick Jill '
db ' Server : 192.168.1.1 - change with eg /aserv 192.168.1.24 ' db ' Server : 83.149.74.246 - change with eg /aserv 192.168.1.24 '
db ' ' db ' '
db ' 1) Open socket 2) Send userinfo Close socket ' db ' 1) Open socket 2) Send userinfo Close socket '
db ' ' db ' '
db ' Commands after established connection: ' db ' Commands after established connection: '
db ' ' db ' '
db ' /join #ChannelName - eg /join #menuet ' db ' /join #ChannelName - eg /join #general '
db ' /part #ChannelName - eg /part #linux ' db ' /part #ChannelName - eg /part #windows '
db ' /query Nickname - eg /query Mary ' db ' /query Nickname - eg /query Mary '
db ' /quit - Quit server and Close socket ' db ' /quit - Quit server and Close socket '
db 'x <- END MARKER, DONT DELETE ' db 'x' ; <- END MARKER, DONT DELETE
@ -1908,7 +1949,7 @@ channel_thread:
add eax,0x80000 add eax,0x80000
mov esp,eax mov esp,eax
mov edi,ebp ; clear thread memory mov edi,ebp ; clear thread memory
imul edi,120*80 imul edi,120*80
add edi,I_END add edi,I_END
mov ecx,120*80 mov ecx,120*80
@ -1950,7 +1991,7 @@ channel_thread:
no_draw_window: no_draw_window:
cmp eax,2 cmp eax,2
je thread_key je thread_key
cmp eax,3 cmp eax,3
jne no_end jne no_end
@ -1960,7 +2001,7 @@ channel_thread:
imul eax,120*80 imul eax,120*80
add eax,I_END add eax,I_END
cmp [eax+120*60+8],byte 0 ; channel window cmp [eax+120*60+8],byte 0 ; channel window
je not_close je not_close
mov eax,ebp mov eax,ebp
shl eax,5 shl eax,5
add eax,channel_list add eax,channel_list
@ -2013,18 +2054,18 @@ check_mouse:
and ebx,0xffff and ebx,0xffff
cmp eax,420 cmp eax,420
jb no_mouse jb no_mouse
cmp eax,494 cmp eax,494
jg no_mouse jg no_mouse
cmp ebx,145 cmp ebx,145
jg no_mouse jg no_mouse
cmp ebx,23 cmp ebx,23
jb no_mouse jb no_mouse
cmp ebx,100 cmp ebx,100
jb no_plus jb no_plus
mov eax,ebp mov eax,ebp
imul eax,120*80 imul eax,120*80
add eax,120*70+I_END add eax,120*70+I_END
@ -2037,12 +2078,12 @@ check_mouse:
no_plus: no_plus:
cmp ebx,80 cmp ebx,80
jg no_mouse jg no_mouse
mov eax,ebp mov eax,ebp
imul eax,120*80 imul eax,120*80
add eax,120*70+I_END add eax,120*70+I_END
cmp dword [eax-8],dword 0 cmp dword [eax-8],dword 0
je no_mouse je no_mouse
dec dword [eax-8] dec dword [eax-8]
call print_user_list call print_user_list
mov eax,5 mov eax,5
@ -2070,7 +2111,7 @@ thread_key:
cmp eax,8 cmp eax,8
jne no_bks jne no_bks
cmp [xpos],0 cmp [xpos],0
je w_t je w_t
dec [xpos] dec [xpos]
call print_entry call print_entry
jmp w_t jmp w_t
@ -2082,7 +2123,7 @@ thread_key:
mov [send_string+ebx],al mov [send_string+ebx],al
inc [xpos] inc [xpos]
cmp [xpos],80 cmp [xpos],80
jb xpok jb xpok
mov [xpos],79 mov [xpos],79
xpok: xpok:
call print_entry call print_entry
@ -2092,7 +2133,7 @@ thread_key:
cmp eax,13 cmp eax,13
jne no_send jne no_send
cmp [xpos],0 cmp [xpos],0
je no_send je no_send
mov dword [send_to_channel],ebp mov dword [send_to_channel],ebp
mov [send_to_server],1 mov [send_to_server],1
wait_for_sending: wait_for_sending:
@ -2100,7 +2141,7 @@ thread_key:
mov ebx,1 mov ebx,1
int 0x40 int 0x40
cmp [send_to_server],1 cmp [send_to_server],1
je wait_for_sending je wait_for_sending
call draw_channel_text call draw_channel_text
call print_entry call print_entry
jmp w_t jmp w_t
@ -2171,7 +2212,7 @@ thread_draw_window:
mov ebx,1 mov ebx,1
int 0x40 int 0x40
mov ebx,ebp ; draw window mov ebx,ebp ; draw window
shl ebx,16+4 shl ebx,16+4
mov eax,0 mov eax,0
mov ecx,ebx mov ecx,ebx
@ -2192,7 +2233,7 @@ thread_draw_window:
int 0x40 int 0x40
mov eax,ebp ; label mov eax,ebp ; label
add eax,48 add eax,48
mov [labelc+14],al mov [labelc+14],al
mov eax,ebp mov eax,ebp
@ -2204,7 +2245,7 @@ thread_draw_window:
cld cld
rep movsb rep movsb
mov esi,17 ; print label mov esi,17 ; print label
movzx ebx,byte [eax+31] movzx ebx,byte [eax+31]
add esi,ebx add esi,ebx
mov eax,4 mov eax,4
@ -2213,7 +2254,7 @@ thread_draw_window:
mov edx,labelc mov edx,labelc
int 0x40 int 0x40
mov eax,38 ; line mov eax,38 ; line
mov ebx,5*65536+494 mov ebx,5*65536+494
mov ecx,148*65536+148 mov ecx,148*65536+148
mov edx,[channel_line_sun] mov edx,[channel_line_sun]
@ -2223,7 +2264,7 @@ thread_draw_window:
int 0x40 int 0x40
mov eax,38 ; line mov eax,38 ; line
mov ebx,410*65536+410 mov ebx,410*65536+410
mov ecx,22*65536+148 mov ecx,22*65536+148
mov edx,[channel_line_sun] mov edx,[channel_line_sun]
@ -2244,7 +2285,7 @@ thread_draw_window:
; DATA AREA ; DATA AREA
socket dd 0x0 socket dd 0x0
bgc dd 0x000000 bgc dd 0x000000
dd 0x000000 dd 0x000000
@ -2275,67 +2316,67 @@ thread_stack dd 0x9fff0
thread_nro dd 1 thread_nro dd 1
thread_screen dd I_END+120*80*1 thread_screen dd I_END+120*80*1
action_header_blue db 10,'*** ',0 action_header_blue db 10,'*** ',0
action_header_red db 10,'*** ',0 action_header_red db 10,'*** ',0
action_header_short db 10,'* ',0 action_header_short db 10,'* ',0
has_left_channel db ' left channel ',0 has_left_channel db ' has left ',0
joins_channel db ' joined channel ',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',0 has_quit_irc db ' has quit IRC',0
sets_mode db ' sets mode ',0 sets_mode db ' sets mode ',0
kicked db ' kicked from ',0 kicked db ' kicked from ',0
index_list_1 dd 0x0000bb index_list_1 dd 0x0000bb
index_list_2 dd 0x0000ff index_list_2 dd 0x0000ff
posx dd 0x0 posx dd 0x0
incoming_pos dd 0x0 incoming_pos dd 0x0
incoming_string: times 128 db 0 incoming_string: times 128 db 0
pos dd 0x0 pos dd 0x0
text_start dd I_END text_start dd I_END
irc_data dd 0x0 irc_data dd 0x0
print db 0x0 print db 0x0
cmd dd 0x0 cmd dd 0x0
rxs dd 66 rxs dd 66
res: db 0,0 res: db 0,0
command: times 600 db 0x0 command: times 600 db 0x0
nick dd 0,0,0 nick dd 0,0,0
irc_command dd 0,0 irc_command dd 0,0
command_position dd 0x0 command_position dd 0x0
counter dd 0 counter dd 0
send_to_server db 0 send_to_server db 0
channel_list: times 32*20 db 32 channel_list: times 32*20 db 32
send_to_channel dd 0x0 send_to_channel dd 0x0
send_string_header: db 'privmsg #eax :' send_string_header: db 'privmsg #eax :'
times 100 db 0x0 times 100 db 0x0
send_string: times 100 db 0x0 send_string: times 100 db 0x0
xpos dd 0 xpos dd 0
string0: db 'USER guest ser1 ser2 :' string0: db 'USER guest ser1 ser2 :'
string0l: string0l:
string1: db 'nick ' string1: db 'nick '
string1l: string1l:
attribute dd 0 attribute dd 0
scroll dd 1 scroll dd 1
dd 12 dd 12
numtext db ' ' numtext db ' '
wcolor dd 0x000000 wcolor dd 0x000000
labelc db 'AIRC - WINDOW X: #xxx ' labelc db 'AIRC - WINDOW X: #xxx '
labelt db 'IRC client ',version labelt db 'IRC client ',version
labellen: labellen:
;; ;;

View File

@ -1,4 +1,5 @@
@erase lang.inc @erase lang.inc
@echo lang fix en >lang.inc @echo lang fix en >lang.inc
@fasm airc.asm airc @fasm airc.asm airc
@erase lang.inc
@pause @pause

View File

@ -1,4 +1,5 @@
@erase lang.inc @erase lang.inc
@echo lang fix ru >lang.inc @echo lang fix ru >lang.inc
@fasm airc.asm airc @fasm airc.asm airc
@erase lang.inc
@pause @pause

View File

@ -662,16 +662,16 @@ draw_window:
int 0x40 int 0x40
xor eax,eax xor eax,eax
mov ebx,200*65536+255 mov ebx,200 shl 16+255
mov ecx,200*65536+180 mov ecx,200 shl 16+180
mov edx,[sc.work] mov edx,[sc.work]
or edx,0x33000000 or edx,0x33000000
mov edi,header mov edi,header
int 0x40 int 0x40
mov eax,8 mov eax,8
mov ebx,19*65536+28 mov ebx,19 shl 16+28
mov ecx,49*65536+18 mov ecx,49 shl 16+18
mov edx,6 mov edx,6
mov esi,[sc.work_button] mov esi,[sc.work_button]
mov edi,7 mov edi,7
@ -679,20 +679,20 @@ draw_window:
dec edi dec edi
jnz no_new_row jnz no_new_row
mov edi,7 mov edi,7
mov ebx,19*65536+28 mov ebx,19 shl 16+28
add ecx,20*65536 add ecx,20 shl 16
no_new_row: no_new_row:
int 0x40 int 0x40
add ebx,30*65536 add ebx,30 shl 16
inc edx inc edx
cmp edx,39 cmp edx,39
jbe newbutton jbe newbutton
mcall ,199*65536+28,49*65536+18,2 ; 'C' mcall ,199 shl 16+28,49 shl 16+18,2 ; 'C'
mcall ,220*65536+8,7*65536+8,3 ; 'dec-bin-hex' mcall ,220 shl 16+8,7 shl 16+8,3 ; 'dec-bin-hex'
mov eax,4 mov eax,4
mov ebx,27*65536+54 mov ebx,27 shl 16+54
mov ecx,[sc.work_button_text] mov ecx,[sc.work_button_text]
mov edx,text mov edx,text
mov esi,33 mov esi,33
@ -713,10 +713,10 @@ draw_window:
print_display: print_display:
pusha pusha
mcall 13,18*65536+210,19*65536+13,0xffffff mcall 13,18 shl 16+210,19 shl 16+13,0xffffff
mov eax,4 mov eax,4
mov ebx,135*65536+7 mov ebx,135 shl 16+7
mov ecx,[sc.work_text] mov ecx,[sc.work_text]
or ecx,0x40000000 or ecx,0x40000000
mov edx,calc mov edx,calc
@ -724,7 +724,7 @@ print_display:
mov edi,[sc.work] mov edi,[sc.work]
int 0x40 int 0x40
mov ebx,198*65536+8 mov ebx,198 shl 16+8
mov edx,[display_type] mov edx,[display_type]
shl edx,2 shl edx,2
add edx,display_type_text add edx,display_type_text
@ -734,7 +734,7 @@ print_display:
cmp [dsign],byte '+' cmp [dsign],byte '+'
je positive je positive
mov ebx,23*65536+22 mov ebx,23 shl 16+22
mov ecx,0x0 mov ecx,0x0
mov edx,dsign mov edx,dsign
mov esi,1 mov esi,1
@ -746,22 +746,22 @@ positive:
cmp [decimal],0 cmp [decimal],0
je whole je whole
mov ebx,180*65536+22 mov ebx,180 shl 16+22
mov ecx,0x0 mov ecx,0x0
mov edx,dot mov edx,dot
mov esi,1 mov esi,1
int 0x40 int 0x40
mov eax,47 mov eax,47
mov ebx,10*65536 mov ebx,10 shl 16
mov ecx,[integer] mov ecx,[integer]
mov edx,120*65536+22 mov edx,120 shl 16+22
mov esi,0x0 mov esi,0x0
int 0x40 int 0x40
mov ebx,6*65536 mov ebx,6 shl 16
mov ecx,[decimal] mov ecx,[decimal]
mov edx,187*65536+22 mov edx,187 shl 16+22
mov esi,0x0 mov esi,0x0
int 0x40 int 0x40
@ -769,7 +769,7 @@ positive:
ret ret
whole: whole:
mov ebx,220*65536+22 mov ebx,220 shl 16+22
mov ecx,0x0 mov ecx,0x0
mov edx,dot mov edx,dot
mov esi,1 mov esi,1
@ -779,9 +779,9 @@ whole:
je null je null
mov eax,47 mov eax,47
mov ebx,10*65536 mov ebx,10 shl 16
mov ecx,[integer] mov ecx,[integer]
mov edx,160*65536+22 mov edx,160 shl 16+22
mov esi,0x0 mov esi,0x0
int 0x40 int 0x40
@ -795,9 +795,9 @@ whole:
je null je null
mov eax,47 mov eax,47
mov ebx,256+8*65536 mov ebx,256+8 shl 16
mov ecx,[integer] mov ecx,[integer]
mov edx,173*65536+22 mov edx,173 shl 16+22
mov esi,0x0 mov esi,0x0
int 0x40 int 0x40
@ -809,9 +809,9 @@ whole:
je null je null
mov eax,47 mov eax,47
mov ebx,2*256+32*65536 mov ebx,2*256+32 shl 16
mov ecx,[integer] mov ecx,[integer]
mov edx,32*65536+22 mov edx,32 shl 16+22
mov esi,0x0 mov esi,0x0
int 0x40 int 0x40
@ -820,9 +820,9 @@ whole:
null: null:
mov eax,47 mov eax,47
mov ebx,1*65536 mov ebx,1 shl 16
mov ecx,0 mov ecx,0
mov edx,214*65536+22 mov edx,214 shl 16+22
mov esi,0x0 mov esi,0x0
int 0x40 int 0x40

View File

@ -42,40 +42,42 @@ do_draw:
sub ecx,50*10000h - 100 sub ecx,50*10000h - 100
mov eax,0 ; define and draw window mov eax,0 ; define and draw window
mov edx,[sc.work_button] mov edx,[sc.work]
mov esi,edx ;[sc.work_button] mov esi,edx
xor edi,edi mov edi,edx
int 0x40 int 0x40
xor edx,edx mov edx,0x444444
mov al,13 mov al,13
mcall ,14 shl 16+90,25 shl 16+27 mcall ,18 shl 16+90,29 shl 16+27
push ebx push ebx
mcall ,117 shl 16+90, mcall ,121 shl 16+90,
xchg ebx,[esp] xchg ebx,[esp]
mcall ,,59 shl 16+27 mcall ,,63 shl 16+27
pop ebx pop ebx
mcall mcall
xor edx,edx
mov al,8 mov al,8
inc edx inc edx
mcall ,15 shl 16+87,26 shl 16+24,,0xdd7700 mcall ,15 shl 16+87,26 shl 16+24,,0xbb0055
inc edx inc edx
mcall ,118 shl 16+87,,,0xbbbb ;cccc mcall ,118 shl 16+87,,,0xaaaa ;cccc
inc edx inc edx
mcall ,15 shl 16+87,60 shl 16+24,,0xbb00 mcall ,15 shl 16+87,60 shl 16+24,,0x9900
inc edx inc edx
mcall ,118 shl 16+87,,,0xbbbbbb ;cccccc mcall ,118 shl 16+87,,,0xaaaaaa ;cccccc
mov al,4 ; 0x00000004 = write text mov al,4 ; 0x00000004 = write text
mov ebx,75*65536+10 mov ebx,75*65536+10
mov ecx,[sc.work_button_text] ; 8b window nro - RR GG BB color mov ecx,[sc.work_text] ; 8b window nro - RR GG BB color
or ecx,0x10000000 or ecx,0x10000000
mov edx,label1 ; pointer to text beginning mov edx,label1 ; pointer to text beginning
mov esi,label1_len ; text length mov esi,label1_len ; text length
int 0x40 int 0x40
mov ecx,0x10ffffff mov ecx,[sc.work_button_text] ; 8b window nro - RR GG BB color
or ecx,0x10000000
mov ebx,25*65536+30 mov ebx,25*65536+30
mov edx,label2 ; pointer to text beginning mov edx,label2 ; pointer to text beginning
mov esi,label2_len ; text length mov esi,label2_len ; text length
@ -193,7 +195,7 @@ else
label1_len = $ - label1 label1_len = $ - label1
label2: label2:
db ' BEENDEN KERNEL' db ' BEENDEN KERNEL'
label2_len = $ - label2 label2_len = $ - label2
label3: label3:

View File

@ -1,4 +1,5 @@
@erase lang.inc @erase lang.inc
@echo lang fix en >lang.inc @echo lang fix en >lang.inc
@fasm icon.asm icon @fasm icon.asm icon
@erase lang.inc
@pause @pause

View File

@ -1,4 +1,5 @@
@erase lang.inc @erase lang.inc
@echo lang fix ge >lang.inc @echo lang fix ge >lang.inc
@fasm icon.asm icon @fasm icon.asm icon
@erase lang.inc
@pause @pause

View File

@ -1,4 +1,5 @@
@erase lang.inc @erase lang.inc
@echo lang fix ru >lang.inc @echo lang fix ru >lang.inc
@fasm icon.asm icon @fasm icon.asm icon
@erase lang.inc
@pause @pause

View File

@ -11,10 +11,8 @@ RAW_SIZE equ 350000
ICON_SIZE equ 32*32*3 ICON_SIZE equ 32*32*3
GIF_SIZE equ 45000 GIF_SIZE equ 45000
REC_SIZE equ 80 REC_SIZE equ 80
ICON_LST equ '/RD/1/ICON2.LST' ICONS_DAT equ '/RD/1/ICONS.DAT'
;ICON_APP equ '/hd/1/me/icon2'; ICON_APP equ '/RD/1/ICON'
ICON_APP equ '/RD/1/ICON2'
;ICON_STRIP equ '/HD/1/ME/ICONSTRP.GIF'
ICON_STRIP equ '/RD/1/ICONSTRP.GIF' ICON_STRIP equ '/RD/1/ICONSTRP.GIF'
use32 use32
@ -443,7 +441,7 @@ print_strings:
popa popa
ret ret
iconlst db ICON_LST,0 iconlst db ICONS_DAT,0
load_icon_list: load_icon_list:

View File

@ -0,0 +1,14 @@
AA-Sysxtree-004-/RD/1/SYSXTREE - *
AB-CMD -023-/RD/1/CMD - *
AC-RDsave -001-/RD/1/RDSAVE - *
BB-Fasm -012-/RD/1/FASM - *
CA-Copy -008-/RD/1/copy2 - *
JA-VRR -009-/RD/1/VRR - *
IA-Board -022-/RD/1/BOARD - *
BA-KFAR -016-/RD/1/kfar - *
JB-Animage -018-/RD/1/ANIMAGE - *
CB-Tinypad -011-/RD/1/TINYPAD - *
IB-AC97 -002-/RD/1/AC97WAV - *
JC-Docpack -010-/RD/1/DOCPACK - *
BC-Calc -006-/RD/1/CALC - *
HA-MTDBG -029-/RD/1/MTDBG - *

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -0,0 +1,2 @@
@fasm kbd.asm kbd
@pause

View File

@ -0,0 +1,569 @@
;
; Kolibri Bus Disconnect
; Test for bus disconnect
;
; Compile with FASM for Menuet
;
;
include 'macros.inc'
include 'lang.inc'
memsize = 1000h
org 0
PARAMS = memsize - 1024
appname equ 'Kolibri Bus Disconnect'
version equ ' 1.1 '
use32 ; ¢ª«îç¨âì 32-¡¨â­ë© ०¨¬  áᥬ¡«¥à 
db 'MENUET01' ; 8 byte id
dd 0x01 ; header version
dd START ; start of code
dd I_END ; size of image
dd memsize ; memory for app
dd memsize - 1024 ; esp
dd PARAMS , 0x0 ; I_Param , I_Icon
;---------------------------------------------------------------------
;--- <20>€—€Ž <20><>Žƒ<C5BD>€ŒŒ ----------------------------------------------
;---------------------------------------------------------------------
START:
cmp [PARAMS], byte 0
jne check_parameters
no_params:
call find_north_bridg
drawwindow:
mov eax,48
mov ebx,3
mov ecx,sc
mov edx,sizeof.system_colors
int 0x40
mov eax, 12
mov ebx, 1 ; start redraw
int 0x40
mov eax, 0 ; window
mov ebx, 100 shl 16 + 300
mov ecx, 100 shl 16 + 90
mov edx, [sc.work]
or edx, 0x13000000
mov edi, header
int 0x40
mov eax, 4
mov ebx, 17 shl 16 + 30
mov ecx, [sc.work_text]
mov edx, msg_nb
mov esi, 14
int 0x40
mov ebx, 105 shl 16 + 30
mov edx, [nb_name]
movzx esi, byte[edx]
inc edx
int 0x40
mov ebx, 17 shl 16 + 40
mov edx, msg_stat
mov esi, 8
int 0x40
mov ebx, 102 shl 16 + 50
mov edx, msg_divs
mov esi, 32
int 0x40
mov ebx, 17 shl 16 + 62
mov edx, msg_hdd
mov esi, 10
int 0x40
mov ebx, 17 shl 16 + 72
mov edx, msg_sgd
int 0x40
call get_divs
mov eax, 47
mov ebx, 0x30000
mov ecx, [val_hdd]
mov edx, 8
shl edx, cl
mov ecx, edx
mov edx, 80 shl 16 + 62
mov esi, [sc.work_text]
int 0x40
mov ecx, [val_sgd]
mov edx, 8
shl edx, cl
mov ecx, edx
mov edx, 80 shl 16 + 72
int 0x40
call get_bd_stat
mov ecx, [sc.work_text]
mov esi, 9
mov ebx, 105 shl 16 + 40
mov edx, msg_nf
mov al, [bd_stat]
test al, al
jz @f
mov edx, msg_dis
dec al
jz @f
mov edx, msg_en
@@: mov eax, 4
int 0x40
; ‘®§¤ ñ¬ ª­®¯ªã
mov ecx, 27 shl 16 + 20
mov eax, 8
mov ebx, 220 shl 16 + 70
mov esi, [sc.work_button]
mov edx, 2
int 0x40
; ˆ ¥éñ 14 ;)
mov edi, 7
mov ecx, 60 shl 16 + 10
mov eax, 8
mov ebx, 105 shl 16 + 25
mov edx, 3
@@: int 0x40
inc edx
add ebx, 27 shl 16
dec edi
jnz @b
add ecx, 12 shl 16
mov ebx, 105 shl 16 + 25
mov edi, 7
@@: int 0x40
inc edx
add ebx, 27 shl 16
dec edi
jnz @b
end_dr: mov eax, 12
mov ebx, 2 ; end redraw
int 0x40
; Wait for event ...
mov eax, 10
int 0x40
cmp al, 3
jne not_bt
mov eax, 17 ; get id
int 0x40
cmp ah, 1
jne no_exit
mov eax, -1 ; close this program
int 0x40
no_exit:
cmp ah, 2
jne no_ch_bt
mov dl, [bd_stat]
test dl, dl
jz drawwindow
xor eax, eax
dec dl
jnz @f
inc eax
@@: call set_bd_stat
jmp drawwindow
no_ch_bt:
cmp ah, 9
jg no_hdd_bt
sub ah, 3
movzx esi, ah
mov edi, [val_sgd]
call set_divs
jmp drawwindow
no_hdd_bt:
sub ah, 10
movzx edi, ah
mov esi, [val_hdd]
call set_divs
jmp drawwindow
not_bt: cmp al, 2
jne drawwindow
mov eax, 2 ; ¯®ª  ª« ¢  ­¥ ¯®¤¤¥à¦¨¢ ¥âáï - ç¨â ¥¬ ¨ § ¡ë¢ ¥¬
int 0x40
jmp drawwindow
;--------------------------------------------------------------------------
bus_num: db 2 ; <20>®¬¥à 設ë
devfn: db 255
bd_id: dd 0 ; ˆ¤¥­â¨ä¨ª â®à ãáâனá⢠
bd_stat: db 0 ; 0 - ­¥ ­ ©¤¥­, 1 - ¢ëª«î祭, 2 - ¢ª«î祭
nb_name dd nb_nf
bd_msk dd msk_i440
nb_nf db 9, 'Not found'
msk_i440 db 0
nb_i440 db 4, 'i440'
msk_nforce db 0x6D, 0x80, 0xE7, 0x06, 0 ; ­®¬¥à ॣ¨áâà , ¬ áª , ­®¬¥à ॣ¨áâà , ¬ áª , ... , 0
nb_nforce db 6, 'nForce'
msk_nforce2 db 0x6F, 0x10, 0
nb_nforce2 db 8, 'nForce 2'
msk_sis730 db 0x6B, 0x01, 0
nb_sis730 db 7, 'SiS 730'
nb_sis733 db 7, 'SiS 733'
msk_sis735 db 0x6A, 0x03, 0
nb_sis735 db 7, 'SiS 735'
nb_sis740 db 7, 'SiS 740'
nb_sis741 db 7, 'SiS 741'
nb_sis745 db 7, 'SiS 745'
msk_sis746 db 0x6C, 0x01, 0
nb_sis746 db 7, 'SiS 746'
nb_sis748 db 7, 'SiS 748'
msk_amd751 db 0x62, 0x06, 0
nb_amd751 db 7, 'AMD 751'
nb_amd751s db 8, 'AMD 751S'
nb_amd761 db 7, 'AMD 761'
msk_amd762 db 0x62, 0x02, 0x6A, 0x02, 0
nb_amd762 db 7, 'AMD 762'
msk_viakt133 db 0x52, 0x80, 0x70, 0x08, 0
nb_viakt133 db 30, 'VIA KT133(A)/KM133/KL133/KN133'
nb_viakx133 db 9, 'VIA KX133'
nb_viakle133 db 10, 'VIA KLE133'
msk_viakt266 db 0x92, 0x80, 0x95, 0x02, 0x70, 0x08, 0
nb_viakt266 db 18, 'VIA KT266(A)/KT333'
nb_viakm266 db 21, 'VIA KM266/KL266/KM333'
nb_vikn266 db 9, 'VIA KN266'
msk_viakt400 db 0xD2, 0x80, 0xD5, 0x02, 0x70, 0x08, 0
nb_viakt400 db 18, 'VIA KT400(A)/KT600'
nb_viakm400 db 9, 'VIA KM400'
msk_viakt880 db 0x82, 0x80, 0x85, 0x02, 0
nb_viakt880 db 9, 'VIA KT880'
bd_table: dd 0x70061022 ; AMD 751 ----
dd nb_amd751
dd msk_amd751
dd 0x70041022 ; AMD 751S
dd nb_amd751s
dd msk_amd751
dd 0x700E1022 ; AMD 761
dd nb_amd761
dd msk_amd751
dd 0x700C1022 ; AMD 762
dd nb_amd762
dd msk_amd762
dd 0x71908086 ; i440 ---
dd nb_i440
dd msk_i440
dd 0x01A410DE ; nForce ----
dd nb_nforce
dd msk_nforce
dd 0x01E010DE ; nForce 2
dd nb_nforce2
dd msk_nforce2
dd 0x07301039 ; SiS 730 ----
dd nb_sis730
dd msk_sis730
dd 0x07331039 ; SiS 733
dd nb_sis730
dd msk_sis730
dd 0x07351039 ; SiS 735
dd nb_sis735
dd msk_sis735
dd 0x07401039 ; SiS 740
dd nb_sis735
dd msk_sis735
dd 0x07411039 ; SiS 741
dd nb_sis735
dd msk_sis735
dd 0x07451039 ; SiS 745
dd nb_sis735
dd msk_sis735
dd 0x07461039 ; SiS 746
dd nb_sis746
dd msk_sis746
dd 0x07481039 ; SiS 748
dd nb_sis746
dd msk_sis746
dd 0x03051106 ; VIA KT133(A)/KM133/KL133/KN133 ----
dd nb_viakt133
dd msk_viakt133
dd 0x03911106 ; VIA KX133
dd nb_viakt133
dd msk_viakt133
dd 0x06911106 ; VIA KLE133
dd nb_viakt133
dd msk_viakt133
dd 0x30991106 ; VIA KT266(A)/KT333
dd nb_viakt266
dd msk_viakt266
dd 0x31161106 ; VIA KM266/KL266/KM333
dd nb_viakt266
dd msk_viakt266
dd 0x31561106 ; VIA KN266
dd nb_viakt266
dd msk_viakt266
dd 0x31891106 ; VIA KT400(A)/KT600
dd nb_viakt400
dd msk_viakt400
dd 0x32051106 ; VIA KM400
dd nb_viakm400
dd msk_viakt400
dd 0x22691106 ; VIA KT880
dd nb_viakt880
dd msk_viakt880
bd_table_end:
find_north_bridg:
mov bl, 6
xor cl, cl
nbus: mov bh, [bus_num]
ndevfn: mov ch, [devfn]
mov eax, 62
int 0x40
cmp eax, 0xffffffff
je bd_next
;---------
mov esi, bd_table_end - bd_table - 12
@@: cmp eax, [bd_table + esi]
je bd_found
test esi, esi
jz bd_next
sub esi, 12
jmp @b
;---------
bd_next:dec byte[devfn]
jns ndevfn
mov byte[devfn], 0
dec byte[bus_num]
jns nbus
ret
bd_found:
add esi, bd_table + 4
mov edi, nb_name
mov ecx, 2
rep movsd
mov [bd_id], eax
ret
;----------------------
;bd_stat: db 0 ; 0 - ­¥ ­ ©¤¥­, 1 - ¢ëª«î祭, 2 - ¢ª«î祭
get_bd_stat:
mov byte[bd_stat], 1
cld
mov esi, [bd_msk]
lodsw
test al, al
jnz @f
mov byte[bd_stat], 0
ret
@@: push eax
mov bh, [bus_num]
mov bl, 4
mov ch, [devfn]
mov cl, al
mov eax, 62
int 0x40
pop edx
and al, dh
jnz @f
lodsw
test al, al
jnz @b
ret
@@: mov byte[bd_stat], 2
ret
;----------------------
set_bd_stat:
cmp dword[bd_id], 0x01E010DE ; ᯥ樠«ì­® ¤«ï nForce2 400
je set_stat_nforce2
mov edi, eax
cld
mov esi, [bd_msk]
bd_ss_nxt:
lodsw
test al, al
jz bd_ss_end
mov dl, ah ; ¬ áª 
mov bh, [bus_num]
mov bl, 4
mov ch, [devfn]
mov cl, al
mov eax, 62
int 0x40
mov bl, 8
test edi, edi
jz @f
or al, dl
mov dl, al
mov eax, 62
int 0x40
jmp bd_ss_nxt
@@: not dl
and al, dl
mov dl, al
mov eax, 62
int 0x40
jmp bd_ss_nxt
bd_ss_end:
ret
;------- nForce 2 -----------
set_stat_nforce2:
; IN : eax = 0 - disable, !0 - enable
push eax
mov bh, [bus_num]
mov bl, 4
mov ch, [devfn]
mov cl, 0x6f
mov eax, 62
int 0x40
and al, 0x1F
mov dl, al
mov bl, 8
mov eax, 62
int 0x40
pop eax
test eax, eax
jz @f
or dl, 0x10
mov eax, 62
int 0x40
ret
@@: and dl, 0xef
mov eax, 62
int 0x40
ret
;--------------------------------------------------------------------------
; x8 x16 x32 x64 x128 x256 x512
div_hdd: db 0x23, 0x27, 0x2B, 0x2F, 0x63, 0x67, 0x6B ; Halt Disconnect Divisor
div_sgd: db 0x12, 0x52, 0x92, 0xD2, 0x12, 0x52, 0x92 ; Stop Grand Divisor
; low word of 0xC001001B MSR
; HDD\SGD 8 16 32 64 128 256 512
; 8 0x1223 0x5223 0x9223 0xD223 | 0x1223 0x5223 0x9223
; 16 0x1227 |
; 32 0x122B |
; 64 0x122F | 0x522F
; 128 0x1263 |
; 256 0x1267 & bin 18 is clear | & bin 18 is set
; 512 0x126B |
; ^^^^
; ||||_HDD
; ||_SGD
set_divs:
; IN : ESI - hdd (0 = x8, 1 = x16 ..)
; EDI - sgd (0 = x8, 1 = x16 ..)
mov eax, 68
mov ebx, 3
mov edx, 0xC001001b
int 0x40
mov al, [div_hdd + esi]
mov ah, [div_sgd + edi]
and eax, 0xFFFBFFFF
cmp edi, 3
jle @f
or eax, 0x40000
@@: mov edi, eax
mov esi, ebx
mov eax, 68
mov ebx, 4
int 0x40
ret
get_divs:
; OUT : val_hdd - hdd (0 = x8, 1 = x16 ..)
; val_sgd - sgd ...
mov eax, 68
mov ebx, 3
mov edx, 0xC001001b
int 0x40
mov ecx, 7
@@: cmp [div_hdd + ecx - 1], al
je @f
loop @b
@@: dec ecx
mov [val_hdd], ecx
mov ecx, 4
@@: cmp [div_sgd + ecx - 1], ah
je @f
loop @b
@@: dec ecx
test eax, 0x40000
jz @f
add ecx, 4
@@: mov [val_sgd], ecx
ret
;******************************************************************************
check_parameters:
cmp [PARAMS], dword "BOOT" ; received BOOT parameter -> goto handler
je boot_bd_enable
jmp no_params
;******************************************************************************
boot_bd_enable:
call find_north_bridg
call set_bd_stat
mcall -1
;******************************************************************************
;--------------------------------------------------------------------------
header db appname,version,0
msg_divs db ' x8 x16 x32 x64 x128 x256 x512'
msg_hdd db 'Hatl Disc.'
msg_sgd db 'Stop Grand'
msg_nb db 'North bridge :';14
msg_stat db 'Status :' ;8
msg_en db 'Enabled ' ;9
msg_dis db 'Disabled ' ;9
msg_nf db 'Not found' ;9
I_END:
sc system_colors
val_hdd: dd ?
val_sgd: dd ?

View File

@ -0,0 +1,266 @@
; new application structure
macro meos_app_start
{
use32
org 0x0
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
dd 0x0
}
MEOS_APP_START fix meos_app_start
macro code
{
__start:
}
CODE fix code
macro data
{
__data:
}
DATA fix data
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
macro __mov reg,a { ; mike.dld
if ~a eq
mov reg,a
end if
}
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
; language for programs
lang fix ru ; ru en fr ge fi
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
; constants
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b

View File

@ -0,0 +1,45 @@
Kolibri Bus Disconnect
Автор : Михайлов Илья Андреевич aka Ghost
Версия : от 24/10/06
ОС : Kolibri
forum : meos.sysbin.com -> Программы -> GMon
mailto : ghost.nsk@mail.ru
Поддерживаемые чипсеты:
AMD 751
AMD 751S
AMD 761
AMD 762
NVIDIA nForce
NVIDIA nForce 2 (400)
SiS 735
SiS 740
SiS 741
SiS 745
SiS 730
SiS 733
SiS 746
SiS 748
VIA KT133(A)/KM133/KL133/KN133 *
VIA KX133
VIA KLE133
VIA KT266(A)/KT333
VIA KM266/KL266/KM333
VIA KN266
VIA KT400(A)/KT600
VIA KM400
VIA KT880
ПРИМЕЧАНИЕ: (Heavyiron, 24.10.2006)
Владельцы данных чипсетов могут (при желании) поместить
эту программу в автозагрузку с параметром boot. Для этого в
autorun.dat необходимо поместить,например, такую строку:
"/RD/1/KBD BOOT 20 # Enable Bus Disconnect for AMD K7 processors",
не забыв при этом увеличить количество запускаемых программ на одну
в самом начале файла autorun.dat.

View File

@ -468,11 +468,11 @@ draw_window:
shl ecx, 16 shl ecx, 16
add ecx, BTN_HEIGHT-1 add ecx, BTN_HEIGHT-1
; edx = button identifier ; edx = button identifier
mov esi, [sc.work_button] mov esi, [sc.work]
inc dl inc dl
cmp [edi + cur_sel], dl cmp [edi + cur_sel], dl
jne .nohighlight jne .nohighlight
add esi, 0x202020 add esi, 0x101010
.nohighlight: .nohighlight:
or edx, 0x20000000 or edx, 0x20000000
int 0x40 int 0x40
@ -497,7 +497,7 @@ draw_window:
dec ecx dec ecx
jnz .findline jnz .findline
mov ecx, [sc.work_button_text] mov ecx, [sc.work_text]
mov eax, 4 mov eax, 4
mov esi, 21 mov esi, 21
int 0x40 int 0x40