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