All: Update locale codes (Part 2) #76
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,275 +1,275 @@
|
||||
use32
|
||||
org 0x0
|
||||
db 'MENUET01'
|
||||
dd 0x01
|
||||
dd _preSTART
|
||||
dd I_END
|
||||
dd 0x4000
|
||||
dd 0x4000
|
||||
dd 0x0,0x0
|
||||
|
||||
include '../../macros.inc'
|
||||
include 'lang.inc'
|
||||
include 'draw_window.inc'
|
||||
include 'ball_operations.inc'
|
||||
include 'basic_alg.inc'
|
||||
|
||||
_preSTART:
|
||||
mcall 66, 1, 1 ;¯à¨¨¬ ¥¬ ᪠-ª®¤ë
|
||||
mcall 3 ;randomize
|
||||
ror eax, 16
|
||||
mov [TC_U_SYSTEM_RANDSEED], eax ;from PPro "system.inc"
|
||||
|
||||
new_game:
|
||||
;®¡ã«¥¨¥ ¬ âà¨æë
|
||||
mov eax, 0
|
||||
mov ecx, 81 / 4
|
||||
mov edi, lineBall
|
||||
rep stosd
|
||||
stosb
|
||||
|
||||
mov [score], 0
|
||||
mov [countAllBall], 0
|
||||
mov [current], 0
|
||||
@@:
|
||||
mov ebx, 7
|
||||
call random
|
||||
inc dl
|
||||
call add_new_ball
|
||||
call test_new_ball
|
||||
cmp [countAllBall], 5
|
||||
jb @b
|
||||
call generate_new___new_color
|
||||
|
||||
START:
|
||||
draw_window
|
||||
still:
|
||||
mcall 10
|
||||
|
||||
dec eax
|
||||
jz START ; ¯¥à¥à¨á®¢ âì ®ª®
|
||||
dec eax
|
||||
jnz button ;¥á«¨ ¥ ª« ¢¨è - § ç¨â ª®¯ª
|
||||
|
||||
key: ; ¦ ⨥ ª« ¢¨è¨
|
||||
mcall 2 ; ¯®«ãç ¥¬ ª®¤ ª« ¢¨è¨
|
||||
cmp ah, 60
|
||||
je new_game
|
||||
jmp still
|
||||
|
||||
button: ; ¦ ⨥ ª®¯ª¨
|
||||
mcall 17
|
||||
shr eax, 8
|
||||
cmp ax, 1 ; ¥á«¨ ª®¯ª ¢ë室 ?
|
||||
je .exit
|
||||
|
||||
;¯à®¢¥à¨¬, ¥ ¯ãáâ «¨ ª«¥âª
|
||||
mov edx, [current]
|
||||
test byte [eax + lineBall - 2], 0x7
|
||||
jz .blank
|
||||
|
||||
;¯à®¢¥à¨¬ ¥ ¡ë« «¨ íâ ª«¥âª 㦥 ¢ë¡à
|
||||
cmp eax, edx
|
||||
je .double_choice
|
||||
|
||||
mov [current], eax
|
||||
call choice_ball
|
||||
call paint_ball ;á ç « ¯à®à¨á㥬 ®¢ë© ¢ë¡à ë© è ਪ
|
||||
|
||||
test edx, edx ;cmp [current], 0
|
||||
jz still
|
||||
mov eax, edx
|
||||
|
||||
@@:
|
||||
call redraw_cell ; 㦥 ¯®â®¬ 㡥६ à ¬ªã ®â áâ ண®
|
||||
call paint_ball
|
||||
jmp still
|
||||
|
||||
.double_choice:
|
||||
mov [current], 0
|
||||
jmp @B
|
||||
|
||||
.blank: ; ¦ â ï ª®¯ª - ¯ãáâ
|
||||
test edx, edx ;cmp [current], 0
|
||||
jz still
|
||||
mov [dest], eax ;ª®¯ªã § 票ï -> ¢ [dest]
|
||||
mov eax, edx ;¯ à ¬¥âà ¢ eax
|
||||
call test_path ;¢ë§ë¢ ¥¬ ४ãàá¨î test_path
|
||||
call zero_cheked
|
||||
jnc still
|
||||
|
||||
;^^^^^^^^^^^^^^^^^ move_ball proc
|
||||
mov eax, [current]
|
||||
mov cl, byte [eax + lineBall - 2]
|
||||
mov byte [eax + lineBall - 2], 0
|
||||
mov eax, [dest]
|
||||
mov byte [eax + lineBall - 2], cl
|
||||
|
||||
mov eax, [current]
|
||||
call redraw_cell
|
||||
mov eax, [dest]
|
||||
call paint_ball
|
||||
mov [current], 0
|
||||
;^^^^^^^^^^^^^^^^^ move_ball endp
|
||||
|
||||
call find_line
|
||||
call vanish_balls
|
||||
call zero_cheked
|
||||
|
||||
cmp [countVanishBall], 0
|
||||
je new_3_balls
|
||||
movzx eax, [countVanishBall]
|
||||
inc eax
|
||||
add [score], eax
|
||||
sub [countAllBall], al
|
||||
call redraw_score
|
||||
jmp still
|
||||
|
||||
.exit:
|
||||
mcall -1 ;¢ë室¨¬
|
||||
|
||||
new_3_balls:
|
||||
|
||||
rept 3 num
|
||||
{
|
||||
mov dl, [newColor#num]
|
||||
call add_new_ball
|
||||
call test_new_ball
|
||||
cmp [countAllBall],81
|
||||
je .record_li
|
||||
}
|
||||
|
||||
call generate_new___new_color
|
||||
call paint_new_color
|
||||
jmp still
|
||||
|
||||
.record_li:
|
||||
mov eax, [score]
|
||||
cmp eax, [record]
|
||||
jbe still
|
||||
mov [record], eax
|
||||
jmp START
|
||||
|
||||
zero_cheked: ;®¡ã«¥¨¥ ¬ âà¨æë cheked
|
||||
pushfd
|
||||
mov eax, lineBall
|
||||
mov ecx, 81
|
||||
@@:
|
||||
and byte [eax], 0x7
|
||||
inc eax
|
||||
loop @B
|
||||
popfd
|
||||
ret
|
||||
|
||||
random: ; edx := random [0..(ebx-1)]
|
||||
mov eax, 134775813
|
||||
mul [TC_U_SYSTEM_RANDSEED]
|
||||
inc eax
|
||||
mov [ TC_U_SYSTEM_RANDSEED], eax
|
||||
xor edx, edx
|
||||
div ebx
|
||||
ret
|
||||
|
||||
generate_new___new_color:
|
||||
rept 3 num
|
||||
{
|
||||
mov ebx, 7
|
||||
call random
|
||||
inc dl
|
||||
mov [newColor#num], dl
|
||||
}
|
||||
ret
|
||||
|
||||
add_new_ball: ;¢ dl - 梥â è ਪ
|
||||
mov ebp, edx
|
||||
mov ebx, 81
|
||||
sub bl, [countAllBall]
|
||||
call random
|
||||
mov ecx, edx
|
||||
mov eax, lineBall-1
|
||||
inc ecx
|
||||
@@:
|
||||
inc eax
|
||||
test byte [eax], 0x7
|
||||
jnz @B
|
||||
loop @B
|
||||
|
||||
;⥯¥àì ã á ¢ eax - ¤à¥á 襣® è ਪ
|
||||
mov edx, ebp
|
||||
or byte [eax], dl
|
||||
inc [countAllBall]
|
||||
;¯®«ã稬 ID ª®¯ª¨
|
||||
sub eax, lineBall-2
|
||||
mov [dest], eax
|
||||
ret
|
||||
|
||||
test_new_ball:
|
||||
call paint_ball
|
||||
|
||||
call find_line
|
||||
call vanish_balls
|
||||
call zero_cheked
|
||||
|
||||
cmp [countVanishBall], 0
|
||||
je @F
|
||||
movzx eax, [countVanishBall]
|
||||
inc eax
|
||||
add [score], eax
|
||||
sub [countAllBall], al
|
||||
call redraw_score
|
||||
@@:
|
||||
ret
|
||||
|
||||
if lang eq ru_RU
|
||||
szTitle db '–¢¥âë¥ «¨¨¨ v 0.3',0
|
||||
szNewGame db 'F2 - ®¢ ï ¨£à ',0
|
||||
szRecord db '<27>¥ª®à¤',0
|
||||
szScore db 'Žçª¨',0
|
||||
else
|
||||
szTitle db 'Color lines v 0.3',0
|
||||
szNewGame db 'F2 - new game',0
|
||||
szRecord db 'Record',0
|
||||
szScore db 'Score',0
|
||||
end if
|
||||
|
||||
|
||||
blank = 0xB8C2D3
|
||||
brown = 0x804000
|
||||
red = 0xff0000
|
||||
yellow = 0xffff00
|
||||
green = 0x008000
|
||||
cyan = 0x00ffff
|
||||
blue = 0x0000ff
|
||||
purple = 0x800080
|
||||
|
||||
tableColor dd blank,brown,red,yellow,green,cyan,blue,purple
|
||||
|
||||
lineCoord:
|
||||
rept 9 coory:0
|
||||
{
|
||||
rept 9 coorx:0
|
||||
\{
|
||||
dw coorx*256+coory
|
||||
|
||||
\}
|
||||
}
|
||||
|
||||
record dd 25
|
||||
|
||||
lineBall db 81 dup ?
|
||||
score dd ?
|
||||
baseAddr dd ?
|
||||
current dd ?
|
||||
dest dd ?
|
||||
|
||||
newColor1 db ?
|
||||
newColor2 db ?
|
||||
newColor3 db ?
|
||||
|
||||
countVanishBall db ?
|
||||
countAllBall db ?
|
||||
|
||||
TC_U_SYSTEM_RANDSEED dd ?
|
||||
bitID dd ?
|
||||
|
||||
I_END:
|
||||
use32
|
||||
org 0x0
|
||||
db 'MENUET01'
|
||||
dd 0x01
|
||||
dd _preSTART
|
||||
dd I_END
|
||||
dd 0x4000
|
||||
dd 0x4000
|
||||
dd 0x0,0x0
|
||||
|
||||
include '../../macros.inc'
|
||||
include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US.
|
||||
include 'draw_window.inc'
|
||||
include 'ball_operations.inc'
|
||||
include 'basic_alg.inc'
|
||||
|
||||
_preSTART:
|
||||
mcall 66, 1, 1 ;¯à¨¨¬ ¥¬ ᪠-ª®¤ë
|
||||
mcall 3 ;randomize
|
||||
ror eax, 16
|
||||
mov [TC_U_SYSTEM_RANDSEED], eax ;from PPro "system.inc"
|
||||
|
||||
new_game:
|
||||
;®¡ã«¥¨¥ ¬ âà¨æë
|
||||
mov eax, 0
|
||||
mov ecx, 81 / 4
|
||||
mov edi, lineBall
|
||||
rep stosd
|
||||
stosb
|
||||
|
||||
mov [score], 0
|
||||
mov [countAllBall], 0
|
||||
mov [current], 0
|
||||
@@:
|
||||
mov ebx, 7
|
||||
call random
|
||||
inc dl
|
||||
call add_new_ball
|
||||
call test_new_ball
|
||||
cmp [countAllBall], 5
|
||||
jb @b
|
||||
call generate_new___new_color
|
||||
|
||||
START:
|
||||
draw_window
|
||||
still:
|
||||
mcall 10
|
||||
|
||||
dec eax
|
||||
jz START ; ¯¥à¥à¨á®¢ âì ®ª®
|
||||
dec eax
|
||||
jnz button ;¥á«¨ ¥ ª« ¢¨è - § ç¨â ª®¯ª
|
||||
|
||||
key: ; ¦ ⨥ ª« ¢¨è¨
|
||||
mcall 2 ; ¯®«ãç ¥¬ ª®¤ ª« ¢¨è¨
|
||||
cmp ah, 60
|
||||
je new_game
|
||||
jmp still
|
||||
|
||||
button: ; ¦ ⨥ ª®¯ª¨
|
||||
mcall 17
|
||||
shr eax, 8
|
||||
cmp ax, 1 ; ¥á«¨ ª®¯ª ¢ë室 ?
|
||||
je .exit
|
||||
|
||||
;¯à®¢¥à¨¬, ¥ ¯ãáâ «¨ ª«¥âª
|
||||
mov edx, [current]
|
||||
test byte [eax + lineBall - 2], 0x7
|
||||
jz .blank
|
||||
|
||||
;¯à®¢¥à¨¬ ¥ ¡ë« «¨ íâ ª«¥âª 㦥 ¢ë¡à
|
||||
cmp eax, edx
|
||||
je .double_choice
|
||||
|
||||
mov [current], eax
|
||||
call choice_ball
|
||||
call paint_ball ;á ç « ¯à®à¨á㥬 ®¢ë© ¢ë¡à ë© è ਪ
|
||||
|
||||
test edx, edx ;cmp [current], 0
|
||||
jz still
|
||||
mov eax, edx
|
||||
|
||||
@@:
|
||||
call redraw_cell ; 㦥 ¯®â®¬ 㡥६ à ¬ªã ®â áâ ண®
|
||||
call paint_ball
|
||||
jmp still
|
||||
|
||||
.double_choice:
|
||||
mov [current], 0
|
||||
jmp @B
|
||||
|
||||
.blank: ; ¦ â ï ª®¯ª - ¯ãáâ
|
||||
test edx, edx ;cmp [current], 0
|
||||
jz still
|
||||
mov [dest], eax ;ª®¯ªã § 票ï -> ¢ [dest]
|
||||
mov eax, edx ;¯ à ¬¥âà ¢ eax
|
||||
call test_path ;¢ë§ë¢ ¥¬ ४ãàá¨î test_path
|
||||
call zero_cheked
|
||||
jnc still
|
||||
|
||||
;^^^^^^^^^^^^^^^^^ move_ball proc
|
||||
mov eax, [current]
|
||||
mov cl, byte [eax + lineBall - 2]
|
||||
mov byte [eax + lineBall - 2], 0
|
||||
mov eax, [dest]
|
||||
mov byte [eax + lineBall - 2], cl
|
||||
|
||||
mov eax, [current]
|
||||
call redraw_cell
|
||||
mov eax, [dest]
|
||||
call paint_ball
|
||||
mov [current], 0
|
||||
;^^^^^^^^^^^^^^^^^ move_ball endp
|
||||
|
||||
call find_line
|
||||
call vanish_balls
|
||||
call zero_cheked
|
||||
|
||||
cmp [countVanishBall], 0
|
||||
je new_3_balls
|
||||
movzx eax, [countVanishBall]
|
||||
inc eax
|
||||
add [score], eax
|
||||
sub [countAllBall], al
|
||||
call redraw_score
|
||||
jmp still
|
||||
|
||||
.exit:
|
||||
mcall -1 ;¢ë室¨¬
|
||||
|
||||
new_3_balls:
|
||||
|
||||
rept 3 num
|
||||
{
|
||||
mov dl, [newColor#num]
|
||||
call add_new_ball
|
||||
call test_new_ball
|
||||
cmp [countAllBall],81
|
||||
je .record_li
|
||||
}
|
||||
|
||||
call generate_new___new_color
|
||||
call paint_new_color
|
||||
jmp still
|
||||
|
||||
.record_li:
|
||||
mov eax, [score]
|
||||
cmp eax, [record]
|
||||
jbe still
|
||||
mov [record], eax
|
||||
jmp START
|
||||
|
||||
zero_cheked: ;®¡ã«¥¨¥ ¬ âà¨æë cheked
|
||||
pushfd
|
||||
mov eax, lineBall
|
||||
mov ecx, 81
|
||||
@@:
|
||||
and byte [eax], 0x7
|
||||
inc eax
|
||||
loop @B
|
||||
popfd
|
||||
ret
|
||||
|
||||
random: ; edx := random [0..(ebx-1)]
|
||||
mov eax, 134775813
|
||||
mul [TC_U_SYSTEM_RANDSEED]
|
||||
inc eax
|
||||
mov [ TC_U_SYSTEM_RANDSEED], eax
|
||||
xor edx, edx
|
||||
div ebx
|
||||
ret
|
||||
|
||||
generate_new___new_color:
|
||||
rept 3 num
|
||||
{
|
||||
mov ebx, 7
|
||||
call random
|
||||
inc dl
|
||||
mov [newColor#num], dl
|
||||
}
|
||||
ret
|
||||
|
||||
add_new_ball: ;¢ dl - 梥â è ਪ
|
||||
mov ebp, edx
|
||||
mov ebx, 81
|
||||
sub bl, [countAllBall]
|
||||
call random
|
||||
mov ecx, edx
|
||||
mov eax, lineBall-1
|
||||
inc ecx
|
||||
@@:
|
||||
inc eax
|
||||
test byte [eax], 0x7
|
||||
jnz @B
|
||||
loop @B
|
||||
|
||||
;⥯¥àì ã á ¢ eax - ¤à¥á 襣® è ਪ
|
||||
mov edx, ebp
|
||||
or byte [eax], dl
|
||||
inc [countAllBall]
|
||||
;¯®«ã稬 ID ª®¯ª¨
|
||||
sub eax, lineBall-2
|
||||
mov [dest], eax
|
||||
ret
|
||||
|
||||
test_new_ball:
|
||||
call paint_ball
|
||||
|
||||
call find_line
|
||||
call vanish_balls
|
||||
call zero_cheked
|
||||
|
||||
cmp [countVanishBall], 0
|
||||
je @F
|
||||
movzx eax, [countVanishBall]
|
||||
inc eax
|
||||
add [score], eax
|
||||
sub [countAllBall], al
|
||||
call redraw_score
|
||||
@@:
|
||||
ret
|
||||
|
||||
if lang eq ru_RU
|
||||
szTitle db '–¢¥âë¥ «¨¨¨ v 0.3',0
|
||||
szNewGame db 'F2 - ®¢ ï ¨£à ',0
|
||||
szRecord db '<27>¥ª®à¤',0
|
||||
szScore db 'Žçª¨',0
|
||||
else ; Default to en_US
|
||||
szTitle db 'Color lines v 0.3',0
|
||||
szNewGame db 'F2 - new game',0
|
||||
szRecord db 'Record',0
|
||||
szScore db 'Score',0
|
||||
end if
|
||||
|
||||
|
||||
blank = 0xB8C2D3
|
||||
brown = 0x804000
|
||||
red = 0xff0000
|
||||
yellow = 0xffff00
|
||||
green = 0x008000
|
||||
cyan = 0x00ffff
|
||||
blue = 0x0000ff
|
||||
purple = 0x800080
|
||||
|
||||
tableColor dd blank,brown,red,yellow,green,cyan,blue,purple
|
||||
|
||||
lineCoord:
|
||||
rept 9 coory:0
|
||||
{
|
||||
rept 9 coorx:0
|
||||
\{
|
||||
dw coorx*256+coory
|
||||
|
||||
\}
|
||||
}
|
||||
|
||||
record dd 25
|
||||
|
||||
lineBall db 81 dup ?
|
||||
score dd ?
|
||||
baseAddr dd ?
|
||||
current dd ?
|
||||
dest dd ?
|
||||
|
||||
newColor1 db ?
|
||||
newColor2 db ?
|
||||
newColor3 db ?
|
||||
|
||||
countVanishBall db ?
|
||||
countAllBall db ?
|
||||
|
||||
TC_U_SYSTEM_RANDSEED dd ?
|
||||
bitID dd ?
|
||||
|
||||
I_END:
|
||||
|
@ -1,140 +1,142 @@
|
||||
; level format
|
||||
; [fx|fy]..[field cells x2]..[worm_count]..[worm_len][start cell #][body dirs x2]
|
||||
|
||||
; internal format
|
||||
; [stepptr]= worms #
|
||||
; area: [worm_len][start_cell #][end_cell #]..[dirs]..
|
||||
; [cur_step]: dragged worm pointer
|
||||
; [finish]: 0 - if head dragged, 1- if tail
|
||||
CZ_levelp:
|
||||
call get_xy_sf
|
||||
call LP_levelp.bit2
|
||||
mov dword[area],5;0
|
||||
ret
|
||||
|
||||
CZ_key:
|
||||
mov [jump],still
|
||||
cmp eax,176
|
||||
jb .ex
|
||||
cmp eax,179
|
||||
ja .ex
|
||||
mov ecx,dword[area]
|
||||
lea ebx,[eax-176]
|
||||
mov eax,[player]
|
||||
call check_bounds
|
||||
je .ex
|
||||
cmp ecx,5
|
||||
jne .novert
|
||||
.vert:
|
||||
add eax,[dirs+ebx*4]
|
||||
call check_bounds
|
||||
je .ex
|
||||
mov ecx,eax
|
||||
add ecx,[dirs+ebx*4]
|
||||
mov cl,[field+ecx]
|
||||
cmp cl,[field+eax]
|
||||
jne .ex
|
||||
mov dword[area],ebx
|
||||
.ok:
|
||||
mov [player],eax
|
||||
cmp eax,[finish]
|
||||
jne .jm
|
||||
cmp dword[area],5
|
||||
jne .jm
|
||||
mov [win_flag],1
|
||||
.jm:
|
||||
mov [jump],drw
|
||||
.ex:
|
||||
ret
|
||||
.novert:
|
||||
mov edx,ebx
|
||||
cmp edx,ecx ; the same dir
|
||||
jne .nosame
|
||||
add eax,[dirs+ebx*4]
|
||||
call check_bounds
|
||||
je .ex
|
||||
.set5:
|
||||
mov dword[area],5
|
||||
add eax,[dirs+ebx*4]
|
||||
jmp .ok
|
||||
.nosame:
|
||||
xor edx,11b
|
||||
cmp edx,ecx ; the opposite dir
|
||||
je .set5
|
||||
add eax,[dirs+ebx*4]
|
||||
mov ebx,ecx
|
||||
xor ecx,11b
|
||||
add eax,[dirs+ecx*4]
|
||||
jmp .vert
|
||||
|
||||
CZ_drawm:
|
||||
mov ecx,[cell_count]
|
||||
mov esi,field
|
||||
mov [sq_size],3
|
||||
.lp:
|
||||
push ecx
|
||||
movzx ebx,byte[field+ecx-1]
|
||||
shr ebx,6
|
||||
lea eax,[ecx-1]
|
||||
call get_xy
|
||||
add [lx],5-2 shl 16
|
||||
add [ly],5-2 shl 16
|
||||
mov edx,[f_colors+ebx*4]
|
||||
mcall 13,[lx],[ly]
|
||||
.no:
|
||||
pop ecx
|
||||
loop .lp
|
||||
|
||||
inc [sq_size]
|
||||
mov eax,[player]
|
||||
call get_xy
|
||||
xor edx,edx
|
||||
cmp dword[area],5
|
||||
je .vert
|
||||
push [lx]
|
||||
push [ly]
|
||||
mov edx,dword[area]
|
||||
add eax,[dirs+edx*4]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly]
|
||||
pop [ly]
|
||||
pop [lx]
|
||||
.vert:
|
||||
mcall 13,[lx],[ly]
|
||||
add [sq_size],5
|
||||
mov eax,[finish]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xffffff
|
||||
|
||||
ret
|
||||
|
||||
|
||||
CZ_level:
|
||||
file 'colzone.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
CZ_help mstr \
|
||||
'—¥àë© ¡«®ª ¨§ 2 ªã¡¨ª®¢ á⮨â à áªà 襮©',\
|
||||
'ª«¥âç ⮩ ¤®áª¥. ‚ è § ¤ ç - ¯¥à¥ª â¨âì ¥£® ',\
|
||||
'ª«¥âªã á ¡¥«ë¬ ª¢ ¤à ⨪®¬. <20>«®ª ç¨ ¥â áâ®ï ¨',\
|
||||
'¤®«¦¥ § ª®ç¨âì ⮦¥ ¢ ¢¥à⨪ «ì®¬ ¯®«®¦¥¨¨.',\
|
||||
'<27>¥«ì§ï ¢ëª âë¢ âì ¥£® § ¯à¥¤¥«ë á¥âª¨ ¨ ᢥàå',\
|
||||
'⮣® - ªã¡¨ª¨ ¡«®ª ¤®«¦ë ¢á¥£¤ «®¦¨âìáï ',\
|
||||
'ª«¥âª¨ ®¤¨ ª®¢®£® 梥â . <20>«®ª ¥ ®â®¡à ¦¥ ¢ 3D,',\
|
||||
'¯®íâ®¬ã ‚ë ¢¨¤¨â¥ «¨èì ¥£® ¯à®¥ªæ¨î.','',\
|
||||
'http://www.clickmazes.com'
|
||||
else
|
||||
CZ_help mstr \
|
||||
'A black block, made of two black cubes stuck',\
|
||||
'together, sits on a coloured grid. Your challenge',\
|
||||
'is to roll the black block to its target',\
|
||||
'position, which is marked with a small white',\
|
||||
'square. The block starts on one end (vertical)',\
|
||||
'and must also finish in this position. The block',\
|
||||
'is not permitted to roll off the grid and, in',\
|
||||
'addition, the block must always lie entirely',\
|
||||
'within one colour-zone. Note the block is not',\
|
||||
'displayed in 3D, in effect you see only its',\
|
||||
'shadow.','',\
|
||||
'http://www.clickmazes.com'
|
||||
end if
|
||||
; Language support for locales: ru_RU (CP866), en_US.
|
||||
|
||||
; level format
|
||||
; [fx|fy]..[field cells x2]..[worm_count]..[worm_len][start cell #][body dirs x2]
|
||||
|
||||
; internal format
|
||||
; [stepptr]= worms #
|
||||
; area: [worm_len][start_cell #][end_cell #]..[dirs]..
|
||||
; [cur_step]: dragged worm pointer
|
||||
; [finish]: 0 - if head dragged, 1- if tail
|
||||
CZ_levelp:
|
||||
call get_xy_sf
|
||||
call LP_levelp.bit2
|
||||
mov dword[area],5;0
|
||||
ret
|
||||
|
||||
CZ_key:
|
||||
mov [jump],still
|
||||
cmp eax,176
|
||||
jb .ex
|
||||
cmp eax,179
|
||||
ja .ex
|
||||
mov ecx,dword[area]
|
||||
lea ebx,[eax-176]
|
||||
mov eax,[player]
|
||||
call check_bounds
|
||||
je .ex
|
||||
cmp ecx,5
|
||||
jne .novert
|
||||
.vert:
|
||||
add eax,[dirs+ebx*4]
|
||||
call check_bounds
|
||||
je .ex
|
||||
mov ecx,eax
|
||||
add ecx,[dirs+ebx*4]
|
||||
mov cl,[field+ecx]
|
||||
cmp cl,[field+eax]
|
||||
jne .ex
|
||||
mov dword[area],ebx
|
||||
.ok:
|
||||
mov [player],eax
|
||||
cmp eax,[finish]
|
||||
jne .jm
|
||||
cmp dword[area],5
|
||||
jne .jm
|
||||
mov [win_flag],1
|
||||
.jm:
|
||||
mov [jump],drw
|
||||
.ex:
|
||||
ret
|
||||
.novert:
|
||||
mov edx,ebx
|
||||
cmp edx,ecx ; the same dir
|
||||
jne .nosame
|
||||
add eax,[dirs+ebx*4]
|
||||
call check_bounds
|
||||
je .ex
|
||||
.set5:
|
||||
mov dword[area],5
|
||||
add eax,[dirs+ebx*4]
|
||||
jmp .ok
|
||||
.nosame:
|
||||
xor edx,11b
|
||||
cmp edx,ecx ; the opposite dir
|
||||
je .set5
|
||||
add eax,[dirs+ebx*4]
|
||||
mov ebx,ecx
|
||||
xor ecx,11b
|
||||
add eax,[dirs+ecx*4]
|
||||
jmp .vert
|
||||
|
||||
CZ_drawm:
|
||||
mov ecx,[cell_count]
|
||||
mov esi,field
|
||||
mov [sq_size],3
|
||||
.lp:
|
||||
push ecx
|
||||
movzx ebx,byte[field+ecx-1]
|
||||
shr ebx,6
|
||||
lea eax,[ecx-1]
|
||||
call get_xy
|
||||
add [lx],5-2 shl 16
|
||||
add [ly],5-2 shl 16
|
||||
mov edx,[f_colors+ebx*4]
|
||||
mcall 13,[lx],[ly]
|
||||
.no:
|
||||
pop ecx
|
||||
loop .lp
|
||||
|
||||
inc [sq_size]
|
||||
mov eax,[player]
|
||||
call get_xy
|
||||
xor edx,edx
|
||||
cmp dword[area],5
|
||||
je .vert
|
||||
push [lx]
|
||||
push [ly]
|
||||
mov edx,dword[area]
|
||||
add eax,[dirs+edx*4]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly]
|
||||
pop [ly]
|
||||
pop [lx]
|
||||
.vert:
|
||||
mcall 13,[lx],[ly]
|
||||
add [sq_size],5
|
||||
mov eax,[finish]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xffffff
|
||||
|
||||
ret
|
||||
|
||||
|
||||
CZ_level:
|
||||
file 'colzone.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
CZ_help mstr \
|
||||
'—¥àë© ¡«®ª ¨§ 2 ªã¡¨ª®¢ á⮨â à áªà 襮©',\
|
||||
'ª«¥âç ⮩ ¤®áª¥. ‚ è § ¤ ç - ¯¥à¥ª â¨âì ¥£® ',\
|
||||
'ª«¥âªã á ¡¥«ë¬ ª¢ ¤à ⨪®¬. <20>«®ª ç¨ ¥â áâ®ï ¨',\
|
||||
'¤®«¦¥ § ª®ç¨âì ⮦¥ ¢ ¢¥à⨪ «ì®¬ ¯®«®¦¥¨¨.',\
|
||||
'<27>¥«ì§ï ¢ëª âë¢ âì ¥£® § ¯à¥¤¥«ë á¥âª¨ ¨ ᢥàå',\
|
||||
'⮣® - ªã¡¨ª¨ ¡«®ª ¤®«¦ë ¢á¥£¤ «®¦¨âìáï ',\
|
||||
'ª«¥âª¨ ®¤¨ ª®¢®£® 梥â . <20>«®ª ¥ ®â®¡à ¦¥ ¢ 3D,',\
|
||||
'¯®íâ®¬ã ‚ë ¢¨¤¨â¥ «¨èì ¥£® ¯à®¥ªæ¨î.','',\
|
||||
'http://www.clickmazes.com'
|
||||
else ; Default to en_US
|
||||
CZ_help mstr \
|
||||
'A black block, made of two black cubes stuck',\
|
||||
'together, sits on a coloured grid. Your challenge',\
|
||||
'is to roll the black block to its target',\
|
||||
'position, which is marked with a small white',\
|
||||
'square. The block starts on one end (vertical)',\
|
||||
'and must also finish in this position. The block',\
|
||||
'is not permitted to roll off the grid and, in',\
|
||||
'addition, the block must always lie entirely',\
|
||||
'within one colour-zone. Note the block is not',\
|
||||
'displayed in 3D, in effect you see only its',\
|
||||
'shadow.','',\
|
||||
'http://www.clickmazes.com'
|
||||
end if
|
||||
|
@ -1,66 +1,68 @@
|
||||
; level format
|
||||
; [fx|fy][blue xy][red xy]..[maze walls]
|
||||
|
||||
; internal format
|
||||
; [player]= blue
|
||||
; [finish]= red
|
||||
|
||||
|
||||
CSTEP_key:
|
||||
cmp eax,176
|
||||
jb .ex
|
||||
cmp eax,179
|
||||
ja .ex
|
||||
mov esi,area
|
||||
inc esi
|
||||
lea ebx,[eax-176]
|
||||
mov [jump],still
|
||||
mov eax,[player]
|
||||
call check_move
|
||||
jc .ex
|
||||
add eax,[dirs+ebx*4]
|
||||
mov edx,eax
|
||||
.nom1:
|
||||
mov eax,[finish]
|
||||
xor ebx,11b
|
||||
call check_move
|
||||
jc .ex
|
||||
add eax,[dirs+ebx*4]
|
||||
mov [finish],eax
|
||||
mov [player],edx
|
||||
mov [jump],drw
|
||||
cmp eax,edx
|
||||
jnz .ex
|
||||
mov [win_flag],1
|
||||
.ex:
|
||||
ret
|
||||
|
||||
CSTEP_drawm:
|
||||
mov eax,[player]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff0000
|
||||
mov eax,[finish]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff
|
||||
ret
|
||||
|
||||
CSTEP_level:
|
||||
file 'cstep.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
CSTEP_help mstr \
|
||||
'‘®¥¤¨¨â¥ ªà áë© ¨ ᨨ© ¡«®ª¨ ¯ã⥬ ã¯à ¢«¥¨ï',\
|
||||
'®¤¨¬ ªà áë¬ ¡«®ª®¬. ‘¨¨© ¡«®ª á«¥¤ã¥â § ',\
|
||||
'ªà áë¬, ® ¤¢¨¦¥âáï ¢ ¯àאַ ¯à®â¨¢®¯®«®¦®¬',\
|
||||
' ¯à ¢«¥¨¨. •®¤ à §à¥è¥ ⮫쪮 ¢ á«ãç ¥',\
|
||||
'®âáãâáâ¢¨ï ¯à¥¯ïâá⢨© ¤«ï ®¡®¨å ¡«®ª®¢.','',\
|
||||
'http://www.clickmazes.com'
|
||||
else
|
||||
CSTEP_help mstr \
|
||||
'Unite the red and blue dots by moving just the',\
|
||||
'red dot. The blue dot follows the red dot, but',\
|
||||
'moves in exactly in the opposite direction. A',\
|
||||
'move is only permitted if the path is clear for',\
|
||||
'both dots.','',\
|
||||
'http://www.clickmazes.com'
|
||||
end if
|
||||
; Language support for locales: ru_RU (CP866), en_US.
|
||||
|
||||
; level format
|
||||
; [fx|fy][blue xy][red xy]..[maze walls]
|
||||
|
||||
; internal format
|
||||
; [player]= blue
|
||||
; [finish]= red
|
||||
|
||||
|
||||
CSTEP_key:
|
||||
cmp eax,176
|
||||
jb .ex
|
||||
cmp eax,179
|
||||
ja .ex
|
||||
mov esi,area
|
||||
inc esi
|
||||
lea ebx,[eax-176]
|
||||
mov [jump],still
|
||||
mov eax,[player]
|
||||
call check_move
|
||||
jc .ex
|
||||
add eax,[dirs+ebx*4]
|
||||
mov edx,eax
|
||||
.nom1:
|
||||
mov eax,[finish]
|
||||
xor ebx,11b
|
||||
call check_move
|
||||
jc .ex
|
||||
add eax,[dirs+ebx*4]
|
||||
mov [finish],eax
|
||||
mov [player],edx
|
||||
mov [jump],drw
|
||||
cmp eax,edx
|
||||
jnz .ex
|
||||
mov [win_flag],1
|
||||
.ex:
|
||||
ret
|
||||
|
||||
CSTEP_drawm:
|
||||
mov eax,[player]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff0000
|
||||
mov eax,[finish]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff
|
||||
ret
|
||||
|
||||
CSTEP_level:
|
||||
file 'cstep.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
CSTEP_help mstr \
|
||||
'‘®¥¤¨¨â¥ ªà áë© ¨ ᨨ© ¡«®ª¨ ¯ã⥬ ã¯à ¢«¥¨ï',\
|
||||
'®¤¨¬ ªà áë¬ ¡«®ª®¬. ‘¨¨© ¡«®ª á«¥¤ã¥â § ',\
|
||||
'ªà áë¬, ® ¤¢¨¦¥âáï ¢ ¯àאַ ¯à®â¨¢®¯®«®¦®¬',\
|
||||
' ¯à ¢«¥¨¨. •®¤ à §à¥è¥ ⮫쪮 ¢ á«ãç ¥',\
|
||||
'®âáãâáâ¢¨ï ¯à¥¯ïâá⢨© ¤«ï ®¡®¨å ¡«®ª®¢.','',\
|
||||
'http://www.clickmazes.com'
|
||||
else ; Default to en_US
|
||||
CSTEP_help mstr \
|
||||
'Unite the red and blue dots by moving just the',\
|
||||
'red dot. The blue dot follows the red dot, but',\
|
||||
'moves in exactly in the opposite direction. A',\
|
||||
'move is only permitted if the path is clear for',\
|
||||
'both dots.','',\
|
||||
'http://www.clickmazes.com'
|
||||
end if
|
||||
|
@ -1,197 +1,199 @@
|
||||
FH_levelp:
|
||||
mcall 40,100111b
|
||||
call get_xy_sf
|
||||
call erase_field
|
||||
sub esi,2
|
||||
mov [levptr],esi
|
||||
movzx ecx,byte[esi-2]
|
||||
sub ecx,2
|
||||
xor eax,eax
|
||||
.lp:
|
||||
lodsb
|
||||
mov byte[field+eax],-1
|
||||
loop .lp
|
||||
mov dword[player],-1
|
||||
mov [win_flag],3
|
||||
ret
|
||||
|
||||
FH_key:
|
||||
cmp eax,-1
|
||||
je FH_mouse
|
||||
cmp eax,8
|
||||
jne .nobsp
|
||||
cmp [stepptr],0
|
||||
jne .no1st
|
||||
mov [jump],run.game
|
||||
ret
|
||||
.no1st:
|
||||
mov [win_flag],0
|
||||
sub [cur_step],2
|
||||
mov esi,[cur_step]
|
||||
mov edi,[finish]
|
||||
mov eax,3
|
||||
movzx ebx,byte[esi]
|
||||
sub eax,ebx
|
||||
movzx ecx,byte[esi+1]
|
||||
.lp0:
|
||||
and byte[field+edi],0
|
||||
add edi,[dirs+eax*4]
|
||||
loop .lp0
|
||||
mov [finish],edi
|
||||
dec [stepptr]
|
||||
ret
|
||||
.nobsp:
|
||||
cmp eax,176
|
||||
jb .ex
|
||||
cmp eax,179
|
||||
ja .ex
|
||||
sub eax,176
|
||||
jmp FH_mouse.fromkey
|
||||
.ex:
|
||||
ret
|
||||
|
||||
FH_drawm:
|
||||
mov ecx,[cell_count]
|
||||
.lp:
|
||||
push ecx
|
||||
movzx ebx,byte[field+ecx-1]
|
||||
test ebx,ebx
|
||||
jz .no
|
||||
lea eax,[ecx-1]
|
||||
call get_xy
|
||||
mov edx,0
|
||||
cmp ebx,0xf
|
||||
jne .stable
|
||||
mov edx,0x909090
|
||||
.stable:
|
||||
mcall 13,[lx],[ly]
|
||||
.no:
|
||||
pop ecx
|
||||
loop .lp
|
||||
|
||||
mov eax,[player]
|
||||
cmp eax,-1
|
||||
je .ex
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff00
|
||||
mov eax,[finish]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff0000
|
||||
|
||||
mov ecx,[stepptr]
|
||||
jecxz .ex
|
||||
mov ebx,area
|
||||
mov edi,[player]
|
||||
mov edx,0xffffff
|
||||
.lp3:
|
||||
push ecx
|
||||
mov esi,edi
|
||||
movzx eax,byte[ebx]
|
||||
movzx ecx,byte[ebx+1]
|
||||
add ebx,2
|
||||
.lp2:
|
||||
add edi,[dirs+eax*4]
|
||||
loop .lp2
|
||||
call getline
|
||||
pop ecx
|
||||
loop .lp3
|
||||
.ex:
|
||||
ret
|
||||
|
||||
FH_mouse:
|
||||
mov [jump],drw;red
|
||||
call get_last_mclick
|
||||
cmp byte[field+ebx],0
|
||||
jne .ex
|
||||
cmp dword[player],-1
|
||||
jne .nostart
|
||||
mov dword[player],ebx
|
||||
mov byte[field+ebx],0xf
|
||||
mov [finish],ebx
|
||||
and [win_flag],0
|
||||
mov [cur_step],area
|
||||
and [stepptr],0
|
||||
ret
|
||||
.nostart:
|
||||
mov eax,[finish]
|
||||
call get_offset
|
||||
cmp eax,-1
|
||||
je .ex
|
||||
.fromkey:
|
||||
xor ecx,ecx
|
||||
mov edx,eax
|
||||
mov esi,[finish]
|
||||
.lp:
|
||||
add esi,[dirs+edx*4]
|
||||
cmp byte[field+esi],0
|
||||
jnz .exlp
|
||||
mov eax,[finish]
|
||||
mov ebx,esi
|
||||
call get_offset
|
||||
cmp eax,edx
|
||||
jne .exlp
|
||||
mov byte[field+esi],0xf
|
||||
inc ecx
|
||||
mov [finish],esi
|
||||
jmp .lp
|
||||
|
||||
.exlp:
|
||||
jecxz .ex
|
||||
mov eax,edx
|
||||
mov edi,[cur_step]
|
||||
stosb
|
||||
mov [edi],cl
|
||||
inc edi
|
||||
mov [cur_step],edi
|
||||
inc [stepptr]
|
||||
mov edi,field
|
||||
mov ecx,[cell_count]
|
||||
xor eax,eax
|
||||
repne scasb
|
||||
je .ch_deadend
|
||||
mov [win_flag],1
|
||||
.ex:
|
||||
ret
|
||||
.ch_deadend:
|
||||
mov ecx,4
|
||||
mov edx,dirs
|
||||
.lpp:
|
||||
mov eax,[finish]
|
||||
mov ebx,[edx]
|
||||
add ebx,eax
|
||||
push ebx
|
||||
call get_offset
|
||||
pop ebx
|
||||
cmp eax,-1
|
||||
je .nxtlp
|
||||
cmp byte[field+ebx],0
|
||||
jz .ex
|
||||
.nxtlp:
|
||||
add edx,4
|
||||
loop .lpp
|
||||
mov [win_flag],4
|
||||
ret
|
||||
|
||||
FH_level:
|
||||
file 'fhouse.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
FH_help mstr \
|
||||
'‚ § ¤ ¨¨ ©¤¨â¥ ç «ìãî ª«¥âªã ¨ ¯à®¢¥¤¨â¥',\
|
||||
'«¨¨î, ª®â®à ï ¯à®å®¤¨â ç¥à¥§ ¯ãáâë¥ ª«¥âª¨ ¯®',\
|
||||
'®¤®¬ã à §ã.',\
|
||||
' Š ¦¤ë© à § ªà áë© ª¢ ¤à â ¤¢¨£ ¥âáï ¯àאַ,',\
|
||||
'®áâ ¢«¨¢ ïáì ⮫쪮 ã ªà ï, ¯¥à¥¤ ç¥à묨',\
|
||||
'ª¢ ¤à â ¬¨ ¨«¨ 㦥 ¯®á¥é¥ë¬¨ ª«¥âª ¬¨.','',\
|
||||
'http://www.clickmazes.com'
|
||||
else
|
||||
FH_help mstr \
|
||||
'For each puzzle find the starting square and draw',\
|
||||
'a path moving horizontally and vertically that',\
|
||||
'passes through each open square exactly once.','',\
|
||||
'At each move the red runner will always run',\
|
||||
'straight, as far as possible, stopping only when',\
|
||||
"blocked by the grid's edge, a black square, or a",\
|
||||
'square already visited.','',\
|
||||
'http://www.clickmazes.com'
|
||||
end if
|
||||
; Language support for locales: ru_RU (CP866), en_US.
|
||||
|
||||
FH_levelp:
|
||||
mcall 40,100111b
|
||||
call get_xy_sf
|
||||
call erase_field
|
||||
sub esi,2
|
||||
mov [levptr],esi
|
||||
movzx ecx,byte[esi-2]
|
||||
sub ecx,2
|
||||
xor eax,eax
|
||||
.lp:
|
||||
lodsb
|
||||
mov byte[field+eax],-1
|
||||
loop .lp
|
||||
mov dword[player],-1
|
||||
mov [win_flag],3
|
||||
ret
|
||||
|
||||
FH_key:
|
||||
cmp eax,-1
|
||||
je FH_mouse
|
||||
cmp eax,8
|
||||
jne .nobsp
|
||||
cmp [stepptr],0
|
||||
jne .no1st
|
||||
mov [jump],run.game
|
||||
ret
|
||||
.no1st:
|
||||
mov [win_flag],0
|
||||
sub [cur_step],2
|
||||
mov esi,[cur_step]
|
||||
mov edi,[finish]
|
||||
mov eax,3
|
||||
movzx ebx,byte[esi]
|
||||
sub eax,ebx
|
||||
movzx ecx,byte[esi+1]
|
||||
.lp0:
|
||||
and byte[field+edi],0
|
||||
add edi,[dirs+eax*4]
|
||||
loop .lp0
|
||||
mov [finish],edi
|
||||
dec [stepptr]
|
||||
ret
|
||||
.nobsp:
|
||||
cmp eax,176
|
||||
jb .ex
|
||||
cmp eax,179
|
||||
ja .ex
|
||||
sub eax,176
|
||||
jmp FH_mouse.fromkey
|
||||
.ex:
|
||||
ret
|
||||
|
||||
FH_drawm:
|
||||
mov ecx,[cell_count]
|
||||
.lp:
|
||||
push ecx
|
||||
movzx ebx,byte[field+ecx-1]
|
||||
test ebx,ebx
|
||||
jz .no
|
||||
lea eax,[ecx-1]
|
||||
call get_xy
|
||||
mov edx,0
|
||||
cmp ebx,0xf
|
||||
jne .stable
|
||||
mov edx,0x909090
|
||||
.stable:
|
||||
mcall 13,[lx],[ly]
|
||||
.no:
|
||||
pop ecx
|
||||
loop .lp
|
||||
|
||||
mov eax,[player]
|
||||
cmp eax,-1
|
||||
je .ex
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff00
|
||||
mov eax,[finish]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff0000
|
||||
|
||||
mov ecx,[stepptr]
|
||||
jecxz .ex
|
||||
mov ebx,area
|
||||
mov edi,[player]
|
||||
mov edx,0xffffff
|
||||
.lp3:
|
||||
push ecx
|
||||
mov esi,edi
|
||||
movzx eax,byte[ebx]
|
||||
movzx ecx,byte[ebx+1]
|
||||
add ebx,2
|
||||
.lp2:
|
||||
add edi,[dirs+eax*4]
|
||||
loop .lp2
|
||||
call getline
|
||||
pop ecx
|
||||
loop .lp3
|
||||
.ex:
|
||||
ret
|
||||
|
||||
FH_mouse:
|
||||
mov [jump],drw;red
|
||||
call get_last_mclick
|
||||
cmp byte[field+ebx],0
|
||||
jne .ex
|
||||
cmp dword[player],-1
|
||||
jne .nostart
|
||||
mov dword[player],ebx
|
||||
mov byte[field+ebx],0xf
|
||||
mov [finish],ebx
|
||||
and [win_flag],0
|
||||
mov [cur_step],area
|
||||
and [stepptr],0
|
||||
ret
|
||||
.nostart:
|
||||
mov eax,[finish]
|
||||
call get_offset
|
||||
cmp eax,-1
|
||||
je .ex
|
||||
.fromkey:
|
||||
xor ecx,ecx
|
||||
mov edx,eax
|
||||
mov esi,[finish]
|
||||
.lp:
|
||||
add esi,[dirs+edx*4]
|
||||
cmp byte[field+esi],0
|
||||
jnz .exlp
|
||||
mov eax,[finish]
|
||||
mov ebx,esi
|
||||
call get_offset
|
||||
cmp eax,edx
|
||||
jne .exlp
|
||||
mov byte[field+esi],0xf
|
||||
inc ecx
|
||||
mov [finish],esi
|
||||
jmp .lp
|
||||
|
||||
.exlp:
|
||||
jecxz .ex
|
||||
mov eax,edx
|
||||
mov edi,[cur_step]
|
||||
stosb
|
||||
mov [edi],cl
|
||||
inc edi
|
||||
mov [cur_step],edi
|
||||
inc [stepptr]
|
||||
mov edi,field
|
||||
mov ecx,[cell_count]
|
||||
xor eax,eax
|
||||
repne scasb
|
||||
je .ch_deadend
|
||||
mov [win_flag],1
|
||||
.ex:
|
||||
ret
|
||||
.ch_deadend:
|
||||
mov ecx,4
|
||||
mov edx,dirs
|
||||
.lpp:
|
||||
mov eax,[finish]
|
||||
mov ebx,[edx]
|
||||
add ebx,eax
|
||||
push ebx
|
||||
call get_offset
|
||||
pop ebx
|
||||
cmp eax,-1
|
||||
je .nxtlp
|
||||
cmp byte[field+ebx],0
|
||||
jz .ex
|
||||
.nxtlp:
|
||||
add edx,4
|
||||
loop .lpp
|
||||
mov [win_flag],4
|
||||
ret
|
||||
|
||||
FH_level:
|
||||
file 'fhouse.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
FH_help mstr \
|
||||
'‚ § ¤ ¨¨ ©¤¨â¥ ç «ìãî ª«¥âªã ¨ ¯à®¢¥¤¨â¥',\
|
||||
'«¨¨î, ª®â®à ï ¯à®å®¤¨â ç¥à¥§ ¯ãáâë¥ ª«¥âª¨ ¯®',\
|
||||
'®¤®¬ã à §ã.',\
|
||||
' Š ¦¤ë© à § ªà áë© ª¢ ¤à â ¤¢¨£ ¥âáï ¯àאַ,',\
|
||||
'®áâ ¢«¨¢ ïáì ⮫쪮 ã ªà ï, ¯¥à¥¤ ç¥à묨',\
|
||||
'ª¢ ¤à â ¬¨ ¨«¨ 㦥 ¯®á¥é¥ë¬¨ ª«¥âª ¬¨.','',\
|
||||
'http://www.clickmazes.com'
|
||||
else ; Default to en_US
|
||||
FH_help mstr \
|
||||
'For each puzzle find the starting square and draw',\
|
||||
'a path moving horizontally and vertically that',\
|
||||
'passes through each open square exactly once.','',\
|
||||
'At each move the red runner will always run',\
|
||||
'straight, as far as possible, stopping only when',\
|
||||
"blocked by the grid's edge, a black square, or a",\
|
||||
'square already visited.','',\
|
||||
'http://www.clickmazes.com'
|
||||
end if
|
||||
|
@ -1,245 +1,247 @@
|
||||
LP_levelp:
|
||||
mcall 40,100111b
|
||||
inc [drag_flag]
|
||||
lodsb
|
||||
lodsw
|
||||
mov byte[fx],al
|
||||
mov byte[fy],ah
|
||||
and dword[player],0
|
||||
and dword[finish],0
|
||||
call get_xy_sf.count
|
||||
call erase_field
|
||||
; mov [levptr],esi
|
||||
.bit2:
|
||||
mov edx,8/2
|
||||
mov edi,field
|
||||
lodsb
|
||||
mov ecx,[cell_count]
|
||||
.lp:
|
||||
mov bl,al
|
||||
rol al,2
|
||||
and bl,11000000b
|
||||
mov [edi],bl
|
||||
inc edi
|
||||
dec edx
|
||||
test edx,edx
|
||||
jnz .nxt
|
||||
mov edx,8/2
|
||||
lodsb
|
||||
.nxt:
|
||||
loop .lp
|
||||
ret
|
||||
|
||||
LP_key:
|
||||
cmp eax,0
|
||||
jl LP_mouse
|
||||
cmp eax,8
|
||||
jne .nobsp
|
||||
cmp [stepptr],0
|
||||
jne .no1st
|
||||
mov [jump],run.game
|
||||
ret
|
||||
.no1st:
|
||||
mov [win_flag],0
|
||||
sub [cur_step],2
|
||||
mov esi,[cur_step]
|
||||
mov edi,[finish]
|
||||
mov eax,3
|
||||
movzx ebx,byte[esi]
|
||||
sub eax,ebx
|
||||
movzx ecx,byte[esi+1]
|
||||
.lp0:
|
||||
and byte[field+edi],0
|
||||
add edi,[dirs+eax*4]
|
||||
loop .lp0
|
||||
mov [finish],edi
|
||||
dec [stepptr]
|
||||
ret
|
||||
.nobsp:
|
||||
cmp eax,176
|
||||
jb .ex
|
||||
cmp eax,179
|
||||
ja .ex
|
||||
sub eax,176
|
||||
.ex:
|
||||
ret
|
||||
|
||||
LP_drawm:
|
||||
and [pause_time],0
|
||||
mov ecx,[cell_count]
|
||||
.lp:
|
||||
push ecx
|
||||
mov bl,byte[field+ecx-1]
|
||||
push ebx
|
||||
lea eax,[ecx-1]
|
||||
mov ecx,eax
|
||||
call get_xy
|
||||
|
||||
mov al,bl
|
||||
and al,0xf
|
||||
test bl,11000000b
|
||||
jnz .noempty
|
||||
mov esi,LP_aw
|
||||
mov ecx,11
|
||||
call LP_draw_alert
|
||||
jmp .no
|
||||
.noempty:
|
||||
mov edx,0
|
||||
test bl,10000000b
|
||||
je .stable
|
||||
mov edx,0xffffff
|
||||
mov esi,LP_aw
|
||||
mov ecx,7
|
||||
jmp .d13
|
||||
.stable:
|
||||
mov esi,LP_em
|
||||
mov ecx,9
|
||||
.d13:
|
||||
call LP_draw_alert
|
||||
mcall 13,[lx],[ly]
|
||||
.no:
|
||||
mov esi,[esp+4]
|
||||
dec esi
|
||||
mov edi,esi
|
||||
mov edx,0x0000FF
|
||||
; ecx - cell #
|
||||
test byte[esp],10b
|
||||
je .no_dn
|
||||
add edi,[dirs+4*1]
|
||||
call getline
|
||||
.no_dn:
|
||||
test byte[esp],1000b
|
||||
je .no_right
|
||||
mov edi,esi
|
||||
add edi,[dirs+4*3]
|
||||
call getline
|
||||
.no_right:
|
||||
pop ebx
|
||||
pop ecx
|
||||
.valid:
|
||||
loop .lp2
|
||||
jmp .exlp
|
||||
.lp2:
|
||||
jmp .lp
|
||||
.exlp:
|
||||
|
||||
mov esi,[player]
|
||||
mov edi,[finish]
|
||||
cmp esi,edi
|
||||
je .ex
|
||||
mov edx,0x7777FF
|
||||
call getline
|
||||
.ex:
|
||||
cmp [pause_time],0
|
||||
jne .ex2
|
||||
xor ecx,ecx
|
||||
xor ebx,ebx
|
||||
mov edx,5
|
||||
; eax - cur cell content, ebx - cell #, ecx - cell counter, edx - dir
|
||||
.chwin:
|
||||
movzx eax,byte[field+ebx]
|
||||
and eax,0xf
|
||||
btr eax,edx
|
||||
bsf edx,eax
|
||||
je .ex3
|
||||
inc ecx
|
||||
add ebx,[dirs+edx*4]
|
||||
jz .ex3
|
||||
xor edx,11b
|
||||
jmp .chwin
|
||||
.ex3:
|
||||
cmp ecx,[cell_count]
|
||||
jne .ex2
|
||||
mov [win_flag],1
|
||||
.ex2:
|
||||
ret
|
||||
|
||||
LP_mouse:
|
||||
cmp [win_flag],1
|
||||
je .ex
|
||||
mov [jump],still
|
||||
mov edx,eax
|
||||
call get_last_mclick
|
||||
cmp edx,-2
|
||||
jne .no1st
|
||||
test eax,eax
|
||||
jnz .noempty
|
||||
mov eax,[player]
|
||||
mov ebx,[finish]
|
||||
call get_offset
|
||||
mov ecx,eax
|
||||
mov edx,0x101
|
||||
shl dl,cl
|
||||
xor ecx,11b
|
||||
shl dh,cl
|
||||
mov ecx,ebx
|
||||
jecxz LP_drawm.ex2
|
||||
mov esi,[player]
|
||||
.lp:
|
||||
xor [field+esi],dl
|
||||
add esi,[dirs+eax*4]
|
||||
xor [field+esi],dh
|
||||
loop .lp
|
||||
xor ebx,ebx
|
||||
.noempty:
|
||||
mov [player],ebx
|
||||
jmp .exx
|
||||
.no1st:
|
||||
test eax,eax
|
||||
jz .ex
|
||||
mov eax,[player]
|
||||
push ebx
|
||||
call get_offset
|
||||
pop ebx
|
||||
cmp eax,-1
|
||||
je .ex
|
||||
.exx:
|
||||
mov [finish],ebx
|
||||
mov [jump],drw
|
||||
; ud2
|
||||
.ex:
|
||||
ret
|
||||
|
||||
|
||||
LP_aw db 1001b,0110b
|
||||
LP_em db 0000b,0001b,0010b,0100b,1000b
|
||||
LP_ab db 0011b,0101b,1100b,1010b,1001b,0110b
|
||||
|
||||
LP_draw_alert:
|
||||
; al-cell, esi - ptr,ecx - len
|
||||
.lp:
|
||||
cmp al,[esi]
|
||||
je .ex
|
||||
inc esi
|
||||
loop .lp
|
||||
pusha
|
||||
mov ebx,[lx]
|
||||
mov ecx,[ly]
|
||||
add ebx,4-2 shl 16
|
||||
add ecx,4-2 shl 16
|
||||
mcall 13,,,0xFFAAAA
|
||||
mov [pause_time],eax
|
||||
popa
|
||||
.ex:
|
||||
ret
|
||||
|
||||
LP_level:
|
||||
file 'loops.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
LP_help mstr \
|
||||
'—¥à¥§ ¢á¥ ª«¥âª¨ ¯àאַ㣮«ì¨ª ¥®¡å®¤¨¬®',\
|
||||
'¯à®¢¥á⨠§ ¬ªãâãî «®¬ ãî. <20>à®å®¤ï ç¥à¥§ ç¥àë©',\
|
||||
'ªà㦮ª, «®¬ ï ®¡ï§ ¯®¢¥àãâì, ¯à®å®¤ï',\
|
||||
'ç¥à¥§ ¡¥«ë© ªà㦮ª, «®¬ ï ¯®¢®à 稢 âì ¥',\
|
||||
'¬®¦¥â. ‚ ¯ãáâëå ¦¥ ª«¥âª å «®¬ ï ¢¥¤¥â á¥¡ï ª ª',\
|
||||
'§ å®ç¥â.','',\
|
||||
'http://puzzleprograms.narod.ru'
|
||||
else
|
||||
LP_help mstr \
|
||||
'You have to draw closed line over every grid',\
|
||||
'cell. On black square line must turn, and it must',\
|
||||
'go straight when over white square. The line may',\
|
||||
'behave anyhow elsewhere.','',\
|
||||
'http://puzzleprograms.narod.ru'
|
||||
end if
|
||||
; Language support for locales: ru_RU (CP866), en_US.
|
||||
|
||||
LP_levelp:
|
||||
mcall 40,100111b
|
||||
inc [drag_flag]
|
||||
lodsb
|
||||
lodsw
|
||||
mov byte[fx],al
|
||||
mov byte[fy],ah
|
||||
and dword[player],0
|
||||
and dword[finish],0
|
||||
call get_xy_sf.count
|
||||
call erase_field
|
||||
; mov [levptr],esi
|
||||
.bit2:
|
||||
mov edx,8/2
|
||||
mov edi,field
|
||||
lodsb
|
||||
mov ecx,[cell_count]
|
||||
.lp:
|
||||
mov bl,al
|
||||
rol al,2
|
||||
and bl,11000000b
|
||||
mov [edi],bl
|
||||
inc edi
|
||||
dec edx
|
||||
test edx,edx
|
||||
jnz .nxt
|
||||
mov edx,8/2
|
||||
lodsb
|
||||
.nxt:
|
||||
loop .lp
|
||||
ret
|
||||
|
||||
LP_key:
|
||||
cmp eax,0
|
||||
jl LP_mouse
|
||||
cmp eax,8
|
||||
jne .nobsp
|
||||
cmp [stepptr],0
|
||||
jne .no1st
|
||||
mov [jump],run.game
|
||||
ret
|
||||
.no1st:
|
||||
mov [win_flag],0
|
||||
sub [cur_step],2
|
||||
mov esi,[cur_step]
|
||||
mov edi,[finish]
|
||||
mov eax,3
|
||||
movzx ebx,byte[esi]
|
||||
sub eax,ebx
|
||||
movzx ecx,byte[esi+1]
|
||||
.lp0:
|
||||
and byte[field+edi],0
|
||||
add edi,[dirs+eax*4]
|
||||
loop .lp0
|
||||
mov [finish],edi
|
||||
dec [stepptr]
|
||||
ret
|
||||
.nobsp:
|
||||
cmp eax,176
|
||||
jb .ex
|
||||
cmp eax,179
|
||||
ja .ex
|
||||
sub eax,176
|
||||
.ex:
|
||||
ret
|
||||
|
||||
LP_drawm:
|
||||
and [pause_time],0
|
||||
mov ecx,[cell_count]
|
||||
.lp:
|
||||
push ecx
|
||||
mov bl,byte[field+ecx-1]
|
||||
push ebx
|
||||
lea eax,[ecx-1]
|
||||
mov ecx,eax
|
||||
call get_xy
|
||||
|
||||
mov al,bl
|
||||
and al,0xf
|
||||
test bl,11000000b
|
||||
jnz .noempty
|
||||
mov esi,LP_aw
|
||||
mov ecx,11
|
||||
call LP_draw_alert
|
||||
jmp .no
|
||||
.noempty:
|
||||
mov edx,0
|
||||
test bl,10000000b
|
||||
je .stable
|
||||
mov edx,0xffffff
|
||||
mov esi,LP_aw
|
||||
mov ecx,7
|
||||
jmp .d13
|
||||
.stable:
|
||||
mov esi,LP_em
|
||||
mov ecx,9
|
||||
.d13:
|
||||
call LP_draw_alert
|
||||
mcall 13,[lx],[ly]
|
||||
.no:
|
||||
mov esi,[esp+4]
|
||||
dec esi
|
||||
mov edi,esi
|
||||
mov edx,0x0000FF
|
||||
; ecx - cell #
|
||||
test byte[esp],10b
|
||||
je .no_dn
|
||||
add edi,[dirs+4*1]
|
||||
call getline
|
||||
.no_dn:
|
||||
test byte[esp],1000b
|
||||
je .no_right
|
||||
mov edi,esi
|
||||
add edi,[dirs+4*3]
|
||||
call getline
|
||||
.no_right:
|
||||
pop ebx
|
||||
pop ecx
|
||||
.valid:
|
||||
loop .lp2
|
||||
jmp .exlp
|
||||
.lp2:
|
||||
jmp .lp
|
||||
.exlp:
|
||||
|
||||
mov esi,[player]
|
||||
mov edi,[finish]
|
||||
cmp esi,edi
|
||||
je .ex
|
||||
mov edx,0x7777FF
|
||||
call getline
|
||||
.ex:
|
||||
cmp [pause_time],0
|
||||
jne .ex2
|
||||
xor ecx,ecx
|
||||
xor ebx,ebx
|
||||
mov edx,5
|
||||
; eax - cur cell content, ebx - cell #, ecx - cell counter, edx - dir
|
||||
.chwin:
|
||||
movzx eax,byte[field+ebx]
|
||||
and eax,0xf
|
||||
btr eax,edx
|
||||
bsf edx,eax
|
||||
je .ex3
|
||||
inc ecx
|
||||
add ebx,[dirs+edx*4]
|
||||
jz .ex3
|
||||
xor edx,11b
|
||||
jmp .chwin
|
||||
.ex3:
|
||||
cmp ecx,[cell_count]
|
||||
jne .ex2
|
||||
mov [win_flag],1
|
||||
.ex2:
|
||||
ret
|
||||
|
||||
LP_mouse:
|
||||
cmp [win_flag],1
|
||||
je .ex
|
||||
mov [jump],still
|
||||
mov edx,eax
|
||||
call get_last_mclick
|
||||
cmp edx,-2
|
||||
jne .no1st
|
||||
test eax,eax
|
||||
jnz .noempty
|
||||
mov eax,[player]
|
||||
mov ebx,[finish]
|
||||
call get_offset
|
||||
mov ecx,eax
|
||||
mov edx,0x101
|
||||
shl dl,cl
|
||||
xor ecx,11b
|
||||
shl dh,cl
|
||||
mov ecx,ebx
|
||||
jecxz LP_drawm.ex2
|
||||
mov esi,[player]
|
||||
.lp:
|
||||
xor [field+esi],dl
|
||||
add esi,[dirs+eax*4]
|
||||
xor [field+esi],dh
|
||||
loop .lp
|
||||
xor ebx,ebx
|
||||
.noempty:
|
||||
mov [player],ebx
|
||||
jmp .exx
|
||||
.no1st:
|
||||
test eax,eax
|
||||
jz .ex
|
||||
mov eax,[player]
|
||||
push ebx
|
||||
call get_offset
|
||||
pop ebx
|
||||
cmp eax,-1
|
||||
je .ex
|
||||
.exx:
|
||||
mov [finish],ebx
|
||||
mov [jump],drw
|
||||
; ud2
|
||||
.ex:
|
||||
ret
|
||||
|
||||
|
||||
LP_aw db 1001b,0110b
|
||||
LP_em db 0000b,0001b,0010b,0100b,1000b
|
||||
LP_ab db 0011b,0101b,1100b,1010b,1001b,0110b
|
||||
|
||||
LP_draw_alert:
|
||||
; al-cell, esi - ptr,ecx - len
|
||||
.lp:
|
||||
cmp al,[esi]
|
||||
je .ex
|
||||
inc esi
|
||||
loop .lp
|
||||
pusha
|
||||
mov ebx,[lx]
|
||||
mov ecx,[ly]
|
||||
add ebx,4-2 shl 16
|
||||
add ecx,4-2 shl 16
|
||||
mcall 13,,,0xFFAAAA
|
||||
mov [pause_time],eax
|
||||
popa
|
||||
.ex:
|
||||
ret
|
||||
|
||||
LP_level:
|
||||
file 'loops.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
LP_help mstr \
|
||||
'—¥à¥§ ¢á¥ ª«¥âª¨ ¯àאַ㣮«ì¨ª ¥®¡å®¤¨¬®',\
|
||||
'¯à®¢¥á⨠§ ¬ªãâãî «®¬ ãî. <20>à®å®¤ï ç¥à¥§ ç¥àë©',\
|
||||
'ªà㦮ª, «®¬ ï ®¡ï§ ¯®¢¥àãâì, ¯à®å®¤ï',\
|
||||
'ç¥à¥§ ¡¥«ë© ªà㦮ª, «®¬ ï ¯®¢®à 稢 âì ¥',\
|
||||
'¬®¦¥â. ‚ ¯ãáâëå ¦¥ ª«¥âª å «®¬ ï ¢¥¤¥â á¥¡ï ª ª',\
|
||||
'§ å®ç¥â.','',\
|
||||
'http://puzzleprograms.narod.ru' ; FIXME: Check link works
|
||||
else ; Default to en_US
|
||||
LP_help mstr \
|
||||
'You have to draw a closed line over every grid',\
|
||||
'cell. On black square line must turn, and it must',\
|
||||
'go straight when over white square. The line may',\
|
||||
'behave anyhow elsewhere.','',\
|
||||
'http://puzzleprograms.narod.ru' ; FIXME: Check link works
|
||||
end if
|
||||
|
@ -1,138 +1,140 @@
|
||||
; level format
|
||||
; [fx|fy][hole xy][balls #]..[1-red,0-black xy]..[maze walls]
|
||||
|
||||
; internal format
|
||||
; [stepptr]= balls #
|
||||
; [finish]= hole cell
|
||||
; area: ..[1-red,0-black xy].. ( -1 if empty)
|
||||
|
||||
MAR_levelp:
|
||||
call get_xy_sf
|
||||
movzx eax,byte[esi-2]
|
||||
mov [finish],eax
|
||||
movzx ecx,byte[esi-1]
|
||||
mov [stepptr],ecx
|
||||
mov edi,area
|
||||
rep movsb
|
||||
mov [pause_time],10
|
||||
call unpack_level
|
||||
ret
|
||||
|
||||
MAR_key:
|
||||
cmp eax,176
|
||||
jb .ex
|
||||
cmp eax,179
|
||||
ja .ex
|
||||
mov esi,area-1
|
||||
lea ebx,[eax-176]
|
||||
.again:
|
||||
and [cur_step],0
|
||||
mov ecx,[stepptr]
|
||||
.lp:
|
||||
movzx eax,byte[esi+ecx]
|
||||
cmp al,-1
|
||||
je .ex1
|
||||
mov byte[player],al
|
||||
and byte[player],0x80
|
||||
and eax,0x7f
|
||||
call check_move
|
||||
jc .ex1
|
||||
add eax,[dirs+ebx*4]
|
||||
cmp eax,[finish]
|
||||
jne .nohole
|
||||
mov byte[esi+ecx],-1
|
||||
jmp .ex2
|
||||
.nohole:
|
||||
push ecx
|
||||
mov ecx,[stepptr]
|
||||
mov edi,area
|
||||
.lp2:
|
||||
mov dl,[edi]
|
||||
and dl,0x7f
|
||||
cmp al,dl
|
||||
je .exlp2
|
||||
inc edi
|
||||
loop .lp2
|
||||
.exlp2:
|
||||
pop ecx
|
||||
je .ex1
|
||||
or al,byte[player]
|
||||
mov [esi+ecx],al
|
||||
.ex2:
|
||||
inc [cur_step]
|
||||
.ex1:
|
||||
loop .lp
|
||||
cmp [cur_step],0
|
||||
je .exx
|
||||
call delay
|
||||
call drwfld
|
||||
jmp .again
|
||||
.exx:
|
||||
mov ecx,[stepptr]
|
||||
inc esi
|
||||
.lp3:
|
||||
lodsb
|
||||
cmp al,-1
|
||||
je .nxt
|
||||
test al,0x80
|
||||
jne .ex
|
||||
.nxt:
|
||||
loop .lp3
|
||||
mov [win_flag],1
|
||||
.ex:
|
||||
ret
|
||||
|
||||
MAR_drawm:
|
||||
shl [sq_size],1
|
||||
mov eax,[finish]
|
||||
call get_xy
|
||||
shr [sq_size],1
|
||||
mcall 13,[lx],[ly],0xa0a0a0
|
||||
movzx ecx,byte[stepptr]
|
||||
mov edi,area
|
||||
.lp:
|
||||
push ecx
|
||||
movzx eax,byte[edi]
|
||||
mov edx,0x0
|
||||
cmp al,-1
|
||||
je .exlp
|
||||
test eax,0x80
|
||||
je .no
|
||||
mov edx,0xff00000
|
||||
.no:
|
||||
and eax,0x7f
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly]
|
||||
.exlp:
|
||||
pop ecx
|
||||
inc edi
|
||||
loop .lp
|
||||
.ex:
|
||||
ret
|
||||
|
||||
MAR_level:
|
||||
file 'marble.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
MAR_help mstr \
|
||||
'<27>¥áª®«ìª® ªà áëå ¨ ç¥àëå ¯« 襪 «¥¦ â ¤®áª¥,',\
|
||||
'¤ëઠ®¡®§ ç¥ á¥à®© ª«¥âª®©. Š®£¤ ¯« èª ',\
|
||||
'¯à®å®¤¨â ¤ ¤ëમ©, ® ¯ ¤ ¥â â㤠¨ ¨á祧 ¥â.',\
|
||||
'ˆá¯®«ì§ã©â¥ áâ५ª¨ ¤«ï ª«® ¤®áª¨.',\
|
||||
' ‚ è § ¤ ç - á¡à®á¨âì ¢á¥ ªà áë¥ ¯« 誨.',\
|
||||
'Š®«¨ç¥á⢮ 㯠¢è¨å ç¥àëå ¯« 襪 ஫¨ ¥ ¨£à ¥â.','',\
|
||||
'http://www.clickmazes.com'
|
||||
else
|
||||
MAR_help mstr \
|
||||
'Several red and black marbles sit on a flat tray,',\
|
||||
'a grey square indicate a hole in the tray. If a',\
|
||||
'marble rolls onto or over the hole it drops',\
|
||||
'through and disappears. Use the cursor keys to',\
|
||||
'tilt the tray and start the marbles rolling, the',\
|
||||
'marbles roll in a straight line until they come',\
|
||||
'to rest, you can then roll again. Your challenge',\
|
||||
'is to drop all the red marbles, it does not',\
|
||||
'matter how many black marbles you lose in the',\
|
||||
'process.','',\
|
||||
'http://www.clickmazes.com'
|
||||
end if
|
||||
; Language support for locales: ru_RU (CP866), en_US.
|
||||
|
||||
; level format
|
||||
; [fx|fy][hole xy][balls #]..[1-red,0-black xy]..[maze walls]
|
||||
|
||||
; internal format
|
||||
; [stepptr]= balls #
|
||||
; [finish]= hole cell
|
||||
; area: ..[1-red,0-black xy].. ( -1 if empty)
|
||||
|
||||
MAR_levelp:
|
||||
call get_xy_sf
|
||||
movzx eax,byte[esi-2]
|
||||
mov [finish],eax
|
||||
movzx ecx,byte[esi-1]
|
||||
mov [stepptr],ecx
|
||||
mov edi,area
|
||||
rep movsb
|
||||
mov [pause_time],10
|
||||
call unpack_level
|
||||
ret
|
||||
|
||||
MAR_key:
|
||||
cmp eax,176
|
||||
jb .ex
|
||||
cmp eax,179
|
||||
ja .ex
|
||||
mov esi,area-1
|
||||
lea ebx,[eax-176]
|
||||
.again:
|
||||
and [cur_step],0
|
||||
mov ecx,[stepptr]
|
||||
.lp:
|
||||
movzx eax,byte[esi+ecx]
|
||||
cmp al,-1
|
||||
je .ex1
|
||||
mov byte[player],al
|
||||
and byte[player],0x80
|
||||
and eax,0x7f
|
||||
call check_move
|
||||
jc .ex1
|
||||
add eax,[dirs+ebx*4]
|
||||
cmp eax,[finish]
|
||||
jne .nohole
|
||||
mov byte[esi+ecx],-1
|
||||
jmp .ex2
|
||||
.nohole:
|
||||
push ecx
|
||||
mov ecx,[stepptr]
|
||||
mov edi,area
|
||||
.lp2:
|
||||
mov dl,[edi]
|
||||
and dl,0x7f
|
||||
cmp al,dl
|
||||
je .exlp2
|
||||
inc edi
|
||||
loop .lp2
|
||||
.exlp2:
|
||||
pop ecx
|
||||
je .ex1
|
||||
or al,byte[player]
|
||||
mov [esi+ecx],al
|
||||
.ex2:
|
||||
inc [cur_step]
|
||||
.ex1:
|
||||
loop .lp
|
||||
cmp [cur_step],0
|
||||
je .exx
|
||||
call delay
|
||||
call drwfld
|
||||
jmp .again
|
||||
.exx:
|
||||
mov ecx,[stepptr]
|
||||
inc esi
|
||||
.lp3:
|
||||
lodsb
|
||||
cmp al,-1
|
||||
je .nxt
|
||||
test al,0x80
|
||||
jne .ex
|
||||
.nxt:
|
||||
loop .lp3
|
||||
mov [win_flag],1
|
||||
.ex:
|
||||
ret
|
||||
|
||||
MAR_drawm:
|
||||
shl [sq_size],1
|
||||
mov eax,[finish]
|
||||
call get_xy
|
||||
shr [sq_size],1
|
||||
mcall 13,[lx],[ly],0xa0a0a0
|
||||
movzx ecx,byte[stepptr]
|
||||
mov edi,area
|
||||
.lp:
|
||||
push ecx
|
||||
movzx eax,byte[edi]
|
||||
mov edx,0x0
|
||||
cmp al,-1
|
||||
je .exlp
|
||||
test eax,0x80
|
||||
je .no
|
||||
mov edx,0xff00000
|
||||
.no:
|
||||
and eax,0x7f
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly]
|
||||
.exlp:
|
||||
pop ecx
|
||||
inc edi
|
||||
loop .lp
|
||||
.ex:
|
||||
ret
|
||||
|
||||
MAR_level:
|
||||
file 'marble.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
MAR_help mstr \
|
||||
'<27>¥áª®«ìª® ªà áëå ¨ ç¥àëå ¯« 襪 «¥¦ â ¤®áª¥,',\
|
||||
'¤ëઠ®¡®§ ç¥ á¥à®© ª«¥âª®©. Š®£¤ ¯« èª ',\
|
||||
'¯à®å®¤¨â ¤ ¤ëમ©, ® ¯ ¤ ¥â â㤠¨ ¨á祧 ¥â.',\
|
||||
'ˆá¯®«ì§ã©â¥ áâ५ª¨ ¤«ï ª«® ¤®áª¨.',\
|
||||
' ‚ è § ¤ ç - á¡à®á¨âì ¢á¥ ªà áë¥ ¯« 誨.',\
|
||||
'Š®«¨ç¥á⢮ 㯠¢è¨å ç¥àëå ¯« 襪 ஫¨ ¥ ¨£à ¥â.','',\
|
||||
'http://www.clickmazes.com'
|
||||
else ; Default to en_US
|
||||
MAR_help mstr \
|
||||
'Several red and black marbles sit on a flat tray,',\
|
||||
'a grey square indicate a hole in the tray. If a',\
|
||||
'marble rolls onto or over the hole it drops',\
|
||||
'through and disappears. Use the cursor keys to',\
|
||||
'tilt the tray and start the marbles rolling, the',\
|
||||
'marbles roll in a straight line until they come',\
|
||||
'to rest, you can then roll again. Your challenge',\
|
||||
'is to drop all the red marbles, it does not',\
|
||||
'matter how many black marbles you lose in the',\
|
||||
'process.','',\
|
||||
'http://www.clickmazes.com'
|
||||
end if
|
||||
|
@ -1,92 +1,94 @@
|
||||
NLT_levelp:
|
||||
mov eax,OR_strip
|
||||
call need_image
|
||||
xor eax,eax
|
||||
lodsb
|
||||
lodsb
|
||||
mov [fx],eax
|
||||
lodsb
|
||||
mov [fy],eax
|
||||
lodsw
|
||||
mov [player],eax
|
||||
mov dword[area],5
|
||||
lodsw
|
||||
mov [finish],eax
|
||||
call get_xy_sf.count
|
||||
mov [levptr],esi
|
||||
call unpack_level
|
||||
ret
|
||||
|
||||
NLT_key:
|
||||
mov [jump],still
|
||||
cmp eax,176
|
||||
jb .ex
|
||||
cmp eax,179
|
||||
ja .ex
|
||||
lea ebx,[eax-176]
|
||||
mov eax,[player]
|
||||
call check_move
|
||||
jc .ex
|
||||
mov ecx,ebx
|
||||
mov edx,ebx
|
||||
movzx ecx,byte[dir_rotate+ecx]
|
||||
cmp ecx,dword[area]
|
||||
je .ex
|
||||
xor edx,11b
|
||||
cmp edx,dword[area]
|
||||
je .ex
|
||||
add eax,[dirs+ebx*4]
|
||||
mov dword[area],ebx
|
||||
mov [player],eax
|
||||
cmp eax,[finish]
|
||||
jne .nowin
|
||||
mov [win_flag],1
|
||||
.nowin:
|
||||
mov [jump],drw
|
||||
.ex:
|
||||
ret
|
||||
|
||||
NLT_drawm:
|
||||
push [sq_size]
|
||||
mov [sq_size],0
|
||||
mov eax,[finish]
|
||||
mov ebx,6
|
||||
call out_image
|
||||
; mcall 13,[lx],[ly],0xff0000
|
||||
mov ebx,dword[area]
|
||||
cmp ebx,5
|
||||
jne .skip
|
||||
mov eax,[player]
|
||||
mov edi,eax
|
||||
pop [sq_size]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0x8000
|
||||
jmp .ex
|
||||
.skip:
|
||||
add ebx,8
|
||||
mov eax,[player]
|
||||
call out_image
|
||||
pop [sq_size]
|
||||
.ex:
|
||||
ret
|
||||
|
||||
NLT_level:
|
||||
file 'nolt.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
NLT_help mstr \
|
||||
'‚ è § ¤ ç - ¯à®¢¥á⨠§¥«¥ë© ª¢ ¤à â ª ªà ᮬã',\
|
||||
'¡¥§ ¯®¢®à®â «¥¢® ¨ ¤¢¨¦¥¨ï § ¤. <20>â® âà㤥¥',\
|
||||
'祬 ª ¦¥âáï. ‚¨¬ ¨¥: ¥á«¨ ‚ë ¯à¨¬¥â¥ ¯«®å®¥',\
|
||||
'à¥è¥¨¥, ¬®¦¥â¥ ¯®¯ áâì ¢ â㯨ª ¨ ¡ã¤¥â¥',\
|
||||
'¢ë㦤¥ë ç âì á ç « .','',\
|
||||
'http://puzzleprograms.narod.ru'
|
||||
else
|
||||
NLT_help mstr \
|
||||
'Your challenge is to manouvre the green dot to',\
|
||||
'the red square without ever turning left, or',\
|
||||
'making a U-turn. Harder than it looks. Beware, if',\
|
||||
'you make a bad decision in this maze you may get',\
|
||||
'completely stuck and have to restart.','',\
|
||||
'http://www.clickmazes.com'
|
||||
end if
|
||||
; Language support for locales: ru_RU (CP866), en_US.
|
||||
|
||||
NLT_levelp:
|
||||
mov eax,OR_strip
|
||||
call need_image
|
||||
xor eax,eax
|
||||
lodsb
|
||||
lodsb
|
||||
mov [fx],eax
|
||||
lodsb
|
||||
mov [fy],eax
|
||||
lodsw
|
||||
mov [player],eax
|
||||
mov dword[area],5
|
||||
lodsw
|
||||
mov [finish],eax
|
||||
call get_xy_sf.count
|
||||
mov [levptr],esi
|
||||
call unpack_level
|
||||
ret
|
||||
|
||||
NLT_key:
|
||||
mov [jump],still
|
||||
cmp eax,176
|
||||
jb .ex
|
||||
cmp eax,179
|
||||
ja .ex
|
||||
lea ebx,[eax-176]
|
||||
mov eax,[player]
|
||||
call check_move
|
||||
jc .ex
|
||||
mov ecx,ebx
|
||||
mov edx,ebx
|
||||
movzx ecx,byte[dir_rotate+ecx]
|
||||
cmp ecx,dword[area]
|
||||
je .ex
|
||||
xor edx,11b
|
||||
cmp edx,dword[area]
|
||||
je .ex
|
||||
add eax,[dirs+ebx*4]
|
||||
mov dword[area],ebx
|
||||
mov [player],eax
|
||||
cmp eax,[finish]
|
||||
jne .nowin
|
||||
mov [win_flag],1
|
||||
.nowin:
|
||||
mov [jump],drw
|
||||
.ex:
|
||||
ret
|
||||
|
||||
NLT_drawm:
|
||||
push [sq_size]
|
||||
mov [sq_size],0
|
||||
mov eax,[finish]
|
||||
mov ebx,6
|
||||
call out_image
|
||||
; mcall 13,[lx],[ly],0xff0000
|
||||
mov ebx,dword[area]
|
||||
cmp ebx,5
|
||||
jne .skip
|
||||
mov eax,[player]
|
||||
mov edi,eax
|
||||
pop [sq_size]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0x8000
|
||||
jmp .ex
|
||||
.skip:
|
||||
add ebx,8
|
||||
mov eax,[player]
|
||||
call out_image
|
||||
pop [sq_size]
|
||||
.ex:
|
||||
ret
|
||||
|
||||
NLT_level:
|
||||
file 'nolt.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
NLT_help mstr \
|
||||
'‚ è § ¤ ç - ¯à®¢¥á⨠§¥«¥ë© ª¢ ¤à â ª ªà ᮬã',\
|
||||
'¡¥§ ¯®¢®à®â «¥¢® ¨ ¤¢¨¦¥¨ï § ¤. <20>â® âà㤥¥',\
|
||||
'祬 ª ¦¥âáï. ‚¨¬ ¨¥: ¥á«¨ ‚ë ¯à¨¬¥â¥ ¯«®å®¥',\
|
||||
'à¥è¥¨¥, ¬®¦¥â¥ ¯®¯ áâì ¢ â㯨ª ¨ ¡ã¤¥â¥',\
|
||||
'¢ë㦤¥ë ç âì á ç « .','',\
|
||||
'http://puzzleprograms.narod.ru' ; FIXME: Check link works
|
||||
else ; Default to en_US
|
||||
NLT_help mstr \
|
||||
'Your challenge is to manouvre the green dot to',\
|
||||
'the red square without ever turning left, or',\
|
||||
'making a U-turn. Harder than it looks. Beware, if',\
|
||||
'you make a bad decision in this maze you may get',\
|
||||
'completely stuck and have to restart.','',\
|
||||
'http://www.clickmazes.com' ; FIXME: Why are links different?
|
||||
end if
|
||||
|
@ -1,227 +1,229 @@
|
||||
; level format
|
||||
; [fx|fy]..[field cells x2]..[worm_count]..[worm_len][start cell #][body dirs x2]
|
||||
|
||||
; internal format
|
||||
; [stepptr]= worms #
|
||||
; area: [worm_len][start_cell #][end_cell #]..[dirs]..
|
||||
; [cur_step]: dragged worm pointer
|
||||
; [finish]: 0 - if head dragged, 1- if tail
|
||||
|
||||
OR_levelp:
|
||||
mov [Ces],40
|
||||
mcall 40,100111b
|
||||
inc [drag_flag]
|
||||
mov eax,OR_strip
|
||||
call need_image
|
||||
inc esi
|
||||
movzx ecx,byte[esi]
|
||||
inc esi
|
||||
push esi
|
||||
mov esi,OR_maze
|
||||
jecxz .sk
|
||||
.nxtmz:
|
||||
movzx eax,byte[esi]
|
||||
add esi,eax
|
||||
loop .nxtmz
|
||||
.sk:
|
||||
call get_xy_sf
|
||||
call unpack_level
|
||||
pop esi
|
||||
movzx ecx,byte[esi]
|
||||
inc esi
|
||||
mov [cur_step],ecx
|
||||
jecxz .sk2
|
||||
mov edi,area
|
||||
rep movsb
|
||||
.sk2:
|
||||
mov ecx,[cell_count]
|
||||
mov edi,area+16
|
||||
rep movsb
|
||||
mov [stepptr],2
|
||||
; call erase_field
|
||||
; ud2
|
||||
ret
|
||||
|
||||
OR_key:
|
||||
cmp eax,0
|
||||
jl OR_mouse
|
||||
ret
|
||||
|
||||
OR_drawf:
|
||||
mov ecx,[cell_count]
|
||||
push [sq_size]
|
||||
mov [sq_size],0
|
||||
.lp:
|
||||
push ecx
|
||||
movzx ebx,byte[area+16+ecx-1]
|
||||
cmp bl,0xf
|
||||
je .no
|
||||
lea eax,[ecx-1]
|
||||
call out_image
|
||||
.no:
|
||||
pop ecx
|
||||
loop .lp
|
||||
pop [sq_size]
|
||||
ret
|
||||
|
||||
OR_drawm:
|
||||
push [sq_size]
|
||||
mov [sq_size],0
|
||||
mov eax,[player]
|
||||
mov ebx,[stepptr]
|
||||
add ebx,8
|
||||
call out_image
|
||||
mov ecx,[cur_step]
|
||||
jecxz .skipb
|
||||
mov ebx,7
|
||||
mov esi,area
|
||||
xor eax,eax
|
||||
.nxtb:
|
||||
lodsb
|
||||
call out_image
|
||||
loop .nxtb
|
||||
.skipb:
|
||||
mov eax,[player]
|
||||
.again:
|
||||
mov ebx,[stepptr]
|
||||
call check_move
|
||||
jc .ex
|
||||
add eax,[dirs+ebx*4]
|
||||
cmp byte[area+16+eax],6
|
||||
je .ex
|
||||
mov ecx,[cur_step]
|
||||
jecxz .skbchk
|
||||
mov edi,area
|
||||
repne scasb
|
||||
je .again
|
||||
.skbchk:
|
||||
mov [sq_size],1
|
||||
push eax
|
||||
call get_xy
|
||||
mov ebx,[lx]
|
||||
sub bx,2
|
||||
mov ecx,[ly]
|
||||
mov cx,3
|
||||
mcall 13,,,0xFFC633
|
||||
xchg bx,cx
|
||||
mcall
|
||||
mov esi,[Ces]
|
||||
sub esi,3+2
|
||||
shl esi,16
|
||||
push ebx
|
||||
add ebx,esi
|
||||
mcall
|
||||
pop ebx
|
||||
add ecx,esi
|
||||
xchg bx,cx
|
||||
add bx,2
|
||||
mcall
|
||||
pop eax
|
||||
jmp .again
|
||||
.ex:
|
||||
pop [sq_size]
|
||||
ret
|
||||
|
||||
OR_mouse:
|
||||
cmp [win_flag],1
|
||||
je .ex
|
||||
mov [jump],still
|
||||
mov edx,eax
|
||||
call get_last_mclick
|
||||
cmp edx,-2
|
||||
jne .ex
|
||||
test eax,eax
|
||||
jnz .noempty
|
||||
.drw:
|
||||
mov [jump],drw
|
||||
ret
|
||||
.noempty:
|
||||
|
||||
; First Click at ebx cell
|
||||
mov eax,[player]
|
||||
cmp eax,ebx
|
||||
je OR_drawf
|
||||
mov ecx,[cur_step]
|
||||
jecxz .skbchk
|
||||
mov edi,area
|
||||
xchg eax,ebx
|
||||
repne scasb
|
||||
xchg eax,ebx
|
||||
je OR_drawf
|
||||
.skbchk:
|
||||
cmp byte[area+16+ebx],0xf
|
||||
je .ex
|
||||
cmp byte[area+16+ebx],6
|
||||
je .ex
|
||||
push eax
|
||||
mov edx,ebx
|
||||
call get_offset
|
||||
mov ebx,eax
|
||||
pop eax
|
||||
cmp ebx,[stepptr]
|
||||
jne .ex
|
||||
|
||||
call check_move
|
||||
jc .ex
|
||||
movzx ecx,byte[area+16+edx]
|
||||
cmp ecx,4
|
||||
jae .noarr
|
||||
mov ebx,ecx
|
||||
call check_move
|
||||
jc .ex
|
||||
mov edx,eax
|
||||
add eax,[dirs+ebx*4]
|
||||
mov [player],eax
|
||||
mov ecx,[cur_step]
|
||||
jecxz .skbchk2
|
||||
mov edi,area
|
||||
repne scasb
|
||||
jne .skbchk2
|
||||
mov [edi-1],dl
|
||||
.skbchk2:
|
||||
cmp eax,[finish]
|
||||
jne .drw
|
||||
mov [win_flag],1
|
||||
jmp .drw
|
||||
.noarr:
|
||||
mov edx,[stepptr]
|
||||
cmp ecx,4
|
||||
jne .nocw
|
||||
movzx edx,byte[dir_rotate+edx]
|
||||
jmp .ex2
|
||||
.nocw:
|
||||
cmp ecx,5
|
||||
jne .ex
|
||||
movzx edx,byte[dir_rotate+4+edx]
|
||||
.ex2:
|
||||
mov [stepptr],edx
|
||||
jmp .drw
|
||||
.ex:
|
||||
ret
|
||||
|
||||
OR_maze:
|
||||
file 'omaze.bin'
|
||||
|
||||
OR_level:
|
||||
file 'or2.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
OR_help mstr \
|
||||
'™¥«ç®ª ¢ë¤¥«¥®© ª«¥âª¥ ¯¥à¥¤¢¨£ ¥â ¨«¨',\
|
||||
'¢à é ¥â ªà áãî áâ५ªã. ‘¨¨© ¡«®ª ¤¥©áâ¢ã¥â',\
|
||||
'ª ª ¯à¥¯ïâá⢨¥, áªàë¢ ï ®¤ã ª«¥âªã. <20>à¨',\
|
||||
'¯¥à¥å®¤¥ áâ५ª¨ ª«¥âªã ᨥ£® ¡«®ª ®¨',\
|
||||
'¯®¬¥ïîâáï ¬¥áâ ¬¨. ‡ ¤ ç - ¯à®¢¥á⨠ªà áãî',\
|
||||
'áâ५ªã ¨§ ¨¦¥© ª«¥âª¨ ¢ ¢¥àåîî.','',\
|
||||
'http://www.clickmazes.com'
|
||||
else
|
||||
OR_help mstr \
|
||||
'Click on a highlighted square to move or rotate',\
|
||||
'the red pointer. The blue switcher acts as an',\
|
||||
'obstacle, hiding one square. The red pointer and',\
|
||||
'blue switcher will swap places if the red pointer',\
|
||||
'is pushed onto a square occupied by a blue',\
|
||||
'switcher. Your challenge is to negotiate the red',\
|
||||
'arrow from the bottom to the top square.','',\
|
||||
'http://www.clickmazes.com'
|
||||
end if
|
||||
; Language support for locales: ru_RU (CP866), en_US.
|
||||
|
||||
; level format
|
||||
; [fx|fy]..[field cells x2]..[worm_count]..[worm_len][start cell #][body dirs x2]
|
||||
|
||||
; internal format
|
||||
; [stepptr]= worms #
|
||||
; area: [worm_len][start_cell #][end_cell #]..[dirs]..
|
||||
; [cur_step]: dragged worm pointer
|
||||
; [finish]: 0 - if head dragged, 1- if tail
|
||||
|
||||
OR_levelp:
|
||||
mov [Ces],40
|
||||
mcall 40,100111b
|
||||
inc [drag_flag]
|
||||
mov eax,OR_strip
|
||||
call need_image
|
||||
inc esi
|
||||
movzx ecx,byte[esi]
|
||||
inc esi
|
||||
push esi
|
||||
mov esi,OR_maze
|
||||
jecxz .sk
|
||||
.nxtmz:
|
||||
movzx eax,byte[esi]
|
||||
add esi,eax
|
||||
loop .nxtmz
|
||||
.sk:
|
||||
call get_xy_sf
|
||||
call unpack_level
|
||||
pop esi
|
||||
movzx ecx,byte[esi]
|
||||
inc esi
|
||||
mov [cur_step],ecx
|
||||
jecxz .sk2
|
||||
mov edi,area
|
||||
rep movsb
|
||||
.sk2:
|
||||
mov ecx,[cell_count]
|
||||
mov edi,area+16
|
||||
rep movsb
|
||||
mov [stepptr],2
|
||||
; call erase_field
|
||||
; ud2
|
||||
ret
|
||||
|
||||
OR_key:
|
||||
cmp eax,0
|
||||
jl OR_mouse
|
||||
ret
|
||||
|
||||
OR_drawf:
|
||||
mov ecx,[cell_count]
|
||||
push [sq_size]
|
||||
mov [sq_size],0
|
||||
.lp:
|
||||
push ecx
|
||||
movzx ebx,byte[area+16+ecx-1]
|
||||
cmp bl,0xf
|
||||
je .no
|
||||
lea eax,[ecx-1]
|
||||
call out_image
|
||||
.no:
|
||||
pop ecx
|
||||
loop .lp
|
||||
pop [sq_size]
|
||||
ret
|
||||
|
||||
OR_drawm:
|
||||
push [sq_size]
|
||||
mov [sq_size],0
|
||||
mov eax,[player]
|
||||
mov ebx,[stepptr]
|
||||
add ebx,8
|
||||
call out_image
|
||||
mov ecx,[cur_step]
|
||||
jecxz .skipb
|
||||
mov ebx,7
|
||||
mov esi,area
|
||||
xor eax,eax
|
||||
.nxtb:
|
||||
lodsb
|
||||
call out_image
|
||||
loop .nxtb
|
||||
.skipb:
|
||||
mov eax,[player]
|
||||
.again:
|
||||
mov ebx,[stepptr]
|
||||
call check_move
|
||||
jc .ex
|
||||
add eax,[dirs+ebx*4]
|
||||
cmp byte[area+16+eax],6
|
||||
je .ex
|
||||
mov ecx,[cur_step]
|
||||
jecxz .skbchk
|
||||
mov edi,area
|
||||
repne scasb
|
||||
je .again
|
||||
.skbchk:
|
||||
mov [sq_size],1
|
||||
push eax
|
||||
call get_xy
|
||||
mov ebx,[lx]
|
||||
sub bx,2
|
||||
mov ecx,[ly]
|
||||
mov cx,3
|
||||
mcall 13,,,0xFFC633
|
||||
xchg bx,cx
|
||||
mcall
|
||||
mov esi,[Ces]
|
||||
sub esi,3+2
|
||||
shl esi,16
|
||||
push ebx
|
||||
add ebx,esi
|
||||
mcall
|
||||
pop ebx
|
||||
add ecx,esi
|
||||
xchg bx,cx
|
||||
add bx,2
|
||||
mcall
|
||||
pop eax
|
||||
jmp .again
|
||||
.ex:
|
||||
pop [sq_size]
|
||||
ret
|
||||
|
||||
OR_mouse:
|
||||
cmp [win_flag],1
|
||||
je .ex
|
||||
mov [jump],still
|
||||
mov edx,eax
|
||||
call get_last_mclick
|
||||
cmp edx,-2
|
||||
jne .ex
|
||||
test eax,eax
|
||||
jnz .noempty
|
||||
.drw:
|
||||
mov [jump],drw
|
||||
ret
|
||||
.noempty:
|
||||
|
||||
; First Click at ebx cell
|
||||
mov eax,[player]
|
||||
cmp eax,ebx
|
||||
je OR_drawf
|
||||
mov ecx,[cur_step]
|
||||
jecxz .skbchk
|
||||
mov edi,area
|
||||
xchg eax,ebx
|
||||
repne scasb
|
||||
xchg eax,ebx
|
||||
je OR_drawf
|
||||
.skbchk:
|
||||
cmp byte[area+16+ebx],0xf
|
||||
je .ex
|
||||
cmp byte[area+16+ebx],6
|
||||
je .ex
|
||||
push eax
|
||||
mov edx,ebx
|
||||
call get_offset
|
||||
mov ebx,eax
|
||||
pop eax
|
||||
cmp ebx,[stepptr]
|
||||
jne .ex
|
||||
|
||||
call check_move
|
||||
jc .ex
|
||||
movzx ecx,byte[area+16+edx]
|
||||
cmp ecx,4
|
||||
jae .noarr
|
||||
mov ebx,ecx
|
||||
call check_move
|
||||
jc .ex
|
||||
mov edx,eax
|
||||
add eax,[dirs+ebx*4]
|
||||
mov [player],eax
|
||||
mov ecx,[cur_step]
|
||||
jecxz .skbchk2
|
||||
mov edi,area
|
||||
repne scasb
|
||||
jne .skbchk2
|
||||
mov [edi-1],dl
|
||||
.skbchk2:
|
||||
cmp eax,[finish]
|
||||
jne .drw
|
||||
mov [win_flag],1
|
||||
jmp .drw
|
||||
.noarr:
|
||||
mov edx,[stepptr]
|
||||
cmp ecx,4
|
||||
jne .nocw
|
||||
movzx edx,byte[dir_rotate+edx]
|
||||
jmp .ex2
|
||||
.nocw:
|
||||
cmp ecx,5
|
||||
jne .ex
|
||||
movzx edx,byte[dir_rotate+4+edx]
|
||||
.ex2:
|
||||
mov [stepptr],edx
|
||||
jmp .drw
|
||||
.ex:
|
||||
ret
|
||||
|
||||
OR_maze:
|
||||
file 'omaze.bin'
|
||||
|
||||
OR_level:
|
||||
file 'or2.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
OR_help mstr \
|
||||
'™¥«ç®ª ¢ë¤¥«¥®© ª«¥âª¥ ¯¥à¥¤¢¨£ ¥â ¨«¨',\
|
||||
'¢à é ¥â ªà áãî áâ५ªã. ‘¨¨© ¡«®ª ¤¥©áâ¢ã¥â',\
|
||||
'ª ª ¯à¥¯ïâá⢨¥, áªàë¢ ï ®¤ã ª«¥âªã. <20>à¨',\
|
||||
'¯¥à¥å®¤¥ áâ५ª¨ ª«¥âªã ᨥ£® ¡«®ª ®¨',\
|
||||
'¯®¬¥ïîâáï ¬¥áâ ¬¨. ‡ ¤ ç - ¯à®¢¥á⨠ªà áãî',\
|
||||
'áâ५ªã ¨§ ¨¦¥© ª«¥âª¨ ¢ ¢¥àåîî.','',\
|
||||
'http://www.clickmazes.com' ; FIXME: Check link works
|
||||
else ; Default to en_US
|
||||
OR_help mstr \
|
||||
'Click on a highlighted square to move or rotate',\
|
||||
'the red pointer. The blue switcher acts as an',\
|
||||
'obstacle, hiding one square. The red pointer and',\
|
||||
'blue switcher will swap places if the red pointer',\
|
||||
'is pushed onto a square occupied by a blue',\
|
||||
'switcher. Your challenge is to negotiate the red',\
|
||||
'arrow from the bottom to the top square.','',\
|
||||
'http://www.clickmazes.com' ; FIXME: Check link works
|
||||
end if
|
||||
|
@ -1,94 +1,96 @@
|
||||
SMZ_levelp:
|
||||
call get_xy_sf
|
||||
xor eax,eax
|
||||
mov [stepptr],esi
|
||||
lodsb
|
||||
mov [cur_step],esi
|
||||
add esi,eax
|
||||
mov [levptr],esi
|
||||
call unpack_level
|
||||
ret
|
||||
|
||||
SMZ_key:
|
||||
cmp eax,176
|
||||
jb .ex
|
||||
cmp eax,179
|
||||
ja .ex
|
||||
mov ecx,[cur_step]
|
||||
movzx ecx,byte[ecx]
|
||||
lea ebx,[eax-176]
|
||||
mov eax,[player]
|
||||
.lp:
|
||||
call check_move
|
||||
jc .exl
|
||||
add eax,[dirs+ebx*4]
|
||||
loop .lp
|
||||
.exl:
|
||||
test ecx,ecx
|
||||
jne .ex
|
||||
mov [player],eax
|
||||
cmp eax,[finish]
|
||||
jne .nowin
|
||||
mov [win_flag],1
|
||||
.nowin:
|
||||
mov esi,[stepptr]
|
||||
movzx eax,byte[esi]
|
||||
inc esi
|
||||
lea ebx,[esi+eax]
|
||||
inc [cur_step]
|
||||
cmp [cur_step],ebx
|
||||
jb .ex
|
||||
mov [cur_step],esi
|
||||
.ex:
|
||||
ret
|
||||
|
||||
SMZ_drawm:
|
||||
mov eax,[player]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff00
|
||||
mov eax,[finish]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff0000
|
||||
cmp [win_flag],1
|
||||
je .ex
|
||||
mov edi,[stepptr]
|
||||
movzx ecx,byte[edi]
|
||||
inc edi
|
||||
mov edx,(XFOFS+MSGXO) shl 16+42
|
||||
mov ebx,0x010000
|
||||
mov eax,47
|
||||
.lp:
|
||||
push ecx
|
||||
mov esi,0x10000000
|
||||
movzx ecx,byte[edi]
|
||||
cmp edi,[cur_step]
|
||||
jne .nocur
|
||||
mov esi,0x100000ff
|
||||
mcall
|
||||
add edx,1 shl 16
|
||||
.nocur:
|
||||
mcall
|
||||
pop ecx
|
||||
add edx,10 shl 16
|
||||
inc edi
|
||||
loop .lp
|
||||
.ex:
|
||||
ret
|
||||
|
||||
SMZ_level:
|
||||
file 'smz.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
SMZ_help mstr \
|
||||
'𧎚T桌鴭漭 祚嶉奶恥罱市鴙桑碪 摰亢<E691B0>, 丐見𩤃',\
|
||||
'坏咱卿<E592B1> 炎𨸹<E7828E><F0A8B8B9> <20> 祚戶╞蟡限恭 狙咧蟡摵╳ 物乒悚',\
|
||||
'祚 能麍悟, 祚<> 郊 亢摵見郊漭 芹<>陋ㄝ 炎𨸹<E7828E><F0A8B8B9>.','',\
|
||||
'http://puzzleprograms.narod.ru'
|
||||
else
|
||||
SMZ_help mstr \
|
||||
'Repeat sequence shown above the field moving the',\
|
||||
'green square by highlighted count of spaces as',\
|
||||
'many times as you like, until you finish at the',\
|
||||
'red square.','',\
|
||||
'http://puzzleprograms.narod.ru'
|
||||
end if
|
||||
; Language support for locales: ru_RU (CP866), en_US.
|
||||
|
||||
SMZ_levelp:
|
||||
call get_xy_sf
|
||||
xor eax,eax
|
||||
mov [stepptr],esi
|
||||
lodsb
|
||||
mov [cur_step],esi
|
||||
add esi,eax
|
||||
mov [levptr],esi
|
||||
call unpack_level
|
||||
ret
|
||||
|
||||
SMZ_key:
|
||||
cmp eax,176
|
||||
jb .ex
|
||||
cmp eax,179
|
||||
ja .ex
|
||||
mov ecx,[cur_step]
|
||||
movzx ecx,byte[ecx]
|
||||
lea ebx,[eax-176]
|
||||
mov eax,[player]
|
||||
.lp:
|
||||
call check_move
|
||||
jc .exl
|
||||
add eax,[dirs+ebx*4]
|
||||
loop .lp
|
||||
.exl:
|
||||
test ecx,ecx
|
||||
jne .ex
|
||||
mov [player],eax
|
||||
cmp eax,[finish]
|
||||
jne .nowin
|
||||
mov [win_flag],1
|
||||
.nowin:
|
||||
mov esi,[stepptr]
|
||||
movzx eax,byte[esi]
|
||||
inc esi
|
||||
lea ebx,[esi+eax]
|
||||
inc [cur_step]
|
||||
cmp [cur_step],ebx
|
||||
jb .ex
|
||||
mov [cur_step],esi
|
||||
.ex:
|
||||
ret
|
||||
|
||||
SMZ_drawm:
|
||||
mov eax,[player]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff00
|
||||
mov eax,[finish]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff0000
|
||||
cmp [win_flag],1
|
||||
je .ex
|
||||
mov edi,[stepptr]
|
||||
movzx ecx,byte[edi]
|
||||
inc edi
|
||||
mov edx,(XFOFS+MSGXO) shl 16+42
|
||||
mov ebx,0x010000
|
||||
mov eax,47
|
||||
.lp:
|
||||
push ecx
|
||||
mov esi,0x10000000
|
||||
movzx ecx,byte[edi]
|
||||
cmp edi,[cur_step]
|
||||
jne .nocur
|
||||
mov esi,0x100000ff
|
||||
mcall
|
||||
add edx,1 shl 16
|
||||
.nocur:
|
||||
mcall
|
||||
pop ecx
|
||||
add edx,10 shl 16
|
||||
inc edi
|
||||
loop .lp
|
||||
.ex:
|
||||
ret
|
||||
|
||||
SMZ_level:
|
||||
file 'smz.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
SMZ_help mstr \
|
||||
'𧎚T桌鴭漭 祚嶉奶恥罱市鴙桑碪 摰亢<E691B0>, 丐見𩤃',\
|
||||
'坏咱卿<E592B1> 炎𨸹<E7828E><F0A8B8B9> <20> 祚戶╞蟡限恭 狙咧蟡摵╳ 物乒悚',\
|
||||
'祚 能麍悟, 祚<> 郊 亢摵見郊漭 芹<>陋ㄝ 炎𨸹<E7828E><F0A8B8B9>.','',\
|
||||
'http://puzzleprograms.narod.ru' ; FIXME: Check link works
|
||||
else ; Default to en_US
|
||||
SMZ_help mstr \
|
||||
'Repeat sequence shown above the field moving the',\
|
||||
'green square by highlighted count of spaces as',\
|
||||
'many times as you like, until you finish at the',\
|
||||
'red square.','',\
|
||||
'http://puzzleprograms.narod.ru' ; FIXME: Check link works
|
||||
end if
|
||||
|
@ -1,164 +1,166 @@
|
||||
TM_levelp:
|
||||
call get_xy_sf
|
||||
mov [levptr],esi
|
||||
call unpack_level
|
||||
ret
|
||||
|
||||
TM_key:
|
||||
cmp eax,' '
|
||||
je .mm
|
||||
cmp eax,176
|
||||
jb .still
|
||||
cmp eax,179
|
||||
ja .still
|
||||
lea ebx,[eax-176]
|
||||
mov eax,[teseus]
|
||||
call check_move
|
||||
jc .still
|
||||
call move_teseus
|
||||
cmp [win_flag],0
|
||||
jne .ex
|
||||
.nowin:
|
||||
call drwfld
|
||||
.mm:
|
||||
call move_minotaur
|
||||
cmp eax,[teseus]
|
||||
jne .still
|
||||
mov [win_flag],2
|
||||
jmp .ex
|
||||
.still:
|
||||
mov [jump],still
|
||||
.ex:
|
||||
ret
|
||||
|
||||
move_minotaur:
|
||||
xor esi,esi
|
||||
mov eax,[teseus]
|
||||
mov ebx,[fx]
|
||||
div bl
|
||||
mov ecx,eax ;teseus: ch-x, cl-y
|
||||
mov eax,[minotaur]
|
||||
.again:
|
||||
call mino_xy
|
||||
xor ebx,ebx
|
||||
cmp dh,ch
|
||||
je .stand2
|
||||
ja .ok1
|
||||
add ebx,3
|
||||
.ok1:
|
||||
call check_move
|
||||
jc .stand2
|
||||
add eax,[dirs+ebx*4]
|
||||
mov [minotaur],eax
|
||||
inc esi
|
||||
call delay
|
||||
call drwfld
|
||||
cmp esi,2
|
||||
jb .again
|
||||
jmp .ex
|
||||
.stand1:
|
||||
call mino_xy
|
||||
.stand2:
|
||||
mov ebx,2
|
||||
cmp dl,cl
|
||||
je .ex
|
||||
ja .ok2
|
||||
dec ebx
|
||||
.ok2:
|
||||
call check_move
|
||||
jc .ex
|
||||
add eax,[dirs+ebx*4]
|
||||
mov [minotaur],eax
|
||||
inc esi
|
||||
call delay
|
||||
call drwfld
|
||||
cmp esi,2
|
||||
jb .again
|
||||
.ex:
|
||||
ret
|
||||
|
||||
mino_xy:
|
||||
push eax
|
||||
div byte[fx]
|
||||
mov edx,eax ;minotaur: dh-x, dl-y
|
||||
pop eax
|
||||
ret
|
||||
|
||||
move_teseus:
|
||||
pusha
|
||||
cdq
|
||||
mov ecx,[fx]
|
||||
div cl
|
||||
add ax,1 shl 8+1
|
||||
test ebx,ebx
|
||||
jne .no0
|
||||
cmp ah,1
|
||||
jne .move
|
||||
.win:
|
||||
inc [win_flag]
|
||||
jmp .ex
|
||||
.no0:
|
||||
cmp ebx,1
|
||||
jne .no1
|
||||
cmp al,byte[fy]
|
||||
je .win
|
||||
jmp .move
|
||||
.no1:
|
||||
cmp ebx,2
|
||||
jne .no2
|
||||
cmp al,1
|
||||
je .win
|
||||
jmp .move
|
||||
.no2:
|
||||
cmp ebx,3
|
||||
jne .move
|
||||
cmp ah,byte[fx]
|
||||
je .win
|
||||
.move:
|
||||
mov eax,[esp+28]
|
||||
add eax,[dirs+ebx*4]
|
||||
mov [teseus],eax
|
||||
.ex:
|
||||
popa
|
||||
ret
|
||||
|
||||
TM_drawm:
|
||||
mov eax,[teseus]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff00
|
||||
mov eax,[minotaur]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff0000
|
||||
ret
|
||||
|
||||
TM_level:
|
||||
file 'tam.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
TM_help mstr \
|
||||
' ’¥á¥© (§¥«¥ë© ª¢ ¤à â) ¤®«¦¥ ã¡¥¦ âì ¨§',\
|
||||
'« ¡¨à¨â . ‡ ¨¬ £®¨âáï ¬¥å ¨ç¥áª¨© Œ¨®â ¢à',\
|
||||
'(ªà áë© ª¢ ¤à â). <20> ª ¦¤ë© 室 ’¥á¥© Œ¨®â ¢à',\
|
||||
'¤¥« ¥â 2 室 ¯® â ª®© á奬¥:',\
|
||||
' ‘ ç « ® ¯ëâ ¥âáï ¯à¨¡«¨§¨âìáï ª ’¥á¥î ¯®',\
|
||||
'£®à¨§®â «¨ 1 ª¢ ¤à â. …᫨ íâ® ¥¢®§¬®¦®,',\
|
||||
'® ¯ëâ ¥âáï ¯®¤®©â¨ ¯® ¢¥à⨪ «¨ 1 ª¢ ¤à â.',\
|
||||
'…᫨ ¥¢®§¬®¦® ᤥ« âì ¨ ⮣®, ¨ ¤à㣮£®,',\
|
||||
'Œ¨®â ¢à ¯à®¯ã᪠¥â ¤ ë© å®¤.','',\
|
||||
'http://puzzleprograms.narod.ru'
|
||||
else
|
||||
TM_help mstr \
|
||||
' Theseus (the green dot) must escape from a maze.',\
|
||||
'There is also a mechanical Minotaur (the red',\
|
||||
'dot) in each maze. For every turn that Theseus',\
|
||||
'takes, the Minotaur takes two turns.',\
|
||||
' Each turn he decides following:',\
|
||||
'First he tests if he can move horizontally and',\
|
||||
'get closer to Theseus. If he can, he will move',\
|
||||
"one square horizontally. If he can't, he will",\
|
||||
'test if he could move vertically and get closer',\
|
||||
'to Theseus. If he can, he will move one square',\
|
||||
"vertically. If he can't move either horizontally",\
|
||||
'or vertically, then he just skips that turn.','',\
|
||||
'http://puzzleprograms.narod.ru'
|
||||
end if
|
||||
; Language support for locales: ru_RU (CP866), en_US.
|
||||
|
||||
TM_levelp:
|
||||
call get_xy_sf
|
||||
mov [levptr],esi
|
||||
call unpack_level
|
||||
ret
|
||||
|
||||
TM_key:
|
||||
cmp eax,' '
|
||||
je .mm
|
||||
cmp eax,176
|
||||
jb .still
|
||||
cmp eax,179
|
||||
ja .still
|
||||
lea ebx,[eax-176]
|
||||
mov eax,[teseus]
|
||||
call check_move
|
||||
jc .still
|
||||
call move_teseus
|
||||
cmp [win_flag],0
|
||||
jne .ex
|
||||
.nowin:
|
||||
call drwfld
|
||||
.mm:
|
||||
call move_minotaur
|
||||
cmp eax,[teseus]
|
||||
jne .still
|
||||
mov [win_flag],2
|
||||
jmp .ex
|
||||
.still:
|
||||
mov [jump],still
|
||||
.ex:
|
||||
ret
|
||||
|
||||
move_minotaur:
|
||||
xor esi,esi
|
||||
mov eax,[teseus]
|
||||
mov ebx,[fx]
|
||||
div bl
|
||||
mov ecx,eax ;teseus: ch-x, cl-y
|
||||
mov eax,[minotaur]
|
||||
.again:
|
||||
call mino_xy
|
||||
xor ebx,ebx
|
||||
cmp dh,ch
|
||||
je .stand2
|
||||
ja .ok1
|
||||
add ebx,3
|
||||
.ok1:
|
||||
call check_move
|
||||
jc .stand2
|
||||
add eax,[dirs+ebx*4]
|
||||
mov [minotaur],eax
|
||||
inc esi
|
||||
call delay
|
||||
call drwfld
|
||||
cmp esi,2
|
||||
jb .again
|
||||
jmp .ex
|
||||
.stand1:
|
||||
call mino_xy
|
||||
.stand2:
|
||||
mov ebx,2
|
||||
cmp dl,cl
|
||||
je .ex
|
||||
ja .ok2
|
||||
dec ebx
|
||||
.ok2:
|
||||
call check_move
|
||||
jc .ex
|
||||
add eax,[dirs+ebx*4]
|
||||
mov [minotaur],eax
|
||||
inc esi
|
||||
call delay
|
||||
call drwfld
|
||||
cmp esi,2
|
||||
jb .again
|
||||
.ex:
|
||||
ret
|
||||
|
||||
mino_xy:
|
||||
push eax
|
||||
div byte[fx]
|
||||
mov edx,eax ;minotaur: dh-x, dl-y
|
||||
pop eax
|
||||
ret
|
||||
|
||||
move_teseus:
|
||||
pusha
|
||||
cdq
|
||||
mov ecx,[fx]
|
||||
div cl
|
||||
add ax,1 shl 8+1
|
||||
test ebx,ebx
|
||||
jne .no0
|
||||
cmp ah,1
|
||||
jne .move
|
||||
.win:
|
||||
inc [win_flag]
|
||||
jmp .ex
|
||||
.no0:
|
||||
cmp ebx,1
|
||||
jne .no1
|
||||
cmp al,byte[fy]
|
||||
je .win
|
||||
jmp .move
|
||||
.no1:
|
||||
cmp ebx,2
|
||||
jne .no2
|
||||
cmp al,1
|
||||
je .win
|
||||
jmp .move
|
||||
.no2:
|
||||
cmp ebx,3
|
||||
jne .move
|
||||
cmp ah,byte[fx]
|
||||
je .win
|
||||
.move:
|
||||
mov eax,[esp+28]
|
||||
add eax,[dirs+ebx*4]
|
||||
mov [teseus],eax
|
||||
.ex:
|
||||
popa
|
||||
ret
|
||||
|
||||
TM_drawm:
|
||||
mov eax,[teseus]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff00
|
||||
mov eax,[minotaur]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff0000
|
||||
ret
|
||||
|
||||
TM_level:
|
||||
file 'tam.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
TM_help mstr \
|
||||
' ’¥á¥© (§¥«¥ë© ª¢ ¤à â) ¤®«¦¥ ã¡¥¦ âì ¨§',\
|
||||
'« ¡¨à¨â . ‡ ¨¬ £®¨âáï ¬¥å ¨ç¥áª¨© Œ¨®â ¢à',\
|
||||
'(ªà áë© ª¢ ¤à â). <20> ª ¦¤ë© 室 ’¥á¥© Œ¨®â ¢à',\
|
||||
'¤¥« ¥â 2 室 ¯® â ª®© á奬¥:',\
|
||||
' ‘ ç « ® ¯ëâ ¥âáï ¯à¨¡«¨§¨âìáï ª ’¥á¥î ¯®',\
|
||||
'£®à¨§®â «¨ 1 ª¢ ¤à â. …᫨ íâ® ¥¢®§¬®¦®,',\
|
||||
'® ¯ëâ ¥âáï ¯®¤®©â¨ ¯® ¢¥à⨪ «¨ 1 ª¢ ¤à â.',\
|
||||
'…᫨ ¥¢®§¬®¦® ᤥ« âì ¨ ⮣®, ¨ ¤à㣮£®,',\
|
||||
'Œ¨®â ¢à ¯à®¯ã᪠¥â ¤ ë© å®¤.','',\
|
||||
'http://puzzleprograms.narod.ru' ; FIXME: Check link works
|
||||
else ; Default to en_US
|
||||
TM_help mstr \
|
||||
' Theseus (the green dot) must escape from a maze.',\
|
||||
'There is also a mechanical Minotaur (the red',\
|
||||
'dot) in each maze. For every turn that Theseus',\
|
||||
'takes, the Minotaur takes two turns.',\
|
||||
' Each turn he decides following:',\
|
||||
'First he tests if he can move horizontally and',\
|
||||
'get closer to Theseus. If he can, he will move',\
|
||||
"one square horizontally. If he can't, he will",\
|
||||
'test if he could move vertically and get closer',\
|
||||
'to Theseus. If he can, he will move one square',\
|
||||
"vertically. If he can't move either horizontally",\
|
||||
'or vertically, then he just skips that turn.','',\
|
||||
'http://puzzleprograms.narod.ru' ; FIXME: Check link works
|
||||
end if
|
||||
|
@ -1,93 +1,95 @@
|
||||
TILT_levelp:
|
||||
call SMZ_levelp
|
||||
mov esi,[stepptr]
|
||||
movzx ecx,byte[esi]
|
||||
mov [finish],ecx
|
||||
inc ecx
|
||||
mov edi,area
|
||||
rep movsb
|
||||
mov [pause_time],10
|
||||
ret
|
||||
|
||||
TILT_key:
|
||||
cmp eax,176
|
||||
jb .ex
|
||||
cmp eax,179
|
||||
ja .ex
|
||||
mov esi,area
|
||||
inc esi
|
||||
lea ebx,[eax-176]
|
||||
mov eax,[player]
|
||||
.lp:
|
||||
call check_move
|
||||
jc .ex1
|
||||
add eax,[dirs+ebx*4]
|
||||
movzx ecx,byte[esi-1]
|
||||
mov edi,esi
|
||||
repne scasb
|
||||
jne .notfound
|
||||
mov byte[edi-1],0xff
|
||||
dec dword[finish]
|
||||
.notfound:
|
||||
mov [player],eax
|
||||
call delay
|
||||
call drwfld
|
||||
jmp .lp
|
||||
.ex1:
|
||||
cmp dword[finish],0
|
||||
jnz .ex
|
||||
mov [win_flag],1
|
||||
.ex:
|
||||
ret
|
||||
|
||||
TILT_drawm:
|
||||
mov eax,[player]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff00
|
||||
cmp [win_flag],1
|
||||
je .ex
|
||||
mov edi,area
|
||||
movzx ecx,byte[edi]
|
||||
jecxz .ex
|
||||
inc edi
|
||||
.lp:
|
||||
push ecx
|
||||
movzx eax,byte[edi]
|
||||
cmp eax,0xff
|
||||
je .no
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff0000
|
||||
.no:
|
||||
pop ecx
|
||||
inc edi
|
||||
loop .lp
|
||||
.ex:
|
||||
ret
|
||||
|
||||
TILT_level:
|
||||
file 'tilt.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
TILT_help mstr \
|
||||
'<27>« èª (§¥«¥ë© ª¢ ¤à â) «¥¦¨â ¤®áª¥, ª®â®àãî',\
|
||||
'¬®¦® ª«®ïâì ¯® £®à¨§®â «¨ ¨ ¢¥à⨪ «¨',\
|
||||
' <20>®á«¥ ª«® ¯« èª áª®«ì§¨â, ¯®ª ¥ ⪥âáï',\
|
||||
' á⥪ã. <20>¥«ì§ï ®áâ ®¢¨âì ¯« èªã ¢® á¥à¥¤¨¥',\
|
||||
'¯ãâ¨.',\
|
||||
' ‚ è § ¤ ç - § áâ ¢¨âì ¯« èªã ¯®á¥â¨âì ª«¥âª¨',\
|
||||
'á ªà á묨 ª¢ ¤à â ¬¨.','',\
|
||||
'http://www.clickmazes.com'
|
||||
else
|
||||
TILT_help mstr \
|
||||
'You are to imagine that a marble (shown here as a',\
|
||||
'green square) is on a board that you can tilt',\
|
||||
'only to the north, south, east, or west. (You',\
|
||||
"can't do anything tricky like tilt it southeast.)",\
|
||||
' Once you tilt the board, the marble will roll',\
|
||||
'(horizontally or vertically) until it hits a',\
|
||||
"barrier. There's no way you can stop the marble",\
|
||||
'in the middle of its roll.',\
|
||||
' The object is to roll the marble onto or over',\
|
||||
'every red square in the maze.','',\
|
||||
'http://www.clickmazes.com'
|
||||
end if
|
||||
; Language support for locales: ru_RU (CP866), en_US.
|
||||
|
||||
TILT_levelp:
|
||||
call SMZ_levelp
|
||||
mov esi,[stepptr]
|
||||
movzx ecx,byte[esi]
|
||||
mov [finish],ecx
|
||||
inc ecx
|
||||
mov edi,area
|
||||
rep movsb
|
||||
mov [pause_time],10
|
||||
ret
|
||||
|
||||
TILT_key:
|
||||
cmp eax,176
|
||||
jb .ex
|
||||
cmp eax,179
|
||||
ja .ex
|
||||
mov esi,area
|
||||
inc esi
|
||||
lea ebx,[eax-176]
|
||||
mov eax,[player]
|
||||
.lp:
|
||||
call check_move
|
||||
jc .ex1
|
||||
add eax,[dirs+ebx*4]
|
||||
movzx ecx,byte[esi-1]
|
||||
mov edi,esi
|
||||
repne scasb
|
||||
jne .notfound
|
||||
mov byte[edi-1],0xff
|
||||
dec dword[finish]
|
||||
.notfound:
|
||||
mov [player],eax
|
||||
call delay
|
||||
call drwfld
|
||||
jmp .lp
|
||||
.ex1:
|
||||
cmp dword[finish],0
|
||||
jnz .ex
|
||||
mov [win_flag],1
|
||||
.ex:
|
||||
ret
|
||||
|
||||
TILT_drawm:
|
||||
mov eax,[player]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff00
|
||||
cmp [win_flag],1
|
||||
je .ex
|
||||
mov edi,area
|
||||
movzx ecx,byte[edi]
|
||||
jecxz .ex
|
||||
inc edi
|
||||
.lp:
|
||||
push ecx
|
||||
movzx eax,byte[edi]
|
||||
cmp eax,0xff
|
||||
je .no
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff0000
|
||||
.no:
|
||||
pop ecx
|
||||
inc edi
|
||||
loop .lp
|
||||
.ex:
|
||||
ret
|
||||
|
||||
TILT_level:
|
||||
file 'tilt.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
TILT_help mstr \
|
||||
'<27>« èª (§¥«¥ë© ª¢ ¤à â) «¥¦¨â ¤®áª¥, ª®â®àãî',\
|
||||
'¬®¦® ª«®ïâì ¯® £®à¨§®â «¨ ¨ ¢¥à⨪ «¨',\
|
||||
' <20>®á«¥ ª«® ¯« èª áª®«ì§¨â, ¯®ª ¥ ⪥âáï',\
|
||||
' á⥪ã. <20>¥«ì§ï ®áâ ®¢¨âì ¯« èªã ¢® á¥à¥¤¨¥',\
|
||||
'¯ãâ¨.',\
|
||||
' ‚ è § ¤ ç - § áâ ¢¨âì ¯« èªã ¯®á¥â¨âì ª«¥âª¨',\
|
||||
'á ªà á묨 ª¢ ¤à â ¬¨.','',\
|
||||
'http://www.clickmazes.com'
|
||||
else ; Default to en_US
|
||||
TILT_help mstr \
|
||||
'You are to imagine that a marble (shown here as a',\
|
||||
'green square) is on a board that you can tilt',\
|
||||
'only to the north, south, east, or west. (You',\
|
||||
"can't do anything tricky like tilt it southeast.)",\
|
||||
' Once you tilt the board, the marble will roll',\
|
||||
'(horizontally or vertically) until it hits a',\
|
||||
"barrier. There's no way you can stop the marble",\
|
||||
'in the middle of its roll.',\
|
||||
' The object is to roll the marble onto or over',\
|
||||
'every red square in the maze.','',\
|
||||
'http://www.clickmazes.com'
|
||||
end if
|
||||
|
@ -1,105 +1,107 @@
|
||||
; level format
|
||||
; [fx|fy][blue xy][red xy][blue point xy][red point xy]..[maze walls]
|
||||
|
||||
; internal format
|
||||
; points db=[stepptr]
|
||||
; [player]= blue
|
||||
; [finish]= red
|
||||
; area: ..[1-red,0-black xy].. ( -1 if empty)
|
||||
|
||||
TILT2_levelp:
|
||||
call get_xy_sf
|
||||
mov [stepptr],esi
|
||||
add esi,2
|
||||
call unpack_level
|
||||
mov [pause_time],10
|
||||
ret
|
||||
|
||||
TILT2_key:
|
||||
cmp eax,176
|
||||
jb .ex
|
||||
cmp eax,179
|
||||
ja .ex
|
||||
mov esi,area
|
||||
inc esi
|
||||
lea ebx,[eax-176]
|
||||
.lp:
|
||||
xor edx,edx
|
||||
mov eax,[player]
|
||||
call check_move
|
||||
jc .nom1
|
||||
inc edx
|
||||
add eax,[dirs+ebx*4]
|
||||
mov [player],eax
|
||||
.nom1:
|
||||
mov eax,[finish]
|
||||
call check_move
|
||||
jc .nom2
|
||||
inc edx
|
||||
add eax,[dirs+ebx*4]
|
||||
mov [finish],eax
|
||||
.nom2:
|
||||
test edx,edx
|
||||
jz .ex1
|
||||
call delay
|
||||
call drwfld
|
||||
jmp .lp
|
||||
.ex1:
|
||||
mov eax,[finish]
|
||||
cmp eax,[player]
|
||||
jnz .ex2
|
||||
mov [win_flag],2
|
||||
jmp TILT2_drawm.skip
|
||||
.ex2:
|
||||
mov esi,[stepptr]
|
||||
cmp al,[esi+1]
|
||||
jne .ex
|
||||
mov eax,[player]
|
||||
cmp al,[esi]
|
||||
jne .ex
|
||||
mov [win_flag],1
|
||||
.ex:
|
||||
ret
|
||||
|
||||
TILT2_drawm:
|
||||
cmp [win_flag],2
|
||||
je .skip
|
||||
; mov [sq_size],3
|
||||
mov eax,[player]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff
|
||||
mov eax,[finish]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff0000
|
||||
.skip:
|
||||
shl [sq_size],1
|
||||
mov esi,[stepptr]
|
||||
lodsb
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff
|
||||
lodsb
|
||||
call get_xy
|
||||
shr [sq_size],1
|
||||
mcall 13,[lx],[ly],0xff0000
|
||||
ret
|
||||
|
||||
TILT2_level:
|
||||
file 'tilt2.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
TILT2_help mstr \
|
||||
'Šà áë© ¨ ᨨ© ¡«®ª¨ ¤®«¦ë ¤®áâ¨çì ª«¥â®ª',\
|
||||
'ᮮ⢥âáâ¢ãî饣® 梥â . ‚¨¬ ¨¥! <20>«®ª¨ ᤥ« ë',\
|
||||
'¨§ £à¥áᨢ®£® ¬ â¥à¨ « , ¨ ¯à¨ á⮫ª®¢¥¨¨',\
|
||||
'¬£®¢¥® ¨á¯ àïîâáï. ‚ í⮬ á«ãç ¥ ‚ ¬ ¯à¨¤¥âáï',\
|
||||
' ç âì ã஢¥ì á ç « .','',\
|
||||
'http://www.clickmazes.com'
|
||||
else
|
||||
TILT2_help mstr \
|
||||
'The red block must reach the red target and the',\
|
||||
'blue block the blue target. Beware! The two',\
|
||||
'blocks are made of highly reactive material and,',\
|
||||
'if they collide, will instantly evaporate. At',\
|
||||
'this point you must start all over again.','',\
|
||||
'http://www.clickmazes.com'
|
||||
end if
|
||||
; Language support for locales: ru_RU (CP866), en_US.
|
||||
|
||||
; level format
|
||||
; [fx|fy][blue xy][red xy][blue point xy][red point xy]..[maze walls]
|
||||
|
||||
; internal format
|
||||
; points db=[stepptr]
|
||||
; [player]= blue
|
||||
; [finish]= red
|
||||
; area: ..[1-red,0-black xy].. ( -1 if empty)
|
||||
|
||||
TILT2_levelp:
|
||||
call get_xy_sf
|
||||
mov [stepptr],esi
|
||||
add esi,2
|
||||
call unpack_level
|
||||
mov [pause_time],10
|
||||
ret
|
||||
|
||||
TILT2_key:
|
||||
cmp eax,176
|
||||
jb .ex
|
||||
cmp eax,179
|
||||
ja .ex
|
||||
mov esi,area
|
||||
inc esi
|
||||
lea ebx,[eax-176]
|
||||
.lp:
|
||||
xor edx,edx
|
||||
mov eax,[player]
|
||||
call check_move
|
||||
jc .nom1
|
||||
inc edx
|
||||
add eax,[dirs+ebx*4]
|
||||
mov [player],eax
|
||||
.nom1:
|
||||
mov eax,[finish]
|
||||
call check_move
|
||||
jc .nom2
|
||||
inc edx
|
||||
add eax,[dirs+ebx*4]
|
||||
mov [finish],eax
|
||||
.nom2:
|
||||
test edx,edx
|
||||
jz .ex1
|
||||
call delay
|
||||
call drwfld
|
||||
jmp .lp
|
||||
.ex1:
|
||||
mov eax,[finish]
|
||||
cmp eax,[player]
|
||||
jnz .ex2
|
||||
mov [win_flag],2
|
||||
jmp TILT2_drawm.skip
|
||||
.ex2:
|
||||
mov esi,[stepptr]
|
||||
cmp al,[esi+1]
|
||||
jne .ex
|
||||
mov eax,[player]
|
||||
cmp al,[esi]
|
||||
jne .ex
|
||||
mov [win_flag],1
|
||||
.ex:
|
||||
ret
|
||||
|
||||
TILT2_drawm:
|
||||
cmp [win_flag],2
|
||||
je .skip
|
||||
; mov [sq_size],3
|
||||
mov eax,[player]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff
|
||||
mov eax,[finish]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff0000
|
||||
.skip:
|
||||
shl [sq_size],1
|
||||
mov esi,[stepptr]
|
||||
lodsb
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff
|
||||
lodsb
|
||||
call get_xy
|
||||
shr [sq_size],1
|
||||
mcall 13,[lx],[ly],0xff0000
|
||||
ret
|
||||
|
||||
TILT2_level:
|
||||
file 'tilt2.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
TILT2_help mstr \
|
||||
'Šà áë© ¨ ᨨ© ¡«®ª¨ ¤®«¦ë ¤®áâ¨çì ª«¥â®ª',\
|
||||
'ᮮ⢥âáâ¢ãî饣® 梥â . ‚¨¬ ¨¥! <20>«®ª¨ ᤥ« ë',\
|
||||
'¨§ £à¥áᨢ®£® ¬ â¥à¨ « , ¨ ¯à¨ á⮫ª®¢¥¨¨',\
|
||||
'¬£®¢¥® ¨á¯ àïîâáï. ‚ í⮬ á«ãç ¥ ‚ ¬ ¯à¨¤¥âáï',\
|
||||
' ç âì ã஢¥ì á ç « .','',\
|
||||
'http://www.clickmazes.com'
|
||||
else ; Default to en_US
|
||||
TILT2_help mstr \
|
||||
'The red block must reach the red target and the',\
|
||||
'blue block the blue target. Beware! The two',\
|
||||
'blocks are made of highly reactive material and,',\
|
||||
'if they collide, will instantly evaporate. At',\
|
||||
'this point you must start all over again.','',\
|
||||
'http://www.clickmazes.com'
|
||||
end if
|
||||
|
@ -241,7 +241,7 @@ if lang eq ru_RU
|
||||
'—¥à¢ïª¨ ¥ ¬®£ãâ ¯¥à¥ªàë¢ âì ¨ ¯¥à¥á¥ª âì ¤àã£',\
|
||||
'¤à㣠.','',\
|
||||
'http://www.clickmazes.com'
|
||||
else
|
||||
else ; Default to en_US
|
||||
WG_help mstr \
|
||||
'Your aim is to drag the wriggley worms by head or',\
|
||||
'tail until each worm covers the squares of its',\
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -456,10 +456,10 @@ is_dn1 dd 0x0 ; |
|
||||
is_up2 dd 0x0 ; |
|
||||
is_dn2 dd 0x0 ; /
|
||||
|
||||
include "lang.inc"
|
||||
include "lang.inc" ; Language support for locales: ru_RU (CP866), en_US.
|
||||
if lang eq ru_RU
|
||||
include "russian.inc"
|
||||
else
|
||||
else ; Default to en_US
|
||||
include "english.inc"
|
||||
end if
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,241 +1,242 @@
|
||||
; SQ_game for MenuetOS
|
||||
; Author: Alexei Ershov aka ealex
|
||||
; E-mail: e-al[at]yandex[dot]ru
|
||||
; Fidonet: 2:469/335.38
|
||||
; slightly updated by leency and renamed to Lights
|
||||
; https://en.wikipedia.org/wiki/Lights_Out_(game)
|
||||
; slightly optimized by diamond
|
||||
; english translation by diamond (two strings in end of source)
|
||||
|
||||
|
||||
BtnSize equ 36 ; à §¬¥à ª®¯ª¨
|
||||
BtnSpace equ 0 ; ¯à®¬¥¦ã⮪ ¬¥¦¤ã ª®¯ª ¬¨
|
||||
NofBtn equ 4 ; à §¬¥à ¯®«ï (3-15)
|
||||
Color1 equ 0xcc0000
|
||||
Color2 equ 0x00cc00
|
||||
|
||||
FieldSize = (BtnSize+BtnSpace)*NofBtn + BtnSpace*3
|
||||
center = FieldSize / 2
|
||||
margin = 20
|
||||
|
||||
|
||||
use32 ; ¢ª«îç¨âì 32-¡¨âë© à¥¦¨¬ áᥬ¡«¥à
|
||||
org 0x0 ; ¤à¥á æ¨ï á ã«ï
|
||||
|
||||
db 'MENUET01' ; 8-¡ ©âë© ¨¤¥â¨ä¨ª â®à MenuetOS
|
||||
dd 0x01 ; ¢¥àá¨ï § £®«®¢ª (¢á¥£¤ 1)
|
||||
dd START ; ¤à¥á ¯¥à¢®© ª®¬ ¤ë
|
||||
dd I_END ; à §¬¥à ¯à®£à ¬¬ë
|
||||
dd 0x1000 ; ª®«¨ç¥á⢮ ¯ ¬ïâ¨
|
||||
dd 0x1000 ; ¤à¥á ¢¥àè¨ë áâíª
|
||||
dd 0x0 ; ¤à¥á ¡ãä¥à ¤«ï ¯ à ¬¥â஢ (¥ ¨á¯®«ì§ã¥âáï)
|
||||
dd 0x0 ; § १¥à¢¨à®¢ ®
|
||||
|
||||
include '../../../macros.inc' ; ¬ ªà®áë ®¡«¥£ç îâ ¦¨§ì áᥬ¡«¥à騪®¢!
|
||||
|
||||
|
||||
START:
|
||||
call Game_Init
|
||||
red:
|
||||
call Draw_Window
|
||||
|
||||
still:
|
||||
mcall 10 ; äãªæ¨ï 10 - ¦¤ âì ᮡëâ¨ï
|
||||
dec eax
|
||||
jz red
|
||||
dec eax
|
||||
jnz button
|
||||
|
||||
key: ; ¦ â ª« ¢¨è ª« ¢¨ âãà¥
|
||||
mov al, 2
|
||||
int 0x40
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
button:
|
||||
mov al, 17 ; 17 - ¯®«ãç¨âì ¨¤¥â¨ä¨ª â®à ¦ ⮩ ª®¯ª¨
|
||||
int 0x40
|
||||
cmp ah, 1 ; ¥á«¨ ¦ â ª®¯ª á ®¬¥à®¬ 1, ¢ë室¨¬
|
||||
je .exit
|
||||
|
||||
cmp ah, 2 ; ¥á«¨ ¦ â ª®¯ª 2, ç¨ ¥¬ ®¢ãî ¨£àã
|
||||
je START
|
||||
|
||||
; <20> ¦ ª®¯ª ¯®«¥
|
||||
inc dword [moves] ; 㢥«¨ç¨¢ ¥¬ ç¨á«® 室®¢
|
||||
|
||||
shr eax, 8 ; ¢ eax ¨¤¥â¨ä¨ª â®à ¦ ⮩ ª®¯ª¨
|
||||
|
||||
mov dh, NofBtn
|
||||
div dh ; al = ax(®¬¥à ª®¯ª¨) / NofBtn
|
||||
; ah = ®áâ ⮪ (á¬. à¨á㮪)
|
||||
mov ebx, eax ; á®åà ¨¬ ç á⮥ ¨ ®áâ ⮪ ¢ ebx
|
||||
|
||||
; al\ah 0 1 2 3
|
||||
; +-+ +-+ +-+ +-+
|
||||
; 1 |4| |5| |6| |7|
|
||||
; +-+ +-+ +-+ +-+
|
||||
|
||||
; +-+ +-+ +-+ +-+
|
||||
; 2 |8| |9| |10 |11
|
||||
; +-+ +-+ +-+ +-+
|
||||
|
||||
; +-+ +-+ +-+ +-+
|
||||
; 3 |12 |13 |14 |15
|
||||
; +-+ +-+ +-+ +-+
|
||||
|
||||
; +-+ +-+ +-+ +-+
|
||||
; 4 |16 |17 |18 |19
|
||||
; +-+ +-+ +-+ +-+
|
||||
|
||||
; Œ¥ï¥¬ 梥â á⮫¡¨ª
|
||||
shr eax, 8 ; eax = ah
|
||||
mov edi, field
|
||||
add edi, eax ; edi 㪠§¢ë¥â ¯¥à¢ãî ª®¯ªã ¨ ¨áª®¬®¬ áâ«¡æ¥
|
||||
mov ecx, NofBtn
|
||||
@@:
|
||||
not byte[edi] ; ¬¥ï¥¬ 梥⠢® ¢á¥¬ á⮫¡¨ª¥
|
||||
dec ecx
|
||||
add edi, NofBtn
|
||||
test ecx, ecx
|
||||
jnz @r
|
||||
|
||||
; Œ¥ï¥¬ 梥â áâப¨
|
||||
mov eax, ebx ; ¢®ááâ ¢«¨¢ ¥¬ eax
|
||||
dec eax
|
||||
mov dl, NofBtn
|
||||
mul dl ; ax = al * NofBtn
|
||||
mov edi, field
|
||||
add edi, eax ; edi 㪠§¢ë¥â ¯¥à¢ãî ª®¯ªã ¢ ¨áª®¬®© áâப¥
|
||||
mov ecx, NofBtn
|
||||
@@:
|
||||
not byte [edi] ; ¬¥ï¥¬ 梥⠢® ¢á¥© áâப¥
|
||||
dec ecx
|
||||
inc edi
|
||||
test ecx, ecx
|
||||
jnz @r
|
||||
; –¢¥â ¦ ⮩ ª®¯ª¨ ¬¥ï«áï 2 à § (ª®£¤ ®¡à ¡ âë¢ «¨ áâப㠨 á⮫¡¥æ),
|
||||
; â.¥. ®áâ «áï ¯¥à¢® ç «ë¬
|
||||
; Œ¥ï¥¬ 梥⠦ ⮩ ª®¯ª¨
|
||||
shr ebx, 8 ; ebx = ®áâ ⮪ (ah à¨á㪥)
|
||||
not byte [field+eax+ebx]
|
||||
jmp red
|
||||
|
||||
|
||||
|
||||
.exit:
|
||||
mcall -1 ; ¨ ç¥ ª®¥æ ¯à®£à ¬¬ë
|
||||
|
||||
|
||||
;----------------------------------------------------------------------------
|
||||
; Draw_Window
|
||||
;----------------------------------------------------------------------------
|
||||
Draw_Window:
|
||||
|
||||
mcall 12, 1
|
||||
mcall 0, 200*65536+FieldSize+margin*2,\
|
||||
200*65536+FieldSize+28+margin*3,\
|
||||
0x14DDD7CF, 0x805080D0, header
|
||||
|
||||
mcall 8, (BtnSpace*2+margin)*65536 + 83,\
|
||||
(FieldSize+BtnSpace+margin*2+10)*65536+ 22, 2
|
||||
mcall 4, (BtnSpace*2+3+margin)*65536+(FieldSize+BtnSpace+margin*2)+14,\
|
||||
0x90DDEEFF, strNew
|
||||
mcall 4, (center - 25+margin) * 65536 + 30, 0x80000000, strMovs
|
||||
mcall 47, 4*65536+1, moves, (center + 2+margin ) * 65536 + 30, 0
|
||||
|
||||
|
||||
|
||||
mov ecx, (20+20+BtnSpace-BtnSize)*65536+BtnSize
|
||||
mov edx, NofBtn ; ¨¤¥â¨ä¨ª â®à ¯¥à¢®© ª®¯ª¨ ¯®«¥
|
||||
; ᬠà¨á㮪
|
||||
|
||||
buttons: ; à¨á㥬 ª®¯®çª¨
|
||||
mov eax, edx
|
||||
mov dh, NofBtn
|
||||
div dh ; al = ax / dh, ah - ®áâ ⮪
|
||||
mov dh, 0
|
||||
test ah, ah ; ¥á«¨ ah = 0, ç¨ ¥¬ ®¢ë© àï¤
|
||||
jnz @f
|
||||
add ecx, (BtnSize+BtnSpace)*65536
|
||||
mov ebx, (BtnSpace*2+margin)*65536+BtnSize+1
|
||||
@@:
|
||||
mov esi, Color1 ; ¡ ©â ¯® ¤à¥áã
|
||||
cmp byte [field-NofBtn+edx], 0 ; field-NofBtn+®¬¥à_ª®¯ª¨
|
||||
jz @f ; £®¢®à¨â ® ¥¥ 梥â¥
|
||||
mov esi, Color2
|
||||
@@:
|
||||
mcall 8,
|
||||
add ebx, (BtnSize+BtnSpace)*65536
|
||||
inc edx ; ¯¥à¥å®¤¨¬ ª á«¥¤ãî饩 ª®¯ª¥
|
||||
cmp edx, NofBtn*(NofBtn+1)
|
||||
jb buttons
|
||||
|
||||
mcall 12, 2 ; äãªæ¨ï 12: á®®¡é¨âì Ž‘ ®¡ ®âà¨á®¢ª¥ ®ª
|
||||
|
||||
ret
|
||||
|
||||
;----------------------------------------------------------------------------
|
||||
; Game_Init
|
||||
;----------------------------------------------------------------------------
|
||||
Game_Init:
|
||||
and [moves], 0 ; ®¡ã«¨¬ ª®«¨ç¥á⢮ 室®¢
|
||||
|
||||
call random ; ¢ eax á«ãç ©®¥ ç¨á«®
|
||||
mov ecx, NofBtn * NofBtn ; ¢ ecx ª®«-¢® ª®¯®ª ¯®«¥
|
||||
mov bh, 0 ; ¤«ï ª ¦¤®© ª®¯ª¨ ¡ã¤¥¬ ¡à âì
|
||||
; 1 ¡¨â ¨§ eax, bh - ᪮«ìª®
|
||||
button_init: ; ¡¨â 㦥 ¨á¯®«ì§®¢ «¨
|
||||
shr eax, 1 ; ¬« ¤è¨© ¡¨â ¯®¯ ¤ ¥â ¢ ä« £ CF
|
||||
; ¢ § ¢¨á¨¬®á⨠®â ¥£® § 票ï
|
||||
; ¢ bl § ¯¨áë¢ ¥âáï -1 ¨«¨ 0
|
||||
sbb bl, bl
|
||||
mov [field + ecx - 1], bl
|
||||
|
||||
inc bh
|
||||
cmp bh, 32 ; ¥á«¨ ¨á¯®«ì§®¢ ë ¢á¥ 32 ¡¨â ¨§ eax
|
||||
jb @f ; ® ¯®«ãç¨âì ®¢®¥ á«ãç ©®¥ ç¨á«®
|
||||
call random
|
||||
mov bh, 0
|
||||
@@:
|
||||
loop button_init
|
||||
|
||||
ret
|
||||
|
||||
;----------------------------------------------------------------------------
|
||||
; random - ¢§ïâ ¨§ â¥âà¨á
|
||||
;----------------------------------------------------------------------------
|
||||
random: mov eax,[generator]
|
||||
add eax,-43ab45b5h
|
||||
ror eax,1
|
||||
xor eax,32c4324fh
|
||||
ror eax,1
|
||||
mov [generator],eax
|
||||
; --- IVAN ---
|
||||
mov eax,26
|
||||
mov ebx,9
|
||||
int 0x40
|
||||
xor eax,0xdeadbeef
|
||||
add eax,[generator]
|
||||
; --- IVAN ---
|
||||
ret
|
||||
|
||||
;============================================================================
|
||||
|
||||
field db NofBtn * NofBtn dup(0)
|
||||
moves dd 0
|
||||
generator dd 0
|
||||
|
||||
header db 'Lights',0
|
||||
|
||||
if lang eq ru_RU
|
||||
strMovs db '•Ž„',0
|
||||
strNew db '<27>®¢ ï ¨£à ',0
|
||||
else
|
||||
strMovs db 'MOVE',0
|
||||
strNew db ' New game',0
|
||||
end if
|
||||
|
||||
|
||||
|
||||
I_END: ; ¬¥âª ª®æ ¯à®£à ¬¬ë
|
||||
; SQ_game for MenuetOS
|
||||
; Author: Alexei Ershov aka ealex
|
||||
; E-mail: e-al[at]yandex[dot]ru
|
||||
; Fidonet: 2:469/335.38
|
||||
; slightly updated by leency and renamed to Lights
|
||||
; https://en.wikipedia.org/wiki/Lights_Out_(game)
|
||||
; slightly optimized by diamond
|
||||
; English translation by diamond (two strings in end of source)
|
||||
|
||||
|
||||
BtnSize equ 36 ; à §¬¥à ª®¯ª¨
|
||||
BtnSpace equ 0 ; ¯à®¬¥¦ã⮪ ¬¥¦¤ã ª®¯ª ¬¨
|
||||
NofBtn equ 4 ; à §¬¥à ¯®«ï (3-15)
|
||||
Color1 equ 0xcc0000
|
||||
Color2 equ 0x00cc00
|
||||
|
||||
FieldSize = (BtnSize+BtnSpace)*NofBtn + BtnSpace*3
|
||||
center = FieldSize / 2
|
||||
margin = 20
|
||||
|
||||
|
||||
use32 ; ¢ª«îç¨âì 32-¡¨âë© à¥¦¨¬ áᥬ¡«¥à
|
||||
org 0x0 ; ¤à¥á æ¨ï á ã«ï
|
||||
|
||||
db 'MENUET01' ; 8-¡ ©âë© ¨¤¥â¨ä¨ª â®à MenuetOS
|
||||
dd 0x01 ; ¢¥àá¨ï § £®«®¢ª (¢á¥£¤ 1)
|
||||
dd START ; ¤à¥á ¯¥à¢®© ª®¬ ¤ë
|
||||
dd I_END ; à §¬¥à ¯à®£à ¬¬ë
|
||||
dd 0x1000 ; ª®«¨ç¥á⢮ ¯ ¬ïâ¨
|
||||
dd 0x1000 ; ¤à¥á ¢¥àè¨ë áâíª
|
||||
dd 0x0 ; ¤à¥á ¡ãä¥à ¤«ï ¯ à ¬¥â஢ (¥ ¨á¯®«ì§ã¥âáï)
|
||||
dd 0x0 ; § १¥à¢¨à®¢ ®
|
||||
|
||||
include '../../../macros.inc' ; ¬ ªà®áë ®¡«¥£ç îâ ¦¨§ì áᥬ¡«¥à騪®¢!
|
||||
|
||||
; Language support for locales: ru_RU (CP866), en_US.
|
||||
|
||||
START:
|
||||
call Game_Init
|
||||
red:
|
||||
call Draw_Window
|
||||
|
||||
still:
|
||||
mcall 10 ; äãªæ¨ï 10 - ¦¤ âì ᮡëâ¨ï
|
||||
dec eax
|
||||
jz red
|
||||
dec eax
|
||||
jnz button
|
||||
|
||||
key: ; ¦ â ª« ¢¨è ª« ¢¨ âãà¥
|
||||
mov al, 2
|
||||
int 0x40
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
button:
|
||||
mov al, 17 ; 17 - ¯®«ãç¨âì ¨¤¥â¨ä¨ª â®à ¦ ⮩ ª®¯ª¨
|
||||
int 0x40
|
||||
cmp ah, 1 ; ¥á«¨ ¦ â ª®¯ª á ®¬¥à®¬ 1, ¢ë室¨¬
|
||||
je .exit
|
||||
|
||||
cmp ah, 2 ; ¥á«¨ ¦ â ª®¯ª 2, ç¨ ¥¬ ®¢ãî ¨£àã
|
||||
je START
|
||||
|
||||
; <20> ¦ ª®¯ª ¯®«¥
|
||||
inc dword [moves] ; 㢥«¨ç¨¢ ¥¬ ç¨á«® 室®¢
|
||||
|
||||
shr eax, 8 ; ¢ eax ¨¤¥â¨ä¨ª â®à ¦ ⮩ ª®¯ª¨
|
||||
|
||||
mov dh, NofBtn
|
||||
div dh ; al = ax(®¬¥à ª®¯ª¨) / NofBtn
|
||||
; ah = ®áâ ⮪ (á¬. à¨á㮪)
|
||||
mov ebx, eax ; á®åà ¨¬ ç á⮥ ¨ ®áâ ⮪ ¢ ebx
|
||||
|
||||
; al\ah 0 1 2 3
|
||||
; +-+ +-+ +-+ +-+
|
||||
; 1 |4| |5| |6| |7|
|
||||
; +-+ +-+ +-+ +-+
|
||||
|
||||
; +-+ +-+ +-+ +-+
|
||||
; 2 |8| |9| |10 |11
|
||||
; +-+ +-+ +-+ +-+
|
||||
|
||||
; +-+ +-+ +-+ +-+
|
||||
; 3 |12 |13 |14 |15
|
||||
; +-+ +-+ +-+ +-+
|
||||
|
||||
; +-+ +-+ +-+ +-+
|
||||
; 4 |16 |17 |18 |19
|
||||
; +-+ +-+ +-+ +-+
|
||||
|
||||
; Œ¥ï¥¬ 梥â á⮫¡¨ª
|
||||
shr eax, 8 ; eax = ah
|
||||
mov edi, field
|
||||
add edi, eax ; edi 㪠§¢ë¥â ¯¥à¢ãî ª®¯ªã ¨ ¨áª®¬®¬ áâ«¡æ¥
|
||||
mov ecx, NofBtn
|
||||
@@:
|
||||
not byte[edi] ; ¬¥ï¥¬ 梥⠢® ¢á¥¬ á⮫¡¨ª¥
|
||||
dec ecx
|
||||
add edi, NofBtn
|
||||
test ecx, ecx
|
||||
jnz @r
|
||||
|
||||
; Œ¥ï¥¬ 梥â áâப¨
|
||||
mov eax, ebx ; ¢®ááâ ¢«¨¢ ¥¬ eax
|
||||
dec eax
|
||||
mov dl, NofBtn
|
||||
mul dl ; ax = al * NofBtn
|
||||
mov edi, field
|
||||
add edi, eax ; edi 㪠§¢ë¥â ¯¥à¢ãî ª®¯ªã ¢ ¨áª®¬®© áâப¥
|
||||
mov ecx, NofBtn
|
||||
@@:
|
||||
not byte [edi] ; ¬¥ï¥¬ 梥⠢® ¢á¥© áâப¥
|
||||
dec ecx
|
||||
inc edi
|
||||
test ecx, ecx
|
||||
jnz @r
|
||||
; –¢¥â ¦ ⮩ ª®¯ª¨ ¬¥ï«áï 2 à § (ª®£¤ ®¡à ¡ âë¢ «¨ áâப㠨 á⮫¡¥æ),
|
||||
; â.¥. ®áâ «áï ¯¥à¢® ç «ë¬
|
||||
; Œ¥ï¥¬ 梥⠦ ⮩ ª®¯ª¨
|
||||
shr ebx, 8 ; ebx = ®áâ ⮪ (ah à¨á㪥)
|
||||
not byte [field+eax+ebx]
|
||||
jmp red
|
||||
|
||||
|
||||
|
||||
.exit:
|
||||
mcall -1 ; ¨ ç¥ ª®¥æ ¯à®£à ¬¬ë
|
||||
|
||||
|
||||
;----------------------------------------------------------------------------
|
||||
; Draw_Window
|
||||
;----------------------------------------------------------------------------
|
||||
Draw_Window:
|
||||
|
||||
mcall 12, 1
|
||||
mcall 0, 200*65536+FieldSize+margin*2,\
|
||||
200*65536+FieldSize+28+margin*3,\
|
||||
0x14DDD7CF, 0x805080D0, header
|
||||
|
||||
mcall 8, (BtnSpace*2+margin)*65536 + 83,\
|
||||
(FieldSize+BtnSpace+margin*2+10)*65536+ 22, 2
|
||||
mcall 4, (BtnSpace*2+3+margin)*65536+(FieldSize+BtnSpace+margin*2)+14,\
|
||||
0x90DDEEFF, strNew
|
||||
mcall 4, (center - 25+margin) * 65536 + 30, 0x80000000, strMovs
|
||||
mcall 47, 4*65536+1, moves, (center + 2+margin ) * 65536 + 30, 0
|
||||
|
||||
|
||||
|
||||
mov ecx, (20+20+BtnSpace-BtnSize)*65536+BtnSize
|
||||
mov edx, NofBtn ; ¨¤¥â¨ä¨ª â®à ¯¥à¢®© ª®¯ª¨ ¯®«¥
|
||||
; ᬠà¨á㮪
|
||||
|
||||
buttons: ; à¨á㥬 ª®¯®çª¨
|
||||
mov eax, edx
|
||||
mov dh, NofBtn
|
||||
div dh ; al = ax / dh, ah - ®áâ ⮪
|
||||
mov dh, 0
|
||||
test ah, ah ; ¥á«¨ ah = 0, ç¨ ¥¬ ®¢ë© àï¤
|
||||
jnz @f
|
||||
add ecx, (BtnSize+BtnSpace)*65536
|
||||
mov ebx, (BtnSpace*2+margin)*65536+BtnSize+1
|
||||
@@:
|
||||
mov esi, Color1 ; ¡ ©â ¯® ¤à¥áã
|
||||
cmp byte [field-NofBtn+edx], 0 ; field-NofBtn+®¬¥à_ª®¯ª¨
|
||||
jz @f ; £®¢®à¨â ® ¥¥ 梥â¥
|
||||
mov esi, Color2
|
||||
@@:
|
||||
mcall 8,
|
||||
add ebx, (BtnSize+BtnSpace)*65536
|
||||
inc edx ; ¯¥à¥å®¤¨¬ ª á«¥¤ãî饩 ª®¯ª¥
|
||||
cmp edx, NofBtn*(NofBtn+1)
|
||||
jb buttons
|
||||
|
||||
mcall 12, 2 ; äãªæ¨ï 12: á®®¡é¨âì Ž‘ ®¡ ®âà¨á®¢ª¥ ®ª
|
||||
|
||||
ret
|
||||
|
||||
;----------------------------------------------------------------------------
|
||||
; Game_Init
|
||||
;----------------------------------------------------------------------------
|
||||
Game_Init:
|
||||
and [moves], 0 ; ®¡ã«¨¬ ª®«¨ç¥á⢮ 室®¢
|
||||
|
||||
call random ; ¢ eax á«ãç ©®¥ ç¨á«®
|
||||
mov ecx, NofBtn * NofBtn ; ¢ ecx ª®«-¢® ª®¯®ª ¯®«¥
|
||||
mov bh, 0 ; ¤«ï ª ¦¤®© ª®¯ª¨ ¡ã¤¥¬ ¡à âì
|
||||
; 1 ¡¨â ¨§ eax, bh - ᪮«ìª®
|
||||
button_init: ; ¡¨â 㦥 ¨á¯®«ì§®¢ «¨
|
||||
shr eax, 1 ; ¬« ¤è¨© ¡¨â ¯®¯ ¤ ¥â ¢ ä« £ CF
|
||||
; ¢ § ¢¨á¨¬®á⨠®â ¥£® § 票ï
|
||||
; ¢ bl § ¯¨áë¢ ¥âáï -1 ¨«¨ 0
|
||||
sbb bl, bl
|
||||
mov [field + ecx - 1], bl
|
||||
|
||||
inc bh
|
||||
cmp bh, 32 ; ¥á«¨ ¨á¯®«ì§®¢ ë ¢á¥ 32 ¡¨â ¨§ eax
|
||||
jb @f ; ® ¯®«ãç¨âì ®¢®¥ á«ãç ©®¥ ç¨á«®
|
||||
call random
|
||||
mov bh, 0
|
||||
@@:
|
||||
loop button_init
|
||||
|
||||
ret
|
||||
|
||||
;----------------------------------------------------------------------------
|
||||
; random - ¢§ïâ ¨§ â¥âà¨á
|
||||
;----------------------------------------------------------------------------
|
||||
random: mov eax,[generator]
|
||||
add eax,-43ab45b5h
|
||||
ror eax,1
|
||||
xor eax,32c4324fh
|
||||
ror eax,1
|
||||
mov [generator],eax
|
||||
; --- IVAN ---
|
||||
mov eax,26
|
||||
mov ebx,9
|
||||
int 0x40
|
||||
xor eax,0xdeadbeef
|
||||
add eax,[generator]
|
||||
; --- IVAN ---
|
||||
ret
|
||||
|
||||
;============================================================================
|
||||
|
||||
field db NofBtn * NofBtn dup(0)
|
||||
moves dd 0
|
||||
generator dd 0
|
||||
|
||||
header db 'Lights',0
|
||||
|
||||
if lang eq ru_RU
|
||||
strMovs db '•Ž„',0
|
||||
strNew db '<27>®¢ ï ¨£à ',0
|
||||
else ; Default to en_US
|
||||
strMovs db 'MOVE',0
|
||||
strNew db ' New game',0
|
||||
end if
|
||||
|
||||
|
||||
|
||||
I_END: ; ¬¥âª ª®æ ¯à®£à ¬¬ë
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,184 +1,184 @@
|
||||
;
|
||||
; Œ ªà®áë ¤«ï ¤¥ª®¤¨à®¢ ¨ï ¨§®¡à ¦¥¨© ç१ äãªæ¨¨ ¡¨¡«¨®â¥ª¨ libimg.
|
||||
;
|
||||
; (1) ¬ ªà®á load_image_file:
|
||||
;
|
||||
; <EFBFBD>஢¥àï¥â à §¬¥à ¯®«ã祮£® ä ©« á ¨§®¡à ¦¥¨¥¬.
|
||||
; ‚뤥«ï¥â ¯®¤ ¥£® ¯ ¬ïâì ¨ § £à㦠¥â âã¤ ä ©«.
|
||||
; Ž¯à¥¤¥«ï¥â à §¬¥à ¯ ¬ï⨠¥®¡å®¤¨¬®© ¤«ï à ᯠª®¢ª¨ ¨§®¡à ¦¥¨ï.
|
||||
; <EFBFBD>¥à¥¢ë¤¥«ï¥â ¯ ¬ïâì, ¨ à ᯠª®¢ë¢ ¥â ¨§®¡à ¦¥¨¥ ¨§ ä®à¬ ⮢ jpg, png, ...
|
||||
; ¢ ä®à¬ â rgb ª®â®àë© ¬®¦® ¢ë¢®¤¨âì íªà ç¥à¥§ á¨áâ. äãªæ¨î.
|
||||
; <EFBFBD>ਠ¥®¡å®¤¨¬®á⨠¬®¦® â ª¦¥ ¯®«ãç¨âì à §¬¥àë ®âªàë¢ ¥¬®£® ¨§®¡à ¦¥¨ï ¤«ï
|
||||
; ¨å ¤ «ì¥©è¥£® ¨á¯®«ì§®¢ ¨ï ¢ ¯à®£à ¬¬¥.
|
||||
;
|
||||
; ‚ ¨á¯®«ì§ãî饩 ¯à®£à ¬¬¥ ¤®«¦ ¡ëâì ¯®¤ª«îç¥ ¡¨¡«¨®â¥ª libimg,
|
||||
; ®¡ê¥ ¯¥à¥¬¥ ï file_name à §¬¥à®¬ ®ª®«® 4096 ¡ ©â,
|
||||
; â ª¦¥ áâàãªâãà run_file_70 ⨯ FileInfoBlock.
|
||||
;
|
||||
; (2) ¬ ªà®á include_image_file:
|
||||
;
|
||||
; ‚¥¤àï¥â ¨§®¡à ¦¥¨¥ ¢ ä ©« ¯à®£à ¬¬ë.
|
||||
; Ž¯à¥¤¥«ï¥â à §¬¥à ¯ ¬ï⨠¥®¡å®¤¨¬®© ¤«ï à ᯠª®¢ª¨ ¨§®¡à ¦¥¨ï.
|
||||
; ‚뤥«ï¥â ¯ ¬ïâì, ¨ à ᯠª®¢ë¢ ¥â ¨§®¡à ¦¥¨¥ ¨§ ä®à¬ ⮢ jpg, png, ...
|
||||
; ¢ ä®à¬ â rgb ª®â®àë© ¬®¦® ¢ë¢®¤¨âì íªà ç¥à¥§ á¨áâ. äãªæ¨î.
|
||||
; <EFBFBD>ਠ¥®¡å®¤¨¬®á⨠¬®¦® â ª¦¥ ¯®«ãç¨âì à §¬¥àë ¢¥¤à¥®£® ¨§®¡à ¦¥¨ï ¤«ï
|
||||
; ¨å ¤ «ì¥©è¥£® ¨á¯®«ì§®¢ ¨ï ¢ ¯à®£à ¬¬¥.
|
||||
|
||||
; ¯®¤ª«î票¥ ¥ª®â®àëå ¥®¡å®¤¨¬ëå ä ©«®¢:
|
||||
include 'dll.inc'
|
||||
;include 'load_lib.mac'
|
||||
include 'develop/libraries/libs-dev/libio/libio.inc'
|
||||
|
||||
align 4
|
||||
open_b rb 560
|
||||
|
||||
txt_err_img_file:
|
||||
if lang eq ru_RU
|
||||
db 'Žè¨¡ª N'
|
||||
.n: db '* ¯à¨ ®âªàë⨨ ä ©« '
|
||||
else
|
||||
db 'Error N'
|
||||
.n: db '*. Can',39,'t open file '
|
||||
end if
|
||||
.f: dd 0,0
|
||||
|
||||
; path - ¬®¦¥â ¡ëâì ¯¥à¥¬¥®© ¨«¨ áâப®¢ë¬ ¯ à ¬¥â஬
|
||||
; buf - ¯¥à¥¬¥ ï ªã¤ ¡ã¤¥â § ¯¨á 㪠§ â¥«ì ¨§®¡à ¦¥¨¥ ¢ ä®à¬ ⥠rgb,
|
||||
; ¢ á«ãç ¥ ¥á«¨ ä ©« ¥ ®âªà®¥âáï â® ¡ã¤¥â § ¯¨á 0
|
||||
; img_w, img_h - ¯¥à¥¬¥ë¥ ªã¤ ¡ã¤ãâ § ¯¨á ë à §¬¥àë ®âªàë¢ ¥¬®£®
|
||||
; ¨§®¡à ¦¥¨ï, ¥ ®¡ï§ ⥫ìë¥ ¯ à ¬¥âàë
|
||||
; bytes_p_p - ᪮«ìª® ¡ ©â ¯ ¬ï⨠¡à âì ¯¨ªá¥«ì, ¥ ®¡ï§ ⥫ìë© ¯ à ¬¥âà
|
||||
; ¥á«¨ ¥ 㪠§ ¡¥à¥âáï 3. Œ¨¨¬ «ì®¥ § 票¥ ¤®«¦® ¡ëâì ¥ ¬¥ìè¥ 3.
|
||||
macro load_image_file path, buf, img_w, img_h, bytes_p_p
|
||||
{
|
||||
local .err_open
|
||||
local .end_open
|
||||
|
||||
if path eqtype '' ;¯à®¢¥à塞 § ¤ «¨ áâப®© ¯ à ¬¥âà path
|
||||
local .path_str
|
||||
jmp @f
|
||||
.path_str db path ;ä®à¬¨à㥬 «®ª «ìãî ¯¥à¥¬¥ãî
|
||||
db 0
|
||||
@@:
|
||||
;32 - áâ ¤ àâë© ¤à¥á ¯® ª®â®à®¬ã ¤®«¦¥ ¡ëâì ¡ãä¥à á á¨áâ¥¬ë¬ ¯ã⥬
|
||||
copy_path .path_str,[32],file_name,0
|
||||
else
|
||||
copy_path path,[32],file_name,0 ;ä®à¬¨à㥬 ¯®«ë© ¯ãâì ª ä ©«ã ¨§®¡à ¦¥¨ï, ¯®¤à §ã¬¥¢ ¥¬ çâ® ® ¢ ®¤®© ¯ ¯ª¥ á ¯à®£à ¬¬®©
|
||||
end if
|
||||
mov dword[buf],0
|
||||
|
||||
mov [run_file_70.Function], SSF_GET_INFO
|
||||
mov [run_file_70.Position], 0
|
||||
mov [run_file_70.Flags], 0
|
||||
mov dword[run_file_70.Count], 0
|
||||
mov dword[run_file_70.Buffer], open_b
|
||||
mov byte[run_file_70+20], 0
|
||||
mov dword[run_file_70.FileName], file_name
|
||||
mcall SF_FILE,run_file_70
|
||||
or eax,eax
|
||||
jnz .err_open
|
||||
|
||||
mov ecx,dword[open_b+32] ;+32 qword: à §¬¥à ä ©« ¢ ¡ ©â å
|
||||
stdcall mem.Alloc,ecx ;¢ë¤¥«ï¥¬ ¯ ¬ïâì ¤«ï ¨§®¡à ¦¥¨ï
|
||||
mov [buf],eax
|
||||
mov [run_file_70.Function], SSF_READ_FILE
|
||||
mov [run_file_70.Position], 0
|
||||
mov [run_file_70.Flags], 0
|
||||
mov [run_file_70.Count], ecx
|
||||
mov [run_file_70.Buffer], eax
|
||||
mov byte[run_file_70+20], 0
|
||||
mov [run_file_70.FileName], file_name
|
||||
mcall SF_FILE,run_file_70 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥¨ï
|
||||
test eax,eax
|
||||
jnz .err_open
|
||||
cmp ebx,0xffffffff
|
||||
je .end_open
|
||||
;®¯à¥¤¥«ï¥¬ ¢¨¤ ¨§®¡à ¦¥¨ï ¨ ¯¨è¥¬ ¥£® ¯ à ¬¥âàë
|
||||
stdcall [img_decode], [buf],ebx,0
|
||||
mov ebx,eax
|
||||
;®¯à¥¤¥«ï¥¬ à §¬¥à ¤¥ª®¤¨à®¢ ®£® ¨§®¡à ¦¥¨ï
|
||||
mov ecx,[eax+4] ;+4 = image width
|
||||
if img_w eq
|
||||
else
|
||||
mov dword[img_w],ecx
|
||||
end if
|
||||
if img_h eq
|
||||
imul ecx,[eax+8] ;+8 = image height
|
||||
else
|
||||
mov eax,[eax+8] ;+8 = image height
|
||||
mov dword[img_h],eax
|
||||
imul ecx,eax
|
||||
end if
|
||||
if bytes_p_p eq
|
||||
imul ecx,3 ;need for r,g,b
|
||||
else
|
||||
imul ecx,bytes_p_p
|
||||
end if
|
||||
stdcall mem.ReAlloc,[buf],ecx ;¨§¬¥ï¥¬ à §¬¥à ¤«ï ¡ãä¥à
|
||||
mov [buf],eax
|
||||
stdcall [img_to_rgb2], ebx,[buf] ;¯à¥®¡à §ã¥¬ ¨§®¡à ¦¥¨¥ ª ä®à¬ âã rgb
|
||||
stdcall [img_destroy], ebx ;㤠«ï¥¬ ¢à¥¬¥ë© ¡ãä¥à á ¯ à ¬¥âà ¬¨ ¨§®¡à ¦¥¨ï
|
||||
jmp .end_open
|
||||
.err_open:
|
||||
add al,'0'
|
||||
mov byte[txt_err_img_file.n],al
|
||||
if path eqtype ''
|
||||
mov eax,dword[.path_str]
|
||||
mov dword[txt_err_img_file.f],eax
|
||||
mov eax,dword[.path_str+4]
|
||||
else
|
||||
mov eax,dword[path]
|
||||
mov dword[txt_err_img_file.f],eax
|
||||
mov eax,dword[path+4]
|
||||
end if
|
||||
mov dword[txt_err_img_file.f+4],eax
|
||||
mov byte[txt_err_img_file.f+7],0
|
||||
notify_window_run txt_err_img_file
|
||||
.end_open:
|
||||
}
|
||||
|
||||
|
||||
|
||||
; path - ¨¬ï ¢ª«îç ¥¬®£® ä ©«
|
||||
; buf - ¯¥à¥¬¥ ï ªã¤ ¡ã¤¥â § ¯¨á 㪠§ â¥«ì ¨§®¡à ¦¥¨¥ ¢ ä®à¬ ⥠rgb
|
||||
; img_w, img_h - ¯¥à¥¬¥ë¥ ªã¤ ¡ã¤ãâ § ¯¨á ë à §¬¥àë ¨§®¡à ¦¥¨ï,
|
||||
; ¥ ®¡ï§ ⥫ìë¥ ¯ à ¬¥âàë
|
||||
; bytes_p_p - ᪮«ìª® ¡ ©â ¯ ¬ï⨠¡à âì ¯¨ªá¥«ì, ¥ ®¡ï§ ⥫ìë© ¯ à ¬¥âà
|
||||
; ¥á«¨ ¥ 㪠§ ¡¥à¥âáï 3. Œ¨¨¬ «ì®¥ § 票¥ ¤®«¦® ¡ëâì ¥ ¬¥ìè¥ 3.
|
||||
macro include_image_file path, buf, img_w, img_h, bytes_p_p
|
||||
{
|
||||
local .beg_file
|
||||
local .end_file
|
||||
|
||||
jmp .end_file
|
||||
align 4
|
||||
.beg_file:
|
||||
file path
|
||||
.end_file:
|
||||
|
||||
;®¯à¥¤¥«ï¥¬ ¢¨¤ ¨§®¡à ¦¥¨ï ¨ ¯¨è¥¬ ¥£® ¯ à ¬¥âàë
|
||||
stdcall [img_decode], .beg_file,.end_file-.beg_file,0
|
||||
mov ebx,eax
|
||||
;®¯à¥¤¥«ï¥¬ à §¬¥à ¤¥ª®¤¨à®¢ ®£® ¨§®¡à ¦¥¨ï
|
||||
mov ecx,[eax+4] ;+4 = image width
|
||||
if img_w eq
|
||||
else
|
||||
mov dword[img_w],ecx
|
||||
end if
|
||||
if img_h eq
|
||||
imul ecx,[eax+8] ;+8 = image height
|
||||
else
|
||||
mov eax,[eax+8] ;+8 = image height
|
||||
mov dword[img_h],eax
|
||||
imul ecx,eax
|
||||
end if
|
||||
if bytes_p_p eq
|
||||
imul ecx,3 ;need for r,g,b
|
||||
else
|
||||
imul ecx,bytes_p_p
|
||||
end if
|
||||
stdcall mem.Alloc,ecx ;¨§¬¥ï¥¬ à §¬¥à ¤«ï ¡ãä¥à
|
||||
mov [buf],eax
|
||||
stdcall [img_to_rgb2], ebx,[buf] ;¯à¥®¡à §ã¥¬ ¨§®¡à ¦¥¨¥ ª ä®à¬ âã rgb
|
||||
stdcall [img_destroy], ebx ;㤠«ï¥¬ ¢à¥¬¥ë© ¡ãä¥à á ¯ à ¬¥âà ¬¨ ¨§®¡à ¦¥¨ï
|
||||
}
|
||||
;
|
||||
; Œ ªà®áë ¤«ï ¤¥ª®¤¨à®¢ ¨ï ¨§®¡à ¦¥¨© ç१ äãªæ¨¨ ¡¨¡«¨®â¥ª¨ libimg.
|
||||
;
|
||||
; (1) ¬ ªà®á load_image_file:
|
||||
;
|
||||
; <EFBFBD>஢¥àï¥â à §¬¥à ¯®«ã祮£® ä ©« á ¨§®¡à ¦¥¨¥¬.
|
||||
; ‚뤥«ï¥â ¯®¤ ¥£® ¯ ¬ïâì ¨ § £à㦠¥â âã¤ ä ©«.
|
||||
; Ž¯à¥¤¥«ï¥â à §¬¥à ¯ ¬ï⨠¥®¡å®¤¨¬®© ¤«ï à ᯠª®¢ª¨ ¨§®¡à ¦¥¨ï.
|
||||
; <EFBFBD>¥à¥¢ë¤¥«ï¥â ¯ ¬ïâì, ¨ à ᯠª®¢ë¢ ¥â ¨§®¡à ¦¥¨¥ ¨§ ä®à¬ ⮢ jpg, png, ...
|
||||
; ¢ ä®à¬ â rgb ª®â®àë© ¬®¦® ¢ë¢®¤¨âì íªà ç¥à¥§ á¨áâ. äãªæ¨î.
|
||||
; <EFBFBD>ਠ¥®¡å®¤¨¬®á⨠¬®¦® â ª¦¥ ¯®«ãç¨âì à §¬¥àë ®âªàë¢ ¥¬®£® ¨§®¡à ¦¥¨ï ¤«ï
|
||||
; ¨å ¤ «ì¥©è¥£® ¨á¯®«ì§®¢ ¨ï ¢ ¯à®£à ¬¬¥.
|
||||
;
|
||||
; ‚ ¨á¯®«ì§ãî饩 ¯à®£à ¬¬¥ ¤®«¦ ¡ëâì ¯®¤ª«îç¥ ¡¨¡«¨®â¥ª libimg,
|
||||
; ®¡ê¥ ¯¥à¥¬¥ ï file_name à §¬¥à®¬ ®ª®«® 4096 ¡ ©â,
|
||||
; â ª¦¥ áâàãªâãà run_file_70 ⨯ FileInfoBlock.
|
||||
;
|
||||
; (2) ¬ ªà®á include_image_file:
|
||||
;
|
||||
; ‚¥¤àï¥â ¨§®¡à ¦¥¨¥ ¢ ä ©« ¯à®£à ¬¬ë.
|
||||
; Ž¯à¥¤¥«ï¥â à §¬¥à ¯ ¬ï⨠¥®¡å®¤¨¬®© ¤«ï à ᯠª®¢ª¨ ¨§®¡à ¦¥¨ï.
|
||||
; ‚뤥«ï¥â ¯ ¬ïâì, ¨ à ᯠª®¢ë¢ ¥â ¨§®¡à ¦¥¨¥ ¨§ ä®à¬ ⮢ jpg, png, ...
|
||||
; ¢ ä®à¬ â rgb ª®â®àë© ¬®¦® ¢ë¢®¤¨âì íªà ç¥à¥§ á¨áâ. äãªæ¨î.
|
||||
; <EFBFBD>ਠ¥®¡å®¤¨¬®á⨠¬®¦® â ª¦¥ ¯®«ãç¨âì à §¬¥àë ¢¥¤à¥®£® ¨§®¡à ¦¥¨ï ¤«ï
|
||||
; ¨å ¤ «ì¥©è¥£® ¨á¯®«ì§®¢ ¨ï ¢ ¯à®£à ¬¬¥.
|
||||
|
||||
; ¯®¤ª«î票¥ ¥ª®â®àëå ¥®¡å®¤¨¬ëå ä ©«®¢:
|
||||
include 'dll.inc'
|
||||
;include 'load_lib.mac'
|
||||
include 'develop/libraries/libs-dev/libio/libio.inc'
|
||||
|
||||
align 4
|
||||
open_b rb 560
|
||||
|
||||
txt_err_img_file:
|
||||
if lang eq ru_RU
|
||||
db 'Žè¨¡ª N'
|
||||
.n: db '* ¯à¨ ®âªàë⨨ ä ©« '
|
||||
else ; Default ot en_US
|
||||
db 'Error N'
|
||||
.n: db '*. Can',39,'t open file '
|
||||
end if
|
||||
.f: dd 0,0
|
||||
|
||||
; path - ¬®¦¥â ¡ëâì ¯¥à¥¬¥®© ¨«¨ áâப®¢ë¬ ¯ à ¬¥â஬
|
||||
; buf - ¯¥à¥¬¥ ï ªã¤ ¡ã¤¥â § ¯¨á 㪠§ â¥«ì ¨§®¡à ¦¥¨¥ ¢ ä®à¬ ⥠rgb,
|
||||
; ¢ á«ãç ¥ ¥á«¨ ä ©« ¥ ®âªà®¥âáï â® ¡ã¤¥â § ¯¨á 0
|
||||
; img_w, img_h - ¯¥à¥¬¥ë¥ ªã¤ ¡ã¤ãâ § ¯¨á ë à §¬¥àë ®âªàë¢ ¥¬®£®
|
||||
; ¨§®¡à ¦¥¨ï, ¥ ®¡ï§ ⥫ìë¥ ¯ à ¬¥âàë
|
||||
; bytes_p_p - ᪮«ìª® ¡ ©â ¯ ¬ï⨠¡à âì ¯¨ªá¥«ì, ¥ ®¡ï§ ⥫ìë© ¯ à ¬¥âà
|
||||
; ¥á«¨ ¥ 㪠§ ¡¥à¥âáï 3. Œ¨¨¬ «ì®¥ § 票¥ ¤®«¦® ¡ëâì ¥ ¬¥ìè¥ 3.
|
||||
macro load_image_file path, buf, img_w, img_h, bytes_p_p
|
||||
{
|
||||
local .err_open
|
||||
local .end_open
|
||||
|
||||
if path eqtype '' ;¯à®¢¥à塞 § ¤ «¨ áâப®© ¯ à ¬¥âà path
|
||||
local .path_str
|
||||
jmp @f
|
||||
.path_str db path ;ä®à¬¨à㥬 «®ª «ìãî ¯¥à¥¬¥ãî
|
||||
db 0
|
||||
@@:
|
||||
;32 - áâ ¤ àâë© ¤à¥á ¯® ª®â®à®¬ã ¤®«¦¥ ¡ëâì ¡ãä¥à á á¨áâ¥¬ë¬ ¯ã⥬
|
||||
copy_path .path_str,[32],file_name,0
|
||||
else
|
||||
copy_path path,[32],file_name,0 ;ä®à¬¨à㥬 ¯®«ë© ¯ãâì ª ä ©«ã ¨§®¡à ¦¥¨ï, ¯®¤à §ã¬¥¢ ¥¬ çâ® ® ¢ ®¤®© ¯ ¯ª¥ á ¯à®£à ¬¬®©
|
||||
end if
|
||||
mov dword[buf],0
|
||||
|
||||
mov [run_file_70.Function], SSF_GET_INFO
|
||||
mov [run_file_70.Position], 0
|
||||
mov [run_file_70.Flags], 0
|
||||
mov dword[run_file_70.Count], 0
|
||||
mov dword[run_file_70.Buffer], open_b
|
||||
mov byte[run_file_70+20], 0
|
||||
mov dword[run_file_70.FileName], file_name
|
||||
mcall SF_FILE,run_file_70
|
||||
or eax,eax
|
||||
jnz .err_open
|
||||
|
||||
mov ecx,dword[open_b+32] ;+32 qword: à §¬¥à ä ©« ¢ ¡ ©â å
|
||||
stdcall mem.Alloc,ecx ;¢ë¤¥«ï¥¬ ¯ ¬ïâì ¤«ï ¨§®¡à ¦¥¨ï
|
||||
mov [buf],eax
|
||||
mov [run_file_70.Function], SSF_READ_FILE
|
||||
mov [run_file_70.Position], 0
|
||||
mov [run_file_70.Flags], 0
|
||||
mov [run_file_70.Count], ecx
|
||||
mov [run_file_70.Buffer], eax
|
||||
mov byte[run_file_70+20], 0
|
||||
mov [run_file_70.FileName], file_name
|
||||
mcall SF_FILE,run_file_70 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥¨ï
|
||||
test eax,eax
|
||||
jnz .err_open
|
||||
cmp ebx,0xffffffff
|
||||
je .end_open
|
||||
;®¯à¥¤¥«ï¥¬ ¢¨¤ ¨§®¡à ¦¥¨ï ¨ ¯¨è¥¬ ¥£® ¯ à ¬¥âàë
|
||||
stdcall [img_decode], [buf],ebx,0
|
||||
mov ebx,eax
|
||||
;®¯à¥¤¥«ï¥¬ à §¬¥à ¤¥ª®¤¨à®¢ ®£® ¨§®¡à ¦¥¨ï
|
||||
mov ecx,[eax+4] ;+4 = image width
|
||||
if img_w eq
|
||||
else
|
||||
mov dword[img_w],ecx
|
||||
end if
|
||||
if img_h eq
|
||||
imul ecx,[eax+8] ;+8 = image height
|
||||
else
|
||||
mov eax,[eax+8] ;+8 = image height
|
||||
mov dword[img_h],eax
|
||||
imul ecx,eax
|
||||
end if
|
||||
if bytes_p_p eq
|
||||
imul ecx,3 ;need for r,g,b
|
||||
else
|
||||
imul ecx,bytes_p_p
|
||||
end if
|
||||
stdcall mem.ReAlloc,[buf],ecx ;¨§¬¥ï¥¬ à §¬¥à ¤«ï ¡ãä¥à
|
||||
mov [buf],eax
|
||||
stdcall [img_to_rgb2], ebx,[buf] ;¯à¥®¡à §ã¥¬ ¨§®¡à ¦¥¨¥ ª ä®à¬ âã rgb
|
||||
stdcall [img_destroy], ebx ;㤠«ï¥¬ ¢à¥¬¥ë© ¡ãä¥à á ¯ à ¬¥âà ¬¨ ¨§®¡à ¦¥¨ï
|
||||
jmp .end_open
|
||||
.err_open:
|
||||
add al,'0'
|
||||
mov byte[txt_err_img_file.n],al
|
||||
if path eqtype ''
|
||||
mov eax,dword[.path_str]
|
||||
mov dword[txt_err_img_file.f],eax
|
||||
mov eax,dword[.path_str+4]
|
||||
else
|
||||
mov eax,dword[path]
|
||||
mov dword[txt_err_img_file.f],eax
|
||||
mov eax,dword[path+4]
|
||||
end if
|
||||
mov dword[txt_err_img_file.f+4],eax
|
||||
mov byte[txt_err_img_file.f+7],0
|
||||
notify_window_run txt_err_img_file
|
||||
.end_open:
|
||||
}
|
||||
|
||||
|
||||
|
||||
; path - ¨¬ï ¢ª«îç ¥¬®£® ä ©«
|
||||
; buf - ¯¥à¥¬¥ ï ªã¤ ¡ã¤¥â § ¯¨á 㪠§ â¥«ì ¨§®¡à ¦¥¨¥ ¢ ä®à¬ ⥠rgb
|
||||
; img_w, img_h - ¯¥à¥¬¥ë¥ ªã¤ ¡ã¤ãâ § ¯¨á ë à §¬¥àë ¨§®¡à ¦¥¨ï,
|
||||
; ¥ ®¡ï§ ⥫ìë¥ ¯ à ¬¥âàë
|
||||
; bytes_p_p - ᪮«ìª® ¡ ©â ¯ ¬ï⨠¡à âì ¯¨ªá¥«ì, ¥ ®¡ï§ ⥫ìë© ¯ à ¬¥âà
|
||||
; ¥á«¨ ¥ 㪠§ ¡¥à¥âáï 3. Œ¨¨¬ «ì®¥ § 票¥ ¤®«¦® ¡ëâì ¥ ¬¥ìè¥ 3.
|
||||
macro include_image_file path, buf, img_w, img_h, bytes_p_p
|
||||
{
|
||||
local .beg_file
|
||||
local .end_file
|
||||
|
||||
jmp .end_file
|
||||
align 4
|
||||
.beg_file:
|
||||
file path
|
||||
.end_file:
|
||||
|
||||
;®¯à¥¤¥«ï¥¬ ¢¨¤ ¨§®¡à ¦¥¨ï ¨ ¯¨è¥¬ ¥£® ¯ à ¬¥âàë
|
||||
stdcall [img_decode], .beg_file,.end_file-.beg_file,0
|
||||
mov ebx,eax
|
||||
;®¯à¥¤¥«ï¥¬ à §¬¥à ¤¥ª®¤¨à®¢ ®£® ¨§®¡à ¦¥¨ï
|
||||
mov ecx,[eax+4] ;+4 = image width
|
||||
if img_w eq
|
||||
else
|
||||
mov dword[img_w],ecx
|
||||
end if
|
||||
if img_h eq
|
||||
imul ecx,[eax+8] ;+8 = image height
|
||||
else
|
||||
mov eax,[eax+8] ;+8 = image height
|
||||
mov dword[img_h],eax
|
||||
imul ecx,eax
|
||||
end if
|
||||
if bytes_p_p eq
|
||||
imul ecx,3 ;need for r,g,b
|
||||
else
|
||||
imul ecx,bytes_p_p
|
||||
end if
|
||||
stdcall mem.Alloc,ecx ;¨§¬¥ï¥¬ à §¬¥à ¤«ï ¡ãä¥à
|
||||
mov [buf],eax
|
||||
stdcall [img_to_rgb2], ebx,[buf] ;¯à¥®¡à §ã¥¬ ¨§®¡à ¦¥¨¥ ª ä®à¬ âã rgb
|
||||
stdcall [img_destroy], ebx ;㤠«ï¥¬ ¢à¥¬¥ë© ¡ãä¥à á ¯ à ¬¥âà ¬¨ ¨§®¡à ¦¥¨ï
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,395 +1,397 @@
|
||||
align 4
|
||||
set_rect_window:
|
||||
mov ebx,set_rect_window_procinfo
|
||||
call get_slot_n
|
||||
|
||||
mov [set_rect_window_slot],ecx
|
||||
|
||||
set_events_mask (evm_redraw+evm_key+evm_button+evm_mouse)
|
||||
call init_rect
|
||||
edit_boxes_set_sys_color rect_input,rect_input_end,sc
|
||||
.red:
|
||||
labels_set_sys_color rect_input_labels,rect_input_labels_end,sc
|
||||
check_boxes_set_sys_color2 riw_check_boxes,riw_check_boxes_end,sc
|
||||
call .draw_window
|
||||
align 4
|
||||
.still:
|
||||
wait_event .red,.key,.button,.mouse
|
||||
|
||||
.key:
|
||||
get_key
|
||||
|
||||
stdcall [edit_box_key], rect_input.left
|
||||
stdcall [edit_box_key], rect_input.top
|
||||
stdcall [edit_box_key], rect_input.width
|
||||
stdcall [edit_box_key], rect_input.height
|
||||
|
||||
call read_rect
|
||||
call draw_rect_on_screen
|
||||
|
||||
jmp .still
|
||||
|
||||
.button:
|
||||
get_pressed_button
|
||||
|
||||
cmp ah,1
|
||||
jne @f
|
||||
btr dword [flags],3
|
||||
jmp close
|
||||
@@:
|
||||
|
||||
jmp .still
|
||||
|
||||
.mouse:
|
||||
get_active_window
|
||||
cmp eax,[set_rect_window_slot]
|
||||
jne .still
|
||||
|
||||
stdcall [edit_box_mouse], rect_input.left
|
||||
stdcall [edit_box_mouse], rect_input.top
|
||||
stdcall [edit_box_mouse], rect_input.width
|
||||
stdcall [edit_box_mouse], rect_input.height
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;
|
||||
stdcall [check_box_mouse], use_rect_active_window
|
||||
|
||||
jmp .still
|
||||
|
||||
align 4
|
||||
.draw_window:
|
||||
start_draw_window
|
||||
|
||||
mov edx,[sc.work]
|
||||
add edx,0x33000000
|
||||
mov edi,riw_grab_text
|
||||
xor esi,esi
|
||||
mcall SF_CREATE_WINDOW, 100*65536+250, 100*65536+130
|
||||
|
||||
draw_labels rect_input_labels,rect_input_labels_end
|
||||
|
||||
stdcall [edit_box_draw], rect_input.left
|
||||
stdcall [edit_box_draw], rect_input.top
|
||||
stdcall [edit_box_draw], rect_input.width
|
||||
stdcall [edit_box_draw], rect_input.height
|
||||
;;;;;;;;;;;;;;;;;;;;;;
|
||||
stdcall [check_box_draw], use_rect_active_window
|
||||
|
||||
call read_rect
|
||||
call draw_rect_on_screen
|
||||
|
||||
stop_draw_window
|
||||
ret
|
||||
|
||||
align 4
|
||||
init_rect:
|
||||
bt dword [use_rect_active_window.flags],1
|
||||
jc init_rect_from_active_window
|
||||
pushad
|
||||
mov edi,rect_input_buffer.left
|
||||
movsx eax,word[rect.left]
|
||||
mov ecx,rect_input.left
|
||||
call init_editbox
|
||||
mov edi,rect_input_buffer.top
|
||||
movsx eax,word[rect.top]
|
||||
mov ecx,rect_input.top
|
||||
call init_editbox
|
||||
mov edi,rect_input_buffer.width
|
||||
movsx eax,word[rect.width]
|
||||
mov ecx,rect_input.width
|
||||
call init_editbox
|
||||
mov edi,rect_input_buffer.height
|
||||
movsx eax,word[rect.height]
|
||||
mov ecx,rect_input.height
|
||||
call init_editbox
|
||||
popad
|
||||
ret
|
||||
|
||||
align 4
|
||||
init_rect_from_active_window:
|
||||
|
||||
ret
|
||||
|
||||
align 4
|
||||
init_editbox:
|
||||
push edi
|
||||
push ecx
|
||||
xor ebx,ebx
|
||||
inc ebx
|
||||
cmp eax,10
|
||||
jl @f
|
||||
inc ebx
|
||||
@@:
|
||||
cmp eax,100
|
||||
jl @f
|
||||
inc ebx
|
||||
@@:
|
||||
cmp eax,1000
|
||||
jl @f
|
||||
inc ebx
|
||||
@@:
|
||||
call int_to_str
|
||||
call [edit_box_set_text] ;ecx,edi
|
||||
ret
|
||||
;--------------------------------------------------------------------
|
||||
;--- ‘ç¨âë¢ ¨¥ ®¡« á⨠---------------------------------------------
|
||||
;--------------------------------------------------------------------
|
||||
align 4
|
||||
read_rect:
|
||||
bt dword [use_rect_active_window.flags],1
|
||||
jc read_rect_from_active_window
|
||||
|
||||
mov edi,rect_input_buffer.left
|
||||
call zstr_to_int
|
||||
cmp ax,[scr.width]
|
||||
jb @f
|
||||
mov ax,[scr.width]
|
||||
@@:
|
||||
mov [rect.left],ax
|
||||
|
||||
mov edi,rect_input_buffer.top
|
||||
call zstr_to_int
|
||||
cmp ax,[scr.height]
|
||||
jb @f
|
||||
mov ax,[scr.height]
|
||||
@@:
|
||||
mov [rect.top],ax
|
||||
|
||||
mov edi,rect_input_buffer.width
|
||||
call zstr_to_int
|
||||
mov bx,[scr.width]
|
||||
sub bx,[rect.left]
|
||||
cmp ax,bx
|
||||
jb @f
|
||||
mov ax,bx
|
||||
@@:
|
||||
mov [rect.width],ax
|
||||
|
||||
mov edi,rect_input_buffer.height
|
||||
call zstr_to_int
|
||||
mov bx,[scr.height]
|
||||
sub bx,[rect.top]
|
||||
cmp ax,bx
|
||||
jb @f
|
||||
mov ax,bx
|
||||
@@:
|
||||
mov [rect.height],ax
|
||||
ret
|
||||
|
||||
align 4
|
||||
read_rect_from_active_window:
|
||||
call get_active_window_info
|
||||
|
||||
mov eax,[active_app.left]
|
||||
mov [rect.left],ax
|
||||
mov eax,[active_app.top]
|
||||
mov [rect.top],ax
|
||||
mov eax,[active_app.width]
|
||||
inc eax
|
||||
mov [rect.width],ax
|
||||
mov eax,[active_app.height]
|
||||
inc eax
|
||||
mov [rect.height],ax
|
||||
ret
|
||||
|
||||
align 4
|
||||
draw_rect_on_screen:
|
||||
|
||||
xor edx,edx
|
||||
mcall SF_DRAW_RECT, 150*65536+80, 5*65536+60
|
||||
|
||||
;movzx eax,word [rect.left]
|
||||
;mul word [scr.width]
|
||||
xor edx,edx
|
||||
movzx eax,word [scr.width]
|
||||
mov ebx,80
|
||||
div ebx
|
||||
mov ebx,eax
|
||||
|
||||
xor edx,edx
|
||||
movzx eax,word [rect.height]
|
||||
div ebx
|
||||
push ax
|
||||
|
||||
xor edx,edx
|
||||
movzx eax,word [rect.width]
|
||||
div ebx
|
||||
push ax
|
||||
|
||||
xor edx,edx
|
||||
movzx eax,word [rect.top]
|
||||
div ebx
|
||||
push ax
|
||||
|
||||
xor edx,edx
|
||||
movzx eax,word [rect.left]
|
||||
div ebx
|
||||
push ax
|
||||
|
||||
pop bx
|
||||
add bx,150
|
||||
shl ebx,16
|
||||
|
||||
pop cx
|
||||
add cx,5
|
||||
shl ecx,16
|
||||
|
||||
pop bx
|
||||
pop cx
|
||||
|
||||
mcall SF_DRAW_RECT,,,0xffffff
|
||||
ret
|
||||
|
||||
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
;DATA ¤ ë¥
|
||||
|
||||
system_dir_Boxlib db '/sys/lib/box_lib.obj',0
|
||||
system_dir_ProcLib db '/sys/lib/proc_lib.obj',0
|
||||
system_dir_LibImg db '/sys/lib/libimg.obj',0
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
ProcLib_import:
|
||||
OpenDialog_Init dd aOpenDialog_Init
|
||||
OpenDialog_Start dd aOpenDialog_Start
|
||||
;OpenDialog__Version dd aOpenDialog_Version
|
||||
dd 0,0
|
||||
aOpenDialog_Init db 'OpenDialog_init',0
|
||||
aOpenDialog_Start db 'OpenDialog_start',0
|
||||
;aOpenDialog_Version db 'Version_OpenDialog',0
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
Box_lib_import:
|
||||
;init_lib dd a_init
|
||||
;version_lib dd a_version
|
||||
|
||||
edit_box_draw dd aEdit_box_draw
|
||||
edit_box_key dd aEdit_box_key
|
||||
edit_box_mouse dd aEdit_box_mouse
|
||||
edit_box_set_text dd aEdit_box_set_text
|
||||
;version_ed dd aVersion_ed
|
||||
|
||||
init_checkbox dd aInit_checkbox
|
||||
check_box_draw dd aCheck_box_draw
|
||||
check_box_mouse dd aCheck_box_mouse
|
||||
;version_ch dd aVersion_ch
|
||||
|
||||
option_box_draw dd aOption_box_draw
|
||||
option_box_mouse dd aOption_box_mouse
|
||||
;version_op dd aVersion_op
|
||||
|
||||
PathShow_prepare dd sz_PathShow_prepare
|
||||
PathShow_draw dd sz_PathShow_draw
|
||||
;Version_path_show dd szVersion_path_show
|
||||
dd 0,0
|
||||
|
||||
;a_init db 'lib_init',0
|
||||
;a_version db 'version',0
|
||||
|
||||
aEdit_box_draw db 'edit_box_draw',0
|
||||
aEdit_box_key db 'edit_box_key',0
|
||||
aEdit_box_mouse db 'edit_box_mouse',0
|
||||
aEdit_box_set_text db 'edit_box_set_text',0
|
||||
;aVersion_ed db 'version_ed',0
|
||||
|
||||
|
||||
aInit_checkbox db 'init_checkbox2',0
|
||||
aCheck_box_draw db 'check_box_draw2',0
|
||||
aCheck_box_mouse db 'check_box_mouse2',0
|
||||
;aVersion_ch db 'version_ch2',0
|
||||
|
||||
aOption_box_draw db 'option_box_draw',0
|
||||
aOption_box_mouse db 'option_box_mouse',0
|
||||
;aVersion_op db 'version_op',0
|
||||
|
||||
sz_PathShow_prepare db 'PathShow_prepare',0
|
||||
sz_PathShow_draw db 'PathShow_draw',0
|
||||
;szVersion_path_show db 'version_PathShow',0
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
import_libimg:
|
||||
dd alib_init1
|
||||
img_is_img dd aimg_is_img
|
||||
img_info dd aimg_info
|
||||
img_from_file dd aimg_from_file
|
||||
img_to_file dd aimg_to_file
|
||||
img_from_rgb dd aimg_from_rgb
|
||||
img_to_rgb dd aimg_to_rgb
|
||||
img_to_rgb2 dd aimg_to_rgb2
|
||||
img_decode dd aimg_decode
|
||||
img_encode dd aimg_encode
|
||||
img_create dd aimg_create
|
||||
img_destroy dd aimg_destroy
|
||||
img_destroy_layer dd aimg_destroy_layer
|
||||
img_count dd aimg_count
|
||||
img_lock_bits dd aimg_lock_bits
|
||||
img_unlock_bits dd aimg_unlock_bits
|
||||
img_flip dd aimg_flip
|
||||
img_flip_layer dd aimg_flip_layer
|
||||
img_rotate dd aimg_rotate
|
||||
img_rotate_layer dd aimg_rotate_layer
|
||||
img_draw dd aimg_draw
|
||||
dd 0,0
|
||||
alib_init1 db 'lib_init',0
|
||||
aimg_is_img db 'img_is_img',0
|
||||
aimg_info db 'img_info',0
|
||||
aimg_from_file db 'img_from_file',0
|
||||
aimg_to_file db 'img_to_file',0
|
||||
aimg_from_rgb db 'img_from_rgb',0
|
||||
aimg_to_rgb db 'img_to_rgb',0
|
||||
aimg_to_rgb2 db 'img_to_rgb2',0
|
||||
aimg_decode db 'img_decode',0
|
||||
aimg_encode db 'img_encode',0
|
||||
aimg_create db 'img_create',0
|
||||
aimg_destroy db 'img_destroy',0
|
||||
aimg_destroy_layer db 'img_destroy_layer',0
|
||||
aimg_count db 'img_count',0
|
||||
aimg_lock_bits db 'img_lock_bits',0
|
||||
aimg_unlock_bits db 'img_unlock_bits',0
|
||||
aimg_flip db 'img_flip',0
|
||||
aimg_flip_layer db 'img_flip_layer',0
|
||||
aimg_rotate db 'img_rotate',0
|
||||
aimg_rotate_layer db 'img_rotate_layer',0
|
||||
aimg_draw db 'img_draw',0
|
||||
;---------------------------------------------------------------------
|
||||
;width,left,top,color,shift_color,focus_border_color,\
|
||||
; blur_border_color,text_color,max,text,mouse_variable,flags,size,pos
|
||||
|
||||
rect_input:
|
||||
.left edit_box 35,95,5, cl_white,0,0,0,0,5,rect_input_buffer.left, mouse_dd1,ed_figure_only ;+ed_focus
|
||||
.top edit_box 35,95,25,cl_white,0,0,0,0,5,rect_input_buffer.top, mouse_dd1,ed_figure_only
|
||||
.width edit_box 35,95,45,cl_white,0,0,0,0,5,rect_input_buffer.width, mouse_dd1,ed_figure_only
|
||||
.height edit_box 35,95,65,cl_white,0,0,0,0,5,rect_input_buffer.height,mouse_dd1,ed_figure_only
|
||||
rect_input_end:
|
||||
mouse_dd1 rd 1
|
||||
rect_input_labels:
|
||||
.left label 10,10,0,rect_input_labels_text.left
|
||||
.top label 10,30,0,rect_input_labels_text.top
|
||||
.width label 10,50,0,rect_input_labels_text.width
|
||||
.height label 10,70,0,rect_input_labels_text.height
|
||||
rect_input_labels_end:
|
||||
|
||||
rect_input_labels_text:
|
||||
if lang eq ru_RU
|
||||
.left db 'Žâáâ㯠᫥¢ :',0
|
||||
.top db 'Žâáâ㯠ᢥàåã:',0
|
||||
.width db '˜¨à¨ :',0
|
||||
.height db '‚ëá®â :',0
|
||||
else
|
||||
.left db 'Left:',0
|
||||
.top db 'Top:',0
|
||||
.width db 'Width:',0
|
||||
.height db 'Height:',0
|
||||
end if
|
||||
|
||||
riw_check_boxes:
|
||||
use_rect_active_window check_box2 (10 shl 16)+10,(85 shl 16) +10,5,cl_white,0,0,\
|
||||
riw_check_boxes_text, ch_flag_bottom
|
||||
riw_check_boxes_end:
|
||||
|
||||
if lang eq ru_RU
|
||||
riw_check_boxes_text db 'ˆá¯®«ì§®¢ âì ®¡« áâì ªâ¨¢®£® ®ª ',0
|
||||
riw_grab_text db 'Š®®à¤¨ âë ¨ à §¬¥àë ®¡« áâ¨:',0
|
||||
else
|
||||
riw_check_boxes_text db 'Use area of the active window',0
|
||||
riw_grab_text db 'Coordinates and size of the field:',0
|
||||
end if
|
||||
; Language support for locales: ru_RU (CP866), en_US.
|
||||
|
||||
align 4
|
||||
set_rect_window:
|
||||
mov ebx,set_rect_window_procinfo
|
||||
call get_slot_n
|
||||
|
||||
mov [set_rect_window_slot],ecx
|
||||
|
||||
set_events_mask (evm_redraw+evm_key+evm_button+evm_mouse)
|
||||
call init_rect
|
||||
edit_boxes_set_sys_color rect_input,rect_input_end,sc
|
||||
.red:
|
||||
labels_set_sys_color rect_input_labels,rect_input_labels_end,sc
|
||||
check_boxes_set_sys_color2 riw_check_boxes,riw_check_boxes_end,sc
|
||||
call .draw_window
|
||||
align 4
|
||||
.still:
|
||||
wait_event .red,.key,.button,.mouse
|
||||
|
||||
.key:
|
||||
get_key
|
||||
|
||||
stdcall [edit_box_key], rect_input.left
|
||||
stdcall [edit_box_key], rect_input.top
|
||||
stdcall [edit_box_key], rect_input.width
|
||||
stdcall [edit_box_key], rect_input.height
|
||||
|
||||
call read_rect
|
||||
call draw_rect_on_screen
|
||||
|
||||
jmp .still
|
||||
|
||||
.button:
|
||||
get_pressed_button
|
||||
|
||||
cmp ah,1
|
||||
jne @f
|
||||
btr dword [flags],3
|
||||
jmp close
|
||||
@@:
|
||||
|
||||
jmp .still
|
||||
|
||||
.mouse:
|
||||
get_active_window
|
||||
cmp eax,[set_rect_window_slot]
|
||||
jne .still
|
||||
|
||||
stdcall [edit_box_mouse], rect_input.left
|
||||
stdcall [edit_box_mouse], rect_input.top
|
||||
stdcall [edit_box_mouse], rect_input.width
|
||||
stdcall [edit_box_mouse], rect_input.height
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;
|
||||
stdcall [check_box_mouse], use_rect_active_window
|
||||
|
||||
jmp .still
|
||||
|
||||
align 4
|
||||
.draw_window:
|
||||
start_draw_window
|
||||
|
||||
mov edx,[sc.work]
|
||||
add edx,0x33000000
|
||||
mov edi,riw_grab_text
|
||||
xor esi,esi
|
||||
mcall SF_CREATE_WINDOW, 100*65536+250, 100*65536+130
|
||||
|
||||
draw_labels rect_input_labels,rect_input_labels_end
|
||||
|
||||
stdcall [edit_box_draw], rect_input.left
|
||||
stdcall [edit_box_draw], rect_input.top
|
||||
stdcall [edit_box_draw], rect_input.width
|
||||
stdcall [edit_box_draw], rect_input.height
|
||||
;;;;;;;;;;;;;;;;;;;;;;
|
||||
stdcall [check_box_draw], use_rect_active_window
|
||||
|
||||
call read_rect
|
||||
call draw_rect_on_screen
|
||||
|
||||
stop_draw_window
|
||||
ret
|
||||
|
||||
align 4
|
||||
init_rect:
|
||||
bt dword [use_rect_active_window.flags],1
|
||||
jc init_rect_from_active_window
|
||||
pushad
|
||||
mov edi,rect_input_buffer.left
|
||||
movsx eax,word[rect.left]
|
||||
mov ecx,rect_input.left
|
||||
call init_editbox
|
||||
mov edi,rect_input_buffer.top
|
||||
movsx eax,word[rect.top]
|
||||
mov ecx,rect_input.top
|
||||
call init_editbox
|
||||
mov edi,rect_input_buffer.width
|
||||
movsx eax,word[rect.width]
|
||||
mov ecx,rect_input.width
|
||||
call init_editbox
|
||||
mov edi,rect_input_buffer.height
|
||||
movsx eax,word[rect.height]
|
||||
mov ecx,rect_input.height
|
||||
call init_editbox
|
||||
popad
|
||||
ret
|
||||
|
||||
align 4
|
||||
init_rect_from_active_window:
|
||||
|
||||
ret
|
||||
|
||||
align 4
|
||||
init_editbox:
|
||||
push edi
|
||||
push ecx
|
||||
xor ebx,ebx
|
||||
inc ebx
|
||||
cmp eax,10
|
||||
jl @f
|
||||
inc ebx
|
||||
@@:
|
||||
cmp eax,100
|
||||
jl @f
|
||||
inc ebx
|
||||
@@:
|
||||
cmp eax,1000
|
||||
jl @f
|
||||
inc ebx
|
||||
@@:
|
||||
call int_to_str
|
||||
call [edit_box_set_text] ;ecx,edi
|
||||
ret
|
||||
;--------------------------------------------------------------------
|
||||
;--- ‘ç¨âë¢ ¨¥ ®¡« á⨠---------------------------------------------
|
||||
;--------------------------------------------------------------------
|
||||
align 4
|
||||
read_rect:
|
||||
bt dword [use_rect_active_window.flags],1
|
||||
jc read_rect_from_active_window
|
||||
|
||||
mov edi,rect_input_buffer.left
|
||||
call zstr_to_int
|
||||
cmp ax,[scr.width]
|
||||
jb @f
|
||||
mov ax,[scr.width]
|
||||
@@:
|
||||
mov [rect.left],ax
|
||||
|
||||
mov edi,rect_input_buffer.top
|
||||
call zstr_to_int
|
||||
cmp ax,[scr.height]
|
||||
jb @f
|
||||
mov ax,[scr.height]
|
||||
@@:
|
||||
mov [rect.top],ax
|
||||
|
||||
mov edi,rect_input_buffer.width
|
||||
call zstr_to_int
|
||||
mov bx,[scr.width]
|
||||
sub bx,[rect.left]
|
||||
cmp ax,bx
|
||||
jb @f
|
||||
mov ax,bx
|
||||
@@:
|
||||
mov [rect.width],ax
|
||||
|
||||
mov edi,rect_input_buffer.height
|
||||
call zstr_to_int
|
||||
mov bx,[scr.height]
|
||||
sub bx,[rect.top]
|
||||
cmp ax,bx
|
||||
jb @f
|
||||
mov ax,bx
|
||||
@@:
|
||||
mov [rect.height],ax
|
||||
ret
|
||||
|
||||
align 4
|
||||
read_rect_from_active_window:
|
||||
call get_active_window_info
|
||||
|
||||
mov eax,[active_app.left]
|
||||
mov [rect.left],ax
|
||||
mov eax,[active_app.top]
|
||||
mov [rect.top],ax
|
||||
mov eax,[active_app.width]
|
||||
inc eax
|
||||
mov [rect.width],ax
|
||||
mov eax,[active_app.height]
|
||||
inc eax
|
||||
mov [rect.height],ax
|
||||
ret
|
||||
|
||||
align 4
|
||||
draw_rect_on_screen:
|
||||
|
||||
xor edx,edx
|
||||
mcall SF_DRAW_RECT, 150*65536+80, 5*65536+60
|
||||
|
||||
;movzx eax,word [rect.left]
|
||||
;mul word [scr.width]
|
||||
xor edx,edx
|
||||
movzx eax,word [scr.width]
|
||||
mov ebx,80
|
||||
div ebx
|
||||
mov ebx,eax
|
||||
|
||||
xor edx,edx
|
||||
movzx eax,word [rect.height]
|
||||
div ebx
|
||||
push ax
|
||||
|
||||
xor edx,edx
|
||||
movzx eax,word [rect.width]
|
||||
div ebx
|
||||
push ax
|
||||
|
||||
xor edx,edx
|
||||
movzx eax,word [rect.top]
|
||||
div ebx
|
||||
push ax
|
||||
|
||||
xor edx,edx
|
||||
movzx eax,word [rect.left]
|
||||
div ebx
|
||||
push ax
|
||||
|
||||
pop bx
|
||||
add bx,150
|
||||
shl ebx,16
|
||||
|
||||
pop cx
|
||||
add cx,5
|
||||
shl ecx,16
|
||||
|
||||
pop bx
|
||||
pop cx
|
||||
|
||||
mcall SF_DRAW_RECT,,,0xffffff
|
||||
ret
|
||||
|
||||
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
;DATA ¤ ë¥
|
||||
|
||||
system_dir_Boxlib db '/sys/lib/box_lib.obj',0
|
||||
system_dir_ProcLib db '/sys/lib/proc_lib.obj',0
|
||||
system_dir_LibImg db '/sys/lib/libimg.obj',0
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
ProcLib_import:
|
||||
OpenDialog_Init dd aOpenDialog_Init
|
||||
OpenDialog_Start dd aOpenDialog_Start
|
||||
;OpenDialog__Version dd aOpenDialog_Version
|
||||
dd 0,0
|
||||
aOpenDialog_Init db 'OpenDialog_init',0
|
||||
aOpenDialog_Start db 'OpenDialog_start',0
|
||||
;aOpenDialog_Version db 'Version_OpenDialog',0
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
Box_lib_import:
|
||||
;init_lib dd a_init
|
||||
;version_lib dd a_version
|
||||
|
||||
edit_box_draw dd aEdit_box_draw
|
||||
edit_box_key dd aEdit_box_key
|
||||
edit_box_mouse dd aEdit_box_mouse
|
||||
edit_box_set_text dd aEdit_box_set_text
|
||||
;version_ed dd aVersion_ed
|
||||
|
||||
init_checkbox dd aInit_checkbox
|
||||
check_box_draw dd aCheck_box_draw
|
||||
check_box_mouse dd aCheck_box_mouse
|
||||
;version_ch dd aVersion_ch
|
||||
|
||||
option_box_draw dd aOption_box_draw
|
||||
option_box_mouse dd aOption_box_mouse
|
||||
;version_op dd aVersion_op
|
||||
|
||||
PathShow_prepare dd sz_PathShow_prepare
|
||||
PathShow_draw dd sz_PathShow_draw
|
||||
;Version_path_show dd szVersion_path_show
|
||||
dd 0,0
|
||||
|
||||
;a_init db 'lib_init',0
|
||||
;a_version db 'version',0
|
||||
|
||||
aEdit_box_draw db 'edit_box_draw',0
|
||||
aEdit_box_key db 'edit_box_key',0
|
||||
aEdit_box_mouse db 'edit_box_mouse',0
|
||||
aEdit_box_set_text db 'edit_box_set_text',0
|
||||
;aVersion_ed db 'version_ed',0
|
||||
|
||||
|
||||
aInit_checkbox db 'init_checkbox2',0
|
||||
aCheck_box_draw db 'check_box_draw2',0
|
||||
aCheck_box_mouse db 'check_box_mouse2',0
|
||||
;aVersion_ch db 'version_ch2',0
|
||||
|
||||
aOption_box_draw db 'option_box_draw',0
|
||||
aOption_box_mouse db 'option_box_mouse',0
|
||||
;aVersion_op db 'version_op',0
|
||||
|
||||
sz_PathShow_prepare db 'PathShow_prepare',0
|
||||
sz_PathShow_draw db 'PathShow_draw',0
|
||||
;szVersion_path_show db 'version_PathShow',0
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
import_libimg:
|
||||
dd alib_init1
|
||||
img_is_img dd aimg_is_img
|
||||
img_info dd aimg_info
|
||||
img_from_file dd aimg_from_file
|
||||
img_to_file dd aimg_to_file
|
||||
img_from_rgb dd aimg_from_rgb
|
||||
img_to_rgb dd aimg_to_rgb
|
||||
img_to_rgb2 dd aimg_to_rgb2
|
||||
img_decode dd aimg_decode
|
||||
img_encode dd aimg_encode
|
||||
img_create dd aimg_create
|
||||
img_destroy dd aimg_destroy
|
||||
img_destroy_layer dd aimg_destroy_layer
|
||||
img_count dd aimg_count
|
||||
img_lock_bits dd aimg_lock_bits
|
||||
img_unlock_bits dd aimg_unlock_bits
|
||||
img_flip dd aimg_flip
|
||||
img_flip_layer dd aimg_flip_layer
|
||||
img_rotate dd aimg_rotate
|
||||
img_rotate_layer dd aimg_rotate_layer
|
||||
img_draw dd aimg_draw
|
||||
dd 0,0
|
||||
alib_init1 db 'lib_init',0
|
||||
aimg_is_img db 'img_is_img',0
|
||||
aimg_info db 'img_info',0
|
||||
aimg_from_file db 'img_from_file',0
|
||||
aimg_to_file db 'img_to_file',0
|
||||
aimg_from_rgb db 'img_from_rgb',0
|
||||
aimg_to_rgb db 'img_to_rgb',0
|
||||
aimg_to_rgb2 db 'img_to_rgb2',0
|
||||
aimg_decode db 'img_decode',0
|
||||
aimg_encode db 'img_encode',0
|
||||
aimg_create db 'img_create',0
|
||||
aimg_destroy db 'img_destroy',0
|
||||
aimg_destroy_layer db 'img_destroy_layer',0
|
||||
aimg_count db 'img_count',0
|
||||
aimg_lock_bits db 'img_lock_bits',0
|
||||
aimg_unlock_bits db 'img_unlock_bits',0
|
||||
aimg_flip db 'img_flip',0
|
||||
aimg_flip_layer db 'img_flip_layer',0
|
||||
aimg_rotate db 'img_rotate',0
|
||||
aimg_rotate_layer db 'img_rotate_layer',0
|
||||
aimg_draw db 'img_draw',0
|
||||
;---------------------------------------------------------------------
|
||||
;width,left,top,color,shift_color,focus_border_color,\
|
||||
; blur_border_color,text_color,max,text,mouse_variable,flags,size,pos
|
||||
|
||||
rect_input:
|
||||
.left edit_box 35,95,5, cl_white,0,0,0,0,5,rect_input_buffer.left, mouse_dd1,ed_figure_only ;+ed_focus
|
||||
.top edit_box 35,95,25,cl_white,0,0,0,0,5,rect_input_buffer.top, mouse_dd1,ed_figure_only
|
||||
.width edit_box 35,95,45,cl_white,0,0,0,0,5,rect_input_buffer.width, mouse_dd1,ed_figure_only
|
||||
.height edit_box 35,95,65,cl_white,0,0,0,0,5,rect_input_buffer.height,mouse_dd1,ed_figure_only
|
||||
rect_input_end:
|
||||
mouse_dd1 rd 1
|
||||
rect_input_labels:
|
||||
.left label 10,10,0,rect_input_labels_text.left
|
||||
.top label 10,30,0,rect_input_labels_text.top
|
||||
.width label 10,50,0,rect_input_labels_text.width
|
||||
.height label 10,70,0,rect_input_labels_text.height
|
||||
rect_input_labels_end:
|
||||
|
||||
rect_input_labels_text:
|
||||
if lang eq ru_RU
|
||||
.left db 'Žâáâ㯠᫥¢ :',0
|
||||
.top db 'Žâáâ㯠ᢥàåã:',0
|
||||
.width db '˜¨à¨ :',0
|
||||
.height db '‚ëá®â :',0
|
||||
else ; Default to en_US
|
||||
.left db 'Left:',0
|
||||
.top db 'Top:',0
|
||||
.width db 'Width:',0
|
||||
.height db 'Height:',0
|
||||
end if
|
||||
|
||||
riw_check_boxes:
|
||||
use_rect_active_window check_box2 (10 shl 16)+10,(85 shl 16) +10,5,cl_white,0,0,\
|
||||
riw_check_boxes_text, ch_flag_bottom
|
||||
riw_check_boxes_end:
|
||||
|
||||
if lang eq ru_RU
|
||||
riw_check_boxes_text db 'ˆá¯®«ì§®¢ âì ®¡« áâì ªâ¨¢®£® ®ª ',0
|
||||
riw_grab_text db 'Š®®à¤¨ âë ¨ à §¬¥àë ®¡« áâ¨:',0
|
||||
else ; Default to en_US
|
||||
riw_check_boxes_text db 'Use area of the active window',0
|
||||
riw_grab_text db 'Coordinates and size of the field:',0
|
||||
end if
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,181 +1,183 @@
|
||||
;
|
||||
; ¢ í⮬ ä ©«¥ ᮡà ë äãªæ¨¨ ã¦ë¥ ¤«ï ᮧ¤ ¨ï ¨
|
||||
; à ¡®âë ®ª á áâனª ¬¨
|
||||
;
|
||||
|
||||
wnd_scale_width equ 320 ;è¨à¨ ®ª á áâனª ¬¨
|
||||
wnd_scale_height equ 150 ;¢ëá®â ®ª á áâனª ¬¨
|
||||
|
||||
align 4
|
||||
wnd_run_scale db 0 ;¯¥à¥¬¥ ï á«¥¤ïé ï § ⥬ çâ®-¡ë ¥ § ¯ã᪠âì ¡®«ìè¥ 1-£® ®ª ᮠ᢮©á⢠¬¨ ®¤®¢à¥¬¥®
|
||||
|
||||
;¤ ®¥ ®ª® (¯à®æ¥áá) ¢ë§ë¢ ¥âìáï äãªæ¨¥© but_wnd_coords
|
||||
align 4
|
||||
start_scale:
|
||||
pushad
|
||||
mcall SF_SET_EVENTS_MASK,0x27 ;¬ ᪠®¦¨¤ ¥¬ëå ᮡë⨩
|
||||
inc byte[wnd_run_scale]
|
||||
|
||||
edit_boxes_set_sys_color edit3,editboxes_end_sc,sc ;ãáâ ®¢ª á¨á⥬ëå 梥⮢
|
||||
call get_scale
|
||||
popad
|
||||
call red_win_scale
|
||||
|
||||
;¥ ®âàë¢ âì íâã äãªæ¨î ®â ¯à¥¤ë¤ã饩
|
||||
align 4
|
||||
still_scale:
|
||||
pushad
|
||||
|
||||
mcall SF_WAIT_EVENT_TIMEOUT,10
|
||||
or eax,eax
|
||||
jnz @f
|
||||
call timer_funct_scale
|
||||
jmp .end
|
||||
@@:
|
||||
|
||||
cmp al,1 ;¨§¬. ¯®«®¦¥¨¥ ®ª
|
||||
jne @f
|
||||
call red_win_scale
|
||||
jmp .end
|
||||
@@:
|
||||
cmp al,2
|
||||
jne @f
|
||||
call key_scale
|
||||
jmp .end
|
||||
@@:
|
||||
cmp al,3
|
||||
jz button_scale
|
||||
cmp al,6
|
||||
jne @f
|
||||
call mouse_scale
|
||||
@@:
|
||||
.end:
|
||||
popad
|
||||
jmp still_scale
|
||||
|
||||
align 4
|
||||
red_win_scale:
|
||||
pushad
|
||||
mcall SF_REDRAW,SSF_BEGIN_DRAW
|
||||
|
||||
mcall SF_STYLE_SETTINGS,SSF_GET_SKIN_HEIGHT
|
||||
mov edi,capt_opt ;children window caption
|
||||
mov bx,word[procinfo.box.left]
|
||||
add bx,word[buf_0.l]
|
||||
add bx,5 ;è¨à¨ ¡®ª®¢®© à ¬ª¨
|
||||
shl ebx,16
|
||||
mov bx,wnd_scale_width
|
||||
mov cx,word[procinfo.box.top]
|
||||
add cx,ax ;add skin height
|
||||
add cx,word[buf_0.t]
|
||||
shl ecx,16
|
||||
mov cx,wnd_scale_height
|
||||
mov edx,[sc.work]
|
||||
or edx,0x33000000
|
||||
xor eax,eax
|
||||
int 0x40
|
||||
|
||||
mov esi,[sc.work_button]
|
||||
;ebx = (l<:)+w, ecx = (t<:)+h
|
||||
mcall SF_DEFINE_BUTTON, (5 shl 16)+59, (95 shl 16)+20, 3
|
||||
mcall , (75 shl 16)+59, (95 shl 16)+20, 4
|
||||
|
||||
mov ecx,[sc.work_text]
|
||||
bts ecx,31 ;à¨á㥬 ï áâப § ª 稢 ¥âáï ã«ñ¬
|
||||
mcall SF_DRAW_TEXT, (5 shl 16)+15,, capt_sc
|
||||
|
||||
mov ecx,[sc.work_button_text]
|
||||
bts ecx,31
|
||||
mcall , (9 shl 16)+101,, txt_but_cancel
|
||||
mov edx,txt_but_apply
|
||||
mcall ,(79 shl 16)+101
|
||||
|
||||
stdcall [edit_box_draw], edit3
|
||||
|
||||
mcall SF_REDRAW,SSF_END_DRAW
|
||||
popad
|
||||
ret
|
||||
|
||||
align 4
|
||||
proc key_scale uses eax ebx
|
||||
mcall SF_GET_KEY
|
||||
|
||||
test word [edit3.flags],10b ;ed_focus
|
||||
je @f
|
||||
stdcall [edit_box_key], edit3
|
||||
;jmp .end
|
||||
@@:
|
||||
|
||||
.end:
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
mouse_scale:
|
||||
stdcall [edit_box_mouse], edit3
|
||||
ret
|
||||
|
||||
align 4
|
||||
button_scale:
|
||||
mcall SF_GET_BUTTON
|
||||
|
||||
cmp ah,3
|
||||
je .exit
|
||||
cmp ah,4
|
||||
jne .end_save
|
||||
push eax ecx edi esi
|
||||
finit
|
||||
|
||||
mov esi,string3
|
||||
mov edi,Data_String
|
||||
cld
|
||||
mov ecx,8
|
||||
rep movsd
|
||||
call String_to_DoubleFloat
|
||||
fld qword[Data_Double] ;áç¨âë¢ ¥¬ ª ª double
|
||||
fstp qword[Scale1mm] ;á®åà 塞 ª ª double
|
||||
|
||||
pop esi edi ecx eax
|
||||
jmp .exit
|
||||
.end_save:
|
||||
|
||||
cmp ah,1
|
||||
jne still_scale.end
|
||||
.exit:
|
||||
mov byte[wnd_run_scale],0 ;®¡ã«ï¥¬ áç¥â稪 ®ª®
|
||||
mcall SF_TERMINATE_PROCESS ;¢ë室 ¨§ ¯à®£à ¬¬ë
|
||||
|
||||
align 4
|
||||
get_scale:
|
||||
;§ £à㧪 ª®®à¤¨ â ¢ editbox-ë
|
||||
push eax
|
||||
mov word[NumberSymbolsAD],8
|
||||
finit
|
||||
fld qword[Scale1mm]
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
call String_crop_0
|
||||
stdcall [edit_box_set_text], edit3, Data_String
|
||||
;stdcall [edit_box_draw], edit3
|
||||
pop eax
|
||||
ret
|
||||
|
||||
align 4
|
||||
proc timer_funct_scale
|
||||
;¯à®á¬ âਢ ¥¬ ¢ë¤¥«¥ãî ª®®à¤¨ âã
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
if lang eq ru_RU
|
||||
capt_opt db '<27> áâனª¨',0
|
||||
capt_sc db 'Œ áèâ ¡:',0
|
||||
else
|
||||
capt_opt db 'Options',0
|
||||
capt_sc db 'Scale:',0
|
||||
end if
|
||||
|
||||
edit3 edit_box 80, 54, 11, 0xffd0d0, 0xff, 0x80ff, 0, 0x8000, 34, string3, mouse_dd, 0
|
||||
editboxes_end_sc:
|
||||
|
||||
string3 rb 34
|
||||
;
|
||||
; ¢ í⮬ ä ©«¥ ᮡà ë äãªæ¨¨ ã¦ë¥ ¤«ï ᮧ¤ ¨ï ¨
|
||||
; à ¡®âë ®ª á áâனª ¬¨
|
||||
;
|
||||
|
||||
; Language support for locales: ru_RU (CP866), en_US.
|
||||
|
||||
wnd_scale_width equ 320 ;è¨à¨ ®ª á áâனª ¬¨
|
||||
wnd_scale_height equ 150 ;¢ëá®â ®ª á áâனª ¬¨
|
||||
|
||||
align 4
|
||||
wnd_run_scale db 0 ;¯¥à¥¬¥ ï á«¥¤ïé ï § ⥬ çâ®-¡ë ¥ § ¯ã᪠âì ¡®«ìè¥ 1-£® ®ª ᮠ᢮©á⢠¬¨ ®¤®¢à¥¬¥®
|
||||
|
||||
;¤ ®¥ ®ª® (¯à®æ¥áá) ¢ë§ë¢ ¥âìáï äãªæ¨¥© but_wnd_coords
|
||||
align 4
|
||||
start_scale:
|
||||
pushad
|
||||
mcall SF_SET_EVENTS_MASK,0x27 ;¬ ᪠®¦¨¤ ¥¬ëå ᮡë⨩
|
||||
inc byte[wnd_run_scale]
|
||||
|
||||
edit_boxes_set_sys_color edit3,editboxes_end_sc,sc ;ãáâ ®¢ª á¨á⥬ëå 梥⮢
|
||||
call get_scale
|
||||
popad
|
||||
call red_win_scale
|
||||
|
||||
;¥ ®âàë¢ âì íâã äãªæ¨î ®â ¯à¥¤ë¤ã饩
|
||||
align 4
|
||||
still_scale:
|
||||
pushad
|
||||
|
||||
mcall SF_WAIT_EVENT_TIMEOUT,10
|
||||
or eax,eax
|
||||
jnz @f
|
||||
call timer_funct_scale
|
||||
jmp .end
|
||||
@@:
|
||||
|
||||
cmp al,1 ;¨§¬. ¯®«®¦¥¨¥ ®ª
|
||||
jne @f
|
||||
call red_win_scale
|
||||
jmp .end
|
||||
@@:
|
||||
cmp al,2
|
||||
jne @f
|
||||
call key_scale
|
||||
jmp .end
|
||||
@@:
|
||||
cmp al,3
|
||||
jz button_scale
|
||||
cmp al,6
|
||||
jne @f
|
||||
call mouse_scale
|
||||
@@:
|
||||
.end:
|
||||
popad
|
||||
jmp still_scale
|
||||
|
||||
align 4
|
||||
red_win_scale:
|
||||
pushad
|
||||
mcall SF_REDRAW,SSF_BEGIN_DRAW
|
||||
|
||||
mcall SF_STYLE_SETTINGS,SSF_GET_SKIN_HEIGHT
|
||||
mov edi,capt_opt ;children window caption
|
||||
mov bx,word[procinfo.box.left]
|
||||
add bx,word[buf_0.l]
|
||||
add bx,5 ;è¨à¨ ¡®ª®¢®© à ¬ª¨
|
||||
shl ebx,16
|
||||
mov bx,wnd_scale_width
|
||||
mov cx,word[procinfo.box.top]
|
||||
add cx,ax ;add skin height
|
||||
add cx,word[buf_0.t]
|
||||
shl ecx,16
|
||||
mov cx,wnd_scale_height
|
||||
mov edx,[sc.work]
|
||||
or edx,0x33000000
|
||||
xor eax,eax
|
||||
int 0x40
|
||||
|
||||
mov esi,[sc.work_button]
|
||||
;ebx = (l<:)+w, ecx = (t<:)+h
|
||||
mcall SF_DEFINE_BUTTON, (5 shl 16)+59, (95 shl 16)+20, 3
|
||||
mcall , (75 shl 16)+59, (95 shl 16)+20, 4
|
||||
|
||||
mov ecx,[sc.work_text]
|
||||
bts ecx,31 ;à¨á㥬 ï áâப § ª 稢 ¥âáï ã«ñ¬
|
||||
mcall SF_DRAW_TEXT, (5 shl 16)+15,, capt_sc
|
||||
|
||||
mov ecx,[sc.work_button_text]
|
||||
bts ecx,31
|
||||
mcall , (9 shl 16)+101,, txt_but_cancel
|
||||
mov edx,txt_but_apply
|
||||
mcall ,(79 shl 16)+101
|
||||
|
||||
stdcall [edit_box_draw], edit3
|
||||
|
||||
mcall SF_REDRAW,SSF_END_DRAW
|
||||
popad
|
||||
ret
|
||||
|
||||
align 4
|
||||
proc key_scale uses eax ebx
|
||||
mcall SF_GET_KEY
|
||||
|
||||
test word [edit3.flags],10b ;ed_focus
|
||||
je @f
|
||||
stdcall [edit_box_key], edit3
|
||||
;jmp .end
|
||||
@@:
|
||||
|
||||
.end:
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
mouse_scale:
|
||||
stdcall [edit_box_mouse], edit3
|
||||
ret
|
||||
|
||||
align 4
|
||||
button_scale:
|
||||
mcall SF_GET_BUTTON
|
||||
|
||||
cmp ah,3
|
||||
je .exit
|
||||
cmp ah,4
|
||||
jne .end_save
|
||||
push eax ecx edi esi
|
||||
finit
|
||||
|
||||
mov esi,string3
|
||||
mov edi,Data_String
|
||||
cld
|
||||
mov ecx,8
|
||||
rep movsd
|
||||
call String_to_DoubleFloat
|
||||
fld qword[Data_Double] ;áç¨âë¢ ¥¬ ª ª double
|
||||
fstp qword[Scale1mm] ;á®åà 塞 ª ª double
|
||||
|
||||
pop esi edi ecx eax
|
||||
jmp .exit
|
||||
.end_save:
|
||||
|
||||
cmp ah,1
|
||||
jne still_scale.end
|
||||
.exit:
|
||||
mov byte[wnd_run_scale],0 ;®¡ã«ï¥¬ áç¥â稪 ®ª®
|
||||
mcall SF_TERMINATE_PROCESS ;¢ë室 ¨§ ¯à®£à ¬¬ë
|
||||
|
||||
align 4
|
||||
get_scale:
|
||||
;§ £à㧪 ª®®à¤¨ â ¢ editbox-ë
|
||||
push eax
|
||||
mov word[NumberSymbolsAD],8
|
||||
finit
|
||||
fld qword[Scale1mm]
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
call String_crop_0
|
||||
stdcall [edit_box_set_text], edit3, Data_String
|
||||
;stdcall [edit_box_draw], edit3
|
||||
pop eax
|
||||
ret
|
||||
|
||||
align 4
|
||||
proc timer_funct_scale
|
||||
;¯à®á¬ âਢ ¥¬ ¢ë¤¥«¥ãî ª®®à¤¨ âã
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
if lang eq ru_RU
|
||||
capt_opt db '<27> áâனª¨',0
|
||||
capt_sc db 'Œ áèâ ¡:',0
|
||||
else ; Default to en_US
|
||||
capt_opt db 'Options',0
|
||||
capt_sc db 'Scale:',0
|
||||
end if
|
||||
|
||||
edit3 edit_box 80, 54, 11, 0xffd0d0, 0xff, 0x80ff, 0, 0x8000, 34, string3, mouse_dd, 0
|
||||
editboxes_end_sc:
|
||||
|
||||
string3 rb 34
|
||||
|
@ -19,7 +19,7 @@ use32
|
||||
dd 0x0
|
||||
|
||||
include "..\..\..\..\macros.inc"
|
||||
include "lang.inc"
|
||||
include "lang.inc" ; Language support for locales: de_DE, en_US.
|
||||
START:
|
||||
|
||||
call cmdexist
|
||||
@ -2780,6 +2780,7 @@ title db 'CMD - Command line interpreter',0
|
||||
smb_cursor db '|'
|
||||
|
||||
prompt db 'CMD>>'
|
||||
|
||||
if lang eq de_DE
|
||||
h1 db ' CMD - Command line interpreter version 0.26 '
|
||||
h2 db ' copyleft Chemist - dmitry_gt@tut.by '
|
||||
@ -2823,7 +2824,9 @@ mess14 db 'Datei erfolgreich umbenannt '
|
||||
mess15 db 'ERROR: Kann Datei nicht umbenennen! '
|
||||
mess16 db 'Scriptname erwartet! '
|
||||
mess17 db 'Dieses Kommando ist nur in Scripts zulaessig! '
|
||||
else
|
||||
|
||||
else ; Default to en_US
|
||||
|
||||
h1 db ' CMD - Command line interpreter version 0.26 '
|
||||
h2 db ' copyleft Chemist - dmitry_gt@tut.by '
|
||||
h3 db ' Available commands: '
|
||||
@ -2831,7 +2834,7 @@ h4 db ' HELP - Display this text LS - List files '
|
||||
h5 db ' EXIT - Exit Programm CP - Copy file '
|
||||
h6 db ' CLS - Clear Screen PS - Process info '
|
||||
h7 db ' KILL - Kill Process RN - Rename File '
|
||||
h8 db ' VER - Display programm version '
|
||||
h8 db ' VER - Display program version '
|
||||
h9 db ' DEL - Delete file from ramdisk '
|
||||
h10 db ' SHUTDOWN - Quit Menuet '
|
||||
h11 db ' PAUSE - Wait for keypress '
|
||||
@ -2849,7 +2852,7 @@ proc_head db ' PID Name Start Length Proc_NUMB '
|
||||
proc_hd11 db '-------------------------------------------- '
|
||||
|
||||
mess1 db 'Press any key to continue (ESC - Cancel)... '
|
||||
mess2 db 'Plz specify a 4 byte process number (not PID) '
|
||||
mess2 db 'Specify a 4 byte process number (not PID) '
|
||||
mess3 db 'Process with number you specified has been '
|
||||
mess4 db 'terminated. '
|
||||
mess5 db 'Usage: del [filename] '
|
||||
|
@ -2,38 +2,40 @@
|
||||
;///// LOCALIZED STRINGS //////////////////////////////////////////////////////
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
; Language support for locales: ru_RU (CP866), en_US, fr_FR, de_DE.
|
||||
|
||||
lsz lname,\
|
||||
ru,'ˆ¬ï',\
|
||||
en,'Name',\
|
||||
fr,'Nom',\
|
||||
ge,'Name'
|
||||
ru_RU,'ˆ¬ï',\
|
||||
en_US,'Name',\
|
||||
fr_FR,'Nom',\
|
||||
de_DE,'Name'
|
||||
lsz sort_kind,\
|
||||
ru,'¨à',\
|
||||
en,'nx',\
|
||||
fr,'ne',\
|
||||
ge,'ne'
|
||||
ru_RU,'¨à',\
|
||||
en_US,'nx',\
|
||||
fr_FR,'ne',\
|
||||
de_DE,'ne'
|
||||
lsz btmkeys,\
|
||||
ru,'<27>®¬®éì <20>®«ì§Œ <20>à®á¬ <20>¥¤ ªâ Š®¯¨à ',\
|
||||
ru,'<27>¥à¥ <20> ¯ª “¤ «¥ Š®äŒ ‚ë室',\
|
||||
en,'Help UserMn View Edit Copy ',\
|
||||
en,'RenMov MkFold Delete ConfMn Quit',\
|
||||
fr,'Aide UserMn Vue Editer Copier ',\
|
||||
fr,'RenDep CrÎeRp Efface ConfMn Quitter',\
|
||||
ge,'Hilfe Menà Anzeig Bearb. Kopie ',\
|
||||
ge,'UmbBew MkDir LÂsche Funkt. Ende'
|
||||
ru_RU,'<27>®¬®éì <20>®«ì§Œ <20>à®á¬ <20>¥¤ ªâ Š®¯¨à ',\
|
||||
ru_RU,'<27>¥à¥ <20> ¯ª “¤ «¥ Š®äŒ ‚ë室',\
|
||||
en_US,'Help UserMn View Edit Copy ',\
|
||||
en_US,'RenMov MkFold Delete ConfMn Quit',\
|
||||
fr_FR,'Aide UserMn Vue Editer Copier ',\
|
||||
fr_FR,'RenDep CrÎeRp Efface ConfMn Quitter',\
|
||||
de_DE,'Hilfe Menà Anzeig Bearb. Kopie ',\
|
||||
de_DE,'UmbBew MkDir LÂsche Funkt. Ende'
|
||||
lsz sz_cancel,\
|
||||
ru,'Žâ¬¥ ',\
|
||||
en,'Cancel',\
|
||||
fr,'Annuler',\
|
||||
ge,'Beenden'
|
||||
ru_RU,'Žâ¬¥ ',\
|
||||
en_US,'Cancel',\
|
||||
fr_FR,'Annuler',\
|
||||
de_DE,'Beenden'
|
||||
;---------- COPY DIALOG ----------
|
||||
lsz sz_copy,\
|
||||
ru,'Š®¯¨à®¢ âì "',\
|
||||
en,'Copy "',\
|
||||
fr,'Copier "',\
|
||||
ge,'Kopiere "'
|
||||
ru_RU,'Š®¯¨à®¢ âì "',\
|
||||
en_US,'Copy "',\
|
||||
fr_FR,'Copier "',\
|
||||
de_DE,'Kopiere "'
|
||||
lsz sz_copyto,\
|
||||
ru,'" ¢:',\
|
||||
en,'" to:',\
|
||||
fr,'" vers:',\
|
||||
ge,'" nach:'
|
||||
ru_RU,'" ¢:',\
|
||||
en_US,'" to:',\
|
||||
fr_FR,'" vers:',\
|
||||
de_DE,'" nach:'
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -35,6 +35,7 @@
|
||||
dd temp_area , 0x0 ; I_Param , I_Icon
|
||||
|
||||
include 'lang.inc'
|
||||
; Language support for locales: ru_RU (CP866), en_US, de_DE.
|
||||
include '..\..\..\..\macros.inc'
|
||||
include '..\..\..\..\develop\examples\editbox\trunk\editbox.inc'
|
||||
;include 'macros.inc'
|
||||
@ -655,9 +656,9 @@ labelt:
|
||||
db 'MeView v.0.4'
|
||||
|
||||
lsz buttext,\
|
||||
en, ' FILE OPEN INFO BGRD',\
|
||||
ru, ' ”€‰‹ Ž’Š<E28099> ˆ<>”Ž ”Ž<E2809D> ',\
|
||||
de, 'DATEI OEFNEN INFO HGRD'
|
||||
en_US, ' FILE OPEN INFO BGRD',\
|
||||
ru_RU, ' ”€‰‹ Ž’Š<E28099> ˆ<>”Ž ”Ž<E2809D> ',\
|
||||
de_DE, 'DATEI OEFNEN INFO HGRD'
|
||||
|
||||
thread1: ; start of thread1
|
||||
|
||||
@ -926,25 +927,25 @@ draw_window2:
|
||||
; DATA AREA
|
||||
|
||||
lsz labelt2,\
|
||||
en, 'File info',\
|
||||
ru, 'ˆä®à¬ æ¨ï ® ä ©«¥',\
|
||||
de, 'Dateiinfo'
|
||||
en_US, 'File info',\
|
||||
ru_RU, 'ˆä®à¬ æ¨ï ® ä ©«¥',\
|
||||
de_DE, 'Dateiinfo'
|
||||
|
||||
lsz fitext,\
|
||||
en, 'FILE SIZE ',\
|
||||
en, 'X SIZE ',\
|
||||
en, 'Y SIZE ',\
|
||||
en, 'BITS PER PIXEL',\
|
||||
en_US, 'FILE SIZE ',\
|
||||
en_US, 'X SIZE ',\
|
||||
en_US, 'Y SIZE ',\
|
||||
en_US, 'BITS PER PIXEL',\
|
||||
\
|
||||
ru, '<27> §¬¥à ä ©« ',\
|
||||
ru, '˜¨à¨ ',\
|
||||
ru, '‚ëá®â ',\
|
||||
ru, '<27>¨â ¯¨ªá¥« ',\
|
||||
ru_RU, '<27> §¬¥à ä ©« ',\
|
||||
ru_RU, '˜¨à¨ ',\
|
||||
ru_RU, '‚ëá®â ',\
|
||||
ru_RU, '<27>¨â ¯¨ªá¥« ',\
|
||||
\
|
||||
de, 'FATEIGROESSE ',\
|
||||
de, 'X GROESSE ',\
|
||||
de, 'Y GROESSE ',\
|
||||
de, 'BITS PER PIXEL'
|
||||
de_DE, 'FATEIGROESSE ',\
|
||||
de_DE, 'X GROESSE ',\
|
||||
de_DE, 'Y GROESSE ',\
|
||||
de_DE, 'BITS PER PIXEL'
|
||||
|
||||
thread3: ; start of bgrd thread
|
||||
|
||||
@ -1114,29 +1115,29 @@ wnd_width dd 210
|
||||
wnd_height dd 53
|
||||
|
||||
lsz labelt3,\
|
||||
en, 'Background set',\
|
||||
ru, "“áâ ®¢ª ä® ",\
|
||||
de, 'Hintergrund gesetzt'
|
||||
en_US, 'Background set',\
|
||||
ru_RU, "“áâ ®¢ª ä® ",\
|
||||
de_DE, 'Hintergrund gesetzt'
|
||||
|
||||
lsz bgrdtext,\
|
||||
en, 'SET AS BACKGROUND:',\
|
||||
ru, '’¨¯ ®¡®¥¢:',\
|
||||
de, 'ALS HINTERGRUND'
|
||||
en_US, 'SET AS BACKGROUND:',\
|
||||
ru_RU, '’¨¯ ®¡®¥¢:',\
|
||||
de_DE, 'ALS HINTERGRUND'
|
||||
|
||||
lsz tiled,\
|
||||
en, 'TILED',\
|
||||
ru, '§ ¬®áâ¨âì',\
|
||||
de, 'GEKACHELT'
|
||||
en_US, 'TILED',\
|
||||
ru_RU, '§ ¬®áâ¨âì',\
|
||||
de_DE, 'GEKACHELT'
|
||||
|
||||
lsz stretch,\
|
||||
en, 'STRETCH',\
|
||||
ru, 'à áâïãâì',\
|
||||
de, 'GESTRECKT'
|
||||
en_US, 'STRETCH',\
|
||||
ru_RU, 'à áâïãâì',\
|
||||
de_DE, 'GESTRECKT'
|
||||
|
||||
lsz ok_btn,\
|
||||
en, 'Ok',\
|
||||
ru, 'Ok',\
|
||||
de, 'Ok'
|
||||
en_US, 'Ok',\
|
||||
ru_RU, 'Ok',\
|
||||
de_DE, 'Ok'
|
||||
|
||||
image_file dd 0
|
||||
image_file_1 dd 0
|
||||
|
@ -1,393 +1,393 @@
|
||||
;
|
||||
; DESKTOP CONTEXT MENU
|
||||
; written by Ivan Poddubny
|
||||
;
|
||||
; €¢â®à - ˆ¢ <20>®¤¤ã¡ë©
|
||||
; e-mail: ivan-yar@bk.ru
|
||||
;
|
||||
; Compile with flat assembler
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
; version: 1.1
|
||||
; last update: 27/03/2012
|
||||
; changed by: Marat Zakiyanov aka Mario79, aka Mario
|
||||
; changes: The program uses only 3404 bytes memory is now.
|
||||
; Optimisations and code refactoring.
|
||||
;------------------------------------------------------------------------------
|
||||
include 'lang.inc'
|
||||
include '..\..\..\..\macros.inc'
|
||||
;------------------------------------------------------------------------------
|
||||
use32
|
||||
org 0x0
|
||||
db 'MENUET01' ; 8 byte id
|
||||
dd 0x01 ; header version
|
||||
dd START ; start of code
|
||||
dd IM_END ; size of image
|
||||
dd I_END ; memory for app
|
||||
dd stack_area ; esp
|
||||
dd 0 ; boot parameters
|
||||
dd 0 ; path
|
||||
;------------------------------------------------------------------------------
|
||||
START:
|
||||
; ¯®«ãç¨âì á¨áâ¥¬ë¥ æ¢¥â
|
||||
mcall 48,3,sc,sizeof.system_colors
|
||||
; ãáâ ®¢¨¬ ¬ áªã ᮡë⨩ - á ¨â¥à¥áã¥â ⮫쪮 ¬ëèì
|
||||
mcall 40,100000b
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
still: ; £« ¢ë© 横« ®á®¢®£® ¯à®æ¥áá
|
||||
mcall 10 ; ¦¤ñ¬ ᮡëâ¨ï
|
||||
|
||||
mcall 37,2 ; ª ª¨¥ ¦ âë ª¯®¯ª¨?
|
||||
cmp eax,ebx ; ¥á«¨ ¥ ¯à ¢ ï, ¢®§¢à â
|
||||
jne still
|
||||
;--------------------------------------
|
||||
; íâ® ¤«ï ®â« ¤ª¨ - ¥á«¨ ¬ëèì ¢ â®çª¥ (0;0), § ªà®¥¬áï
|
||||
; xor ebx,ebx
|
||||
; mcall 37
|
||||
; test eax,eax ; ªãàá®à ¢ â®çª¥ (0;0), â.¥. eax = 0
|
||||
; je exit
|
||||
;--------------------------------------
|
||||
; ª®®à¤¨ âë ªãàá®à
|
||||
xor ebx,ebx
|
||||
mcall 37
|
||||
|
||||
mov ebx,eax ; eax = cursor_x
|
||||
shr eax,16 ; ebx = cursor_y
|
||||
and ebx,0xffff
|
||||
mov [curx1],eax ; curx1 = cursor_x
|
||||
mov [cury1],ebx ; cury1 = cursor_y
|
||||
; ª®¬ã ¯à¨ ¤«¥¦¨â â®çª ?
|
||||
mcall 34,[curx1],[cury1]
|
||||
cmp al,1 ; 1 - ï¤à®
|
||||
jne still
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@: ; ¯®¤®¦¤ñ¬, ¯®ª ¯®«ì§®¢ â¥«ì ¥ ®â¯ãá⨫ ¯à ¢ãî ª®¯ªã ¬ëè¨
|
||||
mcall 37,2 ; ¦ âë «¨ ª®¯ª¨ ¬ëè¨?
|
||||
test eax,ebx ; ¥á«¨ ®â¯ãá⨫, (eax != 2)
|
||||
jz @f ; ¨¤ñ¬ ¢ ç «® £« ¢®£® 横«
|
||||
|
||||
mcall 68,1 ; ¨ ç¥ ¯¥à¥ª«î稬áï á«¥¤ãî騩 ¯®â®ª á¨áâ¥¬ë ¨ ª®£¤
|
||||
jmp @b ; ¢ë¯®«¥¨¥ ¢¥à¥âáï í⮬㠯®â®ªã, ¯à®¢¥à¨¬ ¬ëèì ®¯ïâì
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
; ¥á«¨ 㦥 ¡ë«® ®âªàëâ® ¬¥î, 㦮 ¯®¤®¦¤ âì, ¯®ª ®® § ªà®¥âáï:
|
||||
cmp [menu_opened],0
|
||||
je @f
|
||||
|
||||
mcall 68,1 ; ¯¥à¥ª«î稬áï á«¥¤ãî騩 ¯®â®ª á¨á⥬ë
|
||||
; ¡®«¥¥ íää¥ªâ¨¢ë© á¯®á®¡ § ¤¥à¦ª¨ 祬 mcall 5
|
||||
jmp @b
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
; ⥯¥àì ¬®¦® ᬥ«® § ¯ã᪠âì ¯à®æ¥áá (¯®â®ª) ¬¥î
|
||||
mcall 51,1,start_wnd,stack_wnd
|
||||
jmp still
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
exit_menu: ; ¥á«¨ ¢ë室¨¬ ¨§ ¬¥î, ¤® § ¯¨á âì ¢ [menu_opened] 0
|
||||
mov [menu_opened],0
|
||||
;--------------------------------------
|
||||
align 4
|
||||
exit: ; áî¤ ¬ë ¨¤ñ¬, ª®£¤ ¢ë室¨¬ ¨§ ®á®¢®£® ¯à®æ¥áá
|
||||
or eax,-1 ; eax = -1
|
||||
mcall
|
||||
;------------------------------------------------------------------------------
|
||||
; §¤¥áì áâ àâã¥â ¯à®æ¥áá ¬¥î
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
start_wnd:
|
||||
mov [menu_opened],1
|
||||
; ãáâ ®¢¨¬ ¬ áªã ¦¥« ¥¬ëå ᮡë⨩: ¬¥î + ª®¯ª¨ + ¯¥à¥à¨á®¢ª
|
||||
mcall 40,100101b
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
red:
|
||||
call draw_window
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
still2: ; £« ¢ë© 横« ¯à®æ¥áá ¬¥î
|
||||
mcall 10 ; ¦¤ñ¬ ᮡëâ¨ï
|
||||
|
||||
cmp eax,1 ; ¯¥à¥à¨á®¢ª ?
|
||||
je red
|
||||
|
||||
cmp eax,3 ; ª®¯ª ?
|
||||
je button
|
||||
|
||||
cmp eax,6 ; ¬ëèì?
|
||||
je mouse
|
||||
|
||||
jmp still2 ; ¢¥àñ¬áï ¢ ç «® £« ¢®£® 横«
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
; Ž<><C5BD>€<EFBFBD>Ž’—ˆŠ Œ›˜ˆ
|
||||
mouse: ; ª®£¤ ¯®«ì§®¢ â¥«ì ¦¬ñâ ª®¯ªã ¬ëè¨, § ªà®¥¬áï
|
||||
mcall 37,2 ; ª ª¨¥ ª®¯ª¨ ¦ âë?
|
||||
test eax,eax ; ¨ª ª¨¥? - ⮣¤ ¯à¥ªà á®! ¢¥àñ¬áï ¢ £« ¢ë© 横«
|
||||
jz still2
|
||||
|
||||
mcall 37,0
|
||||
|
||||
mov esi, eax
|
||||
shr esi, 16
|
||||
movzx edi, ax
|
||||
mcall 9, procinfo, -1
|
||||
|
||||
mov eax, [procinfo.box.left]
|
||||
cmp esi, eax
|
||||
jl exit_menu
|
||||
|
||||
add eax, [procinfo.box.width]
|
||||
cmp esi, eax
|
||||
jge exit_menu
|
||||
|
||||
mov eax, [procinfo.box.top]
|
||||
cmp edi, eax
|
||||
jl exit_menu
|
||||
|
||||
add eax, [procinfo.box.height]
|
||||
cmp edi, eax
|
||||
jge exit_menu
|
||||
|
||||
jmp still2
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
; <20>€†€’€ Š<>Ž<EFBFBD>Š€
|
||||
button:
|
||||
mcall 17 ; ¯®«ãç¨âì ¨¤¥â¨ä¨ª â®à ¦ ⮩ ª®¯ª¨
|
||||
|
||||
sub ah,10 ; áà ¢¨¢ ¥¬ á 10
|
||||
jl nofuncbtns ; ¥á«¨ ¬¥ìè¥ - § ªàë¢ ¥¬ ¬¥î
|
||||
|
||||
movzx ebx,ah ; ¯®«ã稫¨ ®¬¥à ¯à®£à ¬¬ë ¢ ᯨ᪥ ¢ ebx
|
||||
mov esi,[startapps + ebx*4]
|
||||
mov edi,start_info.path
|
||||
cld
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
lodsb
|
||||
stosb
|
||||
test al,al
|
||||
jnz @b
|
||||
mcall 70, start_info
|
||||
|
||||
; mov eax,5 ; ¯®¤®¦¤ñ¬, ¯®ª ¯à®£à ¬¬ § ¯ãáâ¨âìáï
|
||||
; mov ebx,1 ; â® ¥ñ ®ª® ¥ ¡ã¤¥â ®âà¨á®¢ ® (¡ £ ¢ ï¤à¥???)
|
||||
; mcall ; à ᪮¬¬¥â¨àã©â¥ í⨠áâப¨, ¥á«¨ ã ¢ á ¯à®¡«¥¬ë
|
||||
; á ®âà¨á®¢ª®©
|
||||
;--------------------------------------
|
||||
align 4
|
||||
nofuncbtns: ; § ªàë¢ ¥¬ ¬¥î
|
||||
jmp exit_menu
|
||||
;------------------------------------------------------------------------------
|
||||
_BTNS_ = 6 ; ª®«¨ç¥á⢮ ª®¯®ª ("¯ãªâ®¢ ¬¥î")
|
||||
|
||||
if lang eq ru_RU
|
||||
font = 0x00000000
|
||||
string_length = 20 ; ¤«¨ áâப¨
|
||||
wnd_x_size = 133 ; è¨à¨ ®ª
|
||||
title_pos = 36 shl 16 + 7
|
||||
else
|
||||
font = 0x10000000
|
||||
string_length = 12 ; ¤«¨ áâப¨
|
||||
wnd_x_size = 105 ; è¨à¨ ®ª
|
||||
title_pos = 23 shl 16 + 7
|
||||
end if
|
||||
;------------------------------------------------------------------------------
|
||||
;*******************************
|
||||
;******** <20>ˆ‘“…Œ ŽŠ<C5BD>Ž ********
|
||||
;*******************************
|
||||
draw_window:
|
||||
mcall 12,1 ; ç¨ ¥¬ "à¨á®¢ âì"
|
||||
|
||||
mov eax,[curx1] ; ⥪ã騥 ª®®à¤¨ âë ªãàá®à
|
||||
mov [curx],eax ; § ¯¨è¥¬ ¢ ª®®à¤¨ âë ®ª
|
||||
mov eax,[cury1]
|
||||
mov [cury],eax
|
||||
; ⥯¥àì ¡ã¤¥¬ áç¨â âì ª®®à¤¨ âë ®ª , çâ®¡ë ®® § ªà © íªà ¥ ¢ë«¥§«®
|
||||
mcall 14 ; ¯®«ã稬 à §¬¥à íªà
|
||||
|
||||
mov ebx,eax
|
||||
shr eax,16 ; ¢ eax - x_screen
|
||||
and ebx,0xffff ; ¢ ebx - y_screen
|
||||
add eax,-wnd_x_size ; eax = [x_screen - è¨à¨ ®ª ]
|
||||
add ebx,-_BTNS_*15-21 ; ebx = [y_screen - ¢ëá®â ®ª ]
|
||||
|
||||
cmp eax,[curx]
|
||||
jg .okx ; ¥á«¨ ®ª® ᫨誮¬ ¡«¨§ª® ª ¯à ¢®¬ã ªà î,
|
||||
add [curx],-wnd_x_size ; ᤢ¨¥¬ ¥£® ¢«¥¢® 100
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.okx:
|
||||
cmp ebx, [cury]
|
||||
jg .oky ; ¯® ¢¥à⨪ «¨ â®ç® â ª¦¥
|
||||
add [cury], -_BTNS_*15-21
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.oky:
|
||||
xor eax, eax ; äãªæ¨ï 0 - ᮧ¤ âì ®ª®
|
||||
mov ebx, [curx] ; ebx = [ª®®à¤¨ â ¯® x] shl 16 + [è¨à¨ ]
|
||||
shl ebx, 16
|
||||
add ebx, wnd_x_size
|
||||
mov ecx, [cury] ; ecx = [ª®®à¤¨ â ¯® y] shl 16 + [¢ëá®â ]
|
||||
shl ecx, 16
|
||||
add ecx, _BTNS_*15+21
|
||||
mov edx, [sc.work] ; 梥â à ¡®ç¥© ®¡« áâ¨
|
||||
mov esi, [sc.grab] ; 梥⠧ £®«®¢ª
|
||||
or esi, 0x81000000
|
||||
mov edi, [sc.frame] ; 梥â à ¬ª¨
|
||||
mcall
|
||||
|
||||
mov eax, 4 ; § £®«®¢®ª
|
||||
mov ebx, title_pos ; [x] shl 16 + [y]
|
||||
mov ecx, [sc.grab_text]; èà¨äâ ¨ 梥â (á¥àë©)
|
||||
or ecx, 0x10000000
|
||||
|
||||
push ecx
|
||||
push ecx
|
||||
xor edx,edx
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.dec_color:
|
||||
sub byte [esp+edx], 0x33
|
||||
jae @f
|
||||
mov byte [esp+edx], 0
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
inc edx
|
||||
jnp .dec_color
|
||||
pop ecx
|
||||
mov edx, title ; ¤à¥á § £®«®¢ª
|
||||
mov esi, title.size ; ¤«¨ § £®«®¢ª ("M E N U")
|
||||
mcall
|
||||
pop ecx
|
||||
add ebx, 1 shl 16 ; ᤢ¨¥¬ ¢¯à ¢® 1
|
||||
mcall
|
||||
|
||||
mov ebx, 1*65536+wnd_x_size-2 ; ç¨ ¥¬ ¤¥« âì ª®¯ª¨
|
||||
mov ecx, 20*65536+15
|
||||
mov edx, 10 or 0x40000000 ; ¡¨â 30 ãáâ ®¢«¥ => ª®¯ª ¥ à¨áã¥âáï
|
||||
|
||||
mov edi,_BTNS_ ; ª®«¨ç¥á⢮ ª®¯®ª (áçñâ稪)
|
||||
;--------------------------------------
|
||||
align 4
|
||||
newbtn: ; ç «® 横«
|
||||
mcall 8 ; ᮧ¤ ñ¬ ª®¯ªã
|
||||
|
||||
; ¯¨è¥¬ ⥪áâ ª®¯ª¥
|
||||
pushad ; á¯ á ¥¬ ॣ¨áâàë
|
||||
shr ecx, 16
|
||||
and ebx, 0xffff0000
|
||||
add ebx, ecx ; ebx = [x] shl 16 + [y];
|
||||
add ebx, 10*65536+4 ; ebx += ᬥ饨¥ ®â®á¨â¥«ì® ªà ï ª®¯ª¨;
|
||||
mov ecx, [sc.work_text] ; èà¨äâ ¨ 梥â
|
||||
or ecx, font
|
||||
add edx, -10 ; edx = ®¬¥à ª®¯ª¨;
|
||||
imul edx, string_length ; edx *= ¤«¨ áâப¨;
|
||||
add edx, text ; edx += text; ⥯¥àì ¢ edx ¤à¥á áâப¨
|
||||
mov esi, string_length ; ¢ esi - ¤«¨ áâப¨
|
||||
mcall 4
|
||||
popad
|
||||
|
||||
inc edx ; ®¬¥à ª®¯ª¨++;
|
||||
add ecx,15*65536 ; 㢥«¨ç¨¬ ᬥ饨¥ ¯® y
|
||||
dec edi ; 㬥ì訬 áçñâ稪
|
||||
jnz newbtn ; ¥á«¨ ¥ ®«ì, ¯®¢â®à¨¬ ¢áñ ¥éñ à §
|
||||
|
||||
mcall 12,2 ; § ª®ç¨«¨ "à¨á®¢ âì"
|
||||
ret ; ¢®§¢à â
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
; „€<EFBFBD><EFBFBD>›… <20><>Žƒ<C5BD>€ŒŒ›
|
||||
|
||||
macro strtbl name, [string]
|
||||
{
|
||||
common
|
||||
label name dword
|
||||
forward
|
||||
local str
|
||||
dd str
|
||||
forward
|
||||
str db string
|
||||
}
|
||||
|
||||
strtbl startapps ,\
|
||||
<"/sys/PIC4",0> ,\
|
||||
<"/sys/DESKTOP",0> ,\
|
||||
<"/sys/ICON",0>,\
|
||||
<"/sys/SETUP",0> ,\
|
||||
<"/sys/DEVELOP/BOARD",0> ,\
|
||||
<"/sys/CPU",0>
|
||||
|
||||
sz title, "KolibriOS"
|
||||
|
||||
lsz text,\
|
||||
en, 'Background ',\
|
||||
en, 'Desktop ',\
|
||||
en, 'Icon manager',\
|
||||
en, 'Device setup',\
|
||||
en, 'Debug board ',\
|
||||
en, 'Processes ',\
|
||||
\
|
||||
ru, 'ƒ¥¥à â®à ®¡®¥¢ ',\
|
||||
ru, '<27> áâனª ®ª® ',\
|
||||
ru, '“¯à ¢«¥¨¥ ¨ª®ª ¬¨ ',\
|
||||
ru, '<27> áâனª ãáâனá⢠',\
|
||||
ru, '<27> ¥«ì ®â« ¤ª¨ ',\
|
||||
ru, '<27>à®æ¥ááë ',\
|
||||
\
|
||||
et, 'Taust ',\
|
||||
et, 'Töölaud ',\
|
||||
et, 'Ikooni hald.',\
|
||||
et, 'Seadme hald.',\
|
||||
et, 'Silumis aken',\
|
||||
et, 'Protsessid '
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
start_info:
|
||||
.mode dd 7
|
||||
dd 0
|
||||
.params dd 0
|
||||
dd 0
|
||||
dd 0
|
||||
db 0
|
||||
dd start_info.path
|
||||
;------------------------------------------------------------------------------
|
||||
IM_END:
|
||||
align 4
|
||||
; <20>…ˆ<E280A6>ˆ–ˆ€‹ˆ‡ˆ<E280A1>Ž‚€<E2809A><E282AC>›… „€<E2809E><E282AC>›…
|
||||
curx1 dd ? ; ª®®à¤¨ âë ªãàá®à
|
||||
cury1 dd ?
|
||||
curx dd ? ; ª®®à¤¨ âë ®ª ¬¥î
|
||||
cury dd ?
|
||||
|
||||
menu_opened db ? ; ®âªàëâ® ¬¥î ¨«¨ ¥â? (1-¤ , 0-¥â)
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
start_info.path rb 256
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
sc system_colors ; á¨áâ¥¬ë¥ æ¢¥â
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
procinfo process_information ; ¨ä®à¬ æ¨ï ® ¯à®æ¥áá¥
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
rb 512 ; áâíª ¤«ï ®ª ¬¥î - å¢ â¨â ¨ 1 Š¡
|
||||
stack_wnd:
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
rb 512
|
||||
stack_area:
|
||||
;------------------------------------------------------------------------------
|
||||
I_END:
|
||||
;------------------------------------------------------------------------------
|
||||
; ŠŽ<C5A0>…– <20><>Žƒ<C5BD>€ŒŒ›
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; DESKTOP CONTEXT MENU
|
||||
; written by Ivan Poddubny
|
||||
;
|
||||
; €¢â®à - ˆ¢ <20>®¤¤ã¡ë©
|
||||
; e-mail: ivan-yar@bk.ru
|
||||
;
|
||||
; Compile with flat assembler
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
; version: 1.1
|
||||
; last update: 27/03/2012
|
||||
; changed by: Marat Zakiyanov aka Mario79, aka Mario
|
||||
; changes: The program uses only 3404 bytes memory is now.
|
||||
; Optimisations and code refactoring.
|
||||
;------------------------------------------------------------------------------
|
||||
include 'lang.inc'
|
||||
include '..\..\..\..\macros.inc'
|
||||
;------------------------------------------------------------------------------
|
||||
use32
|
||||
org 0x0
|
||||
db 'MENUET01' ; 8 byte id
|
||||
dd 0x01 ; header version
|
||||
dd START ; start of code
|
||||
dd IM_END ; size of image
|
||||
dd I_END ; memory for app
|
||||
dd stack_area ; esp
|
||||
dd 0 ; boot parameters
|
||||
dd 0 ; path
|
||||
;------------------------------------------------------------------------------
|
||||
START:
|
||||
; ¯®«ãç¨âì á¨áâ¥¬ë¥ æ¢¥â
|
||||
mcall 48,3,sc,sizeof.system_colors
|
||||
; ãáâ ®¢¨¬ ¬ áªã ᮡë⨩ - á ¨â¥à¥áã¥â ⮫쪮 ¬ëèì
|
||||
mcall 40,100000b
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
still: ; £« ¢ë© 横« ®á®¢®£® ¯à®æ¥áá
|
||||
mcall 10 ; ¦¤ñ¬ ᮡëâ¨ï
|
||||
|
||||
mcall 37,2 ; ª ª¨¥ ¦ âë ª¯®¯ª¨?
|
||||
cmp eax,ebx ; ¥á«¨ ¥ ¯à ¢ ï, ¢®§¢à â
|
||||
jne still
|
||||
;--------------------------------------
|
||||
; íâ® ¤«ï ®â« ¤ª¨ - ¥á«¨ ¬ëèì ¢ â®çª¥ (0;0), § ªà®¥¬áï
|
||||
; xor ebx,ebx
|
||||
; mcall 37
|
||||
; test eax,eax ; ªãàá®à ¢ â®çª¥ (0;0), â.¥. eax = 0
|
||||
; je exit
|
||||
;--------------------------------------
|
||||
; ª®®à¤¨ âë ªãàá®à
|
||||
xor ebx,ebx
|
||||
mcall 37
|
||||
|
||||
mov ebx,eax ; eax = cursor_x
|
||||
shr eax,16 ; ebx = cursor_y
|
||||
and ebx,0xffff
|
||||
mov [curx1],eax ; curx1 = cursor_x
|
||||
mov [cury1],ebx ; cury1 = cursor_y
|
||||
; ª®¬ã ¯à¨ ¤«¥¦¨â â®çª ?
|
||||
mcall 34,[curx1],[cury1]
|
||||
cmp al,1 ; 1 - ï¤à®
|
||||
jne still
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@: ; ¯®¤®¦¤ñ¬, ¯®ª ¯®«ì§®¢ â¥«ì ¥ ®â¯ãá⨫ ¯à ¢ãî ª®¯ªã ¬ëè¨
|
||||
mcall 37,2 ; ¦ âë «¨ ª®¯ª¨ ¬ëè¨?
|
||||
test eax,ebx ; ¥á«¨ ®â¯ãá⨫, (eax != 2)
|
||||
jz @f ; ¨¤ñ¬ ¢ ç «® £« ¢®£® 横«
|
||||
|
||||
mcall 68,1 ; ¨ ç¥ ¯¥à¥ª«î稬áï á«¥¤ãî騩 ¯®â®ª á¨áâ¥¬ë ¨ ª®£¤
|
||||
jmp @b ; ¢ë¯®«¥¨¥ ¢¥à¥âáï í⮬㠯®â®ªã, ¯à®¢¥à¨¬ ¬ëèì ®¯ïâì
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
; ¥á«¨ 㦥 ¡ë«® ®âªàëâ® ¬¥î, 㦮 ¯®¤®¦¤ âì, ¯®ª ®® § ªà®¥âáï:
|
||||
cmp [menu_opened],0
|
||||
je @f
|
||||
|
||||
mcall 68,1 ; ¯¥à¥ª«î稬áï á«¥¤ãî騩 ¯®â®ª á¨á⥬ë
|
||||
; ¡®«¥¥ íää¥ªâ¨¢ë© á¯®á®¡ § ¤¥à¦ª¨ 祬 mcall 5
|
||||
jmp @b
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
; ⥯¥àì ¬®¦® ᬥ«® § ¯ã᪠âì ¯à®æ¥áá (¯®â®ª) ¬¥î
|
||||
mcall 51,1,start_wnd,stack_wnd
|
||||
jmp still
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
exit_menu: ; ¥á«¨ ¢ë室¨¬ ¨§ ¬¥î, ¤® § ¯¨á âì ¢ [menu_opened] 0
|
||||
mov [menu_opened],0
|
||||
;--------------------------------------
|
||||
align 4
|
||||
exit: ; áî¤ ¬ë ¨¤ñ¬, ª®£¤ ¢ë室¨¬ ¨§ ®á®¢®£® ¯à®æ¥áá
|
||||
or eax,-1 ; eax = -1
|
||||
mcall
|
||||
;------------------------------------------------------------------------------
|
||||
; §¤¥áì áâ àâã¥â ¯à®æ¥áá ¬¥î
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
start_wnd:
|
||||
mov [menu_opened],1
|
||||
; ãáâ ®¢¨¬ ¬ áªã ¦¥« ¥¬ëå ᮡë⨩: ¬¥î + ª®¯ª¨ + ¯¥à¥à¨á®¢ª
|
||||
mcall 40,100101b
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
red:
|
||||
call draw_window
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
still2: ; £« ¢ë© 横« ¯à®æ¥áá ¬¥î
|
||||
mcall 10 ; ¦¤ñ¬ ᮡëâ¨ï
|
||||
|
||||
cmp eax,1 ; ¯¥à¥à¨á®¢ª ?
|
||||
je red
|
||||
|
||||
cmp eax,3 ; ª®¯ª ?
|
||||
je button
|
||||
|
||||
cmp eax,6 ; ¬ëèì?
|
||||
je mouse
|
||||
|
||||
jmp still2 ; ¢¥àñ¬áï ¢ ç «® £« ¢®£® 横«
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
; Ž<><C5BD>€<EFBFBD>Ž’—ˆŠ Œ›˜ˆ
|
||||
mouse: ; ª®£¤ ¯®«ì§®¢ â¥«ì ¦¬ñâ ª®¯ªã ¬ëè¨, § ªà®¥¬áï
|
||||
mcall 37,2 ; ª ª¨¥ ª®¯ª¨ ¦ âë?
|
||||
test eax,eax ; ¨ª ª¨¥? - ⮣¤ ¯à¥ªà á®! ¢¥àñ¬áï ¢ £« ¢ë© 横«
|
||||
jz still2
|
||||
|
||||
mcall 37,0
|
||||
|
||||
mov esi, eax
|
||||
shr esi, 16
|
||||
movzx edi, ax
|
||||
mcall 9, procinfo, -1
|
||||
|
||||
mov eax, [procinfo.box.left]
|
||||
cmp esi, eax
|
||||
jl exit_menu
|
||||
|
||||
add eax, [procinfo.box.width]
|
||||
cmp esi, eax
|
||||
jge exit_menu
|
||||
|
||||
mov eax, [procinfo.box.top]
|
||||
cmp edi, eax
|
||||
jl exit_menu
|
||||
|
||||
add eax, [procinfo.box.height]
|
||||
cmp edi, eax
|
||||
jge exit_menu
|
||||
|
||||
jmp still2
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
; <20>€†€’€ Š<>Ž<EFBFBD>Š€
|
||||
button:
|
||||
mcall 17 ; ¯®«ãç¨âì ¨¤¥â¨ä¨ª â®à ¦ ⮩ ª®¯ª¨
|
||||
|
||||
sub ah,10 ; áà ¢¨¢ ¥¬ á 10
|
||||
jl nofuncbtns ; ¥á«¨ ¬¥ìè¥ - § ªàë¢ ¥¬ ¬¥î
|
||||
|
||||
movzx ebx,ah ; ¯®«ã稫¨ ®¬¥à ¯à®£à ¬¬ë ¢ ᯨ᪥ ¢ ebx
|
||||
mov esi,[startapps + ebx*4]
|
||||
mov edi,start_info.path
|
||||
cld
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
lodsb
|
||||
stosb
|
||||
test al,al
|
||||
jnz @b
|
||||
mcall 70, start_info
|
||||
|
||||
; mov eax,5 ; ¯®¤®¦¤ñ¬, ¯®ª ¯à®£à ¬¬ § ¯ãáâ¨âìáï
|
||||
; mov ebx,1 ; â® ¥ñ ®ª® ¥ ¡ã¤¥â ®âà¨á®¢ ® (¡ £ ¢ ï¤à¥???)
|
||||
; mcall ; à ᪮¬¬¥â¨àã©â¥ í⨠áâப¨, ¥á«¨ ã ¢ á ¯à®¡«¥¬ë
|
||||
; á ®âà¨á®¢ª®©
|
||||
;--------------------------------------
|
||||
align 4
|
||||
nofuncbtns: ; § ªàë¢ ¥¬ ¬¥î
|
||||
jmp exit_menu
|
||||
;------------------------------------------------------------------------------
|
||||
_BTNS_ = 6 ; ª®«¨ç¥á⢮ ª®¯®ª ("¯ãªâ®¢ ¬¥î")
|
||||
|
||||
if lang eq ru_RU
|
||||
font = 0x00000000
|
||||
string_length = 20 ; ¤«¨ áâப¨
|
||||
wnd_x_size = 133 ; è¨à¨ ®ª
|
||||
title_pos = 36 shl 16 + 7
|
||||
else
|
||||
font = 0x10000000
|
||||
string_length = 12 ; string length
|
||||
wnd_x_size = 105 ; window width
|
||||
title_pos = 23 shl 16 + 7
|
||||
end if
|
||||
;------------------------------------------------------------------------------
|
||||
;*******************************
|
||||
;******** <20>ˆ‘“…Œ ŽŠ<C5BD>Ž ********
|
||||
;*******************************
|
||||
draw_window:
|
||||
mcall 12,1 ; ç¨ ¥¬ "à¨á®¢ âì"
|
||||
|
||||
mov eax,[curx1] ; ⥪ã騥 ª®®à¤¨ âë ªãàá®à
|
||||
mov [curx],eax ; § ¯¨è¥¬ ¢ ª®®à¤¨ âë ®ª
|
||||
mov eax,[cury1]
|
||||
mov [cury],eax
|
||||
; ⥯¥àì ¡ã¤¥¬ áç¨â âì ª®®à¤¨ âë ®ª , çâ®¡ë ®® § ªà © íªà ¥ ¢ë«¥§«®
|
||||
mcall 14 ; ¯®«ã稬 à §¬¥à íªà
|
||||
|
||||
mov ebx,eax
|
||||
shr eax,16 ; ¢ eax - x_screen
|
||||
and ebx,0xffff ; ¢ ebx - y_screen
|
||||
add eax,-wnd_x_size ; eax = [x_screen - è¨à¨ ®ª ]
|
||||
add ebx,-_BTNS_*15-21 ; ebx = [y_screen - ¢ëá®â ®ª ]
|
||||
|
||||
cmp eax,[curx]
|
||||
jg .okx ; ¥á«¨ ®ª® ᫨誮¬ ¡«¨§ª® ª ¯à ¢®¬ã ªà î,
|
||||
add [curx],-wnd_x_size ; ᤢ¨¥¬ ¥£® ¢«¥¢® 100
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.okx:
|
||||
cmp ebx, [cury]
|
||||
jg .oky ; ¯® ¢¥à⨪ «¨ â®ç® â ª¦¥
|
||||
add [cury], -_BTNS_*15-21
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.oky:
|
||||
xor eax, eax ; äãªæ¨ï 0 - ᮧ¤ âì ®ª®
|
||||
mov ebx, [curx] ; ebx = [ª®®à¤¨ â ¯® x] shl 16 + [è¨à¨ ]
|
||||
shl ebx, 16
|
||||
add ebx, wnd_x_size
|
||||
mov ecx, [cury] ; ecx = [ª®®à¤¨ â ¯® y] shl 16 + [¢ëá®â ]
|
||||
shl ecx, 16
|
||||
add ecx, _BTNS_*15+21
|
||||
mov edx, [sc.work] ; 梥â à ¡®ç¥© ®¡« áâ¨
|
||||
mov esi, [sc.grab] ; 梥⠧ £®«®¢ª
|
||||
or esi, 0x81000000
|
||||
mov edi, [sc.frame] ; 梥â à ¬ª¨
|
||||
mcall
|
||||
|
||||
mov eax, 4 ; § £®«®¢®ª
|
||||
mov ebx, title_pos ; [x] shl 16 + [y]
|
||||
mov ecx, [sc.grab_text]; èà¨äâ ¨ 梥â (á¥àë©)
|
||||
or ecx, 0x10000000
|
||||
|
||||
push ecx
|
||||
push ecx
|
||||
xor edx,edx
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.dec_color:
|
||||
sub byte [esp+edx], 0x33
|
||||
jae @f
|
||||
mov byte [esp+edx], 0
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
inc edx
|
||||
jnp .dec_color
|
||||
pop ecx
|
||||
mov edx, title ; ¤à¥á § £®«®¢ª
|
||||
mov esi, title.size ; ¤«¨ § £®«®¢ª ("M E N U")
|
||||
mcall
|
||||
pop ecx
|
||||
add ebx, 1 shl 16 ; ᤢ¨¥¬ ¢¯à ¢® 1
|
||||
mcall
|
||||
|
||||
mov ebx, 1*65536+wnd_x_size-2 ; ç¨ ¥¬ ¤¥« âì ª®¯ª¨
|
||||
mov ecx, 20*65536+15
|
||||
mov edx, 10 or 0x40000000 ; ¡¨â 30 ãáâ ®¢«¥ => ª®¯ª ¥ à¨áã¥âáï
|
||||
|
||||
mov edi,_BTNS_ ; ª®«¨ç¥á⢮ ª®¯®ª (áçñâ稪)
|
||||
;--------------------------------------
|
||||
align 4
|
||||
newbtn: ; ç «® 横«
|
||||
mcall 8 ; ᮧ¤ ñ¬ ª®¯ªã
|
||||
|
||||
; ¯¨è¥¬ ⥪áâ ª®¯ª¥
|
||||
pushad ; á¯ á ¥¬ ॣ¨áâàë
|
||||
shr ecx, 16
|
||||
and ebx, 0xffff0000
|
||||
add ebx, ecx ; ebx = [x] shl 16 + [y];
|
||||
add ebx, 10*65536+4 ; ebx += ᬥ饨¥ ®â®á¨â¥«ì® ªà ï ª®¯ª¨;
|
||||
mov ecx, [sc.work_text] ; èà¨äâ ¨ 梥â
|
||||
or ecx, font
|
||||
add edx, -10 ; edx = ®¬¥à ª®¯ª¨;
|
||||
imul edx, string_length ; edx *= ¤«¨ áâப¨;
|
||||
add edx, text ; edx += text; ⥯¥àì ¢ edx ¤à¥á áâப¨
|
||||
mov esi, string_length ; ¢ esi - ¤«¨ áâப¨
|
||||
mcall 4
|
||||
popad
|
||||
|
||||
inc edx ; ®¬¥à ª®¯ª¨++;
|
||||
add ecx,15*65536 ; 㢥«¨ç¨¬ ᬥ饨¥ ¯® y
|
||||
dec edi ; 㬥ì訬 áçñâ稪
|
||||
jnz newbtn ; ¥á«¨ ¥ ®«ì, ¯®¢â®à¨¬ ¢áñ ¥éñ à §
|
||||
|
||||
mcall 12,2 ; § ª®ç¨«¨ "à¨á®¢ âì"
|
||||
ret ; ¢®§¢à â
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
; PROGRAM DATA
|
||||
|
||||
macro strtbl name, [string]
|
||||
{
|
||||
common
|
||||
label name dword
|
||||
forward
|
||||
local str
|
||||
dd str
|
||||
forward
|
||||
str db string
|
||||
}
|
||||
|
||||
strtbl startapps ,\
|
||||
<"/sys/PIC4",0> ,\
|
||||
<"/sys/DESKTOP",0> ,\
|
||||
<"/sys/ICON",0>,\
|
||||
<"/sys/SETUP",0> ,\
|
||||
<"/sys/DEVELOP/BOARD",0> ,\
|
||||
<"/sys/CPU",0>
|
||||
|
||||
sz title, "KolibriOS"
|
||||
|
||||
lsz text,\
|
||||
en_US, 'Background ',\
|
||||
en_US, 'Desktop ',\
|
||||
en_US, 'Icon manager',\
|
||||
en_US, 'Device setup',\
|
||||
en_US, 'Debug board ',\
|
||||
en_US, 'Processes ',\
|
||||
\
|
||||
ru_RU, 'ƒ¥¥à â®à ®¡®¥¢ ',\
|
||||
ru_RU, '<27> áâனª ®ª® ',\
|
||||
ru_RU, '“¯à ¢«¥¨¥ ¨ª®ª ¬¨ ',\
|
||||
ru_RU, '<27> áâனª ãáâனá⢠',\
|
||||
ru_RU, '<27> ¥«ì ®â« ¤ª¨ ',\
|
||||
ru_RU, '<27>à®æ¥ááë ',\
|
||||
\
|
||||
et_EE, 'Taust ',\
|
||||
et_EE, 'Töölaud ',\
|
||||
et_EE, 'Ikooni hald.',\
|
||||
et_EE, 'Seadme hald.',\
|
||||
et_EE, 'Silumis aken',\
|
||||
et_EE, 'Protsessid '
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
start_info:
|
||||
.mode dd 7
|
||||
dd 0
|
||||
.params dd 0
|
||||
dd 0
|
||||
dd 0
|
||||
db 0
|
||||
dd start_info.path
|
||||
;------------------------------------------------------------------------------
|
||||
IM_END:
|
||||
align 4
|
||||
; <20>…ˆ<E280A6>ˆ–ˆ€‹ˆ‡ˆ<E280A1>Ž‚€<E2809A><E282AC>›… „€<E2809E><E282AC>›…
|
||||
curx1 dd ? ; ª®®à¤¨ âë ªãàá®à
|
||||
cury1 dd ?
|
||||
curx dd ? ; ª®®à¤¨ âë ®ª ¬¥î
|
||||
cury dd ?
|
||||
|
||||
menu_opened db ? ; ®âªàëâ® ¬¥î ¨«¨ ¥â? (1-¤ , 0-¥â)
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
start_info.path rb 256
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
sc system_colors ; á¨áâ¥¬ë¥ æ¢¥â
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
procinfo process_information ; ¨ä®à¬ æ¨ï ® ¯à®æ¥áá¥
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
rb 512 ; áâíª ¤«ï ®ª ¬¥î - å¢ â¨â ¨ 1 Š¡
|
||||
stack_wnd:
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
rb 512
|
||||
stack_area:
|
||||
;------------------------------------------------------------------------------
|
||||
I_END:
|
||||
;------------------------------------------------------------------------------
|
||||
; ŠŽ<C5A0>…– <20><>Žƒ<C5BD>€ŒŒ›
|
||||
;------------------------------------------------------------------------------
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,209 +1,211 @@
|
||||
;
|
||||
; ¢ í⮬ ä ©«¥ ᮡà ë äãªæ¨¨ ã¦ë¥ ¤«ï ᮧ¤ ¨ï ¨
|
||||
; à ¡®âë ®ª á ¯®¨áª®¬ ¢ ª«î祢ëå á«®¢ å
|
||||
;
|
||||
|
||||
prop_wnd_width equ 350 ;è¨à¨ ®ª á ¯®¨áª®¬
|
||||
SIZE_ONE_FLOAT equ 14
|
||||
|
||||
IMAGE_TOOLBAR_ICON_SIZE equ 20*20*3
|
||||
|
||||
wnd_k_words_run dd 0 ;¯¥à¥¬¥ ï á«¥¤ïé ï § ⥬ çâ®-¡ë ¥ § ¯ã᪠âì ¡®«ìè¥ 1-£® ®ª ®¤®¢à¥¬¥®
|
||||
|
||||
if lang eq ru_RU
|
||||
txt_caption db '<27>®¨áª ¢ ª«î祢ëå á«®¢ å',0
|
||||
else
|
||||
txt_caption db 'Search in keywords',0
|
||||
end if
|
||||
|
||||
;¤ ®¥ ®ª® (¯à®æ¥áá) ¢ë§ë¢ ¥âìáï äãªæ¨¥© but_wnd_coords
|
||||
align 4
|
||||
prop_start:
|
||||
pushad
|
||||
mcall SF_SET_EVENTS_MASK,0xC0000027 ;¬ ᪠®¦¨¤ ¥¬ëå ᮡë⨩
|
||||
|
||||
; áâனª ᯨ᪠®¡ê¥ªâ®¢
|
||||
mov dword[tree3.info_max_count],2
|
||||
mov edi,tedit0
|
||||
mov edx,ted_key_words_count
|
||||
add dword[tree3.info_max_count],edx ;áâ ¢¨¬ ç¨á«® 㧫®¢, à ¢®¥ ª®««¨ç¥áâ¢ã ª«î祢ëå á«®¢ ¢ ä ©«¥ ¯®¤á¢¥âª¨ (+2 ç «® ¨ ª®¥æ ᯨ᪠)
|
||||
stdcall [tl_data_init], tree3
|
||||
mov eax,dword[icon_tl_sys]
|
||||
mov dword[tree3.data_img],eax
|
||||
mov eax,dword[tree1.data_img_sys]
|
||||
mov dword[tree3.data_img_sys],eax
|
||||
|
||||
edit_boxes_set_sys_color edit3,editboxes_end,sc ;ãáâ ®¢ª á¨á⥬ëå 梥⮢
|
||||
popad
|
||||
|
||||
align 4
|
||||
prop_red_win:
|
||||
pushad
|
||||
mcall SF_REDRAW,SSF_BEGIN_DRAW
|
||||
|
||||
mov bx,word[procinfo.box.left]
|
||||
add bx,5 ;word[buf_0.l]
|
||||
shl ebx,16
|
||||
mov bx,prop_wnd_width
|
||||
mov cx,word[procinfo.box.top]
|
||||
add cx,42 ;word[buf_0.t]
|
||||
shl ecx,16
|
||||
mov cx,250
|
||||
mcall SF_CREATE_WINDOW,,,0x33ffffd0,,txt_caption
|
||||
|
||||
mcall SF_DEFINE_BUTTON,(5 shl 16)+19,(5 shl 16)+19,3,[sc.work_button]
|
||||
add ebx,(25 shl 16)
|
||||
mcall ,,,4
|
||||
|
||||
mov ebx,[bmp_icon]
|
||||
add ebx,(ID_BUT_FIND-ID_BUT_0)*IMAGE_TOOLBAR_ICON_SIZE
|
||||
mcall SF_PUT_IMAGE,,(20 shl 16)+20,(5 shl 16)+5 ; ©â¨
|
||||
|
||||
sub ebx,2*IMAGE_TOOLBAR_ICON_SIZE
|
||||
mov edx,(30 shl 16)+5 ;ª®¯¨à®¢ âì
|
||||
int 0x40
|
||||
|
||||
mcall SF_THREAD_INFO,procinfo,-1
|
||||
mov eax,[procinfo.box.height]
|
||||
cmp eax,90
|
||||
jge @f
|
||||
mov eax,90 ;min size
|
||||
@@:
|
||||
sub eax,58
|
||||
cmp [tree3.box_height],eax
|
||||
je @f
|
||||
mov [tree3.box_height],eax
|
||||
mov word[w_scr_t3.y_size],ax
|
||||
;need call tb_scrol_resize
|
||||
@@:
|
||||
|
||||
mov dword[w_scr_t3.all_redraw],1
|
||||
stdcall [scrollbar_ver_draw], w_scr_t3
|
||||
stdcall [tl_draw], tree3
|
||||
stdcall [edit_box_draw], edit3
|
||||
mcall SF_REDRAW,SSF_END_DRAW
|
||||
popad
|
||||
|
||||
;¥ ®âàë¢ âì íâã äãªæ¨î ®â ¯à¥¤ë¤ã饩
|
||||
align 4
|
||||
prop_still:
|
||||
mcall SF_WAIT_EVENT
|
||||
|
||||
cmp al,1 ;¨§¬. ¯®«®¦¥¨¥ ®ª
|
||||
jz prop_red_win
|
||||
cmp al,2
|
||||
jne @f
|
||||
call prop_key
|
||||
@@:
|
||||
cmp al,3
|
||||
jne @f
|
||||
call prop_button
|
||||
@@:
|
||||
cmp al,6
|
||||
jne @f
|
||||
call prop_mouse
|
||||
@@:
|
||||
jmp prop_still
|
||||
.exit:
|
||||
mov dword[tree3.data_img],0 ;ç¨á⨬ 㪠§ ⥫¨ ¨ª®ª¨ çâ®-¡ë ¨å ¥ 㤠«¨« ¤¥áâàãªâ®à
|
||||
mov dword[tree3.data_img_sys],0 ;â. ª. ®¨ ¥é¥ ¨á¯®«ì§ãîâìáï ¢ ¤à㣨å í«¥¬¥â å
|
||||
stdcall [tl_data_clear], tree3
|
||||
mov dword[wnd_k_words_run],0 ;®¡ã«ï¥¬ ID ®ª
|
||||
mcall SF_TERMINATE_PROCESS
|
||||
|
||||
align 4
|
||||
prop_key:
|
||||
push eax
|
||||
mcall SF_GET_KEY
|
||||
stdcall [edit_box_key], edit3
|
||||
stdcall [tl_key], tree3
|
||||
pop eax
|
||||
ret
|
||||
|
||||
align 4
|
||||
prop_mouse:
|
||||
;push ecx edi
|
||||
stdcall [tl_mouse], tree3
|
||||
stdcall [edit_box_mouse], edit3
|
||||
;pop edi ecx
|
||||
ret
|
||||
|
||||
align 4
|
||||
prop_button:
|
||||
pushad
|
||||
mcall SF_GET_BUTTON
|
||||
|
||||
cmp ah,1
|
||||
je prop_still.exit
|
||||
|
||||
cmp ah,3
|
||||
jne @f
|
||||
; ©â¨ á«®¢
|
||||
mov edi,tedit0
|
||||
cmp ted_syntax_file,0
|
||||
je @f
|
||||
stdcall [tl_info_clear], tree3
|
||||
and dword[tree3.style], not tl_cursor_pos_limited
|
||||
|
||||
mov ebx,ted_key_words_data
|
||||
mov ecx,ted_key_words_count
|
||||
cld
|
||||
.cycle_0:
|
||||
stdcall str_instr, ebx,[edit3.text]
|
||||
test al,al
|
||||
jnz .end_add
|
||||
;ª«î祢®¥ á«®¢®
|
||||
stdcall [tl_node_add], tree3, (1 shl 16), ebx
|
||||
stdcall [tl_cur_next], tree3
|
||||
mov edx,[ebx+MAX_COLOR_WORD_LEN]
|
||||
or edx,edx
|
||||
jz .end_add
|
||||
;á¯à ¢ª ¯® ª«î祢®¬ã á«®¢ã
|
||||
add edx,ted_help_text_f1
|
||||
stdcall [tl_node_add], tree3, 1, edx
|
||||
stdcall [tl_cur_next], tree3
|
||||
.end_add:
|
||||
add ebx,MAX_COLOR_WORD_LEN+8 ;sizeof.TexColViv
|
||||
loop .cycle_0
|
||||
|
||||
stdcall [tl_cur_beg], tree3
|
||||
or dword[tree3.style], tl_cursor_pos_limited ;®£à ¨ç¨¢ ¥¬ ¤¢¨¦¥¨¥ ªãàá®à ¢ ¯à¥¤¥« å ᯨáª
|
||||
stdcall [tl_draw], tree3
|
||||
jmp .no_select_0
|
||||
@@:
|
||||
cmp ah,4
|
||||
jne @f
|
||||
;ª®¯¨à®¢ âì ¢ ¡ãä¥à
|
||||
stdcall [tl_node_get_data],tree3
|
||||
or eax,eax
|
||||
jz .no_select_0
|
||||
mov esi,eax
|
||||
mov edi,[tedit0.buffer]
|
||||
mov dword[edi],MAX_COLOR_WORD_LEN
|
||||
mov dword[edi+4],0 ;text data
|
||||
mov dword[edi+8],1 ;code 866
|
||||
add edi,12 ;system buffer header size
|
||||
mov byte[edi+MAX_COLOR_WORD_LEN],0
|
||||
mov ecx,MAX_COLOR_WORD_LEN
|
||||
cld
|
||||
rep movsb
|
||||
mcall SF_CLIPBOARD,SSF_WRITE_CB,12+MAX_COLOR_WORD_LEN,[tedit0.buffer]
|
||||
.no_select_0:
|
||||
@@:
|
||||
|
||||
popad
|
||||
ret
|
||||
|
||||
;¤¥à¥¢® á ®¡ê¥ªâ ¬¨ ¢ ¯®«ì§®¢ ⥫ì᪮¬ ä ©«¥
|
||||
align 4
|
||||
tree3 tree_list MAX_COLOR_WORD_LEN,3,tl_key_no_edit,\
|
||||
16,16, 0x8080ff,0x0000ff,0xffffff, 5,30,300,160, 16, 0,0, el_focus, w_scr_t3,0
|
||||
|
||||
align 4
|
||||
edit3 edit_box 80, 70, 8, 0xffffff, 0xff, 0x80ff, 0, 0x8000, MAX_COLOR_WORD_LEN+2, string1, mouse_dd, ed_focus
|
||||
editboxes_end:
|
||||
|
||||
string1 rb MAX_COLOR_WORD_LEN
|
||||
|
||||
align 4
|
||||
w_scr_t3 scrollbar 16,0, 3,0, 15, 100, 0,0, 0xeeeeee, 0xbbddff, 0, 1
|
||||
;
|
||||
; ¢ í⮬ ä ©«¥ ᮡà ë äãªæ¨¨ ã¦ë¥ ¤«ï ᮧ¤ ¨ï ¨
|
||||
; à ¡®âë ®ª á ¯®¨áª®¬ ¢ ª«î祢ëå á«®¢ å
|
||||
;
|
||||
|
||||
; Language support for locales: ru_RU (CP866), en_US.
|
||||
|
||||
prop_wnd_width equ 350 ;è¨à¨ ®ª á ¯®¨áª®¬
|
||||
SIZE_ONE_FLOAT equ 14
|
||||
|
||||
IMAGE_TOOLBAR_ICON_SIZE equ 20*20*3
|
||||
|
||||
wnd_k_words_run dd 0 ;¯¥à¥¬¥ ï á«¥¤ïé ï § ⥬ çâ®-¡ë ¥ § ¯ã᪠âì ¡®«ìè¥ 1-£® ®ª ®¤®¢à¥¬¥®
|
||||
|
||||
if lang eq ru_RU
|
||||
txt_caption db '<27>®¨áª ¢ ª«î祢ëå á«®¢ å',0
|
||||
else ; Default to en_US
|
||||
txt_caption db 'Search in keywords',0
|
||||
end if
|
||||
|
||||
;¤ ®¥ ®ª® (¯à®æ¥áá) ¢ë§ë¢ ¥âìáï äãªæ¨¥© but_wnd_coords
|
||||
align 4
|
||||
prop_start:
|
||||
pushad
|
||||
mcall SF_SET_EVENTS_MASK,0xC0000027 ;¬ ᪠®¦¨¤ ¥¬ëå ᮡë⨩
|
||||
|
||||
; áâனª ᯨ᪠®¡ê¥ªâ®¢
|
||||
mov dword[tree3.info_max_count],2
|
||||
mov edi,tedit0
|
||||
mov edx,ted_key_words_count
|
||||
add dword[tree3.info_max_count],edx ;áâ ¢¨¬ ç¨á«® 㧫®¢, à ¢®¥ ª®««¨ç¥áâ¢ã ª«î祢ëå á«®¢ ¢ ä ©«¥ ¯®¤á¢¥âª¨ (+2 ç «® ¨ ª®¥æ ᯨ᪠)
|
||||
stdcall [tl_data_init], tree3
|
||||
mov eax,dword[icon_tl_sys]
|
||||
mov dword[tree3.data_img],eax
|
||||
mov eax,dword[tree1.data_img_sys]
|
||||
mov dword[tree3.data_img_sys],eax
|
||||
|
||||
edit_boxes_set_sys_color edit3,editboxes_end,sc ;ãáâ ®¢ª á¨á⥬ëå 梥⮢
|
||||
popad
|
||||
|
||||
align 4
|
||||
prop_red_win:
|
||||
pushad
|
||||
mcall SF_REDRAW,SSF_BEGIN_DRAW
|
||||
|
||||
mov bx,word[procinfo.box.left]
|
||||
add bx,5 ;word[buf_0.l]
|
||||
shl ebx,16
|
||||
mov bx,prop_wnd_width
|
||||
mov cx,word[procinfo.box.top]
|
||||
add cx,42 ;word[buf_0.t]
|
||||
shl ecx,16
|
||||
mov cx,250
|
||||
mcall SF_CREATE_WINDOW,,,0x33ffffd0,,txt_caption
|
||||
|
||||
mcall SF_DEFINE_BUTTON,(5 shl 16)+19,(5 shl 16)+19,3,[sc.work_button]
|
||||
add ebx,(25 shl 16)
|
||||
mcall ,,,4
|
||||
|
||||
mov ebx,[bmp_icon]
|
||||
add ebx,(ID_BUT_FIND-ID_BUT_0)*IMAGE_TOOLBAR_ICON_SIZE
|
||||
mcall SF_PUT_IMAGE,,(20 shl 16)+20,(5 shl 16)+5 ; ©â¨
|
||||
|
||||
sub ebx,2*IMAGE_TOOLBAR_ICON_SIZE
|
||||
mov edx,(30 shl 16)+5 ;ª®¯¨à®¢ âì
|
||||
int 0x40
|
||||
|
||||
mcall SF_THREAD_INFO,procinfo,-1
|
||||
mov eax,[procinfo.box.height]
|
||||
cmp eax,90
|
||||
jge @f
|
||||
mov eax,90 ;min size
|
||||
@@:
|
||||
sub eax,58
|
||||
cmp [tree3.box_height],eax
|
||||
je @f
|
||||
mov [tree3.box_height],eax
|
||||
mov word[w_scr_t3.y_size],ax
|
||||
;need call tb_scrol_resize
|
||||
@@:
|
||||
|
||||
mov dword[w_scr_t3.all_redraw],1
|
||||
stdcall [scrollbar_ver_draw], w_scr_t3
|
||||
stdcall [tl_draw], tree3
|
||||
stdcall [edit_box_draw], edit3
|
||||
mcall SF_REDRAW,SSF_END_DRAW
|
||||
popad
|
||||
|
||||
;¥ ®âàë¢ âì íâã äãªæ¨î ®â ¯à¥¤ë¤ã饩
|
||||
align 4
|
||||
prop_still:
|
||||
mcall SF_WAIT_EVENT
|
||||
|
||||
cmp al,1 ;¨§¬. ¯®«®¦¥¨¥ ®ª
|
||||
jz prop_red_win
|
||||
cmp al,2
|
||||
jne @f
|
||||
call prop_key
|
||||
@@:
|
||||
cmp al,3
|
||||
jne @f
|
||||
call prop_button
|
||||
@@:
|
||||
cmp al,6
|
||||
jne @f
|
||||
call prop_mouse
|
||||
@@:
|
||||
jmp prop_still
|
||||
.exit:
|
||||
mov dword[tree3.data_img],0 ;ç¨á⨬ 㪠§ ⥫¨ ¨ª®ª¨ çâ®-¡ë ¨å ¥ 㤠«¨« ¤¥áâàãªâ®à
|
||||
mov dword[tree3.data_img_sys],0 ;â. ª. ®¨ ¥é¥ ¨á¯®«ì§ãîâìáï ¢ ¤à㣨å í«¥¬¥â å
|
||||
stdcall [tl_data_clear], tree3
|
||||
mov dword[wnd_k_words_run],0 ;®¡ã«ï¥¬ ID ®ª
|
||||
mcall SF_TERMINATE_PROCESS
|
||||
|
||||
align 4
|
||||
prop_key:
|
||||
push eax
|
||||
mcall SF_GET_KEY
|
||||
stdcall [edit_box_key], edit3
|
||||
stdcall [tl_key], tree3
|
||||
pop eax
|
||||
ret
|
||||
|
||||
align 4
|
||||
prop_mouse:
|
||||
;push ecx edi
|
||||
stdcall [tl_mouse], tree3
|
||||
stdcall [edit_box_mouse], edit3
|
||||
;pop edi ecx
|
||||
ret
|
||||
|
||||
align 4
|
||||
prop_button:
|
||||
pushad
|
||||
mcall SF_GET_BUTTON
|
||||
|
||||
cmp ah,1
|
||||
je prop_still.exit
|
||||
|
||||
cmp ah,3
|
||||
jne @f
|
||||
; ©â¨ á«®¢
|
||||
mov edi,tedit0
|
||||
cmp ted_syntax_file,0
|
||||
je @f
|
||||
stdcall [tl_info_clear], tree3
|
||||
and dword[tree3.style], not tl_cursor_pos_limited
|
||||
|
||||
mov ebx,ted_key_words_data
|
||||
mov ecx,ted_key_words_count
|
||||
cld
|
||||
.cycle_0:
|
||||
stdcall str_instr, ebx,[edit3.text]
|
||||
test al,al
|
||||
jnz .end_add
|
||||
;ª«î祢®¥ á«®¢®
|
||||
stdcall [tl_node_add], tree3, (1 shl 16), ebx
|
||||
stdcall [tl_cur_next], tree3
|
||||
mov edx,[ebx+MAX_COLOR_WORD_LEN]
|
||||
or edx,edx
|
||||
jz .end_add
|
||||
;á¯à ¢ª ¯® ª«î祢®¬ã á«®¢ã
|
||||
add edx,ted_help_text_f1
|
||||
stdcall [tl_node_add], tree3, 1, edx
|
||||
stdcall [tl_cur_next], tree3
|
||||
.end_add:
|
||||
add ebx,MAX_COLOR_WORD_LEN+8 ;sizeof.TexColViv
|
||||
loop .cycle_0
|
||||
|
||||
stdcall [tl_cur_beg], tree3
|
||||
or dword[tree3.style], tl_cursor_pos_limited ;®£à ¨ç¨¢ ¥¬ ¤¢¨¦¥¨¥ ªãàá®à ¢ ¯à¥¤¥« å ᯨáª
|
||||
stdcall [tl_draw], tree3
|
||||
jmp .no_select_0
|
||||
@@:
|
||||
cmp ah,4
|
||||
jne @f
|
||||
;ª®¯¨à®¢ âì ¢ ¡ãä¥à
|
||||
stdcall [tl_node_get_data],tree3
|
||||
or eax,eax
|
||||
jz .no_select_0
|
||||
mov esi,eax
|
||||
mov edi,[tedit0.buffer]
|
||||
mov dword[edi],MAX_COLOR_WORD_LEN
|
||||
mov dword[edi+4],0 ;text data
|
||||
mov dword[edi+8],1 ;code 866
|
||||
add edi,12 ;system buffer header size
|
||||
mov byte[edi+MAX_COLOR_WORD_LEN],0
|
||||
mov ecx,MAX_COLOR_WORD_LEN
|
||||
cld
|
||||
rep movsb
|
||||
mcall SF_CLIPBOARD,SSF_WRITE_CB,12+MAX_COLOR_WORD_LEN,[tedit0.buffer]
|
||||
.no_select_0:
|
||||
@@:
|
||||
|
||||
popad
|
||||
ret
|
||||
|
||||
;¤¥à¥¢® á ®¡ê¥ªâ ¬¨ ¢ ¯®«ì§®¢ ⥫ì᪮¬ ä ©«¥
|
||||
align 4
|
||||
tree3 tree_list MAX_COLOR_WORD_LEN,3,tl_key_no_edit,\
|
||||
16,16, 0x8080ff,0x0000ff,0xffffff, 5,30,300,160, 16, 0,0, el_focus, w_scr_t3,0
|
||||
|
||||
align 4
|
||||
edit3 edit_box 80, 70, 8, 0xffffff, 0xff, 0x80ff, 0, 0x8000, MAX_COLOR_WORD_LEN+2, string1, mouse_dd, ed_focus
|
||||
editboxes_end:
|
||||
|
||||
string1 rb MAX_COLOR_WORD_LEN
|
||||
|
||||
align 4
|
||||
w_scr_t3 scrollbar 16,0, 3,0, 15, 100, 0,0, 0xeeeeee, 0xbbddff, 0, 1
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,321 +1,323 @@
|
||||
; program data
|
||||
|
||||
curMonth dd ?
|
||||
curYear dd ?
|
||||
curDay dd ?
|
||||
|
||||
remainder dd ?
|
||||
quotient dd ?
|
||||
|
||||
firstday dd ?
|
||||
Year dd ?
|
||||
Month dd ?
|
||||
day_sel dd ?
|
||||
|
||||
datestr dd ?
|
||||
leap_year dd ?
|
||||
number dd ?
|
||||
|
||||
; colors
|
||||
COL_WINDOW_BG equ 0x54E7E7E7
|
||||
COL_TOOLBAR_BG equ 0x555555
|
||||
COL_ACTIVE_TEXT equ 0x10e7c750
|
||||
COL_WEEKDAY_BG equ 0xCCCDDD
|
||||
COL_DATE_BUTTONS equ 0xF3F3F3
|
||||
COL_TIME_BUTTONS equ 0x5555dd
|
||||
COL_GO_TODAY_T equ 0xd048c8
|
||||
COL_MONTH_YEAR_B equ 0x555555
|
||||
COL_DROPDOWN_BG equ 0x666666
|
||||
COL_DROPDOWN_T equ 0x10CCCccc
|
||||
COL_NEW_STYLE_T equ 0xef3333
|
||||
|
||||
COL_DATE_INACTIVE_1 equ 0x388CAF
|
||||
COL_DATE_INACTIVE_2 equ 0x75B9D5
|
||||
COL_DATE_INACTIVE_3 equ 0x9ECBDF
|
||||
COL_DATE_INACTIVE_4 equ 0xABD7E8
|
||||
|
||||
COL_DATE_ACTIVE_1 equ 0xA57F2C
|
||||
COL_DATE_ACTIVE_2 equ 0xEFB52D
|
||||
COL_DATE_ACTIVE_3 equ 0xFAD84C
|
||||
COL_DATE_ACTIVE_4 equ 0xFAE995
|
||||
|
||||
COL_DATE_1 equ 0x8C8C8C
|
||||
COL_DATE_2 equ 0xFFFfff
|
||||
COL_DATE_3 equ 0xF2F2F2
|
||||
COL_DATE_4 equ 0xF2F2F2
|
||||
|
||||
; definitions
|
||||
WIN_W equ 275
|
||||
WIN_H equ 326
|
||||
|
||||
DATE_BUTTON_WIDTH equ 32
|
||||
DATE_BUTTON_HEIGHT equ 30
|
||||
|
||||
|
||||
LINE1 equ 27 shl 16+16
|
||||
B_MONTH_X equ 15 shl 16+158
|
||||
B_Y equ LINE1
|
||||
B_MONTH equ 63 shl 16+27
|
||||
|
||||
BT_WBAR_Y equ 283 shl 16+43
|
||||
|
||||
B_WBAR_X equ 1 shl 16+WIN_W-1
|
||||
B_WBAR_Y equ 64 shl 16+20
|
||||
B_WEEK equ 34 shl 16+66
|
||||
B_WX_SHIFT equ 32 shl 16
|
||||
|
||||
B_DROP equ B_MONTH+16
|
||||
B_DAYS_Y equ 106
|
||||
B_DAYS_SHIFT equ 30
|
||||
|
||||
B_YEAR equ 204 shl 16+28
|
||||
|
||||
B_SPIN_X equ 186 shl 16+12
|
||||
B_SPIN equ 188 shl 16+28
|
||||
spinner db '< >'
|
||||
|
||||
B_TODAY_X equ 25 shl 16
|
||||
B_TODAY_Y equ 48 shl 16+10
|
||||
B_TODAY equ 30 shl 16+50
|
||||
|
||||
B_NS_X equ 185 shl 16+75
|
||||
B_NS_Y equ 48 shl 16+10
|
||||
B_NS equ 190 shl 16+50
|
||||
|
||||
FOCUSABLE equ 4
|
||||
|
||||
; multilanguage interface - configuratable in lang.inc
|
||||
day_count db 3,0,3,2,3,2,3,3,2,3,2,3
|
||||
Fkeys db 210,211,212,213,214,215,216,217,208,209,228,159
|
||||
|
||||
month_name:
|
||||
if lang eq ru_RU
|
||||
db 8
|
||||
db 'Ÿ¢ àì '
|
||||
db '”¥¢à «ì '
|
||||
db 'Œ àâ '
|
||||
db '€¯à¥«ì '
|
||||
db 'Œ © '
|
||||
db 'ˆîì '
|
||||
db 'ˆî«ì '
|
||||
db '€¢£ãáâ '
|
||||
db '‘¥âï¡àì'
|
||||
db 'Žªâï¡àì '
|
||||
db '<27>®ï¡àì '
|
||||
db '„¥ª ¡àì '
|
||||
else if lang eq de_DE
|
||||
db 9
|
||||
db 'Januar '
|
||||
db 'Februar '
|
||||
db 'M+rz '
|
||||
db 'April '
|
||||
db 'Mai '
|
||||
db 'Juni '
|
||||
db 'Juli '
|
||||
db 'August '
|
||||
db 'September'
|
||||
db 'Oktober '
|
||||
db 'November '
|
||||
db 'Dezember '
|
||||
else if lang eq fr_FR
|
||||
db 9
|
||||
db 'Janvier '
|
||||
db 'Fevrier '
|
||||
db 'Mars '
|
||||
db 'Avril '
|
||||
db 'Mai '
|
||||
db 'Juin '
|
||||
db 'Juliet '
|
||||
db 'Aout '
|
||||
db 'Septembre'
|
||||
db 'Octobre '
|
||||
db 'Novembre '
|
||||
db 'Decembre '
|
||||
else if lang eq fi_FI
|
||||
db 9
|
||||
db 'Tammikuu '
|
||||
db 'Helmikuu '
|
||||
db 'Maaliskuu'
|
||||
db 'Huhtikuu '
|
||||
db 'Toukokuu '
|
||||
db 'Kes+kuu '
|
||||
db 'Hein+kuu '
|
||||
db 'Elokuu '
|
||||
db 'Syyskuu '
|
||||
db 'Lokakuu '
|
||||
db 'Marraskuu'
|
||||
db 'Joulukuu '
|
||||
else if lang eq et_EE
|
||||
db 9
|
||||
db 'Jaanuar '
|
||||
db 'Veebruar '
|
||||
db 'Märts '
|
||||
db 'Aprill '
|
||||
db 'Mai '
|
||||
db 'Juuni '
|
||||
db 'Juuli '
|
||||
db 'August '
|
||||
db 'September'
|
||||
db 'Oktoober '
|
||||
db 'November '
|
||||
db 'Detsember'
|
||||
else if lang eq it_IT
|
||||
db 9
|
||||
db 'Gennaio '
|
||||
db 'Febbraio '
|
||||
db 'Marzo '
|
||||
db 'Aprile '
|
||||
db 'Maggio '
|
||||
db 'Giugno '
|
||||
db 'Luglio '
|
||||
db 'Agosto '
|
||||
db 'Settembre'
|
||||
db 'Ottobre '
|
||||
db 'Novembre '
|
||||
db 'Dicembre '
|
||||
else
|
||||
db 9
|
||||
db 'January '
|
||||
db 'February '
|
||||
db 'March '
|
||||
db 'April '
|
||||
db 'May '
|
||||
db 'June '
|
||||
db 'July '
|
||||
db 'August '
|
||||
db 'September'
|
||||
db 'October '
|
||||
db 'November '
|
||||
db 'December '
|
||||
end if
|
||||
week_days:
|
||||
if lang eq ru_RU
|
||||
db 2
|
||||
db 1
|
||||
db '<27>'
|
||||
db '‚â'
|
||||
db '‘à'
|
||||
db '—â'
|
||||
db '<27>â'
|
||||
db '‘¡'
|
||||
db '‚á'
|
||||
else if lang eq de_DE
|
||||
db 2
|
||||
db 7
|
||||
db 'So'
|
||||
db 'Mo'
|
||||
db 'Di'
|
||||
db 'Mi'
|
||||
db 'Do'
|
||||
db 'Fr'
|
||||
db 'Sa'
|
||||
else if lang eq fr_FR
|
||||
db 3
|
||||
db 7
|
||||
db 'Dim'
|
||||
db 'Lun'
|
||||
db 'Mar'
|
||||
db 'Mer'
|
||||
db 'Jeu'
|
||||
db 'Ven'
|
||||
db 'Sam'
|
||||
else if lang eq fi_FI
|
||||
db 2
|
||||
db 7
|
||||
db 'Su'
|
||||
db 'Ma'
|
||||
db 'Ti'
|
||||
db 'Ke'
|
||||
db 'To'
|
||||
db 'Pe'
|
||||
db 'La'
|
||||
else if lang eq et_EE
|
||||
db 3
|
||||
db 7
|
||||
db 'Esm'
|
||||
db 'Tei'
|
||||
db 'Kol'
|
||||
db 'Nel'
|
||||
db 'Ree'
|
||||
db 'Lau'
|
||||
db 'Püh'
|
||||
else if lang eq it_IT
|
||||
db 3
|
||||
db 7
|
||||
db 'Dom'
|
||||
db 'Lun'
|
||||
db 'Mar'
|
||||
db 'Mer'
|
||||
db 'Gio'
|
||||
db 'Ven'
|
||||
db 'Sab'
|
||||
else
|
||||
db 3
|
||||
db 7
|
||||
db 'Sun'
|
||||
db 'Mon'
|
||||
db 'Tue'
|
||||
db 'Wed'
|
||||
db 'Thu'
|
||||
db 'Fri'
|
||||
db 'Sat'
|
||||
end if
|
||||
|
||||
title:
|
||||
if lang eq ru_RU
|
||||
db 'Š «¥¤ àì',0
|
||||
else if lang eq de_DE
|
||||
db 'Kalender',0
|
||||
else if lang eq fr_FR
|
||||
db 'Calendrier',0
|
||||
else if lang eq et_EE
|
||||
db 'Kalender',0
|
||||
else if lang eq it_IT
|
||||
db 'Calendario',0
|
||||
else
|
||||
db 'Calendar',0
|
||||
end if
|
||||
|
||||
today_msg:
|
||||
if lang eq ru_RU
|
||||
db '‘¥£®¤ï'
|
||||
else if lang eq de_DE
|
||||
db 'Heute'
|
||||
else if lang eq fr_FR
|
||||
db "Aujourd'hui"
|
||||
else if lang eq et_EE
|
||||
db 'Täna'
|
||||
else if lang eq it_IT
|
||||
db 'Oggi'
|
||||
else
|
||||
db 'Today'
|
||||
end if
|
||||
today_end:
|
||||
focus dd 3
|
||||
new_style dd 1
|
||||
dropped db 0
|
||||
|
||||
sys_text:
|
||||
if lang eq ru_RU
|
||||
db '∴•',0
|
||||
else if lang eq it_IT
|
||||
db ' Ora',0
|
||||
else if lang eq et_EE
|
||||
db ' Aeg ',0
|
||||
else
|
||||
db ' Time',0
|
||||
end if
|
||||
separator db ':',0
|
||||
plus db '+',0
|
||||
minus db '-',0
|
||||
set_date_t:
|
||||
if lang eq ru_RU
|
||||
db '“áâ ®¢¨âì ¤ âã',0
|
||||
else if lang eq it_IT
|
||||
db ' Impostazioni ',0
|
||||
else if lang eq et_EE
|
||||
db ' Määra kuupäev ',0
|
||||
else
|
||||
db ' Set date ',0
|
||||
end if
|
||||
|
||||
; program data
|
||||
|
||||
curMonth dd ?
|
||||
curYear dd ?
|
||||
curDay dd ?
|
||||
|
||||
remainder dd ?
|
||||
quotient dd ?
|
||||
|
||||
firstday dd ?
|
||||
Year dd ?
|
||||
Month dd ?
|
||||
day_sel dd ?
|
||||
|
||||
datestr dd ?
|
||||
leap_year dd ?
|
||||
number dd ?
|
||||
|
||||
; colors
|
||||
COL_WINDOW_BG equ 0x54E7E7E7
|
||||
COL_TOOLBAR_BG equ 0x555555
|
||||
COL_ACTIVE_TEXT equ 0x10e7c750
|
||||
COL_WEEKDAY_BG equ 0xCCCDDD
|
||||
COL_DATE_BUTTONS equ 0xF3F3F3
|
||||
COL_TIME_BUTTONS equ 0x5555dd
|
||||
COL_GO_TODAY_T equ 0xd048c8
|
||||
COL_MONTH_YEAR_B equ 0x555555
|
||||
COL_DROPDOWN_BG equ 0x666666
|
||||
COL_DROPDOWN_T equ 0x10CCCccc
|
||||
COL_NEW_STYLE_T equ 0xef3333
|
||||
|
||||
COL_DATE_INACTIVE_1 equ 0x388CAF
|
||||
COL_DATE_INACTIVE_2 equ 0x75B9D5
|
||||
COL_DATE_INACTIVE_3 equ 0x9ECBDF
|
||||
COL_DATE_INACTIVE_4 equ 0xABD7E8
|
||||
|
||||
COL_DATE_ACTIVE_1 equ 0xA57F2C
|
||||
COL_DATE_ACTIVE_2 equ 0xEFB52D
|
||||
COL_DATE_ACTIVE_3 equ 0xFAD84C
|
||||
COL_DATE_ACTIVE_4 equ 0xFAE995
|
||||
|
||||
COL_DATE_1 equ 0x8C8C8C
|
||||
COL_DATE_2 equ 0xFFFfff
|
||||
COL_DATE_3 equ 0xF2F2F2
|
||||
COL_DATE_4 equ 0xF2F2F2
|
||||
|
||||
; definitions
|
||||
WIN_W equ 275
|
||||
WIN_H equ 326
|
||||
|
||||
DATE_BUTTON_WIDTH equ 32
|
||||
DATE_BUTTON_HEIGHT equ 30
|
||||
|
||||
|
||||
LINE1 equ 27 shl 16+16
|
||||
B_MONTH_X equ 15 shl 16+158
|
||||
B_Y equ LINE1
|
||||
B_MONTH equ 63 shl 16+27
|
||||
|
||||
BT_WBAR_Y equ 283 shl 16+43
|
||||
|
||||
B_WBAR_X equ 1 shl 16+WIN_W-1
|
||||
B_WBAR_Y equ 64 shl 16+20
|
||||
B_WEEK equ 34 shl 16+66
|
||||
B_WX_SHIFT equ 32 shl 16
|
||||
|
||||
B_DROP equ B_MONTH+16
|
||||
B_DAYS_Y equ 106
|
||||
B_DAYS_SHIFT equ 30
|
||||
|
||||
B_YEAR equ 204 shl 16+28
|
||||
|
||||
B_SPIN_X equ 186 shl 16+12
|
||||
B_SPIN equ 188 shl 16+28
|
||||
spinner db '< >'
|
||||
|
||||
B_TODAY_X equ 25 shl 16
|
||||
B_TODAY_Y equ 48 shl 16+10
|
||||
B_TODAY equ 30 shl 16+50
|
||||
|
||||
B_NS_X equ 185 shl 16+75
|
||||
B_NS_Y equ 48 shl 16+10
|
||||
B_NS equ 190 shl 16+50
|
||||
|
||||
FOCUSABLE equ 4
|
||||
|
||||
day_count db 3,0,3,2,3,2,3,3,2,3,2,3
|
||||
Fkeys db 210,211,212,213,214,215,216,217,208,209,228,159
|
||||
|
||||
; Multilanguage interface - configurable in lang.inc
|
||||
; Language support for locales: ru_RU (CP866), de_DE, fr_FR, fi_FI, et_EE, it_IT, en_US
|
||||
|
||||
month_name:
|
||||
if lang eq ru_RU
|
||||
db 8
|
||||
db 'Ÿ¢ àì '
|
||||
db '”¥¢à «ì '
|
||||
db 'Œ àâ '
|
||||
db '€¯à¥«ì '
|
||||
db 'Œ © '
|
||||
db 'ˆîì '
|
||||
db 'ˆî«ì '
|
||||
db '€¢£ãáâ '
|
||||
db '‘¥âï¡àì'
|
||||
db 'Žªâï¡àì '
|
||||
db '<27>®ï¡àì '
|
||||
db '„¥ª ¡àì '
|
||||
else if lang eq de_DE
|
||||
db 9
|
||||
db 'Januar '
|
||||
db 'Februar '
|
||||
db 'M+rz '
|
||||
db 'April '
|
||||
db 'Mai '
|
||||
db 'Juni '
|
||||
db 'Juli '
|
||||
db 'August '
|
||||
db 'September'
|
||||
db 'Oktober '
|
||||
db 'November '
|
||||
db 'Dezember '
|
||||
else if lang eq fr_FR
|
||||
db 9
|
||||
db 'Janvier '
|
||||
db 'Fevrier '
|
||||
db 'Mars '
|
||||
db 'Avril '
|
||||
db 'Mai '
|
||||
db 'Juin '
|
||||
db 'Juliet '
|
||||
db 'Aout '
|
||||
db 'Septembre'
|
||||
db 'Octobre '
|
||||
db 'Novembre '
|
||||
db 'Decembre '
|
||||
else if lang eq fi_FI
|
||||
db 9
|
||||
db 'Tammikuu '
|
||||
db 'Helmikuu '
|
||||
db 'Maaliskuu'
|
||||
db 'Huhtikuu '
|
||||
db 'Toukokuu '
|
||||
db 'Kes+kuu '
|
||||
db 'Hein+kuu '
|
||||
db 'Elokuu '
|
||||
db 'Syyskuu '
|
||||
db 'Lokakuu '
|
||||
db 'Marraskuu'
|
||||
db 'Joulukuu '
|
||||
else if lang eq et_EE
|
||||
db 9
|
||||
db 'Jaanuar '
|
||||
db 'Veebruar '
|
||||
db 'Märts '
|
||||
db 'Aprill '
|
||||
db 'Mai '
|
||||
db 'Juuni '
|
||||
db 'Juuli '
|
||||
db 'August '
|
||||
db 'September'
|
||||
db 'Oktoober '
|
||||
db 'November '
|
||||
db 'Detsember'
|
||||
else if lang eq it_IT
|
||||
db 9
|
||||
db 'Gennaio '
|
||||
db 'Febbraio '
|
||||
db 'Marzo '
|
||||
db 'Aprile '
|
||||
db 'Maggio '
|
||||
db 'Giugno '
|
||||
db 'Luglio '
|
||||
db 'Agosto '
|
||||
db 'Settembre'
|
||||
db 'Ottobre '
|
||||
db 'Novembre '
|
||||
db 'Dicembre '
|
||||
else ; Default to en_US
|
||||
db 9
|
||||
db 'January '
|
||||
db 'February '
|
||||
db 'March '
|
||||
db 'April '
|
||||
db 'May '
|
||||
db 'June '
|
||||
db 'July '
|
||||
db 'August '
|
||||
db 'September'
|
||||
db 'October '
|
||||
db 'November '
|
||||
db 'December '
|
||||
end if
|
||||
week_days:
|
||||
if lang eq ru_RU
|
||||
db 2
|
||||
db 1
|
||||
db '<27>'
|
||||
db '‚â'
|
||||
db '‘à'
|
||||
db '—â'
|
||||
db '<27>â'
|
||||
db '‘¡'
|
||||
db '‚á'
|
||||
else if lang eq de_DE
|
||||
db 2
|
||||
db 7
|
||||
db 'So'
|
||||
db 'Mo'
|
||||
db 'Di'
|
||||
db 'Mi'
|
||||
db 'Do'
|
||||
db 'Fr'
|
||||
db 'Sa'
|
||||
else if lang eq fr_FR
|
||||
db 3
|
||||
db 7
|
||||
db 'Dim'
|
||||
db 'Lun'
|
||||
db 'Mar'
|
||||
db 'Mer'
|
||||
db 'Jeu'
|
||||
db 'Ven'
|
||||
db 'Sam'
|
||||
else if lang eq fi_FI
|
||||
db 2
|
||||
db 7
|
||||
db 'Su'
|
||||
db 'Ma'
|
||||
db 'Ti'
|
||||
db 'Ke'
|
||||
db 'To'
|
||||
db 'Pe'
|
||||
db 'La'
|
||||
else if lang eq et_EE
|
||||
db 3
|
||||
db 7
|
||||
db 'Esm'
|
||||
db 'Tei'
|
||||
db 'Kol'
|
||||
db 'Nel'
|
||||
db 'Ree'
|
||||
db 'Lau'
|
||||
db 'Püh'
|
||||
else if lang eq it_IT
|
||||
db 3
|
||||
db 7
|
||||
db 'Dom'
|
||||
db 'Lun'
|
||||
db 'Mar'
|
||||
db 'Mer'
|
||||
db 'Gio'
|
||||
db 'Ven'
|
||||
db 'Sab'
|
||||
else ; Default to en_US
|
||||
db 3
|
||||
db 7
|
||||
db 'Sun'
|
||||
db 'Mon'
|
||||
db 'Tue'
|
||||
db 'Wed'
|
||||
db 'Thu'
|
||||
db 'Fri'
|
||||
db 'Sat'
|
||||
end if
|
||||
|
||||
title:
|
||||
if lang eq ru_RU
|
||||
db 'Š «¥¤ àì',0
|
||||
else if lang eq de_DE
|
||||
db 'Kalender',0
|
||||
else if lang eq fr_FR
|
||||
db 'Calendrier',0
|
||||
else if lang eq et_EE
|
||||
db 'Kalender',0
|
||||
else if lang eq it_IT
|
||||
db 'Calendario',0
|
||||
else ; Default to en_US
|
||||
db 'Calendar',0
|
||||
end if
|
||||
|
||||
today_msg:
|
||||
if lang eq ru_RU
|
||||
db '‘¥£®¤ï'
|
||||
else if lang eq de_DE
|
||||
db 'Heute'
|
||||
else if lang eq fr_FR
|
||||
db "Aujourd'hui"
|
||||
else if lang eq et_EE
|
||||
db 'Täna'
|
||||
else if lang eq it_IT
|
||||
db 'Oggi'
|
||||
else ; Default to en_US
|
||||
db 'Today'
|
||||
end if
|
||||
today_end:
|
||||
focus dd 3
|
||||
new_style dd 1
|
||||
dropped db 0
|
||||
|
||||
sys_text:
|
||||
if lang eq ru_RU
|
||||
db '∴•',0
|
||||
else if lang eq it_IT
|
||||
db ' Ora',0
|
||||
else if lang eq et_EE
|
||||
db ' Aeg ',0
|
||||
else ; Default to en_US
|
||||
db ' Time',0
|
||||
end if
|
||||
separator db ':',0
|
||||
plus db '+',0
|
||||
minus db '-',0
|
||||
|
||||
set_date_t:
|
||||
if lang eq ru_RU
|
||||
db '“áâ ®¢¨âì ¤ âã',0
|
||||
else if lang eq it_IT
|
||||
db ' Impostazioni ',0
|
||||
else if lang eq et_EE
|
||||
db ' Määra kuupäev ',0
|
||||
else ; Default to en_US
|
||||
db ' Set date ',0
|
||||
end if
|
||||
|
@ -1,163 +1,165 @@
|
||||
;
|
||||
; Управление лотками дисковых приводов ATAPI
|
||||
; 22.07.2007 Mario79 исходный вариант
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
use32 ; включить 32-битный режим ассемблера
|
||||
org 0x0 ; адресация с нуля
|
||||
|
||||
db 'MENUET01' ; 8-байтный идентификатор MenuetOS
|
||||
dd 0x01 ; версия заголовка (всегда 1)
|
||||
dd START ; адрес первой команды
|
||||
dd I_END ; размер программы
|
||||
dd 0x11000 ; количество памяти
|
||||
dd 0x11000 ; адрес вершины стэка
|
||||
dd 0x0 ; адрес буфера для параметров (не используется)
|
||||
dd 0x0 ; зарезервировано
|
||||
|
||||
include 'macros.inc' ; макросы облегчают жизнь ассемблерщиков!
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
;--- НАЧАЛО ПРОГРАММЫ ----------------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
START:
|
||||
|
||||
red: ; перерисовать окно
|
||||
call draw_window ; вызываем процедуру отрисовки окна
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
;--- ЦИКЛ ОБРАБОТКИ СОБЫТИЙ ----------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
still:
|
||||
mcall 10 ; функция 10 - ждать события
|
||||
|
||||
cmp eax,1 ; перерисовать окно ?
|
||||
je red ; если да - на метку red
|
||||
cmp eax,2 ; нажата клавиша ?
|
||||
je key ; если да - на key
|
||||
cmp eax,3 ; нажата кнопка ?
|
||||
je button ; если да - на button
|
||||
|
||||
jmp still ; если другое событие - в начало цикла
|
||||
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
|
||||
key: ; нажата клавиша на клавиатуре
|
||||
mcall 2 ; функция 2 - считать код символа (в ah)
|
||||
|
||||
jmp still ; вернуться к началу цикла
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
button:
|
||||
mcall 17 ; 17 - получить идентификатор нажатой кнопки
|
||||
; кнопки 2,3,4,5 - load tray CD0/CD1/CD2/CD3
|
||||
movzx ecx, ah
|
||||
sub ecx, 2
|
||||
cmp ecx, 3
|
||||
ja b6
|
||||
mcall 24,5
|
||||
jmp red
|
||||
b6:
|
||||
; кнопки 6,7,8,9 - eject tray CD0/CD1/CD2/CD3
|
||||
sub ecx, 4
|
||||
cmp ecx, 3
|
||||
ja b1
|
||||
mcall 24,4
|
||||
jmp red
|
||||
b1:
|
||||
cmp ah, 1 ; если НЕ нажата кнопка с номером 1,
|
||||
jne still ; вернуться
|
||||
|
||||
.exit:
|
||||
mcall -1 ; иначе конец программы
|
||||
|
||||
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
;--- ОПРЕДЕЛЕНИЕ И ОТРИСОВКА ОКНА ----------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
draw_window:
|
||||
mcall 12, 1 ; функция 12: сообщить ОС об отрисовке окна
|
||||
; 1 - начинаем рисовать
|
||||
; СОЗДАиМ ОКНО
|
||||
|
||||
if lang eq it_IT
|
||||
mcall 0, <100,250>, <100,110>, 0x03AABBCC, 0x805080D0, 0x005080D0
|
||||
else
|
||||
mcall 0, <100,230>, <100,110>, 0x03AABBCC, 0x805080D0, 0x005080D0
|
||||
end if
|
||||
mcall 71, 1 ,header
|
||||
mcall 8,<15,42>,<40,20>,2,0xaaaaaa
|
||||
call draw_buttons
|
||||
mov edx,6
|
||||
add ecx,30 shl 16
|
||||
mcall
|
||||
call draw_buttons
|
||||
|
||||
if lang eq it_IT
|
||||
mcall 4, <16,25>, 0x80ffffff,text1
|
||||
else
|
||||
mcall 4, <25,25>, 0x80ffffff,text1
|
||||
end if
|
||||
mov edx,text2
|
||||
|
||||
add ebx,3 shl 16+20
|
||||
mcall
|
||||
mov edx,text3
|
||||
add ebx,30
|
||||
sub ebx,3 shl 16
|
||||
mcall
|
||||
|
||||
mcall 12, 2 ; функция 12: сообщить ОС об отрисовке окна
|
||||
; 2, закончили рисовать
|
||||
|
||||
ret ; выходим из процедуры
|
||||
|
||||
draw_buttons:
|
||||
pusha
|
||||
if lang eq it_IT
|
||||
add ebx,60 shl 16
|
||||
else
|
||||
add ebx,50 shl 16
|
||||
end if
|
||||
inc edx
|
||||
mcall
|
||||
if lang eq it_IT
|
||||
add ebx,60 shl 16
|
||||
else
|
||||
add ebx,50 shl 16
|
||||
end if
|
||||
inc edx
|
||||
mcall
|
||||
if lang eq it_IT
|
||||
add ebx,60 shl 16
|
||||
else
|
||||
add ebx,50 shl 16
|
||||
end if
|
||||
inc edx
|
||||
mcall
|
||||
popa
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
;--- ДАННЫЕ ПРОГРАММЫ ----------------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
header db ' ATAPI Device Tray Control',0
|
||||
if lang eq it_IT
|
||||
text3 db 'espelli espelli espelli espelli',0
|
||||
text2 db 'carica carica carica carica',0
|
||||
text1 db '/cd0/ /cd1/ /cd2/ /cd3/',0
|
||||
else
|
||||
text3 db 'eject eject eject eject',0
|
||||
text2 db 'load load load load',0
|
||||
text1 db '/cd0/ /cd1/ /cd2/ /cd3/',0
|
||||
end if
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
I_END: ; метка конца программы
|
||||
;
|
||||
; Управление лотками дисковых приводов ATAPI
|
||||
; 22.07.2007 Mario79 исходный вариант
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
use32 ; включить 32-битный режим ассемблера
|
||||
org 0x0 ; адресация с нуля
|
||||
|
||||
db 'MENUET01' ; 8-байтный идентификатор MenuetOS
|
||||
dd 0x01 ; версия заголовка (всегда 1)
|
||||
dd START ; адрес первой команды
|
||||
dd I_END ; размер программы
|
||||
dd 0x11000 ; количество памяти
|
||||
dd 0x11000 ; адрес вершины стэка
|
||||
dd 0x0 ; адрес буфера для параметров (не используется)
|
||||
dd 0x0 ; зарезервировано
|
||||
|
||||
; Language support for locales: it_IT, en_US.
|
||||
|
||||
include 'macros.inc' ; макросы облегчают жизнь ассемблерщиков!
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
;--- НАЧАЛО ПРОГРАММЫ ----------------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
START:
|
||||
|
||||
red: ; перерисовать окно
|
||||
call draw_window ; вызываем процедуру отрисовки окна
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
;--- ЦИКЛ ОБРАБОТКИ СОБЫТИЙ ----------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
still:
|
||||
mcall 10 ; функция 10 - ждать события
|
||||
|
||||
cmp eax,1 ; перерисовать окно ?
|
||||
je red ; если да - на метку red
|
||||
cmp eax,2 ; нажата клавиша ?
|
||||
je key ; если да - на key
|
||||
cmp eax,3 ; нажата кнопка ?
|
||||
je button ; если да - на button
|
||||
|
||||
jmp still ; если другое событие - в начало цикла
|
||||
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
|
||||
key: ; нажата клавиша на клавиатуре
|
||||
mcall 2 ; функция 2 - считать код символа (в ah)
|
||||
|
||||
jmp still ; вернуться к началу цикла
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
button:
|
||||
mcall 17 ; 17 - получить идентификатор нажатой кнопки
|
||||
; кнопки 2,3,4,5 - load tray CD0/CD1/CD2/CD3
|
||||
movzx ecx, ah
|
||||
sub ecx, 2
|
||||
cmp ecx, 3
|
||||
ja b6
|
||||
mcall 24,5
|
||||
jmp red
|
||||
b6:
|
||||
; кнопки 6,7,8,9 - eject tray CD0/CD1/CD2/CD3
|
||||
sub ecx, 4
|
||||
cmp ecx, 3
|
||||
ja b1
|
||||
mcall 24,4
|
||||
jmp red
|
||||
b1:
|
||||
cmp ah, 1 ; если НЕ нажата кнопка с номером 1,
|
||||
jne still ; вернуться
|
||||
|
||||
.exit:
|
||||
mcall -1 ; иначе конец программы
|
||||
|
||||
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
;--- ОПРЕДЕЛЕНИЕ И ОТРИСОВКА ОКНА ----------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
draw_window:
|
||||
mcall 12, 1 ; функция 12: сообщить ОС об отрисовке окна
|
||||
; 1 - начинаем рисовать
|
||||
; СОЗДАиМ ОКНО
|
||||
|
||||
if lang eq it_IT
|
||||
mcall 0, <100,250>, <100,110>, 0x03AABBCC, 0x805080D0, 0x005080D0
|
||||
else ; Default to en_US
|
||||
mcall 0, <100,230>, <100,110>, 0x03AABBCC, 0x805080D0, 0x005080D0
|
||||
end if
|
||||
mcall 71, 1 ,header
|
||||
mcall 8,<15,42>,<40,20>,2,0xaaaaaa
|
||||
call draw_buttons
|
||||
mov edx,6
|
||||
add ecx,30 shl 16
|
||||
mcall
|
||||
call draw_buttons
|
||||
|
||||
if lang eq it_IT
|
||||
mcall 4, <16,25>, 0x80ffffff,text1
|
||||
else ; Default to en_US
|
||||
mcall 4, <25,25>, 0x80ffffff,text1
|
||||
end if
|
||||
mov edx,text2
|
||||
|
||||
add ebx,3 shl 16+20
|
||||
mcall
|
||||
mov edx,text3
|
||||
add ebx,30
|
||||
sub ebx,3 shl 16
|
||||
mcall
|
||||
|
||||
mcall 12, 2 ; функция 12: сообщить ОС об отрисовке окна
|
||||
; 2, закончили рисовать
|
||||
|
||||
ret ; выходим из процедуры
|
||||
|
||||
draw_buttons:
|
||||
pusha
|
||||
if lang eq it_IT
|
||||
add ebx,60 shl 16
|
||||
else ; Default to en_US
|
||||
add ebx,50 shl 16
|
||||
end if
|
||||
inc edx
|
||||
mcall
|
||||
if lang eq it_IT
|
||||
add ebx,60 shl 16
|
||||
else ; Default to en_US
|
||||
add ebx,50 shl 16
|
||||
end if
|
||||
inc edx
|
||||
mcall
|
||||
if lang eq it_IT
|
||||
add ebx,60 shl 16
|
||||
else ; Default to en_US
|
||||
add ebx,50 shl 16
|
||||
end if
|
||||
inc edx
|
||||
mcall
|
||||
popa
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
;--- ДАННЫЕ ПРОГРАММЫ ----------------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
header db ' ATAPI Device Tray Control',0
|
||||
if lang eq it_IT
|
||||
text3 db 'espelli espelli espelli espelli',0
|
||||
text2 db 'carica carica carica carica',0
|
||||
text1 db '/cd0/ /cd1/ /cd2/ /cd3/',0
|
||||
else ; Default to en_US
|
||||
text3 db 'eject eject eject eject',0
|
||||
text2 db 'load load load load',0
|
||||
text1 db '/cd0/ /cd1/ /cd2/ /cd3/',0
|
||||
end if
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
I_END: ; метка конца программы
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
use32
|
||||
org 0x0
|
||||
|
||||
|
||||
db "MENUET01" ; 8 byte id
|
||||
dd 0x01 ; header version
|
||||
dd START ; start of code
|
||||
@ -16,7 +16,7 @@
|
||||
dd 0x0 ; boot parameters
|
||||
dd cur_dir_path ; path
|
||||
;-------------------------------------------------------------------------------
|
||||
include "lang.inc"
|
||||
include "lang.inc" ; Language support for locales (UTF-8): de_DE, et_EE, ru_RU, it_IT, en_US.
|
||||
include "../../../macros.inc"
|
||||
include "../../../develop/libraries/box_lib/trunk/box_lib.mac"
|
||||
include "../../../KOSfuncs.inc"
|
||||
@ -43,7 +43,7 @@ EDITBOX:
|
||||
.Y = UNDERTABLE.Y + BUTTON.HEIGHT + 20
|
||||
.WIDTH = 465
|
||||
.HEIGHT = 23
|
||||
|
||||
|
||||
CHECKBOX:
|
||||
.X = PROCESS_TABLE.X
|
||||
.Y = UNDERTABLE.Y + BUTTON.HEIGHT + 25
|
||||
@ -300,7 +300,7 @@ draw_next_process:
|
||||
add ebx, BUTTON.WIDTH
|
||||
mcall
|
||||
|
||||
;create terminate process button
|
||||
;create terminate process button
|
||||
;mov ecx,[curposy]
|
||||
shl ecx,16
|
||||
mov cx, BUTTON.HEIGHT
|
||||
@ -478,7 +478,7 @@ align 4
|
||||
;show window y size
|
||||
movzx eax, word [process_info_buffer.box.top]
|
||||
add ebx, 70 shl 16
|
||||
call draw_ra_dec_number
|
||||
call draw_ra_dec_number
|
||||
pop edi
|
||||
;-------------------------------------------------------------------------------
|
||||
align 4
|
||||
@ -515,36 +515,36 @@ draw_window:
|
||||
|
||||
test [window_status],10b ; window is minimized to panel
|
||||
jnz .exit
|
||||
|
||||
|
||||
mov eax, strings.process_name
|
||||
mov ebx, 130 shl 16 + 5
|
||||
xor ecx, ecx
|
||||
call draw_ra_text
|
||||
|
||||
|
||||
mov eax, strings.ptid
|
||||
add ebx, 80 shl 16
|
||||
call draw_ra_text
|
||||
|
||||
|
||||
mov eax, strings.cpu_usage_cycles
|
||||
add ebx, 100 shl 16
|
||||
call draw_ra_text
|
||||
|
||||
|
||||
mov eax, strings.cpu_usage_percent
|
||||
add ebx, 55 shl 16
|
||||
call draw_ra_text
|
||||
|
||||
|
||||
mov eax, strings.memory_usage
|
||||
add ebx, 60 shl 16
|
||||
call draw_ra_text
|
||||
|
||||
|
||||
mov eax, strings.window_stack_pos
|
||||
add ebx, 70 shl 16
|
||||
call draw_ra_text
|
||||
|
||||
|
||||
mov eax, strings.window_position.x
|
||||
add ebx, 70 shl 16
|
||||
call draw_ra_text
|
||||
|
||||
|
||||
mov eax, strings.window_position.y
|
||||
add ebx, 70 shl 16
|
||||
call draw_ra_text
|
||||
@ -621,7 +621,7 @@ align 4
|
||||
align 4
|
||||
.exit:
|
||||
ret
|
||||
|
||||
|
||||
;-------------------------------------------------------------------------------
|
||||
|
||||
draw_ra_dec_number:
|
||||
@ -638,13 +638,13 @@ draw_ra_dec_number:
|
||||
|
||||
ror ebx, 16
|
||||
mov ebp, eax
|
||||
|
||||
|
||||
test edx, edx
|
||||
jz .no_postfix
|
||||
|
||||
|
||||
mov eax, edx
|
||||
call count_utf8z_chars
|
||||
|
||||
|
||||
test eax, eax
|
||||
jz .no_postfix
|
||||
push ecx
|
||||
@ -655,13 +655,13 @@ draw_ra_dec_number:
|
||||
mcall SF_DRAW_TEXT
|
||||
ror ebx, 16
|
||||
pop ecx
|
||||
|
||||
|
||||
.no_postfix:
|
||||
mov eax, ebp
|
||||
push edx
|
||||
|
||||
xor edi, edi
|
||||
|
||||
|
||||
mov esi, 10
|
||||
@@:
|
||||
xor edx, edx
|
||||
@ -681,7 +681,7 @@ draw_ra_dec_number:
|
||||
sub dx, ax
|
||||
rol edx, 16
|
||||
mcall SF_DRAW_NUMBER, (11 shl 16) or 0x80000000
|
||||
|
||||
|
||||
popa
|
||||
ret
|
||||
;-------------------------------------------------------------------------------
|
||||
@ -702,7 +702,7 @@ draw_ra_data_size:
|
||||
cmp eax, 1024
|
||||
ja @f
|
||||
jmp .draw_text
|
||||
|
||||
|
||||
@@:
|
||||
cmp eax, 1024*1024
|
||||
jae @f
|
||||
@ -710,7 +710,7 @@ draw_ra_data_size:
|
||||
div esi
|
||||
mov edx, strings.KB
|
||||
jmp .draw_text
|
||||
|
||||
|
||||
@@:
|
||||
cmp eax, 1024*1024*1024
|
||||
jae @f
|
||||
@ -718,15 +718,15 @@ draw_ra_data_size:
|
||||
div esi
|
||||
mov edx, strings.MB
|
||||
jmp .draw_text
|
||||
|
||||
|
||||
@@:
|
||||
mov esi, 1024*1024*1024
|
||||
div esi
|
||||
mov edx, strings.GB
|
||||
|
||||
|
||||
.draw_text:
|
||||
call draw_ra_dec_number
|
||||
|
||||
|
||||
popa
|
||||
ret
|
||||
;-------------------------------------------------------------------------------
|
||||
@ -743,9 +743,9 @@ draw_ra_text:
|
||||
|
||||
ror ebx, 16
|
||||
mov edx, eax
|
||||
|
||||
|
||||
call count_utf8z_chars
|
||||
|
||||
|
||||
test eax, eax
|
||||
jz .ret
|
||||
lea eax, [eax*8]
|
||||
@ -753,7 +753,7 @@ draw_ra_text:
|
||||
rol ebx, 16
|
||||
or ecx, 0xB0000000
|
||||
mcall SF_DRAW_TEXT
|
||||
|
||||
|
||||
.ret:
|
||||
popa
|
||||
ret
|
||||
@ -773,7 +773,7 @@ draw_button_with_caption:
|
||||
;ebx = x+width shl 16 + y
|
||||
;-------------------------------------------------------------------------------
|
||||
pusha
|
||||
|
||||
|
||||
xor ebp, ebp
|
||||
mov edi, eax
|
||||
test eax, eax
|
||||
@ -782,7 +782,7 @@ draw_button_with_caption:
|
||||
call count_utf8z_chars
|
||||
mov ebp, eax
|
||||
|
||||
.no_caption_0:
|
||||
.no_caption_0:
|
||||
push ebx esi
|
||||
lea eax, [ebp*8]
|
||||
mov esi, edx
|
||||
@ -804,7 +804,7 @@ draw_button_with_caption:
|
||||
mov ecx, esi
|
||||
or ecx, 0xB0000000
|
||||
mcall SF_DRAW_TEXT
|
||||
|
||||
|
||||
.no_caption_1:
|
||||
popa
|
||||
ret
|
||||
@ -820,7 +820,7 @@ count_utf8z_chars:
|
||||
push esi ebx
|
||||
mov esi, eax
|
||||
xor ebx, ebx
|
||||
|
||||
|
||||
.0:
|
||||
lodsb
|
||||
test al, al
|
||||
@ -836,25 +836,25 @@ count_utf8z_chars:
|
||||
ja @f
|
||||
inc esi
|
||||
jmp .0
|
||||
|
||||
|
||||
@@:
|
||||
cmp al, 0xEF
|
||||
ja @f
|
||||
inc esi
|
||||
inc esi
|
||||
jmp .0
|
||||
|
||||
|
||||
@@:
|
||||
cmp al, 0xF7
|
||||
ja .err
|
||||
add esi, 3
|
||||
jmp .0
|
||||
|
||||
|
||||
.ok:
|
||||
mov eax, ebx
|
||||
pop ebx esi
|
||||
ret
|
||||
|
||||
|
||||
.err:
|
||||
xor eax, eax
|
||||
pop ebx esi
|
||||
@ -920,7 +920,7 @@ sys_reboot:
|
||||
strings:
|
||||
if lang eq de_DE
|
||||
.window_caption utf8z "Prozesse v0.2.3 - [Ctrl+Alt+Del]"
|
||||
|
||||
|
||||
.process_name utf8z "NAME/BEENDEN"
|
||||
.ptid utf8z "PID/TID"
|
||||
.cpu_usage_cycles utf8z "CPU(ZYKLEN)"
|
||||
@ -929,21 +929,21 @@ if lang eq de_DE
|
||||
.window_stack_pos utf8z "W-STACK"
|
||||
.window_position.x utf8z " WIN-X"
|
||||
.window_position.y utf8z " WIN-Y"
|
||||
|
||||
|
||||
.previous_page utf8z "SEITE ZURUECK"
|
||||
.next_page utf8z "SEITE VOR"
|
||||
.reboot utf8z "REBOOT SYSTEM"
|
||||
.run utf8z "START"
|
||||
|
||||
|
||||
.checkbox_caption utf8z "System"
|
||||
|
||||
|
||||
.KB utf8z " KB"
|
||||
.MB utf8z " MB"
|
||||
.GB utf8z " GB"
|
||||
;-------------------------------------------------------------------------------
|
||||
else if lang eq et_EE
|
||||
.window_caption utf8z "Protsessid v0.2.3 - [Ctrl+Alt+Del]"
|
||||
|
||||
|
||||
.process_name utf8z "NIMI/LÕPETA"
|
||||
.ptid utf8z "PID/TID"
|
||||
.cpu_usage_cycles utf8z "CPU(TSÜKLID)"
|
||||
@ -952,21 +952,21 @@ else if lang eq et_EE
|
||||
.window_stack_pos utf8z "W-PUHVER"
|
||||
.window_position.x utf8z " WIN-X"
|
||||
.window_position.y utf8z " WIN-Y"
|
||||
|
||||
|
||||
.previous_page utf8z "EELMINE LEHT"
|
||||
.next_page utf8z "JÄRGMINE LEHT"
|
||||
.reboot utf8z "REBOODI SÜSTEEM"
|
||||
.run utf8z "START"
|
||||
|
||||
|
||||
.checkbox_caption utf8z "System"
|
||||
|
||||
|
||||
.KB utf8z " KB"
|
||||
.MB utf8z " MB"
|
||||
.GB utf8z " GB"
|
||||
;-------------------------------------------------------------------------------
|
||||
else if lang eq ru_RU
|
||||
.window_caption utf8z "Диспетчер процессов v0.2.3 - [Ctrl+Alt+Del]"
|
||||
|
||||
|
||||
.process_name utf8z "ИМЯ/ЗАВЕРШИТЬ"
|
||||
.ptid utf8z "PID/TID"
|
||||
.cpu_usage_cycles utf8z "CPU(ТАКТЫ)"
|
||||
@ -975,21 +975,21 @@ else if lang eq ru_RU
|
||||
.window_stack_pos utf8z "W-STACK"
|
||||
.window_position.x utf8z " WIN-X"
|
||||
.window_position.y utf8z " WIN-Y"
|
||||
|
||||
|
||||
.previous_page utf8z "ПРЕД. СТР."
|
||||
.next_page utf8z "СЛЕД. СТР."
|
||||
.reboot utf8z "ПЕРЕЗАГРУЗКА"
|
||||
.run utf8z "ЗАПУСК"
|
||||
|
||||
|
||||
.checkbox_caption utf8z "Системные"
|
||||
|
||||
|
||||
.KB utf8z " КБ"
|
||||
.MB utf8z " МБ"
|
||||
.GB utf8z " ГБ"
|
||||
;-------------------------------------------------------------------------------
|
||||
else if lang eq it_IT
|
||||
.window_caption utf8z "Gestore processi v0.2.3 - [Ctrl+Alt+Del]"
|
||||
|
||||
|
||||
.process_name utf8z "NOME-PROGRAMMA"
|
||||
.ptid utf8z "PID/TID"
|
||||
.cpu_usage_cycles utf8z "CPU(CICLI)"
|
||||
@ -998,21 +998,21 @@ else if lang eq it_IT
|
||||
.window_stack_pos utf8z "W-STACK"
|
||||
.window_position.x utf8z " WIN-X"
|
||||
.window_position.y utf8z " WIN-Y"
|
||||
|
||||
|
||||
.previous_page utf8z "INDIETRO"
|
||||
.next_page utf8z "AVANTI"
|
||||
.reboot utf8z "RIAVVIA SISTEMA"
|
||||
.run utf8z "START"
|
||||
|
||||
|
||||
.checkbox_caption utf8z "System"
|
||||
|
||||
|
||||
.KB utf8z " KB"
|
||||
.MB utf8z " MB"
|
||||
.GB utf8z " GB"
|
||||
;-------------------------------------------------------------------------------
|
||||
else
|
||||
else ; Default to en_US
|
||||
.window_caption utf8z "Process manager v0.2.3 - [Ctrl+Alt+Del]"
|
||||
|
||||
|
||||
.process_name utf8z "NAME/TERMINATE"
|
||||
.ptid utf8z "PID/TID"
|
||||
.cpu_usage_cycles utf8z "CPU(CYCLES)"
|
||||
@ -1021,15 +1021,15 @@ else
|
||||
.window_stack_pos utf8z "W-STACK"
|
||||
.window_position.x utf8z " WIN-X"
|
||||
.window_position.y utf8z " WIN-Y"
|
||||
|
||||
|
||||
|
||||
|
||||
.previous_page utf8z "PREV PAGE"
|
||||
.next_page utf8z "NEXT PAGE"
|
||||
.reboot utf8z "REBOOT SYSTEM"
|
||||
.run utf8z "RUN"
|
||||
|
||||
|
||||
.checkbox_caption utf8z "System"
|
||||
|
||||
|
||||
.KB utf8z " KB"
|
||||
.MB utf8z " MB"
|
||||
.GB utf8z " GB"
|
||||
|
@ -1,227 +1,227 @@
|
||||
;---------------------------------------------------------------------
|
||||
;
|
||||
; DOCPAK FOR KOLIBRI v1.2
|
||||
; Written in pure assembly by Ivushkin Andrey aka Willow
|
||||
;
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
FILE_COUNT=0
|
||||
DEF_FILE equ 'g'
|
||||
|
||||
macro embed_docdir_file fn
|
||||
{
|
||||
forward
|
||||
local label,label2,label3
|
||||
dd label2-label
|
||||
dd label-label3
|
||||
label3:
|
||||
db fn
|
||||
label:
|
||||
file '%DOCDIR%' # fn
|
||||
label2:
|
||||
FILE_COUNT=FILE_COUNT+1
|
||||
}
|
||||
macro embed_local_file fn
|
||||
{
|
||||
forward
|
||||
local label,label2,label3
|
||||
dd label2-label
|
||||
dd label-label3
|
||||
label3:
|
||||
db fn
|
||||
label:
|
||||
file fn
|
||||
label2:
|
||||
FILE_COUNT=FILE_COUNT+1
|
||||
}
|
||||
|
||||
use32
|
||||
org 0x0
|
||||
db 'MENUET01' ; 8 byte id
|
||||
dd 0x01 ; header version
|
||||
dd start ; start of code
|
||||
dd I_END ; size of image
|
||||
dd I_END+0x400 ; memory for app
|
||||
dd I_END+0x400 ; esp
|
||||
dd my_param , 0x0 ; I_Param , I_Icon
|
||||
include '../../../macros.inc'
|
||||
include 'lang.inc'
|
||||
|
||||
start:
|
||||
cmp [my_param],0
|
||||
je red
|
||||
cmp [my_param],'a'
|
||||
jb .par_a
|
||||
cmp [my_param],'z'
|
||||
jbe .ok2
|
||||
.par_a:
|
||||
mov [my_param],DEF_FILE
|
||||
.ok2:
|
||||
movzx ecx,[my_param]
|
||||
mov [my_param],'*'
|
||||
.open:
|
||||
sub ecx,'a'-1
|
||||
mov edx,embedded
|
||||
xor esi,esi
|
||||
.list:
|
||||
lea edx,[edx+esi+8]
|
||||
mov esi,[edx-8]
|
||||
add edx,[edx-4]
|
||||
test esi,esi
|
||||
jz .close
|
||||
loop .list
|
||||
push edx
|
||||
; convert number in esi to decimal representation
|
||||
mov ecx, 10
|
||||
push -'0'
|
||||
mov eax, esi
|
||||
@@:
|
||||
xor edx, edx
|
||||
div ecx
|
||||
push edx
|
||||
test eax, eax
|
||||
jnz @b
|
||||
mov edi, fsize
|
||||
@@:
|
||||
pop eax
|
||||
add al, '0'
|
||||
stosb
|
||||
jnz @b
|
||||
mcall 70,fileinfo
|
||||
mov ecx,eax
|
||||
mcall 5,20
|
||||
pop edx
|
||||
mcall 60,2
|
||||
cmp [my_param],'*'
|
||||
jne still
|
||||
.close:
|
||||
mcall -1
|
||||
|
||||
red:
|
||||
mov [my_param],'a'
|
||||
|
||||
mcall 48, 3, sc, sizeof.system_colors
|
||||
|
||||
mcall 12,1
|
||||
|
||||
BTN_H equ 21
|
||||
|
||||
mov edx,[sc.work]
|
||||
or edx,0x34000000
|
||||
mcall 0, <220,141>, <30,FILECOUNT*(BTN_H+3)+37>, , ,title
|
||||
|
||||
mov ecx,FILECOUNT
|
||||
mov ebx,23 shl 16+100
|
||||
mov esi,[sc.work_button]
|
||||
mov edi,5 shl 16+BTN_H
|
||||
mov edx,10
|
||||
mov eax,8
|
||||
.btnlp:
|
||||
push ecx
|
||||
mcall ,,edi
|
||||
add edi,(BTN_H+3) shl 16
|
||||
inc edx
|
||||
pop ecx
|
||||
loop .btnlp
|
||||
mov ecx,FILECOUNT
|
||||
mov edx,embedded
|
||||
xor edi,edi
|
||||
mov ebx,30 shl 16+8
|
||||
mov eax,4
|
||||
.list:
|
||||
lea edx,[edx+edi+8]
|
||||
mov edi,[edx-8]
|
||||
pusha
|
||||
sub ebx,20 shl 16
|
||||
mov ecx, [sc.work_text]
|
||||
or ecx, 0x30000000
|
||||
mcall ,,,my_param,1
|
||||
inc [my_param]
|
||||
popa
|
||||
push ecx
|
||||
mov esi, [edx-4]
|
||||
sub esi, 4 ;remove .txt extension
|
||||
mov ecx, [sc.work_button_text]
|
||||
or ecx, 0x30000000
|
||||
mcall
|
||||
pop ecx
|
||||
add esi, 4
|
||||
add edx, esi
|
||||
add ebx,(BTN_H+3)
|
||||
loop .list
|
||||
mcall 12,2
|
||||
|
||||
still:
|
||||
mcall 10
|
||||
cmp eax,1
|
||||
je red
|
||||
cmp eax,2
|
||||
jne .nokey
|
||||
mcall 2
|
||||
cmp ah,27 ;Esc
|
||||
je start.close
|
||||
cmp ah,'a'
|
||||
jb still
|
||||
cmp ah,'a'+FILECOUNT
|
||||
jae still
|
||||
jmp .cxax
|
||||
.nokey:
|
||||
mcall 17
|
||||
cmp ah,1
|
||||
je start.close
|
||||
sub ah,10-'a'
|
||||
.cxax:
|
||||
movzx ecx,ah
|
||||
jmp start.open
|
||||
|
||||
fileinfo:
|
||||
dd 7
|
||||
dd 0
|
||||
dd param
|
||||
dd 0 ,0
|
||||
db '/sys/TINYPAD',0
|
||||
|
||||
param db '*'
|
||||
fsize:
|
||||
times 10 db '0'
|
||||
db 0
|
||||
|
||||
embedded:
|
||||
|
||||
; Please use only filenames w/o path!
|
||||
|
||||
; -- Start of embedding area ------
|
||||
embed_docdir_file 'CREDITS.TXT' ;a
|
||||
if lang eq ru_RU
|
||||
embed_docdir_file 'GNU.TXT' ;b
|
||||
else
|
||||
embed_docdir_file 'COPYING.TXT' ;b
|
||||
end if
|
||||
embed_docdir_file 'HOT_KEYS.TXT' ;c
|
||||
embed_local_file 'FASM.TXT' ;d
|
||||
embed_docdir_file 'MTDBG.TXT' ;e
|
||||
if lang eq ru_RU
|
||||
embed_local_file 'SYSFUNCR.TXT' ;f
|
||||
else
|
||||
embed_local_file 'SYSFUNCS.TXT' ;f
|
||||
end if
|
||||
embed_local_file 'STACK.TXT' ;g
|
||||
embed_docdir_file 'KFAR_KEYS.TXT' ;h
|
||||
embed_docdir_file 'INI.TXT' ;i
|
||||
embed_docdir_file 'OPENDIAL.TXT' ;j
|
||||
; -- End of embedding area -------
|
||||
|
||||
dd 0
|
||||
FILECOUNT = FILE_COUNT
|
||||
|
||||
if ~ FILECOUNT>0
|
||||
error 'No embedded files'
|
||||
end if
|
||||
|
||||
my_param db 0
|
||||
rb 256
|
||||
I_END:
|
||||
|
||||
title db 'Doc Pack',0
|
||||
|
||||
sc system_colors
|
||||
;---------------------------------------------------------------------
|
||||
;
|
||||
; DOCPAK FOR KOLIBRI v1.2
|
||||
; Written in pure assembly by Ivushkin Andrey aka Willow
|
||||
;
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
FILE_COUNT=0
|
||||
DEF_FILE equ 'g'
|
||||
|
||||
macro embed_docdir_file fn
|
||||
{
|
||||
forward
|
||||
local label,label2,label3
|
||||
dd label2-label
|
||||
dd label-label3
|
||||
label3:
|
||||
db fn
|
||||
label:
|
||||
file '%DOCDIR%' # fn
|
||||
label2:
|
||||
FILE_COUNT=FILE_COUNT+1
|
||||
}
|
||||
macro embed_local_file fn
|
||||
{
|
||||
forward
|
||||
local label,label2,label3
|
||||
dd label2-label
|
||||
dd label-label3
|
||||
label3:
|
||||
db fn
|
||||
label:
|
||||
file fn
|
||||
label2:
|
||||
FILE_COUNT=FILE_COUNT+1
|
||||
}
|
||||
|
||||
use32
|
||||
org 0x0
|
||||
db 'MENUET01' ; 8 byte id
|
||||
dd 0x01 ; header version
|
||||
dd start ; start of code
|
||||
dd I_END ; size of image
|
||||
dd I_END+0x400 ; memory for app
|
||||
dd I_END+0x400 ; esp
|
||||
dd my_param , 0x0 ; I_Param , I_Icon
|
||||
include '../../../macros.inc'
|
||||
include 'lang.inc' ; Language support for locales: ru_RU, en_US.
|
||||
|
||||
start:
|
||||
cmp [my_param],0
|
||||
je red
|
||||
cmp [my_param],'a'
|
||||
jb .par_a
|
||||
cmp [my_param],'z'
|
||||
jbe .ok2
|
||||
.par_a:
|
||||
mov [my_param],DEF_FILE
|
||||
.ok2:
|
||||
movzx ecx,[my_param]
|
||||
mov [my_param],'*'
|
||||
.open:
|
||||
sub ecx,'a'-1
|
||||
mov edx,embedded
|
||||
xor esi,esi
|
||||
.list:
|
||||
lea edx,[edx+esi+8]
|
||||
mov esi,[edx-8]
|
||||
add edx,[edx-4]
|
||||
test esi,esi
|
||||
jz .close
|
||||
loop .list
|
||||
push edx
|
||||
; convert number in esi to decimal representation
|
||||
mov ecx, 10
|
||||
push -'0'
|
||||
mov eax, esi
|
||||
@@:
|
||||
xor edx, edx
|
||||
div ecx
|
||||
push edx
|
||||
test eax, eax
|
||||
jnz @b
|
||||
mov edi, fsize
|
||||
@@:
|
||||
pop eax
|
||||
add al, '0'
|
||||
stosb
|
||||
jnz @b
|
||||
mcall 70,fileinfo
|
||||
mov ecx,eax
|
||||
mcall 5,20
|
||||
pop edx
|
||||
mcall 60,2
|
||||
cmp [my_param],'*'
|
||||
jne still
|
||||
.close:
|
||||
mcall -1
|
||||
|
||||
red:
|
||||
mov [my_param],'a'
|
||||
|
||||
mcall 48, 3, sc, sizeof.system_colors
|
||||
|
||||
mcall 12,1
|
||||
|
||||
BTN_H equ 21
|
||||
|
||||
mov edx,[sc.work]
|
||||
or edx,0x34000000
|
||||
mcall 0, <220,141>, <30,FILECOUNT*(BTN_H+3)+37>, , ,title
|
||||
|
||||
mov ecx,FILECOUNT
|
||||
mov ebx,23 shl 16+100
|
||||
mov esi,[sc.work_button]
|
||||
mov edi,5 shl 16+BTN_H
|
||||
mov edx,10
|
||||
mov eax,8
|
||||
.btnlp:
|
||||
push ecx
|
||||
mcall ,,edi
|
||||
add edi,(BTN_H+3) shl 16
|
||||
inc edx
|
||||
pop ecx
|
||||
loop .btnlp
|
||||
mov ecx,FILECOUNT
|
||||
mov edx,embedded
|
||||
xor edi,edi
|
||||
mov ebx,30 shl 16+8
|
||||
mov eax,4
|
||||
.list:
|
||||
lea edx,[edx+edi+8]
|
||||
mov edi,[edx-8]
|
||||
pusha
|
||||
sub ebx,20 shl 16
|
||||
mov ecx, [sc.work_text]
|
||||
or ecx, 0x30000000
|
||||
mcall ,,,my_param,1
|
||||
inc [my_param]
|
||||
popa
|
||||
push ecx
|
||||
mov esi, [edx-4]
|
||||
sub esi, 4 ;remove .txt extension
|
||||
mov ecx, [sc.work_button_text]
|
||||
or ecx, 0x30000000
|
||||
mcall
|
||||
pop ecx
|
||||
add esi, 4
|
||||
add edx, esi
|
||||
add ebx,(BTN_H+3)
|
||||
loop .list
|
||||
mcall 12,2
|
||||
|
||||
still:
|
||||
mcall 10
|
||||
cmp eax,1
|
||||
je red
|
||||
cmp eax,2
|
||||
jne .nokey
|
||||
mcall 2
|
||||
cmp ah,27 ;Esc
|
||||
je start.close
|
||||
cmp ah,'a'
|
||||
jb still
|
||||
cmp ah,'a'+FILECOUNT
|
||||
jae still
|
||||
jmp .cxax
|
||||
.nokey:
|
||||
mcall 17
|
||||
cmp ah,1
|
||||
je start.close
|
||||
sub ah,10-'a'
|
||||
.cxax:
|
||||
movzx ecx,ah
|
||||
jmp start.open
|
||||
|
||||
fileinfo:
|
||||
dd 7
|
||||
dd 0
|
||||
dd param
|
||||
dd 0 ,0
|
||||
db '/sys/TINYPAD',0
|
||||
|
||||
param db '*'
|
||||
fsize:
|
||||
times 10 db '0'
|
||||
db 0
|
||||
|
||||
embedded:
|
||||
|
||||
; Please use only filenames w/o path!
|
||||
|
||||
; -- Start of embedding area ------
|
||||
embed_docdir_file 'CREDITS.TXT' ;a
|
||||
if lang eq ru_RU
|
||||
embed_docdir_file 'GNU.TXT' ;b
|
||||
else ; Default to en_US
|
||||
embed_docdir_file 'COPYING.TXT' ;b
|
||||
end if
|
||||
embed_docdir_file 'HOT_KEYS.TXT' ;c
|
||||
embed_local_file 'FASM.TXT' ;d
|
||||
embed_docdir_file 'MTDBG.TXT' ;e
|
||||
if lang eq ru_RU
|
||||
embed_local_file 'SYSFUNCR.TXT' ;f
|
||||
else ; Default to en_US
|
||||
embed_local_file 'SYSFUNCS.TXT' ;f
|
||||
end if
|
||||
embed_local_file 'STACK.TXT' ;g
|
||||
embed_docdir_file 'KFAR_KEYS.TXT' ;h
|
||||
embed_docdir_file 'INI.TXT' ;i
|
||||
embed_docdir_file 'OPENDIAL.TXT' ;j
|
||||
; -- End of embedding area -------
|
||||
|
||||
dd 0
|
||||
FILECOUNT = FILE_COUNT
|
||||
|
||||
if ~ FILECOUNT>0
|
||||
error 'No embedded files'
|
||||
end if
|
||||
|
||||
my_param db 0
|
||||
rb 256
|
||||
I_END:
|
||||
|
||||
title db 'Doc Pack',0
|
||||
|
||||
sc system_colors
|
||||
|
@ -1,68 +1,71 @@
|
||||
WIN_W = 440
|
||||
WIN_H = 200
|
||||
BOT_PANEL_H = 70
|
||||
;---------------------------------------------------------------------
|
||||
CANCEL_BUTTON_ID = 1+BT_HIDE
|
||||
HOME_BUTTON_ID = 2
|
||||
REBOOT_BUTTON_ID = 3
|
||||
POWEROFF_BUTTON_ID = 4
|
||||
CHECKBOX_BUTTON_ID = 5+BT_HIDE
|
||||
;---------------------------------------------------------------------
|
||||
TEXT_HOME: db 'Home',0
|
||||
TEXT_ENTER: db 'Enter',0
|
||||
TEXT_END: db 'End',0
|
||||
TEXT_CANCEL: db 'x',0
|
||||
;---------------------------------------------------------------------
|
||||
if lang eq ru_RU
|
||||
TEXT_WTITLE: db '‡ ¢¥à襨¥ à ¡®âë',0
|
||||
TEXT_RDSAVE1: db '‘®åà ¨âì ¨§¬¥¥¨ï, ᤥ« ë¥ ¢',0
|
||||
TEXT_RDSAVE2: db '¯à®æ¥áá¥ à ¡®âë ¢ á¨á⥬¥ (Ctrl+S)',0
|
||||
TEXT_KERNEL: db 'Ÿ¤à®',0
|
||||
TEXT_REBOOT: db '<27>¥à¥§ £à㧪 ',0
|
||||
TEXT_OFF: db '‚몫î票¥',0
|
||||
TEXT_SAVING: db '‘®åà ¥¨¥ ®¡à § ...',0
|
||||
else if lang eq de_DE
|
||||
TEXT_WTITLE: db 'Shutdown computer',0
|
||||
TEXT_RDSAVE1: db 'Save all changes that were done',0
|
||||
TEXT_RDSAVE2: db 'during system work (Ctrl+S)',0
|
||||
TEXT_KERNEL: db 'Kernel',0
|
||||
TEXT_REBOOT: db 'Neustart',0
|
||||
TEXT_OFF: db 'Beenden',0
|
||||
TEXT_SAVING: db 'Saving RAM-drive...',0
|
||||
else if lang eq it_IT
|
||||
TEXT_WTITLE: db 'Shutdown computer',0
|
||||
TEXT_RDSAVE1: db 'Save all changes that were done',0
|
||||
TEXT_RDSAVE2: db 'during system work (Ctrl+S)',0
|
||||
TEXT_KERNEL: db 'Kernel',0
|
||||
TEXT_REBOOT: db 'Riavvio',0
|
||||
TEXT_OFF: db 'Spegni',0
|
||||
TEXT_SAVING: db 'Saving RAM-drive...',0
|
||||
else
|
||||
TEXT_WTITLE: db 'Shutdown computer',0
|
||||
TEXT_RDSAVE1: db 'Save all changes that were done',0
|
||||
TEXT_RDSAVE2: db 'during system work (Ctrl+S)',0
|
||||
TEXT_KERNEL: db 'Kernel',0
|
||||
TEXT_REBOOT: db 'Reboot',0
|
||||
TEXT_OFF: db 'Power off',0
|
||||
TEXT_SAVING: db 'Saving RAM-drive...',0
|
||||
end if
|
||||
;---------------------------------------------------------------------
|
||||
rdsave:
|
||||
dd SSF_START_APP,0,hide,0,0
|
||||
db '/sys/rdsave',0
|
||||
hide db 'h',0
|
||||
asettings db 'settings',0
|
||||
aautosave db 'autosave',0
|
||||
ini_file db '/sys/settings/rdsave.ini',0
|
||||
;---------------------------------------------------------------------
|
||||
importLib:
|
||||
library \
|
||||
libini, 'libini.obj'
|
||||
|
||||
import libini, \
|
||||
ini_set_int ,'ini_set_int', \
|
||||
ini_get_int ,'ini_get_int'
|
||||
;---------------------------------------------------------------------
|
||||
checkbox_sharedname db 'CHECKBOX',0
|
||||
checkbox_img dd ?
|
||||
;---------------------------------------------------------------------
|
||||
WIN_W = 440
|
||||
WIN_H = 200
|
||||
BOT_PANEL_H = 70
|
||||
;---------------------------------------------------------------------
|
||||
CANCEL_BUTTON_ID = 1+BT_HIDE
|
||||
HOME_BUTTON_ID = 2
|
||||
REBOOT_BUTTON_ID = 3
|
||||
POWEROFF_BUTTON_ID = 4
|
||||
CHECKBOX_BUTTON_ID = 5+BT_HIDE
|
||||
;---------------------------------------------------------------------
|
||||
TEXT_HOME: db 'Home',0
|
||||
TEXT_ENTER: db 'Enter',0
|
||||
TEXT_END: db 'End',0
|
||||
TEXT_CANCEL: db 'x',0
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
; Language support for locales: ru_RU (CP866), de_DE, it_IT, en_US
|
||||
|
||||
if lang eq ru_RU
|
||||
TEXT_WTITLE: db '‡ ¢¥à襨¥ à ¡®âë',0
|
||||
TEXT_RDSAVE1: db '‘®åà ¨âì ¨§¬¥¥¨ï, ᤥ« ë¥ ¢',0
|
||||
TEXT_RDSAVE2: db '¯à®æ¥áá¥ à ¡®âë ¢ á¨á⥬¥ (Ctrl+S)',0
|
||||
TEXT_KERNEL: db 'Ÿ¤à®',0
|
||||
TEXT_REBOOT: db '<27>¥à¥§ £à㧪 ',0
|
||||
TEXT_OFF: db '‚몫î票¥',0
|
||||
TEXT_SAVING: db '‘®åà ¥¨¥ ®¡à § ...',0
|
||||
else if lang eq de_DE
|
||||
TEXT_WTITLE: db 'Shutdown computer',0
|
||||
TEXT_RDSAVE1: db 'Save all changes that were done',0
|
||||
TEXT_RDSAVE2: db 'during system work (Ctrl+S)',0
|
||||
TEXT_KERNEL: db 'Kernel',0
|
||||
TEXT_REBOOT: db 'Neustart',0
|
||||
TEXT_OFF: db 'Beenden',0
|
||||
TEXT_SAVING: db 'Saving RAM-drive...',0
|
||||
else if lang eq it_IT
|
||||
TEXT_WTITLE: db 'Shutdown computer',0
|
||||
TEXT_RDSAVE1: db 'Save all changes that were done',0
|
||||
TEXT_RDSAVE2: db 'during system work (Ctrl+S)',0
|
||||
TEXT_KERNEL: db 'Kernel',0
|
||||
TEXT_REBOOT: db 'Riavvio',0
|
||||
TEXT_OFF: db 'Spegni',0
|
||||
TEXT_SAVING: db 'Saving RAM-drive...',0
|
||||
else ; Default to en_US
|
||||
TEXT_WTITLE: db 'Shutdown computer',0
|
||||
TEXT_RDSAVE1: db 'Save all changes that were done',0
|
||||
TEXT_RDSAVE2: db 'during system work (Ctrl+S)',0
|
||||
TEXT_KERNEL: db 'Kernel',0
|
||||
TEXT_REBOOT: db 'Reboot',0
|
||||
TEXT_OFF: db 'Power off',0
|
||||
TEXT_SAVING: db 'Saving RAM-drive...',0
|
||||
end if
|
||||
;---------------------------------------------------------------------
|
||||
rdsave:
|
||||
dd SSF_START_APP,0,hide,0,0
|
||||
db '/sys/rdsave',0
|
||||
hide db 'h',0
|
||||
asettings db 'settings',0
|
||||
aautosave db 'autosave',0
|
||||
ini_file db '/sys/settings/rdsave.ini',0
|
||||
;---------------------------------------------------------------------
|
||||
importLib:
|
||||
library \
|
||||
libini, 'libini.obj'
|
||||
|
||||
import libini, \
|
||||
ini_set_int ,'ini_set_int', \
|
||||
ini_get_int ,'ini_get_int'
|
||||
;---------------------------------------------------------------------
|
||||
checkbox_sharedname db 'CHECKBOX',0
|
||||
checkbox_img dd ?
|
||||
;---------------------------------------------------------------------
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,44 +1,45 @@
|
||||
;
|
||||
; Ghost Monitor - утилита (стресс) тестирования и мониторинга системы
|
||||
; Copyright (C) 2005, 2006, 2007 Mihailov Ilia (ghost.nsk@mail.ru)
|
||||
; All Right Reserved
|
||||
|
||||
|
||||
mov edx, msg_about
|
||||
mov ebx, 17 * 65536 + 285
|
||||
call show_text
|
||||
jmp redraw
|
||||
|
||||
if lang eq it_IT
|
||||
msg_about mls \
|
||||
' Ghost Monitor',\
|
||||
'',\
|
||||
'strumento per testare il proprio hardware',\
|
||||
'',\
|
||||
'Supported SuperIO : W83627HF,W83697HF',\
|
||||
' W83627THF,W83627THF-A,W83627EHF-A,',\
|
||||
' W83637THF,IT8705F,IT8712F,SiS950',\
|
||||
' ABIT uGuru',\
|
||||
'',\
|
||||
'Test basati su R.J.Redelmeier CPUBurn',\
|
||||
'',\
|
||||
'Mailto : ghost.nsk@mail.ru',\
|
||||
'',\
|
||||
' *** Usare a prioprio rischio ***'
|
||||
else
|
||||
msg_about mls \ ; должна быть хотябы одна строка
|
||||
' Ghost Monitor',\
|
||||
'',\
|
||||
' tool for testing and monitoring hardware',\
|
||||
'',\
|
||||
'Supported SuperIO : W83627HF,W83697HF',\
|
||||
' W83627THF,W83627THF-A,W83627EHF-A,',\
|
||||
' W83637THF,IT8705F,IT8712F,SiS950',\
|
||||
' ABIT uGuru',\
|
||||
'',\
|
||||
'Tests based on R.J.Redelmeier CPUBurn',\
|
||||
'',\
|
||||
'Mailto : ghost.nsk@mail.ru',\
|
||||
'',\
|
||||
' *** Use at YOUR own RISK ***'
|
||||
end if
|
||||
;
|
||||
; Ghost Monitor - утилита (стресс) тестирования и мониторинга системы
|
||||
; Copyright (C) 2005, 2006, 2007 Mihailov Ilia (ghost.nsk@mail.ru)
|
||||
; All Right Reserved
|
||||
|
||||
; Language support for locales: it_IT, en_US.
|
||||
|
||||
mov edx, msg_about
|
||||
mov ebx, 17 * 65536 + 285
|
||||
call show_text
|
||||
jmp redraw
|
||||
|
||||
if lang eq it_IT
|
||||
msg_about mls \
|
||||
' Ghost Monitor',\
|
||||
'',\
|
||||
'strumento per testare il proprio hardware',\
|
||||
'',\
|
||||
'Supported SuperIO : W83627HF,W83697HF',\
|
||||
' W83627THF,W83627THF-A,W83627EHF-A,',\
|
||||
' W83637THF,IT8705F,IT8712F,SiS950',\
|
||||
' ABIT uGuru',\
|
||||
'',\
|
||||
'Test basati su R.J.Redelmeier CPUBurn',\
|
||||
'',\
|
||||
'Mailto : ghost.nsk@mail.ru',\
|
||||
'',\
|
||||
' *** Usare a prioprio rischio ***'
|
||||
else ; Default to en_US
|
||||
msg_about mls \ ; должна быть хотябы одна строка
|
||||
' Ghost Monitor',\
|
||||
'',\
|
||||
' tool for testing and monitoring hardware',\
|
||||
'',\
|
||||
'Supported SuperIO : W83627HF,W83697HF',\
|
||||
' W83627THF,W83627THF-A,W83627EHF-A,',\
|
||||
' W83637THF,IT8705F,IT8712F,SiS950',\
|
||||
' ABIT uGuru',\
|
||||
'',\
|
||||
'Tests based on R.J.Redelmeier CPUBurn',\
|
||||
'',\
|
||||
'Mailto : ghost.nsk@mail.ru',\
|
||||
'',\
|
||||
' *** Use at your own risk ***'
|
||||
end if
|
||||
|
@ -1,123 +1,125 @@
|
||||
;
|
||||
; Ghost Monitor - утилита (стресс) тестирования и мониторинга системы
|
||||
; Copyright (C) 2005, 2006, 2007 Mihailov Ilia (ghost.nsk@mail.ru)
|
||||
; All Right Reserved
|
||||
;
|
||||
; Вкладка тестов
|
||||
;
|
||||
; "GenuineIntel" - International Electronics
|
||||
; "GenuineTMx86" - Transmeta Processor
|
||||
; "AuthenticAMD" - Advanced Micro Devices
|
||||
; "AMD ISBETTER" - Advanced Micro Devices
|
||||
; "UMC UMC UMC " - United Microelectronics Corporation
|
||||
; "CyrixInstead" - Cyrix Processor
|
||||
; "Geode by NSC" - National Semiconductor Processor
|
||||
; "SiS SiS SiS " - SiS Processor
|
||||
; "RiseRiseRise" - Rise Processor
|
||||
; "NexGenDriven" - NexGen Processor (acquired by AMD)
|
||||
; "CentaurHauls" - IDT/Centaur, now VIA Processor
|
||||
|
||||
; Pentium (P5) button
|
||||
mov eax, 8
|
||||
mov ebx, 17 * 65536 + 145
|
||||
mov ecx, 297 * 65536 + 25
|
||||
mov edx, 6
|
||||
mov esi, tcol
|
||||
cmp byte[Vendor + 11], 'l'
|
||||
jne p5n
|
||||
cmp byte[CPU_fam], 5
|
||||
jne p5n
|
||||
mov esi, atcol
|
||||
p5n: int 0x40
|
||||
; Pentium Pro / II / III (P6) button
|
||||
add ecx, 27 * 65536
|
||||
inc edx
|
||||
mov esi, tcol
|
||||
cmp byte[Vendor + 11], 'l'
|
||||
jne p6n
|
||||
cmp byte[CPU_fam], 6
|
||||
jne p6n
|
||||
mov esi, atcol
|
||||
p6n: int 0x40
|
||||
; AMD K6 button
|
||||
add ecx, 27 * 65536
|
||||
inc edx
|
||||
mov esi, tcol
|
||||
cmp byte[Vendor], 'A'
|
||||
jne k6n
|
||||
cmp byte[CPU_fam], 5
|
||||
jne k6n
|
||||
mov esi, atcol
|
||||
k6n: int 0x40
|
||||
; AMD K7 (Athlon / Duron)
|
||||
add ecx, 27 * 65536
|
||||
inc edx
|
||||
mov esi, tcol
|
||||
cmp byte[Vendor], 'A'
|
||||
jne k7n
|
||||
cmp byte[CPU_fam], 6
|
||||
jne k7n
|
||||
mov esi, atcol
|
||||
k7n: int 0x40
|
||||
; Пишем названия кнопок
|
||||
mov eax, 4
|
||||
mov ebx, 30 * 65536 + 307
|
||||
mov esi, 7
|
||||
mov edx, tmsg_p ; P5
|
||||
xor ecx, ecx
|
||||
cmp byte[test_id], 6
|
||||
jne nr1
|
||||
mov ecx, 0xFF0000
|
||||
nr1: int 0x40
|
||||
add ebx, 27
|
||||
mov esi, 20 ; P6
|
||||
xor ecx, ecx
|
||||
cmp byte[test_id], 7
|
||||
jne nr2
|
||||
mov ecx, 0xFF0000
|
||||
nr2: int 0x40
|
||||
add ebx, 27
|
||||
mov edx, tmsg_k6 ; K6
|
||||
mov esi, 13
|
||||
xor ecx, ecx
|
||||
cmp byte[test_id], 8
|
||||
jne nr3
|
||||
mov ecx, 0xFF0000
|
||||
nr3: int 0x40
|
||||
add ebx, 27
|
||||
mov edx, tmsg_k7 ; K7
|
||||
mov esi, 15
|
||||
xor ecx, ecx
|
||||
cmp byte[test_id], 9
|
||||
jne nr4
|
||||
mov ecx, 0xFF0000
|
||||
nr4: int 0x40
|
||||
xor ecx, ecx
|
||||
mov ebx, 190 * 65536 + 420
|
||||
mov edx, tmsg_rec
|
||||
mov esi, 11
|
||||
int 0x40
|
||||
; read about
|
||||
mov ebx, 30 * 65536 + 282
|
||||
mov edx, tmsg_war
|
||||
mov esi, 35
|
||||
mov ecx, 0xFF0000
|
||||
int 0x40
|
||||
; recommendate color
|
||||
mov eax, 13
|
||||
mov ebx, 170 * 65536 + 10
|
||||
mov ecx, 418 * 65536 + 10
|
||||
mov edx, atcol
|
||||
int 0x40
|
||||
|
||||
jmp redraw
|
||||
|
||||
tmsg_p db 'Pentium (Pro/II/III)' ; 7/20
|
||||
tmsg_k6 db 'K6 (I/II/III)' ; 13
|
||||
tmsg_k7 db 'K7/Athlon/Duron' ; 15
|
||||
tmsg_rec db 'recommended' ; 11
|
||||
if lang eq it_IT
|
||||
tmsg_war db 'Potrebbe danneggiare lo hardware '
|
||||
else
|
||||
tmsg_war db 'May permanently damage the hardware'
|
||||
end if
|
||||
;
|
||||
; Ghost Monitor - утилита (стресс) тестирования и мониторинга системы
|
||||
; Copyright (C) 2005, 2006, 2007 Mihailov Ilia (ghost.nsk@mail.ru)
|
||||
; All Right Reserved
|
||||
;
|
||||
; Вкладка тестов
|
||||
|
||||
; Language support for locales: it_IT, en_US.
|
||||
|
||||
; "GenuineIntel" - International Electronics
|
||||
; "GenuineTMx86" - Transmeta Processor
|
||||
; "AuthenticAMD" - Advanced Micro Devices
|
||||
; "AMD ISBETTER" - Advanced Micro Devices
|
||||
; "UMC UMC UMC " - United Microelectronics Corporation
|
||||
; "CyrixInstead" - Cyrix Processor
|
||||
; "Geode by NSC" - National Semiconductor Processor
|
||||
; "SiS SiS SiS " - SiS Processor
|
||||
; "RiseRiseRise" - Rise Processor
|
||||
; "NexGenDriven" - NexGen Processor (acquired by AMD)
|
||||
; "CentaurHauls" - IDT/Centaur, now VIA Processor
|
||||
|
||||
; Pentium (P5) button
|
||||
mov eax, 8
|
||||
mov ebx, 17 * 65536 + 145
|
||||
mov ecx, 297 * 65536 + 25
|
||||
mov edx, 6
|
||||
mov esi, tcol
|
||||
cmp byte[Vendor + 11], 'l'
|
||||
jne p5n
|
||||
cmp byte[CPU_fam], 5
|
||||
jne p5n
|
||||
mov esi, atcol
|
||||
p5n: int 0x40
|
||||
; Pentium Pro / II / III (P6) button
|
||||
add ecx, 27 * 65536
|
||||
inc edx
|
||||
mov esi, tcol
|
||||
cmp byte[Vendor + 11], 'l'
|
||||
jne p6n
|
||||
cmp byte[CPU_fam], 6
|
||||
jne p6n
|
||||
mov esi, atcol
|
||||
p6n: int 0x40
|
||||
; AMD K6 button
|
||||
add ecx, 27 * 65536
|
||||
inc edx
|
||||
mov esi, tcol
|
||||
cmp byte[Vendor], 'A'
|
||||
jne k6n
|
||||
cmp byte[CPU_fam], 5
|
||||
jne k6n
|
||||
mov esi, atcol
|
||||
k6n: int 0x40
|
||||
; AMD K7 (Athlon / Duron)
|
||||
add ecx, 27 * 65536
|
||||
inc edx
|
||||
mov esi, tcol
|
||||
cmp byte[Vendor], 'A'
|
||||
jne k7n
|
||||
cmp byte[CPU_fam], 6
|
||||
jne k7n
|
||||
mov esi, atcol
|
||||
k7n: int 0x40
|
||||
; Пишем названия кнопок
|
||||
mov eax, 4
|
||||
mov ebx, 30 * 65536 + 307
|
||||
mov esi, 7
|
||||
mov edx, tmsg_p ; P5
|
||||
xor ecx, ecx
|
||||
cmp byte[test_id], 6
|
||||
jne nr1
|
||||
mov ecx, 0xFF0000
|
||||
nr1: int 0x40
|
||||
add ebx, 27
|
||||
mov esi, 20 ; P6
|
||||
xor ecx, ecx
|
||||
cmp byte[test_id], 7
|
||||
jne nr2
|
||||
mov ecx, 0xFF0000
|
||||
nr2: int 0x40
|
||||
add ebx, 27
|
||||
mov edx, tmsg_k6 ; K6
|
||||
mov esi, 13
|
||||
xor ecx, ecx
|
||||
cmp byte[test_id], 8
|
||||
jne nr3
|
||||
mov ecx, 0xFF0000
|
||||
nr3: int 0x40
|
||||
add ebx, 27
|
||||
mov edx, tmsg_k7 ; K7
|
||||
mov esi, 15
|
||||
xor ecx, ecx
|
||||
cmp byte[test_id], 9
|
||||
jne nr4
|
||||
mov ecx, 0xFF0000
|
||||
nr4: int 0x40
|
||||
xor ecx, ecx
|
||||
mov ebx, 190 * 65536 + 420
|
||||
mov edx, tmsg_rec
|
||||
mov esi, 11
|
||||
int 0x40
|
||||
; read about
|
||||
mov ebx, 30 * 65536 + 282
|
||||
mov edx, tmsg_war
|
||||
mov esi, 35
|
||||
mov ecx, 0xFF0000
|
||||
int 0x40
|
||||
; recommendate color
|
||||
mov eax, 13
|
||||
mov ebx, 170 * 65536 + 10
|
||||
mov ecx, 418 * 65536 + 10
|
||||
mov edx, atcol
|
||||
int 0x40
|
||||
|
||||
jmp redraw
|
||||
|
||||
tmsg_p db 'Pentium (Pro/II/III)' ; 7/20
|
||||
tmsg_k6 db 'K6 (I/II/III)' ; 13
|
||||
tmsg_k7 db 'K7/Athlon/Duron' ; 15
|
||||
tmsg_rec db 'recommended' ; 11
|
||||
if lang eq it_IT
|
||||
tmsg_war db 'Potrebbe danneggiare lo hardware '
|
||||
else ; Default to en_US
|
||||
tmsg_war db 'May permanently damage the hardware'
|
||||
end if
|
||||
|
@ -1,206 +1,209 @@
|
||||
;------------------------------------------------------------------------------
|
||||
tl dd 8
|
||||
yw: dd 51
|
||||
ya dd 0
|
||||
cur_btn dd 40
|
||||
;------------------------------------------------------------------------------
|
||||
; 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_RU
|
||||
text:
|
||||
db 255,255,255,0, ' ’…Š‘’ '
|
||||
db 255,255,255,0, ' <20><>Žƒ<C5BD>€ŒŒ€ '
|
||||
db 255,255,255,0, ' <20>€<EFBFBD>€Œ…’<E280A6>› '
|
||||
db 255,255,255,0, ' <20><>ˆŒ…<C592>ˆ’œ '
|
||||
db 255,255,255,0, ' „Ž<E2809E>€‚ˆ’œ “„€‹ˆ’œ '
|
||||
db 0,0,0,0, '<27>€†Œˆ’… <20>€ <20>Ž‡ˆ–ˆž ˆŠŽ<C5A0>Šˆ „‹Ÿ <20>…„€Š’ˆ<E28099>Ž‚€<E2809A>ˆŸ '
|
||||
db 'x' ; <- END MARKER, DONT DELETE
|
||||
|
||||
add_text db '<27>€†Œˆ’… <20>€ <20>Ž‡ˆ–ˆž <20>…ˆ‘<CB86>Ž‹œ‡“…ŒŽ‰ ˆŠŽ<C5A0>Šˆ ',0
|
||||
rem_text db '<27>€†Œˆ’… <20>€ <20>Ž‡ˆ–ˆž ˆ‘<CB86>Ž‹œ‡“…ŒŽ‰ ˆŠŽ<C5A0>Šˆ ',0
|
||||
title db 'Œ¥¥¤¦¥à ¨ª®®ª',0
|
||||
|
||||
else if lang eq de_DE
|
||||
text:
|
||||
db 255,255,255,0, ' TITLE '
|
||||
db 255,255,255,0, ' APP NAME '
|
||||
db 255,255,255,0, ' PARAMETER '
|
||||
db 255,255,255,0, ' ANWENDEN '
|
||||
db 255,255,255,0, ' HINZUFUEGEN ENTFERNEN '
|
||||
db 0,0,0,0, 'AUF BUTTON KLICKEN, UM ICON ZU EDITIEREN '
|
||||
db 'x' ; <- END MARKER, DONT DELETE
|
||||
|
||||
add_text db 'AUF UNBENUTZTE ICONPOSITION KLICKEN ',0
|
||||
rem_text db 'ICON ANKLICKEN; DAS GELOESCHT WERDEN SOLL ',0
|
||||
title db 'Icon Manager',0
|
||||
|
||||
else if lang eq it_IT
|
||||
text:
|
||||
db 255,255,255,0, 'Titolo '
|
||||
db 255,255,255,0, 'Nome app '
|
||||
db 255,255,255,0, 'Parametri '
|
||||
db 255,255,255,0, ' Applica modifiche '
|
||||
db 255,255,255,0, ' Aggiungi Rimuovi '
|
||||
db 0,0,0,0, 'Clicca sull icona per effettuare modifiche '
|
||||
db 'x' ; <- END MARKER, DONT DELETE
|
||||
|
||||
add_text db 'Clicca su una posizione non usata ',0
|
||||
rem_text db 'Cliccare sull icona da rimuovere ',0
|
||||
title db 'Gestore Icone',0
|
||||
|
||||
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, 'CLICK BUTTON ON ICON POSITION FOR EDIT '
|
||||
db 'x' ; <- END MARKER, DONT DELETE
|
||||
add_text db 'CLICK ON A NOT USED POSITION ',0
|
||||
rem_text db 'CLICK ICON POSITION; YOU WANT TO DELETE ',0
|
||||
title db 'Icon Manager',0
|
||||
|
||||
end if
|
||||
;------------------------------------------------------------------------------
|
||||
arrows db '</>'
|
||||
;------------------------------------------------------------------------------
|
||||
iconname:
|
||||
db ICON_APP,0
|
||||
;------------------------------------------------------------------------------
|
||||
icon_default:
|
||||
db 'AA-CALC -004-/SYS/CALC '
|
||||
db '- *'
|
||||
db 13,10
|
||||
;------------------------------------------------------------------------------
|
||||
rep_text:
|
||||
if lang eq ru_RU
|
||||
db '‡<>€—Šˆ - ˆ‡ , ‚›<E2809A><E280BA>€<EFBFBD> #'
|
||||
;else if lang eq it_IT
|
||||
; db 'Icone - di , Selezionate'
|
||||
else
|
||||
db 'ICONS - OF , SELECTED'
|
||||
end if
|
||||
|
||||
rep_text_len:
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
finfo_start:
|
||||
dd 7
|
||||
dd 0
|
||||
.params dd 0
|
||||
dd 0
|
||||
dd 0
|
||||
db 0
|
||||
dd finfo.path
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
finfo:
|
||||
dd 5
|
||||
dd 0
|
||||
dd 0
|
||||
.size dd 0
|
||||
.point dd procinfo
|
||||
.path:
|
||||
db ICON_STRIP,0
|
||||
rb 31-($-.path)
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
positions dd 3,16,47
|
||||
str_lens db 8,30,30
|
||||
|
||||
current_icon dd icon_data
|
||||
|
||||
iconlst db ICONS_DAT,0
|
||||
|
||||
;image dd image_area
|
||||
;------------------------------------------------------------------------------
|
||||
; not change this section!!!
|
||||
; start section
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
image_file dd 0 ;+0
|
||||
raw_pointer dd 0 ;+4
|
||||
return_code dd 0 ;+8
|
||||
img_size dd 0 ;+12
|
||||
deflate_unpack dd 0 ;+16 ; not use for scaling
|
||||
raw_pointer_2 dd 0 ;+20 ; not use for scaling
|
||||
;------------------------------------------------------------------------------
|
||||
; end section
|
||||
;------------------------------------------------------------------------------
|
||||
system_dir_CnvPNG db '/sys/lib/cnv_png.obj',0
|
||||
system_dir_UNPACK db '/sys/lib/archiver.obj',0
|
||||
|
||||
;plugins_directory db 'plugins/',0
|
||||
plugins_directory db 0
|
||||
;------------------------------------------------------------------------------
|
||||
l_libs_start:
|
||||
|
||||
library01 l_libs system_dir_CnvPNG+9,library_path,system_dir_CnvPNG,\
|
||||
cnv_png_import,plugins_directory
|
||||
|
||||
library02 l_libs system_dir_UNPACK+9,library_path,system_dir_UNPACK,\
|
||||
UNPACK_import,plugins_directory
|
||||
|
||||
end_l_libs:
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
cnv_png_import:
|
||||
.Start dd aCP_Start
|
||||
.Version dd aCP_Version
|
||||
.Check dd aCP_Check
|
||||
.Assoc dd aCP_Assoc
|
||||
dd 0
|
||||
dd 0
|
||||
aCP_Start db 'START',0
|
||||
aCP_Version db 'version',0
|
||||
aCP_Check db 'Check_Header',0
|
||||
aCP_Assoc db 'Associations',0
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
UNPACK_import:
|
||||
;unpack_Version dd aUnpack_Version
|
||||
;unpack_PluginLoad dd aUnpack_PluginLoad
|
||||
;unpack_OpenFilePlugin dd aUnpack_OpenFilePlugin
|
||||
;unpack_ClosePlugin dd aUnpack_ClosePlugin
|
||||
;unpack_ReadFolder dd aUnpack_ReadFolder
|
||||
;unpack_SetFolder dd aUnpack_SetFolder
|
||||
;unpack_GetFiles dd aUnpack_GetFiles
|
||||
;unpack_GetOpenPluginInfo dd aUnpack_GetOpenPluginInfo
|
||||
;unpack_Getattr dd aUnpack_Getattr
|
||||
;unpack_Open dd aUnpack_Open
|
||||
;unpack_Read dd aUnpack_Read
|
||||
;unpack_Setpos dd aUnpack_Setpos
|
||||
;unpack_Close dd aUnpack_Close
|
||||
;unpack_DeflateUnpack dd aUnpack_DeflateUnpack
|
||||
unpack_DeflateUnpack2 dd aUnpack_DeflateUnpack2
|
||||
dd 0
|
||||
dd 0
|
||||
|
||||
;aUnpack_Version db 'version',0
|
||||
;aUnpack_PluginLoad db 'plugin_load',0
|
||||
;aUnpack_OpenFilePlugin db 'OpenFilePlugin',0
|
||||
;aUnpack_ClosePlugin db 'ClosePlugin',0
|
||||
;aUnpack_ReadFolder db 'ReadFolder',0
|
||||
;aUnpack_SetFolder db 'SetFolder',0
|
||||
;aUnpack_GetFiles db 'GetFiles',0
|
||||
;aUnpack_GetOpenPluginInfo db 'GetOpenPluginInfo',0
|
||||
;aUnpack_Getattr db 'getattr',0
|
||||
;aUnpack_Open db 'open',0
|
||||
;aUnpack_Read db 'read',0
|
||||
;aUnpack_Setpos db 'setpos',0
|
||||
;aUnpack_Close db 'close',0
|
||||
;aUnpack_DeflateUnpack db 'deflate_unpack',0
|
||||
aUnpack_DeflateUnpack2 db 'deflate_unpack2',0
|
||||
;------------------------------------------------------------------------------
|
||||
;------------------------------------------------------------------------------
|
||||
tl dd 8
|
||||
yw: dd 51
|
||||
ya dd 0
|
||||
cur_btn dd 40
|
||||
;------------------------------------------------------------------------------
|
||||
; 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 ' '
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
; Language support for locales: ru_RU (CP866), de_DE, it_IT, en_US
|
||||
|
||||
if lang eq ru_RU
|
||||
text:
|
||||
db 255,255,255,0, ' ’…Š‘’ '
|
||||
db 255,255,255,0, ' <20><>Žƒ<C5BD>€ŒŒ€ '
|
||||
db 255,255,255,0, ' <20>€<EFBFBD>€Œ…’<E280A6>› '
|
||||
db 255,255,255,0, ' <20><>ˆŒ…<C592>ˆ’œ '
|
||||
db 255,255,255,0, ' „Ž<E2809E>€‚ˆ’œ “„€‹ˆ’œ '
|
||||
db 0,0,0,0, '<27>€†Œˆ’… <20>€ <20>Ž‡ˆ–ˆž ˆŠŽ<C5A0>Šˆ „‹Ÿ <20>…„€Š’ˆ<E28099>Ž‚€<E2809A>ˆŸ '
|
||||
db 'x' ; <- END MARKER, DO NOT DELETE
|
||||
|
||||
add_text db '<27>€†Œˆ’… <20>€ <20>Ž‡ˆ–ˆž <20>…ˆ‘<CB86>Ž‹œ‡“…ŒŽ‰ ˆŠŽ<C5A0>Šˆ ',0
|
||||
rem_text db '<27>€†Œˆ’… <20>€ <20>Ž‡ˆ–ˆž ˆ‘<CB86>Ž‹œ‡“…ŒŽ‰ ˆŠŽ<C5A0>Šˆ ',0
|
||||
title db 'Œ¥¥¤¦¥à ¨ª®®ª',0
|
||||
|
||||
else if lang eq de_DE
|
||||
text:
|
||||
db 255,255,255,0, ' TITLE '
|
||||
db 255,255,255,0, ' APP NAME '
|
||||
db 255,255,255,0, ' PARAMETER '
|
||||
db 255,255,255,0, ' ANWENDEN '
|
||||
db 255,255,255,0, ' HINZUFUEGEN ENTFERNEN '
|
||||
db 0,0,0,0, 'AUF BUTTON KLICKEN, UM ICON ZU EDITIEREN '
|
||||
db 'x' ; <- END MARKER, DO NOT DELETE
|
||||
|
||||
add_text db 'AUF UNBENUTZTE ICONPOSITION KLICKEN ',0
|
||||
rem_text db 'ICON ANKLICKEN; DAS GELOESCHT WERDEN SOLL ',0
|
||||
title db 'Icon Manager',0
|
||||
|
||||
else if lang eq it_IT
|
||||
text:
|
||||
db 255,255,255,0, 'Titolo '
|
||||
db 255,255,255,0, 'Nome app '
|
||||
db 255,255,255,0, 'Parametri '
|
||||
db 255,255,255,0, ' Applica modifiche '
|
||||
db 255,255,255,0, ' Aggiungi Rimuovi '
|
||||
db 0,0,0,0, 'Clicca sull icona per effettuare modifiche '
|
||||
db 'x' ; <- END MARKER, DO NOT DELETE
|
||||
|
||||
add_text db 'Clicca su una posizione non usata ',0
|
||||
rem_text db 'Cliccare sull icona da rimuovere ',0
|
||||
title db 'Gestore Icone',0
|
||||
|
||||
else ; Default to en_US
|
||||
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, 'CLICK BUTTON ON ICON POSITION FOR EDIT '
|
||||
db 'x' ; <- END MARKER, DO NOT DELETE
|
||||
add_text db 'CLICK ON A NOT USED POSITION ',0
|
||||
rem_text db 'CLICK ICON POSITION; YOU WANT TO DELETE ',0
|
||||
title db 'Icon Manager',0
|
||||
|
||||
end if
|
||||
;------------------------------------------------------------------------------
|
||||
arrows db '</>'
|
||||
;------------------------------------------------------------------------------
|
||||
iconname:
|
||||
db ICON_APP,0
|
||||
;------------------------------------------------------------------------------
|
||||
icon_default:
|
||||
db 'AA-CALC -004-/SYS/CALC '
|
||||
db '- *'
|
||||
db 13,10
|
||||
;------------------------------------------------------------------------------
|
||||
rep_text:
|
||||
if lang eq ru_RU
|
||||
db '‡<>€—Šˆ - ˆ‡ , ‚›<E2809A><E280BA>€<EFBFBD> #'
|
||||
;else if lang eq it_IT
|
||||
; db 'Icone - di , Selezionate'
|
||||
else ; Default to en_US
|
||||
db 'ICONS - OF , SELECTED'
|
||||
end if
|
||||
|
||||
rep_text_len:
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
finfo_start:
|
||||
dd 7
|
||||
dd 0
|
||||
.params dd 0
|
||||
dd 0
|
||||
dd 0
|
||||
db 0
|
||||
dd finfo.path
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
finfo:
|
||||
dd 5
|
||||
dd 0
|
||||
dd 0
|
||||
.size dd 0
|
||||
.point dd procinfo
|
||||
.path:
|
||||
db ICON_STRIP,0
|
||||
rb 31-($-.path)
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
positions dd 3,16,47
|
||||
str_lens db 8,30,30
|
||||
|
||||
current_icon dd icon_data
|
||||
|
||||
iconlst db ICONS_DAT,0
|
||||
|
||||
;image dd image_area
|
||||
;------------------------------------------------------------------------------
|
||||
; not change this section!!!
|
||||
; start section
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
image_file dd 0 ;+0
|
||||
raw_pointer dd 0 ;+4
|
||||
return_code dd 0 ;+8
|
||||
img_size dd 0 ;+12
|
||||
deflate_unpack dd 0 ;+16 ; not use for scaling
|
||||
raw_pointer_2 dd 0 ;+20 ; not use for scaling
|
||||
;------------------------------------------------------------------------------
|
||||
; end section
|
||||
;------------------------------------------------------------------------------
|
||||
system_dir_CnvPNG db '/sys/lib/cnv_png.obj',0
|
||||
system_dir_UNPACK db '/sys/lib/archiver.obj',0
|
||||
|
||||
;plugins_directory db 'plugins/',0
|
||||
plugins_directory db 0
|
||||
;------------------------------------------------------------------------------
|
||||
l_libs_start:
|
||||
|
||||
library01 l_libs system_dir_CnvPNG+9,library_path,system_dir_CnvPNG,\
|
||||
cnv_png_import,plugins_directory
|
||||
|
||||
library02 l_libs system_dir_UNPACK+9,library_path,system_dir_UNPACK,\
|
||||
UNPACK_import,plugins_directory
|
||||
|
||||
end_l_libs:
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
cnv_png_import:
|
||||
.Start dd aCP_Start
|
||||
.Version dd aCP_Version
|
||||
.Check dd aCP_Check
|
||||
.Assoc dd aCP_Assoc
|
||||
dd 0
|
||||
dd 0
|
||||
aCP_Start db 'START',0
|
||||
aCP_Version db 'version',0
|
||||
aCP_Check db 'Check_Header',0
|
||||
aCP_Assoc db 'Associations',0
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
UNPACK_import:
|
||||
;unpack_Version dd aUnpack_Version
|
||||
;unpack_PluginLoad dd aUnpack_PluginLoad
|
||||
;unpack_OpenFilePlugin dd aUnpack_OpenFilePlugin
|
||||
;unpack_ClosePlugin dd aUnpack_ClosePlugin
|
||||
;unpack_ReadFolder dd aUnpack_ReadFolder
|
||||
;unpack_SetFolder dd aUnpack_SetFolder
|
||||
;unpack_GetFiles dd aUnpack_GetFiles
|
||||
;unpack_GetOpenPluginInfo dd aUnpack_GetOpenPluginInfo
|
||||
;unpack_Getattr dd aUnpack_Getattr
|
||||
;unpack_Open dd aUnpack_Open
|
||||
;unpack_Read dd aUnpack_Read
|
||||
;unpack_Setpos dd aUnpack_Setpos
|
||||
;unpack_Close dd aUnpack_Close
|
||||
;unpack_DeflateUnpack dd aUnpack_DeflateUnpack
|
||||
unpack_DeflateUnpack2 dd aUnpack_DeflateUnpack2
|
||||
dd 0
|
||||
dd 0
|
||||
|
||||
;aUnpack_Version db 'version',0
|
||||
;aUnpack_PluginLoad db 'plugin_load',0
|
||||
;aUnpack_OpenFilePlugin db 'OpenFilePlugin',0
|
||||
;aUnpack_ClosePlugin db 'ClosePlugin',0
|
||||
;aUnpack_ReadFolder db 'ReadFolder',0
|
||||
;aUnpack_SetFolder db 'SetFolder',0
|
||||
;aUnpack_GetFiles db 'GetFiles',0
|
||||
;aUnpack_GetOpenPluginInfo db 'GetOpenPluginInfo',0
|
||||
;aUnpack_Getattr db 'getattr',0
|
||||
;aUnpack_Open db 'open',0
|
||||
;aUnpack_Read db 'read',0
|
||||
;aUnpack_Setpos db 'setpos',0
|
||||
;aUnpack_Close db 'close',0
|
||||
;aUnpack_DeflateUnpack db 'deflate_unpack',0
|
||||
aUnpack_DeflateUnpack2 db 'deflate_unpack2',0
|
||||
;------------------------------------------------------------------------------
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,198 +1,198 @@
|
||||
; Keyboard indicators v0.2
|
||||
; by Albom and IgorA
|
||||
|
||||
use32
|
||||
org 0
|
||||
db 'MENUET01'
|
||||
dd 1
|
||||
dd _start
|
||||
dd _end
|
||||
dd _memory
|
||||
dd stacktop
|
||||
dd 0
|
||||
dd sys_path
|
||||
|
||||
include '../../macros.inc'
|
||||
include '../../proc32.inc'
|
||||
include '../../develop/libraries/box_lib/load_lib.mac'
|
||||
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
;include 'mem.inc'
|
||||
;include 'dll.inc'
|
||||
include 'lang.inc'
|
||||
|
||||
@use_library ;_mem mem.Alloc,mem.Free,mem.ReAlloc, dll.Load
|
||||
|
||||
align 4
|
||||
_start:
|
||||
load_libraries l_libs_start,l_libs_end
|
||||
mcall 48,3,sc,sizeof.system_colors
|
||||
mcall 40,0x27
|
||||
|
||||
init_checkboxes2 check_boxes,check_boxes_end
|
||||
check_boxes_set_sys_color2 check_boxes,check_boxes_end,sc
|
||||
call _key_set
|
||||
|
||||
align 4
|
||||
red_win:
|
||||
call draw_window
|
||||
|
||||
|
||||
align 4
|
||||
still:
|
||||
mcall 10
|
||||
|
||||
cmp al,1 ;èçì. ïîëîæåíèå îêíà
|
||||
jz red_win
|
||||
cmp al,2
|
||||
jz key
|
||||
cmp al,3
|
||||
jz button
|
||||
|
||||
;stdcall [check_box_mouse], ch1
|
||||
;stdcall [check_box_mouse], ch2
|
||||
;stdcall [check_box_mouse], ch3
|
||||
|
||||
jmp still
|
||||
|
||||
;óñòàíîâèòü îáùåñèñòåìíûå "ãîðÿ÷èå êëàâèøè"
|
||||
align 4
|
||||
_key_set:
|
||||
mov eax, 66
|
||||
mov ebx, 4
|
||||
mov edx, 0
|
||||
mov cl, 69
|
||||
int 0x40
|
||||
|
||||
mov eax, 66
|
||||
mov ebx, 4
|
||||
mov edx, 0
|
||||
mov cl, 58
|
||||
int 0x40
|
||||
|
||||
mov eax, 66
|
||||
mov ebx, 4
|
||||
mov edx, 0
|
||||
mov cl, 70
|
||||
int 0x40
|
||||
|
||||
ret
|
||||
|
||||
align 4
|
||||
draw_window:
|
||||
pushad
|
||||
mcall 12,1
|
||||
mov edx, [sc.work]
|
||||
or edx, 0x34000000
|
||||
mcall 0, (10 shl 16)+100, (10 shl 16)+75
|
||||
|
||||
stdcall [check_box_draw], ch1
|
||||
stdcall [check_box_draw], ch2
|
||||
stdcall [check_box_draw], ch3
|
||||
mcall 12,2
|
||||
popad
|
||||
ret
|
||||
|
||||
align 4
|
||||
key:
|
||||
mcall 2
|
||||
call _indicators_check
|
||||
jmp still
|
||||
|
||||
align 4
|
||||
_indicators_check:
|
||||
pusha
|
||||
mov eax, 66
|
||||
mov ebx, 3
|
||||
int 40h
|
||||
|
||||
test_ins:
|
||||
test eax, 0x80
|
||||
jz @f
|
||||
bts dword[ch1.flags],1
|
||||
jmp test_caps
|
||||
@@:
|
||||
btr dword[ch1.flags],1
|
||||
|
||||
test_caps:
|
||||
test eax, 0x40
|
||||
jz @f
|
||||
bts dword[ch2.flags],1
|
||||
jmp test_scroll
|
||||
@@:
|
||||
btr dword[ch2.flags],1
|
||||
|
||||
test_scroll:
|
||||
test eax, 0x100
|
||||
jz @f
|
||||
bts dword[ch3.flags],1
|
||||
jmp test_ok
|
||||
@@:
|
||||
btr dword[ch3.flags],1
|
||||
|
||||
test_ok:
|
||||
call draw_window
|
||||
popa
|
||||
ret
|
||||
|
||||
align 4
|
||||
button:
|
||||
mcall 17
|
||||
cmp ah,1
|
||||
jne still
|
||||
.exit:
|
||||
mcall -1
|
||||
|
||||
|
||||
check_boxes:
|
||||
ch1 check_box2 (5 shl 16)+15,(5 shl 16)+10,5, 0xffffff,0x8000,0xff,\
|
||||
txt_160,0+ch_flag_middle
|
||||
ch2 check_box2 (5 shl 16)+15,(17 shl 16)+10,5, 0xffffff,0x8000,0xff,\
|
||||
txt_159,0+ch_flag_middle
|
||||
ch3 check_box2 (5 shl 16)+15,(29 shl 16)+10,5, 0xffffff,0x8000,0xff,\
|
||||
txt_158,0+ch_flag_middle
|
||||
check_boxes_end:
|
||||
|
||||
if lang eq it_IT
|
||||
txt_160 db 'Bloc Num',0
|
||||
txt_159 db 'Bloc Maiusc',0
|
||||
txt_158 db 'Bloc Scorr',0
|
||||
else
|
||||
txt_160 db 'Num',0
|
||||
txt_159 db 'Caps',0
|
||||
txt_158 db 'Scroll',0
|
||||
end if
|
||||
head_f_i:
|
||||
head_f_l db 'Ñèñòåìíàÿ îøèáêà',0
|
||||
|
||||
system_dir_0 db '/sys/lib/'
|
||||
lib_name_0 db 'box_lib.obj',0
|
||||
err_msg_found_lib_0 db 'Íå íàéäåíà áèáëèîòåêà box_lib.obj',0
|
||||
err_msg_import_0 db 'Îøèáêà ïðè èìïîðòå áèáëèîòåêè box_lib',0
|
||||
|
||||
l_libs_start:
|
||||
lib_0 l_libs lib_name_0, sys_path, library_path, system_dir_0,\
|
||||
err_msg_found_lib_0,head_f_l,import_box_lib,err_msg_import_0,head_f_i
|
||||
l_libs_end:
|
||||
|
||||
align 4
|
||||
import_box_lib:
|
||||
;init dd sz_init
|
||||
init_checkbox dd sz_init_checkbox
|
||||
check_box_draw dd sz_check_box_draw
|
||||
check_box_mouse dd sz_check_box_mouse
|
||||
dd 0,0
|
||||
;sz_init db 'lib_init',0
|
||||
sz_init_checkbox db 'init_checkbox2',0
|
||||
sz_check_box_draw db 'check_box_draw2',0
|
||||
sz_check_box_mouse db 'check_box_mouse2',0
|
||||
|
||||
;mouse_dd dd 0x0
|
||||
sc system_colors
|
||||
|
||||
_end:
|
||||
align 32
|
||||
rb 2048
|
||||
stacktop:
|
||||
sys_path rb 1024
|
||||
library_path rb 1024
|
||||
_memory:
|
||||
; Keyboard indicators v0.2
|
||||
; by Albom and IgorA
|
||||
|
||||
use32
|
||||
org 0
|
||||
db 'MENUET01'
|
||||
dd 1
|
||||
dd _start
|
||||
dd _end
|
||||
dd _memory
|
||||
dd stacktop
|
||||
dd 0
|
||||
dd sys_path
|
||||
|
||||
include '../../macros.inc'
|
||||
include '../../proc32.inc'
|
||||
include '../../develop/libraries/box_lib/load_lib.mac'
|
||||
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
;include 'mem.inc'
|
||||
;include 'dll.inc'
|
||||
include 'lang.inc' ; Language support for locales: it_IT, en_US.
|
||||
|
||||
@use_library ;_mem mem.Alloc,mem.Free,mem.ReAlloc, dll.Load
|
||||
|
||||
align 4
|
||||
_start:
|
||||
load_libraries l_libs_start,l_libs_end
|
||||
mcall 48,3,sc,sizeof.system_colors
|
||||
mcall 40,0x27
|
||||
|
||||
init_checkboxes2 check_boxes,check_boxes_end
|
||||
check_boxes_set_sys_color2 check_boxes,check_boxes_end,sc
|
||||
call _key_set
|
||||
|
||||
align 4
|
||||
red_win:
|
||||
call draw_window
|
||||
|
||||
|
||||
align 4
|
||||
still:
|
||||
mcall 10
|
||||
|
||||
cmp al,1 ;èçì. ïîëîæåíèå îêíà
|
||||
jz red_win
|
||||
cmp al,2
|
||||
jz key
|
||||
cmp al,3
|
||||
jz button
|
||||
|
||||
;stdcall [check_box_mouse], ch1
|
||||
;stdcall [check_box_mouse], ch2
|
||||
;stdcall [check_box_mouse], ch3
|
||||
|
||||
jmp still
|
||||
|
||||
;óñòàíîâèòü îáùåñèñòåìíûå "ãîðÿ÷èå êëàâèøè"
|
||||
align 4
|
||||
_key_set:
|
||||
mov eax, 66
|
||||
mov ebx, 4
|
||||
mov edx, 0
|
||||
mov cl, 69
|
||||
int 0x40
|
||||
|
||||
mov eax, 66
|
||||
mov ebx, 4
|
||||
mov edx, 0
|
||||
mov cl, 58
|
||||
int 0x40
|
||||
|
||||
mov eax, 66
|
||||
mov ebx, 4
|
||||
mov edx, 0
|
||||
mov cl, 70
|
||||
int 0x40
|
||||
|
||||
ret
|
||||
|
||||
align 4
|
||||
draw_window:
|
||||
pushad
|
||||
mcall 12,1
|
||||
mov edx, [sc.work]
|
||||
or edx, 0x34000000
|
||||
mcall 0, (10 shl 16)+100, (10 shl 16)+75
|
||||
|
||||
stdcall [check_box_draw], ch1
|
||||
stdcall [check_box_draw], ch2
|
||||
stdcall [check_box_draw], ch3
|
||||
mcall 12,2
|
||||
popad
|
||||
ret
|
||||
|
||||
align 4
|
||||
key:
|
||||
mcall 2
|
||||
call _indicators_check
|
||||
jmp still
|
||||
|
||||
align 4
|
||||
_indicators_check:
|
||||
pusha
|
||||
mov eax, 66
|
||||
mov ebx, 3
|
||||
int 40h
|
||||
|
||||
test_ins:
|
||||
test eax, 0x80
|
||||
jz @f
|
||||
bts dword[ch1.flags],1
|
||||
jmp test_caps
|
||||
@@:
|
||||
btr dword[ch1.flags],1
|
||||
|
||||
test_caps:
|
||||
test eax, 0x40
|
||||
jz @f
|
||||
bts dword[ch2.flags],1
|
||||
jmp test_scroll
|
||||
@@:
|
||||
btr dword[ch2.flags],1
|
||||
|
||||
test_scroll:
|
||||
test eax, 0x100
|
||||
jz @f
|
||||
bts dword[ch3.flags],1
|
||||
jmp test_ok
|
||||
@@:
|
||||
btr dword[ch3.flags],1
|
||||
|
||||
test_ok:
|
||||
call draw_window
|
||||
popa
|
||||
ret
|
||||
|
||||
align 4
|
||||
button:
|
||||
mcall 17
|
||||
cmp ah,1
|
||||
jne still
|
||||
.exit:
|
||||
mcall -1
|
||||
|
||||
|
||||
check_boxes:
|
||||
ch1 check_box2 (5 shl 16)+15,(5 shl 16)+10,5, 0xffffff,0x8000,0xff,\
|
||||
txt_160,0+ch_flag_middle
|
||||
ch2 check_box2 (5 shl 16)+15,(17 shl 16)+10,5, 0xffffff,0x8000,0xff,\
|
||||
txt_159,0+ch_flag_middle
|
||||
ch3 check_box2 (5 shl 16)+15,(29 shl 16)+10,5, 0xffffff,0x8000,0xff,\
|
||||
txt_158,0+ch_flag_middle
|
||||
check_boxes_end:
|
||||
|
||||
if lang eq it_IT
|
||||
txt_160 db 'Bloc Num',0
|
||||
txt_159 db 'Bloc Maiusc',0
|
||||
txt_158 db 'Bloc Scorr',0
|
||||
else ; Default to en_US
|
||||
txt_160 db 'Num',0
|
||||
txt_159 db 'Caps',0
|
||||
txt_158 db 'Scroll',0
|
||||
end if
|
||||
head_f_i:
|
||||
head_f_l db 'Ñèñòåìíàÿ îøèáêà',0
|
||||
|
||||
system_dir_0 db '/sys/lib/'
|
||||
lib_name_0 db 'box_lib.obj',0
|
||||
err_msg_found_lib_0 db 'Íå íàéäåíà áèáëèîòåêà box_lib.obj',0
|
||||
err_msg_import_0 db 'Îøèáêà ïðè èìïîðòå áèáëèîòåêè box_lib',0
|
||||
|
||||
l_libs_start:
|
||||
lib_0 l_libs lib_name_0, sys_path, library_path, system_dir_0,\
|
||||
err_msg_found_lib_0,head_f_l,import_box_lib,err_msg_import_0,head_f_i
|
||||
l_libs_end:
|
||||
|
||||
align 4
|
||||
import_box_lib:
|
||||
;init dd sz_init
|
||||
init_checkbox dd sz_init_checkbox
|
||||
check_box_draw dd sz_check_box_draw
|
||||
check_box_mouse dd sz_check_box_mouse
|
||||
dd 0,0
|
||||
;sz_init db 'lib_init',0
|
||||
sz_init_checkbox db 'init_checkbox2',0
|
||||
sz_check_box_draw db 'check_box_draw2',0
|
||||
sz_check_box_mouse db 'check_box_mouse2',0
|
||||
|
||||
;mouse_dd dd 0x0
|
||||
sc system_colors
|
||||
|
||||
_end:
|
||||
align 32
|
||||
rb 2048
|
||||
stacktop:
|
||||
sys_path rb 1024
|
||||
library_path rb 1024
|
||||
_memory:
|
||||
|
@ -1,468 +1,470 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Copyright (C) Vasiliy Kosenko (vkos), 2009 ;;
|
||||
;; Launch is free software: you can redistribute it and/or modify it under the terms of the GNU ;;
|
||||
;; General Public License as published by the Free Software Foundation, either version 3 ;;
|
||||
;; of the License, or (at your option) any later version. ;;
|
||||
;; ;;
|
||||
;; Launch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without ;;
|
||||
;; even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;
|
||||
;; General Public License for more details. ;;
|
||||
;; ;;
|
||||
;; You should have received a copy of the GNU General Public License along with Launch. ;;
|
||||
;; If not, see <http://www.gnu.org/licenses/>. ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Launch finds program in search dirictories and runs it. ;;
|
||||
;; For more details see readme.txt ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
format binary
|
||||
|
||||
APP_NAME fix 'Launch'
|
||||
APP_VERSION fix '0.1.80.1'
|
||||
|
||||
use32
|
||||
org 0x0
|
||||
|
||||
db 'MENUET01'
|
||||
dd 0x01
|
||||
dd START
|
||||
dd APP_END
|
||||
dd MEM_END
|
||||
dd APP_STACK
|
||||
dd args
|
||||
dd path
|
||||
|
||||
define DEBUG_NO 0
|
||||
define DEBUG_CONSOLE 1
|
||||
define DEBUG_BOARD 2 ;; Not used now
|
||||
|
||||
define PATH_MAX_LEN 1024
|
||||
define DEBUG_MAX_LEN 8
|
||||
define DEBUG_DEFAULT 0
|
||||
define BUFF_SIZE 1024
|
||||
|
||||
include 'proc32.inc'
|
||||
include 'macros.inc'
|
||||
include 'libio.inc'
|
||||
include 'dll.inc'
|
||||
|
||||
purge mov
|
||||
|
||||
include 'thread.inc'
|
||||
include 'ipc.inc'
|
||||
include 'kobra.inc'
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
;; Basic initialization
|
||||
START:
|
||||
;; Initialize process heap
|
||||
mcall 68,11
|
||||
test eax, eax
|
||||
jz exit
|
||||
|
||||
;; Import modules
|
||||
stdcall dll.Load,importTable
|
||||
test eax, eax
|
||||
jnz exit
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
;; Reading config
|
||||
read_ini_path: ;; Read search path
|
||||
;; First read config in /sys/etc
|
||||
invoke ini.get_str, etc_cfg, cfg_main, cfg_path, search_path, PATH_MAX_LEN, empty_str
|
||||
|
||||
;; Next, read config from current directory
|
||||
;; Find end of path string
|
||||
.find_path_eol:
|
||||
mov edi, path
|
||||
mov ecx, PATH_MAX_LEN
|
||||
xor al, al
|
||||
cld
|
||||
repne scasb
|
||||
|
||||
;; Append ext to run path (NOTE: this work only when config file has name <launch-file-name>.cfg and ext size is dword)
|
||||
mov eax, dword [cfg_ext]
|
||||
dec edi
|
||||
mov dword [edi], eax
|
||||
mov byte [edi+5], 0
|
||||
|
||||
;; Currently there is no checking for repeating pathes, so we should only concatenate two strings
|
||||
;; So we need to find end of current search_path string
|
||||
.find_search_eol:
|
||||
mov edi, search_path
|
||||
mov ecx, PATH_MAX_LEN
|
||||
xor al, al
|
||||
;cld
|
||||
repne scasb
|
||||
dec edi
|
||||
|
||||
;; Now we need to correct buffer length
|
||||
mov eax, path+PATH_MAX_LEN
|
||||
sub eax, edi
|
||||
;; Read ini
|
||||
invoke ini.get_str, path, cfg_main, cfg_path, edi, PATH_MAX_LEN, empty_str
|
||||
|
||||
read_ini_debug: ;; Read debug options
|
||||
;; Read debug options from config files
|
||||
invoke ini.get_option_str, etc_cfg, cfg_debug, cfg_debug, debug_strings, DEBUG_MAX_LEN, DEBUG_DEFAULT
|
||||
invoke ini.get_option_str, path, cfg_debug, cfg_debug, debug_strings, DEBUG_MAX_LEN, eax
|
||||
mov [debug_option], eax
|
||||
|
||||
test eax, eax ;; No console
|
||||
je .ok
|
||||
|
||||
jmp .con_init
|
||||
|
||||
.console_err:
|
||||
mov byte [debug_option], 0
|
||||
jmp .ok
|
||||
|
||||
.con_init:
|
||||
stdcall dll.Load, consoleImport
|
||||
test eax, eax
|
||||
jnz .console_err
|
||||
invoke con.init, -1, -1, -1, -1, window_title
|
||||
|
||||
.read_level:
|
||||
invoke ini.get_int, etc_cfg, cfg_debug, cfg_level, 0
|
||||
invoke ini.get_int, path, cfg_debug, cfg_level, eax
|
||||
mov byte [debug_level], al
|
||||
.ok:
|
||||
|
||||
read_ini_kobra:
|
||||
invoke ini.get_bool, etc_cfg, cfg_kobra, cfg_use, 0
|
||||
invoke ini.get_bool, path, cfg_kobra, cfg_use, eax
|
||||
|
||||
mov byte [kobra_use], al
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
;; Parse command line options
|
||||
parse_args:
|
||||
;; Now parse command line arguments
|
||||
;; TODO: use optparse library
|
||||
;; Currently the only argument to parse is program name with its' arguments
|
||||
|
||||
.skip_spaces:
|
||||
mov ecx, -1
|
||||
mov edi, args
|
||||
mov al, ' '
|
||||
xor bl, bl
|
||||
;cld
|
||||
repe scasb
|
||||
|
||||
push edi
|
||||
|
||||
mov ecx, -1
|
||||
@@:
|
||||
scasb
|
||||
je @f
|
||||
xchg al, bl
|
||||
dec edi
|
||||
scasb
|
||||
jne @b
|
||||
@@:
|
||||
mov dword [prog_args], edi
|
||||
|
||||
pop edi
|
||||
dec edi
|
||||
;; Now edi = program name
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
;; Finding file
|
||||
search_file:
|
||||
push edi
|
||||
mov esi, search_path
|
||||
xchg esi, [esp]
|
||||
.loop:
|
||||
or dl, dl
|
||||
je .prn_dbg
|
||||
xor dl, dl
|
||||
jmp .prn_end
|
||||
.prn_dbg:
|
||||
push eax
|
||||
mov al, byte [debug_option]
|
||||
; dec al
|
||||
test al, al
|
||||
je .prn_stp
|
||||
mov al, byte [debug_level]
|
||||
or al, al
|
||||
je .prn_stp
|
||||
dec al
|
||||
or al, al
|
||||
je .prn_1
|
||||
.prn_1:
|
||||
cinvoke con.printf, message_dbg_not_found, buff
|
||||
|
||||
.prn_stp:
|
||||
pop eax
|
||||
.prn_end:
|
||||
xor eax, eax ;; When we check is proramme launched we are checking for eax
|
||||
xchg esi, [esp]
|
||||
mov edi, buff
|
||||
.copy_path:
|
||||
lodsb
|
||||
cmp al, ';'
|
||||
je .copy_file
|
||||
or al, al
|
||||
je exit
|
||||
stosb
|
||||
jmp .copy_path
|
||||
|
||||
.copy_file:
|
||||
xchg esi, [esp]
|
||||
push esi
|
||||
.cp_file_loop:
|
||||
lodsb
|
||||
or al, al
|
||||
je .copy_end
|
||||
cmp al, ' '
|
||||
je .copy_end
|
||||
stosb
|
||||
jmp .cp_file_loop
|
||||
|
||||
.copy_end:
|
||||
pop esi
|
||||
xor al, al
|
||||
stosb
|
||||
|
||||
;; Try to launch
|
||||
|
||||
mov dword [LaunchStruct.Function], 7
|
||||
push dword [prog_args]
|
||||
pop dword [LaunchStruct.Arguments]
|
||||
mov dword [LaunchStruct.Flags], 0
|
||||
mov dword [LaunchStruct.Zero], 0
|
||||
mov dword [LaunchStruct.FileNameP], buff
|
||||
mcall 70, LaunchStruct
|
||||
cmp eax, 0
|
||||
jl .loop
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
;; Exit
|
||||
exit:
|
||||
mov dword [tid], eax
|
||||
;; If console is present we should write some info
|
||||
mov al, byte [debug_option]
|
||||
cmp al, DEBUG_CONSOLE
|
||||
jne .kobra
|
||||
|
||||
.write_console:
|
||||
mov eax, dword [tid]
|
||||
test eax, eax
|
||||
jz .write_error
|
||||
.write_launched:
|
||||
cinvoke con.printf, message_ok, buff, eax, eax
|
||||
jmp .wr_end
|
||||
.write_error:
|
||||
pop edi
|
||||
cinvoke con.printf, message_error, edi
|
||||
.wr_end:
|
||||
invoke con.exit, 0
|
||||
|
||||
.kobra:
|
||||
mov al, byte [kobra_use]
|
||||
test al, al
|
||||
je .close
|
||||
|
||||
.register:
|
||||
mov dword [IPC_area], buff
|
||||
call IPC_init
|
||||
; jnz .close
|
||||
|
||||
mov dword [thread_find_buff], another_buff
|
||||
|
||||
call kobra_register
|
||||
|
||||
test eax, eax
|
||||
jnz .close
|
||||
|
||||
;; Prepare message
|
||||
mov dword [kobra_message], KOBRA_MESSAGE_LAUNCH_STATE
|
||||
|
||||
mov eax, dword [tid]
|
||||
mov dword [kobra_message+4], eax
|
||||
|
||||
.kobra_send:
|
||||
stdcall kobra_send_message, kobra_group_launch_reactive, kobra_message, 8
|
||||
|
||||
.close:
|
||||
mcall -1
|
||||
|
||||
;; End of code
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
;; Imports
|
||||
align 16
|
||||
importTable:
|
||||
|
||||
library libini, 'libconfig.obj' ;, \
|
||||
; libio, 'libio.obj', \
|
||||
|
||||
import libini, \
|
||||
ini.get_str ,'ini_get_str', \
|
||||
\; ini.set_str ,'ini_set_str', \
|
||||
ini.get_int ,'ini_get_int', \
|
||||
\; ini.set_int ,'ini_set_int', \
|
||||
\; ini.get_color ,'ini_get_color', \
|
||||
\; ini.set_color ,'ini_set_color', \
|
||||
ini.get_option_str ,'ini_get_option_str', \
|
||||
ini.get_bool ,'ini_get_bool';,\
|
||||
|
||||
;import libio, \
|
||||
; file_find_first,'file_find_first', \
|
||||
; file_find_next ,'file_find_next', \
|
||||
; file_find_close,'file_find_close', \
|
||||
; file_size ,'file_size', \
|
||||
; file_open ,'file_open', \
|
||||
; file_read ,'file_read', \
|
||||
; file_write ,'file_write', \
|
||||
; file_seek ,'file_seek', \
|
||||
; file_tell ,'file_tell', \
|
||||
; file_eof? ,'file_eof?', \
|
||||
; file_truncate ,'file_truncate', \
|
||||
; file_close ,'file_close'
|
||||
|
||||
consoleImport:
|
||||
library \
|
||||
conlib, 'console.obj'
|
||||
|
||||
import conlib,\
|
||||
con.init, 'con_init',\
|
||||
con.exit, 'con_exit',\
|
||||
con.printf, 'con_printf' ;,\
|
||||
; con.write_asciiz, 'con_write_asciiz'
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
;; Data
|
||||
align 16
|
||||
APP_DATA:
|
||||
|
||||
;; Window title
|
||||
window_title:
|
||||
db APP_NAME, ' ', APP_VERSION, 0
|
||||
|
||||
;; Messages
|
||||
if lang eq it_IT
|
||||
message_dbg_not_found:
|
||||
db '%s non trovato', 10, 0
|
||||
|
||||
message_error:
|
||||
db 'File (%s) non trovato!', 0
|
||||
|
||||
message_ok:
|
||||
db '%s caricato correttamente. PID: %d (0x%X)', 0
|
||||
else
|
||||
message_dbg_not_found:
|
||||
db '%s not found', 10, 0
|
||||
|
||||
message_error:
|
||||
db 'File (%s) not found!', 0
|
||||
|
||||
message_ok:
|
||||
db '%s loaded succesfully. PID: %d (0x%X)', 0
|
||||
end if
|
||||
;; Configuration path
|
||||
etc_cfg:
|
||||
db '/sys/etc/'
|
||||
cfg_name:
|
||||
db 'launch'
|
||||
cfg_ext:
|
||||
db '.cfg', 0
|
||||
|
||||
;; Strings in config file
|
||||
cfg_main:
|
||||
db 'main', 0
|
||||
cfg_path:
|
||||
db 'path', 0
|
||||
cfg_debug:
|
||||
db 'debug', 0
|
||||
cfg_level:
|
||||
db 'level', 0
|
||||
cfg_kobra:
|
||||
db 'kobra', 0
|
||||
cfg_use:
|
||||
db 'use', 0
|
||||
|
||||
;; List of debug modes for parsing debug option
|
||||
debug_strings:
|
||||
dd debug_no
|
||||
dd debug_console
|
||||
dd 0
|
||||
|
||||
debug_no:
|
||||
db 'no', 0
|
||||
debug_console:
|
||||
db 'console', 0
|
||||
|
||||
;; Empty string
|
||||
empty_str:
|
||||
db 0
|
||||
|
||||
kobra_group_launch_reactive:
|
||||
db 'launch_reactive', 0
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
;; Configuration options
|
||||
debug_level:
|
||||
db 0
|
||||
|
||||
; debug_kobra:
|
||||
; db 0
|
||||
|
||||
;; debug option (bool)
|
||||
debug_option:
|
||||
db 0
|
||||
|
||||
kobra_use:
|
||||
db 0
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
tid:
|
||||
dd 0
|
||||
|
||||
struct FileInfoRun
|
||||
Function dd 7
|
||||
Flags dd ?
|
||||
Arguments dd 0
|
||||
Reserved0 dd ?
|
||||
Reserved1 dd ?
|
||||
union
|
||||
FileName rb 1024
|
||||
struct
|
||||
Zero db 0
|
||||
FileNameP dd ?
|
||||
ends
|
||||
ends
|
||||
ends
|
||||
|
||||
LaunchStruct FileInfoRun
|
||||
|
||||
args: db 0
|
||||
APP_END:
|
||||
rb 255
|
||||
|
||||
prog_args:
|
||||
rd 1
|
||||
path:
|
||||
rb 1024
|
||||
|
||||
;; Search path will be here
|
||||
search_path:
|
||||
rb PATH_MAX_LEN
|
||||
|
||||
;; Buffer
|
||||
buff:
|
||||
rb BUFF_SIZE
|
||||
|
||||
another_buff:
|
||||
rb 0x1000
|
||||
|
||||
kobra_message:
|
||||
rb 0x100
|
||||
|
||||
rb 0x1000 ;; 4 Kb stack
|
||||
APP_STACK:
|
||||
MEM_END:
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Copyright (C) Vasiliy Kosenko (vkos), 2009 ;;
|
||||
;; Launch is free software: you can redistribute it and/or modify it under the terms of the GNU ;;
|
||||
;; General Public License as published by the Free Software Foundation, either version 3 ;;
|
||||
;; of the License, or (at your option) any later version. ;;
|
||||
;; ;;
|
||||
;; Launch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without ;;
|
||||
;; even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;
|
||||
;; General Public License for more details. ;;
|
||||
;; ;;
|
||||
;; You should have received a copy of the GNU General Public License along with Launch. ;;
|
||||
;; If not, see <http://www.gnu.org/licenses/>. ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Launch finds program in search dirictories and runs it. ;;
|
||||
;; For more details see readme.txt ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
; Language support for locales: it_IT, en_US.
|
||||
|
||||
format binary
|
||||
|
||||
APP_NAME fix 'Launch'
|
||||
APP_VERSION fix '0.1.80.1'
|
||||
|
||||
use32
|
||||
org 0x0
|
||||
|
||||
db 'MENUET01'
|
||||
dd 0x01
|
||||
dd START
|
||||
dd APP_END
|
||||
dd MEM_END
|
||||
dd APP_STACK
|
||||
dd args
|
||||
dd path
|
||||
|
||||
define DEBUG_NO 0
|
||||
define DEBUG_CONSOLE 1
|
||||
define DEBUG_BOARD 2 ;; Not used now
|
||||
|
||||
define PATH_MAX_LEN 1024
|
||||
define DEBUG_MAX_LEN 8
|
||||
define DEBUG_DEFAULT 0
|
||||
define BUFF_SIZE 1024
|
||||
|
||||
include 'proc32.inc'
|
||||
include 'macros.inc'
|
||||
include 'libio.inc'
|
||||
include 'dll.inc'
|
||||
|
||||
purge mov
|
||||
|
||||
include 'thread.inc'
|
||||
include 'ipc.inc'
|
||||
include 'kobra.inc'
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
;; Basic initialization
|
||||
START:
|
||||
;; Initialize process heap
|
||||
mcall 68,11
|
||||
test eax, eax
|
||||
jz exit
|
||||
|
||||
;; Import modules
|
||||
stdcall dll.Load,importTable
|
||||
test eax, eax
|
||||
jnz exit
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
;; Reading config
|
||||
read_ini_path: ;; Read search path
|
||||
;; First read config in /sys/etc
|
||||
invoke ini.get_str, etc_cfg, cfg_main, cfg_path, search_path, PATH_MAX_LEN, empty_str
|
||||
|
||||
;; Next, read config from current directory
|
||||
;; Find end of path string
|
||||
.find_path_eol:
|
||||
mov edi, path
|
||||
mov ecx, PATH_MAX_LEN
|
||||
xor al, al
|
||||
cld
|
||||
repne scasb
|
||||
|
||||
;; Append ext to run path (NOTE: this work only when config file has name <launch-file-name>.cfg and ext size is dword)
|
||||
mov eax, dword [cfg_ext]
|
||||
dec edi
|
||||
mov dword [edi], eax
|
||||
mov byte [edi+5], 0
|
||||
|
||||
;; Currently there is no checking for repeating pathes, so we should only concatenate two strings
|
||||
;; So we need to find end of current search_path string
|
||||
.find_search_eol:
|
||||
mov edi, search_path
|
||||
mov ecx, PATH_MAX_LEN
|
||||
xor al, al
|
||||
;cld
|
||||
repne scasb
|
||||
dec edi
|
||||
|
||||
;; Now we need to correct buffer length
|
||||
mov eax, path+PATH_MAX_LEN
|
||||
sub eax, edi
|
||||
;; Read ini
|
||||
invoke ini.get_str, path, cfg_main, cfg_path, edi, PATH_MAX_LEN, empty_str
|
||||
|
||||
read_ini_debug: ;; Read debug options
|
||||
;; Read debug options from config files
|
||||
invoke ini.get_option_str, etc_cfg, cfg_debug, cfg_debug, debug_strings, DEBUG_MAX_LEN, DEBUG_DEFAULT
|
||||
invoke ini.get_option_str, path, cfg_debug, cfg_debug, debug_strings, DEBUG_MAX_LEN, eax
|
||||
mov [debug_option], eax
|
||||
|
||||
test eax, eax ;; No console
|
||||
je .ok
|
||||
|
||||
jmp .con_init
|
||||
|
||||
.console_err:
|
||||
mov byte [debug_option], 0
|
||||
jmp .ok
|
||||
|
||||
.con_init:
|
||||
stdcall dll.Load, consoleImport
|
||||
test eax, eax
|
||||
jnz .console_err
|
||||
invoke con.init, -1, -1, -1, -1, window_title
|
||||
|
||||
.read_level:
|
||||
invoke ini.get_int, etc_cfg, cfg_debug, cfg_level, 0
|
||||
invoke ini.get_int, path, cfg_debug, cfg_level, eax
|
||||
mov byte [debug_level], al
|
||||
.ok:
|
||||
|
||||
read_ini_kobra:
|
||||
invoke ini.get_bool, etc_cfg, cfg_kobra, cfg_use, 0
|
||||
invoke ini.get_bool, path, cfg_kobra, cfg_use, eax
|
||||
|
||||
mov byte [kobra_use], al
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
;; Parse command line options
|
||||
parse_args:
|
||||
;; Now parse command line arguments
|
||||
;; TODO: use optparse library
|
||||
;; Currently the only argument to parse is program name with its' arguments
|
||||
|
||||
.skip_spaces:
|
||||
mov ecx, -1
|
||||
mov edi, args
|
||||
mov al, ' '
|
||||
xor bl, bl
|
||||
;cld
|
||||
repe scasb
|
||||
|
||||
push edi
|
||||
|
||||
mov ecx, -1
|
||||
@@:
|
||||
scasb
|
||||
je @f
|
||||
xchg al, bl
|
||||
dec edi
|
||||
scasb
|
||||
jne @b
|
||||
@@:
|
||||
mov dword [prog_args], edi
|
||||
|
||||
pop edi
|
||||
dec edi
|
||||
;; Now edi = program name
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
;; Finding file
|
||||
search_file:
|
||||
push edi
|
||||
mov esi, search_path
|
||||
xchg esi, [esp]
|
||||
.loop:
|
||||
or dl, dl
|
||||
je .prn_dbg
|
||||
xor dl, dl
|
||||
jmp .prn_end
|
||||
.prn_dbg:
|
||||
push eax
|
||||
mov al, byte [debug_option]
|
||||
; dec al
|
||||
test al, al
|
||||
je .prn_stp
|
||||
mov al, byte [debug_level]
|
||||
or al, al
|
||||
je .prn_stp
|
||||
dec al
|
||||
or al, al
|
||||
je .prn_1
|
||||
.prn_1:
|
||||
cinvoke con.printf, message_dbg_not_found, buff
|
||||
|
||||
.prn_stp:
|
||||
pop eax
|
||||
.prn_end:
|
||||
xor eax, eax ;; When we check is proramme launched we are checking for eax
|
||||
xchg esi, [esp]
|
||||
mov edi, buff
|
||||
.copy_path:
|
||||
lodsb
|
||||
cmp al, ';'
|
||||
je .copy_file
|
||||
or al, al
|
||||
je exit
|
||||
stosb
|
||||
jmp .copy_path
|
||||
|
||||
.copy_file:
|
||||
xchg esi, [esp]
|
||||
push esi
|
||||
.cp_file_loop:
|
||||
lodsb
|
||||
or al, al
|
||||
je .copy_end
|
||||
cmp al, ' '
|
||||
je .copy_end
|
||||
stosb
|
||||
jmp .cp_file_loop
|
||||
|
||||
.copy_end:
|
||||
pop esi
|
||||
xor al, al
|
||||
stosb
|
||||
|
||||
;; Try to launch
|
||||
|
||||
mov dword [LaunchStruct.Function], 7
|
||||
push dword [prog_args]
|
||||
pop dword [LaunchStruct.Arguments]
|
||||
mov dword [LaunchStruct.Flags], 0
|
||||
mov dword [LaunchStruct.Zero], 0
|
||||
mov dword [LaunchStruct.FileNameP], buff
|
||||
mcall 70, LaunchStruct
|
||||
cmp eax, 0
|
||||
jl .loop
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
;; Exit
|
||||
exit:
|
||||
mov dword [tid], eax
|
||||
;; If console is present we should write some info
|
||||
mov al, byte [debug_option]
|
||||
cmp al, DEBUG_CONSOLE
|
||||
jne .kobra
|
||||
|
||||
.write_console:
|
||||
mov eax, dword [tid]
|
||||
test eax, eax
|
||||
jz .write_error
|
||||
.write_launched:
|
||||
cinvoke con.printf, message_ok, buff, eax, eax
|
||||
jmp .wr_end
|
||||
.write_error:
|
||||
pop edi
|
||||
cinvoke con.printf, message_error, edi
|
||||
.wr_end:
|
||||
invoke con.exit, 0
|
||||
|
||||
.kobra:
|
||||
mov al, byte [kobra_use]
|
||||
test al, al
|
||||
je .close
|
||||
|
||||
.register:
|
||||
mov dword [IPC_area], buff
|
||||
call IPC_init
|
||||
; jnz .close
|
||||
|
||||
mov dword [thread_find_buff], another_buff
|
||||
|
||||
call kobra_register
|
||||
|
||||
test eax, eax
|
||||
jnz .close
|
||||
|
||||
;; Prepare message
|
||||
mov dword [kobra_message], KOBRA_MESSAGE_LAUNCH_STATE
|
||||
|
||||
mov eax, dword [tid]
|
||||
mov dword [kobra_message+4], eax
|
||||
|
||||
.kobra_send:
|
||||
stdcall kobra_send_message, kobra_group_launch_reactive, kobra_message, 8
|
||||
|
||||
.close:
|
||||
mcall -1
|
||||
|
||||
;; End of code
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
;; Imports
|
||||
align 16
|
||||
importTable:
|
||||
|
||||
library libini, 'libconfig.obj' ;, \
|
||||
; libio, 'libio.obj', \
|
||||
|
||||
import libini, \
|
||||
ini.get_str ,'ini_get_str', \
|
||||
\; ini.set_str ,'ini_set_str', \
|
||||
ini.get_int ,'ini_get_int', \
|
||||
\; ini.set_int ,'ini_set_int', \
|
||||
\; ini.get_color ,'ini_get_color', \
|
||||
\; ini.set_color ,'ini_set_color', \
|
||||
ini.get_option_str ,'ini_get_option_str', \
|
||||
ini.get_bool ,'ini_get_bool';,\
|
||||
|
||||
;import libio, \
|
||||
; file_find_first,'file_find_first', \
|
||||
; file_find_next ,'file_find_next', \
|
||||
; file_find_close,'file_find_close', \
|
||||
; file_size ,'file_size', \
|
||||
; file_open ,'file_open', \
|
||||
; file_read ,'file_read', \
|
||||
; file_write ,'file_write', \
|
||||
; file_seek ,'file_seek', \
|
||||
; file_tell ,'file_tell', \
|
||||
; file_eof? ,'file_eof?', \
|
||||
; file_truncate ,'file_truncate', \
|
||||
; file_close ,'file_close'
|
||||
|
||||
consoleImport:
|
||||
library \
|
||||
conlib, 'console.obj'
|
||||
|
||||
import conlib,\
|
||||
con.init, 'con_init',\
|
||||
con.exit, 'con_exit',\
|
||||
con.printf, 'con_printf' ;,\
|
||||
; con.write_asciiz, 'con_write_asciiz'
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
;; Data
|
||||
align 16
|
||||
APP_DATA:
|
||||
|
||||
;; Window title
|
||||
window_title:
|
||||
db APP_NAME, ' ', APP_VERSION, 0
|
||||
|
||||
;; Messages
|
||||
if lang eq it_IT
|
||||
message_dbg_not_found:
|
||||
db '%s non trovato', 10, 0
|
||||
|
||||
message_error:
|
||||
db 'File (%s) non trovato!', 0
|
||||
|
||||
message_ok:
|
||||
db '%s caricato correttamente. PID: %d (0x%X)', 0
|
||||
else ; Default to en_US
|
||||
message_dbg_not_found:
|
||||
db '%s not found', 10, 0
|
||||
|
||||
message_error:
|
||||
db 'File (%s) not found!', 0
|
||||
|
||||
message_ok:
|
||||
db '%s loaded successfully. PID: %d (0x%X)', 0
|
||||
end if
|
||||
;; Configuration path
|
||||
etc_cfg:
|
||||
db '/sys/etc/'
|
||||
cfg_name:
|
||||
db 'launch'
|
||||
cfg_ext:
|
||||
db '.cfg', 0
|
||||
|
||||
;; Strings in config file
|
||||
cfg_main:
|
||||
db 'main', 0
|
||||
cfg_path:
|
||||
db 'path', 0
|
||||
cfg_debug:
|
||||
db 'debug', 0
|
||||
cfg_level:
|
||||
db 'level', 0
|
||||
cfg_kobra:
|
||||
db 'kobra', 0
|
||||
cfg_use:
|
||||
db 'use', 0
|
||||
|
||||
;; List of debug modes for parsing debug option
|
||||
debug_strings:
|
||||
dd debug_no
|
||||
dd debug_console
|
||||
dd 0
|
||||
|
||||
debug_no:
|
||||
db 'no', 0
|
||||
debug_console:
|
||||
db 'console', 0
|
||||
|
||||
;; Empty string
|
||||
empty_str:
|
||||
db 0
|
||||
|
||||
kobra_group_launch_reactive:
|
||||
db 'launch_reactive', 0
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
;; Configuration options
|
||||
debug_level:
|
||||
db 0
|
||||
|
||||
; debug_kobra:
|
||||
; db 0
|
||||
|
||||
;; debug option (bool)
|
||||
debug_option:
|
||||
db 0
|
||||
|
||||
kobra_use:
|
||||
db 0
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
tid:
|
||||
dd 0
|
||||
|
||||
struct FileInfoRun
|
||||
Function dd 7
|
||||
Flags dd ?
|
||||
Arguments dd 0
|
||||
Reserved0 dd ?
|
||||
Reserved1 dd ?
|
||||
union
|
||||
FileName rb 1024
|
||||
struct
|
||||
Zero db 0
|
||||
FileNameP dd ?
|
||||
ends
|
||||
ends
|
||||
ends
|
||||
|
||||
LaunchStruct FileInfoRun
|
||||
|
||||
args: db 0
|
||||
APP_END:
|
||||
rb 255
|
||||
|
||||
prog_args:
|
||||
rd 1
|
||||
path:
|
||||
rb 1024
|
||||
|
||||
;; Search path will be here
|
||||
search_path:
|
||||
rb PATH_MAX_LEN
|
||||
|
||||
;; Buffer
|
||||
buff:
|
||||
rb BUFF_SIZE
|
||||
|
||||
another_buff:
|
||||
rb 0x1000
|
||||
|
||||
kobra_message:
|
||||
rb 0x100
|
||||
|
||||
rb 0x1000 ;; 4 Kb stack
|
||||
APP_STACK:
|
||||
MEM_END:
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -7,7 +7,7 @@ include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
include 'txtbut.inc'
|
||||
include '../../../macros.inc'
|
||||
include 'run.mac'
|
||||
include 'lang.inc'
|
||||
include 'lang.inc' ; Language support for locales: ru_RU (CP866), it_IT, en_US.
|
||||
use32
|
||||
org 0
|
||||
db 'MENUET01'
|
||||
@ -263,7 +263,7 @@ else if lang eq it_IT
|
||||
run_ok db 'Il programma eseguito correttamente',0
|
||||
grab_text db 'RUN',0
|
||||
run_but_text db 'Esegui',0
|
||||
else
|
||||
else ; Default to en_US
|
||||
hello db 'Enter full path to file and press <Enter>',0
|
||||
bad_file_sys db 'Unknown file system',0 ; 3
|
||||
file_not_find db 'File not found',0 ; 5
|
||||
|
@ -1,387 +1,385 @@
|
||||
;-----------------------------------------------------------------------------
|
||||
text:
|
||||
if lang eq ru_RU
|
||||
db ' Unused1 '
|
||||
db ' Unused2 '
|
||||
db ' 3d ⥬ ï áâ®à® '
|
||||
db ' 3d ᢥ⫠ï áâ®à® '
|
||||
db ' ‡ £®«®¢®ª ®ª '
|
||||
db ' ”® ®ª '
|
||||
db ' Š®¯ª '
|
||||
db ' ’¥ªáâ ª®¯ª¥ '
|
||||
db ' ’¥ªáâ ¢ ®ª¥ '
|
||||
db ' ƒà 䨪 ¢ ®ª¥ '
|
||||
db 'x'
|
||||
else if lang eq et_EE
|
||||
db ' Unused1 '
|
||||
db ' Unused2 '
|
||||
db ' 3d dark '
|
||||
db ' 3d light '
|
||||
db ' Akna pealkiri '
|
||||
db ' Akna tööpiirkond '
|
||||
db ' Akna tööpiirkonna nupp '
|
||||
db ' Akna tööpiirkonna nuppu tekst '
|
||||
db ' Akna tööpiirkonna tekst '
|
||||
db ' Akna tööpiirkonna graafika '
|
||||
db 'x'
|
||||
else
|
||||
db ' Unused1 '
|
||||
db ' Unused2 '
|
||||
db ' 3d dark '
|
||||
db ' 3d light '
|
||||
db ' Window title '
|
||||
db ' Window background '
|
||||
db ' Button '
|
||||
db ' Button text '
|
||||
db ' Window text '
|
||||
db ' Window graph '
|
||||
db 'x'
|
||||
end if
|
||||
;-----------------------------------------------------------------------------
|
||||
if lang eq ru_RU
|
||||
sz t1,'‡€ƒ<E282AC>“‡ˆ’œ ‘Ž•<C5BD>€<EFBFBD>ˆ’œ <20><>ˆŒ…<C592>ˆ’œ'
|
||||
else if lang eq et_EE
|
||||
sz t1,' LAADI SALVESTA KINNITA'
|
||||
else
|
||||
sz t1,' LOAD SAVE APPLY'
|
||||
end if
|
||||
;-----------------------------------------------------------------------------
|
||||
if lang eq ru_RU
|
||||
sz t2,'‡€ƒ<E282AC>“‡ˆ’œ 3D <20>‹Ž‘Šˆ… <20><>ˆŒ…<C592>ˆ’œ'
|
||||
else if lang eq et_EE
|
||||
sz t2,' LAADI 3D LAME KINNITA'
|
||||
else
|
||||
sz t2,' LOAD 3D FLAT APPLY'
|
||||
end if
|
||||
;-----------------------------------------------------------------------------
|
||||
select_dtp_text:
|
||||
if lang eq ru_RU
|
||||
db ' ‚ë¡®à 梥⮢®£® ®ä®à¬«¥¨ï: ',0
|
||||
else if lang eq et_EE
|
||||
db ' Valik varviskeeme: ',0
|
||||
else
|
||||
db ' Choice of color schemes: ',0
|
||||
end if
|
||||
;-----------------------------------------------------------------------------
|
||||
select_skin_text:
|
||||
if lang eq ru_RU
|
||||
db ' ‚ë¡®à ᪨ : ',0
|
||||
else if lang eq et_EE
|
||||
db ' Valik nahad: ',0
|
||||
else
|
||||
db ' Choice of skins: ',0
|
||||
end if
|
||||
;-----------------------------------------------------------------------------
|
||||
if lang eq ru_RU
|
||||
sz caption_text,'‡ £®«®¢®ª'
|
||||
else if lang eq et_EE
|
||||
sz caption_text,'Pealkiri'
|
||||
else
|
||||
sz caption_text,'Caption'
|
||||
end if
|
||||
;-----------------------------------------------------------------------------
|
||||
sz close_text,'x'
|
||||
;-----------------------------------------------------------------------------
|
||||
if lang eq ru_RU
|
||||
sz window_text,'’¥ªáâ ¢ ®ª¥'
|
||||
else if lang eq et_EE
|
||||
sz window_text,'Akna tekst'
|
||||
else
|
||||
sz window_text,'Window text'
|
||||
end if
|
||||
;-----------------------------------------------------------------------------
|
||||
if lang eq ru_RU
|
||||
sz button_text,'’¥ªáâ ª®¯ª¥'
|
||||
else if lang eq et_EE
|
||||
sz button_text,'Nupu tekst'
|
||||
else
|
||||
sz button_text,'Button text'
|
||||
end if
|
||||
;-----------------------------------------------------------------------------
|
||||
if lang eq ru_RU
|
||||
title db '<27> áâனª ®ª®',0
|
||||
else if lang eq et_EE
|
||||
title db 'Akna seaded',0
|
||||
else if lang eq it_IT
|
||||
title db 'Impostazioni',0
|
||||
else
|
||||
title db 'Windows settings',0
|
||||
end if
|
||||
;---------------------------------------------------------------------
|
||||
LibIniImportTable:
|
||||
library \
|
||||
libini, 'libini.obj'
|
||||
|
||||
import libini, \
|
||||
ini_set_int ,'ini_set_int'
|
||||
|
||||
aIni db '/sys/settings/system.ini',0
|
||||
aSectionSkn db 'style',0
|
||||
aButtonStyle db 'buttons_gradient',0
|
||||
;---------------------------------------------------------------------
|
||||
l_libs_start:
|
||||
|
||||
library01 l_libs system_dir_Boxlib+9, library_path, system_dir_Boxlib, \
|
||||
Box_lib_import
|
||||
|
||||
library02 l_libs system_dir_ProcLib+9, library_path, system_dir_ProcLib, \
|
||||
ProcLib_import
|
||||
|
||||
end_l_libs:
|
||||
;---------------------------------------------------------------------
|
||||
system_dir_Boxlib db '/sys/lib/box_lib.obj',0
|
||||
system_dir_ProcLib db '/sys/lib/proc_lib.obj',0
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
|
||||
ProcLib_import:
|
||||
OpenDialog_Init dd aOpenDialog_Init
|
||||
OpenDialog_Start dd aOpenDialog_Start
|
||||
|
||||
ColorDialog_Init dd aColorDialog_Init
|
||||
ColorDialog_Start dd aColorDialog_Start
|
||||
;OpenDialog__Version dd aOpenDialog_Version
|
||||
dd 0
|
||||
dd 0
|
||||
|
||||
aOpenDialog_Init db 'OpenDialog_init',0
|
||||
aOpenDialog_Start db 'OpenDialog_start',0
|
||||
|
||||
aColorDialog_Init db 'ColorDialog_init',0
|
||||
aColorDialog_Start db 'ColorDialog_start',0
|
||||
;aOpenDialog_Version db 'Version_OpenDialog',0
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
Box_lib_import:
|
||||
;init_lib dd a_init
|
||||
;version_lib dd a_version
|
||||
|
||||
|
||||
;edit_box_draw dd aEdit_box_draw
|
||||
;edit_box_key dd aEdit_box_key
|
||||
;edit_box_mouse dd aEdit_box_mouse
|
||||
;version_ed dd aVersion_ed
|
||||
|
||||
;check_box_draw dd aCheck_box_draw
|
||||
;check_box_mouse dd aCheck_box_mouse
|
||||
;version_ch dd aVersion_ch
|
||||
|
||||
;option_box_draw dd aOption_box_draw
|
||||
;option_box_mouse dd aOption_box_mouse
|
||||
;version_op dd aVersion_op
|
||||
|
||||
;scrollbar_ver_draw dd aScrollbar_ver_draw
|
||||
;scrollbar_ver_mouse dd aScrollbar_ver_mouse
|
||||
;scrollbar_hor_draw dd aScrollbar_hor_draw
|
||||
;scrollbar_hor_mouse dd aScrollbar_hor_mouse
|
||||
;version_scrollbar dd aVersion_scrollbar
|
||||
|
||||
;dinamic_button_draw dd aDbutton_draw
|
||||
;dinamic_button_mouse dd aDbutton_mouse
|
||||
;version_dbutton dd aVersion_dbutton
|
||||
|
||||
;menu_bar_draw dd aMenu_bar_draw
|
||||
;menu_bar_mouse dd aMenu_bar_mouse
|
||||
;menu_bar_activate dd aMenu_bar_activate
|
||||
;version_menu_bar dd aVersion_menu_bar
|
||||
|
||||
;FileBrowser_draw dd aFileBrowser_draw
|
||||
;FileBrowser_mouse dd aFileBrowser_mouse
|
||||
;FileBrowser_key dd aFileBrowser_key
|
||||
;Version_FileBrowser dd aVersion_FileBrowser
|
||||
|
||||
PathShow_prepare dd sz_PathShow_prepare
|
||||
PathShow_draw dd sz_PathShow_draw
|
||||
;Version_path_show dd szVersion_path_show
|
||||
|
||||
Frame_draw dd sz_Frame_draw
|
||||
;Version_frame dd szVersion_frame
|
||||
|
||||
dd 0,0
|
||||
|
||||
;a_init db 'lib_init',0
|
||||
;a_version db 'version',0
|
||||
|
||||
;aEdit_box_draw db 'edit_box_draw',0
|
||||
;aEdit_box_key db 'edit_box_key',0
|
||||
;aEdit_box_mouse db 'edit_box_mouse',0
|
||||
;aVersion_ed db 'version_ed',0
|
||||
|
||||
;aCheck_box_draw db 'check_box_draw',0
|
||||
;aCheck_box_mouse db 'check_box_mouse',0
|
||||
;aVersion_ch db 'version_ch',0
|
||||
|
||||
;aOption_box_draw db 'option_box_draw',0
|
||||
;aOption_box_mouse db 'option_box_mouse',0
|
||||
;aVersion_op db 'version_op',0
|
||||
|
||||
;aScrollbar_ver_draw db 'scrollbar_v_draw',0
|
||||
;aScrollbar_ver_mouse db 'scrollbar_v_mouse',0
|
||||
;aScrollbar_hor_draw db 'scrollbar_h_draw',0
|
||||
;aScrollbar_hor_mouse db 'scrollbar_h_mouse',0
|
||||
;aVersion_scrollbar db 'version_scrollbar',0
|
||||
|
||||
;aDbutton_draw db 'dbutton_draw',0
|
||||
;aDbutton_mouse db 'dbutton_mouse',0
|
||||
;aVersion_dbutton db 'version_dbutton',0
|
||||
|
||||
;aMenu_bar_draw db 'menu_bar_draw',0
|
||||
;aMenu_bar_mouse db 'menu_bar_mouse',0
|
||||
;aMenu_bar_activate db 'menu_bar_activate',0
|
||||
;aVersion_menu_bar db 'version_menu_bar',0
|
||||
|
||||
;aFileBrowser_draw db 'FileBrowser_draw',0
|
||||
;aFileBrowser_mouse db 'FileBrowser_mouse',0
|
||||
;aFileBrowser_key db 'FileBrowser_key',0
|
||||
;aVersion_FileBrowser db 'version_FileBrowser',0
|
||||
|
||||
sz_PathShow_prepare db 'PathShow_prepare',0
|
||||
sz_PathShow_draw db 'PathShow_draw',0
|
||||
;szVersion_path_show db 'version_PathShow',0
|
||||
|
||||
sz_Frame_draw db 'frame_draw',0
|
||||
;szVersion_frame db 'version_frame',0
|
||||
;---------------------------------------------------------------------
|
||||
PathShow_data_1:
|
||||
.type dd 0 ;+0
|
||||
.start_y dw frame_1.y+19 ;+4
|
||||
.start_x dw frame_1.x+15 ;+6
|
||||
.font_size_x dw 6 ;+8 ; 6 - for font 0, 8 - for font 1
|
||||
.area_size_x dw frame_1.w-28 ;+10
|
||||
.font_number dd 0 ;+12 ; 0 - monospace, 1 - variable
|
||||
.background_flag dd 0 ;+16
|
||||
.font_color dd 0x0 ;+20
|
||||
.background_color dd 0x0 ;+24
|
||||
.text_pointer dd dtp_name ;+28
|
||||
.work_area_pointer dd text_work_area ;+32
|
||||
.temp_text_length dd 0 ;+36
|
||||
;---------------------------------------------------------------------
|
||||
PathShow_data_2:
|
||||
.type dd 0 ;+0
|
||||
.start_y dw frame_2.y+19 ;+4
|
||||
.start_x dw frame_2.x+15 ;+6
|
||||
.font_size_x dw 6 ;+8 ; 6 - for font 0, 8 - for font 1
|
||||
.area_size_x dw frame_2.w-28 ;+10
|
||||
.font_number dd 0 ;+12 ; 0 - monospace, 1 - variable
|
||||
.background_flag dd 0 ;+16
|
||||
.font_color dd 0x0 ;+20
|
||||
.background_color dd 0x0 ;+24
|
||||
.text_pointer dd skin_info ;+28
|
||||
.work_area_pointer dd text_work_area2 ;+32
|
||||
.temp_text_length dd 0 ;+36
|
||||
;---------------------------------------------------------------------
|
||||
OpenDialog_data:
|
||||
.type dd 0
|
||||
.procinfo dd procinfo ;+4
|
||||
.com_area_name dd communication_area_name ;+8
|
||||
.com_area dd 0 ;+12
|
||||
.opendir_pach dd temp_dir_pach ;+16
|
||||
.dir_default_pach dd communication_area_default_pach ;+20
|
||||
.start_path dd open_dialog_path ;+24
|
||||
.draw_window dd draw_window ;+28
|
||||
.status dd 0 ;+32
|
||||
.openfile_pach dd dtp_name ;+36
|
||||
.filename_area dd filename_area ;+40
|
||||
.filter_area dd Filter
|
||||
.x:
|
||||
.x_size dw 420 ;+48 ; Window X size
|
||||
.x_start dw 10 ;+50 ; Window X position
|
||||
.y:
|
||||
.y_size dw 320 ;+52 ; Window y size
|
||||
.y_start dw 10 ;+54 ; Window Y position
|
||||
|
||||
OpenDialog_data2:
|
||||
.type dd 0
|
||||
.procinfo dd procinfo ;+4
|
||||
.com_area_name dd communication_area_name2 ;+8
|
||||
.com_area dd 0 ;+12
|
||||
.opendir_pach dd temp_dir_pach2 ;+16
|
||||
.dir_default_pach dd communication_area_default_pach ;+20
|
||||
.start_path dd open_dialog_path ;+24
|
||||
.draw_window dd draw_window ;+28
|
||||
.status dd 0 ;+32
|
||||
.openfile_pach dd skin_info ;+36
|
||||
.filename_area dd filename_area2 ;+40
|
||||
.filter_area dd Filter2
|
||||
.x:
|
||||
.x_size dw 420 ;+48 ; Window X size
|
||||
.x_start dw 10 ;+50 ; Window X position
|
||||
.y:
|
||||
.y_size dw 320 ;+52 ; Window y size
|
||||
.y_start dw 10 ;+54 ; Window Y position
|
||||
|
||||
communication_area_name2:
|
||||
db 'FFFFFFFF_open_dialog',0
|
||||
|
||||
communication_area_name:
|
||||
db 'FFFFFFFF_open_dialog2',0
|
||||
open_dialog_path:
|
||||
if __nightbuild eq yes
|
||||
db '/sys/MANAGERS/opendial',0
|
||||
else
|
||||
db '/sys/File Managers/opendial',0
|
||||
end if
|
||||
communication_area_default_pach:
|
||||
db '/sys',0
|
||||
|
||||
Filter:
|
||||
dd Filter.end - Filter
|
||||
.1:
|
||||
db 'DTP',0
|
||||
.end:
|
||||
db 0
|
||||
|
||||
Filter2:
|
||||
dd Filter.end - Filter
|
||||
.1:
|
||||
db 'SKN',0
|
||||
.end:
|
||||
db 0
|
||||
|
||||
default_skin:
|
||||
db '/sys/default.skn',0
|
||||
default_dtp:
|
||||
db '/sys/default.dtp',0
|
||||
;---------------------------------------------------------------------
|
||||
ColorDialog_data:
|
||||
.type dd 0
|
||||
.procinfo dd procinfo ;+4
|
||||
.com_area_name dd cd_communication_area_name ;+8
|
||||
.com_area dd 0 ;+12
|
||||
.start_path dd colordialog_path ;+16
|
||||
.draw_window dd draw_window ;+20
|
||||
.status dd 0 ;+24
|
||||
.x:
|
||||
.x_size dw 510 ;+28 ; Window X size
|
||||
.x_start dw 10 ;+30 ; Window X position
|
||||
.y:
|
||||
.y_size dw 310 ;+32 ; Window y size
|
||||
.y_start dw 10 ;+34 ; Window Y position
|
||||
.color_type dd 0 ;+36 ; 0- RGB, 1 or other - reserved
|
||||
.color dd 0 ;+40 ; Selected color
|
||||
|
||||
cd_communication_area_name:
|
||||
db 'FFFFFFFF_color_dialog',0
|
||||
colordialog_path:
|
||||
db '/sys/colrdial',0
|
||||
;---------------------------------------------------------------------
|
||||
frame_data:
|
||||
.type dd 0 ;+0
|
||||
.x:
|
||||
.x_size dw 0 ;+4
|
||||
.x_start dw 0 ;+6
|
||||
.y:
|
||||
.y_size dw 0 ;+8
|
||||
.y_start dw 0 ;+10
|
||||
.ext_fr_col dd 0x0 ;+12
|
||||
.int_fr_col dd 0xffffff ;+16
|
||||
.draw_text_flag dd 1 ;+20
|
||||
.text_pointer dd 0 ;+24
|
||||
.text_position dd 0 ;+28
|
||||
.font_number dd 1 ;+32
|
||||
.font_size_y dd 14 ;+36
|
||||
.font_color dd 0x0 ;+40
|
||||
.font_backgr_color dd 0xffffff ;+44
|
||||
;---------------------------------------------------------------------
|
||||
IncludeIGlobals
|
||||
; Language support for locales: ru_RU (CP866), et_EE, en_US.
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
text:
|
||||
db ' Unused1 '
|
||||
db ' Unused2 '
|
||||
if lang eq ru_RU
|
||||
db ' 3D ⥬ ï áâ®à® '
|
||||
db ' 3D ᢥ⫠ï áâ®à® '
|
||||
db ' ‡ £®«®¢®ª ®ª '
|
||||
db ' ”® ®ª '
|
||||
db ' Š®¯ª '
|
||||
db ' ’¥ªáâ ª®¯ª¥ '
|
||||
db ' ’¥ªáâ ¢ ®ª¥ '
|
||||
db ' ƒà 䨪 ¢ ®ª¥ '
|
||||
db 'x'
|
||||
else if lang eq et_EE
|
||||
db ' 3D dark '
|
||||
db ' 3D light '
|
||||
db ' Akna pealkiri '
|
||||
db ' Akna tööpiirkond '
|
||||
db ' Akna tööpiirkonna nupp '
|
||||
db ' Akna tööpiirkonna nuppu tekst '
|
||||
db ' Akna tööpiirkonna tekst '
|
||||
db ' Akna tööpiirkonna graafika '
|
||||
db 'x'
|
||||
else ; Default to en_US
|
||||
db ' 3D dark '
|
||||
db ' 3D light '
|
||||
db ' Window title '
|
||||
db ' Window background '
|
||||
db ' Button '
|
||||
db ' Button text '
|
||||
db ' Window text '
|
||||
db ' Window graph '
|
||||
db 'x'
|
||||
end if
|
||||
;-----------------------------------------------------------------------------
|
||||
if lang eq ru_RU
|
||||
sz t1,'‡€ƒ<E282AC>“‡ˆ’œ ‘Ž•<C5BD>€<EFBFBD>ˆ’œ <20><>ˆŒ…<C592>ˆ’œ'
|
||||
else if lang eq et_EE
|
||||
sz t1,' LAADI SALVESTA KINNITA'
|
||||
else ; Default to en_US
|
||||
sz t1,' LOAD SAVE APPLY'
|
||||
end if
|
||||
;-----------------------------------------------------------------------------
|
||||
if lang eq ru_RU
|
||||
sz t2,'‡€ƒ<E282AC>“‡ˆ’œ 3D <20>‹Ž‘Šˆ… <20><>ˆŒ…<C592>ˆ’œ'
|
||||
else if lang eq et_EE
|
||||
sz t2,' LAADI 3D LAME KINNITA'
|
||||
else ; Default to en_US
|
||||
sz t2,' LOAD 3D FLAT APPLY'
|
||||
end if
|
||||
;-----------------------------------------------------------------------------
|
||||
select_dtp_text:
|
||||
if lang eq ru_RU
|
||||
db ' ‚ë¡®à 梥⮢®£® ®ä®à¬«¥¨ï: ',0
|
||||
else if lang eq et_EE
|
||||
db ' Valik varviskeeme: ',0
|
||||
else ; Default to en_US
|
||||
db ' Choice of color schemes: ',0
|
||||
end if
|
||||
;-----------------------------------------------------------------------------
|
||||
select_skin_text:
|
||||
if lang eq ru_RU
|
||||
db ' ‚ë¡®à ᪨ : ',0
|
||||
else if lang eq et_EE
|
||||
db ' Valik nahad: ',0
|
||||
else ; Default to en_US
|
||||
db ' Choice of skins: ',0
|
||||
end if
|
||||
;-----------------------------------------------------------------------------
|
||||
if lang eq ru_RU
|
||||
sz caption_text,'‡ £®«®¢®ª'
|
||||
else if lang eq et_EE
|
||||
sz caption_text,'Pealkiri'
|
||||
else ; Default to en_US
|
||||
sz caption_text,'Caption'
|
||||
end if
|
||||
;-----------------------------------------------------------------------------
|
||||
sz close_text,'x'
|
||||
;-----------------------------------------------------------------------------
|
||||
if lang eq ru_RU
|
||||
sz window_text,'’¥ªáâ ¢ ®ª¥'
|
||||
else if lang eq et_EE
|
||||
sz window_text,'Akna tekst'
|
||||
else ; Default to en_US
|
||||
sz window_text,'Window text'
|
||||
end if
|
||||
;-----------------------------------------------------------------------------
|
||||
if lang eq ru_RU
|
||||
sz button_text,'’¥ªáâ ª®¯ª¥'
|
||||
else if lang eq et_EE
|
||||
sz button_text,'Nupu tekst'
|
||||
else ; Default to en_US
|
||||
sz button_text,'Button text'
|
||||
end if
|
||||
;-----------------------------------------------------------------------------
|
||||
if lang eq ru_RU
|
||||
title db '<27> áâனª ®ª®',0
|
||||
else if lang eq et_EE
|
||||
title db 'Akna seaded',0
|
||||
else if lang eq it_IT
|
||||
title db 'Impostazioni',0
|
||||
else ; Default to en_US
|
||||
title db 'Windows settings',0
|
||||
end if
|
||||
;---------------------------------------------------------------------
|
||||
LibIniImportTable:
|
||||
library \
|
||||
libini, 'libini.obj'
|
||||
|
||||
import libini, \
|
||||
ini_set_int ,'ini_set_int'
|
||||
|
||||
aIni db '/sys/settings/system.ini',0
|
||||
aSectionSkn db 'style',0
|
||||
aButtonStyle db 'buttons_gradient',0
|
||||
;---------------------------------------------------------------------
|
||||
l_libs_start:
|
||||
|
||||
library01 l_libs system_dir_Boxlib+9, library_path, system_dir_Boxlib, \
|
||||
Box_lib_import
|
||||
|
||||
library02 l_libs system_dir_ProcLib+9, library_path, system_dir_ProcLib, \
|
||||
ProcLib_import
|
||||
|
||||
end_l_libs:
|
||||
;---------------------------------------------------------------------
|
||||
system_dir_Boxlib db '/sys/lib/box_lib.obj',0
|
||||
system_dir_ProcLib db '/sys/lib/proc_lib.obj',0
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
|
||||
ProcLib_import:
|
||||
OpenDialog_Init dd aOpenDialog_Init
|
||||
OpenDialog_Start dd aOpenDialog_Start
|
||||
|
||||
ColorDialog_Init dd aColorDialog_Init
|
||||
ColorDialog_Start dd aColorDialog_Start
|
||||
;OpenDialog__Version dd aOpenDialog_Version
|
||||
dd 0
|
||||
dd 0
|
||||
|
||||
aOpenDialog_Init db 'OpenDialog_init',0
|
||||
aOpenDialog_Start db 'OpenDialog_start',0
|
||||
|
||||
aColorDialog_Init db 'ColorDialog_init',0
|
||||
aColorDialog_Start db 'ColorDialog_start',0
|
||||
;aOpenDialog_Version db 'Version_OpenDialog',0
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
Box_lib_import:
|
||||
;init_lib dd a_init
|
||||
;version_lib dd a_version
|
||||
|
||||
|
||||
;edit_box_draw dd aEdit_box_draw
|
||||
;edit_box_key dd aEdit_box_key
|
||||
;edit_box_mouse dd aEdit_box_mouse
|
||||
;version_ed dd aVersion_ed
|
||||
|
||||
;check_box_draw dd aCheck_box_draw
|
||||
;check_box_mouse dd aCheck_box_mouse
|
||||
;version_ch dd aVersion_ch
|
||||
|
||||
;option_box_draw dd aOption_box_draw
|
||||
;option_box_mouse dd aOption_box_mouse
|
||||
;version_op dd aVersion_op
|
||||
|
||||
;scrollbar_ver_draw dd aScrollbar_ver_draw
|
||||
;scrollbar_ver_mouse dd aScrollbar_ver_mouse
|
||||
;scrollbar_hor_draw dd aScrollbar_hor_draw
|
||||
;scrollbar_hor_mouse dd aScrollbar_hor_mouse
|
||||
;version_scrollbar dd aVersion_scrollbar
|
||||
|
||||
;dinamic_button_draw dd aDbutton_draw
|
||||
;dinamic_button_mouse dd aDbutton_mouse
|
||||
;version_dbutton dd aVersion_dbutton
|
||||
|
||||
;menu_bar_draw dd aMenu_bar_draw
|
||||
;menu_bar_mouse dd aMenu_bar_mouse
|
||||
;menu_bar_activate dd aMenu_bar_activate
|
||||
;version_menu_bar dd aVersion_menu_bar
|
||||
|
||||
;FileBrowser_draw dd aFileBrowser_draw
|
||||
;FileBrowser_mouse dd aFileBrowser_mouse
|
||||
;FileBrowser_key dd aFileBrowser_key
|
||||
;Version_FileBrowser dd aVersion_FileBrowser
|
||||
|
||||
PathShow_prepare dd sz_PathShow_prepare
|
||||
PathShow_draw dd sz_PathShow_draw
|
||||
;Version_path_show dd szVersion_path_show
|
||||
|
||||
Frame_draw dd sz_Frame_draw
|
||||
;Version_frame dd szVersion_frame
|
||||
|
||||
dd 0,0
|
||||
|
||||
;a_init db 'lib_init',0
|
||||
;a_version db 'version',0
|
||||
|
||||
;aEdit_box_draw db 'edit_box_draw',0
|
||||
;aEdit_box_key db 'edit_box_key',0
|
||||
;aEdit_box_mouse db 'edit_box_mouse',0
|
||||
;aVersion_ed db 'version_ed',0
|
||||
|
||||
;aCheck_box_draw db 'check_box_draw',0
|
||||
;aCheck_box_mouse db 'check_box_mouse',0
|
||||
;aVersion_ch db 'version_ch',0
|
||||
|
||||
;aOption_box_draw db 'option_box_draw',0
|
||||
;aOption_box_mouse db 'option_box_mouse',0
|
||||
;aVersion_op db 'version_op',0
|
||||
|
||||
;aScrollbar_ver_draw db 'scrollbar_v_draw',0
|
||||
;aScrollbar_ver_mouse db 'scrollbar_v_mouse',0
|
||||
;aScrollbar_hor_draw db 'scrollbar_h_draw',0
|
||||
;aScrollbar_hor_mouse db 'scrollbar_h_mouse',0
|
||||
;aVersion_scrollbar db 'version_scrollbar',0
|
||||
|
||||
;aDbutton_draw db 'dbutton_draw',0
|
||||
;aDbutton_mouse db 'dbutton_mouse',0
|
||||
;aVersion_dbutton db 'version_dbutton',0
|
||||
|
||||
;aMenu_bar_draw db 'menu_bar_draw',0
|
||||
;aMenu_bar_mouse db 'menu_bar_mouse',0
|
||||
;aMenu_bar_activate db 'menu_bar_activate',0
|
||||
;aVersion_menu_bar db 'version_menu_bar',0
|
||||
|
||||
;aFileBrowser_draw db 'FileBrowser_draw',0
|
||||
;aFileBrowser_mouse db 'FileBrowser_mouse',0
|
||||
;aFileBrowser_key db 'FileBrowser_key',0
|
||||
;aVersion_FileBrowser db 'version_FileBrowser',0
|
||||
|
||||
sz_PathShow_prepare db 'PathShow_prepare',0
|
||||
sz_PathShow_draw db 'PathShow_draw',0
|
||||
;szVersion_path_show db 'version_PathShow',0
|
||||
|
||||
sz_Frame_draw db 'frame_draw',0
|
||||
;szVersion_frame db 'version_frame',0
|
||||
;---------------------------------------------------------------------
|
||||
PathShow_data_1:
|
||||
.type dd 0 ;+0
|
||||
.start_y dw frame_1.y+19 ;+4
|
||||
.start_x dw frame_1.x+15 ;+6
|
||||
.font_size_x dw 6 ;+8 ; 6 - for font 0, 8 - for font 1
|
||||
.area_size_x dw frame_1.w-28 ;+10
|
||||
.font_number dd 0 ;+12 ; 0 - monospace, 1 - variable
|
||||
.background_flag dd 0 ;+16
|
||||
.font_color dd 0x0 ;+20
|
||||
.background_color dd 0x0 ;+24
|
||||
.text_pointer dd dtp_name ;+28
|
||||
.work_area_pointer dd text_work_area ;+32
|
||||
.temp_text_length dd 0 ;+36
|
||||
;---------------------------------------------------------------------
|
||||
PathShow_data_2:
|
||||
.type dd 0 ;+0
|
||||
.start_y dw frame_2.y+19 ;+4
|
||||
.start_x dw frame_2.x+15 ;+6
|
||||
.font_size_x dw 6 ;+8 ; 6 - for font 0, 8 - for font 1
|
||||
.area_size_x dw frame_2.w-28 ;+10
|
||||
.font_number dd 0 ;+12 ; 0 - monospace, 1 - variable
|
||||
.background_flag dd 0 ;+16
|
||||
.font_color dd 0x0 ;+20
|
||||
.background_color dd 0x0 ;+24
|
||||
.text_pointer dd skin_info ;+28
|
||||
.work_area_pointer dd text_work_area2 ;+32
|
||||
.temp_text_length dd 0 ;+36
|
||||
;---------------------------------------------------------------------
|
||||
OpenDialog_data:
|
||||
.type dd 0
|
||||
.procinfo dd procinfo ;+4
|
||||
.com_area_name dd communication_area_name ;+8
|
||||
.com_area dd 0 ;+12
|
||||
.opendir_pach dd temp_dir_pach ;+16
|
||||
.dir_default_pach dd communication_area_default_pach ;+20
|
||||
.start_path dd open_dialog_path ;+24
|
||||
.draw_window dd draw_window ;+28
|
||||
.status dd 0 ;+32
|
||||
.openfile_pach dd dtp_name ;+36
|
||||
.filename_area dd filename_area ;+40
|
||||
.filter_area dd Filter
|
||||
.x:
|
||||
.x_size dw 420 ;+48 ; Window X size
|
||||
.x_start dw 10 ;+50 ; Window X position
|
||||
.y:
|
||||
.y_size dw 320 ;+52 ; Window y size
|
||||
.y_start dw 10 ;+54 ; Window Y position
|
||||
|
||||
OpenDialog_data2:
|
||||
.type dd 0
|
||||
.procinfo dd procinfo ;+4
|
||||
.com_area_name dd communication_area_name2 ;+8
|
||||
.com_area dd 0 ;+12
|
||||
.opendir_pach dd temp_dir_pach2 ;+16
|
||||
.dir_default_pach dd communication_area_default_pach ;+20
|
||||
.start_path dd open_dialog_path ;+24
|
||||
.draw_window dd draw_window ;+28
|
||||
.status dd 0 ;+32
|
||||
.openfile_pach dd skin_info ;+36
|
||||
.filename_area dd filename_area2 ;+40
|
||||
.filter_area dd Filter2
|
||||
.x:
|
||||
.x_size dw 420 ;+48 ; Window X size
|
||||
.x_start dw 10 ;+50 ; Window X position
|
||||
.y:
|
||||
.y_size dw 320 ;+52 ; Window y size
|
||||
.y_start dw 10 ;+54 ; Window Y position
|
||||
|
||||
communication_area_name2:
|
||||
db 'FFFFFFFF_open_dialog',0
|
||||
|
||||
communication_area_name:
|
||||
db 'FFFFFFFF_open_dialog2',0
|
||||
open_dialog_path:
|
||||
if __nightbuild eq yes
|
||||
db '/sys/MANAGERS/opendial',0
|
||||
else
|
||||
db '/sys/File Managers/opendial',0
|
||||
end if
|
||||
communication_area_default_pach:
|
||||
db '/sys',0
|
||||
|
||||
Filter:
|
||||
dd Filter.end - Filter
|
||||
.1:
|
||||
db 'DTP',0
|
||||
.end:
|
||||
db 0
|
||||
|
||||
Filter2:
|
||||
dd Filter.end - Filter
|
||||
.1:
|
||||
db 'SKN',0
|
||||
.end:
|
||||
db 0
|
||||
|
||||
default_skin:
|
||||
db '/sys/default.skn',0
|
||||
default_dtp:
|
||||
db '/sys/default.dtp',0
|
||||
;---------------------------------------------------------------------
|
||||
ColorDialog_data:
|
||||
.type dd 0
|
||||
.procinfo dd procinfo ;+4
|
||||
.com_area_name dd cd_communication_area_name ;+8
|
||||
.com_area dd 0 ;+12
|
||||
.start_path dd colordialog_path ;+16
|
||||
.draw_window dd draw_window ;+20
|
||||
.status dd 0 ;+24
|
||||
.x:
|
||||
.x_size dw 510 ;+28 ; Window X size
|
||||
.x_start dw 10 ;+30 ; Window X position
|
||||
.y:
|
||||
.y_size dw 310 ;+32 ; Window y size
|
||||
.y_start dw 10 ;+34 ; Window Y position
|
||||
.color_type dd 0 ;+36 ; 0- RGB, 1 or other - reserved
|
||||
.color dd 0 ;+40 ; Selected color
|
||||
|
||||
cd_communication_area_name:
|
||||
db 'FFFFFFFF_color_dialog',0
|
||||
colordialog_path:
|
||||
db '/sys/colrdial',0
|
||||
;---------------------------------------------------------------------
|
||||
frame_data:
|
||||
.type dd 0 ;+0
|
||||
.x:
|
||||
.x_size dw 0 ;+4
|
||||
.x_start dw 0 ;+6
|
||||
.y:
|
||||
.y_size dw 0 ;+8
|
||||
.y_start dw 0 ;+10
|
||||
.ext_fr_col dd 0x0 ;+12
|
||||
.int_fr_col dd 0xffffff ;+16
|
||||
.draw_text_flag dd 1 ;+20
|
||||
.text_pointer dd 0 ;+24
|
||||
.text_position dd 0 ;+28
|
||||
.font_number dd 1 ;+32
|
||||
.font_size_y dd 14 ;+36
|
||||
.font_color dd 0x0 ;+40
|
||||
.font_backgr_color dd 0xffffff ;+44
|
||||
;---------------------------------------------------------------------
|
||||
IncludeIGlobals
|
||||
|
@ -26,7 +26,7 @@
|
||||
M01header.params:
|
||||
dd app_param ; parameters
|
||||
dd cur_dir_path ; path to file
|
||||
|
||||
|
||||
include 'lang.inc'
|
||||
include '../../../proc32.inc'
|
||||
include '../../../config.inc' ;for nightbuild
|
||||
@ -85,7 +85,7 @@ frame_1:
|
||||
.y = area.y + area.height + 20
|
||||
.w = area.w + 217
|
||||
.height = 65
|
||||
;--------------------------------------
|
||||
;--------------------------------------
|
||||
frame_2:
|
||||
.x = frame_1.x
|
||||
.y = frame_1.y + frame_1.height + 20
|
||||
@ -99,11 +99,11 @@ win:
|
||||
START: ; start of execution
|
||||
;---------------------------------------------------------------------
|
||||
mcall SF_SYS_MISC,SSF_HEAP_INIT
|
||||
|
||||
test eax,eax
|
||||
jz close
|
||||
|
||||
stdcall dll.Load,LibIniImportTable
|
||||
test eax,eax
|
||||
jz close
|
||||
|
||||
stdcall dll.Load,LibIniImportTable
|
||||
load_libraries l_libs_start,end_l_libs
|
||||
|
||||
;if return code =-1 then exit, else nornary work
|
||||
@ -125,7 +125,7 @@ load_libraries l_libs_start,end_l_libs
|
||||
cmp ecx, '.dtp'
|
||||
je load_dtp_from_param
|
||||
jmp no_param
|
||||
|
||||
|
||||
load_dtp_from_param:
|
||||
stdcall string.copy, [M01header.params], dtp_name
|
||||
call load_dtp_file.1
|
||||
@ -139,8 +139,8 @@ load_skin_from_param:
|
||||
no_param:
|
||||
mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,color_table,4*10 ; get current colors
|
||||
call load_skin_file.2
|
||||
|
||||
skin_path_ready:
|
||||
|
||||
skin_path_ready:
|
||||
;---------------------------------------------------------------------
|
||||
;OpenDialog initialisation
|
||||
push dword OpenDialog_data
|
||||
@ -156,13 +156,13 @@ skin_path_ready:
|
||||
; prepare for PathShow
|
||||
push dword PathShow_data_1
|
||||
call [PathShow_prepare]
|
||||
|
||||
|
||||
push dword PathShow_data_2
|
||||
call [PathShow_prepare]
|
||||
;---------------------------------------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
red:
|
||||
call draw_window ; at first, draw the window
|
||||
;---------------------------------------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
still:
|
||||
mcall SF_WAIT_EVENT
|
||||
|
||||
@ -250,19 +250,19 @@ no_apply_skin:
|
||||
|
||||
cmp ah,41
|
||||
jg no_new_colour
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
.start_ColorDialog:
|
||||
push dword ColorDialog_data
|
||||
call [ColorDialog_Start]
|
||||
; 2 - use another method/not found program
|
||||
cmp [ColorDialog_data.status],2
|
||||
je still
|
||||
; 1 - OK, color selected
|
||||
; 1 - OK, color selected
|
||||
cmp [ColorDialog_data.status],1
|
||||
jne still
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
shr eax,8
|
||||
sub eax,31
|
||||
shl eax,2
|
||||
@ -449,9 +449,9 @@ newcol:
|
||||
add bx,4
|
||||
sub ecx,2 shl 16
|
||||
add cx,4
|
||||
|
||||
|
||||
mov [frame_data.x],ebx
|
||||
mov [frame_data.y],ecx
|
||||
mov [frame_data.y],ecx
|
||||
|
||||
push dword frame_data
|
||||
call [Frame_draw]
|
||||
@ -473,7 +473,7 @@ draw_PathShow:
|
||||
; draw for PathShow
|
||||
push dword PathShow_data_1
|
||||
call [PathShow_draw]
|
||||
|
||||
|
||||
push dword PathShow_data_2
|
||||
call [PathShow_draw]
|
||||
popa
|
||||
@ -498,7 +498,7 @@ draw_window:
|
||||
mcall ,<110, win.w>,,,,title
|
||||
|
||||
mcall SF_THREAD_INFO,procinfo,-1
|
||||
|
||||
|
||||
mov eax,[procinfo+70] ;status of window
|
||||
test eax,100b
|
||||
jne .end
|
||||
@ -527,8 +527,8 @@ draw_window:
|
||||
mcall SF_DEFINE_BUTTON,,,16 ; button 17
|
||||
; select color DTP button text
|
||||
mcall SF_DRAW_TEXT,<frame_1.x+16,frame_1.y+44>,[w_work_button_text],t1,t1.size
|
||||
;-----------------------------------
|
||||
; select skin frame
|
||||
;-----------------------------------
|
||||
; select skin frame
|
||||
; LOAD SKIN BUTTON ; button 17
|
||||
mcall SF_DEFINE_BUTTON,<frame_2.x+10,load_w>,<frame_2.y+38,18>,17,[w_work_button]
|
||||
; 3D
|
||||
@ -543,7 +543,7 @@ draw_window:
|
||||
mcall ,,,18 ; button 18
|
||||
; select skin button text
|
||||
mcall SF_DRAW_TEXT,<frame_2.x+16,frame_2.y+44>,[w_work_button_text],t2,t2.size
|
||||
;-----------------------------------
|
||||
;-----------------------------------
|
||||
call draw_button_row
|
||||
call draw_button_row_of_texts
|
||||
call draw_colours
|
||||
@ -556,7 +556,7 @@ draw_window:
|
||||
mov eax,[w_work_text]
|
||||
mov [frame_data.font_color],eax
|
||||
mov [frame_data.draw_text_flag],dword 1
|
||||
|
||||
|
||||
push dword frame_data
|
||||
call [Frame_draw]
|
||||
;-----------------------------------
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -35,7 +35,7 @@ no_def_width:
|
||||
|
||||
cmp [place_attachment],1
|
||||
je @f
|
||||
|
||||
|
||||
xor ecx,ecx
|
||||
mov cx,[height]
|
||||
dec cx
|
||||
@ -51,19 +51,19 @@ align 4
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.attachment_selected:
|
||||
xor eax,eax ; DEFINE AND DRAW WINDOW
|
||||
xor eax,eax ; DEFINE AND DRAW WINDOW
|
||||
mov edx, [wcolor]
|
||||
or edx, 0x01000000 ; do not draw the window
|
||||
mov esi, [wcolor]
|
||||
or esi, 0x01000000 ; unmovable window
|
||||
mov edi, [wcolor]
|
||||
mov [panel_x_pos], ebx
|
||||
mov [panel_y_pos], ecx ; Ïîêà ÷òî òàê.
|
||||
mov [panel_y_pos], ecx ; So far ok
|
||||
mcall
|
||||
|
||||
movzx eax,word [screenxy+2]
|
||||
mov [max_x],eax
|
||||
|
||||
|
||||
call fill_window
|
||||
call minimize_left_button
|
||||
call minimize_right_button
|
||||
@ -78,7 +78,7 @@ align 4
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
fill_window:
|
||||
fill_window:
|
||||
movzx ebx,word [screenxy+2]
|
||||
xor ecx,ecx
|
||||
mov edx,[wcolor]
|
||||
@ -192,7 +192,7 @@ align 4
|
||||
.exit:
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
align 4
|
||||
minimize_right_button:
|
||||
cmp [minimize_right],dword 0
|
||||
je .exit
|
||||
@ -247,19 +247,19 @@ align 4
|
||||
mov ecx, [height]
|
||||
mov edx, 0x60d1ff01
|
||||
mcall 8,,,,[wcolor] ; MENU BUTTON
|
||||
|
||||
|
||||
mov eax,ebx
|
||||
shr eax,16
|
||||
mov [menu_button_x.start],eax
|
||||
|
||||
|
||||
mov eax,ebx
|
||||
and eax,0xffff
|
||||
mov [menu_button_x.size],eax
|
||||
|
||||
|
||||
mov eax,ecx
|
||||
shr eax,16
|
||||
mov [menu_button_y.start],eax
|
||||
|
||||
|
||||
mov eax,ecx
|
||||
and eax,0xffff
|
||||
mov [menu_button_y.size],eax
|
||||
@ -268,7 +268,7 @@ align 4
|
||||
mov edx,[MenuButton_color] ;0x44aa44
|
||||
mov esi,[wcolor]
|
||||
add ebx,3 shl 16 - 5
|
||||
call draw_appl_button
|
||||
call draw_appl_button
|
||||
|
||||
add ebx, 4*65536
|
||||
mov bx,[height]
|
||||
@ -276,7 +276,7 @@ align 4
|
||||
sub bx,7
|
||||
mov ecx,[PanelText_color]
|
||||
or ecx,0x10000000
|
||||
if lang eq et_EE
|
||||
if lang eq et_ET
|
||||
mcall 4,,,m_text,5
|
||||
else
|
||||
mcall 4,,,m_text,4
|
||||
@ -289,7 +289,7 @@ no_menu:
|
||||
je .exit
|
||||
; calculate and draw clean desktop button
|
||||
mov ebx, (0 shl 16) + CLD_SIZE-5
|
||||
; check for left minimize button enabled
|
||||
; check for left minimize button enabled
|
||||
cmp [minimize_left],dword 0
|
||||
je @f
|
||||
|
||||
@ -300,7 +300,7 @@ align 4
|
||||
; check for menu button enabled
|
||||
cmp [menu_enable],dword 0
|
||||
je @f
|
||||
|
||||
|
||||
add ebx, MENU_SIZE shl 16
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@ -311,7 +311,7 @@ align 4
|
||||
mov edx, 0x60000000 + 103
|
||||
mov ecx, [height]
|
||||
mcall 8 ;,,<3,13>
|
||||
|
||||
|
||||
call calculate_button_y_coordinate_and_size
|
||||
mov edx,[CleanDesktopButton_color] ;time_bgr_color
|
||||
mov esi,[wcolor]
|
||||
@ -354,31 +354,31 @@ align 4
|
||||
@@:
|
||||
cmp [clock_enable],dword 0
|
||||
je @f
|
||||
|
||||
|
||||
sub eax,CLOCK_SIZE
|
||||
;--------------------------------------
|
||||
align 4
|
||||
align 4
|
||||
@@:
|
||||
cmp [cpu_usage_enable],dword 0
|
||||
je @f
|
||||
|
||||
|
||||
sub eax,CPU_USAGE_SIZE
|
||||
;--------------------------------------
|
||||
align 4
|
||||
align 4
|
||||
@@:
|
||||
cmp [chlang_enable],dword 0
|
||||
je @f
|
||||
|
||||
|
||||
sub eax,CHLANG_SIZE
|
||||
;--------------------------------------
|
||||
align 4
|
||||
align 4
|
||||
@@:
|
||||
cmp [page_list_enable],dword 0
|
||||
je @f
|
||||
|
||||
|
||||
sub eax,PAGE_LIST_SIZE
|
||||
;--------------------------------------
|
||||
align 4
|
||||
align 4
|
||||
@@:
|
||||
mov ebx, TAB_SIZE
|
||||
xor edx,edx
|
||||
@ -419,11 +419,11 @@ calculate_offset_X:
|
||||
add eax, ML_SIZE
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
@@:
|
||||
; check for menu button enabled
|
||||
cmp [menu_enable],dword 0
|
||||
je @f
|
||||
|
||||
|
||||
add eax, MENU_SIZE
|
||||
;--------------------------------------
|
||||
align 4
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,301 +1,303 @@
|
||||
;-----------------------------------------------------------------------------
|
||||
s_text:
|
||||
if lang eq ru_RU
|
||||
db '‚ë¡®à ä ©« ',0
|
||||
else
|
||||
db 'Select file',0
|
||||
end if
|
||||
;-----------------------------------------------------------------------------
|
||||
r_text:
|
||||
if lang eq ru_RU
|
||||
db '<27>ãáª',0
|
||||
else
|
||||
db 'Start',0
|
||||
end if
|
||||
;-----------------------------------------------------------------------------
|
||||
result_table_text:
|
||||
if lang eq ru_RU
|
||||
db '<27> §¬¥à —⥨¥ (Š<>/á) ‡ ¯¨áì (Š<>/á)',0
|
||||
else
|
||||
db 'Size Read (KB/s) Write (KB/s)',0
|
||||
end if
|
||||
;-----------------------------------------------------------------------------
|
||||
title db 'File Speed v0.3',0
|
||||
;-----------------------------------------------------------------------------
|
||||
include_debug_strings
|
||||
;-----------------------------------------------------------------------------
|
||||
l_libs_start:
|
||||
|
||||
library01 l_libs system_dir_Boxlib+9, library_path, system_dir_Boxlib, Box_lib_import
|
||||
|
||||
library02 l_libs system_dir_ProcLib+9, library_path, system_dir_ProcLib, ProcLib_import
|
||||
|
||||
end_l_libs:
|
||||
;-----------------------------------------------------------------------------
|
||||
system_dir_Boxlib db '/sys/lib/box_lib.obj',0
|
||||
system_dir_ProcLib db '/sys/lib/proc_lib.obj',0
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
ProcLib_import:
|
||||
OpenDialog_Init dd aOpenDialog_Init
|
||||
OpenDialog_Start dd aOpenDialog_Start
|
||||
;OpenDialog_Version dd aOpenDialog_Version
|
||||
|
||||
;ColorDialog_Init dd aColorDialog_Init
|
||||
;ColorDialog_Start dd aColorDialog_Start
|
||||
;ColorDialog_Version dd aColorDialog_Version
|
||||
|
||||
dd 0
|
||||
dd 0
|
||||
|
||||
aOpenDialog_Init db 'OpenDialog_init',0
|
||||
aOpenDialog_Start db 'OpenDialog_start',0
|
||||
;aOpenDialog_Version db 'Version_OpenDialog',0
|
||||
|
||||
;aColorDialog_Init db 'ColorDialog_init',0
|
||||
;aColorDialog_Start db 'ColorDialog_start',0
|
||||
;aColorDialog_Version db 'Version_ColorDialog',0
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
Box_lib_import:
|
||||
;init_lib dd a_init
|
||||
;version_lib dd a_version
|
||||
|
||||
|
||||
;edit_box_draw dd aEdit_box_draw
|
||||
;edit_box_key dd aEdit_box_key
|
||||
;edit_box_mouse dd aEdit_box_mouse
|
||||
;version_ed dd aVersion_ed
|
||||
|
||||
init_checkbox dd aInit_checkbox
|
||||
check_box_draw dd aCheck_box_draw
|
||||
check_box_mouse dd aCheck_box_mouse
|
||||
;version_ch dd aVersion_ch
|
||||
|
||||
;option_box_draw dd aOption_box_draw
|
||||
;option_box_mouse dd aOption_box_mouse
|
||||
;version_op dd aVersion_op
|
||||
|
||||
;scrollbar_ver_draw dd aScrollbar_ver_draw
|
||||
;scrollbar_ver_mouse dd aScrollbar_ver_mouse
|
||||
;scrollbar_hor_draw dd aScrollbar_hor_draw
|
||||
;scrollbar_hor_mouse dd aScrollbar_hor_mouse
|
||||
;version_scrollbar dd aVersion_scrollbar
|
||||
|
||||
;dinamic_button_draw dd aDbutton_draw
|
||||
;dinamic_button_mouse dd aDbutton_mouse
|
||||
;version_dbutton dd aVersion_dbutton
|
||||
|
||||
;menu_bar_draw dd aMenu_bar_draw
|
||||
;menu_bar_mouse dd aMenu_bar_mouse
|
||||
;menu_bar_activate dd aMenu_bar_activate
|
||||
;version_menu_bar dd aVersion_menu_bar
|
||||
|
||||
;FileBrowser_draw dd aFileBrowser_draw
|
||||
;FileBrowser_mouse dd aFileBrowser_mouse
|
||||
;FileBrowser_key dd aFileBrowser_key
|
||||
;Version_FileBrowser dd aVersion_FileBrowser
|
||||
|
||||
PathShow_prepare dd sz_PathShow_prepare
|
||||
PathShow_draw dd sz_PathShow_draw
|
||||
;Version_path_show dd szVersion_path_show
|
||||
|
||||
;Frame_draw dd sz_Frame_draw
|
||||
;Version_frame dd szVersion_frame
|
||||
|
||||
dd 0,0
|
||||
|
||||
;a_init db 'lib_init',0
|
||||
;a_version db 'version',0
|
||||
|
||||
;aEdit_box_draw db 'edit_box_draw',0
|
||||
;aEdit_box_key db 'edit_box_key',0
|
||||
;aEdit_box_mouse db 'edit_box_mouse',0
|
||||
;aVersion_ed db 'version_ed',0
|
||||
|
||||
aInit_checkbox db 'init_checkbox2',0
|
||||
aCheck_box_draw db 'check_box_draw2',0
|
||||
aCheck_box_mouse db 'check_box_mouse2',0
|
||||
;aVersion_ch db 'version_ch2',0
|
||||
|
||||
;aOption_box_draw db 'option_box_draw',0
|
||||
;aOption_box_mouse db 'option_box_mouse',0
|
||||
;aVersion_op db 'version_op',0
|
||||
|
||||
;aScrollbar_ver_draw db 'scrollbar_v_draw',0
|
||||
;aScrollbar_ver_mouse db 'scrollbar_v_mouse',0
|
||||
;aScrollbar_hor_draw db 'scrollbar_h_draw',0
|
||||
;aScrollbar_hor_mouse db 'scrollbar_h_mouse',0
|
||||
;aVersion_scrollbar db 'version_scrollbar',0
|
||||
|
||||
;aDbutton_draw db 'dbutton_draw',0
|
||||
;aDbutton_mouse db 'dbutton_mouse',0
|
||||
;aVersion_dbutton db 'version_dbutton',0
|
||||
|
||||
;aMenu_bar_draw db 'menu_bar_draw',0
|
||||
;aMenu_bar_mouse db 'menu_bar_mouse',0
|
||||
;aMenu_bar_activate db 'menu_bar_activate',0
|
||||
;aVersion_menu_bar db 'version_menu_bar',0
|
||||
|
||||
;aFileBrowser_draw db 'FileBrowser_draw',0
|
||||
;aFileBrowser_mouse db 'FileBrowser_mouse',0
|
||||
;aFileBrowser_key db 'FileBrowser_key',0
|
||||
;aVersion_FileBrowser db 'version_FileBrowser',0
|
||||
|
||||
sz_PathShow_prepare db 'PathShow_prepare',0
|
||||
sz_PathShow_draw db 'PathShow_draw',0
|
||||
;szVersion_path_show db 'version_PathShow',0
|
||||
|
||||
;sz_Frame_draw db 'frame_draw',0
|
||||
;szVersion_frame db 'version_frame',0
|
||||
;-----------------------------------------------------------------------------
|
||||
PathShow_data:
|
||||
.type dd 0 ;+0
|
||||
.start_y dw 5+4 ;+4
|
||||
.start_x dw 5+5 ;+6
|
||||
.font_size_x dw 6 ;+8 ; 6 - for font 0, 8 - for font 1
|
||||
.area_size_x dw 400-30 ;+10
|
||||
.font_number dd 0 ;+12 ; 0 - monospace, 1 - variable
|
||||
.background_flag dd 0 ;+16
|
||||
.font_color dd 0x0 ;+20
|
||||
.background_color dd 0x0 ;+24
|
||||
.text_pointer dd fname ;+28
|
||||
.work_area_pointer dd text_work_area ;+32
|
||||
.temp_text_length dd 0 ;+36
|
||||
;-----------------------------------------------------------------------------
|
||||
check1 check_box2 (100 shl 16)+12,(27 shl 16)+12,6,0xFFFFFF,0,0xffffff,\
|
||||
check_text1,ch_flag_middle
|
||||
|
||||
check_text1:
|
||||
if lang eq ru_RU
|
||||
db '’¥áâ¨à®¢ âì § ¯¨áì',0
|
||||
else
|
||||
db 'Use testing of write',0
|
||||
end if
|
||||
|
||||
check_box_warning_text:
|
||||
if lang eq ru_RU
|
||||
db '‚<>ˆŒ€<C592>ˆ…! <20>஢¥àª ᪮à®á⨠§ ¯¨á¨ ã¨ç⮦ ¥â ᮤ¥à¦¨¬®¥ ä ©« !',0
|
||||
else
|
||||
db 'WARNING! Testing of write speed is destroy contents of file!',0
|
||||
end if
|
||||
;-----------------------------------------------------------------------------
|
||||
OpenDialog_data:
|
||||
.type dd 0
|
||||
.procinfo dd process_info ;+4
|
||||
.com_area_name dd communication_area_name ;+8
|
||||
.com_area dd 0 ;+12
|
||||
.opendir_pach dd temp_dir_pach ;+16
|
||||
.dir_default_pach dd communication_area_default_pach ;+20
|
||||
.start_path dd open_dialog_path ;+24
|
||||
.draw_window dd draw_window ;+28
|
||||
.status dd 0 ;+32
|
||||
.openfile_pach dd fname ;+36
|
||||
.filename_area dd filename_area ;+40
|
||||
.filter_area dd Filter
|
||||
.x:
|
||||
.x_size dw 420 ;+48 ; Window X size
|
||||
.x_start dw 10 ;+50 ; Window X position
|
||||
.y:
|
||||
.y_size dw 320 ;+52 ; Window y size
|
||||
.y_start dw 10 ;+54 ; Window Y position
|
||||
|
||||
communication_area_name:
|
||||
db 'FFFFFFFF_open_dialog2',0
|
||||
|
||||
open_dialog_path:
|
||||
if __nightbuild eq yes
|
||||
db '/sys/MANAGERS/opendial',0
|
||||
else
|
||||
db '/sys/File Managers/opendial',0
|
||||
end if
|
||||
|
||||
communication_area_default_pach:
|
||||
db '/sys',0
|
||||
|
||||
Filter:
|
||||
dd Filter.end - Filter.1
|
||||
.1:
|
||||
;db 'BIN',0
|
||||
;db 'DAT',0
|
||||
.end:
|
||||
db 0
|
||||
|
||||
start_temp_file_name:
|
||||
db 'default.dtp',0
|
||||
|
||||
default_dtp:
|
||||
db '/sys/default.dtp',0
|
||||
;-----------------------------------------------------------------------------
|
||||
sector equ 512
|
||||
;--------------------------------------
|
||||
result_table:
|
||||
dd a512b, 0, 0, sector*1
|
||||
dd a1K, 1, 1, sector*2
|
||||
dd a2K, 2, 2, sector*4
|
||||
dd a4K, 3, 3, sector*8
|
||||
dd a8K, 4, 4, sector*16
|
||||
dd a16K, 5, 5, sector*32
|
||||
dd a32K, 6, 6, sector*64
|
||||
dd a64K, 7, 7, sector*128
|
||||
dd a128K, 8, 8, sector*256
|
||||
dd a256K, 9, 9, sector*512
|
||||
dd a512K, 10, 10, sector*1024
|
||||
dd a1M, 11, 11, sector*2*1024
|
||||
dd a2M, 12, 12, sector*4*1024
|
||||
dd a4M, 13, 13, sector*8*1024
|
||||
dd a8M, 14, 14, sector*16*1024
|
||||
dd a16M, 15, 15, sector*32*1024
|
||||
dd a32M, 16, 16, sector*64*1024
|
||||
dd a64M, 17, 17, sector*128*1024
|
||||
;-----------------------------------------------------------------------------
|
||||
a512b db ' 512',0
|
||||
a1K db ' 1K',0
|
||||
a2K db ' 2K',0
|
||||
a4K db ' 4K',0
|
||||
a8K db ' 8K',0
|
||||
a16K db ' 16K',0
|
||||
a32K db ' 32K',0
|
||||
a64K db ' 64K',0
|
||||
a128K db '128K',0
|
||||
a256K db '256K',0
|
||||
a512K db '512K',0
|
||||
a1M db ' 1M',0
|
||||
a2M db ' 2M',0
|
||||
a4M db ' 4M',0
|
||||
a8M db ' 8M',0
|
||||
a16M db ' 16M',0
|
||||
a32M db ' 32M',0
|
||||
a64M db ' 64M',0
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
fileinfo:
|
||||
.subfunction dd 5
|
||||
.offset dd 0
|
||||
.offset_1 dd 0
|
||||
.size dd 0
|
||||
.return dd file_info
|
||||
db 0
|
||||
.name: dd fname
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
fileread:
|
||||
.subfunction dd 0
|
||||
.offset dd 0
|
||||
.offset_1 dd 0
|
||||
.size dd 0
|
||||
.return dd process_info
|
||||
db 0
|
||||
.name: dd fname
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
filewrite:
|
||||
.subfunction dd 3
|
||||
.offset dd 0
|
||||
.offset_1 dd 0
|
||||
.size dd 0
|
||||
.data dd process_info
|
||||
db 0
|
||||
.name: dd fname
|
||||
;-----------------------------------------------------------------------------
|
||||
; Language support for locales: ru_RU (CP866), en_US.
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
s_text:
|
||||
if lang eq ru_RU
|
||||
db '‚ë¡®à ä ©« ',0
|
||||
else ; Default to en_US
|
||||
db 'Select file',0
|
||||
end if
|
||||
;-----------------------------------------------------------------------------
|
||||
r_text:
|
||||
if lang eq ru_RU
|
||||
db '<27>ãáª',0
|
||||
else ; Default to en_US
|
||||
db 'Start',0
|
||||
end if
|
||||
;-----------------------------------------------------------------------------
|
||||
result_table_text:
|
||||
if lang eq ru_RU
|
||||
db '<27> §¬¥à —⥨¥ (Š<>/á) ‡ ¯¨áì (Š<>/á)',0
|
||||
else ; Default to en_US
|
||||
db 'Size Read (KB/s) Write (KB/s)',0
|
||||
end if
|
||||
;-----------------------------------------------------------------------------
|
||||
title db 'File Speed v0.3',0
|
||||
;-----------------------------------------------------------------------------
|
||||
include_debug_strings
|
||||
;-----------------------------------------------------------------------------
|
||||
l_libs_start:
|
||||
|
||||
library01 l_libs system_dir_Boxlib+9, library_path, system_dir_Boxlib, Box_lib_import
|
||||
|
||||
library02 l_libs system_dir_ProcLib+9, library_path, system_dir_ProcLib, ProcLib_import
|
||||
|
||||
end_l_libs:
|
||||
;-----------------------------------------------------------------------------
|
||||
system_dir_Boxlib db '/sys/lib/box_lib.obj',0
|
||||
system_dir_ProcLib db '/sys/lib/proc_lib.obj',0
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
ProcLib_import:
|
||||
OpenDialog_Init dd aOpenDialog_Init
|
||||
OpenDialog_Start dd aOpenDialog_Start
|
||||
;OpenDialog_Version dd aOpenDialog_Version
|
||||
|
||||
;ColorDialog_Init dd aColorDialog_Init
|
||||
;ColorDialog_Start dd aColorDialog_Start
|
||||
;ColorDialog_Version dd aColorDialog_Version
|
||||
|
||||
dd 0
|
||||
dd 0
|
||||
|
||||
aOpenDialog_Init db 'OpenDialog_init',0
|
||||
aOpenDialog_Start db 'OpenDialog_start',0
|
||||
;aOpenDialog_Version db 'Version_OpenDialog',0
|
||||
|
||||
;aColorDialog_Init db 'ColorDialog_init',0
|
||||
;aColorDialog_Start db 'ColorDialog_start',0
|
||||
;aColorDialog_Version db 'Version_ColorDialog',0
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
Box_lib_import:
|
||||
;init_lib dd a_init
|
||||
;version_lib dd a_version
|
||||
|
||||
|
||||
;edit_box_draw dd aEdit_box_draw
|
||||
;edit_box_key dd aEdit_box_key
|
||||
;edit_box_mouse dd aEdit_box_mouse
|
||||
;version_ed dd aVersion_ed
|
||||
|
||||
init_checkbox dd aInit_checkbox
|
||||
check_box_draw dd aCheck_box_draw
|
||||
check_box_mouse dd aCheck_box_mouse
|
||||
;version_ch dd aVersion_ch
|
||||
|
||||
;option_box_draw dd aOption_box_draw
|
||||
;option_box_mouse dd aOption_box_mouse
|
||||
;version_op dd aVersion_op
|
||||
|
||||
;scrollbar_ver_draw dd aScrollbar_ver_draw
|
||||
;scrollbar_ver_mouse dd aScrollbar_ver_mouse
|
||||
;scrollbar_hor_draw dd aScrollbar_hor_draw
|
||||
;scrollbar_hor_mouse dd aScrollbar_hor_mouse
|
||||
;version_scrollbar dd aVersion_scrollbar
|
||||
|
||||
;dinamic_button_draw dd aDbutton_draw
|
||||
;dinamic_button_mouse dd aDbutton_mouse
|
||||
;version_dbutton dd aVersion_dbutton
|
||||
|
||||
;menu_bar_draw dd aMenu_bar_draw
|
||||
;menu_bar_mouse dd aMenu_bar_mouse
|
||||
;menu_bar_activate dd aMenu_bar_activate
|
||||
;version_menu_bar dd aVersion_menu_bar
|
||||
|
||||
;FileBrowser_draw dd aFileBrowser_draw
|
||||
;FileBrowser_mouse dd aFileBrowser_mouse
|
||||
;FileBrowser_key dd aFileBrowser_key
|
||||
;Version_FileBrowser dd aVersion_FileBrowser
|
||||
|
||||
PathShow_prepare dd sz_PathShow_prepare
|
||||
PathShow_draw dd sz_PathShow_draw
|
||||
;Version_path_show dd szVersion_path_show
|
||||
|
||||
;Frame_draw dd sz_Frame_draw
|
||||
;Version_frame dd szVersion_frame
|
||||
|
||||
dd 0,0
|
||||
|
||||
;a_init db 'lib_init',0
|
||||
;a_version db 'version',0
|
||||
|
||||
;aEdit_box_draw db 'edit_box_draw',0
|
||||
;aEdit_box_key db 'edit_box_key',0
|
||||
;aEdit_box_mouse db 'edit_box_mouse',0
|
||||
;aVersion_ed db 'version_ed',0
|
||||
|
||||
aInit_checkbox db 'init_checkbox2',0
|
||||
aCheck_box_draw db 'check_box_draw2',0
|
||||
aCheck_box_mouse db 'check_box_mouse2',0
|
||||
;aVersion_ch db 'version_ch2',0
|
||||
|
||||
;aOption_box_draw db 'option_box_draw',0
|
||||
;aOption_box_mouse db 'option_box_mouse',0
|
||||
;aVersion_op db 'version_op',0
|
||||
|
||||
;aScrollbar_ver_draw db 'scrollbar_v_draw',0
|
||||
;aScrollbar_ver_mouse db 'scrollbar_v_mouse',0
|
||||
;aScrollbar_hor_draw db 'scrollbar_h_draw',0
|
||||
;aScrollbar_hor_mouse db 'scrollbar_h_mouse',0
|
||||
;aVersion_scrollbar db 'version_scrollbar',0
|
||||
|
||||
;aDbutton_draw db 'dbutton_draw',0
|
||||
;aDbutton_mouse db 'dbutton_mouse',0
|
||||
;aVersion_dbutton db 'version_dbutton',0
|
||||
|
||||
;aMenu_bar_draw db 'menu_bar_draw',0
|
||||
;aMenu_bar_mouse db 'menu_bar_mouse',0
|
||||
;aMenu_bar_activate db 'menu_bar_activate',0
|
||||
;aVersion_menu_bar db 'version_menu_bar',0
|
||||
|
||||
;aFileBrowser_draw db 'FileBrowser_draw',0
|
||||
;aFileBrowser_mouse db 'FileBrowser_mouse',0
|
||||
;aFileBrowser_key db 'FileBrowser_key',0
|
||||
;aVersion_FileBrowser db 'version_FileBrowser',0
|
||||
|
||||
sz_PathShow_prepare db 'PathShow_prepare',0
|
||||
sz_PathShow_draw db 'PathShow_draw',0
|
||||
;szVersion_path_show db 'version_PathShow',0
|
||||
|
||||
;sz_Frame_draw db 'frame_draw',0
|
||||
;szVersion_frame db 'version_frame',0
|
||||
;-----------------------------------------------------------------------------
|
||||
PathShow_data:
|
||||
.type dd 0 ;+0
|
||||
.start_y dw 5+4 ;+4
|
||||
.start_x dw 5+5 ;+6
|
||||
.font_size_x dw 6 ;+8 ; 6 - for font 0, 8 - for font 1
|
||||
.area_size_x dw 400-30 ;+10
|
||||
.font_number dd 0 ;+12 ; 0 - monospace, 1 - variable
|
||||
.background_flag dd 0 ;+16
|
||||
.font_color dd 0x0 ;+20
|
||||
.background_color dd 0x0 ;+24
|
||||
.text_pointer dd fname ;+28
|
||||
.work_area_pointer dd text_work_area ;+32
|
||||
.temp_text_length dd 0 ;+36
|
||||
;-----------------------------------------------------------------------------
|
||||
check1 check_box2 (100 shl 16)+12,(27 shl 16)+12,6,0xFFFFFF,0,0xffffff,\
|
||||
check_text1,ch_flag_middle
|
||||
|
||||
check_text1:
|
||||
if lang eq ru_RU
|
||||
db '’¥áâ¨à®¢ âì § ¯¨áì',0
|
||||
else ; Default to en_US
|
||||
db 'Use testing of write',0
|
||||
end if
|
||||
|
||||
check_box_warning_text:
|
||||
if lang eq ru_RU
|
||||
db '‚<>ˆŒ€<C592>ˆ…! <20>஢¥àª ᪮à®á⨠§ ¯¨á¨ ã¨ç⮦ ¥â ᮤ¥à¦¨¬®¥ ä ©« !',0
|
||||
else ; Default to en_US
|
||||
db 'WARNING! Testing of write speed will destroy file contents!',0
|
||||
end if
|
||||
;-----------------------------------------------------------------------------
|
||||
OpenDialog_data:
|
||||
.type dd 0
|
||||
.procinfo dd process_info ;+4
|
||||
.com_area_name dd communication_area_name ;+8
|
||||
.com_area dd 0 ;+12
|
||||
.opendir_pach dd temp_dir_pach ;+16
|
||||
.dir_default_pach dd communication_area_default_pach ;+20
|
||||
.start_path dd open_dialog_path ;+24
|
||||
.draw_window dd draw_window ;+28
|
||||
.status dd 0 ;+32
|
||||
.openfile_pach dd fname ;+36
|
||||
.filename_area dd filename_area ;+40
|
||||
.filter_area dd Filter
|
||||
.x:
|
||||
.x_size dw 420 ;+48 ; Window X size
|
||||
.x_start dw 10 ;+50 ; Window X position
|
||||
.y:
|
||||
.y_size dw 320 ;+52 ; Window y size
|
||||
.y_start dw 10 ;+54 ; Window Y position
|
||||
|
||||
communication_area_name:
|
||||
db 'FFFFFFFF_open_dialog2',0
|
||||
|
||||
open_dialog_path:
|
||||
if __nightbuild eq yes
|
||||
db '/sys/MANAGERS/opendial',0
|
||||
else
|
||||
db '/sys/File Managers/opendial',0
|
||||
end if
|
||||
|
||||
communication_area_default_pach:
|
||||
db '/sys',0
|
||||
|
||||
Filter:
|
||||
dd Filter.end - Filter.1
|
||||
.1:
|
||||
;db 'BIN',0
|
||||
;db 'DAT',0
|
||||
.end:
|
||||
db 0
|
||||
|
||||
start_temp_file_name:
|
||||
db 'default.dtp',0
|
||||
|
||||
default_dtp:
|
||||
db '/sys/default.dtp',0
|
||||
;-----------------------------------------------------------------------------
|
||||
sector equ 512
|
||||
;--------------------------------------
|
||||
result_table:
|
||||
dd a512b, 0, 0, sector*1
|
||||
dd a1K, 1, 1, sector*2
|
||||
dd a2K, 2, 2, sector*4
|
||||
dd a4K, 3, 3, sector*8
|
||||
dd a8K, 4, 4, sector*16
|
||||
dd a16K, 5, 5, sector*32
|
||||
dd a32K, 6, 6, sector*64
|
||||
dd a64K, 7, 7, sector*128
|
||||
dd a128K, 8, 8, sector*256
|
||||
dd a256K, 9, 9, sector*512
|
||||
dd a512K, 10, 10, sector*1024
|
||||
dd a1M, 11, 11, sector*2*1024
|
||||
dd a2M, 12, 12, sector*4*1024
|
||||
dd a4M, 13, 13, sector*8*1024
|
||||
dd a8M, 14, 14, sector*16*1024
|
||||
dd a16M, 15, 15, sector*32*1024
|
||||
dd a32M, 16, 16, sector*64*1024
|
||||
dd a64M, 17, 17, sector*128*1024
|
||||
;-----------------------------------------------------------------------------
|
||||
a512b db ' 512',0
|
||||
a1K db ' 1K',0
|
||||
a2K db ' 2K',0
|
||||
a4K db ' 4K',0
|
||||
a8K db ' 8K',0
|
||||
a16K db ' 16K',0
|
||||
a32K db ' 32K',0
|
||||
a64K db ' 64K',0
|
||||
a128K db '128K',0
|
||||
a256K db '256K',0
|
||||
a512K db '512K',0
|
||||
a1M db ' 1M',0
|
||||
a2M db ' 2M',0
|
||||
a4M db ' 4M',0
|
||||
a8M db ' 8M',0
|
||||
a16M db ' 16M',0
|
||||
a32M db ' 32M',0
|
||||
a64M db ' 64M',0
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
fileinfo:
|
||||
.subfunction dd 5
|
||||
.offset dd 0
|
||||
.offset_1 dd 0
|
||||
.size dd 0
|
||||
.return dd file_info
|
||||
db 0
|
||||
.name: dd fname
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
fileread:
|
||||
.subfunction dd 0
|
||||
.offset dd 0
|
||||
.offset_1 dd 0
|
||||
.size dd 0
|
||||
.return dd process_info
|
||||
db 0
|
||||
.name: dd fname
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
filewrite:
|
||||
.subfunction dd 3
|
||||
.offset dd 0
|
||||
.offset_1 dd 0
|
||||
.size dd 0
|
||||
.data dd process_info
|
||||
db 0
|
||||
.name: dd fname
|
||||
;-----------------------------------------------------------------------------
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user