HACONFIG: deleting unnecessary rows

git-svn-id: svn://kolibrios.org@7408 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
theonlymirage 2018-09-23 06:23:29 +00:00
parent 50de36b599
commit 40f011a45d

View File

@ -2,7 +2,7 @@
; Hot Angles Config ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Hot Angles Config ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Compile with FASM ; Compile with FASM
; Version 0.3: Sep 22, 2018 ; Version 0.3.1: Sep 23, 2018
; Copyright (c) 2018, Efremenkov Sergey aka TheOnlyMirage ; Copyright (c) 2018, Efremenkov Sergey aka TheOnlyMirage
; All rights reserved. ; All rights reserved.
@ -25,7 +25,7 @@
; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
; -------------------------------------------------------------------------------------- ; --------------------------------------------------------------------------------------
;P.S. Êîä ñûðîé, òðåáóåòñÿ îïòèìèçàöèÿ è äîðàáîòêà (ñì. òåìó ôîðóìà) ;P.S. Êîäó òðåáóåòñÿ îïòèìèçàöèÿ è äîðàáîòêà (ñì. òåìó ôîðóìà)
format binary as "" ; Binary file format without extension format binary as "" ; Binary file format without extension
use32 ; Tell compiler to use 32 bit instructions use32 ; Tell compiler to use 32 bit instructions
org 0 ; the base address of code, always 0x0 org 0 ; the base address of code, always 0x0
@ -44,12 +44,7 @@ include 'lang.inc' ;
include '../../macros.inc' include '../../macros.inc'
include '../../proc32.inc' include '../../proc32.inc'
include '../../dll.inc' include '../../dll.inc'
include '../../develop/libraries/box_lib/trunk/box_lib.mac' include '../../develop/libraries/box_lib/trunk/box_lib.mac' ;êîìïîíåíòû checkBox è editBox
;;include 'editbox.inc'
;;use_edit_box
;;include 'check.inc' ;âêëþ÷èòü ôàéë check.inc
;;version_ch1 ;íåîáõîäèìûé ìàêðîñ äëÿ âêëþ÷åíèÿ new âåðñèè check_box1
;;use_check_box ;èñïîëüçóÿ ìàêðîñû, âíåñòè ïðîöåäóðû äëÿ ðèñîâàíèÿ ÷åê áîêñà
Otstup = 30 Otstup = 30
@ -94,13 +89,11 @@ event_wait:
je button ; Expl.: User has pressed one of the je button ; Expl.: User has pressed one of the
; applications buttons. ; applications buttons.
;mouse_edit_boxes editboxes,editboxes_end invoke edit_box_mouse, editLU ;ïðîâåðêà ñîáûòèé ìûøè äëÿ editBox'îâ
;mouse_check_boxes check_boxes,check_boxes_end ;ïðîâåðêà ÷åê áîêñà
invoke edit_box_mouse, editLU
invoke edit_box_mouse, editLD invoke edit_box_mouse, editLD
invoke edit_box_mouse, editRU invoke edit_box_mouse, editRU
invoke edit_box_mouse, editRD invoke edit_box_mouse, editRD
invoke check_box_mouse, ch1 ;ïðîâåðêà ÷åê áîêñà invoke check_box_mouse, ch1 ;ïðîâåðêà ÷åê áîêñà
jmp event_wait jmp event_wait
@ -112,7 +105,7 @@ red: ;
key: ; Keypress event handler key: ; Keypress event handler
mov eax, 2 ; The key is returned in ah. The key must be mov eax, 2 ; The key is returned in ah. The key must be
mcall ; read and cleared from the system queue. mcall ; read and cleared from the system queue.
;key_edit_boxes editboxes,editboxes_end
invoke edit_box_key, editLU invoke edit_box_key, editLU
invoke edit_box_key, editLD invoke edit_box_key, editLD
invoke edit_box_key, editRU invoke edit_box_key, editRU
@ -186,9 +179,9 @@ applyButton:
;âû÷èñëèì ðàçìåð ôàéëà êîíôèãóðàöèè â áàéòàõ ;âû÷èñëèì ðàçìåð ôàéëà êîíôèãóðàöèè â áàéòàõ
mov ecx, 5*2+1 ;1 áàéò íà ñîñòîÿíèå àêòèâíîñòè è 5 ïàð ïåðåíîñîâ ñòðîê (ñèìâîëû 13, 10) mov ecx, 5*2+1 ;1 áàéò íà ñîñòîÿíèå àêòèâíîñòè è 5 ïàð ïåðåíîñîâ ñòðîê (ñèìâîëû 13, 10)
add ecx, dword[editLU.size] ;dataBuffer.size1] ;ïëþñ ðàçìåð êàæäîé ñòðîêè â áàéòàõ add ecx, dword[editLU.size] ;ïëþñ ðàçìåð êàæäîé ñòðîêè â áàéòàõ
add ecx, dword[editLD.size] ;dataBuffer.size2] add ecx, dword[editLD.size]
add ecx, dword[editRU.size] ;dataBuffer.size3] add ecx, dword[editRU.size]
add ecx, dword[editRD.size] ;dataBuffer.size4] add ecx, dword[editRD.size] ;dataBuffer.size4]
;òåïåðü ðàçìåð ôàéëà êîíôèãóðàöèè â ecx ;òåïåðü ðàçìåð ôàéëà êîíôèãóðàöèè â ecx
mov dword[createFile.size], ecx ;ïîëîæèì ðàçìåð áàéò â ñòðóêòóðó ñîçäàíèÿ/ïåðåçàïèñè ôàéëà mov dword[createFile.size], ecx ;ïîëîæèì ðàçìåð áàéò â ñòðóêòóðó ñîçäàíèÿ/ïåðåçàïèñè ôàéëà
@ -197,7 +190,7 @@ applyButton:
;çàïîëíèì áóôåð ñîäåðæèìîãî: ;çàïîëíèì áóôåð ñîäåðæèìîãî:
mov byte[eax], 110; 'n' ;ïî óìîë÷àíèþ ôëàã ñíÿò mov byte[eax], 110; 'n' ;ïî óìîë÷àíèþ ôëàã ñíÿò
cmp word[ch1.flags], 110b ;ch_flag_en and ch_flag_middle ;110b ;ch_flag_en ;âûñòàâëåí checkBox èëè íåò? cmp word[ch1.flags], 110b ;ch_flag_en and ch_flag_middle ;âûñòàâëåí checkBox èëè íåò?
jne applyButton.no jne applyButton.no
mov byte[eax], 121 ;èíà÷å êëàä¸ì 'y' mov byte[eax], 121 ;èíà÷å êëàä¸ì 'y'
.no: .no:
@ -207,13 +200,13 @@ applyButton:
push esi ebx push esi ebx
call UpdateEditsSizes ;îáíîâèòü ðàçìåðû òåêñòà â edit'àõ call UpdateEditsSizes ;îáíîâèòü ðàçìåðû òåêñòà â edit'àõ
mov esi, dataBuffer.1 ;editLU.text mov esi, dataBuffer.1 ;editLU.text
mov ebx, dataBuffer.size1 ;editLU.size mov ebx, dataBuffer.size1 ;editLU.size
call copyParam call copyParam
call addPerenos ;äîáàâëÿåì ïåðåíîñ ñòðîêè call addPerenos ;äîáàâëÿåì ïåðåíîñ ñòðîêè
mov esi, dataBuffer.2 ;editLD.text mov esi, dataBuffer.2
mov ebx, dataBuffer.size2 ;editLD.size mov ebx, dataBuffer.size2
call copyParam call copyParam
call addPerenos ;äîáàâëÿåì ïåðåíîñ ñòðîêè call addPerenos ;äîáàâëÿåì ïåðåíîñ ñòðîêè
@ -267,7 +260,7 @@ compareBytes2:
ret ret
restartHotAnglesApp: ;!!! restartHotAnglesApp:
;íàõîäèì âñå êîïèè ïðèëîæåíèÿ ïî èìåíè è çàâåðøàåì èõ ;íàõîäèì âñå êîïèè ïðèëîæåíèÿ ïî èìåíè è çàâåðøàåì èõ
push eax ebx ecx esi edi push eax ebx ecx esi edi
;óêàçàòåëè, êîòîðûå íèêîãäà íå ìåíÿþòñÿ: ;óêàçàòåëè, êîòîðûå íèêîãäà íå ìåíÿþòñÿ:
@ -353,27 +346,26 @@ loadConfig:
cmp byte[eax], 121 ;'y' ;âûñòàâëÿåì checkBox - ïàðàìåòð àêòèâíîñòè ïðèëîæåíèÿ cmp byte[eax], 121 ;'y' ;âûñòàâëÿåì checkBox - ïàðàìåòð àêòèâíîñòè ïðèëîæåíèÿ
jne loadConfig.no jne loadConfig.no
.yes: .yes:
mov word[ch1.flags], 110b ;ch_flag_en and ch_flag_middle ;110b ;ch_flag_en mov word[ch1.flags], 110b ;ch_flag_en and ch_flag_middle
jmp loadConfig.chEnd jmp loadConfig.chEnd
.no: .no:
mov word[ch1.flags], 100b ;0 and ch_flag_middle ;100b mov word[ch1.flags], 100b ;ch_flag_middle
.chEnd: .chEnd:
;jmp loadConfig.end ;êîìàíäà äëÿ óäîáñòâà îòëàäêè è ïîèñêà îøèáîê ;jmp loadConfig.end ;êîìàíäà äëÿ óäîáñòâà îòëàäêè è ïîèñêà îøèáîê
;êîïèðóåì ñîäåðæèìîå ñòðîê â áóôåð ;êîïèðóåì ñîäåðæèìîå ñòðîê â áóôåð
push edi esi ecx ebx eax push edi esi ecx ebx eax
;èíèöèàëèçèðóåì óêàçàòåëè íà àäðåñà áóôåðà ñòðîêè è å¸ ðàçìåðà ;èíèöèàëèçèðóåì óêàçàòåëè íà àäðåñà áóôåðà ñòðîêè è å¸ ðàçìåðà
mov edi, dataBuffer.1 ;dword[dataBuffer.1] mov edi, dataBuffer.1
mov esi, dataBuffer.size1 ;dword[dataBuffer.size1] mov esi, dataBuffer.size1
;ecx - ñ÷¸ò÷èê áàéò â ñòðîêå ;ecx - ñ÷¸ò÷èê áàéò â ñòðîêå
; mov ecx, 0 ;xor ecx, ecx
.block: .block:
xor ecx, ecx ;îáíóëÿåì ñ÷¸ò÷èê xor ecx, ecx ;îáíóëÿåì ñ÷¸ò÷èê
inc eax inc eax
cmp byte[eax], 10 ;åñëè î÷åðåäíîé êîä ñèìâîëà 10 èëè 13, òî ïðîïóñêàåì ñèìâîëû cmp byte[eax], 10 ;åñëè î÷åðåäíîé êîä ñèìâîëà 10 èëè 13, òî ïðîïóñêàåì ñèìâîëû
je loadConfig.block ;propusk ;äî ïåðâîãî îòëè÷íîãî îò íèõ je loadConfig.block ;äî ïåðâîãî îòëè÷íîãî îò íèõ
cmp byte[eax], 13 cmp byte[eax], 13
je loadConfig.block ;propusk je loadConfig.block
; ñèìâîë îòëè÷åí îò ïåðåíîñà ñòðîêè è âîçâðàòà êàðåòêè - íà÷èíàåì êîïèðîâàòü îòñþäà â áóôåð ; ñèìâîë îòëè÷åí îò ïåðåíîñà ñòðîêè è âîçâðàòà êàðåòêè - íà÷èíàåì êîïèðîâàòü îòñþäà â áóôåð
mov bl, byte[eax] mov bl, byte[eax]
@ -407,7 +399,7 @@ loadConfig:
add esi, 4 ;ïåðåõîäèì íà ðàçìåð ñëåäóþùåãî áóôåðà add esi, 4 ;ïåðåõîäèì íà ðàçìåð ñëåäóþùåãî áóôåðà
sub edi, ecx ;ïåðåõîäèì íà ñëåäóþùèé áóôåð sub edi, ecx ;ïåðåõîäèì íà ñëåäóþùèé áóôåð
add edi, 512 add edi, 512
; mov ecx, 0 ;xor ecx, ecx ;îáíóëÿåì ðàçìåð ñòðîêè ;xor ecx, ecx ;îáíóëÿåì ðàçìåð ñòðîêè
cmp edi, dataBuffer.size1 ;åñëè ýòî áûë ïîñëåäíèé áóôåð (è ìû âûøëè çà àäðåñà ðàçìåðîâ áóôåðîâ), òî âûõîäèì cmp edi, dataBuffer.size1 ;åñëè ýòî áûë ïîñëåäíèé áóôåð (è ìû âûøëè çà àäðåñà ðàçìåðîâ áóôåðîâ), òî âûõîäèì
jb loadConfig.block jb loadConfig.block
@ -452,13 +444,13 @@ updateParams: ;max, size, pos
selfName db 'HACONFIG', 0 ;'@HOTANGLES',0 selfName db 'HACONFIG', 0
selfNameSize = 8;9 ;äî 11 byte selfNameSize = 8 ;äî 11 byte
; ;
compareBytes: compareBytes:
push edi esi ecx ebx push edi esi ecx ebx
mov eax, 0 ;xor eax, eax mov eax, 0 ;xor eax, eax
mov ecx, selfNameSize ;11 ;max ðàçìåð ñòðîê 11 mov ecx, selfNameSize ;max ðàçìåð ñòðîê 11
@@: @@:
mov bl, byte[edi] mov bl, byte[edi]
cmp bl, byte[esi] cmp bl, byte[esi]
@ -546,13 +538,13 @@ draw_window:
sub word[coord.y], WindowsHeight/2 sub word[coord.y], WindowsHeight/2
mov eax, 0 ; function 0 : define and draw window mov eax, 0 ; function 0 : define and draw window
mov ebx, 0 ;* 65536 + WindowsWidth ; [x start] *65536 + [x size] mov ebx, 0 ; [x start] *65536 + [x size]
mov bx, word[coord.x] mov bx, word[coord.x]
shl ebx, 16 shl ebx, 16
mov bx, WindowsWidth mov bx, WindowsWidth
mov ecx, 0 mov ecx, 0
mov cx, word[coord.y] ;* 65536 + WindowsHeight ; [y start] *65536 + [y size] mov cx, word[coord.y] ; [y start] *65536 + [y size]
shl ecx, 16 shl ecx, 16
mov cx, WindowsHeight mov cx, WindowsHeight
@ -563,8 +555,6 @@ draw_window:
mov edi, title mov edi, title
mcall mcall
;draw_check_boxes check_boxes,check_boxes_end ;ðèñîâàíèå ÷åêáîêñîâ
;draw_edit_boxes editboxes,editboxes_end ;ðèñîâàíèå edit box'îâ
invoke edit_box_draw, editLU ;ðèñîâàíèå edit box'îâ invoke edit_box_draw, editLU ;ðèñîâàíèå edit box'îâ
invoke edit_box_draw, editLD invoke edit_box_draw, editLD
invoke edit_box_draw, editRU invoke edit_box_draw, editRU
@ -587,7 +577,7 @@ draw_window:
call draw_super_text call draw_super_text
LineLength = 62 ;42 LineLength = 62
mov ebx, 40 * 65536 + 36 ; draw info text with function 4 (x, y) mov ebx, 40 * 65536 + 36 ; draw info text with function 4 (x, y)
mov ecx, 0x224466 mov ecx, 0x224466
mov edx, text mov edx, text
@ -626,15 +616,7 @@ import box_lib,\
option_box_mouse, 'option_box_mouse' option_box_mouse, 'option_box_mouse'
;DATA äàííûå check_box èñïîëüçóåò ñèñòåìíûå öâåòà
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;DATA äàííûå äëÿ check_box1 - èñïîëüçóåò ñèñòåìíûå öâåòà
;Ôîðìàò äàííûõ ÷åê áîêñà:
; êîîðäèíàòà õ, êîîðäèíàòà ó, óêàçàòåëü íà íà÷àëî ñòðîêè, äëèíà ñòðîêè
;ñîñòîÿíèå ðàáîòû óòèëèòû: àêòèâíà/íåò
;check_boxes:
; ch1 check_box1 30,160,ch_text.1,ch_text.e1-ch_text.1,ch_flag_en
;check_boxes_end:
;êîîðäèíàòû (x,y) = (30, 160) ðàçìåð ÷åêáîêñà 12, öâåò òåêñòà 0x224466 ;êîîðäèíàòû (x,y) = (30, 160) ðàçìåð ÷åêáîêñà 12, öâåò òåêñòà 0x224466
ch1 check_box2 30 shl 16 + 12, 160 shl 16 + 12, 6, 0xFFFFFFFF, 0xAABBCC, 0x224466, ch_text, 110b ; ch_flag_en and ch_flag_middle ch1 check_box2 30 shl 16 + 12, 160 shl 16 + 12, 6, 0xFFFFFFFF, 0xAABBCC, 0x224466, ch_text, 110b ; ch_flag_en and ch_flag_middle
@ -652,9 +634,6 @@ buttonTextSize = 9
buttonTextXoffset = 12 buttonTextXoffset = 12
ch_text db '‚ª«îç¨âì/ ªâ¨¢¨à®¢ âì "Hot Angles"', 0 ch_text db '‚ª«îç¨âì/ ªâ¨¢¨à®¢ âì "Hot Angles"', 0
;ch_text: ;ñîïðîâîæäàþùèé òåêñò äëÿ ÷åê áîêñîâ
;.1 db '‚ª«îç¨âì/ ªâ¨¢¨à®¢ âì "Hot Angles"'
;.e1:
superText: superText:
.lu db 'Š®¬ ­¤  «¥¢®£® ¢¥àå­¥£® 㣫 : ', 0 .lu db 'Š®¬ ­¤  «¥¢®£® ¢¥àå­¥£® 㣫 : ', 0
@ -675,8 +654,6 @@ buttonTextSize = 5
buttonTextXoffset = 0 buttonTextXoffset = 0
ch_text db 'Activate "Hot Angles"',0 ;ñîïðîâîæäàþùèé òåêñò äëÿ ÷åê áîêñà ch_text db 'Activate "Hot Angles"',0 ;ñîïðîâîæäàþùèé òåêñò äëÿ ÷åê áîêñà
;.1 db 'Activate "Hot Angles"',0
;.e1:
superText: superText:
.lu db 'Left up angle command: ', 0 .lu db 'Left up angle command: ', 0
@ -694,22 +671,22 @@ draw_super_text:
mov ecx, 0x224466 mov ecx, 0x224466
mov eax, superText.lu mov eax, superText.lu
mov edx, eax mov edx, eax
mov esi, superTextSize ;22 mov esi, superTextSize
mcall 4 mcall 4
mov ebx, Otstup * 65536 + 109 mov ebx, Otstup * 65536 + 109
mov edx, superText.ld mov edx, superText.ld
mov esi, superTextSize ;24 mov esi, superTextSize
mcall 4 mcall 4
mov ebx, 240 * 65536 + 74 mov ebx, 240 * 65536 + 74
mov edx, superText.ru mov edx, superText.ru
mov esi, superTextSize ;23 mov esi, superTextSize
mcall 4 mcall 4
mov ebx, 240 * 65536 + 109 mov ebx, 240 * 65536 + 109
mov edx, superText.rd mov edx, superText.rd
mov esi, superTextSize ;25 mov esi, superTextSize
mcall 4 mcall 4
pop esi edi edx ecx ebx eax pop esi edi edx ecx ebx eax
@ -725,16 +702,6 @@ editLD edit_box 180,Otstup,120, 0xffffff, 0x6a9480, 0, 0xAABBCC, 0, edMaxSize,
editRU edit_box 180,240,85, 0xffffff, 0x6a9480, 0, 0xAABBCC, 0, edMaxSize, dataBuffer.3, mouse_dd, 0, edMax, edMax editRU edit_box 180,240,85, 0xffffff, 0x6a9480, 0, 0xAABBCC, 0, edMaxSize, dataBuffer.3, mouse_dd, 0, edMax, edMax
editRD edit_box 180,240,120, 0xffffff, 0x6a9480, 0, 0xAABBCC, 0, edMaxSize, dataBuffer.4, mouse_dd, 0, edMax, edMax editRD edit_box 180,240,120, 0xffffff, 0x6a9480, 0, 0xAABBCC, 0, edMaxSize, dataBuffer.4, mouse_dd, 0, edMax, edMax
;editboxes:
;editLU edit_box 180,Otstup,85,0xffffff,0x6a9480,0,0xAABBCC,0,edMaxSize,dataBuffer.1,ed_focus,edMax,edMax
;editLD edit_box 180,Otstup,120,0xffffff,0x6a9480,0,0xAABBCC,0,edMaxSize,dataBuffer.2,0,edMax,edMax
;editRU edit_box 180,240,85,0xffffff,0x6a9480,0,0xAABBCC,0,edMaxSize,dataBuffer.3,0,edMax,edMax
;editRD edit_box 180,240,120,0xffffff,0x6a9480,0,0xAABBCC,0,edMaxSize,dataBuffer.4,0,edMax,edMax
;editboxes_end:
;data_of_code dd 0
;mouse_flag dd 0x0
dataBuffer: dataBuffer:
.1: rb 512 .1: rb 512
.2: rb 512 .2: rb 512