From df5b0209d7447457792c868d80291da2e0a1060a Mon Sep 17 00:00:00 2001 From: "Mihail Semenyako (mike.dld)" Date: Sat, 4 Mar 2006 11:44:33 +0000 Subject: [PATCH] ICON2, @PANEL: changes to perform self-reposition on screen resolution change @PANEL: display of up to 255 running applications (from Mario79) VRR: don't kill applications on screen resolution change GRSCREEN: don't set up system colors (they're taken from skin file now) DESKTOP: added ability to change window skins 'on the fly' (with preview) git-svn-id: svn://kolibrios.org@51 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/desktop/trunk/desktop.asm | 516 +++++-- programs/desktop/trunk/macros.inc | 36 +- programs/grscreen/trunk/grscreen.asm | 17 - programs/icon/trunk/gif_lite.inc | 328 +++++ programs/icon/trunk/icon.asm | 1961 +++++++++++++++++++------- programs/panel/trunk/@PANEL.ASM | 462 ++++-- programs/panel/trunk/setup.asm | 1648 ---------------------- programs/vrr/trunk/vrr.asm | 43 - 8 files changed, 2506 insertions(+), 2505 deletions(-) create mode 100644 programs/icon/trunk/gif_lite.inc delete mode 100644 programs/panel/trunk/setup.asm diff --git a/programs/desktop/trunk/desktop.asm b/programs/desktop/trunk/desktop.asm index 2a2bdf35aa..4b8a48e3b5 100644 --- a/programs/desktop/trunk/desktop.asm +++ b/programs/desktop/trunk/desktop.asm @@ -1,9 +1,10 @@ ; -; UNIFORM WINDOW COLOURS +; UNIFORM WINDOW COLOURS & SKIN ; ; Compile with FASM for Menuet ; ; < russian edition by Ivan Poddubny > +; < skin selection by Mike Semenyako > ; ;****************************************************************************** @@ -13,15 +14,55 @@ dd 1 ; header version dd START ; start address dd I_END ; file size - dd 20000h ; memory + dd 28000h ; memory dd 10000h ; stack pointer (0x10000+ - work area for os) dd 0;,0 ; parameters, reserved - include 'lang.inc' + include 'lang.inc' include 'macros.inc' ;****************************************************************************** +struct SKIN_HEADER + .ident dd ? + .version dd ? + .params dd ? + .buttons dd ? + .bitmaps dd ? +ends + +struct SKIN_PARAMS + .skin_height dd ? + .margin.right dw ? + .margin.left dw ? + .margin.bottom dw ? + .margin.top dw ? + .colors.inner dd ? + .colors.outer dd ? + .colors.frame dd ? + .colors_1.inner dd ? + .colors_1.outer dd ? + .colors_1.frame dd ? + .dtp.size dd ? + .dtp.data db 40 dup (?) +ends + +struct SKIN_BUTTONS + .type dd ? + .pos: + .left dw ? + .top dw ? + .size: + .width dw ? + .height dw ? +ends + +struct SKIN_BITMAPS + .kind dw ? + .type dw ? + .data dd ? +ends + START: ; start of execution @@ -32,14 +73,14 @@ START: ; start of execution int 0x40 cld - mov esi, default_file - mov edi, fname - mov ecx, default_file.size + mov esi,default_skn + mov edi,fname + mov ecx,default_skn.size rep movsb + mov [skin_info.fname],0 + mov [skin_info.workarea],0x10000 + call load_skin_file - mov [read_info.address], color_table - mov [read_info.workarea], 0x10000 - mov [read_info.start_block], 0 red: call draw_window ; at first, draw the window @@ -71,6 +112,25 @@ still: mov eax,17 ; get id int 0x40 + cmp ah,11 ; read string + jne no_string + call read_string + jmp still + no_string: + + cmp ah,12 ; load file + jne no_load + call load_file + call draw_window + jmp still + no_load: + + cmp ah,13 ; save file + jne no_save + call save_file + jmp still + no_save: + cmp ah,14 ; set 3d buttons jne no_3d mov eax,48 @@ -91,8 +151,9 @@ still: jmp still no_flat: - cmp ah,51 ; apply + cmp ah,16 ; apply jne no_apply + apply_direct: mov eax,48 mov ebx,2 mov ecx,color_table @@ -104,6 +165,22 @@ still: int 0x40 no_apply: + cmp ah,17 ; load skin file + jne no_load_skin + call load_skin_file + call draw_window + jmp still + no_load_skin: + + cmp ah,18 ; apply skin + jne no_apply_skin + cmp [skin_info.fname],0 + je no_apply_skin + mcall 48,8,skin_info + call draw_window + jmp still + no_apply_skin: + cmp ah,31 jb no_new_colour cmp ah,41 @@ -124,25 +201,6 @@ still: int 0x40 noid1: - cmp ah,11 ; read string - jne no_string - call read_string - jmp still - no_string: - - cmp ah,12 ; load file - jne no_load - call load_file - call draw_window - jmp still - no_load: - - cmp ah,13 ; save file - jne no_save - call save_file - jmp still - no_save: - jmp still @@ -174,9 +232,9 @@ draw_cursor: cmp ebx,32 jbe no_color - cmp ebx,280 ; CHANGE COLOR + cmp ebx,266 ; CHANGE COLOR jb no_color - cmp ebx,280+20*3 + cmp ebx,266+20*3 jg no_color cmp ecx,30+128 @@ -184,7 +242,7 @@ draw_cursor: cmp ecx,30 jb no_color - sub ebx,280 + sub ebx,266 mov eax,ebx cdq mov ebx,20 @@ -211,11 +269,47 @@ draw_cursor: load_file: pushad - mov [read_info.mode], 0 - mov [read_info.blocks], 1 + mov [read_info.mode] ,0 + mov [read_info.start_block],0 + mov [read_info.blocks] ,1 + mov [read_info.address] ,color_table + mov [read_info.workarea] ,0x10000 mcall 58, read_info - call draw_colours + popad +ret + +load_skin_file: + pushad + + mov [read_info.mode] ,0 + mov [read_info.start_block],0 + mov [read_info.blocks] ,64 + mov [read_info.address] ,0x20000 + mov [read_info.workarea] ,0x10000 + mcall 58, read_info + + cmp dword[0x20000+SKIN_HEADER.ident],'SKIN' + jne @f + + mov esi,fname + mov edi,skin_info.fname + mov ecx,257 + rep movsb + + mov esi,0x20000 + mov edi,0x18000 + mov ecx,0x8000/4 + rep movsd + + mov ebp,0x18000 + mov esi,[ebp+SKIN_HEADER.params] + add esi,ebp + lea esi,[esi+SKIN_PARAMS.dtp.data] + mov edi,color_table + mov ecx,10 + rep movsd + @@: popad ret @@ -224,8 +318,10 @@ ret save_file: pushad - mov [write_info.mode], 1 - mov [write_info.bytes2write], 10*4 + mov [write_info.mode] ,1 + mov [write_info.bytes2write],10*4 + mov [write_info.address] ,color_table + mov [write_info.workarea] ,0x10000 mcall 58, write_info popad @@ -238,7 +334,7 @@ read_string: mov edi,fname mov al,'_' - mov ecx,54 + mov ecx,87 cld rep stosb @@ -270,13 +366,13 @@ read_string: call print_text inc edi - cmp edi, fname+54 + cmp edi, fname+87 jne f11 read_done: mov ecx, fname - add ecx, 55 + add ecx, 88 sub ecx, edi mov eax, 0 cld @@ -292,12 +388,12 @@ read_string: print_text: pushad - mpack ebx, 16, 6*54+4 - mpack ecx, 234, 10 - mcall 13, , , [w_work] + mpack ebx,15,6*87+4 + mpack ecx,(30+18*10+2),11 + mcall 13,,,[w_work] - mpack ebx, 17, 235 - mcall 4, , [w_work_text], fname, 54 + mpack ebx,17,(30+18*10+4) + mcall 4,,[w_work_text],fname,87 popad ret @@ -308,13 +404,13 @@ draw_color: pusha mov eax,13 - mov ebx,280*65536+60 + mov ebx,266*65536+60 mov ecx,170*65536+30 mov edx,[color] int 0x40 ; mov eax,13 - mov ebx,280*65536+60 + mov ebx,266*65536+60 mov ecx,200*65536+10 mov edx,[w_work] int 0x40 @@ -322,7 +418,7 @@ draw_color: mov eax,47 mov ebx,0+1*256+8*65536 mov ecx,[color] - mov edx,280*65536+201 + mov edx,272*65536+201 mov esi,[w_work_text] int 0x40 @@ -338,12 +434,12 @@ draw_colours: mov esi,color_table mov ebx,225*65536+32 - mov ecx,37*65536+12 + mov ecx,32*65536+12 newcol: mov eax,13 mov edx,[esi] int 0x40 - add ecx,20*65536 + add ecx,18*65536 add esi,4 cmp esi,color_table+4*9 jbe newcol @@ -353,6 +449,189 @@ draw_colours: ret +draw_framerect: ; ebx,ecx + push ebx ecx + add bx,[esp+6] + mov cx,[esp+2] + dec ebx + mcall 38 + add cx,[esp] + rol ecx,16 + add cx,[esp] + sub ecx,0x00010001 + mcall + mov ebx,[esp+4] + mov ecx,[esp] + mov bx,[esp+6] + add cx,[esp+2] + dec ecx + mcall + add bx,[esp+4] + rol ebx,16 + add bx,[esp+4] + sub ebx,0x00010001 + mcall + add esp,8 + ret + +find_bitmap: + mov edi,[ebp+SKIN_HEADER.bitmaps] + add edi,ebp + xor ebx,ebx + .lp1: cmp dword[edi],0 + je .lp2 + cmp dword[edi+0],eax + jne @f + mov ebx,[edi+SKIN_BITMAPS.data] + add ebx,ebp + mov ecx,[ebx-2] + mov cx,[ebx+4] + add ebx,8 + .lp2: ret + @@: add edi,8 + jmp .lp1 + +draw_skin: + mcall 13,<345,206>,<20,191>,0x00FFFFFF + mov ebp,0x18000 + mov edi,[ebp+SKIN_HEADER.params] + add edi,ebp + mpack ebx,345+45,150 + mpack ecx,20+10,140 + mov edx,[edi+SKIN_PARAMS.colors_1.outer] + call draw_framerect + mpack ebx,345+45+4,150-8 + mpack ecx,20+10+4,140-8 + mov edx,[edi+SKIN_PARAMS.colors_1.inner] + call draw_framerect + mcall 13,<345+45+1,148>,<20+10+1,3>,[edi+SKIN_PARAMS.colors_1.frame] + add ecx,135*65536 + mcall + mcall ,<345+45+1,3>,<20+10+1,138> + add ebx,145*65536 + mcall + mcall ,<345+45+5,140>,<20+10+5,130>,dword[edi+SKIN_PARAMS.dtp.data+system_colors.work] + + mov eax,0x00000001 ; left, inactive + call find_bitmap + mcall 7,,,<345+45,20+10> + + pushd [ebx-8] + mov eax,0x00000003 ; base, inactive + call find_bitmap + pop edx + mov esi,345+45+150-1 + sub esi,edx + shl edx,16 + add edx,(345+45)*65536+20+10 + mcall 7 + @@: rol edx,16 + add dx,[ebx-8] + cmp dx,si + ja @f + rol edx,16 + mcall 7 + jmp @b + @@: + + mov eax,0x00000002 ; oper, inactive + call find_bitmap + mov edx,ecx + shr edx,16 + neg edx + shl edx,16 + add edx,(345+45+150)*65536+20+10 + mcall 7 + + mov ebp,0x18000 + mov edi,[ebp+SKIN_HEADER.params] + add edi,ebp + mov eax,dword[edi+SKIN_PARAMS.margin.left-2] + mov ax,word[edi+SKIN_PARAMS.skin_height] + sub ax,[edi+SKIN_PARAMS.margin.bottom] + shr ax,1 + add ax,[edi+SKIN_PARAMS.margin.top] + add ax,-4 + push eax + lea ebx,[eax+(345+45)*65536+20+10] + mcall 4,,dword[edi+SKIN_PARAMS.dtp.data+system_colors.grab_text],test_text,test_text.size + +;--------------------------------------------------------- + + mov edi,[ebp+SKIN_HEADER.params] + add edi,ebp + mpack ebx,345+10,150 + mpack ecx,20+40,140 + mov edx,[edi+SKIN_PARAMS.colors.outer] + call draw_framerect + mpack ebx,345+10+4,150-8 + mpack ecx,20+40+4,140-8 + mov edx,[edi+SKIN_PARAMS.colors.inner] + call draw_framerect + mcall 13,<345+10+1,148>,<20+40+1,3>,[edi+SKIN_PARAMS.colors.frame] + add ecx,135*65536 + mcall + mcall ,<345+10+1,3>,<20+40+1,138> + add ebx,145*65536 + mcall + mcall ,<345+10+5,140>,<20+40+5,130>,dword[edi+SKIN_PARAMS.dtp.data+system_colors.work] + + mov eax,0x00010001 ; left, inactive + call find_bitmap + mcall 7,,,<345+10,20+40> + + pushd [ebx-8] + mov eax,0x00010003 ; base, inactive + call find_bitmap + pop edx + mov esi,345+10+150-1 + sub esi,edx + shl edx,16 + add edx,(345+10)*65536+20+40 + mcall 7 + @@: rol edx,16 + add dx,[ebx-8] + cmp dx,si + ja @f + rol edx,16 + mcall 7 + jmp @b + @@: + + mov eax,0x00010002 ; oper, inactive + call find_bitmap + mov edx,ecx + shr edx,16 + neg edx + shl edx,16 + add edx,(345+10+150)*65536+20+40 + mcall 7 + + mov ebp,0x18000 + mov edi,[ebp+SKIN_HEADER.params] + add edi,ebp + pop eax + lea ebx,[eax+(345+10)*65536+20+40] + mcall 4,,dword[edi+SKIN_PARAMS.dtp.data+system_colors.grab_text],test_text,test_text.size + +;---------------------------------------------------------------------- + + mov edi,[ebp+SKIN_HEADER.buttons] + add edi,ebp + .lp1: cmp dword[edi],0 + je .lp2 + mov ebx,dword[edi+SKIN_BUTTONS.left-2] + mov bx,[edi+SKIN_BUTTONS.width] + mov ecx,dword[edi+SKIN_BUTTONS.top-2] + mov cx,[edi+SKIN_BUTTONS.height] + add ebx,(345+10+150)*65536 + add ecx,(20+40)*65536 + dec ebx + dec ecx + mcall 8,,,0x40000000 + add edi,12 + jmp .lp1 + .lp2: ret ; ********************************************* ; ******* WINDOW DEFINITIONS AND DRAW ******** @@ -380,8 +659,8 @@ draw_window: ; DRAW WINDOW mov eax,0 ; function 0 : define and draw window - mov ebx,110*65536+360 ; [x start] *65536 + [x size] - mov ecx,50*65536+300 ; [y start] *65536 + [y size] + mov ebx,110*65536+555 ; [x start] *65536 + [x size] + mov ecx,50*65536+255 ; [y start] *65536 + [y size] mov edx,[w_work] ; color of work area RRGGBB,8->color or edx,0x02000000 mov esi,[w_grab] ; color of grab bar RRGGBB,8->color gl @@ -401,60 +680,81 @@ end if int 0x40 ; CLOSE BUTTON mov eax,8 ; function 8 : define and draw button - mov ebx,(360-19)*65536+12 ; [x start] *65536 + [x size] + mov ebx,(555-19)*65536+12 ; [x start] *65536 + [x size] mov ecx,4*65536+12 ; [y start] *65536 + [y size] mov edx,1 ; button id mov esi,[w_grab_button] ; button color RRGGBB int 0x40 +if lang eq ru + load_w = (5*2+6*9) + save_w = (5*2+6*9) + flat_w = (5*2+6*7) + apply_w = (5*2+6*9) +else + load_w = (5*2+6*6) + save_w = (5*2+6*6) + flat_w = (5*2+6*4) + apply_w = (5*2+6*7) +end if + ; mov eax,8 ; FILENAME BUTTON - mov ebx,280*65536+60 - mov ecx,250*65536+14 - mov edx,11 + mov ebx,5*65536+545 + mov ecx,212*65536+10 + mov edx,0x4000000B + int 0x40 + +; mov eax,8 ; LOAD BUTTON + mov ebx,15*65536+load_w + mov ecx,(30+18*11)*65536+14 + mov edx,12 mov esi,[w_work_button] int 0x40 ; mov eax,8 ; SAVE BUTTON - mov ebx,280*65536+29 - mov ecx,270*65536+14 - mov edx,12 - int 0x40 - -; mov eax,8 ; LOAD BUTTON - add ebx,30*65536 + add ebx,(load_w+2)*65536-load_w+save_w inc edx int 0x40 ; mov eax,8 ; 3D - mov ebx,15*65536+35 - mov ecx,275*65536+14 + mov ebx,(340-t1.size*6-13)*65536+(5*2+6*4) inc edx int 0x40 ; mov eax,8 ; FLAT -if lang eq ru - add ebx,40*65536+7 -else - add ebx,40*65536 -end if + add ebx,(5*2+6*4+2)*65536-(5*2+6*4)+flat_w inc edx int 0x40 +; mov eax,8 ; APPLY BUTTON + add ebx,(flat_w+6+2)*65536-flat_w+apply_w + inc edx + int 0x40 + +; mov eax,8 ; LOAD SKIN BUTTON + mov ebx,(336+(555-335)/2-t2.size*6/2)*65536+load_w + inc edx + int 0x40 + +; mov eax,8 ; APPLY SKIN BUTTON + add ebx,(load_w+6+2)*65536-load_w+apply_w + inc edx + int 0x40 mov eax, 4 - mov ebx, 281*65536+254 + mov ebx, (339-t1.size*6-12)*65536+(30+18*11+4) mov ecx, [w_work_button_text] mov edx, t1 mov esi, t1.size int 0x40 -; mov eax, 4 - mov ebx, 277*65536+274 - mov edx, t2 - mov esi, t2.size + mov ebx,(336+(555-335)/2-t2.size*6/2)*65536+(30+18*11+4) + mov edx,t2 + mov esi,t2.size int 0x40 + mov eax,38 ; R G B COLOR GLIDES - mov ebx,280*65536+300 ;295 + mov ebx,266*65536+285 mov ecx,30*65536+30 mov edx,0xff0000 .newl: @@ -476,37 +776,50 @@ end if mov edx,31 ; BUTTON ROW mov ebx,15*65536+200 - mov ecx,35*65536+14 + mov ecx,30*65536+14 mov esi,[w_work_button] newb: mov eax,8 int 0x40 - add ecx,20*65536 + add ecx,18*65536 inc edx cmp edx,40 jbe newb -; mov eax,8 ; APPLY BUTTON - add ecx,20*65536 - mov edx,51 - int 0x40 - - mov ebx,20*65536+39 ; ROW OF TEXTS + mov ebx,15*65536+34 ; ROW OF TEXTS mov ecx,[w_work_button_text] mov edx,text mov esi,32 newline: mov eax,4 int 0x40 - add ebx,20 + add ebx,18 add edx,32 cmp [edx],byte 'x' jne newline call draw_colours + mcall 13,<5,546>,<212,11>,[w_work] + mcall 13,<337,7>,<2,250>,[w_frame] + shr edx,1 + and edx,0x007F7F7F + mcall 38,<336,336>,<20,250> + add ebx,0x00080008 + mcall + sub ebx,0x00040004 + mcall ,,<0,255> + mcall ,<5,550>,<211,211> + add ecx,0x000C000C + mcall + call print_text + cmp dword[0x18000+SKIN_HEADER.ident],'SKIN' + jne @f + call draw_skin + @@: + mov eax,12 ; function 12:tell os about windowdraw mov ebx,2 ; 2, end of draw int 0x40 @@ -528,8 +841,7 @@ lsz text,\ ru, ' ’…Š‘’ ‚ €Ž—…‰ Ž‹€‘’ˆ ',\ ru, ' ƒ€”ˆŠ€ ‚ €Ž—…‰ Ž‹€‘’ˆ ',\ ru, ' ',\ - ru, ' ˆŒ…ˆ’œ ',\ - ru, ' 3D ‹Ž‘Š ',\ + ru, ' ‡€ƒ“‡ˆ’œ ‘Ž•€ˆ’œ ',\ ru, 'x',\ en, ' WINDOW FRAME ',\ en, ' WINDOW GRAB BAR ',\ @@ -542,25 +854,27 @@ lsz text,\ en, ' WINDOW WORK AREA TEXT ',\ en, ' WINDOW WORK AREA GRAPH ',\ en, ' ',\ - en, ' APPLY CHANGES ',\ - en, ' 3D FLAT ',\ + en, ' LOAD SAVE ',\ en, 'x' -lsz t2,\ - ru, ' ‡€ƒ ‘Ž• ',\ - en, ' LOAD SAVE ' - lsz t1,\ - ru, ' ”€‰‹ ',\ - en, ' FILENAME ' + ru, ' 3D ‹Ž‘Šˆ… ˆŒ…ˆ’œ ',\ + en, ' 3D FLAT APPLY ' + +lsz t2,\ + ru, ' ‡€ƒ“‡ˆ’œ ˆŒ…ˆ’œ ',\ + en, ' LOAD APPLY ',\ + +lsz test_text,\ + ru, '‡ ฃฎซฎขฎช',\ + en, 'Caption' lsz labelt,\ ru, '€‘’Ž‰Š€ –‚…’Ž‚',\ en, 'DESKTOP COLOURS - DEFINE COLOR AND CLICK ON TARGET' - -sz default_file, '/RD/1/DEFAULT.DTP' +sz default_skn, '/RD/1/DEFAULT.SKN',0 color dd 0 @@ -583,6 +897,14 @@ virtual at read_info .workarea dd ? end virtual +skin_info: + .mode dd ? + .start_block dd ? + .blocks dd ? + .address dd ? + .workarea dd ? + .fname rb 256+1 + app_colours: w_frame dd ? diff --git a/programs/desktop/trunk/macros.inc b/programs/desktop/trunk/macros.inc index 1d153e8723..29976779fc 100644 --- a/programs/desktop/trunk/macros.inc +++ b/programs/desktop/trunk/macros.inc @@ -197,17 +197,30 @@ macro mov arg1,arg2 } -macro struct name +; structure definition helper +macro struct name, [arg] { - virtual at 0 - name name - sizeof.#name = $ - name - end virtual + common + name@struct equ name + struc name arg { } -; structures used in MeOS -struc process_information +macro struct_helper name { + match xname,name + \{ + virtual at 0 + xname xname + sizeof.#xname = $ - xname + name equ sizeof.#xname + end virtual + \} + } + +ends fix } struct_helper name@struct + +; structures used in MeOS +struct process_information .cpu_usage dd ? ; +0 .window_stack_position dw ? ; +4 .window_stack_value dw ? ; +6 @@ -222,11 +235,9 @@ struc process_information .y_size dd ? ; +46 .slot_state dw ? ; +50 rb (1024-52) - } -struct process_information +ends -struc system_colors - { +struct system_colors .frame dd ? .grab dd ? .grab_button dd ? @@ -237,8 +248,7 @@ struc system_colors .work_button_text dd ? .work_text dd ? .work_graph dd ? - } -struct system_colors +ends ; constants diff --git a/programs/grscreen/trunk/grscreen.asm b/programs/grscreen/trunk/grscreen.asm index d673436e27..9ad1cd1a61 100644 --- a/programs/grscreen/trunk/grscreen.asm +++ b/programs/grscreen/trunk/grscreen.asm @@ -30,12 +30,6 @@ include "macros.inc" db "MenuetOS RE #8",13,10 START: - ; load system colors - mcall 58, read_info - - ; set system colors - mcall 48, 2, sc, sizeof.system_colors - ; set stretch backgound mcall 15, 4, 2 @@ -96,14 +90,6 @@ START: ;------------------------------------------------------------------------------ -read_info: - .mode dd 0 - .start_block dd 0 - .blocks dd 1 - .address dd sc - .workarea dd work_area - .path db "/rd/1/myblue.dtp",0 - start_info: .mode dd 16 dd 0 @@ -122,9 +108,6 @@ boot db 'BOOT',0 I_END: ;rd 256 -sc system_colors - rb 512-40 - align 32 work_area: diff --git a/programs/icon/trunk/gif_lite.inc b/programs/icon/trunk/gif_lite.inc new file mode 100644 index 0000000000..4086245a33 --- /dev/null +++ b/programs/icon/trunk/gif_lite.inc @@ -0,0 +1,328 @@ +; GIF LITE v2.0 by Willow +; Written in pure assembler by Ivushkin Andrey aka Willow +; +; This include file will contain functions to handle GIF image format +; +; Created: August 15, 2004 +; Last changed: September 9, 2004 + +; Change COLOR_ORDER in your program +; if colors are displayed improperly + +if ~ (COLOR_ORDER in ) +; This message may not appear under MenuetOS, so watch... + display 'Please define COLOR_ORDER: MENUETOS or OTHER',13,10 +end if + +; virtual structure, used internally + +struc GIF_list +{ + .NextImg rd 1 + .Left rw 1 + .Top rw 1 + .Width rw 1 + .Height rw 1 +} + +struc GIF_info +{ + .Left rw 1 + .Top rw 1 + .Width rw 1 + .Height rw 1 +} + +_null fix 0x1000 + +; **************************************** +; FUNCTION GetGIFinfo - retrieve Nth image info +; **************************************** +; in: +; esi - pointer to image list header +; ecx - image_index (0...img_count-1) +; edi - pointer to GIF_info structure to be filled + +; out: +; eax - pointer to RAW data, or 0, if error + +GetGIFinfo: + push esi ecx edi + xor eax,eax + jecxz .eloop + .lp: + mov esi,[esi] + test esi,esi + jz .error + loop .lp + .eloop: + add esi,4 + movsd + movsd + mov eax,esi + .error: + pop edi ecx esi + ret + +; **************************************** +; FUNCTION ReadGIF - unpacks GIF image +; **************************************** +; in: +; esi - pointer to GIF file in memory +; edi - pointer to output image list +; eax - pointer to work area (MIN 16 KB!) + +; out: +; eax - 0, all OK; +; eax - 1, invalid signature; +; eax >=8, unsupported image attributes +; +; ecx - number of images + +ReadGIF: + push esi edi + mov [.table_ptr],eax + mov [.cur_info],edi + xor eax,eax + mov [.globalColor],eax + mov [.img_count],eax + inc eax + cmp dword[esi],'GIF8' + jne .er ; signature + mov ecx,[esi+0xa] + inc eax + add esi,0xd + mov edi,esi + bt ecx,7 + jnc .nextblock + mov [.globalColor],esi + call .Gif_skipmap + .nextblock: + cmp byte[edi],0x21 + jne .noextblock + inc edi + cmp byte[edi],0xf9 ; Graphic Control Ext + jne .no_gc + add edi,7 + jmp .nextblock + .no_gc: + cmp byte[edi],0xfe ; Comment Ext + jne .no_comm + inc edi + .block_skip: + movzx eax,byte[edi] + lea edi,[edi+eax+1] + cmp byte[edi],0 + jnz .block_skip + inc edi + jmp .nextblock + .no_comm: + cmp byte[edi],0xff ; Application Ext + jne .nextblock + add edi,13 + jmp .block_skip + .noextblock: + cmp byte[edi],0x2c ; image beginning + jne .er + inc [.img_count] + inc edi + mov esi,[.cur_info] + add esi,4 + xchg esi,edi + movsd + movsd + push edi + movzx ecx,word[esi] + inc esi + bt ecx,7 + jc .uselocal + push [.globalColor] + mov edi,esi + jmp .setPal + .uselocal: + call .Gif_skipmap + push esi + .setPal: + movzx ecx,byte[edi] + inc ecx + mov [.codesize],ecx + dec ecx + pop [.Palette] + lea esi,[edi+1] + mov edi,[.table_ptr] + xor eax,eax + cld + lodsb ; eax - block_count + add eax,esi + mov [.block_ofs],eax + mov [.bit_count],8 + mov eax,1 + shl eax,cl + mov [.CC],eax + inc eax + mov [.EOI],eax + lea ecx,[eax-1] + mov eax, _null shl 16 + .filltable: + stosd + inc eax + loop .filltable + pop edi + mov [.img_start],edi + .reinit: + mov edx,[.EOI] + inc edx + push [.codesize] + pop [.compsize] + call .Gif_get_sym + cmp eax,[.CC] + je .reinit + call .Gif_output + .cycle: + movzx ebx,ax + call .Gif_get_sym + cmp eax,edx + jae .notintable + cmp eax,[.CC] + je .reinit + cmp eax,[.EOI] + je .end + call .Gif_output + .add: + push eax + mov eax,[.table_ptr] + mov [eax+edx*4],ebx + pop eax + cmp edx,0xFFF + jae .cycle + inc edx + bsr ebx,edx + cmp ebx,[.compsize] + jne .noinc + inc [.compsize] + .noinc: + jmp .cycle + .notintable: + push eax + mov eax,ebx + call .Gif_output + push ebx + movzx eax,bx + call .Gif_output + pop ebx eax + jmp .add + .er: + pop edi + jmp .ex + .end: + mov eax,[.cur_info] + mov [eax],edi + mov [.cur_info],edi + add esi,2 + xchg esi,edi + .nxt: + cmp byte[edi],0 + jnz .continue + inc edi + jmp .nxt + .continue: + cmp byte[edi],0x3b + jne .nextblock + xor eax,eax + stosd + mov ecx,[.img_count] + .ex: + pop edi esi + ret + +.Gif_skipmap: +; in: ecx - image descriptor, esi - pointer to colormap +; out: edi - pointer to area after colormap + + and ecx,111b + inc ecx ; color map size + mov ebx,1 + shl ebx,cl + lea ebx,[ebx*2+ebx] + lea edi,[esi+ebx] + ret + +.Gif_get_sym: + mov ecx,[.compsize] + push ecx + xor eax,eax + .shift: + ror byte[esi],1 + rcr eax,1 + dec [.bit_count] + jnz .loop1 + inc esi + cmp esi,[.block_ofs] + jb .noblock + push eax + xor eax,eax + lodsb + test eax,eax + jnz .nextbl + mov eax,[.EOI] + sub esi,2 + add esp,8 + jmp .exx + .nextbl: + add eax,esi + mov [.block_ofs],eax + pop eax + .noblock: + mov [.bit_count],8 + .loop1: + loop .shift + pop ecx + rol eax,cl + .exx: + xor ecx,ecx + ret + +.Gif_output: + push esi eax edx + mov edx,[.table_ptr] + .next: + push word[edx+eax*4] + mov ax,word[edx+eax*4+2] + inc ecx + cmp ax,_null + jnz .next + shl ebx,16 + mov bx,[esp] + .loop2: + pop ax + + lea esi,[eax+eax*2] + add esi,[.Palette] + + if COLOR_ORDER eq MENUETOS + mov esi,[esi] + bswap esi + shr esi,8 + mov [edi],esi + add edi,3 + else + movsw + movsb + end if + + loop .loop2 + pop edx eax esi + ret + + .globalColor rd 1 + .img_count rd 1 + .cur_info rd 1 ; image table pointer + .img_start rd 1 + .codesize rd 1 + .compsize rd 1 + .bit_count rd 1 + .CC rd 1 + .EOI rd 1 + .Palette rd 1 + .block_ofs rd 1 + .table_ptr rd 1 diff --git a/programs/icon/trunk/icon.asm b/programs/icon/trunk/icon.asm index 02c8fe6966..3213891d97 100644 --- a/programs/icon/trunk/icon.asm +++ b/programs/icon/trunk/icon.asm @@ -1,534 +1,1427 @@ -; -; ICON APPLICATION -; -; Compile with FASM for Menuet -; -; 22.02.05 Mario79 -; 1) multi-threading -; 2)dinamic load BMP files -; 3)type on desktop with function 7 -; 4)Image in memory only 8000h (32Kb) for all 48 icons. -; Old version ICON 5000h*48(decimal)=960Kb. -; - -use32 - - org 0x0 - - db 'MENUET01' - dd 0x01 - dd START - dd I_END - dd 0x8000 - dd 0x8000 - dd I_Param , 0x0 - -include 'lang.inc' -include 'macros.inc' - -get_bg_info: - mov eax,39 - mov ebx,4 - int 0x40 - mov [bgrdrawtype],eax - - mov eax,39 ; get background size - mov ebx,1 - int 0x40 - mov [bgrxy],eax - - mov ebx,eax - shr eax,16 - and ebx,0xffff - mov [bgrx],eax - mov [bgry],ebx - ret - -START: -load_icon_list: - mov eax,6 - mov ebx,icon_lst - xor ecx,ecx - mov edx,-1 - mov esi,icon_data - int 0x40 - - add eax,10 - xor edx,edx - mov ebx,52 - div ebx - mov [icons],eax - - call get_bg_info - - mov eax,14 - int 0x40 - add eax,0x00010001 - mov [scrxy],eax - -apply_changes: - - mov edi,[icons] - mov esi,icon_data - mov ebp,0x5000 ; threads stack starting point - - start_new: - movzx eax,byte [esi] ; x position - sub eax,'A' ;eax - number of letter - cmp eax,4 - jg no_left - shl eax,6 ;imul eax,64 - add eax,24 - jmp x_done - no_left: - sub eax,9 - shl eax,6 ;imul eax,64 - sub eax,24+32-1 - movzx ebx,word [scrxy+2] - add eax,ebx - x_done: -; mov [xpos],eax - mov [ebp-12],eax - - movzx eax,byte [esi+1] ; y position - sub eax,'A' ; eax - number of letter - cmp eax,4 - jg no_up - lea eax,[eax+4*eax] - shl eax,4 ;imul eax,80 - add eax,34 - jmp y_done - no_up: - sub eax,9 - lea eax,[eax+4*eax] - shl eax,4 ;imul eax,80 - movzx ebx,word [scrxy] - sub eax,32-1 - add eax,ebx - y_done: -; mov [ypos],eax - mov [ebp-8],eax - - mov eax,51 - mov ebx,1 - mov ecx,thread -; mov edx,[thread_stack] - mov edx,ebp -; sub edx,4 -; mov [edx],esi - mov [ebp-4],esi - int 0x40 -; add [thread_stack],0x100 - add ebp,0x100 - - mov eax,5 - mov ebx,1 -wait_thread_start: ;wait until thread draw itself first time - cmp [create_thread_event],bl - jz wait_thread_end - int 0x40 - jmp wait_thread_start -wait_thread_end: - dec [create_thread_event] ;reset event - - - add esi,50+2 - dec edi - jnz start_new - or eax,-1 - int 0x40 - -thread: -; pop ebp ;ebp - address of our icon - sub esp,12 - mov ebp,esp - call draw_window - mov [create_thread_event],1 - mov eax,40 - mov ebx,010101b - int 0x40 - jmp still -red: - call draw_window - -still: - - mov eax,10 - int 0x40 - - cmp eax,1 - je red - cmp eax,3 - je button - cmp eax,5 - jne still - - call get_bg_info - mov eax,5 - mov ebx,1 - call draw_icon - - jmp still - - key: - mov eax,2 - int 0x40 - - jmp still - - button: - mov eax,17 - int 0x40 - -; mcall 55,eax, , ,klick_music - - mov ebx,[ebp+8] - add ebx,19 -; lea ebx,[ebp+19] - mov eax,19 - xor ecx,ecx - int 0x40 - mcall 55,eax, , ,klick_music - jmp still - -klick_music db 0x85,0x60,0x85,0x70,0x85,0x65,0 - -draw_picture: - mov [image],0x3000 - xor ebx,ebx - xor ecx,ecx - mov esi,data_from_file+54+32*3*33-96 - mov [pixpos],0 - mov [pixpos2],32 - newb: - push ebx - push ecx - - cmp ebx,10 - jb yesbpix - cmp ebx,42 - jge yesbpix - cmp ecx,32 - jg yesbpix - - push esi - mov esi,data_from_file+54+32*3*33-96 - sub esi,[pixpos] - - dec [pixpos2] - cmp [pixpos2],0 - jne no_correction_pixpos - add [pixpos],192 - mov [pixpos2],32 -no_correction_pixpos: - sub [pixpos],3 - mov eax,[esi] - and eax,0xffffff - - pop esi - - cmp eax,0 - je yesbpix - cmp eax,0xf5f5f5 - je yesbpix - jmp nobpix - - yesbpix: - - stretch: - cmp [bgrdrawtype],dword 2 - jne nostretch -; mov eax,[ypos] - mov eax,[ebp+4] - add eax,ecx - imul eax,[bgry] - cdq - movzx ebx,word [scrxy] - div ebx - imul eax,[bgrx] - push eax -; mov eax,[xpos] - mov eax,[ebp+0] - add eax,[esp+8] - imul eax,[bgrx] - cdq - movzx ebx,word [scrxy+2] - div ebx - add eax,[esp] - add esp,4 - - jmp notiled - - nostretch: - - cmp [bgrdrawtype],dword 1 - jne notiled -; mov eax,[ypos] - mov eax,[ebp+4] - add eax,ecx - cdq - movzx ebx,word [bgrxy] - div ebx - mov eax,edx - imul eax,[bgrx] - push eax -; mov eax,[xpos] - mov eax,[ebp+0] - add eax,[esp+8] - movzx ebx,word [bgrxy+2] - cdq - div ebx - mov eax,edx - add eax,[esp] - add esp,4 - - notiled: - - lea ecx,[eax+eax*2] - mov eax,39 - mov ebx,2 - int 0x40 - - nobpix: - - pop ecx - pop ebx - - mov edx,eax - mov eax,[image] - mov [eax],dl - inc eax - ror edx,8 - mov [eax],dl - inc eax - ror edx,8 - mov [eax],dl - inc eax - mov [image],eax - - inc ebx - mov eax,[yw] - inc eax - cmp ebx,eax - jnz newb - xor ebx,ebx - - inc ecx - - mov eax,[ya] - add [pixpos],eax - - cmp [top],1 - jne notop - cmp ecx,38 - je toponly - - notop: - - cmp ecx,52 - jnz newb - - toponly: - - mov eax,7 - mov ebx,0x3000 - mov ecx,52 shl 16 + 52 - xor edx,edx - int 0x40 - mov [load_pic],0 - ret - -draw_text: - - mov esi,[ebp+8] - add esi,33 -; lea esi,[ebp+33] - push edi - mov edi,labelt - mov ecx,8 - cld - rep movsb - pop edi - mov eax,labelt - news: - cmp [eax],byte 33 - jb founde - inc eax - cmp eax,labelt+11 - jb news - founde: - sub eax,labelt - mov [tl],eax - - mov eax,[tl] - lea eax,[eax+eax*2] ; eax *= char_width/2 - shl eax,16 - - mov ebx,27*65536+42 - sub ebx,eax - - mov eax,4 - xor ecx,ecx ; black shade of text - mov edx,labelt - mov esi,[tl] - add ebx,1 shl 16 ;*65536+1 - int 0x40 - inc ebx - int 0x40 - add ebx,1 shl 16 - int 0x40 - inc ebx - int 0x40 - sub ebx,1 shl 16 - int 0x40 - dec ebx - sub ebx,1 shl 16 - int 0x40 - sub ebx,1 shl 16 - dec ebx - int 0x40 - dec ebx - add ebx,1 shl 16 - int 0x40 - inc ebx - mov ecx,0xffffff - - int 0x40 - mov [draw_pic],0 - ret - -load_icon_file: - mov ebx,[ebp+8] - add ebx,5 -; lea ebx,[ebp+5] - - mov eax,6 - xor ecx,ecx - mov edx,-1 - mov esi,data_from_file - int 0x40 - - ret - - ; for y = 32 to 0 - ; for x = 0 to 32 - ; if (pix[y][x]==0) then - ; pix[y][x]=background(x,y); - -; ********************************************* -; ******* WINDOW DEFINITIONS AND DRAW ******** -; ********************************************* - - -draw_window: - - mov eax,12 ; function 12:tell os about windowdraw - mov ebx,1 ; 1, start of draw - int 0x40 - - ; DRAW WINDOW - xor eax,eax ; function 0 : define and draw window -; mov ebx,[xpos-2] - mov ebx,[ebp+0-2] -; mov ecx,[ypos-2] - mov ecx,[ebp+4-2] - add ebx,[yw] ; [x start] *65536 + [x size] - add ecx,51 ; [y start] *65536 + [y size] - mov edx,0x01000000 ; color of work area RRGGBB,8->color gl - int 0x40 - - mov eax,8 ; button - mov ebx,51 - mov ecx,50 - mov edx,1+20000000 ; or 0x40000000 - int 0x40 - - mov eax,5 - mov ebx,1 -draw_icon: - xchg [load_pic],bl - test bl,bl - je draw_icon_end - int 0x40 - jmp draw_icon -draw_icon_end: - - call load_icon_file - - mov eax,5 - mov ebx,1 -draw_icon_2: - xchg [draw_pic],bl - test bl,bl - je draw_icon_end_2 - int 0x40 - jmp draw_icon_2 -draw_icon_end_2: - - mov eax,9 - mov ebx,process_table - mov ecx,-1 - int 0x40 -; mov eax,process_table -; add eax,34 -; mov ebx,[eax] -; mov [xpos],ebx -; add eax,4 -; mov ebx,[eax] -; mov [ypos],ebx - - call draw_picture - call draw_text - - mov eax,12 - mov ebx,2 - int 0x40 - - ret - - - -icon_lst db 'ICON LST' - -tl dd 8 -yw dd 51 -ya dd 0 - -;xpos dd 15 -;ypos dd 185 -draw_pic db 0 -load_pic db 0 -create_thread_event db 0 - -labelt: - db 'SETUP ' -labellen: - -bgrxy dd 0x0 -scrxy dd 0x0 -bgrdrawtype dd 0x0 - -pixpos dd 0 -pixpos2 db 0 - -top dd 0 - -image dd 0x3000 -;thread_stack dd 0x5000 - -icons dd 0 - - -I_Param: - - icon_data = I_END+0x1400 - process_table = I_END+0x2400 - -I_END: - -bgrx dd ? -bgry dd ? -data_from_file: - rb 54 ;header - raw_data: - rb 32*32 +;******************************** +;* * +;* DESKTOP ICON MANAGER * +;* * +;* Compile with flat assembler * +;* * +;******************************** +; 22.02.05 was modified for work with new multi-thread ICON. +;****************************************************************************** +RAW_SIZE equ 350000 +ICON_SIZE equ 32*32*3 +GIF_SIZE equ 45000 +REC_SIZE equ 80 +ICON_LST equ '/RD/1/ICON2.LST' +;ICON_APP equ '/hd/1/me/icon2'; +ICON_APP equ '/RD/1/ICON2' +;ICON_STRIP equ '/HD/1/ME/ICONSTRP.GIF' +ICON_STRIP equ '/RD/1/ICONSTRP.GIF' + + use32 + org 0x0 + db 'MENUET01' ; 8 byte id + dd 0x01 ; header version + dd START ; start of code + dd I_END ; size of image + dd icon_data+0x30000 ; memory for app + dd icon_data+0x30000 ; esp + dd I_Param , 0x0 ; I_Param , I_Icon +include 'macros.inc' +COLOR_ORDER equ MENUETOS +include 'gif_lite.inc' +;include 'debug.inc' +purge newline +;****************************************************************************** +START: ; start of execution + mcall 58,finfo + cmp ebx,GIF_SIZE + ja close + mov esi,gif_file + mov edi,strip_file + mov eax,icon_data + call ReadGIF + movzx eax,word[strip_file+10] + shr eax,5 + mov [icon_count],eax + call load_ic + boot_str: + cmp [I_Param],dword 'BOOT' + je load_icon_list2 + call load_icon_list + red: + call draw_window ; at first, draw the window + mov esi,[current_icon] + jmp band +still: + + mov eax,10 ; wait here for event + int 0x40 + + cmp eax,1 ; redraw request ? + je red + cmp eax,2 ; key in buffer ? + je key + cmp eax,3 ; button in buffer ? + je button + + jmp still + + key: ; key + mov eax,2 ; just read it and ignore + int 0x40 + jmp still + + button: ; button + mov eax,17 ; get id + int 0x40 + + shr eax,8 + + cmp eax,1 ; button id=1 ? + je close + noclose: + mov esi,[current_icon] + add esi,12 + mov ebx,[cur_band];eax + cmp eax,31 + jne .no_back + add ebx,8 + mov eax,[icon_count] + cmp eax,ebx + jae .drwic2 + xor ebx,ebx + jmp .drwic2 + .no_back: + cmp eax,30 + jne .no_side + test ebx,ebx + jnz .dec + mov ebx,[icon_count] + and ebx,0xfffffff8 + add ebx,8 + .dec: + sub ebx,8 + .drwic2: + mov [cur_band],ebx + .drwic1: + call draw_icon + jmp still + .no_side: + cmp eax,32 + jne .no_ico + push ebx + mcall 37,1 + pop ebx + shr eax,16 + sub eax,33-19 + mov edi,34 + xor edx,edx + div edi + lea ecx,[ebx+eax] + cmp ecx,[icon_count] + jae still + mov [sel_icon1],eax + mov ecx,eax + add eax,ebx + call itoa + jmp .drwic1 + .no_ico: + cmp eax,11 + jb no_str + cmp eax,13 + jg no_str + call read_string + jmp still + no_str: + + + cmp eax,21 ; apply changes + jne no_apply + + ; (1) save list + + mov ebx,finfo + mov dword[ebx],1 + mov edx,REC_SIZE + imul edx,dword [icons] + mov [ebx+8],edx + mov esi,iconlst + call lst_path + mcall 58 + + ; (2) terminate all icons + mov eax,9 + mov ebx,I_END + mov ecx,-1 + int 0x40 + mov edi,[ebx+30] + newread2: + mov esi,1 + newread: + inc esi + mov eax,9 + mov ebx,I_END + mov ecx,esi + int 0x40 + cmp edi,[ebx+30] + je newread + cmp esi,eax + jg all_terminated + + cmp [I_END+10],dword 'ICON' + jne newread + mov eax,51 + cmp eax,[I_END+42] + jne newread + cmp eax,[I_END+46] + jne newread + + mov eax,18 + mov ebx,2 + mov ecx,esi + int 0x40 + + jmp newread2 + +finfo: + dd 0 + dd 0 + dd GIF_SIZE/512 + dd gif_file + dd icon_data + .path: + db ICON_STRIP,0 + rb 31-($-.path) + + all_terminated: + + apply_changes: + + mov ebx,finfo + mov dword[ebx],16 + mov dword[ebx+8],boot_str+6 + mov esi,iconname + call lst_path + mcall 58 + jmp still + + no_apply: + + cmp eax,22 ; user pressed the 'add icon' button + jne no_add_icon + + mov eax,13 + mov ebx,24*65536+270 + mov ecx,(250+8*14)*65536+8 + mov edx,0xffffff + int 0x40 + mov eax,4 + mov ebx,24*65536+250+8*14 + mov ecx,0xff0000 + mov edx,add_text + mov esi,add_text_len-add_text + int 0x40 + + mov eax,10 + int 0x40 + cmp eax,3 + jne still + mov eax,17 + int 0x40 + shr eax,8 + cmp eax,40 + jb no_f + mov edi,eax + sub eax,40 + + xor edx,edx ; bcd -> 10 + mov ebx,16 + div ebx + imul eax,10 + add eax,edx + + mov ebx,eax + add ebx,icons_reserved + cmp [ebx],byte 'x' + je no_f + mov [ebx],byte 'x' + + mov [cur_btn],edi + xor edx,edx + mov ebx,10 + div ebx + add eax,65 + add edx,65 + mov [icon_default+0],dl + mov [icon_default+1],al + + inc dword [icons] + mov edi,[icons] + dec edi + imul edi,REC_SIZE + add edi,icon_data + + mov [current_icon],edi + + mov esi,icon_default + mov ecx,REC_SIZE + cld + rep movsb + mov esi,[current_icon] + jmp band + no_f: + + call draw_btns;draw_window + + jmp still + + no_add_icon: + + + cmp eax,23 ; user pressed the remove icon button + jne no_remove_icon + + mov eax,13 + mov ebx,24*65536+270 + mov ecx,(250+8*14)*65536+8 + mov edx,0xffffff + int 0x40 + mov eax,4 + mov ebx,24*65536+250+8*14 + mov ecx,0xff0000 + mov edx,rem_text + mov esi,rem_text_len-rem_text + int 0x40 + + mov eax,10 + int 0x40 + cmp eax,3 + jne no_f;ound + mov eax,17 + int 0x40 + shr eax,8 + cmp eax,40 + jb red;no_f;ound + sub eax,40 + + xor edx,edx + mov ebx,16 + div ebx + imul eax,10 + add eax,edx + + mov ebx,eax + add ebx,icons_reserved + cmp [ebx],byte 'x' + jne red + mov [ebx],byte ' ' + + xor edx,edx + mov ebx,10 + div ebx + shl eax,8 + mov al,dl + + add eax,65*256+65 + + mov esi,icon_data + mov edi,REC_SIZE + imul edi,[icons] + add edi,icon_data + news: + cmp word [esi],ax + je foundi + add esi,REC_SIZE + cmp esi,edi + jb news + jmp red + + foundi: + + mov ecx,edi + sub ecx,esi + + mov edi,esi + add esi,REC_SIZE + + cld + rep movsb + + dec [icons] + + mov eax,icon_data + mov [current_icon],eax + movzx ebx,word[eax] + sub bx,'AA' + shl bl,4 + shr ebx,4 + add ebx,40 + mov [cur_btn],ebx + + jmp red + + no_remove_icon: + + cmp eax,40 ; user pressed button for icon position + jb no_on_screen_button + mov edi,eax + sub eax,40 + mov edx,eax + shl eax,4 + and edx,0xf + mov dh,ah + add edx,65*256+65 + + mov esi,icon_data + mov ecx,[icons] + cld + findl1: + cmp dx,[esi] + je foundl1 + add esi,REC_SIZE + loop findl1 + jmp still + + foundl1: + + mov [current_icon],esi + mov [cur_btn],edi + band: + add esi,12 + call atoi + and eax,0xfffff8 + mov [cur_band],eax + call draw_btns + + jmp still + + no_on_screen_button: + + + jmp still + + +current_icon dd icon_data + + +print_strings: + + pusha + + mov eax,13 ; clear text area + mov ebx,100*65536+180 + mov ecx,(278+12)*65536+40 + mov edx,0xffffff + int 0x40 + + xor edi,edi + mov eax,4 ; icon text + mov ebx,100*65536+278+14 + mov ecx,3 + .ll: + push ecx + mov ecx,0x000000 + mov edx,[current_icon] + add edx,[positions+edi*4] + movzx esi,byte[str_lens+edi] + inc edi + int 0x40 + add ebx,14 + pop ecx + loop .ll + + popa + ret + +iconlst db ICON_LST,0 + +load_icon_list: + + mov edi,icons_reserved ; clear reserved area + mov eax,32 + mov ecx,10*9 + cld + rep stosb + + mov ecx,[icons] ; set used icons to reserved area + mov esi,icon_data + ldl1: + movzx ebx,byte [esi+1] + sub ebx,65 + imul ebx,10 + movzx eax,byte [esi] + add ebx,eax + sub ebx,65 + add ebx,icons_reserved + mov [ebx],byte 'x' + add esi,REC_SIZE + loop ldl1 + ret + +lst_path: + mov ecx,30 + mov edi,finfo.path + rep movsb + ret + +load_ic: + mov ebx,finfo + mov dword[ebx+8],(48*REC_SIZE)shr 9+1 + mov dword[ebx+12],icon_data + mov dword[ebx+16],gif_file + mov esi,iconlst + call lst_path + mcall 58 + lea eax,[ebx+10] + xor edx,edx + mov ebx,REC_SIZE + div ebx + mov [icons],eax + ret + + +positions dd 3,16,47 +str_lens db 8,30,30 + +read_string: + pusha + sub eax,11 + movzx ecx,byte[str_lens+eax] + mov [cur_str],ecx + mov eax,[positions+eax*4] + + mov edi,[current_icon] + add edi,eax + mov [addr],edi + + add edi,ecx + + .l1: + dec edi + cmp byte[edi],' ' + jne .found + mov byte[edi],'_' + loop .l1 + dec edi + .found: + inc edi + push edi + call print_strings + + pop edi + f11: + mov eax,10 + int 0x40 + cmp eax,2 + jz fbu + jmp rs_done + fbu: + mov eax,2 + int 0x40 + shr eax,8 + cmp eax,13 + je rs_done + cmp eax,8 + jnz nobsl + cmp edi,[addr] + jz f11 + dec edi + mov [edi],byte '_' + call print_strings + jmp f11 + nobsl: + cmp eax,31 + jbe f11 + mov [edi],al + call print_strings + + inc edi + mov esi,[addr] + add esi,[cur_str] + cmp esi,edi + jnz f11 + + rs_done: + + mov ecx,[addr] + add ecx,[cur_str] + sub ecx,edi + mov eax,32 + cld + rep stosb + call print_strings + popa + ret + +; ********************************************* +; ******* WINDOW DEFINITIONS AND DRAW ******** +; ********************************************* + + +draw_window: + + mov eax,12 ; function 12:tell os about windowdraw + mov ebx,1 ; 1, start of draw + int 0x40 + + ; DRAW WINDOW + mov eax,0 + mov ebx,210*65536+300 + mov ecx,30*65536+390-14 + mov edx,0x03ffffff + mov esi,0x808899ff + mov edi,0x008899ff + int 0x40 + + ; WINDOW LABEL + mov eax,4 + mov ebx,8*65536+8 + mov ecx,0x10ffffff + mov edx,labelt + mov esi,labellen-labelt + int 0x40 + + mov eax,13 ; WINDOW AREA + mov ebx,20*65536+260 + mov ecx,35*65536+200 + mov edx,0x3366cc + int 0x40 + + mov eax,38 ; VERTICAL LINE ON WINDOW AREA + mov ebx,150*65536+150 + mov ecx,35*65536+235 + mov edx,0xffffff + int 0x40 + + mov eax,38 ; HOROZONTAL LINE ON WINDOW AREA + mov ebx,20*65536+280 + mov ecx,135*65536+135 + mov edx,0xffffff + int 0x40 + + mov eax,8 ; TEXT ENTER BUTTONS + mov ebx,20*65536+72 + mov ecx,(275+1+14)*65536+13-2 + mov edx,11 + mov esi,[bcolor] + int 0x40 + inc edx + add ecx,14*65536 + int 0x40 + inc edx + add ecx,14*65536 + int 0x40 + +; mov eax,8 ; APPLY AND SAVE CHANGES BUTTON + mov ebx,20*65536+259 + mov ecx,(329+2)*65536+15-4 + mov edx,21 + mov esi,[bcolor] + int 0x40 + +; mov eax,8 ; ADD ICON BUTTON + mov ebx,20*65536+129-2 + add ecx,14*65536 + inc edx + int 0x40 + +; mov eax,8 ; REMOVE ICON BUTTON + add ebx,(130+2)*65536 + inc edx + int 0x40 + + mcall ,<20-14,8>,<260-23,32>,30+1 shl 30 ; IMAGE BUTTON + inc edx + add ebx,(36*7+26) shl 16 + mcall + add edx,1+1 shl 29 + mov ebx,(33-19) shl 16+(34*8) + mcall + mcall 4,<23-15,273-24>,0,arrows,1 + add ebx,(36*7+27)shl 16 + add edx,2 + mcall + dec edx + mcall ,<120,250> + lea edx,[ebx+8 shl 16] + mov ecx,[icon_count] + mcall 47,0x30000,,,0 + +;; + mov ebx,24*65536+250+14+14+14 + mov ecx,0xffffff + mov edx,text + mov esi,47 + newline: + mov ecx,[edx] + add edx,4 + mov eax,4 + int 0x40 + add ebx,14 + add edx,47 + cmp [edx],byte 'x' + jne newline +draw_btns: +;; + mov eax,0 ; DRAW BUTTONS ON WINDOW AREA + mov ebx,20*65536+25 + mov ecx,35*65536+19 + mov edi,icon_table + mov edx,40 + newbline: + + cmp [edi],byte 'x' + jne no_button + + mov esi,0x5577cc + cmp [edi+90],byte 'x' + jne nores + mov esi,0xcc5555 + cmp edx,[cur_btn] + jne nores + mov esi,0xe7e05a + nores: + + push eax + mov eax,8 + int 0x40 + pop eax + + no_button: + + add ebx,26*65536 + + inc edi + inc edx + + inc al + cmp al,9 + jbe newbline + mov al,0 + + add edx,6 + + ror ebx,16 + mov bx,20 + ror ebx,16 + add ecx,20*65536 + + inc ah + cmp ah,8;9 + jbe newbline + call print_strings + call draw_icon + mov eax,12 ; function 12:tell os about windowdraw + mov ebx,2 ; 2, end of draw + int 0x40 + + ret + +draw_icon: + mcall 13,<33-20,34*8+2>,<260-24,37+15-2>,0xffffff + mov esi,[current_icon] + add esi,12 + call atoi + push eax + cmp eax,[cur_band] + jb .nou + sub eax,[cur_band] + cmp eax,7 + ja .nou + imul eax,34 shl 16 + lea ebx,[eax+(33-19) shl 16] + mov bx,34 + mcall 13,,<236+35,3>,0xff0000 + mov eax,[esp] + .nou: + mov eax,[cur_band] + and eax,0xfffffff8 + push eax + imul eax,ICON_SIZE + lea ebx,[strip_file+12+eax] + mov ecx,8 + mov edx,(33-18) shl 16+238 + .nxt: + push ecx + mcall 7,,<32,32> + pop ecx + add ebx,ICON_SIZE + add edx,34 shl 16 + loop .nxt + + mcall 4,<45,280-2>,0,rep_text,rep_text_len-rep_text + lea edx,[ebx+(8*5)shl 16] + pop ecx + mcall 47,0x30000,,,0xff + add ecx,7 + add edx,(3*8+4)shl 16 + mcall + mov ecx,[icon_count] + add edx,(5*8+4)shl 16 + mcall + pop ecx + add edx,(10*8+4)shl 16 + mcall ,,,,0xff0000 + ret + +; DATA AREA + + +bcolor dd 0x335599 + +icon_table: + + times 4 db 'xxxx xxxx' + times 2 db ' ' + times 1 db ' ' + times 2 db 'xxxx xxxx' +; times 1 db ' ' + +icons_reserved: + times 9 db ' ' + +if lang eq ru + text: + db 255,255,255,0, ' ’…Š‘’ ' + db 255,255,255,0, ' Žƒ€ŒŒ€ ' + db 255,255,255,0, ' €€Œ…’› ' + db 255,255,255,0, ' ˆŒ…ˆ’œ ' + db 255,255,255,0, ' „Ž€‚ˆ’œ “„€‹ˆ’œ ' + db 0,0,0,0, '€†Œˆ’… € Ž‡ˆ–ˆž ˆŠŽŠˆ „‹Ÿ …„€Š’ˆŽ‚€ˆŸ ' + db 'x' ; <- END MARKER, DONT DELETE + + labelt: + db ' แโเฎฉช  เ กฎ็ฅฃฎ แโฎซ ' + labellen: +else + text: + db 255,255,255,0, ' TITLE ' + db 255,255,255,0, ' APP NAME ' + db 255,255,255,0, ' PARAMETERS ' + db 255,255,255,0, ' APPLY CHANGES ' + db 255,255,255,0, ' ADD ICON REMOVE ICON ' + db 0,0,0,0, '€†Œˆ’… € Ž‡ˆ–ˆž ˆŠŽŠˆ „‹Ÿ …„€Š’ˆŽ‚€ˆŸ ' + db 'x' ; <- END MARKER, DONT DELETE + + labelt: + db 'Icon Manager' + labellen: +end if + +;ya dd 0 + +add_text db '€†Œˆ’… € Ž‡ˆ–ˆž …ˆ‘Ž‹œ‡“…ŒŽ‰ ˆŠŽŠˆ' +add_text_len: + +rem_text db '€†Œˆ’… € Ž‡ˆ–ˆž ˆ‘Ž‹œ‡“…ŒŽ‰ ˆŠŽŠˆ' +rem_text_len: +arrows db '' +iconname: + db ICON_APP,0 + +icon_default: + db 'AA-SYSXTREE-000-/RD/1/SYSXTREE ' + db '- *' + db 13,10 + +rep_text: +if lang eq ru + db '‡€—Šˆ - ˆ‡ , ‚›€ #' +else + db 'ICONS - OF , SELECTED' +end if + +rep_text_len: + +;////////////////////////// +get_bg_info: + mov eax,39 + mov ebx,4 + int 0x40 + mov [bgrdrawtype],eax + + mov eax,39 ; get background size + mov ebx,1 + int 0x40 + mov [bgrxy],eax + + mov ebx,eax + shr eax,16 + and ebx,0xffff + mov [bgrx],eax + mov [bgry],ebx + ret + +calc_icon_pos: + movzx eax,byte [ebp-20] ; x position + sub eax,'A' ;eax - number of letter + cmp eax,4 + jg no_left + shl eax,6 ;imul eax,64 + add eax,16 + movzx ebx,[warea.left] + add eax,ebx + jmp x_done + no_left: + sub eax,9 + sal eax,6 ;imul eax,64 + sub eax,16+52-1 + movzx ebx,[warea.right] + add eax,ebx + x_done: +; mov [xpos],eax + mov [ebp-12],eax + + movzx eax,byte [ebp-20+1] ; y position + sub eax,'A' ; eax - number of letter + cmp eax,4 + jg no_up + shl eax,6 ;imul eax,80 + add eax,16 + movzx ebx,[warea.top] + add eax,ebx + jmp y_done + no_up: + sub eax,9 + shl eax,6 ;imul eax,80 + sub eax,16-1 + movzx ebx,[warea.bottom] + add eax,ebx + y_done: +; mov [ypos],eax + mov [ebp-8],eax + ret + +;START2: +load_icon_list2: + mov eax,finfo + mov dword[eax],16 + mov dword[eax+8],param_str + call get_bg_info + + mcall 48,5 + mov [warea.by_x],eax + mov [warea.by_y],ebx + + mov eax,14 + int 0x40 + add eax,0x00010001 + mov [scrxy],eax + +apply_changes2: + + mov edi,[icons] + mov esi,icon_data + mov ebp,0x5000 ; threads stack starting point + + start_new: + mov eax,[esi] + mov [ebp-20],eax + call calc_icon_pos + + mov eax,51 + mov ebx,1 + mov ecx,thread +; mov edx,[thread_stack] + mov edx,ebp +; sub edx,4 +; mov [edx],esi + mov dword[ebp-4],esi + int 0x40 +; add [thread_stack],0x100 + add ebp,0x100 + + mov eax,5 + mov ebx,1 +wait_thread_start: ;wait until thread draw itself first time + cmp [create_thread_event],bl + jz wait_thread_end + int 0x40 + jmp wait_thread_start +wait_thread_end: + dec [create_thread_event] ;reset event + + + add esi,REC_SIZE + dec edi + jnz start_new + close: + or eax,-1 + int 0x40 + +thread: +; pop ebp ;ebp - address of our icon + sub esp,12 + mov ebp,esp + sub esp,16 + call draw_window2 + mov [create_thread_event],1 + mov eax,40 + mov ebx,010101b + int 0x40 + +still2: + + mov eax,10 + int 0x40 + + cmp eax,1 + je red2 + cmp eax,3 + je button2 + cmp eax,5 + jne still2 + + call get_bg_info + mov eax,5 + mov ebx,1 + call draw_icon2 + + jmp still2 + + red2: + mcall 14 + add eax,0x00010001 + mov [scrxy],eax + mcall 48,5 + mov [warea.by_x],eax + mov [warea.by_y],ebx + add ebp,+12 + call calc_icon_pos + add ebp,-12 + mcall 9,I_END,-1 + mov eax,[I_END+process_information.x_start] + cmp eax,[ebp+0] + jne @f + mov eax,[I_END+process_information.y_start] + cmp eax,[ebp+4] + je .lp1 + @@: call get_bg_info + mcall 67,[ebp+0],[ebp+4],51,51 + + .lp1: call draw_window2 + jmp still2 + + key2: + mov eax,2 + int 0x40 + + jmp still2 + + button2: + mov eax,17 + int 0x40 + +; mcall 55,eax, , ,klick_music + + mov esi,[ebp+8] + mov ebx,1 + mov edi,finfo.path + call fill_paths + inc ebx + mov edi,param_str + mov dword[finfo+8],param_str + call fill_paths + cmp byte[edi],0 + jne .no0 + and dword[finfo+8],0 + .no0: +; lea ebx,[ebp+19] + mov ebx,finfo + mov eax,58 + int 0x40 +; dph eax + cmp eax,1024 + jae still2 + mcall 55,eax, , ,klick_music + jmp still2 + +klick_music db 0x85,0x60,0x85,0x70,0x85,0x65,0 + +fill_paths: + push esi edi +; dps '>' + movzx ecx,byte[str_lens+ebx] + add esi,[positions+ebx*4] + push esi +; mov edx,esi + add esi,ecx + + .l1: + dec esi + cmp byte[esi],' ' + jnz .found + loop .l1 + pop esi + jmp .noms + .found: + lea ecx,[esi+1] + pop esi + sub ecx,esi + rep movsb + .noms: + and byte[edi],0 +; call debug_outstr +; dps <'<',13,10> + pop edi esi + ret + +atoi: + push esi + xor eax,eax + xor ebx,ebx + .nxt: + lodsb + cmp al,'0' + jb .done + cmp al,'9' + ja .done + sub eax,'0' + imul ebx,10 + add ebx,eax + jmp .nxt + .done: + pop esi + mov eax,ebx + ret + +itoa: +; mov esi,[current_icon] + add esi,2 + mov ebx,10 + mov ecx,3 + .l0: + xor edx,edx + div ebx + add dl,'0' + mov [esi],dl + dec esi + loop .l0 +; and byte[esi],0 + ret + +draw_picture: + mov [image],0x3000 + mov edi,[ebp+8] + lea esi,[edi+12] + call atoi + cmp eax,[icon_count] + ja toponly.ex + imul eax,(32*3*32) + lea edi,[eax+strip_file+12] + xor ebx,ebx + xor ecx,ecx + mov esi,edi;strip_file+12+(32*3*32)*2 + + mov [pixpos],0 + newb: + push ebx + push ecx + + cmp ebx,10 + jb yesbpix + cmp ebx,42 + jge yesbpix + cmp ecx,31;2 + jg yesbpix + + push esi + mov esi,edi + add esi,[pixpos] + +no_correction_pixpos: + add [pixpos],3 + mov eax,[esi] + and eax,0xffffff + + pop esi + + cmp eax,0 + je yesbpix + cmp eax,0xfffcff ;f5f5f5 + je yesbpix + jmp nobpix + + yesbpix: + + stretch: + cmp [bgrdrawtype],dword 2 + jne nostretch +; mov eax,[ypos] + mov eax,[ebp+4] + add eax,ecx + imul eax,[bgry] + cdq + movzx ebx,word [scrxy] + div ebx + imul eax,[bgrx] + push eax +; mov eax,[xpos] + mov eax,[ebp+0] + add eax,[esp+8] + imul eax,[bgrx] + cdq + movzx ebx,word [scrxy+2] + div ebx + add eax,[esp] + add esp,4 + + jmp notiled + + nostretch: + + cmp [bgrdrawtype],dword 1 + jne notiled +; mov eax,[ypos] + mov eax,[ebp+4] + add eax,ecx + cdq + movzx ebx,word [bgrxy] + div ebx + mov eax,edx + imul eax,[bgrx] + push eax +; mov eax,[xpos] + mov eax,[ebp+0] + add eax,[esp+8] + movzx ebx,word [bgrxy+2] + cdq + div ebx + mov eax,edx + add eax,[esp] + add esp,4 + + notiled: + + lea ecx,[eax+eax*2] + mov eax,39 + mov ebx,2 + int 0x40 + + nobpix: + + pop ecx + pop ebx + + mov edx,eax + mov eax,[image] + mov [eax],edx + mov [eax],dl + inc eax + ror edx,8 + mov [eax],dl + inc eax + ror edx,8 + mov [eax],dl + inc eax + mov [image],eax + inc ebx + mov eax,[yw] + inc eax + cmp ebx,eax + jnz newb + xor ebx,ebx + + inc ecx + + mov eax,[ya] + add [pixpos],eax + + cmp [top],1 + jne notop + cmp ecx,38 + je toponly + + notop: + + cmp ecx,52 + jnz newb + + toponly: + + mov eax,7 + mov ebx,0x3000 + mov ecx,52 shl 16 + 52 + xor edx,edx + int 0x40 + .ex: + mov [load_pic],0 + ret + +draw_text: + + mov esi,[ebp+8] + add esi,3 + push edi + mov edi,labelt + mov ecx,8 + cld + rep movsb + pop edi + mov eax,labelt + news2: + cmp [eax],byte 33 + jb founde + inc eax + cmp eax,labelt+8;11 + jb news2 + founde: + sub eax,labelt + mov [tl],eax + + mov eax,[tl] + lea eax,[eax+eax*2] ; eax *= char_width/2 + shl eax,16 + + mov ebx,27*65536+42 + sub ebx,eax + + mov eax,4 + xor ecx,ecx ; black shade of text + mov edx,labelt + mov esi,[tl] + add ebx,1 shl 16 ;*65536+1 + int 0x40 + inc ebx + int 0x40 + add ebx,1 shl 16 + int 0x40 + inc ebx + int 0x40 + sub ebx,1 shl 16 + int 0x40 + dec ebx + sub ebx,1 shl 16 + int 0x40 + sub ebx,1 shl 16 + dec ebx + int 0x40 + dec ebx + add ebx,1 shl 16 + int 0x40 + inc ebx + mov ecx,0xffffff + + int 0x40 + mov [draw_pic],0 + ret + +; ********************************************* +; ******* WINDOW DEFINITIONS AND DRAW ******** +; ********************************************* + + +draw_window2: + + mov eax,12 ; function 12:tell os about windowdraw + mov ebx,1 ; 1, start of draw + int 0x40 + + ; DRAW WINDOW + xor eax,eax ; function 0 : define and draw window +; mov ebx,[xpos-2] + mov ebx,[ebp+0-2] +; mov ecx,[ypos-2] + mov ecx,[ebp+4-2] + add ebx,[yw] ; [x start] *65536 + [x size] + add ecx,51 ; [y start] *65536 + [y size] + mov edx,0x01000000 ; color of work area RRGGBB,8->color gl + int 0x40 + + mov eax,8 ; button + mov ebx,51 + mov ecx,50 + mov edx,1+20000000 ; or 0x40000000 + int 0x40 + + mov eax,5 + mov ebx,1 +draw_icon2: + xchg [load_pic],bl + test bl,bl + je draw_icon_end + int 0x40 + jmp draw_icon2 +draw_icon_end: + + mov eax,5 + mov ebx,1 +draw_icon_2: + xchg [draw_pic],bl + test bl,bl + je draw_icon_end_2 + int 0x40 + jmp draw_icon_2 +draw_icon_end_2: + + mov eax,9 + mov ebx,process_table + mov ecx,-1 + int 0x40 + + call draw_picture + call draw_text + + mov eax,12 + mov ebx,2 + int 0x40 + + ret + +tl dd 8 +yw dd 51 +ya dd 0 +cur_btn dd 40 + +;xpos dd 15 +;ypos dd 185 +draw_pic db 0 +load_pic db 0 +create_thread_event db 0 + + +image dd 0x3000 +;thread_stack dd 0x5000 + +;icons dd 0 + + +I_Param: + + icon_data = I_END+0x1400 + process_table = I_END+0x2400 + +;I_END: + +bgrx dd ? +bgry dd ? +param_str rb 31 + +;////////////////////////// + +bgrxy dd ? +warea: + .by_x: + .right dw ? + .left dw ? + .by_y: + .bottom dw ? + .top dw ? +scrxy dd ? +bgrdrawtype dd ? + +pixpos dd ? +top dd ? +icons dd ? +addr dd ? +cur_str dd ? +cur_band dd ? +sel_icon1 rd 1 +icon_count rd 1 +gif_file rb GIF_SIZE +strip_file rb RAW_SIZE +;I_Param: + +; icon_data = I_END+256 + +I_END: diff --git a/programs/panel/trunk/@PANEL.ASM b/programs/panel/trunk/@PANEL.ASM index 64ca24363c..2cac055d86 100644 --- a/programs/panel/trunk/@PANEL.ASM +++ b/programs/panel/trunk/@PANEL.ASM @@ -7,28 +7,28 @@ use32 org 0x0 db 'MENUET01' ; 8 byte id - dd 0x01 ; required OS version - dd START ; program start - dd I_END ; program image size - dd 0xB000 ; reguired amount of memory - 64 Kb - dd 0xA000 ; esp - dd 0x0,0x0 ; param, icon + dd 0x01 ; required OS version + dd START ; program start + dd I_END ; program image size + dd 0xB000 ; reguired amount of memory - 64 Kb + dd 0xA000 ; esp + dd 0x0,0x0 ; param, icon include 'lang.inc' include 'macros.inc' -width dd 305 -buttons dd 1 ; 0 no frames ; 1 frames -soften_up dd 1 ; 0 no ; 1 yes -soften_down dd 0 ; 0 no ; 1 yes -minimize_left dd 1 -minimize_right dd 1 -icons_position dd 95 -menu_enable dd 1 -setup_enable dd 0 -graph_text dd 1 -soften_middle dd 1 ; 0 no ; 1 yes -icons dd 1 ; 0 defaults ; 1 activate +width dd 305 +buttons dd 1 ; 0 no frames ; 1 frames +soften_up dd 1 ; 0 no ; 1 yes +soften_down dd 0 ; 0 no ; 1 yes +minimize_left dd 1 +minimize_right dd 1 +icons_position dd 95 +menu_enable dd 1 +setup_enable dd 0 +graph_text dd 1 +soften_middle dd 1 ; 0 no ; 1 yes +icons dd 1 ; 0 defaults ; 1 activate dat db 'PANEL DAT' @@ -61,19 +61,19 @@ begin: mov ah,al and al,100000b cmp al,100000b - je change_start_end + je change_start_end mov al,ah and al,10000b cmp al,10000b - je change_start_end + je change_start_end mov al,ah and al,1000b cmp al,1000b - je change_key_lang_1 + je change_key_lang_1 mov al,ah and al,100b cmp al,100b - je change_key_lang_1 + je change_key_lang_1 mov al,ah and al,1111b cmp al,11b @@ -90,7 +90,7 @@ change_key_lang_1: mov al,ah and al,11b cmp al,01b - je change_key_lang + je change_key_lang cmp al,10b jne begin change_key_lang: @@ -124,6 +124,7 @@ start_end: start_menu: mcall 18,12 mov [button_presssed_alt],eax + mov [draw_window_1],1 ; mov ecx,eax ; mcall 47,0x40100, ,10 shl 16+5,0 ; mov eax,ecx @@ -159,11 +160,32 @@ start_menu: je start_menu_application cmp ah,83 ;62 je kill_active_application + cmp ah,71 ;179 + jne no_test_179 + cmp [page_list],15 + je @f + inc [page_list] + mov [draw_window_1],1 + @@: + jmp begin + + no_test_179: + cmp ah,72 ;180 + jne no_test_180 + cmp [page_list],0 + je @f + dec [page_list] + mov [draw_window_1],1 + @@: + jmp begin + + no_test_180: + jmp begin button_presssed_alt dd 0 -active_process dd 0 +active_process dd 0 my_process dd 0 calendar_music: @@ -188,21 +210,21 @@ menu_music: mcall 55,eax, , ,menumusic ret -chlangmusic: db 0x82,0x60,0x83,0x65,0x82,0x60,0 +chlangmusic: db 0x82,0x60,0x83,0x65,0x82,0x60,0 -syslangmusic: db 0x82,0x65,0x83,0x70,0x82,0x65,0 +syslangmusic: db 0x82,0x65,0x83,0x70,0x82,0x65,0 -menumusic: db 0x82,0x50,0x84,0x48,0x82,0x50,0x84,0x53,0x82,0x51,0 +menumusic: db 0x82,0x50,0x84,0x48,0x82,0x50,0x84,0x53,0x82,0x51,0 -activatemusic: db 0x83,0x30,0x85,0x60,0 +activatemusic: db 0x83,0x30,0x85,0x60,0 -buttonmusic: db 0x85,0x25,0x85,0x40,0 +buttonmusic: db 0x85,0x25,0x85,0x40,0 -sysmetermusic: db 0x85,0x35,0x85,0x45,0 +sysmetermusic: db 0x85,0x35,0x85,0x45,0 -setupmusic: db 0x85,0x40,0x85,0x50,0 +setupmusic: db 0x85,0x40,0x85,0x50,0 -calendarmusic: db 0x85,0x37,0x85,0x48,0 +calendarmusic: db 0x85,0x37,0x85,0x48,0 ; .exit: mcall -1 @@ -224,7 +246,7 @@ START: mov eax,0 new_number: cmp [esi],byte ';' - je number_ready + je number_ready imul eax,10 movzx ebx,byte [esi] sub ebx,'0' @@ -239,10 +261,13 @@ START: cmp [esi],byte 'x' jne new_number - mcall 48,5 - mov ecx,eax - lea edx,[ebx-PANEL_HEIGHT-1] - mcall 48,6 + mcall 14 + mov [screen_size],eax + + mcall 48,5 + mov ecx,eax + lea edx,[ebx-PANEL_HEIGHT-1] + mcall 48,6 call set_variables @@ -272,26 +297,42 @@ still: mov ebx, 20 int 0x40 - cmp eax,1 ; redraw ? - jz red - cmp eax,3 ; button ? - jz button + cmp eax,1 ; redraw ? + jz red + cmp eax,3 ; button ? + jz button jmp still - red: ; redraw window + red: ; redraw window + + mcall 14 + movzx ecx,ax + mov edx,eax + shr edx,16 + cmp [screen_size.height],ax + jne @f + rol eax,16 + cmp [screen_size.width],ax + je .lp1 + rol eax,16 + @@: mov [screen_size],eax + sub ecx,PANEL_HEIGHT + mcall 67,0,,,PANEL_HEIGHT + + .lp1: call draw_window call draw_info jmp still - button: ; button + button: ; button mov eax,17 int 0x40 cmp ah,50 - jb no_activate + jb no_activate cmp ah,70 - jg no_activate + jg no_activate movzx ecx,byte ah sub ecx,52 @@ -308,13 +349,13 @@ still: no_activate: - cmp ah,101 ; minimize to left - je left_button + cmp ah,101 ; minimize to left + je left_button - cmp ah,102 ; minimize to right - je right_button + cmp ah,102 ; minimize to right + je right_button - cmp ah,byte 1 ; start/terminate menu + cmp ah,byte 1 ; start/terminate menu jnz noselect call menu_handler ; cmp [music_type],0 @@ -323,7 +364,7 @@ still: jmp still noselect: - cmp ah,byte 2 ; start calendar + cmp ah,byte 2 ; start calendar jnz noid15 ;noclock mov eax, 19 mov ebx, file6 @@ -410,7 +451,7 @@ still: jmp red noid19: - cmp ah,20 ; start system setup + cmp ah,20 ; start system setup jnz noid20 mov eax, 19 mov ebx, file_sys @@ -419,6 +460,26 @@ still: call setup_music noid20: + cmp ah,21 + jnz noid21 + cmp [page_list],15 + je @f + inc [page_list] + jmp red + @@: + jmp still + + noid21: + cmp ah,22 + jnz noid22 + cmp [page_list],0 + je @f + dec [page_list] + jmp red + @@: + jmp still + + noid22: jmp still @@ -449,6 +510,16 @@ draw_running_applications: mov edi,0 mov ecx,2 mov [contrast],0 + mov eax,[max_applications] + mov ebx,[page_list] + xor edx,edx + mul ebx + cmp eax,0 + je @f + inc eax + @@: + mov [draw_start_position],eax + newpr: @@ -460,19 +531,26 @@ draw_running_applications: push ecx cmp eax,ecx - jb norpl2 + jb norpl2 cmp byte [0x8000+10], '@' - je norpl - cmp [0x8000+11],dword 'CON ' - je norpl + je norpl + cmp [0x8000+10],dword 'ICON' + jne .noicon + cmp dword[0x8000+42],51 + jne .noicon + cmp dword[0x8000+46],51 + je norpl + .noicon: cmp [0x8000+11],dword 'ENU ' - je norpl + je norpl ; cmp [0x8000+12],dword 'NEL ' ; je norpl cmp [0x8000+10],dword ' ' - je norpl - + je norpl + dec [draw_start_position] + cmp [draw_start_position],0 + jg norpl mov eax,13 mov ebx,edi inc ebx @@ -504,7 +582,7 @@ draw_running_applications: inc [contrast] and [contrast],1 cmp [contrast],1 - je contrast1 + je contrast1 mov edx,0x88ff jmp contrast2 contrast1: @@ -549,7 +627,7 @@ contrast2: inc ecx cmp edi,[max_applications] - jb newpr + jb newpr nompr: @@ -562,6 +640,16 @@ contrast2: calculate_applications: + mov eax,[max_applications] + mov ebx,[page_list] + xor edx,edx + mul ebx + cmp eax,0 + je @f + inc eax + @@: + mov [draw_start_position],eax + mov edi,app_list mov ecx,20 mov eax,0xff @@ -578,15 +666,25 @@ calculate_applications: int 0x40 cmp byte [0x8000+10], '@' - je cnorpl + je cnorpl + cmp [0x8000+10],dword 'ICON' + jne .noicon + cmp dword[0x8000+42],51 + jne .noicon + cmp dword[0x8000+46],51 + je cnorpl + .noicon: cmp [0x8000+11],dword 'CON ' - je cnorpl + je cnorpl cmp [0x8000+11],dword 'ENU ' - je cnorpl + je cnorpl ; cmp [0x8000+12],dword 'NEL ' ; je cnorpl cmp [0x8000+10],dword ' ' - je cnorpl + je cnorpl + dec [draw_start_position] + cmp [draw_start_position],0 + jg cnorpl mov [app_list+edi*4],ecx @@ -615,19 +713,19 @@ draw_application_buttons: cmp eax,639 jne now1 - mov [max_applications],7 ;6 + mov [max_applications],7 ;6 now1: cmp eax,799 jne now2 - mov [max_applications],10 ;8 + mov [max_applications],9 ;10 ;8 now2: cmp eax,1023 jne now3 - mov [max_applications],13 ;8 + mov [max_applications],12 ;13 ;8 now3: cmp eax,1279 jne now4 - mov [max_applications],18 ;8 + mov [max_applications],17 ;18 ;8 now4: mov edi,1 @@ -636,14 +734,14 @@ draw_application_buttons: mov eax,8 mov ebx,edi shl ebx,16 - imul ebx,6*10 ;13 + imul ebx,6*10 ;13 add ebx,15*65536+10*6-1 ;13 mov ecx,1*65536+17 mov edx,edi add edx,51 cmp [buttons],1 - je bufr - or edx,0x60000000 + je bufr + or edx,0x60000000 bufr: mov esi,[wcolor] sub ebx,11 shl 16 @@ -679,7 +777,7 @@ draw_small_right: mov edx,[wcolor] mov esi,edx mov edi,edx - or edx, 0x01000000 + or edx, 0x01000000 int 0x40 mov eax,8 @@ -724,11 +822,11 @@ draw_small_left: mov edx,[wcolor] mov esi,edx mov edi,edx - or edx, 0x01000000 + or edx, 0x01000000 int 0x40 cmp [graph_text],1 - je nos4 + je nos4 mov eax,8 mov ebx,0*65536+9 @@ -843,7 +941,7 @@ left_button: cmp ah,1 jne no_full - mov eax, 14 ; get screen max x & max y + mov eax, 14 ; get screen max x & max y int 0x40 mov edx, eax shr edx, 16 @@ -882,7 +980,7 @@ set_variables: no_frames: - mov eax,48 ; 3d button look + mov eax,48 ; 3d button look mov ebx,1 mov ecx,1 int 0x40 @@ -930,7 +1028,7 @@ draw_flag: sub ebx,2 mov ecx, 5 shl 16+11 cmp [type_lang],1 - je label_1 + je label_1 mov edx,0xff ;[wcolor] jmp label_2 label_1: @@ -941,7 +1039,7 @@ label_2: popad shl ebx,16 - add ebx,7 ;24 + add ebx,7 ;24 mov ecx,[bte] ; color @@ -988,7 +1086,7 @@ draw_window: mov [running_applications],-1 mov [checks],-1 - mov eax, 12 ; tell os about redraw + mov eax, 12 ; tell os about redraw mov ebx, 1 int 0x40 @@ -1001,11 +1099,11 @@ draw_window: mov eax, [system_colours+4*6] mov [wcolor], eax - mov eax,14 ; get screen max x & max y + mov eax,14 ; get screen max x & max y int 0x40 cmp [width],0 - je no_def_width + je no_def_width and eax,0xffff mov ebx,[width] shl ebx,16 @@ -1024,11 +1122,11 @@ draw_window: mov cx,PANEL_HEIGHT add ecx,20*65536 no_text_1: - mov eax, 0 ; DEFINE AND DRAW WINDOW + mov eax, 0 ; DEFINE AND DRAW WINDOW mov edx, [wcolor] - or edx, 0x01000000 ; do not draw the window + or edx, 0x01000000 ; do not draw the window mov esi, [wcolor] - or esi, 0x01000000 ; unmovable window + or esi, 0x01000000 ; unmovable window mov edi, [wcolor] int 0x40 @@ -1041,6 +1139,7 @@ draw_window: mov eax,38 cmp [soften_up],1 jne no_su + and edx,0x00FFFFFF int 0x40 no_su: @@ -1053,13 +1152,14 @@ draw_window: add edi,[b_size_y] add ecx,edi sub ecx,3*65536+3 + and edx,0x00FFFFFF int 0x40 no_sd: popa add ecx,1*65536+1 cmp cx,5 - jb newline + jb newline cmp [soften_middle],1 jne no_sm @@ -1073,16 +1173,17 @@ draw_window: add esi,4 mov eax,38 + and edx,0x00FFFFFF int 0x40 add ecx,1*65536+1 cmp cx,15 - jb newline3 + jb newline3 no_sm: cmp [minimize_left],1 jne no_mleft - mov eax,8 ; ABS LEFT + mov eax,8 ; ABS LEFT mov ebx,0 *65536+9 mov ecx,1 *65536 add ecx,[b_size_y] @@ -1091,7 +1192,7 @@ draw_window: add edx,[button_frames] mov esi,[wcolor] int 0x40 - mov eax,4 ; HIDE TEXT + mov eax,4 ; HIDE TEXT mov ebx,2*65536+17 cmp [graph_text],1 jne no_y1 @@ -1114,7 +1215,7 @@ draw_window: shl eax,16 mov ebx,eax add ebx,67 - mov eax,8 ; ABS RIGHT + mov eax,8 ; ABS RIGHT mov ecx,1 *65536 add ecx,[b_size_y] dec ecx @@ -1169,7 +1270,7 @@ draw_menuet_icon: jne no_menu - mov eax, 8 ; M BUTTON + mov eax, 8 ; M BUTTON mov ebx, 10*65536 + 47 cmp [minimize_left], 0 jne @f @@ -1200,7 +1301,7 @@ draw_menuet_icon: mov ecx,4 shl 16+11 int 0x40 mov ebx,58 shl 16+1 - mov ecx,6 shl 16+7 + mov ecx,6 shl 16+7 int 0x40 ; mov ebx,66 shl 16+1 ; mov ecx,9 shl 16+1 @@ -1238,7 +1339,7 @@ draw_menuet_icon: mov eax,[wcolor] mov [m_icon+4],eax - mov eax,6 ; load file + mov eax,6 ; load file mov ebx,m_bmp mov ecx,0 mov edx,200000 @@ -1257,13 +1358,13 @@ draw_menuet_icon: mov cl,[edi] cmp cl,10 - jb nopix + jb nopix mov cl,[edi+1] cmp cl,10 - jb nopix + jb nopix mov cl,[edi+2] cmp cl,10 - jb nopix + jb nopix pusha cmp [minimize_left],0 @@ -1325,7 +1426,7 @@ draw_program_icons: mov bx,39 pop edx add edx,[button_frames] - or edx, 0x20000000 + or edx, 0x20000000 mov eax,8 int 0x40 popa @@ -1334,7 +1435,7 @@ draw_program_icons: add ecx,48 mov [iconf+6],cl - mov eax,6 ; load file + mov eax,6 ; load file mov ebx,iconf mov ecx,0 mov edx,200000 @@ -1345,22 +1446,22 @@ draw_program_icons: mov ebx,32 mov edi,image+51+32*33*3 - np2: ; new pixel of file + np2: ; new pixel of file mov edx,[edi] and edx,0xffffff - cmp eax,3 ; Y draw limits - jb nopix2 + cmp eax,3 ; Y draw limits + jb nopix2 cmp eax,36 - jg nopix2 - cmp ebx,38 ; X draw limits - jg nopix2 + jg nopix2 + cmp ebx,38 ; X draw limits + jg nopix2 cmp ebx,2 - jb nopix2 + jb nopix2 cmp edx,0 - jz nopix2 + jz nopix2 cmp [graph_text],1 jne no_icon_text @@ -1458,7 +1559,7 @@ draw_info: ; draw cpu usage, time, date mov eax,3 int 0x40 cmp eax,[ptime] - jz _ret + jz _ret mov [ptime],eax call draw_cpu_usage @@ -1487,7 +1588,7 @@ draw_info: ; draw cpu usage, time, date int 0x40 - mov eax,26 ; check for change in time or country + mov eax,26 ; check for change in time or country mov ebx,5 int 0x40 mov edx,eax @@ -1501,7 +1602,7 @@ draw_info: ; draw cpu usage, time, date and eax,0xffff add edx,eax cmp edx,[checks] - je _ret + je _ret mov [checks],edx mov ebx,[maxx] @@ -1509,7 +1610,7 @@ draw_info: ; draw cpu usage, time, date shl ebx,16 add ebx,33 ;;84 ;;64 - mov eax,8 ; time/date button + mov eax,8 ; time/date button mov ecx,3 *65536 add ecx,[b_size_y] ; dec ecx @@ -1538,19 +1639,28 @@ draw_info: ; draw cpu usage, time, date mov esi,[wcolor] int 0x40 sub ebx,17 shl 16 - inc edx ;button 17 + inc edx ;button 17 int 0x40 add ebx,33 shl 16 mov bx,8 - inc edx ;button 18 + inc edx ;button 18 int 0x40 sub ebx,47 shl 16 mov bx,10 - inc edx ;button 19 + inc edx ;button 19 int 0x40 sub ebx,14 shl 16 - inc edx ;button 20 + inc edx ;button 20 int 0x40 + sub ebx,12 shl 16 + mov bx,8 + mov ecx,6 shl 16+10 + inc edx ;button 21 + int 0x40 + sub ebx,18 shl 16 + inc edx ;button 22 + int 0x40 + ; flags mov eax,26 @@ -1607,7 +1717,7 @@ draw_info: ; draw cpu usage, time, date ; cmp [music_type],0 ; jne dalshe cmp [sound_flag],0 - je dalshe + je dalshe sub ebx,8 shl 16 ror ebx,16 @@ -1655,6 +1765,45 @@ dalshe: add ebx,1 shl 16 int 0x40 + mov edx,0 + mov eax,13 + mov ebx,[maxx] + sub ebx,134 + shl ebx,16 + mov bx,9 + mov ecx,6 shl 16+11 + int 0x40 + sub ebx,18 shl 16 + int 0x40 + add ebx,19 shl 16 + sub bx,2 + mov ecx,7 shl 16+9 + mov edx,0xffffff + int 0x40 + sub ebx,18 shl 16 + int 0x40 + + mov eax,4 + mov edx,page_a1 + mov ebx,[maxx] + sub ebx,150 + shl ebx,16 + mov bx,8 + mov esi,4 + int 0x40 + add ebx,1 shl 16 + int 0x40 + + mov eax,47 + mov ebx,0x10100 + mov ecx,[page_list] + mov edx,[maxx] + sub edx,141 + shl edx,16 + mov dx,7 + mov esi,0xffffff + int 0x40 + ; sub ebx,14 shl 16 ; mov bx,7 ; mov edx,turn_text @@ -1699,7 +1848,7 @@ dalshe: ; mov edx,[wcolor] ; int 0x40 - mov eax,3 ; get time + mov eax,3 ; get time int 0x40 movzx ebx,al @@ -1728,7 +1877,7 @@ dalshe: no_y3: - mov edx,[esp] ; __:_X + mov edx,[esp] ; __:_X and edx,15 mov eax,4 add ebx,10*65536 @@ -1736,7 +1885,7 @@ dalshe: mov esi,1 int 0x40 - pop edx ; __:X_ + pop edx ; __:X_ shr edx,4 and edx,15 mov eax,4 @@ -1745,7 +1894,7 @@ dalshe: mov esi,1 int 0x40 - mov edx,[esp] ; _X:__ + mov edx,[esp] ; _X:__ and edx,15 mov eax,4 sub ebx,11*65536 @@ -1753,7 +1902,7 @@ dalshe: mov esi,1 int 0x40 - pop edx ; X_:__ + pop edx ; X_:__ shr edx,4 and edx,15 mov eax,4 @@ -1857,30 +2006,27 @@ draw_cpu_usage: ret - - - ; DATA stripe: - dd -0x010101 - dd -0x010101 - dd -0x020202 - dd -0x010101 - dd -0x000000 + dd -0x010101 + dd -0x010101 + dd -0x020202 + dd -0x010101 + dd -0x000000 - dd 0x000000 - dd 0x010101 - dd 0x020202 - dd 0x010101 - dd 0x010101 + dd 0x000000 + dd 0x010101 + dd 0x020202 + dd 0x010101 + dd 0x010101 m_icon: - dd 0x0 - dd 0x808080 - dd 0x000000 - dd 0x000000 - dd 0xffffff + dd 0x0 + dd 0x808080 + dd 0x000000 + dd 0x000000 + dd 0xffffff lsz m_text,\ @@ -1896,10 +2042,10 @@ type_lang db 0 sound_flag db 0 button_frames dd 0x0 -checks dd -1 +checks dd -1 hidetext db 0x11,0x10,0x1e -iconf db 'MBAR_IX BMP' -m_bmp db 'MENUET BMP' +iconf db 'MBAR_IX BMP' +m_bmp db 'MENUET BMP' sysmeter db 'SYSMETER ' file_end db 'END ' @@ -1912,8 +2058,8 @@ turn_text db '><' ;file4 db 'TINYPAD ' ;file4_par db 'COPYING.TXT',0 ;file5 db 'MFASM ' -file6 db 'CALENDAR ' -gpl db 'GPL' +file6 db 'CALENDAR ' +gpl db 'GPL' chlang db 'LANG',0 syslang db 'SLAN',0 @@ -1923,25 +2069,35 @@ contrast db 0 running_applications dd 0x100 max_applications dd 11 +page_list dd 0 +draw_start_position dd 0 +draw_window_1 db 0 + b_size_y: dd 0x0 ysi dd 0 small_draw dd 0x0 -ptime dd 0x0 -maxx dd 0x0 -text db '0123456789' -bte dd 0xccddee +ptime dd 0x0 +maxx dd 0x0 +text db '0123456789' +page_a1 db '< >' +bte dd 0xccddee -wcolor dd 0x506070 +wcolor dd 0x506070 -sec db ': ' -pros db ' ' - db ' ' +sec db ': ' +pros db ' ' + db ' ' -screenxy dd 0x0 -stcount dd 0x0 +screenxy dd 0x0 +stcount dd 0x0 I_END: + +screen_size: + .height dw ? + .width dw ? + area9 rb 100 system_colours rd 10 app_list rd 50 diff --git a/programs/panel/trunk/setup.asm b/programs/panel/trunk/setup.asm deleted file mode 100644 index 00de49ed5c..0000000000 --- a/programs/panel/trunk/setup.asm +++ /dev/null @@ -1,1648 +0,0 @@ -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; ;; -;; DEVICE SETUP ;; -;; ;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -; Authors: Ville - original version -; A. Ivushkin - autostart (w launcher) -; M. Lisovin - added many feauters (apply all, save all, set time...) -; I. Poddubny - fixed russian keymap - -;****************************************************************************** - use32 - org 0x0 - db 'MENUET01' ; 8 byte identifier - dd 0x01 ; header version - dd START ; pointer to program start - dd I_END ; size of image - dd 0x4000 ; reguired amount of memory - dd 0x4000 ; stack pointer (esp) - dd I_PARAM,0 ; parameters, reserved - include 'MACROS.INC' -;****************************************************************************** - -LLL equ (56+3) -BBB equ 25 - -;****************************************************************************** -apply_all: - - mov eax,6 ; load saved settings from SETUP.DAT - mov ebx,filename - xor ecx,ecx - or edx,-1 - mov esi,keyboard - int 0x40 - - call _midibase ;1 - call _sound_dma ;10 - call _pci_acc ;12 - call _sb16 ;4 - call _wssp ;6 - call _syslang ;5 - call _keyboard ;2 - - call get_disk_info - cmp [cd],0 - jne no_cd - call _cdbase ;3 - no_cd: - cmp [hd],0 - jne no_hd - call _lba_read ;11 - call _hdbase ;7 - call _f32p ;8 - no_hd: -ret -;------------------------------------------------------------------------------- -get_disk_info: - mov [hd],1 - mov [cd],1 - mov [hdbase],0 - mov [cdbase],0 - mcall 18,11,1,table_area - - ide_0: - mov al,[table_area+1] - shr al,6 - cmp al,0 - je ide_1 - cmp al,01b - jnz ide_0_cd - mov [hdbase],1 - mov [hd],0 - jmp ide_1 - - ide_0_cd: - cmp al,10b - jnz ide_1 - mov [cdbase],1 - mov [cd],0 - cmp [hd],0 - je all_device - - ide_1: - mov al,[table_area+1] - shl al,2 - shr al,6 - cmp al,0 - je ide_2 - cmp al,01b - jnz ide_1_cd - cmp [hd],0 - je ide_11 - mov [hdbase],2 - mov [hd],0 - ide_11: - cmp [cd],0 - je all_device - jmp ide_2 - - ide_1_cd: - cmp al,10b - jnz ide_2 - cmp [cd],0 - je ide_11_cd - mov [cdbase],2 - mov [cd],0 - ide_11_cd: - cmp [hd],0 - je all_device - - ide_2: - mov al,[table_area+1] - shl al,4 - shr al,6 - cmp al,0 - je ide_3 - cmp al,01b - jnz ide_2_cd - cmp [hd],0 - je ide_21 - mov [hdbase],3 - mov [hd],0 - ide_21: - cmp [cd],0 - je all_device - jmp ide_3 - - ide_2_cd: - cmp al,10b - jnz ide_3 - cmp [cd],0 - je ide_21_cd - mov [cdbase],3 - mov [cd],0 - ide_21_cd: - cmp [hd],0 - je all_device - - ide_3: - mov al,[table_area+1] - shl al,6 - shr al,6 - cmp al,0 - je not_device - cmp al,01b - jnz ide_3_cd - cmp [hd],0 - je ide_31 - mov [hdbase],4 - mov [hd],0 - ide_31: - cmp [cd],0 - jmp all_device - - ide_3_cd: - cmp al,10b - jnz not_device - cmp [cd],0 - je all_device - mov [cdbase],4 - mov [cd],0 - - all_device: - not_device: - ret - -hd db 0 -cd db 0 -;****************************************************************************** -apply_all_and_exit: - call apply_all - jmp close - -;****************************************************************************** -set_language_and_exit: - mov eax,26 - mov ebx,2 - mov ecx,9 - int 0x40 -; cmp eax,5 -; jne @f -; xor eax,eax -;@@: mov [keyboard],eax - cmp eax,1 - je russian - xor eax,eax -set_lang_now: - mov [keyboard],eax - call _keyboard - jmp close -russian: - mov eax,3 - jmp set_lang_now - -set_syslanguage_and_exit: - mov eax,26 - mov ebx,5 -; mov ecx,9 - int 0x40 - cmp eax,4 - jne temp ;@f - xor eax,eax -;@@: inc eax -temp: inc eax - mov [syslang],eax - call _syslang - jmp close - -get_setup_values: - mcall 26,1 - mov [midibase],eax - mcall 26,2,9 - dec eax - mov [keyboard],eax - mcall 26,3 - mov [cdbase],eax - mcall 26,4 - mov [sb16],eax - mcall 26,5 - mov [syslang],eax - mcall 26,6 - cmp eax,0x530 - jne s_wss_2 - mov eax,1 - jmp get_other -s_wss_2: - cmp eax,0x608 - jne s_wss_3 - mov eax,2 - jmp get_other -s_wss_3: - cmp eax,0xe80 - jne s_wss_4 - mov eax,3 - jmp get_other -s_wss_4: - mov eax,4 -get_other: - mov [wss],eax - mcall 26,7 - mov [hdbase],eax - mcall 26,8 - mov [f32p],eax - mcall 26,10 - mov [sound_dma],eax - mcall 26,11 - mov [lba_read],eax - mcall 26,12 - mov [pci_acc],eax - ret - -;****************************************************************************** - -START: - cmp [I_PARAM], 'SLAN' - je set_syslanguage_and_exit - - cmp [I_PARAM], 'LANG' - je set_language_and_exit - -; mov eax,6 ; load saved settings from SETUP.DAT -; mov ebx,filename -; xor ecx,ecx -; or edx,-1 -; mov esi,keyboard -; int 0x40 - - cmp [I_PARAM], 'BOOT' - je apply_all_and_exit - - call loadtxt - call get_setup_values -red: - call draw_window - -still: - - cmp word [blinkpar],0 - jne blinker - mov eax,29 ;get system date - int 0x40 - cmp eax,[date] - je gettime - mov [date],eax - gettime: - mov eax,3 ;get system time - int 0x40 - cmp ax,[time] - je sysevent - mov [time],ax - call drawtime - - sysevent: - mov eax,23 - mov ebx,8 ; wait here for event with timeout - int 0x40 - - cmp eax,1 - jz red - cmp eax,2 - jz key - cmp eax,3 - jz button - - jmp still - - blinker: - cmp byte [count],6 - jb noblink - btc dword [blinkpar],16 - mov byte [count],0 - call drawtime - noblink: - inc byte [count] - jmp sysevent - -incdectime: - cmp byte [blinkpar],0 - je still - mov esi,time - mov bl,0x23 ;border - cmp byte [blinkpar],1 - je hours - mov bl,0x59 ;minutes - inc esi - hours: - mov al,byte [esi] - cmp ah,112 - je dectime - cmp al,bl - je noinctime - inc al - daa - jmp incdectime1 - noinctime: - xor al,al - incdectime1: - mov byte [esi],al - jmp still - dectime: - cmp al,0 - je nodectime - dec al - das - jmp incdectime1 - nodectime: - mov al,bl - jmp incdectime1 - -incdecdate: - cmp byte [blinkpar+1],0 - je still - mov esi,date - mov bl,0 ;border of years - cmp byte [blinkpar+1],1 - jne days - mov bl,0x12 ;months - inc esi - days: - cmp byte [blinkpar+1],2 - jne nodays - mov bl,0x31 - add esi,2 - nodays: - mov al,byte [esi] - cmp ah,122 - je decdate - cmp al,bl - je noincdate - inc al ;add al,1 - daa - jmp incdecdate1 - noincdate: - mov al,1 - incdecdate1: - mov byte [esi],al - jmp still - decdate: - cmp al,1 - je nodecdate - dec al - das - jmp incdecdate1 - nodecdate: - mov al,bl - jmp incdecdate1 - - - key: - ;mov eax,2 - int 0x40 - cmp ah,27 - jne still - mov dword [blinkpar],0 - call drawtime - jmp still - - button: - - mov eax,17 - int 0x40 - - cmp ah,112 - je incdectime - cmp ah,113 - je incdectime - cmp ah,122 - je incdecdate - cmp ah,123 - je incdecdate - cmp ah,111 - jne noseltime - mov al, [blinkpar] - cmp al,2 - jae seltime - inc al - jmp seltime1 - seltime: - xor al,al - seltime1: - mov [blinkpar],al - call drawtime - jmp still -noseltime: - cmp ah,121 - jne noseldate - mov al,byte [blinkpar+1] - cmp al,3 - jae seldate - inc al - jmp seldate1 - seldate: - xor al,al - seldate1: - mov [blinkpar+1],al - call drawtime - jmp still -noseldate: - cmp ah,99 - jne nosaveall - mov eax,33 - mov ebx,filename - mov ecx,keyboard - mov edx,48 - xor esi,esi - int 0x40 - call settime - mov dword [blinkpar],0 - call drawtime - jmp still -nosaveall: - cmp ah,100 - jne no_apply_all - call apply_all - jmp still -no_apply_all: - - cmp ah,1 ; CLOSE APPLICATION - jne no_close -close: - or eax,-1 - int 0x40 - no_close: - - cmp ah,11 ; SET MIDI BASE - jnz nosetbase1 - call _midibase - nosetbase1: - cmp ah,12 - jnz nomm - sub [midibase],2 - call draw_infotext - nomm: - cmp ah,13 - jnz nomp - add [midibase],2 - call draw_infotext - nomp: - - - cmp ah,4 ; SET KEYBOARD - jnz nokm - mov eax,[keyboard] - test eax,eax - je downuplbl - dec eax - jmp nodownup - downuplbl: - mov eax,4 - nodownup: - mov [keyboard],eax - call draw_infotext - nokm: - cmp ah,5 - jnz nokp - mov eax,[keyboard] - cmp eax,4 - je updownlbl - inc eax - jmp noupdown - updownlbl: - xor eax,eax - noupdown: - mov [keyboard],eax - call draw_infotext - nokp: - - - cmp ah,22 ; SET CD BASE - jnz nocm - mov eax,[cdbase] - sub eax,2 - and eax,3 - inc eax - mov [cdbase],eax - call draw_infotext - nocm: - cmp ah,23 - jnz nocp - mov eax,[cdbase] - and eax,3 - inc eax - mov [cdbase],eax - call draw_infotext - nocp: - cmp ah,21 - jnz nocs - call _cdbase - nocs: - - cmp ah,62 ; SET HD BASE - jnz hnocm - mov eax,[hdbase] - sub eax,2 - and eax,3 - inc eax - mov [hdbase],eax - call draw_infotext - hnocm: - cmp ah,63 - jnz hnocp - mov eax,[hdbase] - and eax,3 - inc eax - mov [hdbase],eax - call draw_infotext - hnocp: - cmp ah,61 - jnz hnocs - call _hdbase - hnocs: - - cmp ah,82 ; SET SOUND DMA - jne no_sdma_d - mov eax,[sound_dma] - dec eax - sdmal: - and eax,3 - mov [sound_dma],eax - call draw_infotext - jmp still - no_sdma_d: - cmp ah,83 - jne no_sdma_i - mov eax,[sound_dma] - inc eax - jmp sdmal - no_sdma_i: - cmp ah,81 - jne no_set_sound_dma - call _sound_dma - jmp still - no_set_sound_dma: - - cmp ah,92 ; SET LBA READ - jne no_lba_d - slbal: - btc [lba_read],0 - call draw_infotext - jmp still - no_lba_d: - cmp ah,93 - jne no_lba_i - jmp slbal - no_lba_i: - cmp ah,91 - jne no_set_lba_read - call _lba_read - jmp still - no_set_lba_read: - - - cmp ah,102 ; SET PCI ACCESS - jne no_pci_d - pcip: - btc [pci_acc],0 - call draw_infotext - jmp still - no_pci_d: - cmp ah,103 - jne no_pci_i - jmp pcip - no_pci_i: - cmp ah,101 - jne no_set_pci_acc - call _pci_acc - jmp still - no_set_pci_acc: - - - set_partition: - cmp ah,72 ; SET FAT32 PARTITION - jnz .nominus - mov eax,[f32p] - sub eax,2 -; and eax,15 ; 3 - four partitions, 7 - eight p., 15 - sixteen, etc. - cmp eax,15 - jb @f - mov eax,14 -@@: - inc eax - mov [f32p],eax - call draw_infotext - .nominus: - cmp ah,73 - jnz .noplus - mov eax,[f32p] -; and eax,15 ; 3 - four partitions, 7 - eight p., 15 - sixteen, etc. - cmp eax,15 - jb @f - mov eax,0 -@@: - inc eax - mov [f32p],eax - call draw_infotext - .noplus: - cmp ah,71 - jnz .noapply - call _f32p - .noapply: - - cmp ah,32 ; SET SOUND BLASTER 16 BASE - jnz nosbm - sub [sb16],2 - call draw_infotext - nosbm: - cmp ah,33 - jnz nosbp - add [sb16],2 - call draw_infotext - nosbp: - cmp ah,31 - jnz nosbs - call _sb16 - nosbs: - - cmp ah,52 ; SET WINDOWS SOUND SYSTEM BASE - jnz nowssm - mov eax,[wss] - sub eax,2 - and eax,3 - inc eax - mov [wss],eax - call draw_infotext - nowssm: - cmp ah,53 - jnz nowssp - mov eax,[wss] - and eax,3 - inc eax - mov [wss],eax - call draw_infotext - nowssp: - cmp ah,51 - jnz nowsss - call _wssp - nowsss: - - cmp ah,42 ; SET SYSTEM LANGUAGE BASE - jnz nosysm - mov eax,[syslang] - dec eax - jz still - mov [syslang],eax - call draw_infotext - nosysm: - cmp ah,43 - jnz nosysp - mov eax,[syslang] - cmp eax,4 - je nosysp - inc eax - mov [syslang],eax - call draw_infotext - nosysp: - cmp ah,41 - jnz nosyss - call _syslang - call cleantxt - call loadtxt - call draw_window - call drawtime - nosyss: - - cmp ah,3 ; SET KEYMAP - jne still - call _keyboard - jmp still - - _keyboard: - cmp [keyboard],0 - jnz nosetkeyle - mov eax,21 ; english - mov ebx,2 - mov ecx,1 - mov edx,en_keymap - int 0x40 - mov eax,21 - inc ecx - mov edx,en_keymap_shift - int 0x40 - mov eax,21 - mov ecx,9 - mov edx,1 - int 0x40 - call alt_gen - nosetkeyle: - cmp [keyboard],1 - jnz nosetkeylfi - mov eax,21 ; finnish - mov ebx,2 - mov ecx,1 - mov edx,fi_keymap - int 0x40 - mov eax,21 - inc ecx - mov edx,fi_keymap_shift - int 0x40 - mov eax,21 - mov ecx,9 - mov edx,2 - int 0x40 - call alt_gen - nosetkeylfi: - cmp [keyboard],2 - jnz nosetkeylge - mov eax,21 ; german - mov ebx,2 - mov ecx,1 - mov edx,ge_keymap - int 0x40 - mov eax,21 - inc ecx - mov edx,ge_keymap_shift - int 0x40 - mov eax,21 - mov ecx,9 - mov edx,3 - int 0x40 - call alt_gen - nosetkeylge: - cmp [keyboard],3 - jnz nosetkeylru - mov eax,21 ; russian - mov ebx,2 - mov ecx,1 - mov edx,ru_keymap - int 0x40 - mov eax,21 - inc ecx - mov edx,ru_keymap_shift - int 0x40 - call alt_gen - mov eax,21 - mov ecx,9 - mov edx,4 - int 0x40 - nosetkeylru: - cmp [keyboard],4 ;french - jnz nosetkeylfr - mov eax,21 - mov ebx,2 - mov ecx,1 - mov edx,fr_keymap - int 0x40 - mov eax,21 - inc ecx - mov edx,fr_keymap_shift - int 0x40 - mov eax,21 - inc ecx - mov edx,fr_keymap_alt_gr - int 0x40 - mov eax,21 - mov ecx,9 - mov edx,5 - int 0x40 - nosetkeylfr: - ret - - alt_gen: - mov eax,21 - mov ecx,3 - mov edx,alt_general - int 0x40 - ret - - - -draw_buttons: - - pusha - - shl ecx,16 - add ecx,12 - mov ebx,(350-50)*65536+46+BBB - - mov eax,8 - int 0x40 - - mov ebx,(350-79)*65536+9 - inc edx - int 0x40 - - mov ebx,(350-67)*65536+9 - inc edx - int 0x40 - - popa - ret - - - -; ******************************************** -; ******* WINDOW DEFINITIONS AND DRAW ******* -; ******************************************** - - -draw_window: - - pusha - - mov eax,12 - mov ebx,1 - int 0x40 - - xor eax,eax ; DRAW WINDOW - mov ebx,40*65536+355+BBB - mov ecx,40*65536+300 - mov edx,0x82111199 - mov esi,0x805588dd - mov edi,0x005588dd - int 0x40 - - mov eax,4 - mov ebx,8*65536+8 - mov ecx,0x10ffffff - mov edx,labelt - cmp [syslang],4 - je ruslabel - add edx,20 - ruslabel: - mov esi,26 - int 0x40 - - mov eax,8 ; CLOSE BUTTON - mov ebx,(355+BBB-19)*65536+12 - mov ecx,5*65536+12 - mov edx,1 - mov esi,0x005588dd - int 0x40 - ; APPLY ALL - mov ebx,(350-79)*65536+100 - mov ecx,251*65536+12 - mov edx,100 - int 0x40 - add ecx,16*65536 ; SAVE ALL - dec edx - int 0x40 - - mov esi,0x5580c0 - - mov edx,11 - mov ecx,43 - call draw_buttons - - mov edx,41 - mov ecx,43+8*8 - call draw_buttons - - mov edx,21 - mov ecx,43+4*8 - call draw_buttons - - mov edx,31 - mov ecx,43+2*8 - call draw_buttons - - mov edx,3 - mov ecx,43+10*8 - call draw_buttons - - mov edx,51 - mov ecx,43+12*8 - call draw_buttons - - mov edx,61 - mov ecx,43+6*8 - call draw_buttons - - mov edx,91 - mov ecx,43+18*8 - call draw_buttons - - mov edx,71 - mov ecx,43+14*8 - call draw_buttons - - mov edx,81 - mov ecx,43+16*8 - call draw_buttons - - mov edx,101 - mov ecx,43+20*8 - call draw_buttons - - mov edx,111 - mov ecx,43+22*8 ; 22 - call draw_buttons - - mov edx,121 - mov ecx,43+24*8 ; 24 - call draw_buttons - - call draw_infotext - - mov eax,12 - mov ebx,2 - int 0x40 - - popa - ret - - - -draw_infotext: - - pusha - - mov eax,[keyboard] ; KEYBOARD - test eax,eax - jnz noen - mov [text00+LLL*10+28],dword 'ENGL' - mov [text00+LLL*10+32],dword 'ISH ' - noen: - cmp eax,1 - jnz nofi - mov [text00+LLL*10+28],dword 'FINN' - mov [text00+LLL*10+32],dword 'ISH ' - nofi: - cmp eax,2 - jnz noge - mov [text00+LLL*10+28],dword 'GERM' - mov [text00+LLL*10+32],dword 'AN ' - noge: - cmp eax,3 - jnz nogr - mov [text00+LLL*10+28],dword 'RUSS' - mov [text00+LLL*10+32],dword 'IAN ' - nogr: - cmp eax,4 - jnz nofr - mov [text00+LLL*10+28],dword 'FREN' - mov [text00+LLL*10+32],dword 'CH ' - nofr: - - - mov eax,[syslang] ; SYSTEM LANGUAGE - dec eax - test eax,eax - jnz noen5 - mov [text00+LLL*8+28],dword 'ENGL' - mov [text00+LLL*8+32],dword 'ISH ' - noen5: - cmp eax,1 - jnz nofi5 - mov [text00+LLL*8+28],dword 'FINN' - mov [text00+LLL*8+32],dword 'ISH ' - nofi5: - cmp eax,2 - jnz noge5 - mov [text00+LLL*8+28],dword 'GERM' - mov [text00+LLL*8+32],dword 'AN ' - noge5: - cmp eax,3 - jnz nogr5 - mov [text00+LLL*8+28],dword 'RUSS' - mov [text00+LLL*8+32],dword 'IAN ' - nogr5: - cmp eax,4 - jne nofr5 - mov [text00+LLL*8+28],dword 'FREN' - mov [text00+LLL*8+32],dword 'CH ' - nofr5: - - - mov eax,[midibase] - mov esi,text00+LLL*0+32 - call hexconvert ; MIDI BASE - - - mov eax,[sb16] ; SB16 BASE - mov esi,text00+LLL*2+32 - call hexconvert - - - mov eax,[wss] ; WSS BASE - cmp eax,1 - jnz nowss1 - mov [wssp],dword 0x530 - nowss1: - cmp eax,2 - jnz nowss2 - mov [wssp],dword 0x608 - nowss2: - cmp eax,3 - jnz nowss3 - mov [wssp],dword 0xe80 - nowss3: - cmp eax,4 - jnz nowss4 - mov [wssp],dword 0xf40 - nowss4: - - mov eax,[wssp] - mov esi,text00+LLL*12+32 - call hexconvert - - mov eax,[cdbase] ; CD BASE - cmp eax,1 - jnz noe1 - mov [text00+LLL*4+28],dword 'PRI.' - mov [text00+LLL*4+32],dword 'MAST' - mov [text00+LLL*4+36],dword 'ER ' - noe1: - cmp eax,2 - jnz nof1 - mov [text00+LLL*4+28],dword 'PRI.' - mov [text00+LLL*4+32],dword 'SLAV' - mov [text00+LLL*4+36],dword 'E ' - nof1: - cmp eax,3 - jnz nog1 - mov [text00+LLL*4+28],dword 'SEC.' - mov [text00+LLL*4+32],dword 'MAST' - mov [text00+LLL*4+36],dword 'ER ' - nog1: - cmp eax,4 - jnz nog2 - mov [text00+LLL*4+28],dword 'SEC.' - mov [text00+LLL*4+32],dword 'SLAV' - mov [text00+LLL*4+36],dword 'E ' - nog2: - - - mov eax,[hdbase] ; HD BASE - cmp eax,1 - jnz hnoe1 - mov [text00+LLL*6+28],dword 'PRI.' - mov [text00+LLL*6+32],dword 'MAST' - mov [text00+LLL*6+36],dword 'ER ' - hnoe1: - cmp eax,2 - jnz hnof1 - mov [text00+LLL*6+28],dword 'PRI.' - mov [text00+LLL*6+32],dword 'SLAV' - mov [text00+LLL*6+36],dword 'E ' - hnof1: - cmp eax,3 - jnz hnog1 - mov [text00+LLL*6+28],dword 'SEC.' - mov [text00+LLL*6+32],dword 'MAST' - mov [text00+LLL*6+36],dword 'ER ' - hnog1: - cmp eax,4 - jnz hnog2 - mov [text00+LLL*6+28],dword 'SEC.' - mov [text00+LLL*6+32],dword 'SLAV' - mov [text00+LLL*6+36],dword 'E ' - hnog2: - - - mov eax,[f32p] ; FAT32 PARTITION - add al,48 - mov [text00+LLL*14+28],al - - mov eax,[sound_dma] ; SOUND DMA - add eax,48 - mov [text00+LLL*16+28],al - - mov eax,[lba_read] - call onoff ; LBA READ - mov [text00+LLL*18+28],ebx - - mov eax,[pci_acc] - call onoff ; PCI ACCESS - mov [text00+LLL*20+28],ebx - - mov eax,13 - mov ebx,175*65536+85 - mov ecx,40*65536+205 - mov edx,0x80111199-19 - int 0x40 - - mov edx,text00 - mov ebx,10*65536+45 - mov eax,4 - mov ecx,0xffffff - mov esi,LLL - newline: - int 0x40 - add ebx,8 - add edx,LLL - cmp [edx],byte 'x' - jnz newline - - popa - ret - - drawtime: - mov ax,[time] ;hours 22 - mov cl,1 - call unpacktime - mov [text00+LLL*22+28],word bx - mov al,ah ;minutes - inc cl - call unpacktime - mov [text00+LLL*22+31],word bx - mov eax,[date] - mov ch,3 - call unpackdate - mov [text00+LLL*24+34],word bx ;year 24 - mov al,ah - mov ch,1 - call unpackdate - mov [text00+LLL*24+28],word bx ;month - bswap eax - mov al,ah - inc ch - call unpackdate - mov [text00+LLL*24+31],word bx ;day - - mov eax,13 - mov ebx,175*65536+85 - mov ecx,40*65536+205 - mov edx,0x80111199-19 - int 0x40 - - mov edx,text00 - mov ebx,10*65536+45 - mov eax,4 - mov ecx,0xffffff - mov esi,LLL - newline1: - int 0x40 - add ebx,8 - add edx,LLL - cmp [edx],byte 'x' - jnz newline1 - ret - - unpacktime: - cmp byte [blinkpar],cl ;translate packed number to ascii - jne unpack1 - chkblink: - bt dword [blinkpar],16 - jnc unpack1 - xor bx,bx - ret - unpackdate: - cmp byte [blinkpar+1],ch - je chkblink - unpack1: - xor bx,bx - mov bh,al - mov bl,al - and bh,0x0f - shr bl,4 - add bx,0x3030 - ret - - hexconvert: ;converting dec to hex in ascii - xor ebx,ebx - mov bl,al - and bl,15 - add ebx,hex - mov cl,[ebx] - mov [esi],cl - shr eax,4 - xor ebx,ebx - mov bl,al - and bl,15 - add ebx,hex - mov cl,[ebx] - dec esi - mov [esi],cl - shr eax,4 - xor ebx,ebx - mov bl,al - and bl,15 - add ebx,hex - mov cl,[ebx] - dec esi - mov [esi],cl - ret - -onoff: - cmp [syslang],4 - jne norus1 - mov ebx,'„€ ' - cmp eax,1 - je exitsub - mov ebx,'…’ ' - ret - norus1: - mov ebx,'ON ' - cmp eax,1 - je exitsub - mov ebx,'OFF ' - exitsub: - ret - -_midibase: - mov eax,21 - mov ebx,1 - mov ecx,[midibase] - int 0x40 - ret - -_cdbase: - mov eax,21 - mov ebx,3 - mov ecx,[cdbase] - int 0x40 - ret - -_hdbase: - mov eax,21 - mov ebx,7 - mov ecx,[hdbase] - int 0x40 - ret - -_sound_dma: - mov eax,21 - mov ebx,10 - mov ecx,[sound_dma] - int 0x40 - ret - -_lba_read: - mov eax,21 - mov ebx,11 - mov ecx,[lba_read] - int 0x40 - ret - -_pci_acc: - mov eax,21 - mov ebx,12 - mov ecx,[pci_acc] - int 0x40 - ret - -_f32p: - mov eax,21 - mov ebx,8 - mov ecx,[f32p] - int 0x40 - ret - -_sb16: - mov eax,21 - mov ebx,4 - mov ecx,[sb16] - int 0x40 - ret - -_wssp: - mov eax,21 - mov ebx,6 - mov ecx,[wssp] - int 0x40 - ret - -_syslang: - mov eax,21 - mov ebx,5 - mov ecx,[syslang] - int 0x40 - ret - -loadtxt: - cld - mov edi,text00 - mov ecx,428 - cmp [syslang],4 - jne norus - mov esi,textrus - jmp sload - norus: - mov esi,texteng - sload: - rep movsd - ret - -cleantxt: - xor eax,eax - mov ecx,428 - cld - mov edi,text00 - rep stosd - mov [text00+1711],byte 'x' - ret - -settime: - mov dx,0x70 - call startstopclk - dec dx - mov al,2 ;set minutes - out dx,al - inc dx - mov al,byte [time+1] - out dx,al - dec dx - mov al,4 ;set hours - out dx,al - inc dx - mov al,byte [time] - out dx,al - dec dx - mov al,7 ;set day - out dx,al - inc dx - mov al,byte [date+2] - out dx,al - dec dx - mov al,8 ;set month - out dx,al - inc dx - mov al,byte [date+1] - out dx,al - dec dx - mov al,9 ;set year - out dx,al - inc dx - mov al,byte [date] - out dx,al - dec dx - call startstopclk - ret - -startstopclk: - mov al,0x0b - out dx,al - inc dx - in al,dx - btc ax,7 - out dx,al - ret - -; DATA AREA -count: db 0x0 -blinkpar: dd 0x0 -time: dw 0x0 -date: dd 0x0 - -filename: db 'SETUP DAT',0 - -textrus: - - db ' ง  MIDI ROLAND MPU-401 : 0x320 - + เจฌฅญจโ์' - db ' ' - db ' ง  SoundBlaster 16 : 0x240 - + เจฌฅญจโ์' - db ' ' - db ' ง  CD-ROM  : PRI.SLAVE - + เจฌฅญจโ์' - db ' ' - db ' ง  †„-1 : PRI.MASTER - + เจฌฅญจโ์' - db ' ' - db 'Ÿง๋ช แจแโฅฌ๋ : ENGLISH - + เจฌฅญจโ์' - db ' ' - db ' แชซ คช  ชซ ขจ โใเ๋ : ENGLISH - + เจฌฅญจโ์' - db ' ' - db ' ง  WSS : 0x200 - + เจฌฅญจโ์' - db ' ' - db ' งคฅซ FAT32 ญ  †„-1 : 1 - + เจฌฅญจโ์' - db ' ' - db '‡ขใชฎขฎฉ ช ญ ซ DMA : 1 - + เจฌฅญจโ์' - db ' ' - db '‚ชซ๎็จโ์ LBA : OFF - + เจฌฅญจโ์' - db ' ' - db '„ฎแโใฏ ช ่จญฅ PCI : OFF - + เจฌฅญจโ์' - db ' ' - db '‘จแโฅฌญฎฅ ขเฅฌ๏ : 0:00 - + ‚๋กฎเ ' - db ' ' - db '‘จแโฅฌญ ๏ ค โ  (ฌ,ค,ฃ) : 00/00/00 - + ‚๋กฎเ ' - db ' ' - db '‚ˆŒ€ˆ…: เจฌฅญจโ์ ขแฅ ' - db 'ˆ‘Ž‹œ‡“‰’… „Ž‘’“ Š FAT-32 Ž‘’ŽŽ†Ž! ' - db '… ‡€“„œ’… ‘Ž•€ˆ’œ €‘’Ž‰Šˆ ‘ฎๅเ ญจโ์ ขแฅ ' - db 'x' - -texteng: - - db 'MIDI: ROLAND MPU-401 BASE : 0x320 - + APPLY ' - db ' ' - db 'SOUND: SB16 BASE : 0x240 - + APPLY ' - db ' ' - db 'CD-ROM BASE : PRI.SLAVE - + APPLY ' - db ' ' - db 'HARDDISK-1 BASE : PRI.MASTER - + APPLY ' - db ' ' - db 'SYSTEM LANGUAGE : ENGLISH - + APPLY ' - db ' ' - db 'KEYBOARD LAYOUT : ENGLISH - + APPLY ' - db ' ' - db 'WINDOWS SOUND SYSTEM BASE : 0x200 - + APPLY ' - db ' ' - db 'FAT32-1 PARTITION IN HD-1 : 1 - + APPLY ' - db ' ' - db 'SOUND DMA CHANNEL : 1 - + APPLY ' - db ' ' - db 'LBA READ ENABLED : OFF - + APPLY ' - db ' ' - db 'PCI ACCESS FOR APPL. : OFF - + APPLY ' - db ' ' - db 'SYSTEM TIME : 0:00 - + SELECT ' - db ' ' - db 'SYSTEM DATE (M,D,Y) : 00/00/00 - + SELECT ' - db ' ' - db 'NOTE: APPLY ALL ' - db 'TEST FAT32 FUNCTIONS WITH EXTREME CARE ' - db 'SAVE YOUR SETTINGS BEFORE QUIT MENUET SAVE ALL ' - db 'x' - -labelt: - db '€‘’Ž‰Š€ “‘’Ž‰‘’‚ MENUET DEVICE SETUP ' - -hex db '0123456789ABCDEF' - -alt_general: - -; db ' ',27 -; db ' @ $ {[]}\ ',8,9 -; db ' ',13 -; db ' ',0,' ',0,'4',0,' ' -; db ' ',180,178,184,'6',176,'7' -; db 179,'8',181,177,183,185,182 -; db 'ABCD',255,'FGHIJKLMNOPQRSTUVWXYZ' -; db 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' -; db 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' -; db 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' - - -en_keymap: - - db '6',27 - db '1234567890-=',8,9 - db 'qwertyuiop[]',13 - db '~asdfghjkl;',39,96,0,'\zxcvbnm,./',0,'45 ' - db '@234567890123',180,178,184,'6',176,'7' - db 179,'8',181,177,183,185,182 - db 'AB?',0,'45 ' - db '@234567890123',180,178,184,'6',176,'7' - db 179,'8',181,177,183,185,182 - db 'AB>D',255,'FGHIJKLMNOPQRSTUVWXYZ' - db 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' - db 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' - db 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' - - -fr_keymap: - - db '6',27 - db '&Ž"',39,'(-_“)=',8,9 - db 'azertyuiop^$',13 - db '~qsdfghjklm’',0,0,'*wxcvbn,;:!',0,'45 ' - db '@234567890123',180,178,184,'6',176,'7' - db 179,'8',181,177,183,185,182 - db 'ABD',255,'FGHIJKLMNOPQRSTUVWXYZ' - db 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' - db 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' - db 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' - - -fr_keymap_alt_gr: - - - db '6',27 - db 28,'~#{[|˜\^@]}',8,9 - db 'azertyuiop^$',13 - db '~qsdfghjklm’',0,0,'*wxcvbn,;:!',0,'45 ' - db '@234567890123',180,178,184,'6',176,'7' - db 179,'8',181,177,183,185,182 - db 'ABD',255,'FGHIJKLMNOPQRSTUVWXYZ' - db 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' - db 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' - db 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' - - - -ge_keymap: - - db '6',27 - db '1234567890?[',8,9 - db 'qwertzuiop',203,'~',13 - db '~asdfghjkl',194,193,'1',0,39,'yxcvbnm,.-',0,'45 ' - db '@234567890123',180,178,184,'6',176,'7' - db 179,'8',181,177,183,185,182 - db 'ABD',255,'FGHIJKLMNOPQRSTUVWXYZ' - db 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' - db 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' - db 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' - -ru_keymap: - - db '6',27 - db '1234567890-=',8,9 - db 'ฉๆใชฅญฃ่้งๅ๊',13 - db 0,"ไ๋ข ฏเฎซคฆํ" - db 0xf1, '-/' - db "๏็แฌจโ์ก๎",'.-','45 ' - db '@234567890123',180,178,184,'6',176,'7' - db 179,'8',181,177,183,185,182 - db 'ABD',255,'FGHIJKLMNOPQRSTUVWXYZ' - db 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' - db 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' - db 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' - -I_PARAM dd 0 - -keyboard dd 0x0 -midibase dd 0x320 -cdbase dd 0x2 -sb16 dd 0x220 -syslang dd 0x1 -wss dd 0x1 -wssp dd 0x0 -hdbase dd 0x1 -f32p dd 0x1 -sound_dma dd 0x1 -lba_read dd 0x1 -pci_acc dd 0x1 - -text00: - -I_END: -table_area: diff --git a/programs/vrr/trunk/vrr.asm b/programs/vrr/trunk/vrr.asm index cfe8e4a13e..328f158576 100644 --- a/programs/vrr/trunk/vrr.asm +++ b/programs/vrr/trunk/vrr.asm @@ -258,12 +258,10 @@ restore_mode: push eax push ebx push edx - call kill_all mov eax,21 mov ebx,13 mov ecx,4 int 40h - call ref_screen pop edx pop ecx pop eax @@ -279,7 +277,6 @@ set_my_mode: mov eax,[currvm] mov [oldvm],eax mov [currvm],edx - call kill_all pop edx push edx mov eax,21 @@ -289,7 +286,6 @@ set_my_mode: pop edx pop ebx pop ecx - call ref_screen retn ; IN: eax = 0/1 - -/+ 1Hz @@ -307,23 +303,6 @@ inc_dec_rate: pop ebx retn - -ref_screen: - push eax - push ebx - push ecx - mov eax,5 - mov ebx,100 - int 40h - mov eax,19 - mov ebx,strt - xor ecx,ecx - int 40h - pop ecx - pop ebx - pop eax - retn - get_pid: mov eax,9 mov ebx,buffer @@ -353,28 +332,6 @@ get_vert_rate: mov [currvm],ecx retn -kill_all: - call get_pid - mov ecx,[totp] -ka_loc_00: - push ecx - push ecx - mov eax,9 - mov ebx,buffer - int 40h - pop ecx - mov eax,[mypid] - cmp eax,[ebx+30] - je ka_loc_02 - mov eax,18 - mov ebx,2 - int 40h -ka_loc_02: - pop ecx - loop ka_loc_00 - retn - - get_initial_videomode: retn