All: Update locale codes (Part 2) (#76)

- Update language codes and add comments.
- Correct `en_US` translations.
- Some whitespace clean-up (mainly EOL sanitation).

Reviewed-on: https://git.kolibrios.org/KolibriOS/kolibrios/pulls/76
Co-authored-by: Andrew <dent.ace@gmail.com>
Co-committed-by: Andrew <dent.ace@gmail.com>
This commit is contained in:
Andrew 2024-06-14 10:35:46 +02:00 committed by Andrew
parent c0324e5907
commit f222e98a09
93 changed files with 61410 additions and 60666 deletions

View File

@ -1,294 +1,295 @@
;---------------------------------------------------------------------
; Screen Ruler v1.0
; Version for KolibriOS 2005-2023
;---------------------------------------------------------------------
; last update: 11.09.2023
; created by: Subbotin Anton aka Spaceraven
;---------------------------------------------------------------------
use32
org 0x0
db 'MENUET01'; 8 byte id
dd 1 ; header version
dd START ; program start
dd I_END ; program image size
dd 0x1000 ; required amount of memory
dd 0x1000 ; esp
dd 0, 0 ; no parameters, no path
;---------------------------------------------------------------------
include 'lang.inc'
include '..\..\macros.inc'
delay = 20
magnify_width = 48
magnify_height = 30
magnify_halfwidth = magnify_width / 2
magnify_halfheight = magnify_height / 2
aim0 = (magnify_halfheight - 1) * 65536 + magnify_halfwidth - 1
aim1 = (magnify_halfheight - 1) * 65536 + magnify_halfwidth + 1
aim2 = (magnify_halfheight + 1) * 65536 + magnify_halfwidth - 1
aim3 = (magnify_halfheight + 1) * 65536 + magnify_halfwidth + 1
;------------------------- Main cycle
START:
redraw:
call draw_window
still:
call draw_magnify
wtevent:
mcall 23, delay ; wait here for event with timeout
dec eax
js still
jz redraw
dec eax
jnz button
; key in buffer
mov eax, 2
mcall
cmp ah, 32
jnz wtevent
mov eax, [mouse_x]
mov [pix1_x], eax
mov eax, [mouse_y]
mov [pix1_y], eax
jmp wtevent
;---------------------------------------------------------------------
button:
; we have only one button, close
or eax, -1
mcall
;------------------------- Window draw
draw_window:
mcall 12, 1
mov al, 48 ; function 48 : graphics parameters
mov bl, 4 ; subfunction 4 : get skin height
mcall
; DRAW WINDOW
mov ebx, 100*65536 + 4*magnify_width + 9
lea ecx, [eax + 100*65536 + 4*magnify_height + 128]
mov edx, 0x34000000 ; color of work area RRGGBB
mov edi, labelt ; header
xor eax, eax ; function 0 : define and draw window
mcall
mcall 71, 1, labelt
mcall 12,2
ret
;------------------------- Magnify draw
draw_magnify:
mcall 9, procinfo, -1
mov eax, [procinfo+70] ;status of window
test eax,100b
jne .end
mcall 14 ; get screen size
movzx ecx, ax
inc ecx
mov [screen_size_y], ecx
shr eax, 16
inc eax
mov [screen_size_x], eax
xor ebx, ebx
mcall 37 ; get mouse coordinates
mov ecx, eax
shr ecx, 16 ; ecx = x
movzx edx, ax ; edx = y
mov [mouse_x], ecx
mov [mouse_y], edx
add ecx, magnify_halfwidth
add edx, magnify_halfheight
mov [magnify_area_end_x], ecx
mov [magnify_area_end_y], edx
sub ecx, magnify_width
sub edx, magnify_height
mov [magnify_area_start_x], ecx
mov [magnify_area_start_y], edx
.loop_y:
.loop_x:
xor eax, eax ; assume black color for invalid pixels
test ecx, ecx
js .nopix
cmp ecx, [screen_size_x]
jge .nopix
test edx, edx
js .nopix
cmp edx, [screen_size_y]
jge .nopix
mov ebx, edx
sub ebx, [magnify_area_start_y]
shl ebx, 16
mov bx, cx
sub ebx, [magnify_area_start_x]
cmp ebx, aim0
jz .nopix
cmp ebx, aim1
jz .nopix
cmp ebx, aim2
jz .nopix
cmp ebx, aim3
jz .nopix
mov ebx, edx
imul ebx, [screen_size_x]
add ebx, ecx
mcall 35 ; read pixel
.nopix:
push ecx edx
sub ecx, [magnify_area_start_x]
sub edx, [magnify_area_start_y]
mov ebx, ecx
shl ebx, 2+16
mov bl, 4
mov ecx, edx
shl ecx, 2+16
mov cl, 4
mov edx, eax
mcall 13 ; draw rectangle 8x8
pop edx ecx
inc ecx
cmp ecx, [magnify_area_end_x]
jnz .loop_x
mov ecx, [magnify_area_start_x]
inc edx
cmp edx, [magnify_area_end_y]
jnz .loop_y
;------------------------- Measure labels draw
mov eax, 4
mov ebx, 8*65536 + 124
mov ecx, 11110000111100001111000011110000b
mov edx, start_pix
xor edi, edi
mcall 4
add ebx, 20
mov edx, end_pix
mcall 4
add ebx, 20
mov edx, measure_x
mcall 4
add ebx, 20
mov edx, measure_y
mcall 4
add ebx, 20
mov edx, measure_d
mcall 4
add ebx, 20
mov edx, inf
mcall 4
mov ebx, 0x80040000
mov ecx, [mouse_x]
mov edx, 12*8*65536 + 144
mov esi, 0x50FFFFFF
xor edi, edi
mcall 47
sub ecx, [pix1_x]
jns .sign1
neg ecx
.sign1:
mov edx, 14*8*65536 + 164
mov [dist_x], ecx
mcall 47
mov ecx, [mouse_y]
mov edx, 18*8*65536 + 144
mcall 47
sub ecx, [pix1_y]
jns .sign2
neg ecx
.sign2:
mov [dist_y], ecx
mov edx, 14*8*65536 + 184
mcall 47
mov ecx, [pix1_y]
mov edx, 18*8*65536 + 124
mcall 47
mov ecx, [pix1_x]
mov edx, 12*8*65536 + 124
mcall 47
mov eax, [dist_x]
mov ebx, eax
mul bx
mov cx, dx
shl ecx, 16
mov cx, ax
mov eax, [dist_y]
mov ebx, eax
mul bx
mov si, dx
shl esi, 16
mov si, ax
add ecx, esi
mov [diag_l], ecx
finit
fild [diag_l]
fsqrt
fistp [diag_l]
mov ebx, 0x80040000
mov ecx, [diag_l]
mov edx, 12*8*65536 + 204
mov esi, 0x50FFFFFF
xor edi, edi
mcall 47
.end:
ret
;------------------------- Data area
if lang eq ru_RU
labelt:
db 3, 'Измеритель', 0
start_pix:
db 'Пиксель 1 ( , )', 0
end_pix:
db 'Пиксель 2 ( , )', 0
measure_x:
db 'Дистанция x ( )', 0
measure_y:
db 'Дистанция y ( )', 0
measure_d:
db 'Диагональ ( )', 0
inf:
db 'Нажмите пробел', 0
else
labelt:
db 3, 'Ruler', 0
start_pix:
db 'Pixel 1 ( , )', 0
end_pix:
db 'Pixel 2 ( , )', 0
measure_x:
db 'Distance x ( )', 0
measure_y:
db 'Distance y ( )', 0
measure_d:
db 'Diagonal ( )', 0
inf:
db 'Press Space', 0
end if
I_END:
align 4
magnify_area_start_x dd ?
magnify_area_start_y dd ?
magnify_area_end_x dd ?
magnify_area_end_y dd ?
screen_size_x dd ?
screen_size_y dd ?
mouse_x dd ?
mouse_y dd ?
pix1_x dd 0
pix1_y dd 0
dist_x dd 0
dist_y dd 0
diag_l dd 0
;---------------------------------------------------------------------
procinfo:
rb 1024
;---------------------------------------------------------------------
;---------------------------------------------------------------------
; Screen Ruler v1.0
; Version for KolibriOS 2005-2023
;---------------------------------------------------------------------
; last update: 11.09.2023
; created by: Subbotin Anton aka Spaceraven
;---------------------------------------------------------------------
use32
org 0x0
db 'MENUET01'; 8 byte id
dd 1 ; header version
dd START ; program start
dd I_END ; program image size
dd 0x1000 ; required amount of memory
dd 0x1000 ; esp
dd 0, 0 ; no parameters, no path
;---------------------------------------------------------------------
include 'lang.inc' ; Language support for locales: ru_RU (UTF-8), en_US.
include '..\..\macros.inc'
delay = 20
magnify_width = 48
magnify_height = 30
magnify_halfwidth = magnify_width / 2
magnify_halfheight = magnify_height / 2
aim0 = (magnify_halfheight - 1) * 65536 + magnify_halfwidth - 1
aim1 = (magnify_halfheight - 1) * 65536 + magnify_halfwidth + 1
aim2 = (magnify_halfheight + 1) * 65536 + magnify_halfwidth - 1
aim3 = (magnify_halfheight + 1) * 65536 + magnify_halfwidth + 1
;------------------------- Main cycle
START:
redraw:
call draw_window
still:
call draw_magnify
wtevent:
mcall 23, delay ; wait here for event with timeout
dec eax
js still
jz redraw
dec eax
jnz button
; key in buffer
mov eax, 2
mcall
cmp ah, 32
jnz wtevent
mov eax, [mouse_x]
mov [pix1_x], eax
mov eax, [mouse_y]
mov [pix1_y], eax
jmp wtevent
;---------------------------------------------------------------------
button:
; we have only one button, close
or eax, -1
mcall
;------------------------- Window draw
draw_window:
mcall 12, 1
mov al, 48 ; function 48 : graphics parameters
mov bl, 4 ; subfunction 4 : get skin height
mcall
; DRAW WINDOW
mov ebx, 100*65536 + 4*magnify_width + 9
lea ecx, [eax + 100*65536 + 4*magnify_height + 128]
mov edx, 0x34000000 ; color of work area RRGGBB
mov edi, labelt ; header
xor eax, eax ; function 0 : define and draw window
mcall
mcall 71, 1, labelt
mcall 12,2
ret
;------------------------- Magnify draw
draw_magnify:
mcall 9, procinfo, -1
mov eax, [procinfo+70] ;status of window
test eax,100b
jne .end
mcall 14 ; get screen size
movzx ecx, ax
inc ecx
mov [screen_size_y], ecx
shr eax, 16
inc eax
mov [screen_size_x], eax
xor ebx, ebx
mcall 37 ; get mouse coordinates
mov ecx, eax
shr ecx, 16 ; ecx = x
movzx edx, ax ; edx = y
mov [mouse_x], ecx
mov [mouse_y], edx
add ecx, magnify_halfwidth
add edx, magnify_halfheight
mov [magnify_area_end_x], ecx
mov [magnify_area_end_y], edx
sub ecx, magnify_width
sub edx, magnify_height
mov [magnify_area_start_x], ecx
mov [magnify_area_start_y], edx
.loop_y:
.loop_x:
xor eax, eax ; assume black color for invalid pixels
test ecx, ecx
js .nopix
cmp ecx, [screen_size_x]
jge .nopix
test edx, edx
js .nopix
cmp edx, [screen_size_y]
jge .nopix
mov ebx, edx
sub ebx, [magnify_area_start_y]
shl ebx, 16
mov bx, cx
sub ebx, [magnify_area_start_x]
cmp ebx, aim0
jz .nopix
cmp ebx, aim1
jz .nopix
cmp ebx, aim2
jz .nopix
cmp ebx, aim3
jz .nopix
mov ebx, edx
imul ebx, [screen_size_x]
add ebx, ecx
mcall 35 ; read pixel
.nopix:
push ecx edx
sub ecx, [magnify_area_start_x]
sub edx, [magnify_area_start_y]
mov ebx, ecx
shl ebx, 2+16
mov bl, 4
mov ecx, edx
shl ecx, 2+16
mov cl, 4
mov edx, eax
mcall 13 ; draw rectangle 8x8
pop edx ecx
inc ecx
cmp ecx, [magnify_area_end_x]
jnz .loop_x
mov ecx, [magnify_area_start_x]
inc edx
cmp edx, [magnify_area_end_y]
jnz .loop_y
;------------------------- Measure labels draw
mov eax, 4
mov ebx, 8*65536 + 124
mov ecx, 11110000111100001111000011110000b
mov edx, start_pix
xor edi, edi
mcall 4
add ebx, 20
mov edx, end_pix
mcall 4
add ebx, 20
mov edx, measure_x
mcall 4
add ebx, 20
mov edx, measure_y
mcall 4
add ebx, 20
mov edx, measure_d
mcall 4
add ebx, 20
mov edx, inf
mcall 4
mov ebx, 0x80040000
mov ecx, [mouse_x]
mov edx, 12*8*65536 + 144
mov esi, 0x50FFFFFF
xor edi, edi
mcall 47
sub ecx, [pix1_x]
jns .sign1
neg ecx
.sign1:
mov edx, 14*8*65536 + 164
mov [dist_x], ecx
mcall 47
mov ecx, [mouse_y]
mov edx, 18*8*65536 + 144
mcall 47
sub ecx, [pix1_y]
jns .sign2
neg ecx
.sign2:
mov [dist_y], ecx
mov edx, 14*8*65536 + 184
mcall 47
mov ecx, [pix1_y]
mov edx, 18*8*65536 + 124
mcall 47
mov ecx, [pix1_x]
mov edx, 12*8*65536 + 124
mcall 47
mov eax, [dist_x]
mov ebx, eax
mul bx
mov cx, dx
shl ecx, 16
mov cx, ax
mov eax, [dist_y]
mov ebx, eax
mul bx
mov si, dx
shl esi, 16
mov si, ax
add ecx, esi
mov [diag_l], ecx
finit
fild [diag_l]
fsqrt
fistp [diag_l]
mov ebx, 0x80040000
mov ecx, [diag_l]
mov edx, 12*8*65536 + 204
mov esi, 0x50FFFFFF
xor edi, edi
mcall 47
.end:
ret
;------------------------- Data area
if lang eq ru_RU
labelt:
db 3, 'Измеритель', 0
start_pix:
db 'Пиксель 1 ( , )', 0
end_pix:
db 'Пиксель 2 ( , )', 0
measure_x:
db 'Дистанция x ( )', 0
measure_y:
db 'Дистанция y ( )', 0
measure_d:
db 'Диагональ ( )', 0
inf:
db 'Нажмите пробел', 0
else ; Default to en_US
labelt:
db 3, 'Ruler', 0
start_pix:
db 'Pixel 1 ( , )', 0
end_pix:
db 'Pixel 2 ( , )', 0
measure_x:
db 'Distance x ( )', 0
measure_y:
db 'Distance y ( )', 0
measure_d:
db 'Diagonal ( )', 0
inf:
db 'Press Space', 0
end if
I_END:
align 4
magnify_area_start_x dd ?
magnify_area_start_y dd ?
magnify_area_end_x dd ?
magnify_area_end_y dd ?
screen_size_x dd ?
screen_size_y dd ?
mouse_x dd ?
mouse_y dd ?
pix1_x dd 0
pix1_y dd 0
dist_x dd 0
dist_y dd 0
diag_l dd 0
;---------------------------------------------------------------------
procinfo:
rb 1024
;---------------------------------------------------------------------

View File

@ -19,7 +19,7 @@
dd 0x1000 ; esp
dd 0, 0 ; no parameters, no path
;---------------------------------------------------------------------
include 'lang.inc'
include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US.
include '..\..\..\macros.inc'
delay equ 20
@ -52,7 +52,7 @@ button:
;---------------------------------------------------------------------
draw_window:
mcall 12,1
mov al, 48 ; function 48 : graphics parameters
mov bl, 4 ; subfunction 4 : get skin height
mcall
@ -63,7 +63,7 @@ draw_window:
mov edi, labelt ; header
xor eax, eax ; function 0 : define and draw window
mcall
mcall 12,2
ret
;---------------------------------------------------------------------
@ -80,7 +80,7 @@ draw_magnify:
shr eax, 16
inc eax
mov [size_x], eax
xor ebx, ebx
mcall 37 ; get mouse coordinates
mov ecx, eax
@ -137,7 +137,7 @@ draw_magnify:
if lang eq ru_RU
labelt:
db 'Magnifier - <20>ªà ­­ ï «ã¯ ', 0
else
else ; Default to en_US
labelt:
db 'Magnifier', 0
end if

View File

@ -16,7 +16,7 @@ use32
dd 0x1000 ; esp
dd 0x0 , 0x0 ; I_Param , I_Icon
include 'lang.inc'
include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US.
include '..\..\..\macros.inc'
START: ; start of execution
@ -139,7 +139,7 @@ draw_window:
if lang eq ru_RU
title db '€‰Œ…<C592>',0
else
else ; Default to en_US
title db 'TIMER',0
end if

View File

@ -1,5 +1,5 @@
@erase lang.inc
@echo lang fix fr >lang.inc
@echo lang fix fr_FR >lang.inc
@fasm template.asm template
@erase lang.inc
@pause
@pause

View File

@ -5,10 +5,10 @@
; last update: 1/03/2007
; written by: Ivan Poddubny
; e-mail: ivan-yar@bk.ru
;modified by: Heavyiron, maxcodehack
; modified by: Heavyiron, maxcodehack
; <--- include all KolibriOS stuff --->
include "lang.inc"
include "lang.inc" ; Language support for locales: ru_RU (CP866), fr_FR, en_US.
include "..\..\..\..\macros.inc"
@ -62,7 +62,7 @@ CODE
xor eax, eax ; create and draw the window
mov ebx, 100*65536+200 ; (window_cx)*65536+(window_sx)
mov ecx, 100*65536+100 ; (window_cy)*65536+(window_sy)
mov edx, [sc.work] ; work area color
mov edx, [sc.work] ; work area color
or edx, 0x33000000 ; & window type 3
mov edi, title ; window title
int 0x40
@ -80,7 +80,7 @@ if lang eq ru_RU
title db '˜ ¡«®­ ¯à®£à ¬¬ë',0
else if lang eq fr_FR
title db 'La programme poncive',0
else
else ; Default to en_US
title db 'Template program',0
end if

View File

@ -15,7 +15,7 @@
dd 0x2000 ; esp
dd 0x0 , 0x0 ; I_Param , I_Icon
include 'lang.inc'
include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US.
include '..\..\..\..\macros.inc'
@ -97,7 +97,7 @@ draw_window:
mov edi,title ; WINDOW LABEL
mcall
mov eax,8 ; NEW THREAD BUTTON
mov ebx,20*65536+128
mov ecx,63*65536+20
@ -136,11 +136,11 @@ if lang eq ru_RU
db '<27> ¬ïâì ¤«ï ¢á¥å ¯®â®ª®¢ ®¡é ï. '
db ' '
db ' ‘Ž‡„€’œ <20>Ž<20>ŽŽŠ '
db 'x' ; <- END MARKER, DONT DELETE
db 'x' ; <- END MARKER, DO NOT DELETE
title db '<27>ਬ¥à ¨á¯®«ì§®¢ ­¨ï ¯®â®ª®¢',0
else
else ; Default to en_US
text:
db 'THIS EXAMPLE CREATES THREADS BY RUNNING '
db 'THE SAME CODE MULTIPLE TIMES. ALL WE '
@ -149,7 +149,7 @@ else
db ' '
db ' '
db ' CREATE NEW THREAD '
db 'x' ; <- END MARKER, DONT DELETE
db 'x' ; <- END MARKER, DO NOT DELETE
title db 'THREAD EXAMPLE',0

View File

@ -1,43 +1,42 @@
include 'lang.inc'
if lang eq ru_RU
text db ' ‚å” ©«:','‚ëå” ©«:',' <20>ãâì:'
.line_size = ($-text)/3
s_compile db 'Š®¬¯¨«.'
s_run db ' <20>ã᪠'
s_debug db 'Žâ« ¤ª '
s_dbgdescr db '‘®§¤ ¢ âì ®â« ¤®ç­ãî ¨­ä®à¬ æ¨î',0
sz_EPnotFound db 'Not found entry point to ',0
sizeof.sz_EPnotFound = $-sz_EPnotFound
sz_cantLL db 'Can not load library ',0
sizeof.sz_cantLL = $-sz_cantLL
sz_system_error db 'System error: ',0
sizeof.sz_system_error = $-sz_system_error
else
text db ' InFile:','OutFile:',' Path:'
.line_size = ($-text)/3
s_compile db 'COMPILE'
s_run db ' RUN '
s_debug db ' DEBUG '
s_dbgdescr db 'Generate debug information',0
sz_EPnotFound db 'Not found entry point to ',0
sizeof.sz_EPnotFound = $-sz_EPnotFound
sz_cantLL db 'Can not load library ',0
sizeof.sz_cantLL = $-sz_cantLL
sz_system_error db 'System error: ',0
sizeof.sz_system_error = $-sz_system_error
end if
include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US.
if lang eq ru_RU
text db ' ‚å” ©«:','‚ëå” ©«:',' <20>ãâì:'
.line_size = ($-text)/3
s_compile db 'Š®¬¯¨«.'
s_run db ' <20>ã᪠'
s_debug db 'Žâ« ¤ª '
s_dbgdescr db '‘®§¤ ¢ âì ®â« ¤®ç­ãî ¨­ä®à¬ æ¨î',0
sz_EPnotFound db 'Not found entry point to ',0
sizeof.sz_EPnotFound = $-sz_EPnotFound
sz_cantLL db 'Cannot load library ',0
sizeof.sz_cantLL = $-sz_cantLL
sz_system_error db 'System error: ',0
sizeof.sz_system_error = $-sz_system_error
else ; Default to en_US
text db ' InFile:','OutFile:',' Path:'
.line_size = ($-text)/3
s_compile db 'COMPILE'
s_run db ' RUN '
s_debug db ' DEBUG '
s_dbgdescr db 'Generate debug information',0
sz_EPnotFound db 'Not found entry point to ',0
sizeof.sz_EPnotFound = $-sz_EPnotFound
sz_cantLL db 'Cannot load library ',0
sizeof.sz_cantLL = $-sz_cantLL
sz_system_error db 'System error: ',0
sizeof.sz_system_error = $-sz_system_error
end if

View File

@ -22,7 +22,7 @@ include '../../../macros.inc' ;
include '../../../KOSfuncs.inc'
include '../../../load_lib.mac'
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
include 'lang.inc'
include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US.
@use_library
@ -170,7 +170,7 @@ draw_window:
;or esi, [sys_colors.grab_text]
mcall SF_CREATE_WINDOW, 200*65536+WIN_W, 200*65536+179, ,,title
mcall SF_DEFINE_BUTTON, 15*65536+42,106*65536+ 21, 2, [sys_colors.work_button] ; ª­®¯ª  shl
mcall , 70*65536+42, , , ; ª­®¯ª  sal
mcall , (WIN_W-55)*65536+42, , 3, ; ª­®¯ª  shr
@ -196,7 +196,7 @@ draw_window:
mcall SF_DRAW_NUMBER, 10*65536, ,(WIN_W-92)*65536+62, ; 10-­ ï á® §­ ª®¬
BIN_LINE_BLOCK_W = 76
mcall SF_DRAW_NUMBER, 8*65536+512,,(WIN_W-BIN_LINE_BLOCK_W)*65536+30 ; 2-­ ï
mcall SF_DRAW_NUMBER, 8*65536+512,,(WIN_W-BIN_LINE_BLOCK_W)*65536+30 ; 2-­ ï
ror ecx, 8
mov edx, (WIN_W-BIN_LINE_BLOCK_W*2)*65536+30
mcall
@ -275,7 +275,7 @@ string1_end:
if lang eq ru_RU
numstr db '—¨á«®:',0
Okstr db '‚¢®¤',0
else
else ; Default to en_US
numstr db 'Number:',0
Okstr db 'Enter',0
end if

View File

@ -13,7 +13,7 @@
; Marat Zakiyanov aka Mario79, aka Mario
;--------------------------------------------------------------------
; v.014 05.02.2010
;
;
; PageUp, PageDown - áâà ­¨æ  ¢¢¥àå/¢­¨§
; Ctrl+UP, Ctrl+Down - ¯à®ªàã⪠ áâà ­¨æë ­  áâப㠢¢¥àå/¢­¨§ ¡¥§ ᬥ饭¨ï ªãàá®à 
; Home,End - ¢ ­ ç «®/ª®­¥æ áâப¨
@ -59,9 +59,9 @@ use32
;--------------------------------------------------------------------
_title equ 'HeEd 0.16', 0
include 'lang.inc'
include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US.
include '../../../KOSfuncs.inc'
include '../../../config.inc' ;for nightbuild
include '../../../config.inc' ; for nightbuild
include '../../../macros.inc'
include '../../libraries/box_lib/trunk/box_lib.mac'
include '../../../load_lib.mac'
@ -108,25 +108,25 @@ load_libraries l_libs_start,end_l_libs
;OpenDialog initialisation
push dword OpenDialog_data
call [OpenDialog_Init]
;--------------------------------------------------------------------
;--------------------------------------------------------------------
mov esi,fname_buf
cmp [esi],byte 0
je .start_temp_file_name
cld
@@:
lodsb
test al,al
jne @b
std
@@:
lodsb
cmp al,'/'
cmp al,'/'
jne @b
add esi,2
jmp .selected_start_file_name
;--------------------------------------------------------------------
;--------------------------------------------------------------------
.start_temp_file_name:
mov esi,start_temp_file_name
.selected_start_file_name:
@ -1068,7 +1068,7 @@ main_area:
mov ecx,edx
mov edx,frgrd_color
movzx ebx,[scroll_bar_data_vertical.x_pos]
mov ax,[scroll_bar_data_vertical.x_size]
test ax,ax
jnz .no_inc_ebx
@ -1091,7 +1091,7 @@ main_area:
shl ebx,16
mov bx,ax
mov cx,16
mov ax,[scroll_bar_data_vertical.x_size]
test ax,ax
jnz .no_inc_ebx_2
@ -1938,13 +1938,13 @@ draw_ed_box: ;
cmp al,1
jne .2
call draw_window
mov eax,[threath_buf+70]
test eax,10b
jnz .2
test eax,100b
jnz .2
call main_area
bt [flags],2
jnc @f
@ -2805,7 +2805,7 @@ Ctrl_V:
mov [shblock_end],eax
jmp red
;--------------------------------------------------------------------
;¥á«¨ ¡«®ª ­¥ ¢ë¤¥«¥­, â® ¢áâ ¢«ï¥¬ ¡«®ª ¯¥à¥¤ ªãàá®à®¬
;¥á«¨ ¡«®ª ­¥ ¢ë¤¥«¥­, â® ¢áâ ¢«ï¥¬ ¡«®ª ¯¥à¥¤ ªãàá®à®¬
.past_kurs:
; bt [flags],1
; jnc still
@ -2965,7 +2965,7 @@ menu_data_1:
.x1:
if lang eq ru_RU
.size_x1 dw 4*2+9*6 ;+32
else
else ; Default to en_US
.size_x1 dw 40 ;+32
end if
.start_x1 dw 2 ;+34
@ -3000,7 +3000,7 @@ if lang eq ru_RU
db 'Žâªàëâì',0
db '‘®åà ­¨âì',0
db '‚ë室',0
else
else ; Default to en_US
db 'File',0
.1:
db 'Open',0
@ -3056,7 +3056,7 @@ menu_text_area_2:
if lang eq ru_RU
db '‚¨¤',0
.1:
else
else ; Default to en_US
db 'View',0
.1:
end if
@ -3074,7 +3074,7 @@ menu_data_3:
.x:
if lang eq ru_RU
.size_x dw 4*2+7*6 ;+32
else
else ; Default to en_US
.size_x dw 40 ;+4
end if
.start_x dw 84 ;+6
@ -3089,7 +3089,7 @@ end if
.x1:
if lang eq ru_RU
.size_x1 dw 4*2+7*6 ;+32
else
else ; Default to en_US
.size_x1 dw 40 ;+32
end if
.start_x1 dw 84 ;+34
@ -3122,7 +3122,7 @@ if lang eq ru_RU
db '‘¯à ¢ª ',0
.1:
db '‘¯à ¢ª ',0
else
else ; Default to en_US
db 'Help',0
.1:
db 'Help',0
@ -3155,7 +3155,7 @@ if lang eq ru_RU
.e2:
.3 db '<27> § ¤'
.e3:
else
else ; Default to en_US
.1 db 'Absolutely'
.e1:
.2 db 'Forward'
@ -3181,7 +3181,7 @@ head_f_i:
if lang eq ru_RU
error_open_file_string db "” ©« ­¥ ­ ©¤¥­!",0
error_save_file_string db "” ©« ­¥ á®åà ­¥­!",0
else
else ; Default to en_US
error_open_file_string db "Isn't found!",0
error_save_file_string db "Isn't saved!",0
end if
@ -3240,7 +3240,7 @@ if lang eq ru_RU
db 'Ctrl+C - ª®¯¨à®¢ âì ¡«®ª '
db 'Ctrl+V - ¢áâ ¢¨âì ¢ ¢ë¤¥«¥­­ãî ®¡« áâì'
db 'Ctrl+X - ¢ë१ âì ¢ ¡ãä¥à '
else
else ; Default to en_US
db 'Ctrl+O - open file '
db 'Ctrl+S - save file '
db 'PageUp, PageDown - page up/down '
@ -3268,7 +3268,7 @@ help_end:
;align 4096
font_buffer file 'cp866-8x16' ;ASCII+cp866 (+ð,ñ)
cp1251 file 'cp1251-8x16'
koi8_r file 'koi8-r-8x16'
koi8_r file 'koi8-r-8x16'
title db _title
;---------------------------------------------------------------------

View File

@ -1,459 +1,460 @@
;
; ”㭪樨 ¤«ï ¯à¥®¡à §®¢ ­¨ï ä ©«  *.stl ¢ *.3ds
;
; ‘âàãªâãà  á®§¤ ¢ ¥¬®£® ä ©«  *.3ds:
; CHUNK_MAIN (40+n+v+f)
; + CHUNK_OBJMESH (34+n+v+f)
; + CHUNK_OBJBLOCK (28+n+v+f)
; + CHUNK_TRIMESH (22+v+f)
; + CHUNK_VERTLIST (8+v)
; + CHUNK_FACELIST (8+f)
;
; ¢ ᪮¡ª å 㪠§ ­ë à §¬¥àë ¡«®ª®¢:
; n - ¯ ¬ïâì ¤«ï ¨¬¥­¨ ®¡ê¥ªâ 
; v - ¯ ¬ïâì ¤«ï ¢¥à設
; f - ¯ ¬ïâì ¤«ï £à ­¥©
; ”®à¬ â ¡¨­ à­®£® *.stl:
; char[80] - § £®«®¢®ª
; uint32 - ç¨á«® £à ­¥©
; ¤«ï ª ¦¤®© £à ­¨:
; float[3] - ¢¥ªâ®à ­®à¬ «¨
; float[9] - ¢¥à設ë 1,2,3
; uint16 -  âਡãâë
if lang eq ru_RU
txt_err_stl_open:
db '"STL',13,10
db '” ©« *.stl ®ç¥­ì ¡®«ì让." -tW',0
txt_err_stl_null_v:
db '"STL',13,10
db '‚¥àè¨­ë ­¥ ­ ©¤¥­ë." -tE',0
else
txt_err_stl_open:
db '"STL',13,10
db 'File *.stl is very large." -tW',0
txt_err_stl_null_v:
db '"STL',13,10
db 'Vertexes not found." -tE',0
end if
;output:
; eax - 㪠§ â¥«ì ­  áä®à¬¨à®¢ ­ë© ä ©« 3ds (¢ á«ãç ¥ ­¥ã¤ ç¨ 0)
; ecx - à §¬¥à áä®à¬¨à®¢ ­®£® ä ©«  3ds
align 4
proc convert_stl_3ds uses ebx edx edi esi, f_data:dword, f_size:dword
locals
c_mem dd ? ;¯ ¬ïâì ¤«ï ¯à¥®¡à §®¢ ­¨ï (convert memory)
c_size dd ? ;à §¬¥à ¯ ¬ï⨠¤«ï ¯à¥®¡à §®¢ ­¨© (convert memory size)
vert_c dd ? ;ç¨á«® ¢¥à設 (vertex count)
face_c dd ? ;ç¨á«® £à ­¥© (faces count)
endl
xor eax,eax
mov esi,[f_data]
cmp dword[esi],'soli'
jne .bin_stl
cmp word[esi+4],'d '
jne .bin_stl
jmp @f
.bin_stl:
;¯à®¢¥à塞 ä ©« ­  ¡¨­ à­ë© ä®à¬ â
mov ecx,[esi+80]
imul ecx,50
add ecx,84 ;§ £®«®¢®ª
cmp ecx,[f_size]
jne .no_stl
call convert_binary_stl
jmp .no_stl
@@:
;¢ ­ ç «¥ ­ ©¤¥­® 'solid '
stdcall txt_next_line, 80
mov eax,[f_data]
sub eax,esi
add eax,[f_size]
stdcall get_stl_vertex_count, esi,eax
or eax,eax
jnz @f
notify_window_run txt_err_stl_null_v
jmp .no_stl
@@:
cmp eax,0xffff
jle @f
notify_window_run txt_err_stl_open
mov eax,0xffff
@@:
mov [vert_c],eax
mov ecx,3
xor edx,edx
div ecx
mov [face_c],eax
shl eax,3
mov ecx,[vert_c]
imul ecx,12
lea ecx,[ecx+eax+40]
lea edx,[esi-6]
sub edx,[f_data]
cmp edx,2
jge @f
mov edx,2 ;¬¨­¨¬ «ì­ë© à §¬¥à ¤«ï ¨¬¥­¨ ®¡ê¥ªâ 
@@:
add ecx,edx ;for object name
mov [c_size],ecx
stdcall mem.Alloc,ecx
mov [c_mem],eax
mov ebx,eax
mov word[ebx],CHUNK_MAIN
mov dword[ebx+2],ecx
add ebx,6
;3d3d
mov word[ebx],CHUNK_OBJMESH
sub ecx,6
mov dword[ebx+2],ecx
add ebx,6
;4000
mov word[ebx],CHUNK_OBJBLOCK
sub ecx,6
mov dword[ebx+2],ecx
add ebx,6
push ecx esi
mov ecx,edx
mov edi,ebx
mov esi,[f_data]
add esi,6 ;¯à®¯ã᪠¥¬ 'solid '
rep movsb ;ª®¯¨à㥬 ¨¬ï ®¡ê¥ªâ 
mov byte[edi-1],0
add ebx,edx
pop esi ecx
;4100
mov word[ebx],CHUNK_TRIMESH
sub ecx,6
mov dword[ebx+2],ecx
add ebx,6
;4110
mov word[ebx],CHUNK_VERTLIST
mov dword[ebx+2],8 ;+ ç¨á«® ¢¥à設 * 12
add ebx,6
mov edx,ebx
mov word[edx],0 ;ª®«. ¢¥à設
add ebx,2
finit
.cycle0:
call txt_ignore_space
cmp dword[esi],'face'
jne .end_v
stdcall txt_next_line, 80
call txt_ignore_space
cmp dword[esi],'oute'
jne .end_v
stdcall txt_next_line, 80
mov ecx,3 ;3 â®çª¨ ­  1 £à ­ì
@@:
stdcall stl_vertex_init, ebx
or eax,eax
jz .end_v
add ebx,12
inc word[edx]
loop @b
mov eax,[vert_c]
cmp word[edx],ax
jge .end_v
call txt_ignore_space
cmp dword[esi],'endl'
jne .end_v
stdcall txt_next_line, 80
call txt_ignore_space
cmp dword[esi],'endf'
jne .end_v
stdcall txt_next_line, 80
jmp .cycle0
.end_v:
movzx eax,word[edx]
imul eax,12
add [edx-4],eax ;¨á¯à ¢«ï¥¬ à §¬¥à ¡«®ª  4110
;4120
mov word[ebx],CHUNK_FACELIST
mov ecx,[face_c]
mov edx,ecx
shl edx,3 ;ª®«. £à ­¥© * 8
add edx,8
mov [ebx+2],edx
add ebx,6
mov [ebx],cx ;ª®«. £à ­¥©
add ebx,2
xor eax,eax
@@:
mov [ebx],ax
inc eax
mov [ebx+2],ax
inc eax
mov [ebx+4],ax
inc eax
mov word[ebx+6],0 ; âਡãâë
add ebx,8
loop @b
mov eax,[c_mem]
mov ecx,[c_size]
.no_stl:
ret
endp
;input:
; esi - 㪠§ â¥«ì ­  ­ ç «® ä ©« 
; ecx - à §¬¥à ä ©« 
align 4
proc convert_binary_stl
locals
c_mem dd ? ;¯ ¬ïâì ¤«ï ¯à¥®¡à §®¢ ­¨ï (convert memory)
c_size dd ? ;à §¬¥à ¯ ¬ï⨠¤«ï ¯à¥®¡à §®¢ ­¨© (convert memory size)
vert_c dd ? ;ç¨á«® ¢¥à設 (vertex count)
face_c dd ? ;ç¨á«® £à ­¥© (faces count)
endl
mov eax,[esi+80]
or eax,eax
jnz @f
notify_window_run txt_err_stl_null_v
jmp .no_stl
@@:
cmp eax,0xffff/3
jle @f
notify_window_run txt_err_stl_open
mov eax,0xffff/3
@@:
mov [face_c],eax
mov ecx,eax
imul eax,3
mov [vert_c],eax
shl ecx,3
imul eax,12
lea ecx,[ecx+eax+40+4] ;+4 à §¬¥à ¤«ï ¨¬¥­¨ ®¡ê¥ªâ 
mov [c_size],ecx
stdcall mem.Alloc,ecx
mov [c_mem],eax
mov ebx,eax
mov word[ebx],CHUNK_MAIN
mov dword[ebx+2],ecx
add ebx,6
;3d3d
mov word[ebx],CHUNK_OBJMESH
sub ecx,6
mov dword[ebx+2],ecx
add ebx,6
;4000
mov word[ebx],CHUNK_OBJBLOCK
sub ecx,6
mov dword[ebx+2],ecx
add ebx,6
mov dword[ebx],'Stl' ;¨¬ï ®¡ê¥ªâ 
add ebx,4
;4100
mov word[ebx],CHUNK_TRIMESH
sub ecx,6
mov dword[ebx+2],ecx
add ebx,6
;4110
mov word[ebx],CHUNK_VERTLIST
mov dword[ebx+2],8 ;+ ç¨á«® ¢¥à設 * 12
add ebx,6
mov edx,ebx
mov ecx,[vert_c]
mov word[edx],cx ;ª®«. ¢¥à設
add ebx,2
add esi,80+4+12 ;¯à®¯ã᪠§ £®«®¢ª , ç¨á«  £à ­¥©, 1-£® ¢¥ªâ®à  ­®à¬ «¥©
mov edi,ebx
mov eax,[face_c]
@@: ;横« ¯® £à ­ï¬
mov ecx,9
rep movsd ;ª®¯¨à㥬 ª®®à¤¨­ âë 3-å ¢¥à設
add esi,14 ;¯à®¯ã᪠¢¥ªâ®à  ­®à¬ «¥© ¨  âਡã⮢
dec eax
jnz @b
mov ebx,edi
movzx eax,word[edx]
imul eax,12
add [edx-4],eax ;¨á¯à ¢«ï¥¬ à §¬¥à ¡«®ª  4110
;4120
mov word[ebx],CHUNK_FACELIST
mov ecx,[face_c]
mov edx,ecx
shl edx,3 ;ª®«. £à ­¥© * 8
add edx,8
mov [ebx+2],edx
add ebx,6
mov [ebx],cx ;ª®«. £à ­¥©
add ebx,2
xor eax,eax
@@:
mov [ebx],ax
inc eax
mov [ebx+2],ax
inc eax
mov [ebx+4],ax
inc eax
mov word[ebx+6],0 ; âਡãâë
add ebx,8
loop @b
mov eax,[c_mem]
mov ecx,[c_size]
.no_stl:
ret
endp
;output:
; eax - vertex count
align 4
proc get_stl_vertex_count uses ebx ecx edi, f_data:dword, f_size:dword
mov al,'v'
xor ebx,ebx
mov ecx,[f_size]
mov edi,[f_data]
.cycle0:
repne scasb
cmp dword[edi],'erte'
jne @f
inc ebx
add edi,4
sub ecx,4
cmp ecx,4
jg .cycle0
@@:
mov eax,ebx
ret
endp
;input:
; esi - input description text
; ppoi - pointer to vertex struct
;output:
; eax - 0 (if error init) or 1
; esi - output description text
align 4
proc stl_vertex_init uses ebx ecx edi, ppoi:dword
call txt_ignore_space
cmp dword[esi],'vert'
jne .err_init
cmp word[esi+4],'ex'
jne .err_init
add esi,6
mov ebx,[ppoi]
call txt_copy_data
call String_to_DoubleFloat
fld qword[Data_Double]
fstp dword[ebx] ;coord X
call txt_copy_data
call String_to_DoubleFloat
fld qword[Data_Double]
fstp dword[ebx+4] ;coord X
call txt_copy_data
call String_to_DoubleFloat
fld qword[Data_Double]
fstp dword[ebx+8] ;coord Z
stdcall txt_next_line, 80
jmp @f
.err_init:
xor eax,eax
jmp .end_f
@@:
xor eax,eax
inc eax
.end_f:
ret
endp
;input:
; esi - 㪠§ â¥«ì ­  ­ ç «® áâப¨ á ¯à®¡¥« ¬¨
;output:
; al - destroy
; ecx - destroy
; esi - 㪠§ â¥«ì ­  ¯¥à¢ë© ­¥¯à®¡¥«ì­ë© ᨬ¢®«
align 4
txt_ignore_space:
mov ecx,64 ;§ é¨â  ®â § æ¨ª«¨¢ ­¨ï
@@:
lodsb
cmp al,' '
jne @f
loop @b
@@:
dec esi
ret
;input:
; esi - 㪠§ â¥«ì ­  áâபã á ç¨á«®¬ (¯à®¡¥«ë ¢ ­ ç «¥ áâப¨ ¨£­®à¨àãîâìáï)
;output:
; al - destroy
; ecx - destroy
; edi - destroy
; esi - 㪠§ â¥«ì ­  ª®­¥æ ª®¯¨à®¢ ­­®£® ç¨á« 
; Data_String - áâப  á ç¨á«®¬ ¨§ esi
align 4
txt_copy_data:
call txt_ignore_space
mov ecx,32
mov edi,esi
@@:
lodsb
or al,al
jz @f
cmp al,' '
je @f
cmp al,13
je @f
loop @b
@@:
mov esi,edi
sub ecx,32
neg ecx
mov edi,Data_String
rep movsb
mov byte[edi],0
ret
;input:
; esi - text pointer
align 4
proc txt_next_line uses eax ecx edi, mlen:dword
mov al,13
mov ecx,[mlen]
mov edi,esi
repne scasb
cmp byte[edi],10
jne @f
inc edi
@@:
mov esi,edi
ret
endp
;
; ”㭪樨 ¤«ï ¯à¥®¡à §®¢ ­¨ï ä ©«  *.stl ¢ *.3ds
;
; ‘âàãªâãà  á®§¤ ¢ ¥¬®£® ä ©«  *.3ds:
; CHUNK_MAIN (40+n+v+f)
; + CHUNK_OBJMESH (34+n+v+f)
; + CHUNK_OBJBLOCK (28+n+v+f)
; + CHUNK_TRIMESH (22+v+f)
; + CHUNK_VERTLIST (8+v)
; + CHUNK_FACELIST (8+f)
;
; ¢ ᪮¡ª å 㪠§ ­ë à §¬¥àë ¡«®ª®¢:
; n - ¯ ¬ïâì ¤«ï ¨¬¥­¨ ®¡ê¥ªâ 
; v - ¯ ¬ïâì ¤«ï ¢¥à設
; f - ¯ ¬ïâì ¤«ï £à ­¥©
; ”®à¬ â ¡¨­ à­®£® *.stl:
; char[80] - § £®«®¢®ª
; uint32 - ç¨á«® £à ­¥©
; ¤«ï ª ¦¤®© £à ­¨:
; float[3] - ¢¥ªâ®à ­®à¬ «¨
; float[9] - ¢¥à設ë 1,2,3
; uint16 -  âਡãâë
; Language support for locales: ru_RU (CP866), en_US.
if lang eq ru_RU
txt_err_stl_open:
db '"STL',13,10
db '” ©« *.stl ®ç¥­ì ¡®«ì让." -tW',0
txt_err_stl_null_v:
db '"STL',13,10
db '‚¥àè¨­ë ­¥ ­ ©¤¥­ë." -tE',0
else ; Default to en_US
txt_err_stl_open:
db '"STL',13,10
db 'File *.stl is very large." -tW',0
txt_err_stl_null_v:
db '"STL',13,10
db 'Vertexes not found." -tE',0
end if
;output:
; eax - 㪠§ â¥«ì ­  áä®à¬¨à®¢ ­ë© ä ©« 3ds (¢ á«ãç ¥ ­¥ã¤ ç¨ 0)
; ecx - à §¬¥à áä®à¬¨à®¢ ­®£® ä ©«  3ds
align 4
proc convert_stl_3ds uses ebx edx edi esi, f_data:dword, f_size:dword
locals
c_mem dd ? ;¯ ¬ïâì ¤«ï ¯à¥®¡à §®¢ ­¨ï (convert memory)
c_size dd ? ;à §¬¥à ¯ ¬ï⨠¤«ï ¯à¥®¡à §®¢ ­¨© (convert memory size)
vert_c dd ? ;ç¨á«® ¢¥à設 (vertex count)
face_c dd ? ;ç¨á«® £à ­¥© (faces count)
endl
xor eax,eax
mov esi,[f_data]
cmp dword[esi],'soli'
jne .bin_stl
cmp word[esi+4],'d '
jne .bin_stl
jmp @f
.bin_stl:
;¯à®¢¥à塞 ä ©« ­  ¡¨­ à­ë© ä®à¬ â
mov ecx,[esi+80]
imul ecx,50
add ecx,84 ;§ £®«®¢®ª
cmp ecx,[f_size]
jne .no_stl
call convert_binary_stl
jmp .no_stl
@@:
;¢ ­ ç «¥ ­ ©¤¥­® 'solid '
stdcall txt_next_line, 80
mov eax,[f_data]
sub eax,esi
add eax,[f_size]
stdcall get_stl_vertex_count, esi,eax
or eax,eax
jnz @f
notify_window_run txt_err_stl_null_v
jmp .no_stl
@@:
cmp eax,0xffff
jle @f
notify_window_run txt_err_stl_open
mov eax,0xffff
@@:
mov [vert_c],eax
mov ecx,3
xor edx,edx
div ecx
mov [face_c],eax
shl eax,3
mov ecx,[vert_c]
imul ecx,12
lea ecx,[ecx+eax+40]
lea edx,[esi-6]
sub edx,[f_data]
cmp edx,2
jge @f
mov edx,2 ;¬¨­¨¬ «ì­ë© à §¬¥à ¤«ï ¨¬¥­¨ ®¡ê¥ªâ 
@@:
add ecx,edx ;for object name
mov [c_size],ecx
stdcall mem.Alloc,ecx
mov [c_mem],eax
mov ebx,eax
mov word[ebx],CHUNK_MAIN
mov dword[ebx+2],ecx
add ebx,6
;3d3d
mov word[ebx],CHUNK_OBJMESH
sub ecx,6
mov dword[ebx+2],ecx
add ebx,6
;4000
mov word[ebx],CHUNK_OBJBLOCK
sub ecx,6
mov dword[ebx+2],ecx
add ebx,6
push ecx esi
mov ecx,edx
mov edi,ebx
mov esi,[f_data]
add esi,6 ;¯à®¯ã᪠¥¬ 'solid '
rep movsb ;ª®¯¨à㥬 ¨¬ï ®¡ê¥ªâ 
mov byte[edi-1],0
add ebx,edx
pop esi ecx
;4100
mov word[ebx],CHUNK_TRIMESH
sub ecx,6
mov dword[ebx+2],ecx
add ebx,6
;4110
mov word[ebx],CHUNK_VERTLIST
mov dword[ebx+2],8 ;+ ç¨á«® ¢¥à設 * 12
add ebx,6
mov edx,ebx
mov word[edx],0 ;ª®«. ¢¥à設
add ebx,2
finit
.cycle0:
call txt_ignore_space
cmp dword[esi],'face'
jne .end_v
stdcall txt_next_line, 80
call txt_ignore_space
cmp dword[esi],'oute'
jne .end_v
stdcall txt_next_line, 80
mov ecx,3 ;3 â®çª¨ ­  1 £à ­ì
@@:
stdcall stl_vertex_init, ebx
or eax,eax
jz .end_v
add ebx,12
inc word[edx]
loop @b
mov eax,[vert_c]
cmp word[edx],ax
jge .end_v
call txt_ignore_space
cmp dword[esi],'endl'
jne .end_v
stdcall txt_next_line, 80
call txt_ignore_space
cmp dword[esi],'endf'
jne .end_v
stdcall txt_next_line, 80
jmp .cycle0
.end_v:
movzx eax,word[edx]
imul eax,12
add [edx-4],eax ;¨á¯à ¢«ï¥¬ à §¬¥à ¡«®ª  4110
;4120
mov word[ebx],CHUNK_FACELIST
mov ecx,[face_c]
mov edx,ecx
shl edx,3 ;ª®«. £à ­¥© * 8
add edx,8
mov [ebx+2],edx
add ebx,6
mov [ebx],cx ;ª®«. £à ­¥©
add ebx,2
xor eax,eax
@@:
mov [ebx],ax
inc eax
mov [ebx+2],ax
inc eax
mov [ebx+4],ax
inc eax
mov word[ebx+6],0 ; âਡãâë
add ebx,8
loop @b
mov eax,[c_mem]
mov ecx,[c_size]
.no_stl:
ret
endp
;input:
; esi - 㪠§ â¥«ì ­  ­ ç «® ä ©« 
; ecx - à §¬¥à ä ©« 
align 4
proc convert_binary_stl
locals
c_mem dd ? ;¯ ¬ïâì ¤«ï ¯à¥®¡à §®¢ ­¨ï (convert memory)
c_size dd ? ;à §¬¥à ¯ ¬ï⨠¤«ï ¯à¥®¡à §®¢ ­¨© (convert memory size)
vert_c dd ? ;ç¨á«® ¢¥à設 (vertex count)
face_c dd ? ;ç¨á«® £à ­¥© (faces count)
endl
mov eax,[esi+80]
or eax,eax
jnz @f
notify_window_run txt_err_stl_null_v
jmp .no_stl
@@:
cmp eax,0xffff/3
jle @f
notify_window_run txt_err_stl_open
mov eax,0xffff/3
@@:
mov [face_c],eax
mov ecx,eax
imul eax,3
mov [vert_c],eax
shl ecx,3
imul eax,12
lea ecx,[ecx+eax+40+4] ;+4 à §¬¥à ¤«ï ¨¬¥­¨ ®¡ê¥ªâ 
mov [c_size],ecx
stdcall mem.Alloc,ecx
mov [c_mem],eax
mov ebx,eax
mov word[ebx],CHUNK_MAIN
mov dword[ebx+2],ecx
add ebx,6
;3d3d
mov word[ebx],CHUNK_OBJMESH
sub ecx,6
mov dword[ebx+2],ecx
add ebx,6
;4000
mov word[ebx],CHUNK_OBJBLOCK
sub ecx,6
mov dword[ebx+2],ecx
add ebx,6
mov dword[ebx],'Stl' ;¨¬ï ®¡ê¥ªâ 
add ebx,4
;4100
mov word[ebx],CHUNK_TRIMESH
sub ecx,6
mov dword[ebx+2],ecx
add ebx,6
;4110
mov word[ebx],CHUNK_VERTLIST
mov dword[ebx+2],8 ;+ ç¨á«® ¢¥à設 * 12
add ebx,6
mov edx,ebx
mov ecx,[vert_c]
mov word[edx],cx ;ª®«. ¢¥à設
add ebx,2
add esi,80+4+12 ;¯à®¯ã᪠§ £®«®¢ª , ç¨á«  £à ­¥©, 1-£® ¢¥ªâ®à  ­®à¬ «¥©
mov edi,ebx
mov eax,[face_c]
@@: ;横« ¯® £à ­ï¬
mov ecx,9
rep movsd ;ª®¯¨à㥬 ª®®à¤¨­ âë 3-å ¢¥à設
add esi,14 ;¯à®¯ã᪠¢¥ªâ®à  ­®à¬ «¥© ¨  âਡã⮢
dec eax
jnz @b
mov ebx,edi
movzx eax,word[edx]
imul eax,12
add [edx-4],eax ;¨á¯à ¢«ï¥¬ à §¬¥à ¡«®ª  4110
;4120
mov word[ebx],CHUNK_FACELIST
mov ecx,[face_c]
mov edx,ecx
shl edx,3 ;ª®«. £à ­¥© * 8
add edx,8
mov [ebx+2],edx
add ebx,6
mov [ebx],cx ;ª®«. £à ­¥©
add ebx,2
xor eax,eax
@@:
mov [ebx],ax
inc eax
mov [ebx+2],ax
inc eax
mov [ebx+4],ax
inc eax
mov word[ebx+6],0 ; âਡãâë
add ebx,8
loop @b
mov eax,[c_mem]
mov ecx,[c_size]
.no_stl:
ret
endp
;output:
; eax - vertex count
align 4
proc get_stl_vertex_count uses ebx ecx edi, f_data:dword, f_size:dword
mov al,'v'
xor ebx,ebx
mov ecx,[f_size]
mov edi,[f_data]
.cycle0:
repne scasb
cmp dword[edi],'erte'
jne @f
inc ebx
add edi,4
sub ecx,4
cmp ecx,4
jg .cycle0
@@:
mov eax,ebx
ret
endp
;input:
; esi - input description text
; ppoi - pointer to vertex struct
;output:
; eax - 0 (if error init) or 1
; esi - output description text
align 4
proc stl_vertex_init uses ebx ecx edi, ppoi:dword
call txt_ignore_space
cmp dword[esi],'vert'
jne .err_init
cmp word[esi+4],'ex'
jne .err_init
add esi,6
mov ebx,[ppoi]
call txt_copy_data
call String_to_DoubleFloat
fld qword[Data_Double]
fstp dword[ebx] ;coord X
call txt_copy_data
call String_to_DoubleFloat
fld qword[Data_Double]
fstp dword[ebx+4] ;coord X
call txt_copy_data
call String_to_DoubleFloat
fld qword[Data_Double]
fstp dword[ebx+8] ;coord Z
stdcall txt_next_line, 80
jmp @f
.err_init:
xor eax,eax
jmp .end_f
@@:
xor eax,eax
inc eax
.end_f:
ret
endp
;input:
; esi - 㪠§ â¥«ì ­  ­ ç «® áâப¨ á ¯à®¡¥« ¬¨
;output:
; al - destroy
; ecx - destroy
; esi - 㪠§ â¥«ì ­  ¯¥à¢ë© ­¥¯à®¡¥«ì­ë© ᨬ¢®«
align 4
txt_ignore_space:
mov ecx,64 ;§ é¨â  ®â § æ¨ª«¨¢ ­¨ï
@@:
lodsb
cmp al,' '
jne @f
loop @b
@@:
dec esi
ret
;input:
; esi - 㪠§ â¥«ì ­  áâபã á ç¨á«®¬ (¯à®¡¥«ë ¢ ­ ç «¥ áâப¨ ¨£­®à¨àãîâìáï)
;output:
; al - destroy
; ecx - destroy
; edi - destroy
; esi - 㪠§ â¥«ì ­  ª®­¥æ ª®¯¨à®¢ ­­®£® ç¨á« 
; Data_String - áâப  á ç¨á«®¬ ¨§ esi
align 4
txt_copy_data:
call txt_ignore_space
mov ecx,32
mov edi,esi
@@:
lodsb
or al,al
jz @f
cmp al,' '
je @f
cmp al,13
je @f
loop @b
@@:
mov esi,edi
sub ecx,32
neg ecx
mov edi,Data_String
rep movsb
mov byte[edi],0
ret
;input:
; esi - text pointer
align 4
proc txt_next_line uses eax ecx edi, mlen:dword
mov al,13
mov ecx,[mlen]
mov edi,esi
repne scasb
cmp byte[edi],10
jne @f
inc edi
@@:
mov esi,edi
ret
endp

View File

@ -1,320 +1,324 @@
;
; §¤¥áì á®¡à ­ë ¤ ­­ë¥ ¯® ¡«®ª ¬ *.3ds
;
MAX_FILE_LEVEL equ 20 ;¬ ªá¨¬ «ì­ë© ã஢¥­ì ¢«®¦¥­­®á⨠¡«®ª®¢ ¤«ï  ­ «¨§ 
sizeof.block_3ds equ 9
can_save db 0 ;¨§¬¥­ï«áï «¨ ä ©«
macro block_3ds id,icon,par,caption
{
dw id ;+0 ¨¤¥­â¨ä¨ª â®à ¡«®ª  ¢ ä ©«¥ 3ds
dw icon ;+2 ­®¬¥à ¨ª®­ª¨ ¤«ï ¡«®ª 
db par ;+4 ᮤ¥à¦¨â «¨ ¡«®ª ¯®¤¡«®ª¨ (0-¤  1-­¥â)
dd caption+0 ;+5 ®¯¨á ­¨¥ ¡«®ª 
}
CHUNK_MAIN equ 0x4D4D ; [-] á業 
CHUNK_ambient_color equ 0x2100 ; [-] ambient color
CHUNK_OBJMESH equ 0x3D3D ; [-] ­ ¡®à ®¡ê¥ªâ®¢
CHUNK_OBJBLOCK equ 0x4000 ; [+] ®¡ê¥ªâ
CHUNK_TRIMESH equ 0x4100 ; [-] trimesh-®¡ê¥ªâ
CHUNK_VERTLIST equ 0x4110 ; [+] ᯨ᮪ ¢¥à設
CHUNK_FACELIST equ 0x4120 ; [+] ᯨ᮪ £à ­¥©
CHUNK_FACEMAT equ 0x4130 ; [+] ¬ â¥à¨ «ë £à ­¥©
CHUNK_MAPLIST equ 0x4140 ; [+] ⥪áâãà­ë¥ ª®®à¤¨­ âë
CHUNK_TRMATRIX equ 0x4160 ; [+] ¬ âà¨æ  ¯¥à¥¢®¤ 
CHUNK_CAMERA equ 0x4700 ; [+] ®¡ê¥ªâ-ª ¬¥à 
CHUNK_MATERIAL equ 0xAFFF ; [-] ¬ â¥à¨ «
CHUNK_MATNAME equ 0xA000 ; [+] ­ §¢ ­¨¥ ¬ â¥à¨ « 
CHUNK_TEXTURE equ 0xA200 ; [-] ⥪áâãà  ¬ â¥à¨ « 
CHUNK_MAPFILE equ 0xA300 ; [+] ¨¬ï ä ©«  ⥪áâãàë
CHUNK_KEYFRAMER equ 0xB000 ; [-] ¨­ä®à¬ æ¨ï ®¡  ­¨¬ æ¨¨
CHUNK_TRACKINFO equ 0xB002 ; [-] ¯®¢¥¤¥­¨¥ ®¡ê¥ªâ 
CHUNK_TRACKOBJNAME equ 0xB010 ; [+] ­ §¢ ­¨¥ í⮣® ®¡ê¥ªâ 
CHUNK_TRACKPIVOT equ 0xB013 ; [+] 業âà ¢à é¥­¨ï ®¡ê¥ªâ 
CHUNK_TRACKPOS equ 0xB020 ; [+] âà ¥ªâ®à¨ï ®¡ê¥ªâ 
CHUNK_TRACKROTATE equ 0xB021 ; [+] âà ¥ªâ®à¨ï ¢à é¥­¨ï ®¡ê¥ªâ 
CHUNK_TRACKCAMERA equ 0xB003 ; [-] ¯®¢¥¤¥­¨¥ ª ¬¥àë
CHUNK_TRACKFOV equ 0xB023 ; [+] ¯®¢¥¤¥­¨¥ fov ª ¬¥àë
CHUNK_TRACKROLL equ 0xB024 ; [+] ¯®¢¥¤¥­¨¥ roll ª ¬¥àë
CHUNK_TRACKCAMTGT equ 0xB004 ; [-] ¯®¢¥¤¥­¨¥ "楫¨" ª ¬¥àë
;¤ ­­ë¥ ᮤ¥à¦ â «¨èì ¡«®ª¨, ®â¬¥ç¥­­ë¥ ¯«îᮬ, ®áâ «ì­ë¥ ¡«®ª¨
; á®áâ®ïâ «¨èì ¨§ ¯®¤¡«®ª®¢
align 4
type_bloks:
block_3ds 0x0002,5,1,txt_0002
block_3ds 0x3d3e,5,1 ; [+] mesh version
block_3ds 0x0011,4,1,txt_0011
block_3ds 0x0100,3,1,txt_0100
block_3ds CHUNK_ambient_color,3,0,txt_2100 ; [-] ambient color
block_3ds CHUNK_OBJMESH, 3,0,txt_3d3d
block_3ds CHUNK_OBJBLOCK,11,1,txt_4000
block_3ds CHUNK_TRIMESH, 3,0,txt_4100
block_3ds CHUNK_VERTLIST,8,1,txt_4110
block_3ds CHUNK_FACELIST,3,1,txt_4120
block_3ds CHUNK_FACEMAT,10,1,txt_4130
block_3ds CHUNK_MAPLIST, 3,1,txt_4140
block_3ds CHUNK_TRMATRIX,3,1,txt_4160
block_3ds 0x4600,3,1,txt_4600
block_3ds CHUNK_CAMERA, 3,1,txt_4700
block_3ds CHUNK_MATERIAL,10,0,txt_afff
block_3ds CHUNK_MATNAME, 3,1,txt_a000
block_3ds 0xa010,4,0,txt_a010
block_3ds 0xa020,4,0,txt_a020
block_3ds 0xa030,4,0,txt_a030
block_3ds 0xa100,5,1,txt_a100
block_3ds CHUNK_TEXTURE, 3,0,txt_a200
block_3ds CHUNK_MAPFILE, 6,1,txt_a300
block_3ds CHUNK_KEYFRAMER, 7,0,txt_b000
block_3ds CHUNK_TRACKINFO, 3,0,txt_b002
block_3ds CHUNK_TRACKOBJNAME,3,1,txt_b010
block_3ds 0xb011,3,1,txt_b011
block_3ds CHUNK_TRACKPIVOT, 3,1,txt_b013
block_3ds 0xb014,3,1,txt_b014
block_3ds CHUNK_TRACKPOS, 3,1,txt_b020
block_3ds CHUNK_TRACKROTATE, 3,1,txt_b021
block_3ds CHUNK_TRACKCAMERA, 7,0,txt_b003
block_3ds CHUNK_TRACKFOV, 7,1,txt_b023
block_3ds CHUNK_TRACKROLL, 7,1,txt_b024
block_3ds CHUNK_TRACKCAMTGT, 7,0,txt_b004
;--- ¤ «¥¥ ­¥ ¢® ¢á¥å ¡«®ª å ᬮ£ ­ ©â¨ ®¯¨á ­¨¥ ­  àãá᪮¬ ï§ëª¥
block_3ds 0x4111, 3,1,txt_4111
block_3ds 0x4150, 3,1,txt_4150
block_3ds 0x4165, 3,1,txt_4165
block_3ds 0x4610, 3,1,txt_4610
block_3ds 0x4627, 3,1,txt_4627
block_3ds 0x4630, 3,1,txt_4630
block_3ds 0x4641, 3,1,txt_4641
block_3ds 0x4650, 3,1,txt_4650
block_3ds 0x4651, 3,1,txt_4651
block_3ds 0x4652, 3,1,txt_4652
block_3ds 0x4653, 3,1,txt_4653
block_3ds 0x4656, 3,1,txt_4656
block_3ds 0x4658, 3,1,txt_4658
block_3ds 0x4620, 3,1,txt_4620
block_3ds 0x4625, 3,1,txt_4625
block_3ds 0x4659, 3,1,txt_4659
block_3ds 0x465a, 3,1,txt_465a
block_3ds 0x465b, 3,1,txt_465b
block_3ds 0xa230, 3,1,txt_a230
block_3ds 0xa220, 3,1,txt_a220
block_3ds 0xa351, 3,1,txt_a351
block_3ds 0xb007, 3,1,txt_b007
block_3ds 0xb008, 3,1,txt_b008
block_3ds 0xb022, 3,1,txt_b022
block_3ds 0xb030, 3,1,txt_b030
block_3ds 0xa040, 3,1,txt_a040
block_3ds 0xa041, 3,1,txt_a041
block_3ds 0xa050, 3,1,txt_a050
block_3ds 0xa052, 3,1,txt_a052
block_3ds 0xa053, 3,1,txt_a053
block_3ds 0xa081, 3,1,txt_a081
block_3ds 0xa083, 3,1,txt_a083
block_3ds 0xa084, 3,1,txt_a084
block_3ds 0xa085, 3,1,txt_a085
block_3ds 0xa087, 3,1,txt_a087
block_3ds 0xa088, 3,1,txt_a088
block_3ds 0xa08a, 3,1,txt_a08a
block_3ds 0xa08c, 3,1,txt_a08c
block_3ds 0xa08e, 3,1,txt_a08e
.end:
if lang eq ru_RU
txt_0002 db '3ds ¢¥àá¨ï',0
txt_0011 db '–¢¥â rgb (¡ ©â®¢ë© ä®à¬ â)',0
;txt_0012 db 'LIN_COLOR_24',0
;txt_0030 db 'Percentage value (int)',0
;txt_0031 db 'Percentage value (float)',0
txt_0100 db 'Master scale',0
txt_2100 db '–¢¥â ®ªà㦠î饩 á।ë',0
txt_3d3d db '<27> ¡®à ®¡ê¥ªâ®¢',0
txt_4000 db 'Ž¡ê¥ªâ (á ¨¬¥­¥¬)',0
txt_4100 db '’à¥ã£®«ì­ë¥ á¥âª¨',0
txt_4110 db '‘¯¨á®ª ¢¥à設',0
txt_4120 db '‘¯¨á®ª £à ­¥©',0
txt_4130 db 'Œ â¥à¨ «ë £à ­¥©',0
txt_4140 db '’¥ªáâãà­ë¥ ª®®à¤¨­ âë',0
txt_4160 db 'Œ âà¨æ  ¯¥à¥¢®¤ ',0
txt_4600 db '‘¢¥â',0
txt_4700 db 'Š ¬¥à ',0
txt_a000 db '<27> §¢ ­¨¥ ¬ â¥à¨ « ',0
txt_a010 db 'Žªà㦠î騩 梥â',0
txt_a020 db '„¨ääã§­ë© æ¢¥â',0
txt_a030 db '‡¥àª «ì­ë© 梥â',0
txt_a100 db '’¨¯ ¬ â¥à¨ «  [1=flat 2=gouraud 3=phong 4=metal]',0
txt_a200 db '’¥ªáâãà  ¬ â¥à¨ «  1',0
txt_a300 db 'ˆ¬ï ä ©«  ⥪áâãàë',0
;txt_a353 db 'MAT_MAP_TEXBLUR',0
txt_afff db 'Œ â¥à¨ «',0
txt_b000 db 'ˆ­ä®à¬ æ¨ï ®¡  ­¨¬ æ¨¨',0
txt_b002 db '<27>®¢¥¤¥­¨¥ ®¡ê¥ªâ ',0
;txt_b009 db 'KFCURTIME',0
;txt_b00a db 'KFHDR',0
txt_b010 db '<27> §¢ ­¨¥ ®¡ê¥ªâ ',0
txt_b011 db 'ˆ¬ï íª§¥¬¯«ïà ',0
txt_b013 db '–¥­âà ¢à é¥­¨ï ®¡ê¥ªâ ',0
txt_b014 db 'Bound box',0
txt_b020 db '’à ¥ªâ®à¨ï ¤¢¨¦¥­¨ï',0
txt_b021 db '’à ¥ªâ®à¨ï ¢à é¥­¨ï',0
txt_b003 db '<27>®¢¥¤¥­¨¥ ª ¬¥àë',0
txt_b023 db '<27>®¢¥¤¥­¨¥ fov ª ¬¥àë',0
txt_b024 db '<27>®¢¥¤¥­¨¥ roll ª ¬¥àë',0
txt_b004 db '<27>®¢¥¤¥­¨¥ "楫¨" ª ¬¥àë',0
;--- ¤ «¥¥ ­¥ ¢® ¢á¥å ¡«®ª å ᬮ£ ­ ©â¨ ®¯¨á ­¨¥ ­  àãá᪮¬ ï§ëª¥
txt_4111 db '”« £¨ ¢¥à設',0
txt_4150 db 'Smoothing group list',0
txt_4165 db 'Object color in editor',0
txt_4610 db '<27> ¯à ¢«¥­­ë© ᢥâ',0
txt_4627 db 'Spot raytrace',0
txt_4630 db 'Light shadowed',0
txt_4641 db 'Spot shadow map',0
txt_4650 db 'Spot show cone',0
txt_4651 db 'Spot is rectangular',0
txt_4652 db 'Spot overshoot',0
txt_4653 db 'Spot map',0
txt_4656 db 'Spot roll',0
txt_4658 db 'Spot ray trace bias',0
txt_4620 db 'Light off',0
txt_4625 db 'Attenuation on',0
txt_4659 db 'Range start',0
txt_465a db 'Range end',0
txt_465b db 'Multiplier',0
txt_a230 db '<27> §¬¥âª  ५ì¥ä ',0
txt_a220 db '<27> §¬¥âª  ®âà ¦¥­¨ï',0
txt_a351 db '<27> à ¬¥âàë à §¬¥âª¨',0
txt_b007 db 'ˆ­ä®à¬ æ¨ï ® ­ ¯à ¢«¥­®¬ ®á¢¥é¥­¨¨',0
txt_b008 db 'Š ¤àë (­ ç «ì­ë© ¨ ª®­¥ç­ë©)',0
txt_b022 db 'Œ áèâ ¡¨à®¢ ­¨¥',0
txt_b030 db '<27>®§¨æ¨ï ¢ ¨¥à à娨',0
txt_a040 db 'Shininess percent',0
txt_a041 db 'Shininess strength percent',0
txt_a050 db 'Transparency percent',0
txt_a052 db 'Transparency falloff percent',0
txt_a053 db 'Reflection blur percent',0
txt_a081 db '2 sided',0
txt_a083 db 'Add trans',0
txt_a084 db 'Self illum',0
txt_a085 db 'Wire frame on',0
txt_a087 db 'Wire thickness',0
txt_a088 db 'Face map',0
txt_a08a db 'In tranc',0
txt_a08c db 'Soften',0
txt_a08e db 'Wire in units',0
txt_not_delete db '<27>¥ ¬®£ã 㤠«¨âì ¢ë¡à ­­ë© ¡«®ª. Ž­ § é¨é¥­.',0
else
txt_0002 db '3ds version',0
txt_0011 db 'Color rgb (byte format)',0
txt_0100 db 'Master scale',0
txt_2100 db 'Ambient color',0
txt_3d3d db 'Editor chunk',0
txt_4000 db 'Object (with name)',0
txt_4100 db 'Triangular mesh',0
txt_4110 db 'Vertices list',0
txt_4120 db 'Faces description',0
txt_4130 db 'Faces material',0
txt_4140 db 'Mapping coordinates list',0
txt_4160 db 'Local coordinate system',0
txt_4600 db 'Light',0
txt_4700 db 'Camera',0
txt_a000 db 'Material name',0
txt_a010 db 'Ambient color',0
txt_a020 db 'Diffuse color',0
txt_a030 db 'Specular color',0
txt_a100 db 'Material type [1=flat 2=gouraud 3=phong 4=metal]',0
txt_a200 db 'Texture map 1',0
txt_a300 db 'Mapping filename',0
txt_afff db 'Meterial',0
txt_b000 db 'Keyframer',0
txt_b002 db 'Mesh information',0
txt_b010 db 'Object name',0
txt_b011 db 'Instance name',0
txt_b013 db 'Object pivot point',0
txt_b014 db 'Bound box',0
txt_b020 db 'Position track',0
txt_b021 db 'Rotation track',0
txt_b003 db 'Camera information',0
txt_b023 db 'Fov track',0
txt_b024 db 'Roll track',0
txt_b004 db 'Camera target information',0
;---
txt_4111 db 'Vertex flags',0
txt_4150 db 'Smoothing group list',0
txt_4165 db 'Object color in editor',0
txt_4610 db 'Spotlight',0
txt_4627 db 'Spot raytrace',0
txt_4630 db 'Light shadowed',0
txt_4641 db 'Spot shadow map',0
txt_4650 db 'Spot show cone',0
txt_4651 db 'Spot is rectangular',0
txt_4652 db 'Spot overshoot',0
txt_4653 db 'Spot map',0
txt_4656 db 'Spot roll',0
txt_4658 db 'Spot ray trace bias',0
txt_4620 db 'Light off',0
txt_4625 db 'Attenuation on',0
txt_4659 db 'Range start',0
txt_465a db 'Range end',0
txt_465b db 'Multiplier',0
txt_a230 db 'Bump map',0
txt_a220 db 'Reflection map',0
txt_a351 db 'Mapping parameters',0
txt_b007 db 'Spot light information',0
txt_b008 db 'Frames (Start and End)',0
txt_b022 db 'Scale track',0
txt_b030 db 'Hierarchy position',0
txt_a040 db 'Shininess percent',0
txt_a041 db 'Shininess strength percent',0
txt_a050 db 'Transparency percent',0
txt_a052 db 'Transparency falloff percent',0
txt_a053 db 'Reflection blur percent',0
txt_a081 db '2 sided',0
txt_a083 db 'Add trans',0
txt_a084 db 'Self illum',0
txt_a085 db 'Wire frame on',0
txt_a087 db 'Wire thickness',0
txt_a088 db 'Face map',0
txt_a08a db 'In tranc',0
txt_a08c db 'Soften',0
txt_a08e db 'Wire in units',0
txt_not_delete db 'I can not delete the selected chunk. It is protected.',0
end if
if lang eq ru_RU
txt_open_3ds db 'Žâªàëâ ä ©«:',0
txt_no_3ds: db 'Žâªàëâë© ä ©« ­¥ ¢ ä®à¬ â¥ *.3ds ',39
.zag: rb 8
db 39,0
txt_3ds_err_sizes db '‚®§¬®¦­® ä ©« ¯®¢à¥¦¤¥­',0
txt_count db 'Š®«¨ç¥á⢮',0
txt_3ds_offs:
db '‘¬¥é¥­¨¥: '
.dig: rb 8
db ' <20> §¬¥à: '
.siz: rb 8
db 0
txt_mat_null db 'Œ â¥à¨ «ë ­¥ ­ ©¤¥­ë',0
else
txt_open_3ds db 'Open file:',0
txt_no_3ds: db 'Open file not in format *.3ds ',39
.zag: rb 8
db 39,0
txt_3ds_err_sizes db 'File may be corrupted',0
txt_count db 'Count',0
txt_3ds_offs:
db 'Offset: '
.dig: rb 8
db ' Size: '
.siz: rb 8
db 0
txt_mat_null db 'No materials found',0
end if
;
; §¤¥áì á®¡à ­ë ¤ ­­ë¥ ¯® ¡«®ª ¬ *.3ds
;
; Language support for locales: ru_RU (CP866), en_US.
MAX_FILE_LEVEL equ 20 ;¬ ªá¨¬ «ì­ë© ã஢¥­ì ¢«®¦¥­­®á⨠¡«®ª®¢ ¤«ï  ­ «¨§ 
sizeof.block_3ds equ 9
can_save db 0 ;¨§¬¥­ï«áï «¨ ä ©«
macro block_3ds id,icon,par,caption
{
dw id ;+0 ¨¤¥­â¨ä¨ª â®à ¡«®ª  ¢ ä ©«¥ 3ds
dw icon ;+2 ­®¬¥à ¨ª®­ª¨ ¤«ï ¡«®ª 
db par ;+4 ᮤ¥à¦¨â «¨ ¡«®ª ¯®¤¡«®ª¨ (0-¤  1-­¥â)
dd caption+0 ;+5 ®¯¨á ­¨¥ ¡«®ª 
}
CHUNK_MAIN equ 0x4D4D ; [-] á業 
CHUNK_ambient_color equ 0x2100 ; [-] ambient color
CHUNK_OBJMESH equ 0x3D3D ; [-] ­ ¡®à ®¡ê¥ªâ®¢
CHUNK_OBJBLOCK equ 0x4000 ; [+] ®¡ê¥ªâ
CHUNK_TRIMESH equ 0x4100 ; [-] trimesh-®¡ê¥ªâ
CHUNK_VERTLIST equ 0x4110 ; [+] ᯨ᮪ ¢¥à設
CHUNK_FACELIST equ 0x4120 ; [+] ᯨ᮪ £à ­¥©
CHUNK_FACEMAT equ 0x4130 ; [+] ¬ â¥à¨ «ë £à ­¥©
CHUNK_MAPLIST equ 0x4140 ; [+] ⥪áâãà­ë¥ ª®®à¤¨­ âë
CHUNK_TRMATRIX equ 0x4160 ; [+] ¬ âà¨æ  ¯¥à¥¢®¤ 
CHUNK_CAMERA equ 0x4700 ; [+] ®¡ê¥ªâ-ª ¬¥à 
CHUNK_MATERIAL equ 0xAFFF ; [-] ¬ â¥à¨ «
CHUNK_MATNAME equ 0xA000 ; [+] ­ §¢ ­¨¥ ¬ â¥à¨ « 
CHUNK_TEXTURE equ 0xA200 ; [-] ⥪áâãà  ¬ â¥à¨ « 
CHUNK_MAPFILE equ 0xA300 ; [+] ¨¬ï ä ©«  ⥪áâãàë
CHUNK_KEYFRAMER equ 0xB000 ; [-] ¨­ä®à¬ æ¨ï ®¡  ­¨¬ æ¨¨
CHUNK_TRACKINFO equ 0xB002 ; [-] ¯®¢¥¤¥­¨¥ ®¡ê¥ªâ 
CHUNK_TRACKOBJNAME equ 0xB010 ; [+] ­ §¢ ­¨¥ í⮣® ®¡ê¥ªâ 
CHUNK_TRACKPIVOT equ 0xB013 ; [+] 業âà ¢à é¥­¨ï ®¡ê¥ªâ 
CHUNK_TRACKPOS equ 0xB020 ; [+] âà ¥ªâ®à¨ï ®¡ê¥ªâ 
CHUNK_TRACKROTATE equ 0xB021 ; [+] âà ¥ªâ®à¨ï ¢à é¥­¨ï ®¡ê¥ªâ 
CHUNK_TRACKCAMERA equ 0xB003 ; [-] ¯®¢¥¤¥­¨¥ ª ¬¥àë
CHUNK_TRACKFOV equ 0xB023 ; [+] ¯®¢¥¤¥­¨¥ fov ª ¬¥àë
CHUNK_TRACKROLL equ 0xB024 ; [+] ¯®¢¥¤¥­¨¥ roll ª ¬¥àë
CHUNK_TRACKCAMTGT equ 0xB004 ; [-] ¯®¢¥¤¥­¨¥ "楫¨" ª ¬¥àë
;¤ ­­ë¥ ᮤ¥à¦ â «¨èì ¡«®ª¨, ®â¬¥ç¥­­ë¥ ¯«îᮬ, ®áâ «ì­ë¥ ¡«®ª¨
; á®áâ®ïâ «¨èì ¨§ ¯®¤¡«®ª®¢
align 4
type_bloks:
block_3ds 0x0002,5,1,txt_0002
block_3ds 0x3d3e,5,1 ; [+] mesh version
block_3ds 0x0011,4,1,txt_0011
block_3ds 0x0100,3,1,txt_0100
block_3ds CHUNK_ambient_color,3,0,txt_2100 ; [-] ambient color
block_3ds CHUNK_OBJMESH, 3,0,txt_3d3d
block_3ds CHUNK_OBJBLOCK,11,1,txt_4000
block_3ds CHUNK_TRIMESH, 3,0,txt_4100
block_3ds CHUNK_VERTLIST,8,1,txt_4110
block_3ds CHUNK_FACELIST,3,1,txt_4120
block_3ds CHUNK_FACEMAT,10,1,txt_4130
block_3ds CHUNK_MAPLIST, 3,1,txt_4140
block_3ds CHUNK_TRMATRIX,3,1,txt_4160
block_3ds 0x4600,3,1,txt_4600
block_3ds CHUNK_CAMERA, 3,1,txt_4700
block_3ds CHUNK_MATERIAL,10,0,txt_afff
block_3ds CHUNK_MATNAME, 3,1,txt_a000
block_3ds 0xa010,4,0,txt_a010
block_3ds 0xa020,4,0,txt_a020
block_3ds 0xa030,4,0,txt_a030
block_3ds 0xa100,5,1,txt_a100
block_3ds CHUNK_TEXTURE, 3,0,txt_a200
block_3ds CHUNK_MAPFILE, 6,1,txt_a300
block_3ds CHUNK_KEYFRAMER, 7,0,txt_b000
block_3ds CHUNK_TRACKINFO, 3,0,txt_b002
block_3ds CHUNK_TRACKOBJNAME,3,1,txt_b010
block_3ds 0xb011,3,1,txt_b011
block_3ds CHUNK_TRACKPIVOT, 3,1,txt_b013
block_3ds 0xb014,3,1,txt_b014
block_3ds CHUNK_TRACKPOS, 3,1,txt_b020
block_3ds CHUNK_TRACKROTATE, 3,1,txt_b021
block_3ds CHUNK_TRACKCAMERA, 7,0,txt_b003
block_3ds CHUNK_TRACKFOV, 7,1,txt_b023
block_3ds CHUNK_TRACKROLL, 7,1,txt_b024
block_3ds CHUNK_TRACKCAMTGT, 7,0,txt_b004
;--- ¤ «¥¥ ­¥ ¢® ¢á¥å ¡«®ª å ᬮ£ ­ ©â¨ ®¯¨á ­¨¥ ­  àãá᪮¬ ï§ëª¥
block_3ds 0x4111, 3,1,txt_4111
block_3ds 0x4150, 3,1,txt_4150
block_3ds 0x4165, 3,1,txt_4165
block_3ds 0x4610, 3,1,txt_4610
block_3ds 0x4627, 3,1,txt_4627
block_3ds 0x4630, 3,1,txt_4630
block_3ds 0x4641, 3,1,txt_4641
block_3ds 0x4650, 3,1,txt_4650
block_3ds 0x4651, 3,1,txt_4651
block_3ds 0x4652, 3,1,txt_4652
block_3ds 0x4653, 3,1,txt_4653
block_3ds 0x4656, 3,1,txt_4656
block_3ds 0x4658, 3,1,txt_4658
block_3ds 0x4620, 3,1,txt_4620
block_3ds 0x4625, 3,1,txt_4625
block_3ds 0x4659, 3,1,txt_4659
block_3ds 0x465a, 3,1,txt_465a
block_3ds 0x465b, 3,1,txt_465b
block_3ds 0xa230, 3,1,txt_a230
block_3ds 0xa220, 3,1,txt_a220
block_3ds 0xa351, 3,1,txt_a351
block_3ds 0xb007, 3,1,txt_b007
block_3ds 0xb008, 3,1,txt_b008
block_3ds 0xb022, 3,1,txt_b022
block_3ds 0xb030, 3,1,txt_b030
block_3ds 0xa040, 3,1,txt_a040
block_3ds 0xa041, 3,1,txt_a041
block_3ds 0xa050, 3,1,txt_a050
block_3ds 0xa052, 3,1,txt_a052
block_3ds 0xa053, 3,1,txt_a053
block_3ds 0xa081, 3,1,txt_a081
block_3ds 0xa083, 3,1,txt_a083
block_3ds 0xa084, 3,1,txt_a084
block_3ds 0xa085, 3,1,txt_a085
block_3ds 0xa087, 3,1,txt_a087
block_3ds 0xa088, 3,1,txt_a088
block_3ds 0xa08a, 3,1,txt_a08a
block_3ds 0xa08c, 3,1,txt_a08c
block_3ds 0xa08e, 3,1,txt_a08e
.end:
if lang eq ru_RU
txt_0002 db '3ds ¢¥àá¨ï',0
txt_0011 db '–¢¥â rgb (¡ ©â®¢ë© ä®à¬ â)',0
;txt_0012 db 'LIN_COLOR_24',0
;txt_0030 db 'Percentage value (int)',0
;txt_0031 db 'Percentage value (float)',0
txt_0100 db 'Master scale',0
txt_2100 db '–¢¥â ®ªà㦠î饩 á।ë',0
txt_3d3d db '<27> ¡®à ®¡ê¥ªâ®¢',0
txt_4000 db 'Ž¡ê¥ªâ (á ¨¬¥­¥¬)',0
txt_4100 db '’à¥ã£®«ì­ë¥ á¥âª¨',0
txt_4110 db '‘¯¨á®ª ¢¥à設',0
txt_4120 db '‘¯¨á®ª £à ­¥©',0
txt_4130 db 'Œ â¥à¨ «ë £à ­¥©',0
txt_4140 db '’¥ªáâãà­ë¥ ª®®à¤¨­ âë',0
txt_4160 db 'Œ âà¨æ  ¯¥à¥¢®¤ ',0
txt_4600 db '‘¢¥â',0
txt_4700 db 'Š ¬¥à ',0
txt_a000 db '<27> §¢ ­¨¥ ¬ â¥à¨ « ',0
txt_a010 db 'Žªà㦠î騩 梥â',0
txt_a020 db '„¨ääã§­ë© æ¢¥â',0
txt_a030 db '‡¥àª «ì­ë© 梥â',0
txt_a100 db '’¨¯ ¬ â¥à¨ «  [1=flat 2=gouraud 3=phong 4=metal]',0
txt_a200 db '’¥ªáâãà  ¬ â¥à¨ «  1',0
txt_a300 db 'ˆ¬ï ä ©«  ⥪áâãàë',0
;txt_a353 db 'MAT_MAP_TEXBLUR',0
txt_afff db 'Œ â¥à¨ «',0
txt_b000 db 'ˆ­ä®à¬ æ¨ï ®¡  ­¨¬ æ¨¨',0
txt_b002 db '<27>®¢¥¤¥­¨¥ ®¡ê¥ªâ ',0
;txt_b009 db 'KFCURTIME',0
;txt_b00a db 'KFHDR',0
txt_b010 db '<27> §¢ ­¨¥ ®¡ê¥ªâ ',0
txt_b011 db 'ˆ¬ï íª§¥¬¯«ïà ',0
txt_b013 db '–¥­âà ¢à é¥­¨ï ®¡ê¥ªâ ',0
txt_b014 db 'Bound box',0
txt_b020 db '’à ¥ªâ®à¨ï ¤¢¨¦¥­¨ï',0
txt_b021 db '’à ¥ªâ®à¨ï ¢à é¥­¨ï',0
txt_b003 db '<27>®¢¥¤¥­¨¥ ª ¬¥àë',0
txt_b023 db '<27>®¢¥¤¥­¨¥ fov ª ¬¥àë',0
txt_b024 db '<27>®¢¥¤¥­¨¥ roll ª ¬¥àë',0
txt_b004 db '<27>®¢¥¤¥­¨¥ "楫¨" ª ¬¥àë',0
;--- ¤ «¥¥ ­¥ ¢® ¢á¥å ¡«®ª å ᬮ£ ­ ©â¨ ®¯¨á ­¨¥ ­  àãá᪮¬ ï§ëª¥
txt_4111 db '”« £¨ ¢¥à設',0
txt_4150 db 'Smoothing group list',0
txt_4165 db 'Object color in editor',0
txt_4610 db '<27> ¯à ¢«¥­­ë© ᢥâ',0
txt_4627 db 'Spot raytrace',0
txt_4630 db 'Light shadowed',0
txt_4641 db 'Spot shadow map',0
txt_4650 db 'Spot show cone',0
txt_4651 db 'Spot is rectangular',0
txt_4652 db 'Spot overshoot',0
txt_4653 db 'Spot map',0
txt_4656 db 'Spot roll',0
txt_4658 db 'Spot ray trace bias',0
txt_4620 db 'Light off',0
txt_4625 db 'Attenuation on',0
txt_4659 db 'Range start',0
txt_465a db 'Range end',0
txt_465b db 'Multiplier',0
txt_a230 db '<27> §¬¥âª  ५ì¥ä ',0
txt_a220 db '<27> §¬¥âª  ®âà ¦¥­¨ï',0
txt_a351 db '<27> à ¬¥âàë à §¬¥âª¨',0
txt_b007 db 'ˆ­ä®à¬ æ¨ï ® ­ ¯à ¢«¥­®¬ ®á¢¥é¥­¨¨',0
txt_b008 db 'Š ¤àë (­ ç «ì­ë© ¨ ª®­¥ç­ë©)',0
txt_b022 db 'Œ áèâ ¡¨à®¢ ­¨¥',0
txt_b030 db '<27>®§¨æ¨ï ¢ ¨¥à à娨',0
txt_a040 db 'Shininess percent',0
txt_a041 db 'Shininess strength percent',0
txt_a050 db 'Transparency percent',0
txt_a052 db 'Transparency falloff percent',0
txt_a053 db 'Reflection blur percent',0
txt_a081 db '2 sided',0
txt_a083 db 'Add trans',0
txt_a084 db 'Self illum',0
txt_a085 db 'Wire frame on',0
txt_a087 db 'Wire thickness',0
txt_a088 db 'Face map',0
txt_a08a db 'In tranc',0
txt_a08c db 'Soften',0
txt_a08e db 'Wire in units',0
txt_not_delete db '<27>¥ ¬®£ã 㤠«¨âì ¢ë¡à ­­ë© ¡«®ª. Ž­ § é¨é¥­.',0
else ; Default to en_US
txt_0002 db '3ds version',0
txt_0011 db 'Color rgb (byte format)',0
txt_0100 db 'Master scale',0
txt_2100 db 'Ambient color',0
txt_3d3d db 'Editor chunk',0
txt_4000 db 'Object (with name)',0
txt_4100 db 'Triangular mesh',0
txt_4110 db 'Vertices list',0
txt_4120 db 'Faces description',0
txt_4130 db 'Faces material',0
txt_4140 db 'Mapping coordinates list',0
txt_4160 db 'Local coordinate system',0
txt_4600 db 'Light',0
txt_4700 db 'Camera',0
txt_a000 db 'Material name',0
txt_a010 db 'Ambient color',0
txt_a020 db 'Diffuse color',0
txt_a030 db 'Specular color',0
txt_a100 db 'Material type [1=flat 2=gouraud 3=phong 4=metal]',0
txt_a200 db 'Texture map 1',0
txt_a300 db 'Mapping filename',0
txt_afff db 'Meterial',0
txt_b000 db 'Keyframer',0
txt_b002 db 'Mesh information',0
txt_b010 db 'Object name',0
txt_b011 db 'Instance name',0
txt_b013 db 'Object pivot point',0
txt_b014 db 'Bound box',0
txt_b020 db 'Position track',0
txt_b021 db 'Rotation track',0
txt_b003 db 'Camera information',0
txt_b023 db 'Fov track',0
txt_b024 db 'Roll track',0
txt_b004 db 'Camera target information',0
;---
txt_4111 db 'Vertex flags',0
txt_4150 db 'Smoothing group list',0
txt_4165 db 'Object color in editor',0
txt_4610 db 'Spotlight',0
txt_4627 db 'Spot raytrace',0
txt_4630 db 'Light shadowed',0
txt_4641 db 'Spot shadow map',0
txt_4650 db 'Spot show cone',0
txt_4651 db 'Spot is rectangular',0
txt_4652 db 'Spot overshoot',0
txt_4653 db 'Spot map',0
txt_4656 db 'Spot roll',0
txt_4658 db 'Spot ray trace bias',0
txt_4620 db 'Light off',0
txt_4625 db 'Attenuation on',0
txt_4659 db 'Range start',0
txt_465a db 'Range end',0
txt_465b db 'Multiplier',0
txt_a230 db 'Bump map',0
txt_a220 db 'Reflection map',0
txt_a351 db 'Mapping parameters',0
txt_b007 db 'Spot light information',0
txt_b008 db 'Frames (Start and End)',0
txt_b022 db 'Scale track',0
txt_b030 db 'Hierarchy position',0
txt_a040 db 'Shininess percent',0
txt_a041 db 'Shininess strength percent',0
txt_a050 db 'Transparency percent',0
txt_a052 db 'Transparency falloff percent',0
txt_a053 db 'Reflection blur percent',0
txt_a081 db '2 sided',0
txt_a083 db 'Add trans',0
txt_a084 db 'Self illum',0
txt_a085 db 'Wire frame on',0
txt_a087 db 'Wire thickness',0
txt_a088 db 'Face map',0
txt_a08a db 'In tranc',0
txt_a08c db 'Soften',0
txt_a08e db 'Wire in units',0
txt_not_delete db 'Cannot delete the selected chunk: it is protected.',0
end if
if lang eq ru_RU
txt_open_3ds db 'Žâªàëâ ä ©«:',0
txt_no_3ds: db 'Žâªàëâë© ä ©« ­¥ ¢ ä®à¬ â¥ *.3ds ',39
.zag: rb 8
db 39,0
txt_3ds_err_sizes db '‚®§¬®¦­® ä ©« ¯®¢à¥¦¤¥­',0
txt_count db 'Š®«¨ç¥á⢮',0
txt_3ds_offs:
db '‘¬¥é¥­¨¥: '
.dig: rb 8
db ' <20> §¬¥à: '
.siz: rb 8
db 0
txt_mat_null db 'Œ â¥à¨ «ë ­¥ ­ ©¤¥­ë',0
else ; Default to en_US
txt_open_3ds db 'Open file:',0
txt_no_3ds: db 'Open file not in format *.3ds ',39
.zag: rb 8
db 39,0
txt_3ds_err_sizes db 'File may be corrupted',0
txt_count db 'Count',0
txt_3ds_offs:
db 'Offset: '
.dig: rb 8
db ' Size: '
.siz: rb 8
db 0
txt_mat_null db 'No materials found',0
end if

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1 +1,55 @@
if lang eq ru_RU sz_main_menu_View db '‚¨¤', 0 sz_main_menu_Veiw_Vertexes db '‚¥àè¨­ë ¢ª«.', 0 sz_main_menu_Veiw_Faces db 'Š àª á­ë¥ £à ­¨ ¢ª«.', 0 sz_main_menu_Veiw_Faces_Fill db '‘¯«®è­ë¥ £à ­¨ ¢ª«.', 0 sz_main_menu_Veiw_Light db '‘¢¥â ¢ª«./¢ëª«.', 0 sz_main_menu_Veiw_Smooth db '‘£« ¦¨¢ ­¨¥ ¢ª«./¢ëª«.', 0 sz_main_menu_Veiw_Reset db '‘¡à®á ­ áâ஥ª', 0 if version_edit eq 0 sz_main_menu_Veiw_Faces_Mat db '<27> §­®æ¢¥â­ë¥ £à ­¨ ¢ª«.', 0 else sz_main_menu_Vertexes db '‚¥à設ë', 0 sz_main_menu_Vertexes_Select db '‚뤥«¨âì ¢¥à設ã', 0 sz_main_menu_Vertexes_Deselect db 'Žâ¬¥­¨âì ¢áñ ¢ë¤¥«¥­¨¥', 0 sz_main_menu_Average_x db '‘।­¥¥ x',0 sz_main_menu_Average_y db '‘।­¥¥ y',0 sz_main_menu_Average_z db '‘।­¥¥ z',0 end if else sz_main_menu_View db 'View', 0 sz_main_menu_Veiw_Vertexes db 'Vertexes on', 0 sz_main_menu_Veiw_Faces db 'Edges on', 0 sz_main_menu_Veiw_Faces_Fill db 'Faces on', 0 sz_main_menu_Veiw_Light db 'Light on/off', 0 sz_main_menu_Veiw_Smooth db 'Smooth on/off', 0 sz_main_menu_Veiw_Reset db 'Reset settings', 0 if version_edit eq 0 sz_main_menu_Veiw_Faces_Mat db 'Diferent color faces on', 0 else sz_main_menu_Vertexes db 'Vertexes', 0 sz_main_menu_Vertexes_Select db 'Select vertex', 0 sz_main_menu_Vertexes_Deselect db 'Deselect all', 0 sz_main_menu_Average_x db 'Average x',0 sz_main_menu_Average_y db 'Average y',0 sz_main_menu_Average_z db 'Average z',0 end if end if main_menu dd 0 main_menu_file dd 0 main_menu_view dd 0 main_menu_vertexes dd 0 KMENUITEM_NORMAL equ 0 KMENUITEM_SUBMENU equ 1 KMENUITEM_SEPARATOR equ 2
; Language support for locales: ru_RU (CP866), en_US.
if lang eq ru_RU
sz_main_menu_View db '‚¨¤', 0
sz_main_menu_Veiw_Vertexes db '‚¥àè¨­ë ¢ª«.', 0
sz_main_menu_Veiw_Faces db 'Š àª á­ë¥ £à ­¨ ¢ª«.', 0
sz_main_menu_Veiw_Faces_Fill db '‘¯«®è­ë¥ £à ­¨ ¢ª«.', 0
sz_main_menu_Veiw_Light db '‘¢¥â ¢ª«./¢ëª«.', 0
sz_main_menu_Veiw_Smooth db '‘£« ¦¨¢ ­¨¥ ¢ª«./¢ëª«.', 0
sz_main_menu_Veiw_Reset db '‘¡à®á ­ áâ஥ª', 0
if version_edit eq 0
sz_main_menu_Veiw_Faces_Mat db '<27> §­®æ¢¥â­ë¥ £à ­¨ ¢ª«.', 0
else
sz_main_menu_Vertexes db '‚¥à設ë', 0
sz_main_menu_Vertexes_Select db '‚뤥«¨âì ¢¥à設ã', 0
sz_main_menu_Vertexes_Deselect db 'Žâ¬¥­¨âì ¢áñ ¢ë¤¥«¥­¨¥', 0
sz_main_menu_Average_x db '‘।­¥¥ x',0
sz_main_menu_Average_y db '‘।­¥¥ y',0
sz_main_menu_Average_z db '‘।­¥¥ z',0
end if
else ; Default to en_US
sz_main_menu_View db 'View', 0
sz_main_menu_Veiw_Vertexes db 'Vertexes on', 0
sz_main_menu_Veiw_Faces db 'Edges on', 0
sz_main_menu_Veiw_Faces_Fill db 'Faces on', 0
sz_main_menu_Veiw_Light db 'Light on/off', 0
sz_main_menu_Veiw_Smooth db 'Smooth on/off', 0
sz_main_menu_Veiw_Reset db 'Reset settings', 0
if version_edit eq 0
sz_main_menu_Veiw_Faces_Mat db 'Diferent color faces on', 0
else
sz_main_menu_Vertexes db 'Vertexes', 0
sz_main_menu_Vertexes_Select db 'Select vertex', 0
sz_main_menu_Vertexes_Deselect db 'Deselect all', 0
sz_main_menu_Average_x db 'Average x',0
sz_main_menu_Average_y db 'Average y',0
sz_main_menu_Average_z db 'Average z',0
end if
end if
main_menu dd 0
main_menu_file dd 0
main_menu_view dd 0
main_menu_vertexes dd 0
KMENUITEM_NORMAL equ 0
KMENUITEM_SUBMENU equ 1
KMENUITEM_SEPARATOR equ 2

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,318 +1,318 @@
; <20>ணࠬ¬  ¤«ï ¯à¥®¡à §®¢ ­¨ï ç¨á¥« ¨§ áâப¨
; ¢ ä®à¬ â float, double,   â ª¦¥ ¨§ 10 ¨«¨ 16 à¨ç­®£®
; ¢® float.
; ‘¤¥« ­  ­  ®á­®¢¥ hex2dec2bin ¨ ¯à¨¬¥à®¢ ¨§ ä ©«  list2_05.inc
; ( ¢â®à Šã« ª®¢ ‚« ¤¨¬¨à ƒ¥­­ ¤ì¥¢¨ç 24.05.2002),
; ª®â®àë¥ ChE ¯¥à¥¤¥« « á 16 ­  32 ¡¨â  ­   áᥬ¡«¥à fasm.
; <20>ணࠬ¬  ¯®§¢®«ï¥â à¥è âì â ª¨¥ § ¤ ç¨:
; 1) ç¨á«® ¢ áâப®¢®¬ ¢¨¤¥ ¯¥à¥¢¥á⨠¢ 4 ¡ ©â  (float) ¢ ¬ è¨­­ë© ¢¨¤
; 2) ç¨á«® ¢ áâப®¢®¬ ¢¨¤¥ ¯¥à¥¢¥á⨠¢ 8 ¡ ©â (double) ¢ ¬ è¨­­ë© ¢¨¤
; 3) ç¨á«® ¢ ¬ è¨­­®¬ ¢¨¤¥ (float) ¯¥à¥¢¥á⨠¢ áâப®¢ë© ¢¨¤ (5 §­ ª®¢ ¯®á«¥ § ¯ï⮩)
use32
org 0
db 'MENUET01'
dd 1,start,i_end,e_end,e_end,0,sys_path
include '../../../proc32.inc'
include '../../../macros.inc'
include '../../../KOSfuncs.inc'
include '../../../load_lib.mac'
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
include '../../../develop/info3ds/info_fun_float.inc'
include 'lang.inc'
@use_library
align 4
start:
load_libraries l_libs_start,l_libs_end
;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨« áì ­ è  ¡¨¡«¨®â¥ª 
mov ebp,lib_0
cmp dword[ebp+ll_struc_size-4],0
jz @f
mcall SF_TERMINATE_PROCESS
@@:
mcall SF_SET_EVENTS_MASK,0xC0000027
mcall SF_STYLE_SETTINGS,SSF_GET_COLORS, sys_colors, sizeof.system_colors
edit_boxes_set_sys_color edit1,editboxes_end,sys_colors
option_boxes_set_sys_color sys_colors,Option_boxes1
align 4
red:
call draw_window
align 4
still:
mcall SF_WAIT_EVENT
cmp eax,1 ; ¯¥à¥à¨á®¢ âì ®ª­® ?
je red ; ¥á«¨ ¤  - ­  ¬¥âªã red
cmp eax,2 ; ­ ¦ â  ª« ¢¨è  ?
je key ; ¥á«¨ ¤  - ­  key
cmp eax,3 ; ­ ¦ â  ª­®¯ª  ?
je button ; ¥á«¨ ¤  - ­  button
cmp eax,6
je mouse
jmp still ; ¥á«¨ ¤à㣮¥ ᮡë⨥ - ¢ ­ ç «® 横« 
align 4
key: ; ­ ¦ â  ª« ¢¨è  ­  ª« ¢¨ âãà¥
mcall SF_GET_KEY
;cmp ah,13
stdcall [edit_box_key], edit1
jmp still ; ¢¥à­ãâìáï ª ­ ç «ã 横« 
align 4
button:
mcall SF_GET_BUTTON
cmp ah, 1 ; ¥á«¨ <20>… ­ ¦ â  ª­®¯ª  á ­®¬¥à®¬ 1,
jne @f
mcall SF_TERMINATE_PROCESS
@@:
cmp ah, 5
jne @f
cmp dword[option_group1],opt3
jne .opt_3_end
stdcall conv_str_to_int,[edit1.text]
mov dword[Data_Double],eax
finit
fld dword[Data_Double]
fstp qword[Data_Double]
; Data_Double - ¯à¥®¡à §ã¥¬®¥ ç¨á«®
mov word[NumberSymbolsAD],8 ; ª®«¨ç¥á⢮ §­ ª®¢ ç¨á«  ¯®á«¥ § ¯ï⮩ (1-17)
call DoubleFloat_to_String
call String_crop_0
mov dword[Data_Double],eax ;¢®ááâ ­ ¢«¨¢ ¥¬ §­ ç¥­¨¥ ¢ ä®à¬ â¥ float
jmp .opt_all_end
.opt_3_end:
mov esi,string1
mov edi,Data_String
cld
mov ecx,32
rep movsb
call String_to_DoubleFloat
cmp dword[option_group1],opt1
jne .opt_all_end ;¥á«¨ ¢ë¡à ­ float, â® ¯à¥®¡à §ã¥¬ ¨§ à ­¥¥ ¯®«ã祭­®£® double
finit
fld qword[Data_Double] ;ç¨â ¥¬ ¨§ double
fstp dword[Data_Double] ;  ¢®§¢à é ¥¬ ¢® float
.opt_all_end:
jmp red
@@:
jmp still
align 4
mouse:
stdcall [edit_box_mouse], edit1
stdcall [option_box_mouse], Option_boxes1
jmp still
;------------------------------------------------
align 4
draw_window:
mcall SF_STYLE_SETTINGS,SSF_GET_COLORS, sys_colors, sizeof.system_colors
mcall SF_REDRAW,SSF_BEGIN_DRAW
mov edx, 0x14000000
or edx, [sys_colors.work]
mcall SF_CREATE_WINDOW, (200 shl 16)+300, (200 shl 16)+175, ,,title
mcall SF_DEFINE_BUTTON, ((300-53) shl 16)+38, (145 shl 16)+15, 5, [sys_colors.work_button] ; ª­®¯ª  Ok
mov ecx, 0x80000000
or ecx, [sys_colors.work_text]
mcall SF_DRAW_TEXT, (15 shl 16) +30,, binstr,
mcall , (15 shl 16) +58,, decstr,
mcall , ((240-56*3) shl 16) +58,, Data_String,
mcall , (15 shl 16) +72,, hexstr,
mcall , (15 shl 16)+150,, numstr,
mov ecx, 0x80000000
or ecx, [sys_colors.work_button_text]
mcall , ((300-42) shl 16)+149, , Okstr,3
cmp dword[option_group1],opt1
je @f ;¥á«¨ ¢ë¡à ­ float, â® áâ à訥 4 ¡ ©â  (¨§ double) ­¥ ¯¥ç â ¥¬
cmp dword[option_group1],opt3
je @f ;¥á«¨ ¢ë¡à ­ float, â® áâ à訥 4 ¡ ©â  (¨§ double) ­¥ ¯¥ç â ¥¬
mov ecx, dword[Data_Double+4]
mcall SF_DRAW_NUMBER, (8 shl 16)+256,,(185 shl 16)+72,[sys_colors.work_text] ; 16-­ ï
mov ecx, dword[Data_Double+4]
mcall ,(8 shl 16)+512,,(240 shl 16)+30, ; 2-­ ï
ror ecx, 8
mcall ,,,((240-56) shl 16)+30,
ror ecx, 8
mcall ,,,((240-56*2) shl 16)+30,
ror ecx, 8
mcall ,,,((240-56*3) shl 16)+30,
ror ecx, 8
@@:
mov ecx,dword[Data_Double]
mcall SF_DRAW_NUMBER, (8 shl 16)+256,,(240 shl 16)+72,[sys_colors.work_text] ; 16-­ ï
mov ecx,dword[Data_Double]
mcall , (8 shl 16)+512,,(240 shl 16)+44, ; 2-­ ï
ror ecx, 8
mcall ,,,((240-56) shl 16)+44,
ror ecx, 8
mcall ,,,((240-56*2) shl 16)+44,
ror ecx, 8
mcall ,,,((240-56*3) shl 16)+44,
ror ecx, 8
mcall SF_DRAW_LINE, (15 shl 16)+300-15, (137 shl 16)+137, [sys_colors.work_graph]
stdcall [edit_box_draw], edit1
stdcall [option_box_draw], Option_boxes1
mcall SF_REDRAW,SSF_END_DRAW
ret
string1 db 32 dup (0)
string1_end:
;input:
; buf - 㪠§ â¥«ì ­  áâபã, ç¨á«® ¤®«¦­® ¡ëâì ¢ 10 ¨«¨ 16 à¨ç­®¬ ¢¨¤¥
;output:
; eax - ç¨á«®
align 4
proc conv_str_to_int uses ebx ecx esi, buf:dword
xor eax,eax
xor ebx,ebx
mov esi,[buf]
;®¯à¥¤¥«¥­¨¥ ®âà¨æ â¥«ì­ëå ç¨á¥«
xor ecx,ecx
inc ecx
cmp byte[esi],'-'
jne @f
dec ecx
inc esi
@@:
cmp word[esi],'0x'
je .load_digit_16
.load_digit_10: ;áç¨â뢠­¨¥ 10-â¨ç­ëå æ¨äà
mov bl,byte[esi]
cmp bl,'0'
jl @f
cmp bl,'9'
jg @f
sub bl,'0'
imul eax,10
add eax,ebx
inc esi
jmp .load_digit_10
jmp @f
.load_digit_16: ;áç¨â뢠­¨¥ 16-à¨ç­ëå æ¨äà
add esi,2
.cycle_16:
mov bl,byte[esi]
cmp bl,'0'
jl @f
cmp bl,'f'
jg @f
cmp bl,'9'
jle .us1
cmp bl,'A'
jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'9' ¨ <'A'
.us1: ;á®áâ ¢­®¥ ãá«®¢¨¥
cmp bl,'F'
jle .us2
cmp bl,'a'
jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'F' ¨ <'a'
sub bl,32 ;¯¥à¥¢®¤¨¬ ᨬ¢®«ë ¢ ¢¥àå­¨© ॣ¨áâà, ¤«ï ã¯à®é¥­¨ï ¨å ¯®á«¥¤ã饩 ®¡à ¡®âª¨
.us2: ;á®áâ ¢­®¥ ãá«®¢¨¥
sub bl,'0'
cmp bl,9
jle .cor1
sub bl,7 ;convert 'A' to '10'
.cor1:
shl eax,4
add eax,ebx
inc esi
jmp .cycle_16
@@:
cmp ecx,0 ;¥á«¨ ç¨á«® ®âà¨æ â¥«ì­®¥
jne @f
sub ecx,eax
mov eax,ecx
@@:
ret
endp
;-------------------------------------------------
title db 'string to double 03.01.21',0
hexstr db 'hex:',0
decstr db 'dec:',0
binstr db 'bin:',0
if lang eq ru_RU
numstr db '—¨á«®:',0
Okstr db '‚¢®¤',0
else
numstr db 'Number:',0
Okstr db 'Ok',0
end if
mouse_dd dd 0
edit1 edit_box 182, 59, 146, 0xffffff, 0xff, 0x80ff, 0, 0x8000, (string1_end-string1), string1, mouse_dd, 0
editboxes_end:
;option_boxes
opt1 option_box option_group1, 15, 90, 8, 12, 0xffffff, 0x80ff, 0, op_text.1, 17
opt2 option_box option_group1, 15, 106, 8, 12, 0xffffff, 0x80ff, 0, op_text.2, 18
opt3 option_box option_group1, 15, 122, 8, 12, 0xffffff, 0x80ff, 0, op_text.3, 21
op_text: ;⥪áâ ¤«ï à ¤¨® ª­®¯®ª
.1 db 'str(dec) -> float'
.2 db 'str(dec) -> double'
.3 db 'float(dec,hex) -> str'
;㪠§ â¥«¨ ¤«ï option_box
option_group1 dd opt1
Option_boxes1 dd opt1, opt2, opt3, 0
system_dir_0 db '/sys/lib/'
lib_name_0 db 'box_lib.obj',0
l_libs_start:
lib_0 l_libs lib_name_0, library_path, system_dir_0,import_box_lib
l_libs_end:
align 4
import_box_lib:
;dd sz_init1
edit_box_draw dd sz_edit_box_draw
edit_box_key dd sz_edit_box_key
edit_box_mouse dd sz_edit_box_mouse
;edit_box_set_text dd sz_edit_box_set_text
option_box_draw dd aOption_box_draw
option_box_mouse dd aOption_box_mouse
;version_op dd aVersion_op
dd 0,0
;sz_init1 db 'lib_init',0
sz_edit_box_draw db 'edit_box_draw',0
sz_edit_box_key db 'edit_box_key',0
sz_edit_box_mouse db 'edit_box_mouse',0
;sz_edit_box_set_text db 'edit_box_set_text',0
aOption_box_draw db 'option_box_draw',0
aOption_box_mouse db 'option_box_mouse',0
;aVersion_op db 'version_op',0
i_end:
sys_colors system_colors
align 16
sys_path rb 4096
library_path rb 4096
rb 0x400 ;stack
e_end: ; ¬¥âª  ª®­æ  ¯à®£à ¬¬ë
; <20>ணࠬ¬  ¤«ï ¯à¥®¡à §®¢ ­¨ï ç¨á¥« ¨§ áâப¨
; ¢ ä®à¬ â float, double,   â ª¦¥ ¨§ 10 ¨«¨ 16 à¨ç­®£®
; ¢® float.
; ‘¤¥« ­  ­  ®á­®¢¥ hex2dec2bin ¨ ¯à¨¬¥à®¢ ¨§ ä ©«  list2_05.inc
; ( ¢â®à Šã« ª®¢ ‚« ¤¨¬¨à ƒ¥­­ ¤ì¥¢¨ç 24.05.2002),
; ª®â®àë¥ ChE ¯¥à¥¤¥« « á 16 ­  32 ¡¨â  ­   áᥬ¡«¥à fasm.
; <20>ணࠬ¬  ¯®§¢®«ï¥â à¥è âì â ª¨¥ § ¤ ç¨:
; 1) ç¨á«® ¢ áâப®¢®¬ ¢¨¤¥ ¯¥à¥¢¥á⨠¢ 4 ¡ ©â  (float) ¢ ¬ è¨­­ë© ¢¨¤
; 2) ç¨á«® ¢ áâப®¢®¬ ¢¨¤¥ ¯¥à¥¢¥á⨠¢ 8 ¡ ©â (double) ¢ ¬ è¨­­ë© ¢¨¤
; 3) ç¨á«® ¢ ¬ è¨­­®¬ ¢¨¤¥ (float) ¯¥à¥¢¥á⨠¢ áâப®¢ë© ¢¨¤ (5 §­ ª®¢ ¯®á«¥ § ¯ï⮩)
use32
org 0
db 'MENUET01'
dd 1,start,i_end,e_end,e_end,0,sys_path
include '../../../proc32.inc'
include '../../../macros.inc'
include '../../../KOSfuncs.inc'
include '../../../load_lib.mac'
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
include '../../../develop/info3ds/info_fun_float.inc'
include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US.
@use_library
align 4
start:
load_libraries l_libs_start,l_libs_end
;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨« áì ­ è  ¡¨¡«¨®â¥ª 
mov ebp,lib_0
cmp dword[ebp+ll_struc_size-4],0
jz @f
mcall SF_TERMINATE_PROCESS
@@:
mcall SF_SET_EVENTS_MASK,0xC0000027
mcall SF_STYLE_SETTINGS,SSF_GET_COLORS, sys_colors, sizeof.system_colors
edit_boxes_set_sys_color edit1,editboxes_end,sys_colors
option_boxes_set_sys_color sys_colors,Option_boxes1
align 4
red:
call draw_window
align 4
still:
mcall SF_WAIT_EVENT
cmp eax,1 ; ¯¥à¥à¨á®¢ âì ®ª­® ?
je red ; ¥á«¨ ¤  - ­  ¬¥âªã red
cmp eax,2 ; ­ ¦ â  ª« ¢¨è  ?
je key ; ¥á«¨ ¤  - ­  key
cmp eax,3 ; ­ ¦ â  ª­®¯ª  ?
je button ; ¥á«¨ ¤  - ­  button
cmp eax,6
je mouse
jmp still ; ¥á«¨ ¤à㣮¥ ᮡë⨥ - ¢ ­ ç «® 横« 
align 4
key: ; ­ ¦ â  ª« ¢¨è  ­  ª« ¢¨ âãà¥
mcall SF_GET_KEY
;cmp ah,13
stdcall [edit_box_key], edit1
jmp still ; ¢¥à­ãâìáï ª ­ ç «ã 横« 
align 4
button:
mcall SF_GET_BUTTON
cmp ah, 1 ; ¥á«¨ <20>… ­ ¦ â  ª­®¯ª  á ­®¬¥à®¬ 1,
jne @f
mcall SF_TERMINATE_PROCESS
@@:
cmp ah, 5
jne @f
cmp dword[option_group1],opt3
jne .opt_3_end
stdcall conv_str_to_int,[edit1.text]
mov dword[Data_Double],eax
finit
fld dword[Data_Double]
fstp qword[Data_Double]
; Data_Double - ¯à¥®¡à §ã¥¬®¥ ç¨á«®
mov word[NumberSymbolsAD],8 ; ª®«¨ç¥á⢮ §­ ª®¢ ç¨á«  ¯®á«¥ § ¯ï⮩ (1-17)
call DoubleFloat_to_String
call String_crop_0
mov dword[Data_Double],eax ;¢®ááâ ­ ¢«¨¢ ¥¬ §­ ç¥­¨¥ ¢ ä®à¬ â¥ float
jmp .opt_all_end
.opt_3_end:
mov esi,string1
mov edi,Data_String
cld
mov ecx,32
rep movsb
call String_to_DoubleFloat
cmp dword[option_group1],opt1
jne .opt_all_end ;¥á«¨ ¢ë¡à ­ float, â® ¯à¥®¡à §ã¥¬ ¨§ à ­¥¥ ¯®«ã祭­®£® double
finit
fld qword[Data_Double] ;ç¨â ¥¬ ¨§ double
fstp dword[Data_Double] ;  ¢®§¢à é ¥¬ ¢® float
.opt_all_end:
jmp red
@@:
jmp still
align 4
mouse:
stdcall [edit_box_mouse], edit1
stdcall [option_box_mouse], Option_boxes1
jmp still
;------------------------------------------------
align 4
draw_window:
mcall SF_STYLE_SETTINGS,SSF_GET_COLORS, sys_colors, sizeof.system_colors
mcall SF_REDRAW,SSF_BEGIN_DRAW
mov edx, 0x14000000
or edx, [sys_colors.work]
mcall SF_CREATE_WINDOW, (200 shl 16)+300, (200 shl 16)+175, ,,title
mcall SF_DEFINE_BUTTON, ((300-53) shl 16)+38, (145 shl 16)+15, 5, [sys_colors.work_button] ; ª­®¯ª  Ok
mov ecx, 0x80000000
or ecx, [sys_colors.work_text]
mcall SF_DRAW_TEXT, (15 shl 16) +30,, binstr,
mcall , (15 shl 16) +58,, decstr,
mcall , ((240-56*3) shl 16) +58,, Data_String,
mcall , (15 shl 16) +72,, hexstr,
mcall , (15 shl 16)+150,, numstr,
mov ecx, 0x80000000
or ecx, [sys_colors.work_button_text]
mcall , ((300-42) shl 16)+149, , Okstr,3
cmp dword[option_group1],opt1
je @f ;¥á«¨ ¢ë¡à ­ float, â® áâ à訥 4 ¡ ©â  (¨§ double) ­¥ ¯¥ç â ¥¬
cmp dword[option_group1],opt3
je @f ;¥á«¨ ¢ë¡à ­ float, â® áâ à訥 4 ¡ ©â  (¨§ double) ­¥ ¯¥ç â ¥¬
mov ecx, dword[Data_Double+4]
mcall SF_DRAW_NUMBER, (8 shl 16)+256,,(185 shl 16)+72,[sys_colors.work_text] ; 16-­ ï
mov ecx, dword[Data_Double+4]
mcall ,(8 shl 16)+512,,(240 shl 16)+30, ; 2-­ ï
ror ecx, 8
mcall ,,,((240-56) shl 16)+30,
ror ecx, 8
mcall ,,,((240-56*2) shl 16)+30,
ror ecx, 8
mcall ,,,((240-56*3) shl 16)+30,
ror ecx, 8
@@:
mov ecx,dword[Data_Double]
mcall SF_DRAW_NUMBER, (8 shl 16)+256,,(240 shl 16)+72,[sys_colors.work_text] ; 16-­ ï
mov ecx,dword[Data_Double]
mcall , (8 shl 16)+512,,(240 shl 16)+44, ; 2-­ ï
ror ecx, 8
mcall ,,,((240-56) shl 16)+44,
ror ecx, 8
mcall ,,,((240-56*2) shl 16)+44,
ror ecx, 8
mcall ,,,((240-56*3) shl 16)+44,
ror ecx, 8
mcall SF_DRAW_LINE, (15 shl 16)+300-15, (137 shl 16)+137, [sys_colors.work_graph]
stdcall [edit_box_draw], edit1
stdcall [option_box_draw], Option_boxes1
mcall SF_REDRAW,SSF_END_DRAW
ret
string1 db 32 dup (0)
string1_end:
;input:
; buf - 㪠§ â¥«ì ­  áâபã, ç¨á«® ¤®«¦­® ¡ëâì ¢ 10 ¨«¨ 16 à¨ç­®¬ ¢¨¤¥
;output:
; eax - ç¨á«®
align 4
proc conv_str_to_int uses ebx ecx esi, buf:dword
xor eax,eax
xor ebx,ebx
mov esi,[buf]
;®¯à¥¤¥«¥­¨¥ ®âà¨æ â¥«ì­ëå ç¨á¥«
xor ecx,ecx
inc ecx
cmp byte[esi],'-'
jne @f
dec ecx
inc esi
@@:
cmp word[esi],'0x'
je .load_digit_16
.load_digit_10: ;áç¨â뢠­¨¥ 10-â¨ç­ëå æ¨äà
mov bl,byte[esi]
cmp bl,'0'
jl @f
cmp bl,'9'
jg @f
sub bl,'0'
imul eax,10
add eax,ebx
inc esi
jmp .load_digit_10
jmp @f
.load_digit_16: ;áç¨â뢠­¨¥ 16-à¨ç­ëå æ¨äà
add esi,2
.cycle_16:
mov bl,byte[esi]
cmp bl,'0'
jl @f
cmp bl,'f'
jg @f
cmp bl,'9'
jle .us1
cmp bl,'A'
jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'9' ¨ <'A'
.us1: ;á®áâ ¢­®¥ ãá«®¢¨¥
cmp bl,'F'
jle .us2
cmp bl,'a'
jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'F' ¨ <'a'
sub bl,32 ;¯¥à¥¢®¤¨¬ ᨬ¢®«ë ¢ ¢¥àå­¨© ॣ¨áâà, ¤«ï ã¯à®é¥­¨ï ¨å ¯®á«¥¤ã饩 ®¡à ¡®âª¨
.us2: ;á®áâ ¢­®¥ ãá«®¢¨¥
sub bl,'0'
cmp bl,9
jle .cor1
sub bl,7 ;convert 'A' to '10'
.cor1:
shl eax,4
add eax,ebx
inc esi
jmp .cycle_16
@@:
cmp ecx,0 ;¥á«¨ ç¨á«® ®âà¨æ â¥«ì­®¥
jne @f
sub ecx,eax
mov eax,ecx
@@:
ret
endp
;-------------------------------------------------
title db 'string to double 03.01.21',0
hexstr db 'hex:',0
decstr db 'dec:',0
binstr db 'bin:',0
if lang eq ru_RU
numstr db '—¨á«®:',0
Okstr db '‚¢®¤',0
else ; Default to en_US
numstr db 'Number:',0
Okstr db 'Ok',0
end if
mouse_dd dd 0
edit1 edit_box 182, 59, 146, 0xffffff, 0xff, 0x80ff, 0, 0x8000, (string1_end-string1), string1, mouse_dd, 0
editboxes_end:
;option_boxes
opt1 option_box option_group1, 15, 90, 8, 12, 0xffffff, 0x80ff, 0, op_text.1, 17
opt2 option_box option_group1, 15, 106, 8, 12, 0xffffff, 0x80ff, 0, op_text.2, 18
opt3 option_box option_group1, 15, 122, 8, 12, 0xffffff, 0x80ff, 0, op_text.3, 21
op_text: ;⥪áâ ¤«ï à ¤¨® ª­®¯®ª
.1 db 'str(dec) -> float'
.2 db 'str(dec) -> double'
.3 db 'float(dec,hex) -> str'
;㪠§ â¥«¨ ¤«ï option_box
option_group1 dd opt1
Option_boxes1 dd opt1, opt2, opt3, 0
system_dir_0 db '/sys/lib/'
lib_name_0 db 'box_lib.obj',0
l_libs_start:
lib_0 l_libs lib_name_0, library_path, system_dir_0,import_box_lib
l_libs_end:
align 4
import_box_lib:
;dd sz_init1
edit_box_draw dd sz_edit_box_draw
edit_box_key dd sz_edit_box_key
edit_box_mouse dd sz_edit_box_mouse
;edit_box_set_text dd sz_edit_box_set_text
option_box_draw dd aOption_box_draw
option_box_mouse dd aOption_box_mouse
;version_op dd aVersion_op
dd 0,0
;sz_init1 db 'lib_init',0
sz_edit_box_draw db 'edit_box_draw',0
sz_edit_box_key db 'edit_box_key',0
sz_edit_box_mouse db 'edit_box_mouse',0
;sz_edit_box_set_text db 'edit_box_set_text',0
aOption_box_draw db 'option_box_draw',0
aOption_box_mouse db 'option_box_mouse',0
;aVersion_op db 'version_op',0
i_end:
sys_colors system_colors
align 16
sys_path rb 4096
library_path rb 4096
rb 0x400 ;stack
e_end: ; ¬¥âª  ª®­æ  ¯à®£à ¬¬ë

View File

@ -1,491 +1,501 @@
sz htext,'TINYPAD ',APP_VERSION
menubar_res main_menu,\
ru,'” ©«' ,mm.File ,onshow.file ,\
ru,'<27>à ¢ª ' ,mm.Edit ,onshow.edit ,\
ru,'<27>®¨áª' ,mm.Search ,onshow.search ,\
ru,'‡ ¯ãáª' ,mm.Run ,onshow.run ,\
ru,'Š®¤¨à®¢ª ',mm.Encoding,onshow.recode ,\
ru,'Ž¯æ¨¨' ,mm.Options ,onshow.options,\
\
en,'File' ,mm.File ,onshow.file ,\
en,'Edit' ,mm.Edit ,onshow.edit ,\
en,'Search' ,mm.Search ,onshow.search ,\
en,'Run' ,mm.Run ,onshow.run ,\
en,'Encoding' ,mm.Encoding,onshow.recode ,\
en,'Options' ,mm.Options ,onshow.options,\
\
it,'File' ,mm.File ,onshow.file ,\
it,'Modificare' ,mm.Edit ,onshow.edit ,\
it,'Ricerca' ,mm.Search ,onshow.search ,\
it,'Correre' ,mm.Run ,onshow.run ,\
it,'Codifica' ,mm.Encoding,onshow.recode ,\
it,'Opzioni' ,mm.Options ,onshow.options,\
\
et,'Fail' ,mm.File ,onshow.file ,\
et,'Muuda' ,mm.Edit ,onshow.edit ,\
et,'Otsi' ,mm.Search ,onshow.search ,\
et,'Käivita' ,mm.Run ,onshow.run ,\
et,'Kodeering',mm.Encoding,onshow.recode ,\
et,'Seaded' ,mm.Options ,onshow.options,\
\
sp,'Archivo' ,mm.File ,onshow.file ,\
sp,'Editar' ,mm.Edit ,onshow.edit ,\
sp,'Buscar' ,mm.Search ,onshow.search ,\
sp,'Ejecutar' ,mm.Run ,onshow.run ,\
sp,'Codificación',mm.Encoding,onshow.recode,\
sp,'Opciones' ,mm.Options ,onshow.options
popup_res mm.File,\
ru,'<27>®¢ë©' ,'Ctrl+N' ,New ,\
ru,'Žâªàëâì...','Ctrl+O' ,Open ,\
ru,'‘®åà ­¨âì' ,'Ctrl+S' ,Save ,\
ru,'‘®åà ­¨âì ª ª...','Ctrl+Shift+S',SaveAs,\
ru,'-','',,\
ru,'‡ ªàëâì' ,'Ctrl+F4' ,Close ,\
ru,'-','',,\
ru,'‚ë室' ,'Alt+X' ,Exit ,\
\
en,'New' ,'Ctrl+N' ,New ,\
en,'Open...' ,'Ctrl+O' ,Open ,\
en,'Save' ,'Ctrl+S' ,Save ,\
en,'Save as...','Ctrl+Shift+S',SaveAs ,\
en,'-','',,\
en,'Close' ,'Ctrl+F4' ,Close ,\
en,'-','',,\
en,'Exit' ,'Alt+X' ,Exit ,\
\
it,'Nuovo' ,'Ctrl+N' ,New ,\
it,'Aperto...' ,'Ctrl+O' ,Open ,\
it,'Salva' ,'Ctrl+S' ,Save ,\
it,'Salva come...','Ctrl+Shift+S',SaveAs ,\
it,'-','',,\
it,'Chiudi' ,'Ctrl+F4' ,Close ,\
it,'-','',,\
it,'Uscita' ,'Alt+X' ,Exit ,\
\
et,'Uus' ,'Ctrl+N' ,New ,\
et,'Ava...' ,'Ctrl+O' ,Open ,\
et,'Salvesta' ,'Ctrl+S' ,Save ,\
et,'Salvesta nimega...','Ctrl+Shift+S',SaveAs,\
et,'-','',,\
et,'Sulge' ,'Ctrl+F4' ,Close ,\
et,'-','',,\
et,'Välju' ,'Alt+X' ,Exit ,\
\
sp,'Nuevo' ,'Ctrl+N' ,New ,\
sp,'Abrir...' ,'Ctrl+O' ,Open ,\
sp,'Guardar' ,'Ctrl+S' ,Save ,\
sp,'Guardar como...','Ctrl+Shift+S',SaveAs,\
sp,'-','',,\
sp,'Cerrar' ,'Ctrl+F4',Close,\
sp,'-','',,\
sp,'Salir' ,'Alt+X' ,Exit
popup_res mm.Edit,\
ru,'‚ë१ âì' ,'Ctrl+X',Cut ,\
ru,'Š®¯¨à®¢ âì' ,'Ctrl+C',Copy ,\
ru,'‚áâ ¢¨âì' ,'Ctrl+V',Insert,\
ru,'“¤ «¨âì' ,'' ,Delete,\
ru,'-','',,\
ru,'‚뤥«¨âì ¢áñ' ,'Ctrl+A',SelAll,\
\
en,'Cut' ,'Ctrl+X',Cut ,\
en,'Copy' ,'Ctrl+C',Copy ,\
en,'Paste' ,'Ctrl+V',Insert,\
en,'Delete' ,'' ,Delete,\
en,'-','',,\
en,'Select all','Ctrl+A',SelAll,\
\
it,'Taglio' ,'Ctrl+X',Cut ,\
it,'Copia' ,'Ctrl+C',Copy ,\
it,'Incolla' ,'Ctrl+V',Insert,\
it,'Elimina' ,'' ,Delete,\
it,'-','',,\
it,'Seleziona tutto','Ctrl+A',SelAll,\
\
et,'Lõika' ,'Ctrl+X',Cut ,\
et,'Kopeeri' ,'Ctrl+C',Copy ,\
et,'Kleebi' ,'Ctrl+V',Insert,\
et,'Kustuta' ,'' ,Delete,\
et,'-','',,\
et,'Vali kõik','Ctrl+A',SelAll,\
\
sp,'Cortar' ,'Ctrl+X',Cut ,\
sp,'Copiar' ,'Ctrl+C',Copy ,\
sp,'Pegar' ,'Ctrl+V',Insert,\
sp,'Eliminar' ,'' ,Delete,\
sp,'-','',,\
sp,'Seleccionar todo','Ctrl+A',SelAll
popup_res mm.Search,\
ru,'<27>¥à¥©â¨...' ,'Ctrl+G',Position,\
ru,'-','',,\
ru,'<27> ©â¨...' ,'Ctrl+F',Find ,\
ru,'<27> ©â¨ ¤ «¥¥','F3' ,FindNext,\
ru,'‡ ¬¥­¨âì...','Ctrl+H',Replace ,\
\
en,'Position...','Ctrl+G',Position,\
en,'-','',,\
en,'Find...' ,'Ctrl+F',Find ,\
en,'Find next' ,'F3' ,FindNext,\
en,'Replace...' ,'Ctrl+H',Replace ,\
\
it,'Posizione...','Ctrl+G',Position,\
it,'-','',,\
it,'Trova...' ,'Ctrl+F',Find ,\
it,'Trova il prossimo' ,'F3' ,FindNext,\
it,'Sostituire...' ,'Ctrl+H',Replace ,\
\
et,'Positsioon...','Ctrl+G',Position,\
et,'-','',,\
et,'Leia...' ,'Ctrl+F',Find ,\
et,'Leia järgmine','F3' ,FindNext,\
et,'Asenda...' ,'Ctrl+H',Replace ,\
\
sp,'Posición...' ,'Ctrl+G',Position,\
sp,'-','',,\
sp,'Buscar...' ,'Ctrl+F',Find ,\
sp,'Buscar siguiente','F3' ,FindNext,\
sp,'Reemplazar...','Ctrl+H',Replace
popup_res mm.Run,\
ru,'‡ ¯ãáâ¨âì' ,'F9' ,Run ,\
ru,'‡ ¯ãáâ¨âì ¢ ¤¥¡ ££¥à¥','F10',Debug ,\
ru,'Š®¬¯¨«¨à®¢ âì' ,'Ctrl+F9',Compile ,\
ru,'-','',,\
ru,'„®áª  ®â« ¤ª¨' ,'' ,DbgBoard,\
ru,'‘¨á⥬­ë¥ ä㭪樨','' ,SysFuncs,\
\
en,'Run' ,'F9' ,Run ,\
en,'Run in debugger' ,'F10' ,Debug ,\
en,'Compile' ,'Ctrl+F9',Compile ,\
en,'-','',,\
en,'Debug board' ,'' ,DbgBoard,\
en,'System functions' ,'' ,SysFuncs,\
\
it,'Correre' ,'F9' ,Run ,\
it,'Esegui nel debugger','F10',Debug ,\
it,'Compilare','Ctrl+F9',Compile ,\
it,'-','',,\
it,'Scheda di debug' ,'' ,DbgBoard,\
it,'Funzioni di sistema','' ,SysFuncs,\
\
et,'Käivita' ,'F9' ,Run ,\
et,'Käivita aastal siluri','F10',Debug ,\
et,'Kompileeri' ,'Ctrl+F9',Compile ,\
et,'-','',,\
et,'Silumis paneel' ,'' ,DbgBoard,\
et,'Süsteemi funktsioonid','' ,SysFuncs,\
\
sp,'Ejecutar' ,'F9' ,Run ,\
sp,'Ejecutar en el depurador','F10',Debug,\
sp,'Compilar' ,'Ctrl+F9',Compile ,\
sp,'-','',,\
sp,'Depuración' ,'' ,DbgBoard,\
sp,'Funciones del sistema' ,'',SysFuncs
popup_res mm.Encoding,\
@!,<'CP866 ',0x1A,' CP1251'>,'',CP866.CP1251,\
@!,<'CP1251 ',0x1A,' CP866' >,'',CP1251.CP866,\
@!,<'-'>,'',,\
@!,<'CP866 ',0x1A,' KOI8-R'>,'',CP866.KOI8R ,\
@!,<'KOI8-R ',0x1A,' CP866' >,'',KOI8R.CP866 ,\
@!,<'-'>,'',,\
@!,<'CP1251 ',0x1A,' KOI8-R'>,'',CP1251.KOI8R,\
@!,<'KOI8-R ',0x1A,' CP1251'>,'',KOI8R.CP1251
popup_res mm.Options,\
ru,'“¢¥«¨ç¨âì' ,'Ctrl +',ZoomIn ,\
ru,'“¬¥­ìè¨âì' ,'Ctrl -',ZoomOut ,\
ru,'-','',,\
ru,'<27>®¬¥à  áâப' ,'',LineNumbers ,\
ru,'<27>¥§®¯ á­®¥ ¢ë¤¥«¥­¨¥' ,'',SecureSel ,\
ru,'€¢â®¬ â¨ç¥áª¨¥ ᪮¡ª¨' ,'',AutoBrackets,\
ru,'€¢â®¬ â¨ç¥áª¨© ®âáâã¯' ,'',AutoIndents ,\
ru,'Ž¯â¨¬ «ì­®¥ á®åà ­¥­¨¥' ,'',OptimalFill ,\
ru,'-','',,\
ru,'‚­¥è­¨© ¢¨¤...' ,'',Appearance ,\
\
en,'Zoom in' ,'Ctrl +',ZoomIn ,\
en,'Zoom out' ,'Ctrl -',ZoomOut ,\
en,'-','',,\
en,'Line numbers' ,'',LineNumbers ,\
en,'Secure selection' ,'',SecureSel ,\
en,'Automatic brackets' ,'',AutoBrackets,\
en,'Automatic indents' ,'',AutoIndents ,\
en,'Optimal fill on saving' ,'',OptimalFill ,\
en,'-','',,\
en,'Appearance...' ,'',Appearance ,\
\
it,'Ingrandire' ,'Ctrl +',ZoomIn ,\
it,'Rimpicciolisci' ,'Ctrl -',ZoomOut ,\
it,'-','',,\
it,'Numeri di riga' ,'',LineNumbers ,\
it,'Selezione sicura' ,'',SecureSel ,\
it,'Staffe automatiche' ,'',AutoBrackets,\
it,'Rientri automatici' ,'',AutoIndents ,\
it,'Combina spazi' ,'',OptimalFill ,\
it,'-','',,\
it,'Aspetto...' ,'',Appearance ,\
\
et,'Zoom in' ,'Ctrl +',ZoomIn ,\
et,'Zoom out' ,'Ctrl -',ZoomOut ,\
et,'-','',,\
et,'Rea numbrid' ,'',LineNumbers ,\
et,'Turvaline valimine' ,'',SecureSel ,\
et,'Automaatsed sulud' ,'',AutoBrackets,\
et,'Automaatsed taandread' ,'',AutoIndents ,\
et,'Optimaalne täitmine salvestamisel','',OptimalFill,\
et,'-','',,\
et,'Välimus...' ,'',Appearance ,\
\
sp,'Zoom in' ,'Ctrl +',ZoomIn ,\
sp,'Zoom out' ,'Ctrl -',ZoomOut ,\
sp,'-','',,\
sp,'Números en líneas' ,'',LineNumbers ,\
sp,'Selección segura' ,'',SecureSel ,\
sp,'Paréntesis automáticos' ,'',AutoBrackets,\
sp,'Identación automática' ,'',AutoIndents ,\
sp,'Llenado óptimo al guardar','',OptimalFill ,\
sp,'-','',,\
sp,'Apariencia...' ,'',Appearance
lsz s_defname,\
ru,<'<27>¥§ë¬ï­­ë©',0>,\
en,<'Untitled',0>,\
it,<'Senza titolo',0>,\
et,<'Nimetu',0>,\
sp,<'Sin título',0>
lsz s_modified,\
ru,'ˆ§¬¥­¥­®',\
en,'Modified',\
it,'Modificato',\
et,'Muudetud',\
sp,'Modificado'
lsz s_2filename,\
ru,'ˆ¬ï ä ©« :',\
en,'Filename:',\
en,'Nome del file:',\
et,'Faili nimi:',\
sp,'Nombre de archivo:'
lsz s_2open,\
ru,'Žâªàëâì',\
en,'Open',\
it,'Aperto',\
et,'Ava',\
sp,'Abrir'
lsz s_2save,\
ru,'‘®åà ­¨âì',\
en,'Save',\
it,'Salva',\
et,'Salvesta',\
sp,'Guardar'
lsz s_2save_no,\
ru,'<27>¥â',\
en,'No',\
it,'No',\
et,'Ei',\
sp,'No'
lsz s_2find,\
ru,'<27> ©â¨',\
en,'Find',\
it,'Trova',\
et,'Leia',\
sp,'Buscar'
db ':'
lsz s_2replace,\
ru,'‡ ¬¥­¨âì',\
en,'Replace',\
it,'Sostituire',\
et,'Asenda',\
sp,'Reemplazar'
db ':'
lsz s_2cancel,\
ru,'Žâ¬¥­ ',\
en,'Cancel',\
it,'Annulla',\
et,'Tühista',\
sp,'Cancelar'
lsz s_color,\
ru,'–¢¥â: 0x',\
en,'Color: 0x',\
it,'Colore: 0x',\
et,'Värv: 0x',\
sp,'Color: 0x'
lsz s_tabpos,\
ru,'<27> á¯®«®¦¥­¨¥ § ª« ¤®ª',\
en,'Tabs placement',\
it,'Posizionamento delle schede',\
et,'Saki asetus',\
sp,'Lugar de tabulador'
lsz s_enter_filename,\
ru,<'‚¢¥¤¨â¥ ¨¬ï ä ©« ',0>,\
en,<'Enter filename',0>,\
it,<'Inserisci il nome del file',0>,\
et,<'Sisesta faili nimi',0>,\
sp,<'Ingresa el nombre del archivo',0>
lsz s_ask_save,\
ru,<'†¥« ¥â¥ á®åà ­¨âì?',0>,\
en,<'Would you like to save?',0>,\
it,<'Vorresti salvare?',0>,\
et,<'Kas soovite salvestada?',0>,\ ; Now correct
sp,<'¿Quieres guardar?',0>
lsz s_enter_text_to_find,\
ru,<'‚¢¥¤¨â¥ ⥪áâ ¤«ï ¯®¨áª ',0>,\
en,<'Enter text to find',0>,\
it,<'Inserisci il testo per trovare',0>,\
et,<'Sisesta otsitav tekst',0>,\
sp,<'Ingresa el texto a buscar',0>
lsz s_enter_text_to_replace,\
ru,<'‚¢¥¤¨â¥ ⥪áâ ¤«ï § ¬¥­ë',0>,\
en,<'Enter text to replace',0>,\
it,<'Inserisci il testo da sostituire',0>,\
et,<'Sisesta asendatav tekst',0>,\
sp,<'Ingresa el texto a reemplazar',0>
lsz s_text_not_found,\
ru,<'„®á⨣­ãâ ª®­¥æ ä ©« , ⥪áâ ­¥ ­ ©¤¥­',0>,\
en,<'Reached end of file, text not found',0>,\
it,<'Raggiunta la fine del file, testo non trovato',0>,\
et,<'Faili lõpp, teksti ei leitud',0>,\
sp,<'Se llegó al final del archivo, texto no encontrado',0>
lszc s_fs_error,b,\
ru,<'Ž¯¥à æ¨ï § ¢¥à襭  ãᯥ譮 (0)',0>,\
ru,<'',0>,\
ru,<'”ã­ªæ¨ï ­¥ ¯®¤¤¥à¦¨¢ ¥âáï ¤«ï ¤ ­­®© ä ©«®¢®© á¨á⥬ë (2)',0>,\
ru,<'<27>¥¨§¢¥áâ­ ï ä ©«®¢ ï á¨á⥬  (3)',0>,\
ru,<'',0>,\
ru,<'<27>¥¢®§¬®¦­® ®âªàëâì ä ©« (5)',0>,\
ru,<'Ž¯¥à æ¨ï § ¢¥à襭  ãᯥ譮 (6)',0>,\
ru,<'€¤à¥á ­ å®¤¨âáï §  £à ­¨æ ¬¨ ¯ ¬ï⨠¯à®£à ¬¬ë (7)',0>,\
ru,<'<27>  ¤¨áª¥ ­¥â ᢮¡®¤­®£® ¬¥áâ  (8)',0>,\
ru,<'’ ¡«¨æ  FAT ã­¨ç⮦¥­  (9)',0>,\
ru,<'„®áâ㯠§ ¯à¥éñ­ (10)',0>,\
ru,<'Žè¨¡ª  ãáâனá⢠ (11)',0>,\
\
en,<'Operation executed successfully (0)',0>,\
en,<'',0>,\
en,<'Function is not supported for the given filesystem (2)',0>,\
en,<'Unknown filesystem (3)',0>,\
en,<'',0>,\
en,<'Unable to open file (5)',0>,\
en,<'Operation executed successfully (6)',0>,\
en,<'Pointer lies outside of application memory (7)',0>,\
en,<'Disk is full (8)',0>,\
en,<'FAT table is destroyed (9)',0>,\
en,<'Access denied (10)',0>,\
en,<'Device error (11)',0>,\
\
it,<'Operazione eseguita correttamente (0)',0>,\
it,<'',0>,\
it,<'La funzione non e supportata per il file system specificato (2)', 0>, \
it,<'Unknown filesystem (3)',0>,\
it,<'',0>,\
it,<'Impossibile aprire il file (5)',0>,\
it,<'Operazione eseguita correttamente (6)',0>,\
it,<'Il puntatore si trova al di fuori della memoria dell',96,'applicazione (7)', 0>, \
it,<'Il disco e pieno (8)',0>,\
it,<'La tabella FAT e distrutta (9)',0>,\
it,<'Accesso negato (10)',0>,\
it,<'Errore dispositivo (11)',0>,\
\
et,<'Operatsioon käivitati edukalt (0)',0>,\
et,<'',0>,\
et,<'Failisüsteem ei toeta funktsiooni (2)',0>,\
et,<'Tundmatu failisüsteem (3)',0>,\
et,<'',0>,\
et,<'Faili ei suudetud avada (5)',0>,\
et,<'Operatsioon käivitatud edukalt (6)',0>,\
et,<'Viit on väljaspool programmi mälu (7)',0>,\
et,<'Ketas täis (8)',0>,\
et,<'FAT tabel hävitatud (9)',0>,\
et,<'Juurdepääs keelatud (10)',0>,\
et,<'Seadme viga (11)',0>,\
\
sp,<'Operación ejecutada correctamente (0)',0>,\
sp,<'',0>,\
sp,<'La función no está soportada por el sistema de archivos dado (2)',0>,\
sp,<'Sistema de archivos desconocido (3)',0>,\
sp,<'',0>,\
sp,<'No es posible abrir el archivo (5)',0>,\
sp,<'Operación ejecutada correctamente (6)',0>,\
sp,<'El puntero está fuera de la memoria de la aplicación (7)',0>,\
sp,<'El disco está lleno (8)',0>,\
sp,<'La tabla FAT está destruida (9)',0>,\
sp,<'Acceso denegado (10)',0>,\
sp,<'Error de dispositivo (11)',0>
lszc s_appearance,b,\
ru,'’¥ªáâ',\
ru,'”®­',\
ru,'’¥ªá⠢뤥«¥­¨ï',\
ru,'”®­ ¢ë¤¥«¥­¨ï',\
ru,'‘¨¬¢®«ë',\
ru,'—¨á« ',\
ru,'‘âப¨',\
ru,'Š®¬¬¥­â à¨¨',\
ru,'ˆ§¬¥­ñ­ë¥ áâப¨',\
ru,'‘®åà ­ñ­­ë¥ áâப¨',\
\
en,'Text',\
en,'Background',\
en,'Selection text',\
en,'Selection background',\
en,'Symbols',\
en,'Numbers',\
en,'Strings',\
en,'Comments',\
en,'Modified lines',\
en,'Saved lines',\
\
it,'Testo',\
it,'Sfondo',\
it,'Testo di selezione',\
it,'Sfondo di selezione',\
it,'Simboli',\
it,'Numeri',\
it,'Stringhe',\
it,'Commenti',\
it,'Linee modificate',\
it,'Linee salvate',\
\
et,'Tekst',\
et,'Taust',\
et,'Valitud tekst',\
et,'Valitud taust',\
et,'Sümbolid',\
et,'Numbrid',\
et,'Stringid',\
et,'Kommentaarid',\
et,'Muudetud read',\
et,'Salvestatud read',\
\
sp,'Texto',\
sp,'Fondo',\
sp,'Texto de selección',\
sp,'Fondo de selección',\
sp,'Símbolos',\
sp,'Números',\
sp,'Cadenas',\
sp,'Comentarios',\
sp,'Líneas modificadas',\
sp,'Líneas guardadas'
lsz sysfuncs_filename,\
ru,<'SYSFUNCR.TXT',0>,\
en,<'SYSFUNCS.TXT',0>,\
it,<'SYSFUNCS.TXT',0>,\
et,<'SYSFUNCET.TXT',0>,\
sp,<'SYSFUNCS.TXT',0>
sz s_example,'/sys/example.asm'
sz s_still ,'still'
sz htext,'TINYPAD ',APP_VERSION
; Language support for locales: ru_RU (CP866), en_US, it_IT, et_EE, es_ES.
menubar_res main_menu,\
ru_RU,'” ©«' ,mm.File ,onshow.file ,\
ru_RU,'<27>à ¢ª ' ,mm.Edit ,onshow.edit ,\
ru_RU,'<27>®¨áª' ,mm.Search ,onshow.search ,\
ru_RU,'‡ ¯ãáª' ,mm.Run ,onshow.run ,\
ru_RU,'Š®¤¨à®¢ª ',mm.Encoding,onshow.recode ,\
ru_RU,'Ž¯æ¨¨' ,mm.Options ,onshow.options,\
\
en_US,'File' ,mm.File ,onshow.file ,\
en_US,'Edit' ,mm.Edit ,onshow.edit ,\
en_US,'Search' ,mm.Search ,onshow.search ,\
en_US,'Run' ,mm.Run ,onshow.run ,\
en_US,'Encoding' ,mm.Encoding,onshow.recode ,\
en_US,'Options' ,mm.Options ,onshow.options,\
\
it_IT,'File' ,mm.File ,onshow.file ,\
it_IT,'Modificare' ,mm.Edit ,onshow.edit ,\
it_IT,'Ricerca' ,mm.Search ,onshow.search ,\
it_IT,'Correre' ,mm.Run ,onshow.run ,\
it_IT,'Codifica' ,mm.Encoding,onshow.recode ,\
it_IT,'Opzioni' ,mm.Options ,onshow.options,\
\
et_EE,'Fail' ,mm.File ,onshow.file ,\
et_EE,'Muuda' ,mm.Edit ,onshow.edit ,\
et_EE,'Otsi' ,mm.Search ,onshow.search ,\
et_EE,'Käivita' ,mm.Run ,onshow.run ,\
et_EE,'Kodeering',mm.Encoding,onshow.recode ,\
et_EE,'Seaded' ,mm.Options ,onshow.options,\
\
es_ES,'Archivo' ,mm.File ,onshow.file ,\
es_ES,'Editar' ,mm.Edit ,onshow.edit ,\
es_ES,'Buscar' ,mm.Search ,onshow.search ,\
es_ES,'Ejecutar' ,mm.Run ,onshow.run ,\
es_ES,'Codificación',mm.Encoding,onshow.recode,\
es_ES,'Opciones' ,mm.Options ,onshow.options
popup_res mm.File,\
ru_RU,'<27>®¢ë©' ,'Ctrl+N' ,New ,\
ru_RU,'Žâªàëâì...','Ctrl+O' ,Open ,\
ru_RU,'‘®åà ­¨âì' ,'Ctrl+S' ,Save ,\
ru_RU,'‘®åà ­¨âì ª ª...','Ctrl+Shift+S',SaveAs,\
ru_RU,'-','',,\
ru_RU,'‡ ªàëâì' ,'Ctrl+F4' ,Close ,\
ru_RU,'-','',,\
ru_RU,'‚ë室' ,'Alt+X' ,Exit ,\
\
en_US,'New' ,'Ctrl+N' ,New ,\
en_US,'Open...' ,'Ctrl+O' ,Open ,\
en_US,'Save' ,'Ctrl+S' ,Save ,\
en_US,'Save as...','Ctrl+Shift+S',SaveAs ,\
en_US,'-','',,\
en_US,'Close' ,'Ctrl+F4' ,Close ,\
en_US,'-','',,\
en_US,'Exit' ,'Alt+X' ,Exit ,\
\
it_IT,'Nuovo' ,'Ctrl+N' ,New ,\
it_IT,'Aperto...' ,'Ctrl+O' ,Open ,\
it_IT,'Salva' ,'Ctrl+S' ,Save ,\
it_IT,'Salva come...','Ctrl+Shift+S',SaveAs ,\
it_IT,'-','',,\
it_IT,'Chiudi' ,'Ctrl+F4' ,Close ,\
it_IT,'-','',,\
it_IT,'Uscita' ,'Alt+X' ,Exit ,\
\
et_EE,'Uus' ,'Ctrl+N' ,New ,\
et_EE,'Ava...' ,'Ctrl+O' ,Open ,\
et_EE,'Salvesta' ,'Ctrl+S' ,Save ,\
et_EE,'Salvesta nimega...','Ctrl+Shift+S',SaveAs,\
et_EE,'-','',,\
et_EE,'Sulge' ,'Ctrl+F4' ,Close ,\
et_EE,'-','',,\
et_EE,'Välju' ,'Alt+X' ,Exit ,\
\
es_ES,'Nuevo' ,'Ctrl+N' ,New ,\
es_ES,'Abrir...' ,'Ctrl+O' ,Open ,\
es_ES,'Guardar' ,'Ctrl+S' ,Save ,\
es_ES,'Guardar como...','Ctrl+Shift+S',SaveAs,\
es_ES,'-','',,\
es_ES,'Cerrar' ,'Ctrl+F4',Close,\
es_ES,'-','',,\
es_ES,'Salir' ,'Alt+X' ,Exit
popup_res mm.Edit,\
ru_RU,'‚ë१ âì' ,'Ctrl+X',Cut ,\
ru_RU,'Š®¯¨à®¢ âì' ,'Ctrl+C',Copy ,\
ru_RU,'‚áâ ¢¨âì' ,'Ctrl+V',Insert,\
ru_RU,'“¤ «¨âì' ,'' ,Delete,\
ru_RU,'-','',,\
ru_RU,'‚뤥«¨âì ¢áñ' ,'Ctrl+A',SelAll,\
\
en_US,'Cut' ,'Ctrl+X',Cut ,\
en_US,'Copy' ,'Ctrl+C',Copy ,\
en_US,'Paste' ,'Ctrl+V',Insert,\
en_US,'Delete' ,'' ,Delete,\
en_US,'-','',,\
en_US,'Select all','Ctrl+A',SelAll,\
\
it_IT,'Taglio' ,'Ctrl+X',Cut ,\
it_IT,'Copia' ,'Ctrl+C',Copy ,\
it_IT,'Incolla' ,'Ctrl+V',Insert,\
it_IT,'Elimina' ,'' ,Delete,\
it_IT,'-','',,\
it_IT,'Seleziona tutto','Ctrl+A',SelAll,\
\
et_EE,'Lõika' ,'Ctrl+X',Cut ,\
et_EE,'Kopeeri' ,'Ctrl+C',Copy ,\
et_EE,'Kleebi' ,'Ctrl+V',Insert,\
et_EE,'Kustuta' ,'' ,Delete,\
et_EE,'-','',,\
et_EE,'Vali kõik','Ctrl+A',SelAll,\
\
es_ES,'Cortar' ,'Ctrl+X',Cut ,\
es_ES,'Copiar' ,'Ctrl+C',Copy ,\
es_ES,'Pegar' ,'Ctrl+V',Insert,\
es_ES,'Eliminar' ,'' ,Delete,\
es_ES,'-','',,\
es_ES,'Seleccionar todo','Ctrl+A',SelAll
popup_res mm.Search,\
ru_RU,'<27>¥à¥©â¨...' ,'Ctrl+G',Position,\
ru_RU,'-','',,\
ru_RU,'<27> ©â¨...' ,'Ctrl+F',Find ,\
ru_RU,'<27> ©â¨ ¤ «¥¥','F3' ,FindNext,\
ru_RU,'‡ ¬¥­¨âì...','Ctrl+H',Replace ,\
\
en_US,'Position...','Ctrl+G',Position,\
en_US,'-','',,\
en_US,'Find...' ,'Ctrl+F',Find ,\
en_US,'Find next' ,'F3' ,FindNext,\
en_US,'Replace...' ,'Ctrl+H',Replace ,\
\
it_IT,'Posizione...','Ctrl+G',Position,\
it_IT,'-','',,\
it_IT,'Trova...' ,'Ctrl+F',Find ,\
it_IT,'Trova il prossimo' ,'F3' ,FindNext,\
it_IT,'Sostituire...' ,'Ctrl+H',Replace ,\
\
et_EE,'Positsioon...','Ctrl+G',Position,\
et_EE,'-','',,\
et_EE,'Leia...' ,'Ctrl+F',Find ,\
et_EE,'Leia järgmine','F3' ,FindNext,\
et_EE,'Asenda...' ,'Ctrl+H',Replace ,\
\
es_ES,'Posición...' ,'Ctrl+G',Position,\
es_ES,'-','',,\
es_ES,'Buscar...' ,'Ctrl+F',Find ,\
es_ES,'Buscar siguiente','F3' ,FindNext,\
es_ES,'Reemplazar...','Ctrl+H',Replace
popup_res mm.Run,\
ru_RU,'‡ ¯ãáâ¨âì' ,'F9' ,Run ,\
ru_RU,'‡ ¯ãáâ¨âì ¢ ¤¥¡ ££¥à¥','F10',Debug ,\
ru_RU,'Š®¬¯¨«¨à®¢ âì' ,'Ctrl+F9',Compile ,\
ru_RU,'-','',,\
ru_RU,'„®áª  ®â« ¤ª¨' ,'' ,DbgBoard,\
ru_RU,'‘¨á⥬­ë¥ ä㭪樨','' ,SysFuncs,\
\
en_US,'Run' ,'F9' ,Run ,\
en_US,'Run in debugger' ,'F10' ,Debug ,\
en_US,'Compile' ,'Ctrl+F9',Compile ,\
en_US,'-','',,\
en_US,'Debug board' ,'' ,DbgBoard,\
en_US,'System functions' ,'' ,SysFuncs,\
\
it_IT,'Correre' ,'F9' ,Run ,\
it_IT,'Esegui nel debugger','F10',Debug ,\
it_IT,'Compilare','Ctrl+F9',Compile ,\
it_IT,'-','',,\
it_IT,'Scheda di debug' ,'' ,DbgBoard,\
it_IT,'Funzioni di sistema','' ,SysFuncs,\
\
et_EE,'Käivita' ,'F9' ,Run ,\
et_EE,'Käivita aastal siluri','F10',Debug ,\
et_EE,'Kompileeri' ,'Ctrl+F9',Compile ,\
et_EE,'-','',,\
et_EE,'Silumis paneel' ,'' ,DbgBoard,\
et_EE,'Süsteemi funktsioonid','' ,SysFuncs,\
\
es_ES,'Ejecutar' ,'F9' ,Run ,\
es_ES,'Ejecutar en el depurador','F10',Debug,\
es_ES,'Compilar' ,'Ctrl+F9',Compile ,\
es_ES,'-','',,\
es_ES,'Depuración' ,'' ,DbgBoard,\
es_ES,'Funciones del sistema' ,'',SysFuncs
popup_res mm.Encoding,\
@!,<'CP866 ',0x1A,' CP1251'>,'',CP866.CP1251,\
@!,<'CP1251 ',0x1A,' CP866' >,'',CP1251.CP866,\
@!,<'-'>,'',,\
@!,<'CP866 ',0x1A,' KOI8-R'>,'',CP866.KOI8R ,\
@!,<'KOI8-R ',0x1A,' CP866' >,'',KOI8R.CP866 ,\
@!,<'-'>,'',,\
@!,<'CP1251 ',0x1A,' KOI8-R'>,'',CP1251.KOI8R,\
@!,<'KOI8-R ',0x1A,' CP1251'>,'',KOI8R.CP1251
popup_res mm.Options,\
ru_RU,'“¢¥«¨ç¨âì' ,'Ctrl +',ZoomIn ,\
ru_RU,'“¬¥­ìè¨âì' ,'Ctrl -',ZoomOut ,\
ru_RU,'-','',,\
ru_RU,'<27>®¬¥à  áâப' ,'',LineNumbers ,\
ru_RU,'<27>¥§®¯ á­®¥ ¢ë¤¥«¥­¨¥' ,'',SecureSel ,\
ru_RU,'€¢â®¬ â¨ç¥áª¨¥ ᪮¡ª¨' ,'',AutoBrackets,\
ru_RU,'€¢â®¬ â¨ç¥áª¨© ®âáâã¯' ,'',AutoIndents ,\
ru_RU,'Ž¯â¨¬ «ì­®¥ á®åà ­¥­¨¥' ,'',OptimalFill ,\
ru_RU,'-','',,\
ru_RU,'‚­¥è­¨© ¢¨¤...' ,'',Appearance ,\
\
en_US,'Zoom in' ,'Ctrl +',ZoomIn ,\
en_US,'Zoom out' ,'Ctrl -',ZoomOut ,\
en_US,'-','',,\
en_US,'Line numbers' ,'',LineNumbers ,\
en_US,'Secure selection' ,'',SecureSel ,\
en_US,'Automatic brackets' ,'',AutoBrackets,\
en_US,'Automatic indents' ,'',AutoIndents ,\
en_US,'Optimal fill on saving' ,'',OptimalFill ,\
en_US,'-','',,\
en_US,'Appearance...' ,'',Appearance ,\
\
it_IT,'Ingrandire' ,'Ctrl +',ZoomIn ,\
it_IT,'Rimpicciolisci' ,'Ctrl -',ZoomOut ,\
it_IT,'-','',,\
it_IT,'Numeri di riga' ,'',LineNumbers ,\
it_IT,'Selezione sicura' ,'',SecureSel ,\
it_IT,'Staffe automatiche' ,'',AutoBrackets,\
it_IT,'Rientri automatici' ,'',AutoIndents ,\
it_IT,'Combina spazi' ,'',OptimalFill ,\
it_IT,'-','',,\
it_IT,'Aspetto...' ,'',Appearance ,\
\
et_EE,'Zoom in' ,'Ctrl +',ZoomIn ,\
et_EE,'Zoom out' ,'Ctrl -',ZoomOut ,\
et_EE,'-','',,\
et_EE,'Rea numbrid' ,'',LineNumbers ,\
et_EE,'Turvaline valimine' ,'',SecureSel ,\
et_EE,'Automaatsed sulud' ,'',AutoBrackets,\
et_EE,'Automaatsed taandread' ,'',AutoIndents ,\
et_EE,'Optimaalne täitmine salvestamisel','',OptimalFill,\
et_EE,'-','',,\
et_EE,'Välimus...' ,'',Appearance ,\
\
es_ES,'Zoom in' ,'Ctrl +',ZoomIn ,\
es_ES,'Zoom out' ,'Ctrl -',ZoomOut ,\
es_ES,'-','',,\
es_ES,'Números en líneas' ,'',LineNumbers ,\
es_ES,'Selección segura' ,'',SecureSel ,\
es_ES,'Paréntesis automáticos' ,'',AutoBrackets,\
es_ES,'Identación automática' ,'',AutoIndents ,\
es_ES,'Llenado óptimo al guardar','',OptimalFill ,\
es_ES,'-','',,\
es_ES,'Apariencia...' ,'',Appearance
lsz s_defname,\
ru_RU,<'<27>¥§ë¬ï­­ë©',0>,\
en_US,<'Untitled',0>,\
it_IT,<'Senza titolo',0>,\
et_EE,<'Nimetu',0>,\
es_ES,<'Sin título',0>
lsz s_modified,\
ru_RU,'ˆ§¬¥­¥­®',\
en_US,'Modified',\
it_IT,'Modificato',\
et_EE,'Muudetud',\
es_ES,'Modificado'
lsz s_2filename,\
ru_RU,'ˆ¬ï ä ©« :',\
en_US,'Filename:',\
en_US,'Nome del file:',\
et_EE,'Faili nimi:',\
es_ES,'Nombre de archivo:'
lsz s_2open,\
ru_RU,'Žâªàëâì',\
en_US,'Open',\
it_IT,'Aperto',\
et_EE,'Ava',\
es_ES,'Abrir'
lsz s_2save,\
ru_RU,'‘®åà ­¨âì',\
en_US,'Save',\
it_IT,'Salva',\
et_EE,'Salvesta',\
es_ES,'Guardar'
lsz s_2save_no,\
ru_RU,'<27>¥â',\
en_US,'No',\
it_IT,'No',\
et_EE,'Ei',\
es_ES,'No'
lsz s_2find,\
ru_RU,'<27> ©â¨',\
en_US,'Find',\
it_IT,'Trova',\
et_EE,'Leia',\
es_ES,'Buscar'
db ':'
lsz s_2replace,\
ru_RU,'‡ ¬¥­¨âì',\
en_US,'Replace',\
it_IT,'Sostituire',\
et_EE,'Asenda',\
es_ES,'Reemplazar'
db ':'
lsz s_2cancel,\
ru_RU,'Žâ¬¥­ ',\
en_US,'Cancel',\
it_IT,'Annulla',\
et_EE,'Tühista',\
es_ES,'Cancelar'
lsz s_color,\
ru_RU,'–¢¥â: 0x',\
en_US,'Color: 0x',\
it_IT,'Colore: 0x',\
et_EE,'Värv: 0x',\
es_ES,'Color: 0x'
lsz s_tabpos,\
ru_RU,'<27> á¯®«®¦¥­¨¥ § ª« ¤®ª',\
en_US,'Tabs placement',\
it_IT,'Posizionamento delle schede',\
et_EE,'Saki asetus',\
es_ES,'Lugar de tabulador'
lsz s_enter_filename,\
ru_RU,<'‚¢¥¤¨â¥ ¨¬ï ä ©« ',0>,\
en_US,<'Enter filename',0>,\
it_IT,<'Inserisci il nome del file',0>,\
et_EE,<'Sisesta faili nimi',0>,\
es_ES,<'Ingresa el nombre del archivo',0>
lsz s_ask_save,\
ru_RU,<'†¥« ¥â¥ á®åà ­¨âì?',0>,\
en_US,<'Would you like to save?',0>,\
it_IT,<'Vorresti salvare?',0>,\
et_EE,<'Kas soovite salvestada?',0>,\
es_ES,<'¿Quieres guardar?',0>
lsz s_enter_text_to_find,\
ru_RU,<'‚¢¥¤¨â¥ ⥪áâ ¤«ï ¯®¨áª ',0>,\
en_US,<'Enter text to find',0>,\
it_IT,<'Inserisci il testo per trovare',0>,\
et_EE,<'Sisesta otsitav tekst',0>,\
es_ES,<'Ingresa el texto a buscar',0>
lsz s_enter_text_to_replace,\
ru_RU,<'‚¢¥¤¨â¥ ⥪áâ ¤«ï § ¬¥­ë',0>,\
en_US,<'Enter text to replace',0>,\
it_IT,<'Inserisci il testo da sostituire',0>,\
et_EE,<'Sisesta asendatav tekst',0>,\
es_ES,<'Ingresa el texto a reemplazar',0>
lsz s_text_not_found,\
ru_RU,<'„®á⨣­ãâ ª®­¥æ ä ©« , ⥪áâ ­¥ ­ ©¤¥­',0>,\
en_US,<'Reached end of file, text not found',0>,\
it_IT,<'Raggiunta la fine del file, testo non trovato',0>,\
et_EE,<'Faili lõpp, teksti ei leitud',0>,\
es_ES,<'Se llegó al final del archivo, texto no encontrado',0>
lszc s_fs_error,b,\
ru_RU,<'Ž¯¥à æ¨ï § ¢¥à襭  ãᯥ譮 (0)',0>,\
ru_RU,<'',0>,\
ru_RU,<'”ã­ªæ¨ï ­¥ ¯®¤¤¥à¦¨¢ ¥âáï ¤«ï ¤ ­­®© ä ©«®¢®© á¨á⥬ë (2)',0>,\
ru_RU,<'<27>¥¨§¢¥áâ­ ï ä ©«®¢ ï á¨á⥬  (3)',0>,\
ru_RU,<'',0>,\
ru_RU,<'<27>¥¢®§¬®¦­® ®âªàëâì ä ©« (5)',0>,\
ru_RU,<'Ž¯¥à æ¨ï § ¢¥à襭  ãᯥ譮 (6)',0>,\
ru_RU,<'€¤à¥á ­ å®¤¨âáï §  £à ­¨æ ¬¨ ¯ ¬ï⨠¯à®£à ¬¬ë (7)',0>,\
ru_RU,<'<27>  ¤¨áª¥ ­¥â ᢮¡®¤­®£® ¬¥áâ  (8)',0>,\
ru_RU,<'’ ¡«¨æ  FAT ã­¨ç⮦¥­  (9)',0>,\
ru_RU,<'„®áâ㯠§ ¯à¥éñ­ (10)',0>,\
ru_RU,<'Žè¨¡ª  ãáâனá⢠ (11)',0>,\
\
en_US,<'Operation executed successfully (0)',0>,\
en_US,<'',0>,\
en_US,<'Function is not supported for the given filesystem (2)',0>,\
en_US,<'Unknown filesystem (3)',0>,\
en_US,<'',0>,\
en_US,<'Unable to open file (5)',0>,\
en_US,<'Operation executed successfully (6)',0>,\
en_US,<'Pointer lies outside of application memory (7)',0>,\
en_US,<'Disk is full (8)',0>,\
en_US,<'FAT table is destroyed (9)',0>,\
en_US,<'Access denied (10)',0>,\
en_US,<'Device error (11)',0>,\
\
it_IT,<'Operazione eseguita correttamente (0)',0>,\
it_IT,<'',0>,\
it_IT,<'La funzione non e supportata per il file system specificato (2)', 0>, \
it_IT,<'Unknown filesystem (3)',0>,\
it_IT,<'',0>,\
it_IT,<'Impossibile aprire il file (5)',0>,\
it_IT,<'Operazione eseguita correttamente (6)',0>,\
it_IT,<'Il puntatore si trova al di fuori della memoria dell',96,'applicazione (7)', 0>, \
it_IT,<'Il disco e pieno (8)',0>,\
it_IT,<'La tabella FAT e distrutta (9)',0>,\
it_IT,<'Accesso negato (10)',0>,\
it_IT,<'Errore dispositivo (11)',0>,\
\
et_EE,<'Operatsioon käivitati edukalt (0)',0>,\
et_EE,<'',0>,\
et_EE,<'Failisüsteem ei toeta funktsiooni (2)',0>,\
et_EE,<'Tundmatu failisüsteem (3)',0>,\
et_EE,<'',0>,\
et_EE,<'Faili ei suudetud avada (5)',0>,\
et_EE,<'Operatsioon käivitatud edukalt (6)',0>,\
et_EE,<'Viit on väljaspool programmi mälu (7)',0>,\
et_EE,<'Ketas täis (8)',0>,\
et_EE,<'FAT tabel hävitatud (9)',0>,\
et_EE,<'Juurdepääs keelatud (10)',0>,\
et_EE,<'Seadme viga (11)',0>,\
\
es_ES,<'Operación ejecutada correctamente (0)',0>,\
es_ES,<'',0>,\
es_ES,<'La función no está soportada por el sistema de archivos dado (2)',0>,\
es_ES,<'Sistema de archivos desconocido (3)',0>,\
es_ES,<'',0>,\
es_ES,<'No es posible abrir el archivo (5)',0>,\
es_ES,<'Operación ejecutada correctamente (6)',0>,\
es_ES,<'El puntero está fuera de la memoria de la aplicación (7)',0>,\
es_ES,<'El disco está lleno (8)',0>,\
es_ES,<'La tabla FAT está destruida (9)',0>,\
es_ES,<'Acceso denegado (10)',0>,\
es_ES,<'Error de dispositivo (11)',0>
lszc s_appearance,b,\
ru_RU,'’¥ªáâ',\
ru_RU,'”®­',\
ru_RU,'’¥ªá⠢뤥«¥­¨ï',\
ru_RU,'”®­ ¢ë¤¥«¥­¨ï',\
ru_RU,'‘¨¬¢®«ë',\
ru_RU,'—¨á« ',\
ru_RU,'‘âப¨',\
ru_RU,'Š®¬¬¥­â à¨¨',\
ru_RU,'ˆ§¬¥­ñ­ë¥ áâப¨',\
ru_RU,'‘®åà ­ñ­­ë¥ áâப¨',\
\
en_US,'Text',\
en_US,'Background',\
en_US,'Selection text',\
en_US,'Selection background',\
en_US,'Symbols',\
en_US,'Numbers',\
en_US,'Strings',\
en_US,'Comments',\
en_US,'Modified lines',\
en_US,'Saved lines',\
\
it_IT,'Testo',\
it_IT,'Sfondo',\
it_IT,'Testo di selezione',\
it_IT,'Sfondo di selezione',\
it_IT,'Simboli',\
it_IT,'Numeri',\
it_IT,'Stringhe',\
it_IT,'Commenti',\
it_IT,'Linee modificate',\
it_IT,'Linee salvate',\
\
et_EE,'Tekst',\
et_EE,'Taust',\
et_EE,'Valitud tekst',\
et_EE,'Valitud taust',\
et_EE,'Sümbolid',\
et_EE,'Numbrid',\
et_EE,'Stringid',\
et_EE,'Kommentaarid',\
et_EE,'Muudetud read',\
et_EE,'Salvestatud read',\
\
es_ES,'Texto',\
es_ES,'Fondo',\
es_ES,'Texto de selección',\
es_ES,'Fondo de selección',\
es_ES,'Símbolos',\
es_ES,'Números',\
es_ES,'Cadenas',\
es_ES,'Comentarios',\
es_ES,'Líneas modificadas',\
es_ES,'Líneas guardadas'
lsz sysfuncs_filename,\
ru_RU,<'SYSFUNCR.TXT',0>,\
en_US,<'SYSFUNCS.TXT',0>,\
it_IT,<'SYSFUNCS.TXT',0>,\
et_EE,<'SYSFUNCET.TXT',0>,\
es_ES,<'SYSFUNCS.TXT',0>
sz s_example,'/sys/example.asm'
sz s_still ,'still'

View File

@ -8,7 +8,7 @@
; ;
; On base SYSTREE FILE COPIER 1.02 ;
; Ivan Poddubny ivan-yar@bk.ru ;
; ;
; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;„ ­­ ï ¯à®£  ¥é¥ áëà ï ¨ £«îç­ ï ­® 㦥 ª®¥ ª ª à ¡®â ¥â
@ -23,11 +23,11 @@
dd 0x10000 ; esp
dd param_area , 0x0 ; I_Param , I_Icon
include 'lang.inc'
include '..\..\..\macros.inc' ; very useful stuff for MeOS
include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US.
include '..\..\..\macros.inc' ; very useful stuff for MeOS
include 'ascl.inc'
START: ; start of execution
START: ; start of execution
; <20> à ¬¥âàë:
; db n1 = ¤«¨­  ¯ã⨠ª ¨áâ®ç­¨ªã
@ -187,7 +187,7 @@ draw_window:
mov edi,labelt ; WINDOW LABEL
mcall
mov eax,8
mov ebx,105*65536+290
mov ecx,33*65536+12
@ -264,12 +264,13 @@ errors:
db "(§ ¯¨áì) ­¥¨§¢¥áâ­ ï ®è¨¡ª  "
db "<22>ãâì ª ¨áâ®ç­¨ªã ¨ ¯à¨¥¬­¨ªã ­¥ 㪠§ ­ë!!! "
db "<22>ãâì ª ¯à¨¥¬­¨ªã ­¥ 㪠§ ­!!! "
else
else ; Default to en_US
text:
db 'SOURCE: | '
db 'DESTINATION: | '
db ' '
db 'x' ; <- END MARKER, DONT DELETE
db 'x' ; <- END MARKER, DO NOT DELETE
labelt:
db 'SYSTREE FILE COPIER'
labellen:
@ -292,6 +293,7 @@ errors:
db "(write) unknown error "
db "Path to source is not given!!! "
db "Path to destination is not given!!! "
end if
;0123456789012345678901234567890123456789012

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,490 +1,490 @@
;
; The famous game 15
; Author: Lloyd, coded by Ivushkin Andrey
; Compile with FASM
;
include 'lang.inc'
include '..\..\..\macros.inc' ; decreases program size (not required)
StatusColor equ 0x00ffffff
StatusColor2 equ 0x00dc1e14
BgdColor equ 0x14aabbcc
; Main window dimensions
XXwindow equ 200 shl 16+276
YYwindow equ 200 shl 16+300
; Status bar
XYstatus equ 35 shl 16+283
XXbar equ 35 shl 16+136
YYbar equ 280 shl 16+15
; Buttons
BtnTop equ 28
BtnLeft equ 13
BtnSize equ 60
BtnColor equ 0xafbb55
BtnColor2 equ 0x0228c314
NumColor equ 0x10000000
; Number shifting for nice look
NumShift equ 23 shl 16+23
NumShift2 equ 4 shl 16
; Shuffle button
XXSh equ 202 shl 16+60
YYSh equ 280 shl 16+12
XYShText equ 212 shl 16+283
; Conf button
XXCnf equ 13 shl 16+13
YYCnf equ 280 shl 16+12
XYCnfText equ 18 shl 16+283
; Position of the 'hole'
null equ (curconf+16)
; Amount of moves to perform shuffle
SH_CYCLES equ 400
; (Amount of tasks)-1
CONF_COUNT equ 2
use32
org 0x0
db 'MENUET01'
dd 0x01
dd START
dd I_END
dd 0x2000 ; 8 Kb
dd 0x2000
dd 0x0
dd 0x0
START:
mov [cptr],CONF_COUNT ; number of task
mov eax,3
mcall
mov cl,16
ror eax,cl
mov [generator],eax ; random generator from Tetris
init:
mov ecx,17
movzx eax,[cptr]
inc eax
cmp eax,CONF_COUNT
jna init_ok
xor eax,eax ; cycling 0..CONF_COUNT
init_ok:
mov [cptr],al
mov esi,eax
shl esi,4
add esi,conf
add esi,eax
add al,0x31
mov [txtTitle+17],al ;task number to program title
mov [task],esi
mov edi,curconf
rep movsb ; initial configuration
mov [sts],4
jmp red
SHUF:
call shuffle ; immediate shuffle
red: ; window redraw
call draw_window
still: ; MAIN PROGRAM CYCLE
mov eax,10 ; wait for event
mcall
cmp eax,1 ; redraw? -
je red ; goto red
cmp eax,2 ; key pressed? -
je key ; goto key
cmp eax,3 ; button pressed? -
je button ; goto button
jmp still ; no more events to process
key: ; Key pressed
mov eax,2
mcall
shr eax,8
cmp eax,32 ; <Space> = Shuffle
je SHUF
cmp eax,13 ; <Enter> = Choose task
je init
cmp eax,176
jl still
sub eax,176
cmp eax,3
ja still
movzx eax,byte [eax+correct] ; 'delta' value from correct[]
jmp m_check
button: ; Button pressed
mov eax,17
mcall
shr eax,8
sub eax,2
cmp eax,-1 ; id == 1 (closeme)?
jne noclose
mcall
noclose:
jl SHUF ; Shuffle (id=0) pressed
cmp eax,18
je init ; Conf button pressed
sub al,byte [null]
mov edi,correct
mov ecx,4
repne scasb ; checking for valid move-part 1
jne fail
m_check:
cmp byte[sts],4 ; puzzle completed, blocking buttons
ja still
call move_check ; checking for valid move-part 2
jnc fail
inc [move_count]
call draw_moves
fail:
jmp still ; ¢®§¢à é ¥¬áï
; *******************************
; ******* WINDOW DRAWING *******
; *******************************
draw_window:
mcall 12, 1 ; begin draw
mcall 0, XXwindow, YYwindow, BgdColor,, txtTitle ; CREATING WINDOW
mov eax,8 ; SHUFFLE BUTTON
mov ebx,XXSh
mov ecx,YYSh
xor edx,edx
mov esi,BtnColor
mcall
mov ebx,XXCnf ; CONF BUTTON
mov ecx,YYCnf
mov edx,20
;mov esi,BtnColor
mcall
mov ebx, XYShText ; SHUFFLE TEXT
mov ecx, StatusColor
mov edx,txtSh
mov esi,lenSh-txtSh
mov eax,4
mcall
mov ebx, XYCnfText ; CONF TEXT
mov edx,lenVictory-1
mov esi,1
mcall
mov ecx, 16 ; FIELD BUTTONS
dbut:
call draw_button
loop dbut
call draw_moves
mcall 12, 2 ; end of drawing
ret
; *********************************************
; ******* DRAWING A FIELD BUTTON **************
; *********************************************
; ECX - button number
draw_button:
pusha
dec ecx
; calculating button dimensions
mov edi, ecx
lea edx,[ecx+2]
mov ebx,ecx
and ebx,11b
shr ecx,2
imul ebx,BtnSize+3
add ebx,BtnLeft
shl ebx,16
add ebx,BtnSize
imul ecx,BtnSize+3
add ecx,BtnTop
shl ecx,16
add ecx,BtnSize
movzx eax,byte [null]
cmp eax,edi
jne no_hole
pusha
inc ebx
inc ecx
mov edx,BgdColor
mov eax,13 ; clearing - 'hole'
mcall
popa
or edx,0x80000000 ; and removing button under it
no_hole:
mov al,byte[edi+curconf]
mov esi,[task]
cmp al,byte[edi+esi]
je highlight
mov esi,BtnColor
jmp s_rbutton
highlight:
mov esi,BtnColor2
s_rbutton:
mov eax,8 ; set/remove button
mcall
movzx eax,byte [null]
cmp eax,edi
je no_text ; no digits - that's hole
mov edx,ebx
shr ecx,16
mov dx,cx
add edx,NumShift
mov ebx,0x20000
movzx ecx,byte [edi+curconf]
cmp ecx,9
ja two_num
add edx,NumShift2 ; shift to center digits
sub ebx,0x10000
two_num:
mov esi,NumColor
mov eax,47
mcall
no_text:
popa
ret
; *********************************************
; ******* DRAWING STATUS LINE *****************
; *********************************************
draw_moves:
mov eax, 13 ; clear area
mov ebx, XXbar
mov ecx, YYbar
mov edx, BgdColor
mcall
mov eax, 4
mov ebx, XYstatus
mov ecx, StatusColor
cmp ax, [sts]
jl report_victory
jne report_moves
mov edx,txtCnf ; prompt to choose configuration
mov esi,lenCnf-txtCnf
jmp e_dm
report_moves:
mov edx,txtMoves ; how many moves done
mov esi,lenMoves-txtMoves
mov eax,4
mcall
mov esi,ecx
mov edx,ebx
add edx, 40 shl 16
mov ebx,0x030000
movzx ecx, byte[move_count]
mov eax,47
jmp e_dm
report_victory: ; puzzle completed
mov ecx,StatusColor2
mov edx,txtVictory
mov esi,lenVictory-txtVictory
e_dm:
mcall
ret
; *********************************************
; ********* SHUFFLE ***************************
; *********************************************
shuffle:
xor eax,eax
mov [sts],ax
mov [move_count],ax ; reset moves to 0
mov [sh_off],al
mov eax, [generator]
mov ecx,SH_CYCLES
sh_cycle:
sub eax,0x43ab45b5 ; next random number
ror eax,1
xor eax,0x32c4324f
ror eax,1
mov [generator],eax
push eax
and eax,11b ; direction 0..3
movzx eax,byte [eax+correct]
call move_check
pop eax
jnc sh_cycle ; if fails then retry
loop sh_cycle
inc byte[sh_off] ; shuffling complete
ret
; *********************************************
; ********* MOVE VALIDITY CHECK ***************
; *********************************************
; AL - 'DELTA' DIRECTION
move_check:
pusha
mov ah,byte [null]
mov bx,ax
cmp bh,3
ja no_top
cmp al,-4 ; top of field
je no_move
no_top:
cmp bh,12
jb no_bottom
cmp al,4 ; bottom of field
je no_move
no_bottom:
and bh,11b
cmp bh,0
jnz no_left
cmp al,-1 ; left of field
je no_move
no_left:
cmp bh,11b
jnz ok
cmp al,1 ; right of field
je no_move
ok:
mov bx,ax
add bh,bl ; bh-new hole
mov byte [null],bh
movzx ecx,ah
mov al,byte[ecx+curconf]
movzx edx,bh
mov bl,byte[edx+curconf] ; swapping button & hole
mov byte[ecx+curconf],bl
mov byte[edx+curconf],al
cmp byte[sh_off],0 ; if shuffle in progress,
jz no_win ; then no redraw
; drawing button & hole
inc ecx
call draw_button
movzx ecx,bh
inc ecx
call draw_button
; testing if task completed
mov esi,[task]
mov edi,curconf
mov ecx,16
repe cmpsb
cmp ecx,0
jne no_win
mov word[sts],6 ; puzzle done. Victory!
no_win:
popa
stc
ret
no_move:
popa
clc
ret
; this is deprecated debug routine
;ud:
; ud2
; These are data used by program
correct db 1,-4,4,-1
conf db 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0,15
db 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0
db 1,2,3,4,12,13,14,5,11,0,15,6,10,9,8,7,9
txtMoves:
if lang eq ru_RU
db '•®¤®¢:'
else if lang eq it_IT
db 'Movimenti:'
else if lang eq de_DE
db 'Bewegungen:'
else
db 'Moves:'
end if
lenMoves:
txtSh:
if lang eq ru_RU
db '’ á®¢ª '
else if lang eq it_IT
db 'Mischia'
else if lang eq de_DE
db 'Mischen'
else
db 'Shuffle'
end if
lenSh:
txtCnf:
if lang eq ru_RU
db '‚ë¡¥à¨â¥ § ¤ çã ¨ ­ ¦¬¨â¥->'
else if lang eq it_IT
db 'Seleziona un compito, poi premi->'
else if lang eq de_DE
db 'Waehle eine Aufgabe, dann clicke au->'
else
db 'Select task, then press ->'
end if
lenCnf:
txtTitle: ; áâப  § £®«®¢ª 
if lang eq ru_RU
db 'ˆ£à  15 - § ¤ ç  X', 0
else if lang eq it_IT
db 'Gioco del quindici - partita X', 0
else if lang eq de_DE
db '15-Puzzle - Spiel X', 0
else
db 'Game 15 - puzzle X', 0
end if
txtVictory:
if lang eq ru_RU
db '‚ë à¥è¨«¨ § ¤ çã! <20> ¦¬¨â¥->'
else if lang eq it_IT
db 'Gioco completato! Premi ->'
else if lang eq de_DE
db 'Spiel beendet! Druecken sie auf ->'
else
db 'Puzzle completed! Press->'
end if
lenVictory:
arrow equ lenVictory-2
I_END: ; ª®­¥æ ¯à®£à ¬¬ë
;null db ?
move_count dw ?
cptr db ?
sts dw ?
sh_off db ?
task dd ?
generator dd ?
curconf:
;
; The famous game 15
; Author: Lloyd, coded by Ivushkin Andrey
; Compile with FASM
;
include 'lang.inc' ; Language support for locales: ru_RU (CP866), it_IT, de_DE, en_US.
include '..\..\..\macros.inc' ; decreases program size (not required)
StatusColor equ 0x00ffffff
StatusColor2 equ 0x00dc1e14
BgdColor equ 0x14aabbcc
; Main window dimensions
XXwindow equ 200 shl 16+276
YYwindow equ 200 shl 16+300
; Status bar
XYstatus equ 35 shl 16+283
XXbar equ 35 shl 16+136
YYbar equ 280 shl 16+15
; Buttons
BtnTop equ 28
BtnLeft equ 13
BtnSize equ 60
BtnColor equ 0xafbb55
BtnColor2 equ 0x0228c314
NumColor equ 0x10000000
; Number shifting for nice look
NumShift equ 23 shl 16+23
NumShift2 equ 4 shl 16
; Shuffle button
XXSh equ 202 shl 16+60
YYSh equ 280 shl 16+12
XYShText equ 212 shl 16+283
; Conf button
XXCnf equ 13 shl 16+13
YYCnf equ 280 shl 16+12
XYCnfText equ 18 shl 16+283
; Position of the 'hole'
null equ (curconf+16)
; Amount of moves to perform shuffle
SH_CYCLES equ 400
; (Amount of tasks)-1
CONF_COUNT equ 2
use32
org 0x0
db 'MENUET01'
dd 0x01
dd START
dd I_END
dd 0x2000 ; 8 Kb
dd 0x2000
dd 0x0
dd 0x0
START:
mov [cptr],CONF_COUNT ; number of task
mov eax,3
mcall
mov cl,16
ror eax,cl
mov [generator],eax ; random generator from Tetris
init:
mov ecx,17
movzx eax,[cptr]
inc eax
cmp eax,CONF_COUNT
jna init_ok
xor eax,eax ; cycling 0..CONF_COUNT
init_ok:
mov [cptr],al
mov esi,eax
shl esi,4
add esi,conf
add esi,eax
add al,0x31
mov [txtTitle+17],al ;task number to program title
mov [task],esi
mov edi,curconf
rep movsb ; initial configuration
mov [sts],4
jmp red
SHUF:
call shuffle ; immediate shuffle
red: ; window redraw
call draw_window
still: ; MAIN PROGRAM CYCLE
mov eax,10 ; wait for event
mcall
cmp eax,1 ; redraw? -
je red ; goto red
cmp eax,2 ; key pressed? -
je key ; goto key
cmp eax,3 ; button pressed? -
je button ; goto button
jmp still ; no more events to process
key: ; Key pressed
mov eax,2
mcall
shr eax,8
cmp eax,32 ; <Space> = Shuffle
je SHUF
cmp eax,13 ; <Enter> = Choose task
je init
cmp eax,176
jl still
sub eax,176
cmp eax,3
ja still
movzx eax,byte [eax+correct] ; 'delta' value from correct[]
jmp m_check
button: ; Button pressed
mov eax,17
mcall
shr eax,8
sub eax,2
cmp eax,-1 ; id == 1 (closeme)?
jne noclose
mcall
noclose:
jl SHUF ; Shuffle (id=0) pressed
cmp eax,18
je init ; Conf button pressed
sub al,byte [null]
mov edi,correct
mov ecx,4
repne scasb ; checking for valid move-part 1
jne fail
m_check:
cmp byte[sts],4 ; puzzle completed, blocking buttons
ja still
call move_check ; checking for valid move-part 2
jnc fail
inc [move_count]
call draw_moves
fail:
jmp still ; ¢®§¢à é ¥¬áï
; *******************************
; ******* WINDOW DRAWING *******
; *******************************
draw_window:
mcall 12, 1 ; begin draw
mcall 0, XXwindow, YYwindow, BgdColor,, txtTitle ; CREATING WINDOW
mov eax,8 ; SHUFFLE BUTTON
mov ebx,XXSh
mov ecx,YYSh
xor edx,edx
mov esi,BtnColor
mcall
mov ebx,XXCnf ; CONF BUTTON
mov ecx,YYCnf
mov edx,20
;mov esi,BtnColor
mcall
mov ebx, XYShText ; SHUFFLE TEXT
mov ecx, StatusColor
mov edx,txtSh
mov esi,lenSh-txtSh
mov eax,4
mcall
mov ebx, XYCnfText ; CONF TEXT
mov edx,lenVictory-1
mov esi,1
mcall
mov ecx, 16 ; FIELD BUTTONS
dbut:
call draw_button
loop dbut
call draw_moves
mcall 12, 2 ; end of drawing
ret
; *********************************************
; ******* DRAWING A FIELD BUTTON **************
; *********************************************
; ECX - button number
draw_button:
pusha
dec ecx
; calculating button dimensions
mov edi, ecx
lea edx,[ecx+2]
mov ebx,ecx
and ebx,11b
shr ecx,2
imul ebx,BtnSize+3
add ebx,BtnLeft
shl ebx,16
add ebx,BtnSize
imul ecx,BtnSize+3
add ecx,BtnTop
shl ecx,16
add ecx,BtnSize
movzx eax,byte [null]
cmp eax,edi
jne no_hole
pusha
inc ebx
inc ecx
mov edx,BgdColor
mov eax,13 ; clearing - 'hole'
mcall
popa
or edx,0x80000000 ; and removing button under it
no_hole:
mov al,byte[edi+curconf]
mov esi,[task]
cmp al,byte[edi+esi]
je highlight
mov esi,BtnColor
jmp s_rbutton
highlight:
mov esi,BtnColor2
s_rbutton:
mov eax,8 ; set/remove button
mcall
movzx eax,byte [null]
cmp eax,edi
je no_text ; no digits - that's hole
mov edx,ebx
shr ecx,16
mov dx,cx
add edx,NumShift
mov ebx,0x20000
movzx ecx,byte [edi+curconf]
cmp ecx,9
ja two_num
add edx,NumShift2 ; shift to center digits
sub ebx,0x10000
two_num:
mov esi,NumColor
mov eax,47
mcall
no_text:
popa
ret
; *********************************************
; ******* DRAWING STATUS LINE *****************
; *********************************************
draw_moves:
mov eax, 13 ; clear area
mov ebx, XXbar
mov ecx, YYbar
mov edx, BgdColor
mcall
mov eax, 4
mov ebx, XYstatus
mov ecx, StatusColor
cmp ax, [sts]
jl report_victory
jne report_moves
mov edx,txtCnf ; prompt to choose configuration
mov esi,lenCnf-txtCnf
jmp e_dm
report_moves:
mov edx,txtMoves ; how many moves done
mov esi,lenMoves-txtMoves
mov eax,4
mcall
mov esi,ecx
mov edx,ebx
add edx, 40 shl 16
mov ebx,0x030000
movzx ecx, byte[move_count]
mov eax,47
jmp e_dm
report_victory: ; puzzle completed
mov ecx,StatusColor2
mov edx,txtVictory
mov esi,lenVictory-txtVictory
e_dm:
mcall
ret
; *********************************************
; ********* SHUFFLE ***************************
; *********************************************
shuffle:
xor eax,eax
mov [sts],ax
mov [move_count],ax ; reset moves to 0
mov [sh_off],al
mov eax, [generator]
mov ecx,SH_CYCLES
sh_cycle:
sub eax,0x43ab45b5 ; next random number
ror eax,1
xor eax,0x32c4324f
ror eax,1
mov [generator],eax
push eax
and eax,11b ; direction 0..3
movzx eax,byte [eax+correct]
call move_check
pop eax
jnc sh_cycle ; if fails then retry
loop sh_cycle
inc byte[sh_off] ; shuffling complete
ret
; *********************************************
; ********* MOVE VALIDITY CHECK ***************
; *********************************************
; AL - 'DELTA' DIRECTION
move_check:
pusha
mov ah,byte [null]
mov bx,ax
cmp bh,3
ja no_top
cmp al,-4 ; top of field
je no_move
no_top:
cmp bh,12
jb no_bottom
cmp al,4 ; bottom of field
je no_move
no_bottom:
and bh,11b
cmp bh,0
jnz no_left
cmp al,-1 ; left of field
je no_move
no_left:
cmp bh,11b
jnz ok
cmp al,1 ; right of field
je no_move
ok:
mov bx,ax
add bh,bl ; bh-new hole
mov byte [null],bh
movzx ecx,ah
mov al,byte[ecx+curconf]
movzx edx,bh
mov bl,byte[edx+curconf] ; swapping button & hole
mov byte[ecx+curconf],bl
mov byte[edx+curconf],al
cmp byte[sh_off],0 ; if shuffle in progress,
jz no_win ; then no redraw
; drawing button & hole
inc ecx
call draw_button
movzx ecx,bh
inc ecx
call draw_button
; testing if task completed
mov esi,[task]
mov edi,curconf
mov ecx,16
repe cmpsb
cmp ecx,0
jne no_win
mov word[sts],6 ; puzzle done. Victory!
no_win:
popa
stc
ret
no_move:
popa
clc
ret
; this is deprecated debug routine
;ud:
; ud2
; These are data used by program
correct db 1,-4,4,-1
conf db 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0,15
db 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0
db 1,2,3,4,12,13,14,5,11,0,15,6,10,9,8,7,9
txtMoves:
if lang eq ru_RU
db '•®¤®¢:'
else if lang eq it_IT
db 'Movimenti:'
else if lang eq de_DE
db 'Bewegungen:'
else ; Default to en_US
db 'Moves:'
end if
lenMoves:
txtSh:
if lang eq ru_RU
db '’ á®¢ª '
else if lang eq it_IT
db 'Mischia'
else if lang eq de_DE
db 'Mischen'
else ; Default to en_US
db 'Shuffle'
end if
lenSh:
txtCnf:
if lang eq ru_RU
db '‚ë¡¥à¨â¥ § ¤ çã ¨ ­ ¦¬¨â¥->'
else if lang eq it_IT
db 'Seleziona un compito, poi premi->'
else if lang eq de_DE
db 'Waehle eine Aufgabe, dann clicke au->'
else ; Default to en_US
db 'Select task, then press ->'
end if
lenCnf:
txtTitle: ; áâப  § £®«®¢ª 
if lang eq ru_RU
db 'ˆ£à  15 - § ¤ ç  X', 0
else if lang eq it_IT
db 'Gioco del quindici - partita X', 0
else if lang eq de_DE
db '15-Puzzle - Spiel X', 0
else ; Default to en_US
db 'Game 15 - puzzle X', 0
end if
txtVictory:
if lang eq ru_RU
db '‚ë à¥è¨«¨ § ¤ çã! <20> ¦¬¨â¥->'
else if lang eq it_IT
db 'Gioco completato! Premi ->'
else if lang eq de_DE
db 'Spiel beendet! Druecken sie auf ->'
else ; Default to en_US
db 'Puzzle completed! Press->'
end if
lenVictory:
arrow equ lenVictory-2
I_END: ; ª®­¥æ ¯à®£à ¬¬ë
;null db ?
move_count dw ?
cptr db ?
sts dw ?
sh_off db ?
task dd ?
generator dd ?
curconf:

View File

@ -1,93 +1,97 @@
include 'lang.inc'
struc langstr [lng, data]
{
if lang eq lng
sz ., data
end if
}
struc langstr0 [lng, data]
{
if lang eq lng
sz0 ., data
end if
}
include 'AKODE/data.inc'
include 'Resources/Textures/textures.inc'
include 'Resources/Levels/levels.inc'
FULLSCREEN = 0
FSAA = 0
DISABLE_SHADING = 0
MOVEMENT_SPEED = BLOCK_BASE_SIZE + BLOCK_BASE_SIZE / 4
FIELD_OF_VIEW = 60
BLOCK_BASE_SIZE = 512
BLOCK_HEIGHT = 512
INVENTORY_SIZE = 10
HUD_PANEL_HEIGHT = 120
INVENTORY_X = 570
INVENTORY_Y = 15
INVENTORY_PADDING_X = 10
INVENTORY_PADDING_Y = 10
OBJECT_IMAGE_WIDTH = 40
OBJECT_IMAGE_HEIGHT = 40
GAME_MESSAGE_X = 150 + 15
GAME_MESSAGE_Y = 15 + 15
GAME_MESSAGE_COLOR = 0E4E2ADh
if FULLSCREEN
;MAIN_WINDOW_X = 0
;MAIN_WINDOW_Y = 0
;MAIN_WINDOW_WIDTH = 0FFFFh
;MAIN_WINDOW_HEIGHT = 0FFFFh
MAIN_WINDOW_STYLE = (01000001b) shl 24
MAIN_WINDOW_STYLE2 = 1 shl 24
else
MAIN_WINDOW_X = 20
MAIN_WINDOW_Y = 20
MAIN_WINDOW_WIDTH = 960 ; client area width
MAIN_WINDOW_HEIGHT = 712 ; client area height
MAIN_WINDOW_STYLE = (01110100b) shl 24
MAIN_WINDOW_STYLE2 = 0
end if
MAIN_EVENT_MASK = EVM_REDRAW or EVM_KEY or EVM_BUTTON or EVM_MOUSE or EVM_MOUSE_FILTER
MAIN_WINDOW_TITLE langstr0 \
en_US, 'Dungeons of Augastes 0.1', \
ru_RU, '<27>®¤§¥¬¥«ìï €ã£ áâ¥á  0.1'
LevelLoadingImageFile db 'Resources/Textures/HUD/LevelLoading.png', 0
HudPanelImageFile db 'Resources/Textures/HUD/Panel.png', 0
DeathImageFile db 'Resources/Textures/HUD/Death.png', 0
EndImageFile db 'Resources/Textures/HUD/End.png', 0
align 4
LevelLoadingImagePtr dd 0
HudPanelImagePtr dd 0
DeathImagePtr dd 0
EndImagePtr dd 0
ImageBufferPtr dd 0
HudPanelNeedsRedraw dd 0
GameMessage dd 0
GameStatus dd 0
GAME_STATUS.LEVEL_LOAD_FAILED = 1
GAME_STATUS.DEAD = 2
GAME_STATUS.END = 3
ACTION.DO_SOMETHING = AKODE_ACTION.CUSTOM + 1
ACTION.LOOK_AROUND = AKODE_ACTION.CUSTOM + 2
ACTION.USE_OBJECT = AKODE_ACTION.CUSTOM + 3
ACTION.LOOK_AT_OBJECT = AKODE_ACTION.CUSTOM + 4
include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US.
; FIXME:
; This translation mechanism should fallback to en_US if the language
; is unlisted (e.g. es_ES). Either fix the macros or use a different method.
; The problem doesn't manifest, as we only bundle Dungeons in the RU distro.
struc langstr [lng, data]
{
if lang eq lng
sz ., data
end if
}
struc langstr0 [lng, data]
{
if lang eq lng
sz0 ., data
end if
}
include 'AKODE/data.inc'
include 'Resources/Textures/textures.inc'
include 'Resources/Levels/levels.inc'
FULLSCREEN = 0
FSAA = 0
DISABLE_SHADING = 0
MOVEMENT_SPEED = BLOCK_BASE_SIZE + BLOCK_BASE_SIZE / 4
FIELD_OF_VIEW = 60
BLOCK_BASE_SIZE = 512
BLOCK_HEIGHT = 512
INVENTORY_SIZE = 10
HUD_PANEL_HEIGHT = 120
INVENTORY_X = 570
INVENTORY_Y = 15
INVENTORY_PADDING_X = 10
INVENTORY_PADDING_Y = 10
OBJECT_IMAGE_WIDTH = 40
OBJECT_IMAGE_HEIGHT = 40
GAME_MESSAGE_X = 150 + 15
GAME_MESSAGE_Y = 15 + 15
GAME_MESSAGE_COLOR = 0E4E2ADh
if FULLSCREEN
;MAIN_WINDOW_X = 0
;MAIN_WINDOW_Y = 0
;MAIN_WINDOW_WIDTH = 0FFFFh
;MAIN_WINDOW_HEIGHT = 0FFFFh
MAIN_WINDOW_STYLE = (01000001b) shl 24
MAIN_WINDOW_STYLE2 = 1 shl 24
else
MAIN_WINDOW_X = 20
MAIN_WINDOW_Y = 20
MAIN_WINDOW_WIDTH = 960 ; client area width
MAIN_WINDOW_HEIGHT = 712 ; client area height
MAIN_WINDOW_STYLE = (01110100b) shl 24
MAIN_WINDOW_STYLE2 = 0
end if
MAIN_EVENT_MASK = EVM_REDRAW or EVM_KEY or EVM_BUTTON or EVM_MOUSE or EVM_MOUSE_FILTER
MAIN_WINDOW_TITLE langstr0 \
en_US, 'Dungeons of Augastes 0.1', \
ru_RU, '<27>®¤§¥¬¥«ìï €ã£ áâ¥á  0.1'
LevelLoadingImageFile db 'Resources/Textures/HUD/LevelLoading.png', 0
HudPanelImageFile db 'Resources/Textures/HUD/Panel.png', 0
DeathImageFile db 'Resources/Textures/HUD/Death.png', 0
EndImageFile db 'Resources/Textures/HUD/End.png', 0
align 4
LevelLoadingImagePtr dd 0
HudPanelImagePtr dd 0
DeathImagePtr dd 0
EndImagePtr dd 0
ImageBufferPtr dd 0
HudPanelNeedsRedraw dd 0
GameMessage dd 0
GameStatus dd 0
GAME_STATUS.LEVEL_LOAD_FAILED = 1
GAME_STATUS.DEAD = 2
GAME_STATUS.END = 3
ACTION.DO_SOMETHING = AKODE_ACTION.CUSTOM + 1
ACTION.LOOK_AROUND = AKODE_ACTION.CUSTOM + 2
ACTION.USE_OBJECT = AKODE_ACTION.CUSTOM + 3
ACTION.LOOK_AT_OBJECT = AKODE_ACTION.CUSTOM + 4

View File

@ -4,7 +4,7 @@
; contact: 4nic8@casiocalc.org
;----------------------------------------
include 'lang.inc'
include 'lang.inc' ; Language support for locales: it_IT, en_US.
include '../../../macros.inc'
include 'ascl.inc'
include 'ascgl.inc'
@ -142,7 +142,7 @@ still:
; *********************************************
show_screen: ; flips the virtual screen to the window
push_abc
push_abc
mcall 7, screen, <X_SIZE, Y_SIZE>, 0
pop_abc
ret
@ -389,7 +389,7 @@ grad_fill_screen: ; eax - screen color ( 0x00RRGGBB ), ebx - mack
.no_ch:
pop ecx
loop .lab1
pop_abc
ret
@ -409,7 +409,7 @@ intro: ; INTRO ;
jne @f
ret
@@:
mcall 4,<115,150>,0x82050505,VERSION
mcall ,<125,180>,0x80050505,AUTHOR
mcall ,<90,210>,0x81EE0800,PRESS_SPACE
@ -468,13 +468,13 @@ fast_gfx:
mov ebx,0xFFFF
.g_ok:
call grad_fill_screen
;black_bg
;mov eax,0
;mov ebx,0
;call fill_screen
mov eax,37 ; get mouse position
mov ebx,1
mcall
@ -805,7 +805,7 @@ draw_window:
mcall 48,4
lea ecx, [100*65536+Y_SIZE+4+eax]; [y start] *65536 + [y size] + [skin_height]
mcall 0,<100,X_SIZE+9>,,0x74ffffff,,0
mov eax, [lives]
add eax, '0'
mov esi, HEADER
@ -836,7 +836,7 @@ if lang eq it_IT
THANKS_FOR_PLAYING db 'Grazie per aver giocato', 0
PRESS_SPACE db 'Premi spazio per iniziare',0
LEVEL db 'LIVELLO',0
else
else ; Default to en_US
THANKS_FOR_PLAYING db 'Thanks for playing', 0
PRESS_SPACE db 'press SPACE to start',0
LEVEL db 'LEVEL',0

View File

@ -19,7 +19,7 @@
;******************************************************************************
include 'lang.inc'
include 'lang.inc' ; Language support for locales: it_IT, en_US.
include '..\..\..\macros.inc'
include 'ascl.inc'
include 'ascgl.inc'
@ -285,7 +285,7 @@ end_col:
cmp [delay_cnt],0
jne no_delay
mov [delay_cnt],1
delay 1 ;don't generate delay for fast speed programm
delay 1 ; don't generate delay for fast speed program
no_delay:
dec [delay_cnt]
@ -297,9 +297,9 @@ win_test:
mov [againbut],1
call draw_window
; label 160,200,'You Win!',cl_Green+font_Big
; label 130,220,'Youre Score:',cl_Green+font_Big
; label 130,220,'Your Score:',cl_Green+font_Big
; outcount dword [scorea],230,220,cl_Green,5*65536
; label 130,234,'Youre Lives:',cl_Green+font_Big
; label 130,234,'Your Lives:',cl_Green+font_Big
; outcount dword [scoreb],230,234,cl_Green,5*65536
; delay 600 ;wait 2sec
; close ;exit from program
@ -310,7 +310,7 @@ lose_test:
jne stl2
; call draw_window
; label 160,200,'You Lose!',cl_Red+font_Big
; label 130,220,'Youre Score:',cl_Red+font_Big
; label 130,220,'Your Score:',cl_Red+font_Big
; outcount dword [scorea],230,220,cl_Red,5*65536
; delay 300 ;wait 2sec
; close ;exit from program
@ -420,7 +420,7 @@ draw_window:
window 0,0,400+8,480+24,window_Skinned
if lang eq it_IT
label 12,8,'ARCANOID: Usa le freccie Vite Punti',cl_White+font_Big
else
else ; Default to en_US
label 12,8,'ARCANOID: USE ARROW KEYS LIVES SCORE',cl_White+font_Big
end if
@ -433,9 +433,9 @@ draw_window:
if lang eq it_IT
label 160,200,'Hai perso!',cl_Red+font_Big
label 130,220,'Punteggio:',cl_Red+font_Big
else
else ; Default to en_US
label 160,200,'You Lose!',cl_Red+font_Big
label 130,220,'Youre Score:',cl_Red+font_Big
label 130,220,'Your Score:',cl_Red+font_Big
end if
outcount dword [scorea],230,220,cl_Red,5*65536
mov ebx,150*65536+80
@ -449,7 +449,7 @@ draw_window:
mcall
if lang eq it_IT
label 152,244,'Rigioca',cl_Red+font_Big
else
else ; Default to en_US
label 152,244,'Play again?',cl_Red+font_Big
end if
jmp elev
@ -457,9 +457,9 @@ nlev:
if lang eq it_IT
label 160,200,'Hai vinto!',cl_Green+font_Big
label 130,220,'Punteggio:',cl_Green+font_Big
else
else ; Default to en_US
label 160,200,'You Win!',cl_Green+font_Big
label 130,220,'Youre Score:',cl_Green+font_Big
label 130,220,'Your Score:',cl_Green+font_Big
end if
outcount dword [scorea],230,220,cl_Green,5*65536
mov ebx,150*65536+120 ;mov ebx,150*65536+80
@ -473,13 +473,13 @@ nlev:
mcall
if lang eq it_IT
label 152,244,'Prossimo Livello',cl_Red+font_Big
else
else ; Default to en_US
label 152,244,'Next level?',cl_Red+font_Big
end if
elev:
if lang eq it_IT
label 178,264,'Esci',cl_Red+font_Big
else
else ; Default to en_US
label 178,264,'Exit?',cl_Red+font_Big
end if

File diff suppressed because it is too large Load Diff

View File

@ -1,17 +1,17 @@
_window_caption db 'Soft landing',0 ;çàãîëîâîê ïðèëîæåíèÿ
_text_game_over db 'G A M E O V E R', 0
_text_level_complete db 'L E V E L C O M P L E T E', 0
_text_intro_title db ' S O F T L A N D I N G', 0
_text_intro_description1 db 'Provide a soft landing, clearing the runway from the city buildings', 0
_text_intro_key_controls db ' Control keys:', 0
_text_intro_key_ctrl db ' CTRL - drop a bomb', 0
_text_intro_key_space db 'SPACE - do a barrel roll', 0
_text_intro_select_level db ' Use UP and DOWN arrow keys for select game level:', 0
_text_intro_level_num db ' LEVEL', 0
_text_intro_set_volume db ' Use LEFT and RIGHT arrow keys for setting volume:', 0
_text_intro_volume_num db 'VOLUME', 0
_text_intro_start_space db 'Press SPACE for start game', 0
_text_intro_exit_key db 'Esc - exit', 0
_window_caption db 'Soft landing',0 ; Application title
_text_game_over db 'G A M E O V E R', 0
_text_level_complete db 'L E V E L C O M P L E T E', 0
_text_intro_title db ' S O F T L A N D I N G', 0
_text_intro_description1 db 'Provide a soft landing, clearing the runway from the city buildings', 0
_text_intro_key_controls db ' Control keys:', 0
_text_intro_key_ctrl db ' CTRL - drop a bomb', 0
_text_intro_key_space db 'SPACE - do a barrel roll', 0
_text_intro_select_level db ' Use UP and DOWN arrow keys to select the game level:', 0
_text_intro_level_num db ' LEVEL', 0
_text_intro_set_volume db ' Use LEFT and RIGHT arrow keys for setting volume:', 0
_text_intro_volume_num db 'VOLUME', 0
_text_intro_start_space db 'Press SPACE for start game', 0
_text_intro_exit_key db 'Esc - exit', 0

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -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:

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -1,3 +1,5 @@
; 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]
@ -241,7 +243,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

View File

@ -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

View File

@ -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

View File

@ -1,184 +1,185 @@
;
; Œ ªà®áë ¤«ï ¤¥ª®¤¨à®¢ ­¨ï ¨§®¡à ¦¥­¨© ç१ ä㭪樨 ¡¨¡«¨®â¥ª¨ 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
; Language support for locales: ru_RU (CP866), en_US.
txt_err_img_file:
if lang eq ru_RU
db 'Žè¨¡ª  N'
.n: db '* ¯à¨ ®âªàë⨨ ä ©«  '
else ; Default to 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

View File

@ -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

View File

@ -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

View File

@ -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] '

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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: ; метка конца программы

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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:

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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