From dad5229ccdd3b10ee062c5606491594318784c02 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Mon, 4 May 2020 23:50:41 +0000 Subject: [PATCH] FASM: fix whole system hung if source was "dd %t" (by Prohor Nikiforov) KFM: buildin buttons.bmp CMM: update libs git-svn-id: svn://kolibrios.org@7863 a494cfbc-eb01-0410-851d-a64ba20cac60 --- data/Tupfile.lua | 1 - programs/cmm/examples/Tupfile.lua | 1 + programs/cmm/lib/gui.h | 9 +- programs/cmm/lib/kolibri.h | 1 - programs/cmm/lib/list_box.h | 32 +++++- programs/cmm/lib/patterns/http_downloader.h | 8 +- programs/cmm/lib/strings.h | 8 +- programs/develop/fasm/1.73/fasm.asm | 22 ++-- programs/develop/fasm/1.73/system.inc | 120 +++++++++++++++++++- programs/fs/kfm/trunk/data.inc | 4 +- programs/fs/kfm/trunk/draw.inc | 70 +++--------- programs/fs/kfm/trunk/err_wind.inc | 3 - programs/fs/kfm/trunk/images/buttons.bmp | Bin 0 -> 9590 bytes programs/fs/kfm/trunk/images/buttons.raw | Bin 0 -> 9504 bytes programs/fs/kfm/trunk/kfm.asm | 15 --- programs/fs/kfm/trunk/text.inc | 3 - 16 files changed, 191 insertions(+), 106 deletions(-) create mode 100644 programs/fs/kfm/trunk/images/buttons.bmp create mode 100644 programs/fs/kfm/trunk/images/buttons.raw diff --git a/data/Tupfile.lua b/data/Tupfile.lua index e7a735608..0ea848b7e 100644 --- a/data/Tupfile.lua +++ b/data/Tupfile.lua @@ -30,7 +30,6 @@ img_files = { {"DEVELOP/T_EDIT.INI", PROGS .. "/other/t_edit/t_edit.ini"}, {"File Managers/ICONS.INI", "common/File Managers/icons.ini"}, {"File Managers/KFM.INI", "common/File Managers/kfm.ini"}, - {"File Managers/BUTTONS.BMP", PROGS .. "/fs/kfm/trunk/buttons.bmp"}, {"File Managers/ICONS.BMP", PROGS .. "/fs/kfm/trunk/icons.bmp"}, {"File Managers/FNAV/ABOUT.TXT", "common/File Managers/fNav/About.txt"}, {"File Managers/FNAV/FNAV", "common/File Managers/fNav/fNav.kex"}, diff --git a/programs/cmm/examples/Tupfile.lua b/programs/cmm/examples/Tupfile.lua index 23a45733c..66a247732 100644 --- a/programs/cmm/examples/Tupfile.lua +++ b/programs/cmm/examples/Tupfile.lua @@ -11,3 +11,4 @@ tup.rule("console.c", "c-- /D=AUTOBUILD /D=$(C_LANG) %f" .. tup.getconfig("KPACK tup.rule("info.c", "c-- /D=AUTOBUILD /D=$(C_LANG) %f" .. tup.getconfig("KPACK_CMD"), "info.com") tup.rule("pigex.c", "c-- /D=AUTOBUILD /D=$(C_LANG) %f" .. tup.getconfig("KPACK_CMD"), "pigex.com") tup.rule("netcheck.c", "c-- /D=AUTOBUILD /D=$(C_LANG) %f" .. tup.getconfig("KPACK_CMD"), "netcheck.com") +tup.rule("math.c", "c-- /D=AUTOBUILD /D=$(C_LANG) %f" .. tup.getconfig("KPACK_CMD"), "math.com") diff --git a/programs/cmm/lib/gui.h b/programs/cmm/lib/gui.h index 270ce9458..990de9aea 100644 --- a/programs/cmm/lib/gui.h +++ b/programs/cmm/lib/gui.h @@ -322,11 +322,18 @@ { dword n; dword inc(dword _addition); + dword set(dword _new_val); }; :dword incn::inc(dword _addition) { - n+=_addition; + n += _addition; + return n; +} + +:dword incn::set(dword _new_val) +{ + n =_new_val; return n; } diff --git a/programs/cmm/lib/kolibri.h b/programs/cmm/lib/kolibri.h index fdf98ec1b..7d710f224 100644 --- a/programs/cmm/lib/kolibri.h +++ b/programs/cmm/lib/kolibri.h @@ -179,7 +179,6 @@ struct proc_info :void GetProcessInfo(dword _process_struct_pointer, _process_id) { - skin_height = GetSkinHeight(); EAX = 9; EBX = _process_struct_pointer; ECX = _process_id; diff --git a/programs/cmm/lib/list_box.h b/programs/cmm/lib/list_box.h index db827b8f4..c326244a8 100644 --- a/programs/cmm/lib/list_box.h +++ b/programs/cmm/lib/list_box.h @@ -26,7 +26,9 @@ struct llist int KeyDown(); int KeyUp(); int KeyHome(); + int KeyHomeHor(); int KeyEnd(); + int KeyEndHor(); int KeyPgDown(); int KeyPgUp(); int KeyLeft(); @@ -124,6 +126,13 @@ struct llist :int llist::ProcessKey(dword key) { + if (horisontal_selelection) switch(key) + { + case SCAN_CODE_LEFT: return KeyLeft(); + case SCAN_CODE_RIGHT: return KeyRight(); + case SCAN_CODE_HOME: return KeyHomeHor(); + case SCAN_CODE_END: return KeyEndHor(); + } switch(key) { case SCAN_CODE_DOWN: return KeyDown(); @@ -133,11 +142,6 @@ struct llist case SCAN_CODE_PGUP: return KeyPgUp(); case SCAN_CODE_PGDN: return KeyPgDown(); } - if (horisontal_selelection) switch(key) - { - case SCAN_CODE_LEFT: return KeyLeft(); - case SCAN_CODE_RIGHT: return KeyRight(); - } return 0; } @@ -164,8 +168,8 @@ struct llist if (cur_y < first) || (cur_y >= first + visible) { first = cur_y; - CheckDoesValuesOkey(); } + CheckDoesValuesOkey(); return 1; } @@ -196,6 +200,21 @@ struct llist return 1; } +:int llist::KeyHomeHor() +{ + if (cur_x==0) return 0; + cur_x = 0; + return 1; +} + +:int llist::KeyEndHor() +{ + if (cur_x==column_max) return 0; + cur_x = column_max; + CheckDoesValuesOkey(); + return 1; +} + :int llist::KeyHome() { if (cur_y==0) && (first==0) return 0; @@ -237,6 +256,7 @@ struct llist if (visible + first > count) first = count - visible; if (first < 0) first = 0; if (cur_y >= count) cur_y = count - 1; + if (cur_x >= column_max) cur_x = column_max; if (cur_y < 0) cur_y = 0; if (cur_x < 0) cur_x = 0; } diff --git a/programs/cmm/lib/patterns/http_downloader.h b/programs/cmm/lib/patterns/http_downloader.h index b9616942e..0b9bc8bac 100644 --- a/programs/cmm/lib/patterns/http_downloader.h +++ b/programs/cmm/lib/patterns/http_downloader.h @@ -51,7 +51,7 @@ void _http::receive() } -bool _http::handle_redirect() +:bool _http::handle_redirect() { dword redirect; http_find_header_field stdcall (transfer, "location\0"); @@ -152,7 +152,7 @@ bool DOWNLOADER::MonitorProgress() =====================================*/ -int check_is_the_adress_local(dword _in) +:int check_is_the_adress_local(dword _in) { if (ESBYTE[_in]!='/') return false; _in++; @@ -168,7 +168,7 @@ int check_is_the_adress_local(dword _in) return false; } -int check_is_the_url_absolute(dword _in) +:int check_is_the_url_absolute(dword _in) { if(!strncmp(_in,"ftp:",4)) return true; if(!strncmp(_in,"http:",5)) return true; @@ -181,7 +181,7 @@ int check_is_the_url_absolute(dword _in) return false; } -void get_absolute_url(dword _rez, _base, _new) +:void get_absolute_url(dword _rez, _base, _new) { int i; //case: ./valera.html diff --git a/programs/cmm/lib/strings.h b/programs/cmm/lib/strings.h index 833417d86..2090dc36e 100644 --- a/programs/cmm/lib/strings.h +++ b/programs/cmm/lib/strings.h @@ -927,11 +927,11 @@ inline void MEMSETD(EDI,ECX,EAX) } :replace_char(dword in_str, char from_char, to_char, int length) { - int i; - for (i=0; i - add edx,26 shl 16 - add ebx,16*16*3 - pusha - call .calculate_button - mcall ,,,151 - popa - mcall - add edx,26 shl 16 - add ebx,16*16*3 - pusha - call .calculate_button - mcall ,,,152 - popa - mcall - add edx,26 shl 16 - add ebx,16*16*3 - pusha - call .calculate_button - mcall ,,,153 - popa - mcall - add edx,26 shl 16 - add ebx,16*16*3 - pusha - call .calculate_button - mcall ,,,154 - popa - mcall - add edx,26 shl 16 - add ebx,16*16*3 - pusha - call .calculate_button - mcall ,,,155 - popa - mcall - add edx,26 shl 16 - add ebx,16*16*3 - pusha - call .calculate_button - mcall ,,,156 - popa - mcall - add edx,26 shl 16 - add ebx,16*16*3 - pusha - call .calculate_button - mcall ,,,157 - popa + mcall 7,buttons_file_data,<198,16> + + mov ecx, 20 + add ecx, [skin_high] + shl ecx, 16 + add ecx, 16 + mcall 8,<15,16>,,150+0x40000000 + +_new_but: + add ebx,26 shl 16 + inc edx mcall + cmp edx, 157+0x40000000 + jl _new_but + ret ;-------------------------------------- .calculate_button: - mov esi,0xffffff mov ebx,edx mov bx,15 mov ecx,edx shl ecx,16 mov cx,bx - mov eax,8 ret ;------------------------------------------------------------------------------ draw_left_sort_button: diff --git a/programs/fs/kfm/trunk/err_wind.inc b/programs/fs/kfm/trunk/err_wind.inc index e6795898b..12bff93d6 100644 --- a/programs/fs/kfm/trunk/err_wind.inc +++ b/programs/fs/kfm/trunk/err_wind.inc @@ -7,9 +7,6 @@ read_folder_1_error: initiation_error: mov [error_pointer],ini_file_name jmp error_window -buttons_error: - mov [error_pointer],buttons_file_name - jmp error_window icon_error: mov [error_pointer],icons_file_name error_window: diff --git a/programs/fs/kfm/trunk/images/buttons.bmp b/programs/fs/kfm/trunk/images/buttons.bmp new file mode 100644 index 0000000000000000000000000000000000000000..34310458086c6a707a1b09895fcea1c7c5db8155 GIT binary patch literal 9590 zcmcgsJCa*R3|z%dREm57S2zQz#X+sa_fNWA?|j}b`Z8#RDl+E_cJ;vp=ywk2>aKG z!o)Sw=SDHjEixXlN2$Z{YTqV-6PI2Jj$Sw7lY`T047?}8jLYC1XDK{(F2J3^pO=(!S;*O0g_ z;8!4S1iK0XLDN9NV3fQx$TMwc`TR^tob{w@RCq3TRU51X5@DO+!c{G= z6Wv4i?MR{laN}A_6-1nRGuF6sf-qeq;G_Yr z48}FjLPQxD>mls16Quv_SS4}kNPKR9ufEYp3b_msvO!i`Xi&;e5thmz zXm(^Uih>%kv()o%o~dQ3?t>yp{QFV_u}I(quj=q7bR5^%~;VNTn$B_iW9 zYD!8qTqlOeBLlI^c8Q=w6E%%e8Xty0!EyWYL;JYzWu8%f;E3f|h2hJ7q$c6+^5~`Q zfn6I4j`Ny8C(P{>_(?V9lBSF~KB^Gm`)ed398x}0xXLAi9J;Rlzz!UpAVu#OO#&*t z{iHag^dBYTwF*;I6!~N^{`M5x#NN<1q)5t4O0etls$_$ycFEWemyWV)tVSZh!NFOY tT9G8bd2QOAV>8@oRmHvg_PcbL@x5xUIeHN@j=U9rZ-r8;i5zKT^*>i7Mos_# literal 0 HcmV?d00001 diff --git a/programs/fs/kfm/trunk/images/buttons.raw b/programs/fs/kfm/tr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9b;OKTEJ~_1tWHPkHVlc8=l()3( k*%H>lY*piRA2QkV>H`F&l|k(a^Dd`7mB1CZMKW&s4_P%sH~;_u literal 0 HcmV?d00001 diff --git a/programs/fs/kfm/trunk/kfm.asm b/programs/fs/kfm/trunk/kfm.asm index a8a19dfa5..4b24b8cdb 100644 --- a/programs/fs/kfm/trunk/kfm.asm +++ b/programs/fs/kfm/trunk/kfm.asm @@ -69,7 +69,6 @@ START: mov [read_folder_name],ax mov [read_folder_1_name],ax call load_icon_and_convert_to_img - call load_buttons_and_convert_to_img call load_initiation_file call add_memory_for_folders call device_detect_f70 @@ -258,20 +257,6 @@ load_icon_and_convert_to_img: call sub_application_memory ret ;--------------------------------------------------------------------- -load_buttons_and_convert_to_img: - mov ebx,buttons_file_name - call prepare_load_data - jnz buttons_error - mov eax,[appl_memory] - mov [buttons_img_start],eax - call prepare_load_data_2 - add eax,[buttons_img_start] - call prepare_load_data_1 - jnz buttons_error - call convert_bmp_to_img - call sub_application_memory - ret -;--------------------------------------------------------------------- load_initiation_file: mov ebx,ini_file_name call prepare_load_data diff --git a/programs/fs/kfm/trunk/text.inc b/programs/fs/kfm/trunk/text.inc index bb5b5d3cb..1a6c23db5 100644 --- a/programs/fs/kfm/trunk/text.inc +++ b/programs/fs/kfm/trunk/text.inc @@ -85,9 +85,6 @@ ini_file_name: icons_file_name: db 'icons.bmp',0 ;--------------------------------------------------------------------- -buttons_file_name: - db 'buttons.bmp',0 -;--------------------------------------------------------------------- error_type: db 'File system error',0 ;---------------------------------------------------------------------