2016-11-09 22:22:10 +01:00
|
|
|
|
;; h2d2b v0.5 big fonts by Leency ;;
|
|
|
|
|
;; 09.11.2016 ;;
|
|
|
|
|
|
2011-08-30 23:00:03 +02:00
|
|
|
|
;; h2d2b v0.4 use editbox by IgorA ;;
|
|
|
|
|
;; 30.08.2011 ;;
|
|
|
|
|
|
2011-08-21 16:10:02 +02:00
|
|
|
|
;; h2d2b v0.3 system colors by Leency ;;
|
|
|
|
|
;; 21.08.2011 ;;
|
|
|
|
|
|
2007-02-04 02:40:26 +01:00
|
|
|
|
;; hex2dec2bin 0.2 by Alexei Ershov ;;
|
|
|
|
|
;; 16.11.2006 ;;
|
|
|
|
|
|
2016-11-09 22:22:10 +01:00
|
|
|
|
WIN_W = 364
|
|
|
|
|
|
2011-08-21 16:10:02 +02:00
|
|
|
|
use32
|
2022-01-03 22:03:06 +01:00
|
|
|
|
org 0
|
2011-08-21 16:10:02 +02:00
|
|
|
|
db 'MENUET01'
|
2022-01-03 22:03:06 +01:00
|
|
|
|
dd 1,start,i_end,e_end,e_end,0,sys_path
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2011-08-21 16:10:02 +02:00
|
|
|
|
include '../../../proc32.inc'
|
2011-08-30 23:00:03 +02:00
|
|
|
|
include '../../../macros.inc' ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ᥬ<EFBFBD><E1A5AC><EFBFBD><EFBFBD>騪<EFBFBD><E9A8AA>!
|
2020-11-22 14:13:45 +01:00
|
|
|
|
include '../../../KOSfuncs.inc'
|
|
|
|
|
include '../../../load_lib.mac'
|
2011-08-30 23:00:03 +02:00
|
|
|
|
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
|
|
|
|
|
include 'lang.inc'
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2011-08-30 23:00:03 +02:00
|
|
|
|
@use_library
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2011-08-21 16:10:02 +02:00
|
|
|
|
start:
|
2011-08-30 23:00:03 +02:00
|
|
|
|
load_libraries l_libs_start,l_libs_end
|
|
|
|
|
;<3B><EFBFBD>ઠ <20><> <>쪮 㤠筮 <20><><EFBFBD>㧨<EFBFBD><E3A7A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD>
|
|
|
|
|
mov ebp,lib_0
|
|
|
|
|
cmp dword [ebp+ll_struc_size-4],0
|
|
|
|
|
jz @f
|
2022-01-03 22:03:06 +01:00
|
|
|
|
mcall SF_TERMINATE_PROCESS
|
2011-08-30 23:00:03 +02:00
|
|
|
|
@@:
|
2022-01-03 22:03:06 +01:00
|
|
|
|
mcall SF_SET_EVENTS_MASK,0x80000027
|
|
|
|
|
mcall SF_STYLE_SETTINGS, SSF_GET_COLORS, sys_colors, 40
|
2011-08-30 23:00:03 +02:00
|
|
|
|
edit_boxes_set_sys_color edit1,editboxes_end,sys_colors
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2011-08-30 23:00:03 +02:00
|
|
|
|
red:
|
2006-01-03 10:43:31 +01:00
|
|
|
|
call draw_window
|
|
|
|
|
|
2022-01-03 22:03:06 +01:00
|
|
|
|
align 4
|
2006-01-03 10:43:31 +01:00
|
|
|
|
still:
|
2022-01-03 22:03:06 +01:00
|
|
|
|
mcall SF_WAIT_EVENT
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2011-08-30 23:00:03 +02:00
|
|
|
|
cmp eax,1 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᮢ<EFBFBD><E1AEA2><EFBFBD> <20><><EFBFBD><EFBFBD> ?
|
|
|
|
|
je red ; <20> <20><> - <20><> <20><><EFBFBD><EFBFBD><EFBFBD> red
|
|
|
|
|
cmp eax,2 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ?
|
|
|
|
|
je key ; <20> <20><> - <20><> key
|
|
|
|
|
cmp eax,3 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ?
|
|
|
|
|
je button ; <20> <20><> - <20><> button
|
|
|
|
|
cmp eax,6
|
|
|
|
|
je mouse
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2011-08-30 23:00:03 +02:00
|
|
|
|
jmp still ; <20> <20><>㣮<EFBFBD> ᮡ<>⨥ - <20> <20><>砫<EFBFBD> 横<><E6A8AA>
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
|
2011-08-30 23:00:03 +02:00
|
|
|
|
key: ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2022-01-03 22:03:06 +01:00
|
|
|
|
mcall SF_GET_KEY
|
2011-09-16 20:43:27 +02:00
|
|
|
|
cmp ah,13 ;<3B><>ࠡ<EFBFBD>⪠ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Enter
|
|
|
|
|
je @f
|
|
|
|
|
stdcall [edit_box_key], dword edit1
|
|
|
|
|
jmp still
|
|
|
|
|
@@:
|
|
|
|
|
mov edi,string1
|
|
|
|
|
add edi,[edit1.size] ;<3B><>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> edi <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD>
|
|
|
|
|
jmp read_str
|
|
|
|
|
jmp still ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><>砫<EFBFBD> 横<><E6A8AA>
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
read_str:
|
|
|
|
|
dec edi
|
|
|
|
|
mov esi, string1
|
|
|
|
|
|
|
|
|
|
call GetBase
|
|
|
|
|
|
|
|
|
|
xor ecx, ecx
|
|
|
|
|
inc ecx ; ecx = 1
|
|
|
|
|
|
|
|
|
|
make_bin:
|
|
|
|
|
xor eax, eax
|
|
|
|
|
|
|
|
|
|
next_digit:
|
|
|
|
|
xor edx, edx
|
|
|
|
|
cmp edi, esi
|
|
|
|
|
jb .done
|
|
|
|
|
|
|
|
|
|
mov dl, [edi]
|
|
|
|
|
cmp dl, '-'
|
|
|
|
|
jne @f
|
|
|
|
|
neg eax
|
|
|
|
|
jmp .done
|
|
|
|
|
@@:
|
|
|
|
|
cmp dl, 'F'
|
|
|
|
|
jbe @f
|
|
|
|
|
and dl, 11011111b
|
|
|
|
|
@@:
|
|
|
|
|
sub dl, '0'
|
|
|
|
|
cmp dl, 9
|
|
|
|
|
jbe @f
|
|
|
|
|
sub dl, 'A'-'9'-1
|
|
|
|
|
@@:
|
|
|
|
|
cmp dl, bl
|
|
|
|
|
jb @f
|
2011-08-30 23:00:03 +02:00
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ࠡ<EFBFBD><E0A0A1><EFBFBD><EFBFBD><EFBFBD> <20>訡<EFBFBD><E8A8A1>
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
jmp .done
|
|
|
|
|
@@:
|
|
|
|
|
push ecx
|
|
|
|
|
xchg eax, ecx
|
|
|
|
|
mul edx ; edx:eax = eax * edx
|
|
|
|
|
add ecx, eax
|
|
|
|
|
pop eax
|
|
|
|
|
mul ebx
|
|
|
|
|
xchg eax, ecx
|
|
|
|
|
dec edi
|
|
|
|
|
jmp next_digit
|
|
|
|
|
|
|
|
|
|
.done:
|
2011-08-30 23:00:03 +02:00
|
|
|
|
mov [num], eax ; <20><><EFBFBD>࠭塞 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jmp red
|
|
|
|
|
|
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
|
2011-08-30 23:00:03 +02:00
|
|
|
|
button:
|
2022-01-03 22:03:06 +01:00
|
|
|
|
mcall SF_GET_BUTTON
|
2011-08-30 23:00:03 +02:00
|
|
|
|
cmp ah, 1 ; <20> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD> 1,
|
|
|
|
|
jne @f
|
2022-01-03 22:03:06 +01:00
|
|
|
|
mcall SF_TERMINATE_PROCESS
|
2011-08-30 23:00:03 +02:00
|
|
|
|
@@:
|
|
|
|
|
cmp ah, 2
|
|
|
|
|
jne @f
|
|
|
|
|
shl [num], 1
|
|
|
|
|
jmp red
|
|
|
|
|
@@:
|
|
|
|
|
cmp ah, 3
|
|
|
|
|
jne @f
|
|
|
|
|
shr [num], 1
|
|
|
|
|
jmp red
|
|
|
|
|
@@:
|
|
|
|
|
cmp ah, 4
|
|
|
|
|
jne @f
|
|
|
|
|
sar [num], 1
|
|
|
|
|
jmp red
|
|
|
|
|
@@:
|
|
|
|
|
cmp ah, 5
|
|
|
|
|
jne @f
|
|
|
|
|
mov edi,string1
|
|
|
|
|
add edi,[edit1.size] ;<3B><>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> edi <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD>
|
|
|
|
|
jmp read_str
|
|
|
|
|
;jmp red
|
|
|
|
|
@@:
|
|
|
|
|
jmp still
|
|
|
|
|
|
|
|
|
|
mouse:
|
|
|
|
|
stdcall [edit_box_mouse], edit1
|
|
|
|
|
jmp still
|
2007-02-04 02:40:26 +01:00
|
|
|
|
|
|
|
|
|
;------------------------------------------------
|
2022-01-03 22:03:06 +01:00
|
|
|
|
draw_window:
|
2007-02-04 02:40:26 +01:00
|
|
|
|
;------------------------------------------------
|
2022-01-03 22:03:06 +01:00
|
|
|
|
mcall SF_STYLE_SETTINGS, SSF_GET_COLORS, sys_colors, 40
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2022-01-03 22:03:06 +01:00
|
|
|
|
mcall SF_REDRAW, SSF_BEGIN_DRAW
|
2011-08-21 16:10:02 +02:00
|
|
|
|
mov edx, 0x14000000
|
|
|
|
|
or edx, [sys_colors.work]
|
|
|
|
|
;mov esi, 0x80000000
|
|
|
|
|
;or esi, [sys_colors.grab_text]
|
2022-01-03 22:03:06 +01:00
|
|
|
|
mcall SF_CREATE_WINDOW, 200*65536+WIN_W, 200*65536+179, ,,title
|
2011-08-21 16:10:02 +02:00
|
|
|
|
|
|
|
|
|
|
2022-01-03 22:03:06 +01:00
|
|
|
|
mcall SF_DEFINE_BUTTON, 15*65536+42,106*65536+ 21, 2, [sys_colors.work_button] ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> shl
|
2016-11-09 22:22:10 +01:00
|
|
|
|
mcall , 70*65536+42, , , ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> sal
|
|
|
|
|
mcall , (WIN_W-55)*65536+42, , 3, ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> shr
|
|
|
|
|
mcall ,(WIN_W-111)*65536+42, , 4, ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> sar
|
|
|
|
|
mcall , (WIN_W-72)*65536+58,145*65536+ 21, 5, ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ok
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2016-11-09 22:22:10 +01:00
|
|
|
|
mov ecx, 0x90000000
|
2011-08-21 16:10:02 +02:00
|
|
|
|
or ecx, [sys_colors.work_text]
|
2022-01-03 22:03:06 +01:00
|
|
|
|
mcall SF_DRAW_TEXT, 15*65536+30, , binstr,
|
2016-11-09 22:22:10 +01:00
|
|
|
|
mcall , 15*65536+46, , decstr,
|
|
|
|
|
mcall , 15*65536+62, ,sdecstr,
|
|
|
|
|
mcall , 15*65536+78, , hexstr,
|
|
|
|
|
mcall , 15*65536+150, , numstr,
|
2007-02-04 02:40:26 +01:00
|
|
|
|
|
2016-11-09 22:22:10 +01:00
|
|
|
|
mov ecx, 0x90000000
|
2011-08-21 16:10:02 +02:00
|
|
|
|
or ecx, [sys_colors.work_button_text]
|
2016-11-09 22:22:10 +01:00
|
|
|
|
mcall , 23*65536+109, , shl_sal_sar_shr_button_caption
|
|
|
|
|
mcall , (WIN_W-59)*65536+149, , Okstr,
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov ecx, [num]
|
|
|
|
|
|
2016-11-09 22:22:10 +01:00
|
|
|
|
mov esi, [sys_colors.work_text]
|
|
|
|
|
or esi, 0x90000000
|
|
|
|
|
|
2022-01-03 22:03:06 +01:00
|
|
|
|
mcall SF_DRAW_NUMBER, 10*65536, ,(WIN_W-92)*65536+62, ; 10-<2D><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2016-11-09 22:22:10 +01:00
|
|
|
|
BIN_LINE_BLOCK_W = 76
|
2022-01-03 22:03:06 +01:00
|
|
|
|
mcall SF_DRAW_NUMBER, 8*65536+512,,(WIN_W-BIN_LINE_BLOCK_W)*65536+30 ; 2-<2D><><EFBFBD>
|
2006-01-03 10:43:31 +01:00
|
|
|
|
ror ecx, 8
|
2016-11-09 22:22:10 +01:00
|
|
|
|
mov edx, (WIN_W-BIN_LINE_BLOCK_W*2)*65536+30
|
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
ror ecx, 8
|
2016-11-09 22:22:10 +01:00
|
|
|
|
mov edx, (WIN_W-BIN_LINE_BLOCK_W*3)*65536+30
|
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
ror ecx, 8
|
2016-11-09 22:22:10 +01:00
|
|
|
|
mov edx, (WIN_W-BIN_LINE_BLOCK_W*4)*65536+30
|
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
ror ecx, 8
|
2007-02-04 02:40:26 +01:00
|
|
|
|
mov [minus], '+'
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jnc @f
|
2007-02-04 02:40:26 +01:00
|
|
|
|
mov [minus], '-'
|
2006-01-03 10:43:31 +01:00
|
|
|
|
neg ecx
|
|
|
|
|
@@:
|
2016-11-09 22:22:10 +01:00
|
|
|
|
mcall , 10*65536, ,(WIN_W-92)*65536+46, ; 10-<2D><><EFBFBD>
|
|
|
|
|
mcall , 8*65536+256,,(WIN_W-76)*65536+78, ; 16-<2D><><EFBFBD>
|
2018-11-10 14:07:49 +01:00
|
|
|
|
mov ecx,esi
|
2022-01-03 22:03:06 +01:00
|
|
|
|
mcall SF_DRAW_TEXT, (WIN_W-102)*65536+61, , minus, 1
|
|
|
|
|
mcall SF_DRAW_LINE, 15*65536+WIN_W-15, 137*65536+137, [sys_colors.work_graph]
|
2011-08-30 23:00:03 +02:00
|
|
|
|
stdcall [edit_box_draw], edit1
|
2022-01-03 22:03:06 +01:00
|
|
|
|
mcall SF_REDRAW, SSF_END_DRAW
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;-------------------------------------------------
|
|
|
|
|
GetBase:
|
|
|
|
|
;-------------------------------------------------
|
|
|
|
|
mov ebx, 10
|
|
|
|
|
cmp edi, esi
|
|
|
|
|
jb .done
|
|
|
|
|
|
|
|
|
|
mov al, [edi]
|
|
|
|
|
cmp al, 'H'
|
|
|
|
|
jbe @f
|
|
|
|
|
and al, 11011111b
|
|
|
|
|
@@:
|
|
|
|
|
cmp al, 'H'
|
|
|
|
|
jne @f
|
|
|
|
|
mov ebx, 16
|
|
|
|
|
dec edi
|
|
|
|
|
jmp .done
|
|
|
|
|
|
|
|
|
|
@@:
|
|
|
|
|
cmp al, 'D'
|
|
|
|
|
jne @f
|
|
|
|
|
mov ebx, 10
|
|
|
|
|
dec edi
|
|
|
|
|
jmp .done
|
|
|
|
|
|
|
|
|
|
@@:
|
|
|
|
|
cmp al, 'B'
|
|
|
|
|
jne .done
|
|
|
|
|
mov ebx, 2
|
|
|
|
|
dec edi
|
|
|
|
|
|
|
|
|
|
.done:
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;-------------------------------------------------
|
|
|
|
|
string1:
|
|
|
|
|
db 34 dup(' ')
|
|
|
|
|
string1_end:
|
2007-02-04 02:40:26 +01:00
|
|
|
|
num dd 0
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
|
2016-11-09 22:22:10 +01:00
|
|
|
|
title db 'hex2dec2bin 0.5',0
|
2011-08-21 16:10:02 +02:00
|
|
|
|
minus db '-',0
|
2007-02-04 02:40:26 +01:00
|
|
|
|
hexstr db 'hex:',0
|
|
|
|
|
binstr db 'bin:',0
|
|
|
|
|
decstr db 'dec:',0
|
2011-08-30 23:00:03 +02:00
|
|
|
|
sdecstr db 'signed dec:',0
|
2016-11-09 22:22:10 +01:00
|
|
|
|
shl_sal_sar_shr_button_caption db 'shl sal sar shr',0
|
2011-08-21 16:10:02 +02:00
|
|
|
|
|
2011-08-30 23:00:03 +02:00
|
|
|
|
if lang eq ru
|
|
|
|
|
numstr db '<27><>:',0
|
|
|
|
|
Okstr db '<27><><EFBFBD><EFBFBD>',0
|
|
|
|
|
else
|
|
|
|
|
numstr db 'Number:',0
|
2016-11-09 22:22:10 +01:00
|
|
|
|
Okstr db 'Enter',0
|
2011-08-30 23:00:03 +02:00
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
mouse_dd dd 0
|
2018-10-11 13:02:39 +02:00
|
|
|
|
edit1 edit_box (WIN_W-67-82), 67, 146, 0xffffff, 0xff, 0x80ff, 0, 0x90000000, (string1_end-string1), string1 , mouse_dd, ed_focus+ed_always_focus
|
2012-06-30 01:18:27 +02:00
|
|
|
|
|
2011-08-30 23:00:03 +02:00
|
|
|
|
editboxes_end:
|
|
|
|
|
|
|
|
|
|
system_dir_0 db '/sys/lib/'
|
|
|
|
|
lib_name_0 db 'box_lib.obj',0
|
|
|
|
|
|
|
|
|
|
l_libs_start:
|
2020-11-22 14:13:45 +01:00
|
|
|
|
lib_0 l_libs lib_name_0, library_path, system_dir_0,import_box_lib
|
2011-08-30 23:00:03 +02:00
|
|
|
|
l_libs_end:
|
|
|
|
|
|
|
|
|
|
align 4
|
|
|
|
|
import_box_lib:
|
|
|
|
|
;dd sz_init1
|
|
|
|
|
edit_box_draw dd sz_edit_box_draw
|
|
|
|
|
edit_box_key dd sz_edit_box_key
|
|
|
|
|
edit_box_mouse dd sz_edit_box_mouse
|
|
|
|
|
;edit_box_set_text dd sz_edit_box_set_text
|
|
|
|
|
dd 0,0
|
|
|
|
|
;sz_init1 db 'lib_init',0
|
2022-01-03 22:03:06 +01:00
|
|
|
|
sz_edit_box_draw db 'edit_box_draw',0
|
2011-08-30 23:00:03 +02:00
|
|
|
|
sz_edit_box_key db 'edit_box_key',0
|
|
|
|
|
sz_edit_box_mouse db 'edit_box_mouse',0
|
|
|
|
|
;sz_edit_box_set_text db 'edit_box_set_text',0
|
|
|
|
|
|
2011-08-21 16:10:02 +02:00
|
|
|
|
i_end:
|
2020-11-22 14:13:45 +01:00
|
|
|
|
sys_colors system_colors
|
|
|
|
|
sys_path rb 4096
|
|
|
|
|
library_path rb 4096
|
|
|
|
|
rb 0x400 ; stack
|
|
|
|
|
e_end: ; <20><>⪠ <20><><EFBFBD><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC>
|