Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af99b495fe | ||
|
|
975284f5f3 | ||
|
|
8ece779b4b | ||
|
|
a218a83bd5 | ||
|
|
c762489408 | ||
|
|
3d02856efe | ||
|
|
4a166ede82 | ||
|
|
46e816c366 | ||
|
|
65239bc359 | ||
|
|
f222e98a09 |
No files matched your search
@@ -31,10 +31,11 @@ A1. Fine. You will need a corresponding compiler, obviously.
|
||||
If the compiler produces an error "file not found" regarding 'lang.inc',
|
||||
the program can be compiled using different languages of interface.
|
||||
Create a file 'lang.inc' in the same folder as <input.asm> like follows:
|
||||
lang fix en
|
||||
lang fix en_US
|
||||
Here the last word selects the language. Valid languages are
|
||||
en, ru, et, it, sp. Not all programs provide all translations,
|
||||
en should always be available, ru is the most frequent after en.
|
||||
en_US, ru_RU, et_EE, it_IT, es_ES, ca_ES. Not all programs provide all
|
||||
translations, en_US should always be available, ru_RU is the most frequent
|
||||
after en_US.
|
||||
|
||||
* For a NASM program, get NASM at http://www.nasm.us/.
|
||||
To compile, find the main .asm file of the program and run
|
||||
@@ -42,7 +43,7 @@ A1. Fine. You will need a corresponding compiler, obviously.
|
||||
Multi-language is rarely supported in this category, but you could still
|
||||
see sometimes an error "file not found" regarding 'lang_nasm.inc'. If so,
|
||||
create a file 'lang_nasm.inc' in the same folder as <input.asm> like follows:
|
||||
%define lang 'en'
|
||||
%define lang 'en_US'
|
||||
Read the entry about fasm for description of valid languages.
|
||||
|
||||
* For a c-- program, try to avoid compiling it and instead rewrite the code
|
||||
|
||||
@@ -1223,10 +1223,10 @@ KOSAPI void _ksys_debug_puts(const char* s)
|
||||
KOSAPI void ksys_draw_bitmap_palette(void* bitmap, int x, int y, int w, int h, int bpp, void* palette, int offset)
|
||||
{
|
||||
asm_inline(
|
||||
"pushl %%ebp,\n\t" // save EBP register
|
||||
"movl 0x24(%%ebp), %%ebp\n\t" // 0x24 - "offset" param
|
||||
"pushl %%ebp\n\t" // save EBP register
|
||||
"movl 0x24(%%ebp), %%ebp\n\t" // 0x24 - "offset" param
|
||||
"int $0x40\n\t"
|
||||
"popl %%ebp" // restore EBP register
|
||||
"popl %%ebp" // restore EBP register
|
||||
:
|
||||
: "a"(65),
|
||||
"b"(bitmap),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
FASM=fasm
|
||||
FLAGS=-m 65536
|
||||
languages=en|ru|ge|et|sp
|
||||
languages=en_US|ru_RU|de_DE|et_EE|es_ES
|
||||
|
||||
.PHONY: all kernel bootloader clean
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ pause
|
||||
goto :eof
|
||||
|
||||
:Target_kernel
|
||||
rem valid languages: en ru ge et sp
|
||||
set lang=en
|
||||
rem valid languages: en_US ru_RU de_DE et_EE es_ES
|
||||
set lang=en_US
|
||||
|
||||
echo *** building kernel with language '%lang%' ...
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ KERPACK=$HOME/kolibrios/programs/other/kpack/kerpack_linux/kerpack
|
||||
KOLIBRI_IMG=$HOME/nightly/kolibri.img
|
||||
|
||||
replace=0; # Replace kernel in the image file?
|
||||
echo 'lang fix en' > lang.inc
|
||||
echo 'lang fix en_US' > lang.inc
|
||||
fasm -m 65536 bootbios.asm bootbios.bin
|
||||
fasm -m 65536 kernel.asm kernel.mnt
|
||||
$KERPACK kernel.mnt kernel.mnt
|
||||
|
||||
@@ -62,6 +62,7 @@ char *actions[] = {
|
||||
#define T_FD "Дискета "
|
||||
#define T_HD "Жесткий диск "
|
||||
#define T_SATA "SATA диск "
|
||||
#define T_NVME "NVMe disk "
|
||||
#define T_USB "USB диск "
|
||||
#define T_RAM "RAM диск "
|
||||
#define T_UNC "Неизвестно "
|
||||
@@ -160,6 +161,7 @@ char *actions[] = {
|
||||
#define T_FD "Floppy disk "
|
||||
#define T_HD "Hard disk "
|
||||
#define T_SATA "SATA disk "
|
||||
#define T_NVME "NVMe disk "
|
||||
#define T_USB "USB disk "
|
||||
#define T_RAM "RAM disk "
|
||||
#define T_UNC "Unknown "
|
||||
@@ -252,6 +254,7 @@ char *devinfo = {
|
||||
"hd", 4, T_HD,
|
||||
"bd", 4, T_HD,
|
||||
"sd", 4, T_SATA,
|
||||
"nv", 4, T_NVME,
|
||||
"tm", 5, T_RAM,
|
||||
"us", 6, T_USB,
|
||||
0
|
||||
|
||||
@@ -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
|
||||
;---------------------------------------------------------------------
|
||||
@@ -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 - Экранная лупа', 0
|
||||
else
|
||||
else ; Default to en_US
|
||||
labelt:
|
||||
db 'Magnifier', 0
|
||||
end if
|
||||
|
||||
@@ -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 'ТАЙМЕР',0
|
||||
else
|
||||
else ; Default to en_US
|
||||
title db 'TIMER',0
|
||||
end if
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 'Память для всех потоков общая. '
|
||||
db ' '
|
||||
db ' СОЗДАТЬ НОВЫЙ ПОТОК '
|
||||
db 'x' ; <- END MARKER, DONT DELETE
|
||||
db 'x' ; <- END MARKER, DO NOT DELETE
|
||||
|
||||
title db 'Пример использования потоков',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
|
||||
|
||||
|
||||
@@ -1,43 +1,42 @@
|
||||
|
||||
include 'lang.inc'
|
||||
|
||||
if lang eq ru_RU
|
||||
|
||||
text db ' ВхФайл:','ВыхФайл:',' Путь:'
|
||||
.line_size = ($-text)/3
|
||||
|
||||
s_compile db 'Компил.'
|
||||
s_run db ' Пуск '
|
||||
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 ' ВхФайл:','ВыхФайл:',' Путь:'
|
||||
.line_size = ($-text)/3
|
||||
|
||||
s_compile db 'Компил.'
|
||||
s_run db ' Пуск '
|
||||
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
|
||||
@@ -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
|
||||
|
||||
@@ -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 'Назад'
|
||||
.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
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
@@ -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
|
||||
+324
-320
@@ -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 'Набор объектов',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 'Название материала',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 'Поведение объекта',0
|
||||
;txt_b009 db 'KFCURTIME',0
|
||||
;txt_b00a db 'KFHDR',0
|
||||
txt_b010 db 'Название объекта',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 'Поведение камеры',0
|
||||
txt_b023 db 'Поведение fov камеры',0
|
||||
txt_b024 db 'Поведение roll камеры',0
|
||||
txt_b004 db 'Поведение "цели" камеры',0
|
||||
|
||||
;--- далее не во всех блоках смог найти описание на русском языке
|
||||
txt_4111 db 'Флаги вершин',0
|
||||
txt_4150 db 'Smoothing group list',0
|
||||
txt_4165 db 'Object color in editor',0
|
||||
txt_4610 db 'Направленный свет',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 'Разметка рельефа',0
|
||||
txt_a220 db 'Разметка отражения',0
|
||||
txt_a351 db 'Параметры разметки',0
|
||||
txt_b007 db 'Информация о направленом освещении',0
|
||||
txt_b008 db 'Кадры (начальный и конечный)',0
|
||||
txt_b022 db 'Масштабирование',0
|
||||
txt_b030 db 'Позиция в иерархии',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 'Не могу удалить выбранный блок. Он защищен.',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 ' Размер: '
|
||||
.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 'Набор объектов',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 'Название материала',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 'Поведение объекта',0
|
||||
;txt_b009 db 'KFCURTIME',0
|
||||
;txt_b00a db 'KFHDR',0
|
||||
txt_b010 db 'Название объекта',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 'Поведение камеры',0
|
||||
txt_b023 db 'Поведение fov камеры',0
|
||||
txt_b024 db 'Поведение roll камеры',0
|
||||
txt_b004 db 'Поведение "цели" камеры',0
|
||||
|
||||
;--- далее не во всех блоках смог найти описание на русском языке
|
||||
txt_4111 db 'Флаги вершин',0
|
||||
txt_4150 db 'Smoothing group list',0
|
||||
txt_4165 db 'Object color in editor',0
|
||||
txt_4610 db 'Направленный свет',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 'Разметка рельефа',0
|
||||
txt_a220 db 'Разметка отражения',0
|
||||
txt_a351 db 'Параметры разметки',0
|
||||
txt_b007 db 'Информация о направленом освещении',0
|
||||
txt_b008 db 'Кадры (начальный и конечный)',0
|
||||
txt_b022 db 'Масштабирование',0
|
||||
txt_b030 db 'Позиция в иерархии',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 'Не могу удалить выбранный блок. Он защищен.',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 ' Размер: '
|
||||
.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
|
||||
+1399
-1399
File diff suppressed because it is too large.
Load diff
+1459
-1459
File diff suppressed because it is too large.
Load diff
@@ -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 'Разноцветные грани вкл.', 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 'Разноцветные грани вкл.', 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
@@ -168,7 +168,7 @@ fail:
|
||||
download_1:
|
||||
DEBUGF 1, "Starting download\n"
|
||||
|
||||
invoke HTTP_get, 0, 0, params, 0
|
||||
invoke HTTP_get, document_user, 0, params, 0
|
||||
test eax, eax
|
||||
jz fail
|
||||
mov [identifier], eax
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
# Libio
|
||||
> Lib for work with files
|
||||
|
||||
## Functions
|
||||
|
||||
### Files enumeration
|
||||
|
||||
##### `file_find_first`
|
||||
> Find first file with matching attributes and mask in specified directory.
|
||||
|
||||
**Prototype**:
|
||||
`proc file.find_first dir, mask, attr`
|
||||
|
||||
**Arguments**:
|
||||
| name | type | Describtion |
|
||||
| :--- | :----: | :------------------------------------------------------- |
|
||||
| dir | ASCIIZ | Directory path, to search in |
|
||||
| mask | ASCIIZ | File mask, with use of wildcards (a.k.a. shell patterns) |
|
||||
| attr | ASCIIZ | File attributes mask (combination of FA_* constants) |
|
||||
|
||||
**Result**:
|
||||
| register | type | Description |
|
||||
| :------- | :-------: | :--------------------------------------------------------------------- |
|
||||
| EAX | Fileinfo* | 0 for error<br/>Matched file data pointer (__acts as find descriptor__) |
|
||||
|
||||
|
||||
##### `file_find_next`
|
||||
> Find next file matching criteria.
|
||||
|
||||
**Prototype**:
|
||||
`proc file.find_next findd`
|
||||
|
||||
**Argument**:
|
||||
| name | type | Describtion |
|
||||
| :---- | :-------: | :--------------------------------------------------------- |
|
||||
| findd | Fileinfo* | Find describtion (see [file_find_first](#file_find_first)) |
|
||||
|
||||
**Result**:
|
||||
| register | type | Description |
|
||||
| :------- | :-------: | :--------------------------------------------------------------------- |
|
||||
| EAX | Fileinfo* | 0 for info<br/>Matched file data pointer (__acts as find descriptor__) |
|
||||
|
||||
|
||||
##### `file_find_close`
|
||||
> Find next file matching criteria.
|
||||
|
||||
**Prototype**:
|
||||
`Find next file matching criteria.`
|
||||
|
||||
**Arguments**:
|
||||
| name | type | Describtion |
|
||||
| :---- | :-------: | :--------------------------------------------------------- |
|
||||
| findd | Fileinfo* | Find describtion (see [file_find_first](#file_find_first)) |
|
||||
|
||||
|
||||
**Result**:
|
||||
| register | type | Description |
|
||||
| :------- | :---: | :------------------------------- |
|
||||
| EAX | dword | Result of memory freeing routine |
|
||||
@@ -1,318 +1,318 @@
|
||||
; Программа для преобразования чисел из строки
|
||||
; в формат float, double, а также из 10 или 16 ричного
|
||||
; во float.
|
||||
; Сделана на основе hex2dec2bin и примеров из файла list2_05.inc
|
||||
; (автор Кулаков Владимир Геннадьевич 24.05.2002),
|
||||
; которые ChE переделал с 16 на 32 бита на ассемблер fasm.
|
||||
; Программа позволяет решать такие задачи:
|
||||
; 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 ; если НЕ нажата кнопка с номером 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: ; метка конца программы
|
||||
; Программа для преобразования чисел из строки
|
||||
; в формат float, double, а также из 10 или 16 ричного
|
||||
; во float.
|
||||
; Сделана на основе hex2dec2bin и примеров из файла list2_05.inc
|
||||
; (автор Кулаков Владимир Геннадьевич 24.05.2002),
|
||||
; которые ChE переделал с 16 на 32 бита на ассемблер fasm.
|
||||
; Программа позволяет решать такие задачи:
|
||||
; 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 ; если НЕ нажата кнопка с номером 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: ; метка конца программы
|
||||
@@ -1,491 +1,501 @@
|
||||
|
||||
sz htext,'TINYPAD ',APP_VERSION
|
||||
|
||||
menubar_res main_menu,\
|
||||
ru,'Файл' ,mm.File ,onshow.file ,\
|
||||
ru,'Правка' ,mm.Edit ,onshow.edit ,\
|
||||
ru,'Поиск' ,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,'Новый' ,'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,'Перейти...' ,'Ctrl+G',Position,\
|
||||
ru,'-','',,\
|
||||
ru,'Найти...' ,'Ctrl+F',Find ,\
|
||||
ru,'Найти далее','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,'Номера строк' ,'',LineNumbers ,\
|
||||
ru,'Безопасное выделение' ,'',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,<'Безымянный',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,'Нет',\
|
||||
en,'No',\
|
||||
it,'No',\
|
||||
et,'Ei',\
|
||||
sp,'No'
|
||||
lsz s_2find,\
|
||||
ru,'Найти',\
|
||||
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,'Расположение закладок',\
|
||||
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,<'Неизвестная файловая система (3)',0>,\
|
||||
ru,<'',0>,\
|
||||
ru,<'Невозможно открыть файл (5)',0>,\
|
||||
ru,<'Операция завершена успешно (6)',0>,\
|
||||
ru,<'Адрес находится за границами памяти программы (7)',0>,\
|
||||
ru,<'На диске нет свободного места (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,'Правка' ,mm.Edit ,onshow.edit ,\
|
||||
ru_RU,'Поиск' ,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,'Новый' ,'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,'Перейти...' ,'Ctrl+G',Position,\
|
||||
ru_RU,'-','',,\
|
||||
ru_RU,'Найти...' ,'Ctrl+F',Find ,\
|
||||
ru_RU,'Найти далее','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,'Номера строк' ,'',LineNumbers ,\
|
||||
ru_RU,'Безопасное выделение' ,'',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,<'Безымянный',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,'Нет',\
|
||||
en_US,'No',\
|
||||
it_IT,'No',\
|
||||
et_EE,'Ei',\
|
||||
es_ES,'No'
|
||||
|
||||
lsz s_2find,\
|
||||
ru_RU,'Найти',\
|
||||
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,'Расположение закладок',\
|
||||
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,<'Неизвестная файловая система (3)',0>,\
|
||||
ru_RU,<'',0>,\
|
||||
ru_RU,<'Невозможно открыть файл (5)',0>,\
|
||||
ru_RU,<'Операция завершена успешно (6)',0>,\
|
||||
ru_RU,<'Адрес находится за границами памяти программы (7)',0>,\
|
||||
ru_RU,<'На диске нет свободного места (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'
|
||||
@@ -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
|
||||
|
||||
; Параметры:
|
||||
; 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 "Путь к источнику и приемнику не указаны!!! "
|
||||
db "Путь к приемнику не указан!!! "
|
||||
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
|
||||
|
||||
+8935
-8931
File diff suppressed because it is too large.
Load diff
+914
-914
File diff suppressed because it is too large.
Load diff
+490
-490
@@ -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 'Вы решили задачу! Нажмите->'
|
||||
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 'Вы решили задачу! Нажмите->'
|
||||
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:
|
||||
@@ -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, 'Подземелья Аугастеса 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, 'Подземелья Аугастеса 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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
+2369
-2369
File diff suppressed because it is too large.
Load diff
@@ -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 renamed without changes.
File diff suppressed because it is too large.
Load diff
+1732
-1732
File diff suppressed because it is too large.
Load diff
+275
-275
@@ -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 'Рекорд',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 'Рекорд',0
|
||||
szScore db 'Очки',0
|
||||
else ; Default to en_US
|
||||
szTitle db 'Color lines v 0.3',0
|
||||
szNewGame db 'F2 - new game',0
|
||||
szRecord db 'Record',0
|
||||
szScore db 'Score',0
|
||||
end if
|
||||
|
||||
|
||||
blank = 0xB8C2D3
|
||||
brown = 0x804000
|
||||
red = 0xff0000
|
||||
yellow = 0xffff00
|
||||
green = 0x008000
|
||||
cyan = 0x00ffff
|
||||
blue = 0x0000ff
|
||||
purple = 0x800080
|
||||
|
||||
tableColor dd blank,brown,red,yellow,green,cyan,blue,purple
|
||||
|
||||
lineCoord:
|
||||
rept 9 coory:0
|
||||
{
|
||||
rept 9 coorx:0
|
||||
\{
|
||||
dw coorx*256+coory
|
||||
|
||||
\}
|
||||
}
|
||||
|
||||
record dd 25
|
||||
|
||||
lineBall db 81 dup ?
|
||||
score dd ?
|
||||
baseAddr dd ?
|
||||
current dd ?
|
||||
dest dd ?
|
||||
|
||||
newColor1 db ?
|
||||
newColor2 db ?
|
||||
newColor3 db ?
|
||||
|
||||
countVanishBall db ?
|
||||
countAllBall db ?
|
||||
|
||||
TC_U_SYSTEM_RANDSEED dd ?
|
||||
bitID dd ?
|
||||
|
||||
I_END:
|
||||
@@ -1,140 +1,142 @@
|
||||
; level format
|
||||
; [fx|fy]..[field cells x2]..[worm_count]..[worm_len][start cell #][body dirs x2]
|
||||
|
||||
; internal format
|
||||
; [stepptr]= worms #
|
||||
; area: [worm_len][start_cell #][end_cell #]..[dirs]..
|
||||
; [cur_step]: dragged worm pointer
|
||||
; [finish]: 0 - if head dragged, 1- if tail
|
||||
CZ_levelp:
|
||||
call get_xy_sf
|
||||
call LP_levelp.bit2
|
||||
mov dword[area],5;0
|
||||
ret
|
||||
|
||||
CZ_key:
|
||||
mov [jump],still
|
||||
cmp eax,176
|
||||
jb .ex
|
||||
cmp eax,179
|
||||
ja .ex
|
||||
mov ecx,dword[area]
|
||||
lea ebx,[eax-176]
|
||||
mov eax,[player]
|
||||
call check_bounds
|
||||
je .ex
|
||||
cmp ecx,5
|
||||
jne .novert
|
||||
.vert:
|
||||
add eax,[dirs+ebx*4]
|
||||
call check_bounds
|
||||
je .ex
|
||||
mov ecx,eax
|
||||
add ecx,[dirs+ebx*4]
|
||||
mov cl,[field+ecx]
|
||||
cmp cl,[field+eax]
|
||||
jne .ex
|
||||
mov dword[area],ebx
|
||||
.ok:
|
||||
mov [player],eax
|
||||
cmp eax,[finish]
|
||||
jne .jm
|
||||
cmp dword[area],5
|
||||
jne .jm
|
||||
mov [win_flag],1
|
||||
.jm:
|
||||
mov [jump],drw
|
||||
.ex:
|
||||
ret
|
||||
.novert:
|
||||
mov edx,ebx
|
||||
cmp edx,ecx ; the same dir
|
||||
jne .nosame
|
||||
add eax,[dirs+ebx*4]
|
||||
call check_bounds
|
||||
je .ex
|
||||
.set5:
|
||||
mov dword[area],5
|
||||
add eax,[dirs+ebx*4]
|
||||
jmp .ok
|
||||
.nosame:
|
||||
xor edx,11b
|
||||
cmp edx,ecx ; the opposite dir
|
||||
je .set5
|
||||
add eax,[dirs+ebx*4]
|
||||
mov ebx,ecx
|
||||
xor ecx,11b
|
||||
add eax,[dirs+ecx*4]
|
||||
jmp .vert
|
||||
|
||||
CZ_drawm:
|
||||
mov ecx,[cell_count]
|
||||
mov esi,field
|
||||
mov [sq_size],3
|
||||
.lp:
|
||||
push ecx
|
||||
movzx ebx,byte[field+ecx-1]
|
||||
shr ebx,6
|
||||
lea eax,[ecx-1]
|
||||
call get_xy
|
||||
add [lx],5-2 shl 16
|
||||
add [ly],5-2 shl 16
|
||||
mov edx,[f_colors+ebx*4]
|
||||
mcall 13,[lx],[ly]
|
||||
.no:
|
||||
pop ecx
|
||||
loop .lp
|
||||
|
||||
inc [sq_size]
|
||||
mov eax,[player]
|
||||
call get_xy
|
||||
xor edx,edx
|
||||
cmp dword[area],5
|
||||
je .vert
|
||||
push [lx]
|
||||
push [ly]
|
||||
mov edx,dword[area]
|
||||
add eax,[dirs+edx*4]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly]
|
||||
pop [ly]
|
||||
pop [lx]
|
||||
.vert:
|
||||
mcall 13,[lx],[ly]
|
||||
add [sq_size],5
|
||||
mov eax,[finish]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xffffff
|
||||
|
||||
ret
|
||||
|
||||
|
||||
CZ_level:
|
||||
file 'colzone.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
CZ_help mstr \
|
||||
'Черный блок из 2 кубиков стоит на раскрашенной',\
|
||||
'клетчатой доске. Ваша задача - перекатить его на',\
|
||||
'клетку с белым квадратиком. Блок начинает стоя и',\
|
||||
'должен закончить тоже в вертикальном положении.',\
|
||||
'Нельзя выкатывать его за пределы сетки и сверх',\
|
||||
'того - кубики блока должны всегда ложиться на',\
|
||||
'клетки одинакового цвета. Блок не отображен в 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 кубиков стоит на раскрашенной',\
|
||||
'клетчатой доске. Ваша задача - перекатить его на',\
|
||||
'клетку с белым квадратиком. Блок начинает стоя и',\
|
||||
'должен закончить тоже в вертикальном положении.',\
|
||||
'Нельзя выкатывать его за пределы сетки и сверх',\
|
||||
'того - кубики блока должны всегда ложиться на',\
|
||||
'клетки одинакового цвета. Блок не отображен в 3D,',\
|
||||
'поэтому Вы видите лишь его проекцию.','',\
|
||||
'http://www.clickmazes.com'
|
||||
else ; Default to en_US
|
||||
CZ_help mstr \
|
||||
'A black block, made of two black cubes stuck',\
|
||||
'together, sits on a coloured grid. Your challenge',\
|
||||
'is to roll the black block to its target',\
|
||||
'position, which is marked with a small white',\
|
||||
'square. The block starts on one end (vertical)',\
|
||||
'and must also finish in this position. The block',\
|
||||
'is not permitted to roll off the grid and, in',\
|
||||
'addition, the block must always lie entirely',\
|
||||
'within one colour-zone. Note the block is not',\
|
||||
'displayed in 3D, in effect you see only its',\
|
||||
'shadow.','',\
|
||||
'http://www.clickmazes.com'
|
||||
end if
|
||||
@@ -1,66 +1,68 @@
|
||||
; level format
|
||||
; [fx|fy][blue xy][red xy]..[maze walls]
|
||||
|
||||
; internal format
|
||||
; [player]= blue
|
||||
; [finish]= red
|
||||
|
||||
|
||||
CSTEP_key:
|
||||
cmp eax,176
|
||||
jb .ex
|
||||
cmp eax,179
|
||||
ja .ex
|
||||
mov esi,area
|
||||
inc esi
|
||||
lea ebx,[eax-176]
|
||||
mov [jump],still
|
||||
mov eax,[player]
|
||||
call check_move
|
||||
jc .ex
|
||||
add eax,[dirs+ebx*4]
|
||||
mov edx,eax
|
||||
.nom1:
|
||||
mov eax,[finish]
|
||||
xor ebx,11b
|
||||
call check_move
|
||||
jc .ex
|
||||
add eax,[dirs+ebx*4]
|
||||
mov [finish],eax
|
||||
mov [player],edx
|
||||
mov [jump],drw
|
||||
cmp eax,edx
|
||||
jnz .ex
|
||||
mov [win_flag],1
|
||||
.ex:
|
||||
ret
|
||||
|
||||
CSTEP_drawm:
|
||||
mov eax,[player]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff0000
|
||||
mov eax,[finish]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff
|
||||
ret
|
||||
|
||||
CSTEP_level:
|
||||
file 'cstep.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
CSTEP_help mstr \
|
||||
'Соедините красный и синий блоки путем управления',\
|
||||
'одним красным блоком. Синий блок следует за',\
|
||||
'красным, но движется в прямо противоположном',\
|
||||
'направлении. Ход разрешен только в случае',\
|
||||
'отсутствия препятствий для обоих блоков.','',\
|
||||
'http://www.clickmazes.com'
|
||||
else
|
||||
CSTEP_help mstr \
|
||||
'Unite the red and blue dots by moving just the',\
|
||||
'red dot. The blue dot follows the red dot, but',\
|
||||
'moves in exactly in the opposite direction. A',\
|
||||
'move is only permitted if the path is clear for',\
|
||||
'both dots.','',\
|
||||
'http://www.clickmazes.com'
|
||||
end if
|
||||
; Language support for locales: ru_RU (CP866), en_US.
|
||||
|
||||
; level format
|
||||
; [fx|fy][blue xy][red xy]..[maze walls]
|
||||
|
||||
; internal format
|
||||
; [player]= blue
|
||||
; [finish]= red
|
||||
|
||||
|
||||
CSTEP_key:
|
||||
cmp eax,176
|
||||
jb .ex
|
||||
cmp eax,179
|
||||
ja .ex
|
||||
mov esi,area
|
||||
inc esi
|
||||
lea ebx,[eax-176]
|
||||
mov [jump],still
|
||||
mov eax,[player]
|
||||
call check_move
|
||||
jc .ex
|
||||
add eax,[dirs+ebx*4]
|
||||
mov edx,eax
|
||||
.nom1:
|
||||
mov eax,[finish]
|
||||
xor ebx,11b
|
||||
call check_move
|
||||
jc .ex
|
||||
add eax,[dirs+ebx*4]
|
||||
mov [finish],eax
|
||||
mov [player],edx
|
||||
mov [jump],drw
|
||||
cmp eax,edx
|
||||
jnz .ex
|
||||
mov [win_flag],1
|
||||
.ex:
|
||||
ret
|
||||
|
||||
CSTEP_drawm:
|
||||
mov eax,[player]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff0000
|
||||
mov eax,[finish]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff
|
||||
ret
|
||||
|
||||
CSTEP_level:
|
||||
file 'cstep.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
CSTEP_help mstr \
|
||||
'Соедините красный и синий блоки путем управления',\
|
||||
'одним красным блоком. Синий блок следует за',\
|
||||
'красным, но движется в прямо противоположном',\
|
||||
'направлении. Ход разрешен только в случае',\
|
||||
'отсутствия препятствий для обоих блоков.','',\
|
||||
'http://www.clickmazes.com'
|
||||
else ; Default to en_US
|
||||
CSTEP_help mstr \
|
||||
'Unite the red and blue dots by moving just the',\
|
||||
'red dot. The blue dot follows the red dot, but',\
|
||||
'moves in exactly in the opposite direction. A',\
|
||||
'move is only permitted if the path is clear for',\
|
||||
'both dots.','',\
|
||||
'http://www.clickmazes.com'
|
||||
end if
|
||||
@@ -1,197 +1,199 @@
|
||||
FH_levelp:
|
||||
mcall 40,100111b
|
||||
call get_xy_sf
|
||||
call erase_field
|
||||
sub esi,2
|
||||
mov [levptr],esi
|
||||
movzx ecx,byte[esi-2]
|
||||
sub ecx,2
|
||||
xor eax,eax
|
||||
.lp:
|
||||
lodsb
|
||||
mov byte[field+eax],-1
|
||||
loop .lp
|
||||
mov dword[player],-1
|
||||
mov [win_flag],3
|
||||
ret
|
||||
|
||||
FH_key:
|
||||
cmp eax,-1
|
||||
je FH_mouse
|
||||
cmp eax,8
|
||||
jne .nobsp
|
||||
cmp [stepptr],0
|
||||
jne .no1st
|
||||
mov [jump],run.game
|
||||
ret
|
||||
.no1st:
|
||||
mov [win_flag],0
|
||||
sub [cur_step],2
|
||||
mov esi,[cur_step]
|
||||
mov edi,[finish]
|
||||
mov eax,3
|
||||
movzx ebx,byte[esi]
|
||||
sub eax,ebx
|
||||
movzx ecx,byte[esi+1]
|
||||
.lp0:
|
||||
and byte[field+edi],0
|
||||
add edi,[dirs+eax*4]
|
||||
loop .lp0
|
||||
mov [finish],edi
|
||||
dec [stepptr]
|
||||
ret
|
||||
.nobsp:
|
||||
cmp eax,176
|
||||
jb .ex
|
||||
cmp eax,179
|
||||
ja .ex
|
||||
sub eax,176
|
||||
jmp FH_mouse.fromkey
|
||||
.ex:
|
||||
ret
|
||||
|
||||
FH_drawm:
|
||||
mov ecx,[cell_count]
|
||||
.lp:
|
||||
push ecx
|
||||
movzx ebx,byte[field+ecx-1]
|
||||
test ebx,ebx
|
||||
jz .no
|
||||
lea eax,[ecx-1]
|
||||
call get_xy
|
||||
mov edx,0
|
||||
cmp ebx,0xf
|
||||
jne .stable
|
||||
mov edx,0x909090
|
||||
.stable:
|
||||
mcall 13,[lx],[ly]
|
||||
.no:
|
||||
pop ecx
|
||||
loop .lp
|
||||
|
||||
mov eax,[player]
|
||||
cmp eax,-1
|
||||
je .ex
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff00
|
||||
mov eax,[finish]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff0000
|
||||
|
||||
mov ecx,[stepptr]
|
||||
jecxz .ex
|
||||
mov ebx,area
|
||||
mov edi,[player]
|
||||
mov edx,0xffffff
|
||||
.lp3:
|
||||
push ecx
|
||||
mov esi,edi
|
||||
movzx eax,byte[ebx]
|
||||
movzx ecx,byte[ebx+1]
|
||||
add ebx,2
|
||||
.lp2:
|
||||
add edi,[dirs+eax*4]
|
||||
loop .lp2
|
||||
call getline
|
||||
pop ecx
|
||||
loop .lp3
|
||||
.ex:
|
||||
ret
|
||||
|
||||
FH_mouse:
|
||||
mov [jump],drw;red
|
||||
call get_last_mclick
|
||||
cmp byte[field+ebx],0
|
||||
jne .ex
|
||||
cmp dword[player],-1
|
||||
jne .nostart
|
||||
mov dword[player],ebx
|
||||
mov byte[field+ebx],0xf
|
||||
mov [finish],ebx
|
||||
and [win_flag],0
|
||||
mov [cur_step],area
|
||||
and [stepptr],0
|
||||
ret
|
||||
.nostart:
|
||||
mov eax,[finish]
|
||||
call get_offset
|
||||
cmp eax,-1
|
||||
je .ex
|
||||
.fromkey:
|
||||
xor ecx,ecx
|
||||
mov edx,eax
|
||||
mov esi,[finish]
|
||||
.lp:
|
||||
add esi,[dirs+edx*4]
|
||||
cmp byte[field+esi],0
|
||||
jnz .exlp
|
||||
mov eax,[finish]
|
||||
mov ebx,esi
|
||||
call get_offset
|
||||
cmp eax,edx
|
||||
jne .exlp
|
||||
mov byte[field+esi],0xf
|
||||
inc ecx
|
||||
mov [finish],esi
|
||||
jmp .lp
|
||||
|
||||
.exlp:
|
||||
jecxz .ex
|
||||
mov eax,edx
|
||||
mov edi,[cur_step]
|
||||
stosb
|
||||
mov [edi],cl
|
||||
inc edi
|
||||
mov [cur_step],edi
|
||||
inc [stepptr]
|
||||
mov edi,field
|
||||
mov ecx,[cell_count]
|
||||
xor eax,eax
|
||||
repne scasb
|
||||
je .ch_deadend
|
||||
mov [win_flag],1
|
||||
.ex:
|
||||
ret
|
||||
.ch_deadend:
|
||||
mov ecx,4
|
||||
mov edx,dirs
|
||||
.lpp:
|
||||
mov eax,[finish]
|
||||
mov ebx,[edx]
|
||||
add ebx,eax
|
||||
push ebx
|
||||
call get_offset
|
||||
pop ebx
|
||||
cmp eax,-1
|
||||
je .nxtlp
|
||||
cmp byte[field+ebx],0
|
||||
jz .ex
|
||||
.nxtlp:
|
||||
add edx,4
|
||||
loop .lpp
|
||||
mov [win_flag],4
|
||||
ret
|
||||
|
||||
FH_level:
|
||||
file 'fhouse.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
FH_help mstr \
|
||||
'В задании найдите начальную клетку и проведите',\
|
||||
'линию, которая проходит через пустые клетки по',\
|
||||
'одному разу.',\
|
||||
' Каждый раз красный квадрат двигается прямо,',\
|
||||
'останавливаясь только у края, перед черными',\
|
||||
'квадратами или уже посещенными клетками.','',\
|
||||
'http://www.clickmazes.com'
|
||||
else
|
||||
FH_help mstr \
|
||||
'For each puzzle find the starting square and draw',\
|
||||
'a path moving horizontally and vertically that',\
|
||||
'passes through each open square exactly once.','',\
|
||||
'At each move the red runner will always run',\
|
||||
'straight, as far as possible, stopping only when',\
|
||||
"blocked by the grid's edge, a black square, or a",\
|
||||
'square already visited.','',\
|
||||
'http://www.clickmazes.com'
|
||||
end if
|
||||
; Language support for locales: ru_RU (CP866), en_US.
|
||||
|
||||
FH_levelp:
|
||||
mcall 40,100111b
|
||||
call get_xy_sf
|
||||
call erase_field
|
||||
sub esi,2
|
||||
mov [levptr],esi
|
||||
movzx ecx,byte[esi-2]
|
||||
sub ecx,2
|
||||
xor eax,eax
|
||||
.lp:
|
||||
lodsb
|
||||
mov byte[field+eax],-1
|
||||
loop .lp
|
||||
mov dword[player],-1
|
||||
mov [win_flag],3
|
||||
ret
|
||||
|
||||
FH_key:
|
||||
cmp eax,-1
|
||||
je FH_mouse
|
||||
cmp eax,8
|
||||
jne .nobsp
|
||||
cmp [stepptr],0
|
||||
jne .no1st
|
||||
mov [jump],run.game
|
||||
ret
|
||||
.no1st:
|
||||
mov [win_flag],0
|
||||
sub [cur_step],2
|
||||
mov esi,[cur_step]
|
||||
mov edi,[finish]
|
||||
mov eax,3
|
||||
movzx ebx,byte[esi]
|
||||
sub eax,ebx
|
||||
movzx ecx,byte[esi+1]
|
||||
.lp0:
|
||||
and byte[field+edi],0
|
||||
add edi,[dirs+eax*4]
|
||||
loop .lp0
|
||||
mov [finish],edi
|
||||
dec [stepptr]
|
||||
ret
|
||||
.nobsp:
|
||||
cmp eax,176
|
||||
jb .ex
|
||||
cmp eax,179
|
||||
ja .ex
|
||||
sub eax,176
|
||||
jmp FH_mouse.fromkey
|
||||
.ex:
|
||||
ret
|
||||
|
||||
FH_drawm:
|
||||
mov ecx,[cell_count]
|
||||
.lp:
|
||||
push ecx
|
||||
movzx ebx,byte[field+ecx-1]
|
||||
test ebx,ebx
|
||||
jz .no
|
||||
lea eax,[ecx-1]
|
||||
call get_xy
|
||||
mov edx,0
|
||||
cmp ebx,0xf
|
||||
jne .stable
|
||||
mov edx,0x909090
|
||||
.stable:
|
||||
mcall 13,[lx],[ly]
|
||||
.no:
|
||||
pop ecx
|
||||
loop .lp
|
||||
|
||||
mov eax,[player]
|
||||
cmp eax,-1
|
||||
je .ex
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff00
|
||||
mov eax,[finish]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff0000
|
||||
|
||||
mov ecx,[stepptr]
|
||||
jecxz .ex
|
||||
mov ebx,area
|
||||
mov edi,[player]
|
||||
mov edx,0xffffff
|
||||
.lp3:
|
||||
push ecx
|
||||
mov esi,edi
|
||||
movzx eax,byte[ebx]
|
||||
movzx ecx,byte[ebx+1]
|
||||
add ebx,2
|
||||
.lp2:
|
||||
add edi,[dirs+eax*4]
|
||||
loop .lp2
|
||||
call getline
|
||||
pop ecx
|
||||
loop .lp3
|
||||
.ex:
|
||||
ret
|
||||
|
||||
FH_mouse:
|
||||
mov [jump],drw;red
|
||||
call get_last_mclick
|
||||
cmp byte[field+ebx],0
|
||||
jne .ex
|
||||
cmp dword[player],-1
|
||||
jne .nostart
|
||||
mov dword[player],ebx
|
||||
mov byte[field+ebx],0xf
|
||||
mov [finish],ebx
|
||||
and [win_flag],0
|
||||
mov [cur_step],area
|
||||
and [stepptr],0
|
||||
ret
|
||||
.nostart:
|
||||
mov eax,[finish]
|
||||
call get_offset
|
||||
cmp eax,-1
|
||||
je .ex
|
||||
.fromkey:
|
||||
xor ecx,ecx
|
||||
mov edx,eax
|
||||
mov esi,[finish]
|
||||
.lp:
|
||||
add esi,[dirs+edx*4]
|
||||
cmp byte[field+esi],0
|
||||
jnz .exlp
|
||||
mov eax,[finish]
|
||||
mov ebx,esi
|
||||
call get_offset
|
||||
cmp eax,edx
|
||||
jne .exlp
|
||||
mov byte[field+esi],0xf
|
||||
inc ecx
|
||||
mov [finish],esi
|
||||
jmp .lp
|
||||
|
||||
.exlp:
|
||||
jecxz .ex
|
||||
mov eax,edx
|
||||
mov edi,[cur_step]
|
||||
stosb
|
||||
mov [edi],cl
|
||||
inc edi
|
||||
mov [cur_step],edi
|
||||
inc [stepptr]
|
||||
mov edi,field
|
||||
mov ecx,[cell_count]
|
||||
xor eax,eax
|
||||
repne scasb
|
||||
je .ch_deadend
|
||||
mov [win_flag],1
|
||||
.ex:
|
||||
ret
|
||||
.ch_deadend:
|
||||
mov ecx,4
|
||||
mov edx,dirs
|
||||
.lpp:
|
||||
mov eax,[finish]
|
||||
mov ebx,[edx]
|
||||
add ebx,eax
|
||||
push ebx
|
||||
call get_offset
|
||||
pop ebx
|
||||
cmp eax,-1
|
||||
je .nxtlp
|
||||
cmp byte[field+ebx],0
|
||||
jz .ex
|
||||
.nxtlp:
|
||||
add edx,4
|
||||
loop .lpp
|
||||
mov [win_flag],4
|
||||
ret
|
||||
|
||||
FH_level:
|
||||
file 'fhouse.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
FH_help mstr \
|
||||
'В задании найдите начальную клетку и проведите',\
|
||||
'линию, которая проходит через пустые клетки по',\
|
||||
'одному разу.',\
|
||||
' Каждый раз красный квадрат двигается прямо,',\
|
||||
'останавливаясь только у края, перед черными',\
|
||||
'квадратами или уже посещенными клетками.','',\
|
||||
'http://www.clickmazes.com'
|
||||
else ; Default to en_US
|
||||
FH_help mstr \
|
||||
'For each puzzle find the starting square and draw',\
|
||||
'a path moving horizontally and vertically that',\
|
||||
'passes through each open square exactly once.','',\
|
||||
'At each move the red runner will always run',\
|
||||
'straight, as far as possible, stopping only when',\
|
||||
"blocked by the grid's edge, a black square, or a",\
|
||||
'square already visited.','',\
|
||||
'http://www.clickmazes.com'
|
||||
end if
|
||||
@@ -1,245 +1,247 @@
|
||||
LP_levelp:
|
||||
mcall 40,100111b
|
||||
inc [drag_flag]
|
||||
lodsb
|
||||
lodsw
|
||||
mov byte[fx],al
|
||||
mov byte[fy],ah
|
||||
and dword[player],0
|
||||
and dword[finish],0
|
||||
call get_xy_sf.count
|
||||
call erase_field
|
||||
; mov [levptr],esi
|
||||
.bit2:
|
||||
mov edx,8/2
|
||||
mov edi,field
|
||||
lodsb
|
||||
mov ecx,[cell_count]
|
||||
.lp:
|
||||
mov bl,al
|
||||
rol al,2
|
||||
and bl,11000000b
|
||||
mov [edi],bl
|
||||
inc edi
|
||||
dec edx
|
||||
test edx,edx
|
||||
jnz .nxt
|
||||
mov edx,8/2
|
||||
lodsb
|
||||
.nxt:
|
||||
loop .lp
|
||||
ret
|
||||
|
||||
LP_key:
|
||||
cmp eax,0
|
||||
jl LP_mouse
|
||||
cmp eax,8
|
||||
jne .nobsp
|
||||
cmp [stepptr],0
|
||||
jne .no1st
|
||||
mov [jump],run.game
|
||||
ret
|
||||
.no1st:
|
||||
mov [win_flag],0
|
||||
sub [cur_step],2
|
||||
mov esi,[cur_step]
|
||||
mov edi,[finish]
|
||||
mov eax,3
|
||||
movzx ebx,byte[esi]
|
||||
sub eax,ebx
|
||||
movzx ecx,byte[esi+1]
|
||||
.lp0:
|
||||
and byte[field+edi],0
|
||||
add edi,[dirs+eax*4]
|
||||
loop .lp0
|
||||
mov [finish],edi
|
||||
dec [stepptr]
|
||||
ret
|
||||
.nobsp:
|
||||
cmp eax,176
|
||||
jb .ex
|
||||
cmp eax,179
|
||||
ja .ex
|
||||
sub eax,176
|
||||
.ex:
|
||||
ret
|
||||
|
||||
LP_drawm:
|
||||
and [pause_time],0
|
||||
mov ecx,[cell_count]
|
||||
.lp:
|
||||
push ecx
|
||||
mov bl,byte[field+ecx-1]
|
||||
push ebx
|
||||
lea eax,[ecx-1]
|
||||
mov ecx,eax
|
||||
call get_xy
|
||||
|
||||
mov al,bl
|
||||
and al,0xf
|
||||
test bl,11000000b
|
||||
jnz .noempty
|
||||
mov esi,LP_aw
|
||||
mov ecx,11
|
||||
call LP_draw_alert
|
||||
jmp .no
|
||||
.noempty:
|
||||
mov edx,0
|
||||
test bl,10000000b
|
||||
je .stable
|
||||
mov edx,0xffffff
|
||||
mov esi,LP_aw
|
||||
mov ecx,7
|
||||
jmp .d13
|
||||
.stable:
|
||||
mov esi,LP_em
|
||||
mov ecx,9
|
||||
.d13:
|
||||
call LP_draw_alert
|
||||
mcall 13,[lx],[ly]
|
||||
.no:
|
||||
mov esi,[esp+4]
|
||||
dec esi
|
||||
mov edi,esi
|
||||
mov edx,0x0000FF
|
||||
; ecx - cell #
|
||||
test byte[esp],10b
|
||||
je .no_dn
|
||||
add edi,[dirs+4*1]
|
||||
call getline
|
||||
.no_dn:
|
||||
test byte[esp],1000b
|
||||
je .no_right
|
||||
mov edi,esi
|
||||
add edi,[dirs+4*3]
|
||||
call getline
|
||||
.no_right:
|
||||
pop ebx
|
||||
pop ecx
|
||||
.valid:
|
||||
loop .lp2
|
||||
jmp .exlp
|
||||
.lp2:
|
||||
jmp .lp
|
||||
.exlp:
|
||||
|
||||
mov esi,[player]
|
||||
mov edi,[finish]
|
||||
cmp esi,edi
|
||||
je .ex
|
||||
mov edx,0x7777FF
|
||||
call getline
|
||||
.ex:
|
||||
cmp [pause_time],0
|
||||
jne .ex2
|
||||
xor ecx,ecx
|
||||
xor ebx,ebx
|
||||
mov edx,5
|
||||
; eax - cur cell content, ebx - cell #, ecx - cell counter, edx - dir
|
||||
.chwin:
|
||||
movzx eax,byte[field+ebx]
|
||||
and eax,0xf
|
||||
btr eax,edx
|
||||
bsf edx,eax
|
||||
je .ex3
|
||||
inc ecx
|
||||
add ebx,[dirs+edx*4]
|
||||
jz .ex3
|
||||
xor edx,11b
|
||||
jmp .chwin
|
||||
.ex3:
|
||||
cmp ecx,[cell_count]
|
||||
jne .ex2
|
||||
mov [win_flag],1
|
||||
.ex2:
|
||||
ret
|
||||
|
||||
LP_mouse:
|
||||
cmp [win_flag],1
|
||||
je .ex
|
||||
mov [jump],still
|
||||
mov edx,eax
|
||||
call get_last_mclick
|
||||
cmp edx,-2
|
||||
jne .no1st
|
||||
test eax,eax
|
||||
jnz .noempty
|
||||
mov eax,[player]
|
||||
mov ebx,[finish]
|
||||
call get_offset
|
||||
mov ecx,eax
|
||||
mov edx,0x101
|
||||
shl dl,cl
|
||||
xor ecx,11b
|
||||
shl dh,cl
|
||||
mov ecx,ebx
|
||||
jecxz LP_drawm.ex2
|
||||
mov esi,[player]
|
||||
.lp:
|
||||
xor [field+esi],dl
|
||||
add esi,[dirs+eax*4]
|
||||
xor [field+esi],dh
|
||||
loop .lp
|
||||
xor ebx,ebx
|
||||
.noempty:
|
||||
mov [player],ebx
|
||||
jmp .exx
|
||||
.no1st:
|
||||
test eax,eax
|
||||
jz .ex
|
||||
mov eax,[player]
|
||||
push ebx
|
||||
call get_offset
|
||||
pop ebx
|
||||
cmp eax,-1
|
||||
je .ex
|
||||
.exx:
|
||||
mov [finish],ebx
|
||||
mov [jump],drw
|
||||
; ud2
|
||||
.ex:
|
||||
ret
|
||||
|
||||
|
||||
LP_aw db 1001b,0110b
|
||||
LP_em db 0000b,0001b,0010b,0100b,1000b
|
||||
LP_ab db 0011b,0101b,1100b,1010b,1001b,0110b
|
||||
|
||||
LP_draw_alert:
|
||||
; al-cell, esi - ptr,ecx - len
|
||||
.lp:
|
||||
cmp al,[esi]
|
||||
je .ex
|
||||
inc esi
|
||||
loop .lp
|
||||
pusha
|
||||
mov ebx,[lx]
|
||||
mov ecx,[ly]
|
||||
add ebx,4-2 shl 16
|
||||
add ecx,4-2 shl 16
|
||||
mcall 13,,,0xFFAAAA
|
||||
mov [pause_time],eax
|
||||
popa
|
||||
.ex:
|
||||
ret
|
||||
|
||||
LP_level:
|
||||
file 'loops.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
LP_help mstr \
|
||||
'Через все клетки прямоугольника необходимо',\
|
||||
'провести замкнутую ломаную. Проходя через черный',\
|
||||
'кружок, ломаная обязана повернуть, а проходя',\
|
||||
'через белый кружок, ломаная поворачивать не',\
|
||||
'может. В пустых же клетках ломаная ведет себя как',\
|
||||
'захочет.','',\
|
||||
'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 \
|
||||
'Через все клетки прямоугольника необходимо',\
|
||||
'провести замкнутую ломаную. Проходя через черный',\
|
||||
'кружок, ломаная обязана повернуть, а проходя',\
|
||||
'через белый кружок, ломаная поворачивать не',\
|
||||
'может. В пустых же клетках ломаная ведет себя как',\
|
||||
'захочет.','',\
|
||||
'http://puzzleprograms.narod.ru' ; FIXME: Check link works
|
||||
else ; Default to en_US
|
||||
LP_help mstr \
|
||||
'You have to draw a closed line over every grid',\
|
||||
'cell. On black square line must turn, and it must',\
|
||||
'go straight when over white square. The line may',\
|
||||
'behave anyhow elsewhere.','',\
|
||||
'http://puzzleprograms.narod.ru' ; FIXME: Check link works
|
||||
end if
|
||||
@@ -1,138 +1,140 @@
|
||||
; level format
|
||||
; [fx|fy][hole xy][balls #]..[1-red,0-black xy]..[maze walls]
|
||||
|
||||
; internal format
|
||||
; [stepptr]= balls #
|
||||
; [finish]= hole cell
|
||||
; area: ..[1-red,0-black xy].. ( -1 if empty)
|
||||
|
||||
MAR_levelp:
|
||||
call get_xy_sf
|
||||
movzx eax,byte[esi-2]
|
||||
mov [finish],eax
|
||||
movzx ecx,byte[esi-1]
|
||||
mov [stepptr],ecx
|
||||
mov edi,area
|
||||
rep movsb
|
||||
mov [pause_time],10
|
||||
call unpack_level
|
||||
ret
|
||||
|
||||
MAR_key:
|
||||
cmp eax,176
|
||||
jb .ex
|
||||
cmp eax,179
|
||||
ja .ex
|
||||
mov esi,area-1
|
||||
lea ebx,[eax-176]
|
||||
.again:
|
||||
and [cur_step],0
|
||||
mov ecx,[stepptr]
|
||||
.lp:
|
||||
movzx eax,byte[esi+ecx]
|
||||
cmp al,-1
|
||||
je .ex1
|
||||
mov byte[player],al
|
||||
and byte[player],0x80
|
||||
and eax,0x7f
|
||||
call check_move
|
||||
jc .ex1
|
||||
add eax,[dirs+ebx*4]
|
||||
cmp eax,[finish]
|
||||
jne .nohole
|
||||
mov byte[esi+ecx],-1
|
||||
jmp .ex2
|
||||
.nohole:
|
||||
push ecx
|
||||
mov ecx,[stepptr]
|
||||
mov edi,area
|
||||
.lp2:
|
||||
mov dl,[edi]
|
||||
and dl,0x7f
|
||||
cmp al,dl
|
||||
je .exlp2
|
||||
inc edi
|
||||
loop .lp2
|
||||
.exlp2:
|
||||
pop ecx
|
||||
je .ex1
|
||||
or al,byte[player]
|
||||
mov [esi+ecx],al
|
||||
.ex2:
|
||||
inc [cur_step]
|
||||
.ex1:
|
||||
loop .lp
|
||||
cmp [cur_step],0
|
||||
je .exx
|
||||
call delay
|
||||
call drwfld
|
||||
jmp .again
|
||||
.exx:
|
||||
mov ecx,[stepptr]
|
||||
inc esi
|
||||
.lp3:
|
||||
lodsb
|
||||
cmp al,-1
|
||||
je .nxt
|
||||
test al,0x80
|
||||
jne .ex
|
||||
.nxt:
|
||||
loop .lp3
|
||||
mov [win_flag],1
|
||||
.ex:
|
||||
ret
|
||||
|
||||
MAR_drawm:
|
||||
shl [sq_size],1
|
||||
mov eax,[finish]
|
||||
call get_xy
|
||||
shr [sq_size],1
|
||||
mcall 13,[lx],[ly],0xa0a0a0
|
||||
movzx ecx,byte[stepptr]
|
||||
mov edi,area
|
||||
.lp:
|
||||
push ecx
|
||||
movzx eax,byte[edi]
|
||||
mov edx,0x0
|
||||
cmp al,-1
|
||||
je .exlp
|
||||
test eax,0x80
|
||||
je .no
|
||||
mov edx,0xff00000
|
||||
.no:
|
||||
and eax,0x7f
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly]
|
||||
.exlp:
|
||||
pop ecx
|
||||
inc edi
|
||||
loop .lp
|
||||
.ex:
|
||||
ret
|
||||
|
||||
MAR_level:
|
||||
file 'marble.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
MAR_help mstr \
|
||||
'Несколько красных и черных плашек лежат на доске,',\
|
||||
'дырка обозначена серой клеткой. Когда плашка',\
|
||||
'проходит над дыркой, она падает туда и исчезает.',\
|
||||
'Используйте стрелки для наклона доски.',\
|
||||
' Ваша задача - сбросить все красные плашки.',\
|
||||
'Количество упавших черных плашек роли не играет.','',\
|
||||
'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 \
|
||||
'Несколько красных и черных плашек лежат на доске,',\
|
||||
'дырка обозначена серой клеткой. Когда плашка',\
|
||||
'проходит над дыркой, она падает туда и исчезает.',\
|
||||
'Используйте стрелки для наклона доски.',\
|
||||
' Ваша задача - сбросить все красные плашки.',\
|
||||
'Количество упавших черных плашек роли не играет.','',\
|
||||
'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
@@ -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 \
|
||||
'Ваша задача - провести зеленый квадрат к красному',\
|
||||
'без поворота налево и движения назад. Это труднее',\
|
||||
'чем кажется. Внимание: если Вы примете плохое',\
|
||||
'решение, можете попасть в тупик и будете',\
|
||||
'вынуждены начать сначала.','',\
|
||||
'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 \
|
||||
'Ваша задача - провести зеленый квадрат к красному',\
|
||||
'без поворота налево и движения назад. Это труднее',\
|
||||
'чем кажется. Внимание: если Вы примете плохое',\
|
||||
'решение, можете попасть в тупик и будете',\
|
||||
'вынуждены начать сначала.','',\
|
||||
'http://puzzleprograms.narod.ru' ; FIXME: Check link works
|
||||
else ; Default to en_US
|
||||
NLT_help mstr \
|
||||
'Your challenge is to manouvre the green dot to',\
|
||||
'the red square without ever turning left, or',\
|
||||
'making a U-turn. Harder than it looks. Beware, if',\
|
||||
'you make a bad decision in this maze you may get',\
|
||||
'completely stuck and have to restart.','',\
|
||||
'http://www.clickmazes.com' ; FIXME: Why are links different?
|
||||
end if
|
||||
@@ -1,227 +1,229 @@
|
||||
; level format
|
||||
; [fx|fy]..[field cells x2]..[worm_count]..[worm_len][start cell #][body dirs x2]
|
||||
|
||||
; internal format
|
||||
; [stepptr]= worms #
|
||||
; area: [worm_len][start_cell #][end_cell #]..[dirs]..
|
||||
; [cur_step]: dragged worm pointer
|
||||
; [finish]: 0 - if head dragged, 1- if tail
|
||||
|
||||
OR_levelp:
|
||||
mov [Ces],40
|
||||
mcall 40,100111b
|
||||
inc [drag_flag]
|
||||
mov eax,OR_strip
|
||||
call need_image
|
||||
inc esi
|
||||
movzx ecx,byte[esi]
|
||||
inc esi
|
||||
push esi
|
||||
mov esi,OR_maze
|
||||
jecxz .sk
|
||||
.nxtmz:
|
||||
movzx eax,byte[esi]
|
||||
add esi,eax
|
||||
loop .nxtmz
|
||||
.sk:
|
||||
call get_xy_sf
|
||||
call unpack_level
|
||||
pop esi
|
||||
movzx ecx,byte[esi]
|
||||
inc esi
|
||||
mov [cur_step],ecx
|
||||
jecxz .sk2
|
||||
mov edi,area
|
||||
rep movsb
|
||||
.sk2:
|
||||
mov ecx,[cell_count]
|
||||
mov edi,area+16
|
||||
rep movsb
|
||||
mov [stepptr],2
|
||||
; call erase_field
|
||||
; ud2
|
||||
ret
|
||||
|
||||
OR_key:
|
||||
cmp eax,0
|
||||
jl OR_mouse
|
||||
ret
|
||||
|
||||
OR_drawf:
|
||||
mov ecx,[cell_count]
|
||||
push [sq_size]
|
||||
mov [sq_size],0
|
||||
.lp:
|
||||
push ecx
|
||||
movzx ebx,byte[area+16+ecx-1]
|
||||
cmp bl,0xf
|
||||
je .no
|
||||
lea eax,[ecx-1]
|
||||
call out_image
|
||||
.no:
|
||||
pop ecx
|
||||
loop .lp
|
||||
pop [sq_size]
|
||||
ret
|
||||
|
||||
OR_drawm:
|
||||
push [sq_size]
|
||||
mov [sq_size],0
|
||||
mov eax,[player]
|
||||
mov ebx,[stepptr]
|
||||
add ebx,8
|
||||
call out_image
|
||||
mov ecx,[cur_step]
|
||||
jecxz .skipb
|
||||
mov ebx,7
|
||||
mov esi,area
|
||||
xor eax,eax
|
||||
.nxtb:
|
||||
lodsb
|
||||
call out_image
|
||||
loop .nxtb
|
||||
.skipb:
|
||||
mov eax,[player]
|
||||
.again:
|
||||
mov ebx,[stepptr]
|
||||
call check_move
|
||||
jc .ex
|
||||
add eax,[dirs+ebx*4]
|
||||
cmp byte[area+16+eax],6
|
||||
je .ex
|
||||
mov ecx,[cur_step]
|
||||
jecxz .skbchk
|
||||
mov edi,area
|
||||
repne scasb
|
||||
je .again
|
||||
.skbchk:
|
||||
mov [sq_size],1
|
||||
push eax
|
||||
call get_xy
|
||||
mov ebx,[lx]
|
||||
sub bx,2
|
||||
mov ecx,[ly]
|
||||
mov cx,3
|
||||
mcall 13,,,0xFFC633
|
||||
xchg bx,cx
|
||||
mcall
|
||||
mov esi,[Ces]
|
||||
sub esi,3+2
|
||||
shl esi,16
|
||||
push ebx
|
||||
add ebx,esi
|
||||
mcall
|
||||
pop ebx
|
||||
add ecx,esi
|
||||
xchg bx,cx
|
||||
add bx,2
|
||||
mcall
|
||||
pop eax
|
||||
jmp .again
|
||||
.ex:
|
||||
pop [sq_size]
|
||||
ret
|
||||
|
||||
OR_mouse:
|
||||
cmp [win_flag],1
|
||||
je .ex
|
||||
mov [jump],still
|
||||
mov edx,eax
|
||||
call get_last_mclick
|
||||
cmp edx,-2
|
||||
jne .ex
|
||||
test eax,eax
|
||||
jnz .noempty
|
||||
.drw:
|
||||
mov [jump],drw
|
||||
ret
|
||||
.noempty:
|
||||
|
||||
; First Click at ebx cell
|
||||
mov eax,[player]
|
||||
cmp eax,ebx
|
||||
je OR_drawf
|
||||
mov ecx,[cur_step]
|
||||
jecxz .skbchk
|
||||
mov edi,area
|
||||
xchg eax,ebx
|
||||
repne scasb
|
||||
xchg eax,ebx
|
||||
je OR_drawf
|
||||
.skbchk:
|
||||
cmp byte[area+16+ebx],0xf
|
||||
je .ex
|
||||
cmp byte[area+16+ebx],6
|
||||
je .ex
|
||||
push eax
|
||||
mov edx,ebx
|
||||
call get_offset
|
||||
mov ebx,eax
|
||||
pop eax
|
||||
cmp ebx,[stepptr]
|
||||
jne .ex
|
||||
|
||||
call check_move
|
||||
jc .ex
|
||||
movzx ecx,byte[area+16+edx]
|
||||
cmp ecx,4
|
||||
jae .noarr
|
||||
mov ebx,ecx
|
||||
call check_move
|
||||
jc .ex
|
||||
mov edx,eax
|
||||
add eax,[dirs+ebx*4]
|
||||
mov [player],eax
|
||||
mov ecx,[cur_step]
|
||||
jecxz .skbchk2
|
||||
mov edi,area
|
||||
repne scasb
|
||||
jne .skbchk2
|
||||
mov [edi-1],dl
|
||||
.skbchk2:
|
||||
cmp eax,[finish]
|
||||
jne .drw
|
||||
mov [win_flag],1
|
||||
jmp .drw
|
||||
.noarr:
|
||||
mov edx,[stepptr]
|
||||
cmp ecx,4
|
||||
jne .nocw
|
||||
movzx edx,byte[dir_rotate+edx]
|
||||
jmp .ex2
|
||||
.nocw:
|
||||
cmp ecx,5
|
||||
jne .ex
|
||||
movzx edx,byte[dir_rotate+4+edx]
|
||||
.ex2:
|
||||
mov [stepptr],edx
|
||||
jmp .drw
|
||||
.ex:
|
||||
ret
|
||||
|
||||
OR_maze:
|
||||
file 'omaze.bin'
|
||||
|
||||
OR_level:
|
||||
file 'or2.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
OR_help mstr \
|
||||
'Щелчок на выделенной клетке передвигает или',\
|
||||
'вращает красную стрелку. Синий блок действует',\
|
||||
'как препятствие, скрывая одну клетку. При',\
|
||||
'переходе стрелки на клетку синего блока они',\
|
||||
'поменяются местами. Задача - провести красную',\
|
||||
'стрелку из нижней клетки в верхнюю.','',\
|
||||
'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 \
|
||||
'Щелчок на выделенной клетке передвигает или',\
|
||||
'вращает красную стрелку. Синий блок действует',\
|
||||
'как препятствие, скрывая одну клетку. При',\
|
||||
'переходе стрелки на клетку синего блока они',\
|
||||
'поменяются местами. Задача - провести красную',\
|
||||
'стрелку из нижней клетки в верхнюю.','',\
|
||||
'http://www.clickmazes.com' ; FIXME: Check link works
|
||||
else ; Default to en_US
|
||||
OR_help mstr \
|
||||
'Click on a highlighted square to move or rotate',\
|
||||
'the red pointer. The blue switcher acts as an',\
|
||||
'obstacle, hiding one square. The red pointer and',\
|
||||
'blue switcher will swap places if the red pointer',\
|
||||
'is pushed onto a square occupied by a blue',\
|
||||
'switcher. Your challenge is to negotiate the red',\
|
||||
'arrow from the bottom to the top square.','',\
|
||||
'http://www.clickmazes.com' ; FIXME: Check link works
|
||||
end if
|
||||
@@ -1,94 +1,96 @@
|
||||
SMZ_levelp:
|
||||
call get_xy_sf
|
||||
xor eax,eax
|
||||
mov [stepptr],esi
|
||||
lodsb
|
||||
mov [cur_step],esi
|
||||
add esi,eax
|
||||
mov [levptr],esi
|
||||
call unpack_level
|
||||
ret
|
||||
|
||||
SMZ_key:
|
||||
cmp eax,176
|
||||
jb .ex
|
||||
cmp eax,179
|
||||
ja .ex
|
||||
mov ecx,[cur_step]
|
||||
movzx ecx,byte[ecx]
|
||||
lea ebx,[eax-176]
|
||||
mov eax,[player]
|
||||
.lp:
|
||||
call check_move
|
||||
jc .exl
|
||||
add eax,[dirs+ebx*4]
|
||||
loop .lp
|
||||
.exl:
|
||||
test ecx,ecx
|
||||
jne .ex
|
||||
mov [player],eax
|
||||
cmp eax,[finish]
|
||||
jne .nowin
|
||||
mov [win_flag],1
|
||||
.nowin:
|
||||
mov esi,[stepptr]
|
||||
movzx eax,byte[esi]
|
||||
inc esi
|
||||
lea ebx,[esi+eax]
|
||||
inc [cur_step]
|
||||
cmp [cur_step],ebx
|
||||
jb .ex
|
||||
mov [cur_step],esi
|
||||
.ex:
|
||||
ret
|
||||
|
||||
SMZ_drawm:
|
||||
mov eax,[player]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff00
|
||||
mov eax,[finish]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff0000
|
||||
cmp [win_flag],1
|
||||
je .ex
|
||||
mov edi,[stepptr]
|
||||
movzx ecx,byte[edi]
|
||||
inc edi
|
||||
mov edx,(XFOFS+MSGXO) shl 16+42
|
||||
mov ebx,0x010000
|
||||
mov eax,47
|
||||
.lp:
|
||||
push ecx
|
||||
mov esi,0x10000000
|
||||
movzx ecx,byte[edi]
|
||||
cmp edi,[cur_step]
|
||||
jne .nocur
|
||||
mov esi,0x100000ff
|
||||
mcall
|
||||
add edx,1 shl 16
|
||||
.nocur:
|
||||
mcall
|
||||
pop ecx
|
||||
add edx,10 shl 16
|
||||
inc edi
|
||||
loop .lp
|
||||
.ex:
|
||||
ret
|
||||
|
||||
SMZ_level:
|
||||
file 'smz.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
SMZ_help mstr \
|
||||
'Повторяйте последовательность ходов, двигая',\
|
||||
'зеленый квадрат на подсвеченное количество клеток',\
|
||||
'по прямой, пока не достигнете красного квадрата.','',\
|
||||
'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 \
|
||||
'Повторяйте последовательность ходов, двигая',\
|
||||
'зеленый квадрат на подсвеченное количество клеток',\
|
||||
'по прямой, пока не достигнете красного квадрата.','',\
|
||||
'http://puzzleprograms.narod.ru' ; FIXME: Check link works
|
||||
else ; Default to en_US
|
||||
SMZ_help mstr \
|
||||
'Repeat sequence shown above the field moving the',\
|
||||
'green square by highlighted count of spaces as',\
|
||||
'many times as you like, until you finish at the',\
|
||||
'red square.','',\
|
||||
'http://puzzleprograms.narod.ru' ; FIXME: Check link works
|
||||
end if
|
||||
@@ -1,164 +1,166 @@
|
||||
TM_levelp:
|
||||
call get_xy_sf
|
||||
mov [levptr],esi
|
||||
call unpack_level
|
||||
ret
|
||||
|
||||
TM_key:
|
||||
cmp eax,' '
|
||||
je .mm
|
||||
cmp eax,176
|
||||
jb .still
|
||||
cmp eax,179
|
||||
ja .still
|
||||
lea ebx,[eax-176]
|
||||
mov eax,[teseus]
|
||||
call check_move
|
||||
jc .still
|
||||
call move_teseus
|
||||
cmp [win_flag],0
|
||||
jne .ex
|
||||
.nowin:
|
||||
call drwfld
|
||||
.mm:
|
||||
call move_minotaur
|
||||
cmp eax,[teseus]
|
||||
jne .still
|
||||
mov [win_flag],2
|
||||
jmp .ex
|
||||
.still:
|
||||
mov [jump],still
|
||||
.ex:
|
||||
ret
|
||||
|
||||
move_minotaur:
|
||||
xor esi,esi
|
||||
mov eax,[teseus]
|
||||
mov ebx,[fx]
|
||||
div bl
|
||||
mov ecx,eax ;teseus: ch-x, cl-y
|
||||
mov eax,[minotaur]
|
||||
.again:
|
||||
call mino_xy
|
||||
xor ebx,ebx
|
||||
cmp dh,ch
|
||||
je .stand2
|
||||
ja .ok1
|
||||
add ebx,3
|
||||
.ok1:
|
||||
call check_move
|
||||
jc .stand2
|
||||
add eax,[dirs+ebx*4]
|
||||
mov [minotaur],eax
|
||||
inc esi
|
||||
call delay
|
||||
call drwfld
|
||||
cmp esi,2
|
||||
jb .again
|
||||
jmp .ex
|
||||
.stand1:
|
||||
call mino_xy
|
||||
.stand2:
|
||||
mov ebx,2
|
||||
cmp dl,cl
|
||||
je .ex
|
||||
ja .ok2
|
||||
dec ebx
|
||||
.ok2:
|
||||
call check_move
|
||||
jc .ex
|
||||
add eax,[dirs+ebx*4]
|
||||
mov [minotaur],eax
|
||||
inc esi
|
||||
call delay
|
||||
call drwfld
|
||||
cmp esi,2
|
||||
jb .again
|
||||
.ex:
|
||||
ret
|
||||
|
||||
mino_xy:
|
||||
push eax
|
||||
div byte[fx]
|
||||
mov edx,eax ;minotaur: dh-x, dl-y
|
||||
pop eax
|
||||
ret
|
||||
|
||||
move_teseus:
|
||||
pusha
|
||||
cdq
|
||||
mov ecx,[fx]
|
||||
div cl
|
||||
add ax,1 shl 8+1
|
||||
test ebx,ebx
|
||||
jne .no0
|
||||
cmp ah,1
|
||||
jne .move
|
||||
.win:
|
||||
inc [win_flag]
|
||||
jmp .ex
|
||||
.no0:
|
||||
cmp ebx,1
|
||||
jne .no1
|
||||
cmp al,byte[fy]
|
||||
je .win
|
||||
jmp .move
|
||||
.no1:
|
||||
cmp ebx,2
|
||||
jne .no2
|
||||
cmp al,1
|
||||
je .win
|
||||
jmp .move
|
||||
.no2:
|
||||
cmp ebx,3
|
||||
jne .move
|
||||
cmp ah,byte[fx]
|
||||
je .win
|
||||
.move:
|
||||
mov eax,[esp+28]
|
||||
add eax,[dirs+ebx*4]
|
||||
mov [teseus],eax
|
||||
.ex:
|
||||
popa
|
||||
ret
|
||||
|
||||
TM_drawm:
|
||||
mov eax,[teseus]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff00
|
||||
mov eax,[minotaur]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff0000
|
||||
ret
|
||||
|
||||
TM_level:
|
||||
file 'tam.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
TM_help mstr \
|
||||
' Тесей (зеленый квадрат) должен убежать из',\
|
||||
'лабиринта. За ним гонится механический Минотавр',\
|
||||
'(красный квадрат). На каждый ход Тесей Минотавр',\
|
||||
'делает 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 \
|
||||
' Тесей (зеленый квадрат) должен убежать из',\
|
||||
'лабиринта. За ним гонится механический Минотавр',\
|
||||
'(красный квадрат). На каждый ход Тесей Минотавр',\
|
||||
'делает 2 хода по такой схеме:',\
|
||||
' Сначала он пытается приблизиться к Тесею по',\
|
||||
'горизонтали на 1 квадрат. Если это невозможно,',\
|
||||
'он пытается подойти по вертикали на 1 квадрат.',\
|
||||
'Если невозможно сделать ни того, ни другого,',\
|
||||
'Минотавр пропускает данный ход.','',\
|
||||
'http://puzzleprograms.narod.ru' ; FIXME: Check link works
|
||||
else ; Default to en_US
|
||||
TM_help mstr \
|
||||
' Theseus (the green dot) must escape from a maze.',\
|
||||
'There is also a mechanical Minotaur (the red',\
|
||||
'dot) in each maze. For every turn that Theseus',\
|
||||
'takes, the Minotaur takes two turns.',\
|
||||
' Each turn he decides following:',\
|
||||
'First he tests if he can move horizontally and',\
|
||||
'get closer to Theseus. If he can, he will move',\
|
||||
"one square horizontally. If he can't, he will",\
|
||||
'test if he could move vertically and get closer',\
|
||||
'to Theseus. If he can, he will move one square',\
|
||||
"vertically. If he can't move either horizontally",\
|
||||
'or vertically, then he just skips that turn.','',\
|
||||
'http://puzzleprograms.narod.ru' ; FIXME: Check link works
|
||||
end if
|
||||
@@ -1,93 +1,95 @@
|
||||
TILT_levelp:
|
||||
call SMZ_levelp
|
||||
mov esi,[stepptr]
|
||||
movzx ecx,byte[esi]
|
||||
mov [finish],ecx
|
||||
inc ecx
|
||||
mov edi,area
|
||||
rep movsb
|
||||
mov [pause_time],10
|
||||
ret
|
||||
|
||||
TILT_key:
|
||||
cmp eax,176
|
||||
jb .ex
|
||||
cmp eax,179
|
||||
ja .ex
|
||||
mov esi,area
|
||||
inc esi
|
||||
lea ebx,[eax-176]
|
||||
mov eax,[player]
|
||||
.lp:
|
||||
call check_move
|
||||
jc .ex1
|
||||
add eax,[dirs+ebx*4]
|
||||
movzx ecx,byte[esi-1]
|
||||
mov edi,esi
|
||||
repne scasb
|
||||
jne .notfound
|
||||
mov byte[edi-1],0xff
|
||||
dec dword[finish]
|
||||
.notfound:
|
||||
mov [player],eax
|
||||
call delay
|
||||
call drwfld
|
||||
jmp .lp
|
||||
.ex1:
|
||||
cmp dword[finish],0
|
||||
jnz .ex
|
||||
mov [win_flag],1
|
||||
.ex:
|
||||
ret
|
||||
|
||||
TILT_drawm:
|
||||
mov eax,[player]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff00
|
||||
cmp [win_flag],1
|
||||
je .ex
|
||||
mov edi,area
|
||||
movzx ecx,byte[edi]
|
||||
jecxz .ex
|
||||
inc edi
|
||||
.lp:
|
||||
push ecx
|
||||
movzx eax,byte[edi]
|
||||
cmp eax,0xff
|
||||
je .no
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff0000
|
||||
.no:
|
||||
pop ecx
|
||||
inc edi
|
||||
loop .lp
|
||||
.ex:
|
||||
ret
|
||||
|
||||
TILT_level:
|
||||
file 'tilt.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
TILT_help mstr \
|
||||
'Плашка (зеленый квадрат) лежит на доске, которую',\
|
||||
'можно наклонять по горизонтали и вертикали',\
|
||||
' После наклона плашка скользит, пока не наткнется',\
|
||||
'на стенку. Нельзя остановить плашку во середине',\
|
||||
'пути.',\
|
||||
' Ваша задача - заставить плашку посетить клетки',\
|
||||
'с красными квадратами.','',\
|
||||
'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 \
|
||||
'Плашка (зеленый квадрат) лежит на доске, которую',\
|
||||
'можно наклонять по горизонтали и вертикали',\
|
||||
' После наклона плашка скользит, пока не наткнется',\
|
||||
'на стенку. Нельзя остановить плашку во середине',\
|
||||
'пути.',\
|
||||
' Ваша задача - заставить плашку посетить клетки',\
|
||||
'с красными квадратами.','',\
|
||||
'http://www.clickmazes.com'
|
||||
else ; Default to en_US
|
||||
TILT_help mstr \
|
||||
'You are to imagine that a marble (shown here as a',\
|
||||
'green square) is on a board that you can tilt',\
|
||||
'only to the north, south, east, or west. (You',\
|
||||
"can't do anything tricky like tilt it southeast.)",\
|
||||
' Once you tilt the board, the marble will roll',\
|
||||
'(horizontally or vertically) until it hits a',\
|
||||
"barrier. There's no way you can stop the marble",\
|
||||
'in the middle of its roll.',\
|
||||
' The object is to roll the marble onto or over',\
|
||||
'every red square in the maze.','',\
|
||||
'http://www.clickmazes.com'
|
||||
end if
|
||||
@@ -1,105 +1,107 @@
|
||||
; level format
|
||||
; [fx|fy][blue xy][red xy][blue point xy][red point xy]..[maze walls]
|
||||
|
||||
; internal format
|
||||
; points db=[stepptr]
|
||||
; [player]= blue
|
||||
; [finish]= red
|
||||
; area: ..[1-red,0-black xy].. ( -1 if empty)
|
||||
|
||||
TILT2_levelp:
|
||||
call get_xy_sf
|
||||
mov [stepptr],esi
|
||||
add esi,2
|
||||
call unpack_level
|
||||
mov [pause_time],10
|
||||
ret
|
||||
|
||||
TILT2_key:
|
||||
cmp eax,176
|
||||
jb .ex
|
||||
cmp eax,179
|
||||
ja .ex
|
||||
mov esi,area
|
||||
inc esi
|
||||
lea ebx,[eax-176]
|
||||
.lp:
|
||||
xor edx,edx
|
||||
mov eax,[player]
|
||||
call check_move
|
||||
jc .nom1
|
||||
inc edx
|
||||
add eax,[dirs+ebx*4]
|
||||
mov [player],eax
|
||||
.nom1:
|
||||
mov eax,[finish]
|
||||
call check_move
|
||||
jc .nom2
|
||||
inc edx
|
||||
add eax,[dirs+ebx*4]
|
||||
mov [finish],eax
|
||||
.nom2:
|
||||
test edx,edx
|
||||
jz .ex1
|
||||
call delay
|
||||
call drwfld
|
||||
jmp .lp
|
||||
.ex1:
|
||||
mov eax,[finish]
|
||||
cmp eax,[player]
|
||||
jnz .ex2
|
||||
mov [win_flag],2
|
||||
jmp TILT2_drawm.skip
|
||||
.ex2:
|
||||
mov esi,[stepptr]
|
||||
cmp al,[esi+1]
|
||||
jne .ex
|
||||
mov eax,[player]
|
||||
cmp al,[esi]
|
||||
jne .ex
|
||||
mov [win_flag],1
|
||||
.ex:
|
||||
ret
|
||||
|
||||
TILT2_drawm:
|
||||
cmp [win_flag],2
|
||||
je .skip
|
||||
; mov [sq_size],3
|
||||
mov eax,[player]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff
|
||||
mov eax,[finish]
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff0000
|
||||
.skip:
|
||||
shl [sq_size],1
|
||||
mov esi,[stepptr]
|
||||
lodsb
|
||||
call get_xy
|
||||
mcall 13,[lx],[ly],0xff
|
||||
lodsb
|
||||
call get_xy
|
||||
shr [sq_size],1
|
||||
mcall 13,[lx],[ly],0xff0000
|
||||
ret
|
||||
|
||||
TILT2_level:
|
||||
file 'tilt2.bin'
|
||||
|
||||
if lang eq ru_RU
|
||||
TILT2_help mstr \
|
||||
'Красный и синий блоки должны достичь клеток',\
|
||||
'соответствующего цвета. Внимание! Блоки сделаны',\
|
||||
'из агрессивного материала, и при столкновении',\
|
||||
'мгновенно испаряются. В этом случае Вам придется',\
|
||||
'начать уровень сначала.','',\
|
||||
'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 \
|
||||
'Красный и синий блоки должны достичь клеток',\
|
||||
'соответствующего цвета. Внимание! Блоки сделаны',\
|
||||
'из агрессивного материала, и при столкновении',\
|
||||
'мгновенно испаряются. В этом случае Вам придется',\
|
||||
'начать уровень сначала.','',\
|
||||
'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
|
||||
@@ -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',\
|
||||
|
||||
+612
-609
File diff suppressed because it is too large.
Load diff
@@ -456,10 +456,10 @@ is_dn1 dd 0x0 ; |
|
||||
is_up2 dd 0x0 ; |
|
||||
is_dn2 dd 0x0 ; /
|
||||
|
||||
include "lang.inc"
|
||||
include "lang.inc" ; Language support for locales: ru_RU (CP866), en_US.
|
||||
if lang eq ru_RU
|
||||
include "russian.inc"
|
||||
else
|
||||
else ; Default to en_US
|
||||
include "english.inc"
|
||||
end if
|
||||
|
||||
|
||||
+1144
-1144
File diff suppressed because it is too large.
Load diff
@@ -1,241 +1,242 @@
|
||||
; SQ_game for MenuetOS
|
||||
; Author: Alexei Ershov aka ealex
|
||||
; E-mail: e-al[at]yandex[dot]ru
|
||||
; Fidonet: 2:469/335.38
|
||||
; slightly updated by leency and renamed to Lights
|
||||
; https://en.wikipedia.org/wiki/Lights_Out_(game)
|
||||
; slightly optimized by diamond
|
||||
; english translation by diamond (two strings in end of source)
|
||||
|
||||
|
||||
BtnSize equ 36 ; размер кнопки
|
||||
BtnSpace equ 0 ; промежуток между кнопками
|
||||
NofBtn equ 4 ; размер поля (3-15)
|
||||
Color1 equ 0xcc0000
|
||||
Color2 equ 0x00cc00
|
||||
|
||||
FieldSize = (BtnSize+BtnSpace)*NofBtn + BtnSpace*3
|
||||
center = FieldSize / 2
|
||||
margin = 20
|
||||
|
||||
|
||||
use32 ; включить 32-битный режим ассемблера
|
||||
org 0x0 ; адресация с нуля
|
||||
|
||||
db 'MENUET01' ; 8-байтный идентификатор MenuetOS
|
||||
dd 0x01 ; версия заголовка (всегда 1)
|
||||
dd START ; адрес первой команды
|
||||
dd I_END ; размер программы
|
||||
dd 0x1000 ; количество памяти
|
||||
dd 0x1000 ; адрес вершины стэка
|
||||
dd 0x0 ; адрес буфера для параметров (не используется)
|
||||
dd 0x0 ; зарезервировано
|
||||
|
||||
include '../../../macros.inc' ; макросы облегчают жизнь ассемблерщиков!
|
||||
|
||||
|
||||
START:
|
||||
call Game_Init
|
||||
red:
|
||||
call Draw_Window
|
||||
|
||||
still:
|
||||
mcall 10 ; функция 10 - ждать события
|
||||
dec eax
|
||||
jz red
|
||||
dec eax
|
||||
jnz button
|
||||
|
||||
key: ; нажата клавиша на клавиатуре
|
||||
mov al, 2
|
||||
int 0x40
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
button:
|
||||
mov al, 17 ; 17 - получить идентификатор нажатой кнопки
|
||||
int 0x40
|
||||
cmp ah, 1 ; если нажата кнопка с номером 1, выходим
|
||||
je .exit
|
||||
|
||||
cmp ah, 2 ; если нажата кнопка 2, начинаем новую игру
|
||||
je START
|
||||
|
||||
; Нажа кнопка на поле
|
||||
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 'Новая игра',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
|
||||
|
||||
; Нажа кнопка на поле
|
||||
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 'Новая игра',0
|
||||
else ; Default to en_US
|
||||
strMovs db 'MOVE',0
|
||||
strNew db ' New game',0
|
||||
end if
|
||||
|
||||
|
||||
|
||||
I_END: ; метка конца программы
|
||||
+1162
-1162
File diff suppressed because it is too large.
Load diff
+1372
-1372
File diff suppressed because it is too large.
Load diff
+185
-184
@@ -1,184 +1,185 @@
|
||||
;
|
||||
; Макросы для декодирования изображений чрез функции библиотеки libimg.
|
||||
;
|
||||
; (1) макрос load_image_file:
|
||||
;
|
||||
; Проверяет размер полученного файла с изображением.
|
||||
; Выделяет под него память и загружает туда файл.
|
||||
; Определяет размер памяти необходимой для распаковки изображения.
|
||||
; Перевыделяет память, и распаковывает изображение из форматов jpg, png, ...
|
||||
; в формат rgb который можно выводить на экран через сист. функцию.
|
||||
; При необходимости можно также получить размеры открываемого изображения для
|
||||
; их дальнейшего использования в программе.
|
||||
;
|
||||
; В использующей программе должна быть подключена библиотека libimg,
|
||||
; объявлена переменная file_name размером около 4096 байт,
|
||||
; а также структура run_file_70 типа FileInfoBlock.
|
||||
;
|
||||
; (2) макрос include_image_file:
|
||||
;
|
||||
; Внедряет изображение в файл программы.
|
||||
; Определяет размер памяти необходимой для распаковки изображения.
|
||||
; Выделяет память, и распаковывает изображение из форматов jpg, png, ...
|
||||
; в формат rgb который можно выводить на экран через сист. функцию.
|
||||
; При необходимости можно также получить размеры внедренного изображения для
|
||||
; их дальнейшего использования в программе.
|
||||
|
||||
; подключение некоторых необходимых файлов:
|
||||
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:
|
||||
;
|
||||
; Проверяет размер полученного файла с изображением.
|
||||
; Выделяет под него память и загружает туда файл.
|
||||
; Определяет размер памяти необходимой для распаковки изображения.
|
||||
; Перевыделяет память, и распаковывает изображение из форматов jpg, png, ...
|
||||
; в формат rgb который можно выводить на экран через сист. функцию.
|
||||
; При необходимости можно также получить размеры открываемого изображения для
|
||||
; их дальнейшего использования в программе.
|
||||
;
|
||||
; В использующей программе должна быть подключена библиотека libimg,
|
||||
; объявлена переменная file_name размером около 4096 байт,
|
||||
; а также структура run_file_70 типа FileInfoBlock.
|
||||
;
|
||||
; (2) макрос include_image_file:
|
||||
;
|
||||
; Внедряет изображение в файл программы.
|
||||
; Определяет размер памяти необходимой для распаковки изображения.
|
||||
; Выделяет память, и распаковывает изображение из форматов jpg, png, ...
|
||||
; в формат rgb который можно выводить на экран через сист. функцию.
|
||||
; При необходимости можно также получить размеры внедренного изображения для
|
||||
; их дальнейшего использования в программе.
|
||||
|
||||
; подключение некоторых необходимых файлов:
|
||||
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
+913
-913
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,395 +1,397 @@
|
||||
align 4
|
||||
set_rect_window:
|
||||
mov ebx,set_rect_window_procinfo
|
||||
call get_slot_n
|
||||
|
||||
mov [set_rect_window_slot],ecx
|
||||
|
||||
set_events_mask (evm_redraw+evm_key+evm_button+evm_mouse)
|
||||
call init_rect
|
||||
edit_boxes_set_sys_color rect_input,rect_input_end,sc
|
||||
.red:
|
||||
labels_set_sys_color rect_input_labels,rect_input_labels_end,sc
|
||||
check_boxes_set_sys_color2 riw_check_boxes,riw_check_boxes_end,sc
|
||||
call .draw_window
|
||||
align 4
|
||||
.still:
|
||||
wait_event .red,.key,.button,.mouse
|
||||
|
||||
.key:
|
||||
get_key
|
||||
|
||||
stdcall [edit_box_key], rect_input.left
|
||||
stdcall [edit_box_key], rect_input.top
|
||||
stdcall [edit_box_key], rect_input.width
|
||||
stdcall [edit_box_key], rect_input.height
|
||||
|
||||
call read_rect
|
||||
call draw_rect_on_screen
|
||||
|
||||
jmp .still
|
||||
|
||||
.button:
|
||||
get_pressed_button
|
||||
|
||||
cmp ah,1
|
||||
jne @f
|
||||
btr dword [flags],3
|
||||
jmp close
|
||||
@@:
|
||||
|
||||
jmp .still
|
||||
|
||||
.mouse:
|
||||
get_active_window
|
||||
cmp eax,[set_rect_window_slot]
|
||||
jne .still
|
||||
|
||||
stdcall [edit_box_mouse], rect_input.left
|
||||
stdcall [edit_box_mouse], rect_input.top
|
||||
stdcall [edit_box_mouse], rect_input.width
|
||||
stdcall [edit_box_mouse], rect_input.height
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;
|
||||
stdcall [check_box_mouse], use_rect_active_window
|
||||
|
||||
jmp .still
|
||||
|
||||
align 4
|
||||
.draw_window:
|
||||
start_draw_window
|
||||
|
||||
mov edx,[sc.work]
|
||||
add edx,0x33000000
|
||||
mov edi,riw_grab_text
|
||||
xor esi,esi
|
||||
mcall SF_CREATE_WINDOW, 100*65536+250, 100*65536+130
|
||||
|
||||
draw_labels rect_input_labels,rect_input_labels_end
|
||||
|
||||
stdcall [edit_box_draw], rect_input.left
|
||||
stdcall [edit_box_draw], rect_input.top
|
||||
stdcall [edit_box_draw], rect_input.width
|
||||
stdcall [edit_box_draw], rect_input.height
|
||||
;;;;;;;;;;;;;;;;;;;;;;
|
||||
stdcall [check_box_draw], use_rect_active_window
|
||||
|
||||
call read_rect
|
||||
call draw_rect_on_screen
|
||||
|
||||
stop_draw_window
|
||||
ret
|
||||
|
||||
align 4
|
||||
init_rect:
|
||||
bt dword [use_rect_active_window.flags],1
|
||||
jc init_rect_from_active_window
|
||||
pushad
|
||||
mov edi,rect_input_buffer.left
|
||||
movsx eax,word[rect.left]
|
||||
mov ecx,rect_input.left
|
||||
call init_editbox
|
||||
mov edi,rect_input_buffer.top
|
||||
movsx eax,word[rect.top]
|
||||
mov ecx,rect_input.top
|
||||
call init_editbox
|
||||
mov edi,rect_input_buffer.width
|
||||
movsx eax,word[rect.width]
|
||||
mov ecx,rect_input.width
|
||||
call init_editbox
|
||||
mov edi,rect_input_buffer.height
|
||||
movsx eax,word[rect.height]
|
||||
mov ecx,rect_input.height
|
||||
call init_editbox
|
||||
popad
|
||||
ret
|
||||
|
||||
align 4
|
||||
init_rect_from_active_window:
|
||||
|
||||
ret
|
||||
|
||||
align 4
|
||||
init_editbox:
|
||||
push edi
|
||||
push ecx
|
||||
xor ebx,ebx
|
||||
inc ebx
|
||||
cmp eax,10
|
||||
jl @f
|
||||
inc ebx
|
||||
@@:
|
||||
cmp eax,100
|
||||
jl @f
|
||||
inc ebx
|
||||
@@:
|
||||
cmp eax,1000
|
||||
jl @f
|
||||
inc ebx
|
||||
@@:
|
||||
call int_to_str
|
||||
call [edit_box_set_text] ;ecx,edi
|
||||
ret
|
||||
;--------------------------------------------------------------------
|
||||
;--- Считывание области ---------------------------------------------
|
||||
;--------------------------------------------------------------------
|
||||
align 4
|
||||
read_rect:
|
||||
bt dword [use_rect_active_window.flags],1
|
||||
jc read_rect_from_active_window
|
||||
|
||||
mov edi,rect_input_buffer.left
|
||||
call zstr_to_int
|
||||
cmp ax,[scr.width]
|
||||
jb @f
|
||||
mov ax,[scr.width]
|
||||
@@:
|
||||
mov [rect.left],ax
|
||||
|
||||
mov edi,rect_input_buffer.top
|
||||
call zstr_to_int
|
||||
cmp ax,[scr.height]
|
||||
jb @f
|
||||
mov ax,[scr.height]
|
||||
@@:
|
||||
mov [rect.top],ax
|
||||
|
||||
mov edi,rect_input_buffer.width
|
||||
call zstr_to_int
|
||||
mov bx,[scr.width]
|
||||
sub bx,[rect.left]
|
||||
cmp ax,bx
|
||||
jb @f
|
||||
mov ax,bx
|
||||
@@:
|
||||
mov [rect.width],ax
|
||||
|
||||
mov edi,rect_input_buffer.height
|
||||
call zstr_to_int
|
||||
mov bx,[scr.height]
|
||||
sub bx,[rect.top]
|
||||
cmp ax,bx
|
||||
jb @f
|
||||
mov ax,bx
|
||||
@@:
|
||||
mov [rect.height],ax
|
||||
ret
|
||||
|
||||
align 4
|
||||
read_rect_from_active_window:
|
||||
call get_active_window_info
|
||||
|
||||
mov eax,[active_app.left]
|
||||
mov [rect.left],ax
|
||||
mov eax,[active_app.top]
|
||||
mov [rect.top],ax
|
||||
mov eax,[active_app.width]
|
||||
inc eax
|
||||
mov [rect.width],ax
|
||||
mov eax,[active_app.height]
|
||||
inc eax
|
||||
mov [rect.height],ax
|
||||
ret
|
||||
|
||||
align 4
|
||||
draw_rect_on_screen:
|
||||
|
||||
xor edx,edx
|
||||
mcall SF_DRAW_RECT, 150*65536+80, 5*65536+60
|
||||
|
||||
;movzx eax,word [rect.left]
|
||||
;mul word [scr.width]
|
||||
xor edx,edx
|
||||
movzx eax,word [scr.width]
|
||||
mov ebx,80
|
||||
div ebx
|
||||
mov ebx,eax
|
||||
|
||||
xor edx,edx
|
||||
movzx eax,word [rect.height]
|
||||
div ebx
|
||||
push ax
|
||||
|
||||
xor edx,edx
|
||||
movzx eax,word [rect.width]
|
||||
div ebx
|
||||
push ax
|
||||
|
||||
xor edx,edx
|
||||
movzx eax,word [rect.top]
|
||||
div ebx
|
||||
push ax
|
||||
|
||||
xor edx,edx
|
||||
movzx eax,word [rect.left]
|
||||
div ebx
|
||||
push ax
|
||||
|
||||
pop bx
|
||||
add bx,150
|
||||
shl ebx,16
|
||||
|
||||
pop cx
|
||||
add cx,5
|
||||
shl ecx,16
|
||||
|
||||
pop bx
|
||||
pop cx
|
||||
|
||||
mcall SF_DRAW_RECT,,,0xffffff
|
||||
ret
|
||||
|
||||
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
;DATA данные
|
||||
|
||||
system_dir_Boxlib db '/sys/lib/box_lib.obj',0
|
||||
system_dir_ProcLib db '/sys/lib/proc_lib.obj',0
|
||||
system_dir_LibImg db '/sys/lib/libimg.obj',0
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
ProcLib_import:
|
||||
OpenDialog_Init dd aOpenDialog_Init
|
||||
OpenDialog_Start dd aOpenDialog_Start
|
||||
;OpenDialog__Version dd aOpenDialog_Version
|
||||
dd 0,0
|
||||
aOpenDialog_Init db 'OpenDialog_init',0
|
||||
aOpenDialog_Start db 'OpenDialog_start',0
|
||||
;aOpenDialog_Version db 'Version_OpenDialog',0
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
Box_lib_import:
|
||||
;init_lib dd a_init
|
||||
;version_lib dd a_version
|
||||
|
||||
edit_box_draw dd aEdit_box_draw
|
||||
edit_box_key dd aEdit_box_key
|
||||
edit_box_mouse dd aEdit_box_mouse
|
||||
edit_box_set_text dd aEdit_box_set_text
|
||||
;version_ed dd aVersion_ed
|
||||
|
||||
init_checkbox dd aInit_checkbox
|
||||
check_box_draw dd aCheck_box_draw
|
||||
check_box_mouse dd aCheck_box_mouse
|
||||
;version_ch dd aVersion_ch
|
||||
|
||||
option_box_draw dd aOption_box_draw
|
||||
option_box_mouse dd aOption_box_mouse
|
||||
;version_op dd aVersion_op
|
||||
|
||||
PathShow_prepare dd sz_PathShow_prepare
|
||||
PathShow_draw dd sz_PathShow_draw
|
||||
;Version_path_show dd szVersion_path_show
|
||||
dd 0,0
|
||||
|
||||
;a_init db 'lib_init',0
|
||||
;a_version db 'version',0
|
||||
|
||||
aEdit_box_draw db 'edit_box_draw',0
|
||||
aEdit_box_key db 'edit_box_key',0
|
||||
aEdit_box_mouse db 'edit_box_mouse',0
|
||||
aEdit_box_set_text db 'edit_box_set_text',0
|
||||
;aVersion_ed db 'version_ed',0
|
||||
|
||||
|
||||
aInit_checkbox db 'init_checkbox2',0
|
||||
aCheck_box_draw db 'check_box_draw2',0
|
||||
aCheck_box_mouse db 'check_box_mouse2',0
|
||||
;aVersion_ch db 'version_ch2',0
|
||||
|
||||
aOption_box_draw db 'option_box_draw',0
|
||||
aOption_box_mouse db 'option_box_mouse',0
|
||||
;aVersion_op db 'version_op',0
|
||||
|
||||
sz_PathShow_prepare db 'PathShow_prepare',0
|
||||
sz_PathShow_draw db 'PathShow_draw',0
|
||||
;szVersion_path_show db 'version_PathShow',0
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
import_libimg:
|
||||
dd alib_init1
|
||||
img_is_img dd aimg_is_img
|
||||
img_info dd aimg_info
|
||||
img_from_file dd aimg_from_file
|
||||
img_to_file dd aimg_to_file
|
||||
img_from_rgb dd aimg_from_rgb
|
||||
img_to_rgb dd aimg_to_rgb
|
||||
img_to_rgb2 dd aimg_to_rgb2
|
||||
img_decode dd aimg_decode
|
||||
img_encode dd aimg_encode
|
||||
img_create dd aimg_create
|
||||
img_destroy dd aimg_destroy
|
||||
img_destroy_layer dd aimg_destroy_layer
|
||||
img_count dd aimg_count
|
||||
img_lock_bits dd aimg_lock_bits
|
||||
img_unlock_bits dd aimg_unlock_bits
|
||||
img_flip dd aimg_flip
|
||||
img_flip_layer dd aimg_flip_layer
|
||||
img_rotate dd aimg_rotate
|
||||
img_rotate_layer dd aimg_rotate_layer
|
||||
img_draw dd aimg_draw
|
||||
dd 0,0
|
||||
alib_init1 db 'lib_init',0
|
||||
aimg_is_img db 'img_is_img',0
|
||||
aimg_info db 'img_info',0
|
||||
aimg_from_file db 'img_from_file',0
|
||||
aimg_to_file db 'img_to_file',0
|
||||
aimg_from_rgb db 'img_from_rgb',0
|
||||
aimg_to_rgb db 'img_to_rgb',0
|
||||
aimg_to_rgb2 db 'img_to_rgb2',0
|
||||
aimg_decode db 'img_decode',0
|
||||
aimg_encode db 'img_encode',0
|
||||
aimg_create db 'img_create',0
|
||||
aimg_destroy db 'img_destroy',0
|
||||
aimg_destroy_layer db 'img_destroy_layer',0
|
||||
aimg_count db 'img_count',0
|
||||
aimg_lock_bits db 'img_lock_bits',0
|
||||
aimg_unlock_bits db 'img_unlock_bits',0
|
||||
aimg_flip db 'img_flip',0
|
||||
aimg_flip_layer db 'img_flip_layer',0
|
||||
aimg_rotate db 'img_rotate',0
|
||||
aimg_rotate_layer db 'img_rotate_layer',0
|
||||
aimg_draw db 'img_draw',0
|
||||
;---------------------------------------------------------------------
|
||||
;width,left,top,color,shift_color,focus_border_color,\
|
||||
; blur_border_color,text_color,max,text,mouse_variable,flags,size,pos
|
||||
|
||||
rect_input:
|
||||
.left edit_box 35,95,5, cl_white,0,0,0,0,5,rect_input_buffer.left, mouse_dd1,ed_figure_only ;+ed_focus
|
||||
.top edit_box 35,95,25,cl_white,0,0,0,0,5,rect_input_buffer.top, mouse_dd1,ed_figure_only
|
||||
.width edit_box 35,95,45,cl_white,0,0,0,0,5,rect_input_buffer.width, mouse_dd1,ed_figure_only
|
||||
.height edit_box 35,95,65,cl_white,0,0,0,0,5,rect_input_buffer.height,mouse_dd1,ed_figure_only
|
||||
rect_input_end:
|
||||
mouse_dd1 rd 1
|
||||
rect_input_labels:
|
||||
.left label 10,10,0,rect_input_labels_text.left
|
||||
.top label 10,30,0,rect_input_labels_text.top
|
||||
.width label 10,50,0,rect_input_labels_text.width
|
||||
.height label 10,70,0,rect_input_labels_text.height
|
||||
rect_input_labels_end:
|
||||
|
||||
rect_input_labels_text:
|
||||
if lang eq ru_RU
|
||||
.left db 'Отступ слева:',0
|
||||
.top db 'Отступ сверху:',0
|
||||
.width db 'Ширина:',0
|
||||
.height db 'Высота:',0
|
||||
else
|
||||
.left db 'Left:',0
|
||||
.top db 'Top:',0
|
||||
.width db 'Width:',0
|
||||
.height db 'Height:',0
|
||||
end if
|
||||
|
||||
riw_check_boxes:
|
||||
use_rect_active_window check_box2 (10 shl 16)+10,(85 shl 16) +10,5,cl_white,0,0,\
|
||||
riw_check_boxes_text, ch_flag_bottom
|
||||
riw_check_boxes_end:
|
||||
|
||||
if lang eq ru_RU
|
||||
riw_check_boxes_text db 'Использовать область активного окна',0
|
||||
riw_grab_text db 'Координаты и размеры области:',0
|
||||
else
|
||||
riw_check_boxes_text db 'Use area of the active window',0
|
||||
riw_grab_text db 'Coordinates and size of the field:',0
|
||||
end if
|
||||
; Language support for locales: ru_RU (CP866), en_US.
|
||||
|
||||
align 4
|
||||
set_rect_window:
|
||||
mov ebx,set_rect_window_procinfo
|
||||
call get_slot_n
|
||||
|
||||
mov [set_rect_window_slot],ecx
|
||||
|
||||
set_events_mask (evm_redraw+evm_key+evm_button+evm_mouse)
|
||||
call init_rect
|
||||
edit_boxes_set_sys_color rect_input,rect_input_end,sc
|
||||
.red:
|
||||
labels_set_sys_color rect_input_labels,rect_input_labels_end,sc
|
||||
check_boxes_set_sys_color2 riw_check_boxes,riw_check_boxes_end,sc
|
||||
call .draw_window
|
||||
align 4
|
||||
.still:
|
||||
wait_event .red,.key,.button,.mouse
|
||||
|
||||
.key:
|
||||
get_key
|
||||
|
||||
stdcall [edit_box_key], rect_input.left
|
||||
stdcall [edit_box_key], rect_input.top
|
||||
stdcall [edit_box_key], rect_input.width
|
||||
stdcall [edit_box_key], rect_input.height
|
||||
|
||||
call read_rect
|
||||
call draw_rect_on_screen
|
||||
|
||||
jmp .still
|
||||
|
||||
.button:
|
||||
get_pressed_button
|
||||
|
||||
cmp ah,1
|
||||
jne @f
|
||||
btr dword [flags],3
|
||||
jmp close
|
||||
@@:
|
||||
|
||||
jmp .still
|
||||
|
||||
.mouse:
|
||||
get_active_window
|
||||
cmp eax,[set_rect_window_slot]
|
||||
jne .still
|
||||
|
||||
stdcall [edit_box_mouse], rect_input.left
|
||||
stdcall [edit_box_mouse], rect_input.top
|
||||
stdcall [edit_box_mouse], rect_input.width
|
||||
stdcall [edit_box_mouse], rect_input.height
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;
|
||||
stdcall [check_box_mouse], use_rect_active_window
|
||||
|
||||
jmp .still
|
||||
|
||||
align 4
|
||||
.draw_window:
|
||||
start_draw_window
|
||||
|
||||
mov edx,[sc.work]
|
||||
add edx,0x33000000
|
||||
mov edi,riw_grab_text
|
||||
xor esi,esi
|
||||
mcall SF_CREATE_WINDOW, 100*65536+250, 100*65536+130
|
||||
|
||||
draw_labels rect_input_labels,rect_input_labels_end
|
||||
|
||||
stdcall [edit_box_draw], rect_input.left
|
||||
stdcall [edit_box_draw], rect_input.top
|
||||
stdcall [edit_box_draw], rect_input.width
|
||||
stdcall [edit_box_draw], rect_input.height
|
||||
;;;;;;;;;;;;;;;;;;;;;;
|
||||
stdcall [check_box_draw], use_rect_active_window
|
||||
|
||||
call read_rect
|
||||
call draw_rect_on_screen
|
||||
|
||||
stop_draw_window
|
||||
ret
|
||||
|
||||
align 4
|
||||
init_rect:
|
||||
bt dword [use_rect_active_window.flags],1
|
||||
jc init_rect_from_active_window
|
||||
pushad
|
||||
mov edi,rect_input_buffer.left
|
||||
movsx eax,word[rect.left]
|
||||
mov ecx,rect_input.left
|
||||
call init_editbox
|
||||
mov edi,rect_input_buffer.top
|
||||
movsx eax,word[rect.top]
|
||||
mov ecx,rect_input.top
|
||||
call init_editbox
|
||||
mov edi,rect_input_buffer.width
|
||||
movsx eax,word[rect.width]
|
||||
mov ecx,rect_input.width
|
||||
call init_editbox
|
||||
mov edi,rect_input_buffer.height
|
||||
movsx eax,word[rect.height]
|
||||
mov ecx,rect_input.height
|
||||
call init_editbox
|
||||
popad
|
||||
ret
|
||||
|
||||
align 4
|
||||
init_rect_from_active_window:
|
||||
|
||||
ret
|
||||
|
||||
align 4
|
||||
init_editbox:
|
||||
push edi
|
||||
push ecx
|
||||
xor ebx,ebx
|
||||
inc ebx
|
||||
cmp eax,10
|
||||
jl @f
|
||||
inc ebx
|
||||
@@:
|
||||
cmp eax,100
|
||||
jl @f
|
||||
inc ebx
|
||||
@@:
|
||||
cmp eax,1000
|
||||
jl @f
|
||||
inc ebx
|
||||
@@:
|
||||
call int_to_str
|
||||
call [edit_box_set_text] ;ecx,edi
|
||||
ret
|
||||
;--------------------------------------------------------------------
|
||||
;--- Считывание области ---------------------------------------------
|
||||
;--------------------------------------------------------------------
|
||||
align 4
|
||||
read_rect:
|
||||
bt dword [use_rect_active_window.flags],1
|
||||
jc read_rect_from_active_window
|
||||
|
||||
mov edi,rect_input_buffer.left
|
||||
call zstr_to_int
|
||||
cmp ax,[scr.width]
|
||||
jb @f
|
||||
mov ax,[scr.width]
|
||||
@@:
|
||||
mov [rect.left],ax
|
||||
|
||||
mov edi,rect_input_buffer.top
|
||||
call zstr_to_int
|
||||
cmp ax,[scr.height]
|
||||
jb @f
|
||||
mov ax,[scr.height]
|
||||
@@:
|
||||
mov [rect.top],ax
|
||||
|
||||
mov edi,rect_input_buffer.width
|
||||
call zstr_to_int
|
||||
mov bx,[scr.width]
|
||||
sub bx,[rect.left]
|
||||
cmp ax,bx
|
||||
jb @f
|
||||
mov ax,bx
|
||||
@@:
|
||||
mov [rect.width],ax
|
||||
|
||||
mov edi,rect_input_buffer.height
|
||||
call zstr_to_int
|
||||
mov bx,[scr.height]
|
||||
sub bx,[rect.top]
|
||||
cmp ax,bx
|
||||
jb @f
|
||||
mov ax,bx
|
||||
@@:
|
||||
mov [rect.height],ax
|
||||
ret
|
||||
|
||||
align 4
|
||||
read_rect_from_active_window:
|
||||
call get_active_window_info
|
||||
|
||||
mov eax,[active_app.left]
|
||||
mov [rect.left],ax
|
||||
mov eax,[active_app.top]
|
||||
mov [rect.top],ax
|
||||
mov eax,[active_app.width]
|
||||
inc eax
|
||||
mov [rect.width],ax
|
||||
mov eax,[active_app.height]
|
||||
inc eax
|
||||
mov [rect.height],ax
|
||||
ret
|
||||
|
||||
align 4
|
||||
draw_rect_on_screen:
|
||||
|
||||
xor edx,edx
|
||||
mcall SF_DRAW_RECT, 150*65536+80, 5*65536+60
|
||||
|
||||
;movzx eax,word [rect.left]
|
||||
;mul word [scr.width]
|
||||
xor edx,edx
|
||||
movzx eax,word [scr.width]
|
||||
mov ebx,80
|
||||
div ebx
|
||||
mov ebx,eax
|
||||
|
||||
xor edx,edx
|
||||
movzx eax,word [rect.height]
|
||||
div ebx
|
||||
push ax
|
||||
|
||||
xor edx,edx
|
||||
movzx eax,word [rect.width]
|
||||
div ebx
|
||||
push ax
|
||||
|
||||
xor edx,edx
|
||||
movzx eax,word [rect.top]
|
||||
div ebx
|
||||
push ax
|
||||
|
||||
xor edx,edx
|
||||
movzx eax,word [rect.left]
|
||||
div ebx
|
||||
push ax
|
||||
|
||||
pop bx
|
||||
add bx,150
|
||||
shl ebx,16
|
||||
|
||||
pop cx
|
||||
add cx,5
|
||||
shl ecx,16
|
||||
|
||||
pop bx
|
||||
pop cx
|
||||
|
||||
mcall SF_DRAW_RECT,,,0xffffff
|
||||
ret
|
||||
|
||||
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
;DATA данные
|
||||
|
||||
system_dir_Boxlib db '/sys/lib/box_lib.obj',0
|
||||
system_dir_ProcLib db '/sys/lib/proc_lib.obj',0
|
||||
system_dir_LibImg db '/sys/lib/libimg.obj',0
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
ProcLib_import:
|
||||
OpenDialog_Init dd aOpenDialog_Init
|
||||
OpenDialog_Start dd aOpenDialog_Start
|
||||
;OpenDialog__Version dd aOpenDialog_Version
|
||||
dd 0,0
|
||||
aOpenDialog_Init db 'OpenDialog_init',0
|
||||
aOpenDialog_Start db 'OpenDialog_start',0
|
||||
;aOpenDialog_Version db 'Version_OpenDialog',0
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
Box_lib_import:
|
||||
;init_lib dd a_init
|
||||
;version_lib dd a_version
|
||||
|
||||
edit_box_draw dd aEdit_box_draw
|
||||
edit_box_key dd aEdit_box_key
|
||||
edit_box_mouse dd aEdit_box_mouse
|
||||
edit_box_set_text dd aEdit_box_set_text
|
||||
;version_ed dd aVersion_ed
|
||||
|
||||
init_checkbox dd aInit_checkbox
|
||||
check_box_draw dd aCheck_box_draw
|
||||
check_box_mouse dd aCheck_box_mouse
|
||||
;version_ch dd aVersion_ch
|
||||
|
||||
option_box_draw dd aOption_box_draw
|
||||
option_box_mouse dd aOption_box_mouse
|
||||
;version_op dd aVersion_op
|
||||
|
||||
PathShow_prepare dd sz_PathShow_prepare
|
||||
PathShow_draw dd sz_PathShow_draw
|
||||
;Version_path_show dd szVersion_path_show
|
||||
dd 0,0
|
||||
|
||||
;a_init db 'lib_init',0
|
||||
;a_version db 'version',0
|
||||
|
||||
aEdit_box_draw db 'edit_box_draw',0
|
||||
aEdit_box_key db 'edit_box_key',0
|
||||
aEdit_box_mouse db 'edit_box_mouse',0
|
||||
aEdit_box_set_text db 'edit_box_set_text',0
|
||||
;aVersion_ed db 'version_ed',0
|
||||
|
||||
|
||||
aInit_checkbox db 'init_checkbox2',0
|
||||
aCheck_box_draw db 'check_box_draw2',0
|
||||
aCheck_box_mouse db 'check_box_mouse2',0
|
||||
;aVersion_ch db 'version_ch2',0
|
||||
|
||||
aOption_box_draw db 'option_box_draw',0
|
||||
aOption_box_mouse db 'option_box_mouse',0
|
||||
;aVersion_op db 'version_op',0
|
||||
|
||||
sz_PathShow_prepare db 'PathShow_prepare',0
|
||||
sz_PathShow_draw db 'PathShow_draw',0
|
||||
;szVersion_path_show db 'version_PathShow',0
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
import_libimg:
|
||||
dd alib_init1
|
||||
img_is_img dd aimg_is_img
|
||||
img_info dd aimg_info
|
||||
img_from_file dd aimg_from_file
|
||||
img_to_file dd aimg_to_file
|
||||
img_from_rgb dd aimg_from_rgb
|
||||
img_to_rgb dd aimg_to_rgb
|
||||
img_to_rgb2 dd aimg_to_rgb2
|
||||
img_decode dd aimg_decode
|
||||
img_encode dd aimg_encode
|
||||
img_create dd aimg_create
|
||||
img_destroy dd aimg_destroy
|
||||
img_destroy_layer dd aimg_destroy_layer
|
||||
img_count dd aimg_count
|
||||
img_lock_bits dd aimg_lock_bits
|
||||
img_unlock_bits dd aimg_unlock_bits
|
||||
img_flip dd aimg_flip
|
||||
img_flip_layer dd aimg_flip_layer
|
||||
img_rotate dd aimg_rotate
|
||||
img_rotate_layer dd aimg_rotate_layer
|
||||
img_draw dd aimg_draw
|
||||
dd 0,0
|
||||
alib_init1 db 'lib_init',0
|
||||
aimg_is_img db 'img_is_img',0
|
||||
aimg_info db 'img_info',0
|
||||
aimg_from_file db 'img_from_file',0
|
||||
aimg_to_file db 'img_to_file',0
|
||||
aimg_from_rgb db 'img_from_rgb',0
|
||||
aimg_to_rgb db 'img_to_rgb',0
|
||||
aimg_to_rgb2 db 'img_to_rgb2',0
|
||||
aimg_decode db 'img_decode',0
|
||||
aimg_encode db 'img_encode',0
|
||||
aimg_create db 'img_create',0
|
||||
aimg_destroy db 'img_destroy',0
|
||||
aimg_destroy_layer db 'img_destroy_layer',0
|
||||
aimg_count db 'img_count',0
|
||||
aimg_lock_bits db 'img_lock_bits',0
|
||||
aimg_unlock_bits db 'img_unlock_bits',0
|
||||
aimg_flip db 'img_flip',0
|
||||
aimg_flip_layer db 'img_flip_layer',0
|
||||
aimg_rotate db 'img_rotate',0
|
||||
aimg_rotate_layer db 'img_rotate_layer',0
|
||||
aimg_draw db 'img_draw',0
|
||||
;---------------------------------------------------------------------
|
||||
;width,left,top,color,shift_color,focus_border_color,\
|
||||
; blur_border_color,text_color,max,text,mouse_variable,flags,size,pos
|
||||
|
||||
rect_input:
|
||||
.left edit_box 35,95,5, cl_white,0,0,0,0,5,rect_input_buffer.left, mouse_dd1,ed_figure_only ;+ed_focus
|
||||
.top edit_box 35,95,25,cl_white,0,0,0,0,5,rect_input_buffer.top, mouse_dd1,ed_figure_only
|
||||
.width edit_box 35,95,45,cl_white,0,0,0,0,5,rect_input_buffer.width, mouse_dd1,ed_figure_only
|
||||
.height edit_box 35,95,65,cl_white,0,0,0,0,5,rect_input_buffer.height,mouse_dd1,ed_figure_only
|
||||
rect_input_end:
|
||||
mouse_dd1 rd 1
|
||||
rect_input_labels:
|
||||
.left label 10,10,0,rect_input_labels_text.left
|
||||
.top label 10,30,0,rect_input_labels_text.top
|
||||
.width label 10,50,0,rect_input_labels_text.width
|
||||
.height label 10,70,0,rect_input_labels_text.height
|
||||
rect_input_labels_end:
|
||||
|
||||
rect_input_labels_text:
|
||||
if lang eq ru_RU
|
||||
.left db 'Отступ слева:',0
|
||||
.top db 'Отступ сверху:',0
|
||||
.width db 'Ширина:',0
|
||||
.height db 'Высота:',0
|
||||
else ; Default to en_US
|
||||
.left db 'Left:',0
|
||||
.top db 'Top:',0
|
||||
.width db 'Width:',0
|
||||
.height db 'Height:',0
|
||||
end if
|
||||
|
||||
riw_check_boxes:
|
||||
use_rect_active_window check_box2 (10 shl 16)+10,(85 shl 16) +10,5,cl_white,0,0,\
|
||||
riw_check_boxes_text, ch_flag_bottom
|
||||
riw_check_boxes_end:
|
||||
|
||||
if lang eq ru_RU
|
||||
riw_check_boxes_text db 'Использовать область активного окна',0
|
||||
riw_grab_text db 'Координаты и размеры области:',0
|
||||
else ; Default to en_US
|
||||
riw_check_boxes_text db 'Use area of the active window',0
|
||||
riw_grab_text db 'Coordinates and size of the field:',0
|
||||
end if
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
+1787
-1785
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,181 +1,183 @@
|
||||
;
|
||||
; в этом файле собраны функции нужные для создания и
|
||||
; работы окна с настройками
|
||||
;
|
||||
|
||||
wnd_scale_width equ 320 ;ширина окна с настройками
|
||||
wnd_scale_height equ 150 ;высота окна с настройками
|
||||
|
||||
align 4
|
||||
wnd_run_scale db 0 ;переменная следящая за тем что-бы не запускать больше 1-го окна со свойствами одновременно
|
||||
|
||||
;даное окно (процесс) вызываеться функцией but_wnd_coords
|
||||
align 4
|
||||
start_scale:
|
||||
pushad
|
||||
mcall SF_SET_EVENTS_MASK,0x27 ;маска ожидаемых событий
|
||||
inc byte[wnd_run_scale]
|
||||
|
||||
edit_boxes_set_sys_color edit3,editboxes_end_sc,sc ;установка системных цветов
|
||||
call get_scale
|
||||
popad
|
||||
call red_win_scale
|
||||
|
||||
;не отрывать эту функцию от предыдущей
|
||||
align 4
|
||||
still_scale:
|
||||
pushad
|
||||
|
||||
mcall SF_WAIT_EVENT_TIMEOUT,10
|
||||
or eax,eax
|
||||
jnz @f
|
||||
call timer_funct_scale
|
||||
jmp .end
|
||||
@@:
|
||||
|
||||
cmp al,1 ;изм. положение окна
|
||||
jne @f
|
||||
call red_win_scale
|
||||
jmp .end
|
||||
@@:
|
||||
cmp al,2
|
||||
jne @f
|
||||
call key_scale
|
||||
jmp .end
|
||||
@@:
|
||||
cmp al,3
|
||||
jz button_scale
|
||||
cmp al,6
|
||||
jne @f
|
||||
call mouse_scale
|
||||
@@:
|
||||
.end:
|
||||
popad
|
||||
jmp still_scale
|
||||
|
||||
align 4
|
||||
red_win_scale:
|
||||
pushad
|
||||
mcall SF_REDRAW,SSF_BEGIN_DRAW
|
||||
|
||||
mcall SF_STYLE_SETTINGS,SSF_GET_SKIN_HEIGHT
|
||||
mov edi,capt_opt ;children window caption
|
||||
mov bx,word[procinfo.box.left]
|
||||
add bx,word[buf_0.l]
|
||||
add bx,5 ;ширина боковой рамки
|
||||
shl ebx,16
|
||||
mov bx,wnd_scale_width
|
||||
mov cx,word[procinfo.box.top]
|
||||
add cx,ax ;add skin height
|
||||
add cx,word[buf_0.t]
|
||||
shl ecx,16
|
||||
mov cx,wnd_scale_height
|
||||
mov edx,[sc.work]
|
||||
or edx,0x33000000
|
||||
xor eax,eax
|
||||
int 0x40
|
||||
|
||||
mov esi,[sc.work_button]
|
||||
;ebx = (l<:)+w, ecx = (t<:)+h
|
||||
mcall SF_DEFINE_BUTTON, (5 shl 16)+59, (95 shl 16)+20, 3
|
||||
mcall , (75 shl 16)+59, (95 shl 16)+20, 4
|
||||
|
||||
mov ecx,[sc.work_text]
|
||||
bts ecx,31 ;рисуемая строка заканчивается нулём
|
||||
mcall SF_DRAW_TEXT, (5 shl 16)+15,, capt_sc
|
||||
|
||||
mov ecx,[sc.work_button_text]
|
||||
bts ecx,31
|
||||
mcall , (9 shl 16)+101,, txt_but_cancel
|
||||
mov edx,txt_but_apply
|
||||
mcall ,(79 shl 16)+101
|
||||
|
||||
stdcall [edit_box_draw], edit3
|
||||
|
||||
mcall SF_REDRAW,SSF_END_DRAW
|
||||
popad
|
||||
ret
|
||||
|
||||
align 4
|
||||
proc key_scale uses eax ebx
|
||||
mcall SF_GET_KEY
|
||||
|
||||
test word [edit3.flags],10b ;ed_focus
|
||||
je @f
|
||||
stdcall [edit_box_key], edit3
|
||||
;jmp .end
|
||||
@@:
|
||||
|
||||
.end:
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
mouse_scale:
|
||||
stdcall [edit_box_mouse], edit3
|
||||
ret
|
||||
|
||||
align 4
|
||||
button_scale:
|
||||
mcall SF_GET_BUTTON
|
||||
|
||||
cmp ah,3
|
||||
je .exit
|
||||
cmp ah,4
|
||||
jne .end_save
|
||||
push eax ecx edi esi
|
||||
finit
|
||||
|
||||
mov esi,string3
|
||||
mov edi,Data_String
|
||||
cld
|
||||
mov ecx,8
|
||||
rep movsd
|
||||
call String_to_DoubleFloat
|
||||
fld qword[Data_Double] ;считываем как double
|
||||
fstp qword[Scale1mm] ;сохраняем как double
|
||||
|
||||
pop esi edi ecx eax
|
||||
jmp .exit
|
||||
.end_save:
|
||||
|
||||
cmp ah,1
|
||||
jne still_scale.end
|
||||
.exit:
|
||||
mov byte[wnd_run_scale],0 ;обнуляем счетчик окон
|
||||
mcall SF_TERMINATE_PROCESS ;выход из программы
|
||||
|
||||
align 4
|
||||
get_scale:
|
||||
;загрузка координат в editbox-ы
|
||||
push eax
|
||||
mov word[NumberSymbolsAD],8
|
||||
finit
|
||||
fld qword[Scale1mm]
|
||||
fstp qword[Data_Double]
|
||||
call DoubleFloat_to_String
|
||||
call String_crop_0
|
||||
stdcall [edit_box_set_text], edit3, Data_String
|
||||
;stdcall [edit_box_draw], edit3
|
||||
pop eax
|
||||
ret
|
||||
|
||||
align 4
|
||||
proc timer_funct_scale
|
||||
;просматриваем выделенную координату
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
if lang eq ru_RU
|
||||
capt_opt db 'Настройки',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 'Настройки',0
|
||||
capt_sc db 'Масштаб:',0
|
||||
else ; Default to en_US
|
||||
capt_opt db 'Options',0
|
||||
capt_sc db 'Scale:',0
|
||||
end if
|
||||
|
||||
edit3 edit_box 80, 54, 11, 0xffd0d0, 0xff, 0x80ff, 0, 0x8000, 34, string3, mouse_dd, 0
|
||||
editboxes_end_sc:
|
||||
|
||||
string3 rb 34
|
||||
@@ -19,7 +19,7 @@ use32
|
||||
dd 0x0
|
||||
|
||||
include "..\..\..\..\macros.inc"
|
||||
include "lang.inc"
|
||||
include "lang.inc" ; Language support for locales: de_DE, en_US.
|
||||
START:
|
||||
|
||||
call cmdexist
|
||||
@@ -2780,6 +2780,7 @@ title db 'CMD - Command line interpreter',0
|
||||
smb_cursor db '|'
|
||||
|
||||
prompt db 'CMD>>'
|
||||
|
||||
if lang eq de_DE
|
||||
h1 db ' CMD - Command line interpreter version 0.26 '
|
||||
h2 db ' copyleft Chemist - dmitry_gt@tut.by '
|
||||
@@ -2823,7 +2824,9 @@ mess14 db 'Datei erfolgreich umbenannt '
|
||||
mess15 db 'ERROR: Kann Datei nicht umbenennen! '
|
||||
mess16 db 'Scriptname erwartet! '
|
||||
mess17 db 'Dieses Kommando ist nur in Scripts zulaessig! '
|
||||
else
|
||||
|
||||
else ; Default to en_US
|
||||
|
||||
h1 db ' CMD - Command line interpreter version 0.26 '
|
||||
h2 db ' copyleft Chemist - dmitry_gt@tut.by '
|
||||
h3 db ' Available commands: '
|
||||
@@ -2831,7 +2834,7 @@ h4 db ' HELP - Display this text LS - List files '
|
||||
h5 db ' EXIT - Exit Programm CP - Copy file '
|
||||
h6 db ' CLS - Clear Screen PS - Process info '
|
||||
h7 db ' KILL - Kill Process RN - Rename File '
|
||||
h8 db ' VER - Display programm version '
|
||||
h8 db ' VER - Display program version '
|
||||
h9 db ' DEL - Delete file from ramdisk '
|
||||
h10 db ' SHUTDOWN - Quit Menuet '
|
||||
h11 db ' PAUSE - Wait for keypress '
|
||||
@@ -2849,7 +2852,7 @@ proc_head db ' PID Name Start Length Proc_NUMB '
|
||||
proc_hd11 db '-------------------------------------------- '
|
||||
|
||||
mess1 db 'Press any key to continue (ESC - Cancel)... '
|
||||
mess2 db 'Plz specify a 4 byte process number (not PID) '
|
||||
mess2 db 'Specify a 4 byte process number (not PID) '
|
||||
mess3 db 'Process with number you specified has been '
|
||||
mess4 db 'terminated. '
|
||||
mess5 db 'Usage: del [filename] '
|
||||
|
||||
@@ -2,38 +2,40 @@
|
||||
;///// LOCALIZED STRINGS //////////////////////////////////////////////////////
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
; Language support for locales: ru_RU (CP866), en_US, fr_FR, de_DE.
|
||||
|
||||
lsz lname,\
|
||||
ru,'Имя',\
|
||||
en,'Name',\
|
||||
fr,'Nom',\
|
||||
ge,'Name'
|
||||
ru_RU,'Имя',\
|
||||
en_US,'Name',\
|
||||
fr_FR,'Nom',\
|
||||
de_DE,'Name'
|
||||
lsz sort_kind,\
|
||||
ru,'ир',\
|
||||
en,'nx',\
|
||||
fr,'ne',\
|
||||
ge,'ne'
|
||||
ru_RU,'ир',\
|
||||
en_US,'nx',\
|
||||
fr_FR,'ne',\
|
||||
de_DE,'ne'
|
||||
lsz btmkeys,\
|
||||
ru,'Помощь ПользМ Просм Редакт Копир ',\
|
||||
ru,'Перен Папка Удален КонфМн Выход',\
|
||||
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,'Помощь ПользМ Просм Редакт Копир ',\
|
||||
ru_RU,'Перен Папка Удален КонфМн Выход',\
|
||||
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:'
|
||||
+1003
-1001
File diff suppressed because it is too large.
Load diff
@@ -35,6 +35,7 @@
|
||||
dd temp_area , 0x0 ; I_Param , I_Icon
|
||||
|
||||
include 'lang.inc'
|
||||
; Language support for locales: ru_RU (CP866), en_US, de_DE.
|
||||
include '..\..\..\..\macros.inc'
|
||||
include '..\..\..\..\develop\examples\editbox\trunk\editbox.inc'
|
||||
;include 'macros.inc'
|
||||
@@ -655,9 +656,9 @@ labelt:
|
||||
db 'MeView v.0.4'
|
||||
|
||||
lsz buttext,\
|
||||
en, ' FILE OPEN INFO BGRD',\
|
||||
ru, ' ФАЙЛ ОТКР ИНФО ФОН ',\
|
||||
de, 'DATEI OEFNEN INFO HGRD'
|
||||
en_US, ' FILE OPEN INFO BGRD',\
|
||||
ru_RU, ' ФАЙЛ ОТКР ИНФО ФОН ',\
|
||||
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, 'Размер файла ',\
|
||||
ru, 'Ширина ',\
|
||||
ru, 'Высота ',\
|
||||
ru, 'Бит на пиксел ',\
|
||||
ru_RU, 'Размер файла ',\
|
||||
ru_RU, 'Ширина ',\
|
||||
ru_RU, 'Высота ',\
|
||||
ru_RU, 'Бит на пиксел ',\
|
||||
\
|
||||
de, 'FATEIGROESSE ',\
|
||||
de, 'X GROESSE ',\
|
||||
de, 'Y GROESSE ',\
|
||||
de, 'BITS PER PIXEL'
|
||||
de_DE, 'FATEIGROESSE ',\
|
||||
de_DE, 'X GROESSE ',\
|
||||
de_DE, 'Y GROESSE ',\
|
||||
de_DE, 'BITS PER PIXEL'
|
||||
|
||||
thread3: ; start of bgrd thread
|
||||
|
||||
@@ -1114,29 +1115,29 @@ wnd_width dd 210
|
||||
wnd_height dd 53
|
||||
|
||||
lsz labelt3,\
|
||||
en, 'Background set',\
|
||||
ru, "Установка фона",\
|
||||
de, 'Hintergrund gesetzt'
|
||||
en_US, 'Background set',\
|
||||
ru_RU, "Установка фона",\
|
||||
de_DE, 'Hintergrund gesetzt'
|
||||
|
||||
lsz bgrdtext,\
|
||||
en, 'SET AS BACKGROUND:',\
|
||||
ru, 'Тип обоев:',\
|
||||
de, 'ALS HINTERGRUND'
|
||||
en_US, 'SET AS BACKGROUND:',\
|
||||
ru_RU, 'Тип обоев:',\
|
||||
de_DE, 'ALS HINTERGRUND'
|
||||
|
||||
lsz tiled,\
|
||||
en, 'TILED',\
|
||||
ru, 'замостить',\
|
||||
de, 'GEKACHELT'
|
||||
en_US, 'TILED',\
|
||||
ru_RU, 'замостить',\
|
||||
de_DE, 'GEKACHELT'
|
||||
|
||||
lsz stretch,\
|
||||
en, 'STRETCH',\
|
||||
ru, 'растянуть',\
|
||||
de, 'GESTRECKT'
|
||||
en_US, 'STRETCH',\
|
||||
ru_RU, 'растянуть',\
|
||||
de_DE, 'GESTRECKT'
|
||||
|
||||
lsz ok_btn,\
|
||||
en, 'Ok',\
|
||||
ru, 'Ok',\
|
||||
de, 'Ok'
|
||||
en_US, 'Ok',\
|
||||
ru_RU, 'Ok',\
|
||||
de_DE, 'Ok'
|
||||
|
||||
image_file dd 0
|
||||
image_file_1 dd 0
|
||||
|
||||
@@ -1,393 +1,393 @@
|
||||
;
|
||||
; DESKTOP CONTEXT MENU
|
||||
; written by Ivan Poddubny
|
||||
;
|
||||
; Автор - Иван Поддубный
|
||||
; 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
|
||||
; ОБРАБОТЧИК МЫШИ
|
||||
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
|
||||
; НАЖАТА КНОПКА
|
||||
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
|
||||
;------------------------------------------------------------------------------
|
||||
;*******************************
|
||||
;******** РИСУЕМ ОКНО ********
|
||||
;*******************************
|
||||
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
|
||||
; ДАННЫЕ ПРОГРАММЫ
|
||||
|
||||
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, 'Настройка окон ',\
|
||||
ru, 'Управление иконками ',\
|
||||
ru, 'Настройка устройств ',\
|
||||
ru, 'Панель отладки ',\
|
||||
ru, 'Процессы ',\
|
||||
\
|
||||
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
|
||||
; НЕИНИЦИАЛИЗИРОВАННЫЕ ДАННЫЕ
|
||||
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:
|
||||
;------------------------------------------------------------------------------
|
||||
; КОНЕЦ ПРОГРАММЫ
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; DESKTOP CONTEXT MENU
|
||||
; written by Ivan Poddubny
|
||||
;
|
||||
; Автор - Иван Поддубный
|
||||
; 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
|
||||
; ОБРАБОТЧИК МЫШИ
|
||||
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
|
||||
; НАЖАТА КНОПКА
|
||||
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
|
||||
;------------------------------------------------------------------------------
|
||||
;*******************************
|
||||
;******** РИСУЕМ ОКНО ********
|
||||
;*******************************
|
||||
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, 'Настройка окон ',\
|
||||
ru_RU, 'Управление иконками ',\
|
||||
ru_RU, 'Настройка устройств ',\
|
||||
ru_RU, 'Панель отладки ',\
|
||||
ru_RU, 'Процессы ',\
|
||||
\
|
||||
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
|
||||
; НЕИНИЦИАЛИЗИРОВАННЫЕ ДАННЫЕ
|
||||
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:
|
||||
;------------------------------------------------------------------------------
|
||||
; КОНЕЦ ПРОГРАММЫ
|
||||
;------------------------------------------------------------------------------
|
||||
@@ -1 +1,644 @@
|
||||
fn_col_option dd def_col_file
fn_syntax_dir db 'info/',0
def_col_file db 'default.syn',0
exit_code dd 0 ;переменная используемая для выхода из программы
panel_but rb 21 ;настройки отображения кнопок на панели
;значения задаваемые по умолчанию, без ini файла
ini_def_window_t equ 20
ini_def_window_l equ 200
ini_def_window_w equ 570
ini_def_window_h equ 470
ini_def_symbol_w equ 7
ini_def_symbol_h equ 10
ini_def_font_s equ 0
ini_def_scroll_type equ 0
;описание параматров для ini файла
ini_name db 't_edit.ini',0
ini_sec_window db 'Window',0
key_window_t db 't',0
key_window_l db 'l',0
key_window_w db 'w',0
key_window_h db 'h',0
key_symbol_w db 'symbol_w',0
key_symbol_h db 'symbol_h',0
key_font_s db 'font_s',0
key_scroll_type db 'scroll_type',0
key_but_new db 'but_new',0
key_but_open db 'but_open',0
key_but_save db 'but_save',0
key_but_save_as db 'but_save_as',0
key_but_select db 'but_select',0
key_but_cut db 'but_cut',0
key_but_copy db 'but_copy',0
key_but_paste db 'but_paste',0
key_but_find db 'but_find',0
key_but_replace db 'but_replace',0
key_but_key_words db 'but_key_words',0
key_but_upper db 'but_upper',0
key_but_lower db 'but_lower',0
key_but_reverse db 'but_reverse',0
key_but_undo db 'but_undo',0
key_but_redo db 'but_redo',0
key_but_invisible db 'but_invisible',0
key_but_syntax_list db 'but_syntax_list',0
key_but_syntax_mode db 'but_syntax_mode',0
key_but_convert_1251_866 db 'but_convert_1251_866',0
key_but_convert_866_1251 db 'but_convert_866_1251',0
ini_sec_options db 'Options',0
key_synt_file:
db 'syntax_'
.numb: db '0',0
key_synt_ext:
db 'ext_'
.numb: db '0',0
ini_def_synt_f db 0
align 4
max_synt_auto_open equ 10
synt_auto_open:
rb 64*max_synt_auto_open
db 0
system_dir_0 db '/sys/lib/'
lib_name_0 db 'box_lib.obj',0
system_dir_1 db '/sys/lib/'
lib_name_1 db 'msgbox.obj',0
system_dir_2 db '/sys/lib/'
lib_name_2 db 'proc_lib.obj',0
system_dir_3 db '/sys/lib/'
lib_name_3 db 'libimg.obj',0
system_dir_4 db '/sys/lib/'
lib_name_4 db 'libini.obj',0
system_dir_5 db '/sys/lib/'
lib_name_5 db 'kmenu.obj',0
;---------------------------------------------------------------------
align 4
import_box_lib:
dd alib_init0 ;функция запускается макросом 1 раз при подключении бибилиотеки, потому в программе метка на нее не нужна
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
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
tl_data_init dd sz_tl_data_init
tl_data_clear dd sz_tl_data_clear
tl_info_clear dd sz_tl_info_clear
tl_key dd sz_tl_key
tl_mouse dd sz_tl_mouse
tl_draw dd sz_tl_draw
tl_info_undo dd sz_tl_info_undo
tl_info_redo dd sz_tl_info_redo
tl_node_add dd sz_tl_node_add
tl_node_set_data dd sz_tl_node_set_data
tl_node_get_data dd sz_tl_node_get_data
tl_node_delete dd sz_tl_node_delete
tl_cur_beg dd sz_tl_cur_beg
tl_cur_next dd sz_tl_cur_next
tl_cur_perv dd sz_tl_cur_perv
;tl_node_close_open dd sz_tl_node_close_open
tl_node_lev_inc dd sz_tl_node_lev_inc
tl_node_lev_dec dd sz_tl_node_lev_dec
ted_but_sumb_upper dd sz_ted_but_sumb_upper
ted_but_sumb_lover dd sz_ted_but_sumb_lover
ted_but_convert_by_table dd sz_ted_but_convert_by_table
ted_can_save dd sz_ted_can_save
ted_clear dd sz_ted_clear
ted_delete dd sz_ted_delete
ted_draw dd sz_ted_draw
ted_init dd sz_ted_init
ted_init_scroll_bars dd sz_ted_init_scroll_bars
ted_init_syntax_file dd sz_ted_init_syntax_file
ted_is_select dd sz_ted_is_select
ted_key dd sz_ted_key
ted_mouse dd sz_ted_mouse
ted_open_file dd sz_ted_open_file
ted_save_file dd sz_ted_save_file
ted_text_add dd sz_ted_text_add
ted_but_select_word dd sz_ted_but_select_word
ted_but_cut dd sz_ted_but_cut
ted_but_copy dd sz_ted_but_copy
ted_but_paste dd sz_ted_but_paste
ted_but_undo dd sz_ted_but_undo
ted_but_redo dd sz_ted_but_redo
ted_but_reverse dd sz_ted_but_reverse
ted_but_find dd sz_ted_but_find
ted_but_replace dd sz_ted_but_replace
ted_text_colored dd sz_ted_text_colored
ted_go_to_position dd sz_ted_go_to_position
version_text_edit dd sz_ted_version
dd 0,0
alib_init0 db 'lib_init',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
aOption_box_draw db 'option_box_draw',0
aOption_box_mouse db 'option_box_mouse',0
;aVersion_op db 'version_op',0
aScrollbar_veLine truncated
|
||||
fn_col_option dd def_col_file
|
||||
fn_syntax_dir db 'info/',0
|
||||
def_col_file db 'default.syn',0
|
||||
|
||||
exit_code dd 0 ;переменная используемая для выхода из программы
|
||||
panel_but rb 21 ;настройки отображения кнопок на панели
|
||||
|
||||
;значения задаваемые по умолчанию, без ini файла
|
||||
ini_def_window_t equ 20
|
||||
ini_def_window_l equ 200
|
||||
ini_def_window_w equ 570
|
||||
ini_def_window_h equ 470
|
||||
ini_def_symbol_w equ 7
|
||||
ini_def_symbol_h equ 10
|
||||
ini_def_font_s equ 0
|
||||
ini_def_scroll_type equ 0
|
||||
;описание параматров для ini файла
|
||||
ini_name db 't_edit.ini',0
|
||||
ini_sec_window db 'Window',0
|
||||
key_window_t db 't',0
|
||||
key_window_l db 'l',0
|
||||
key_window_w db 'w',0
|
||||
key_window_h db 'h',0
|
||||
key_symbol_w db 'symbol_w',0
|
||||
key_symbol_h db 'symbol_h',0
|
||||
key_font_s db 'font_s',0
|
||||
key_scroll_type db 'scroll_type',0
|
||||
key_but_new db 'but_new',0
|
||||
key_but_open db 'but_open',0
|
||||
key_but_save db 'but_save',0
|
||||
key_but_save_as db 'but_save_as',0
|
||||
key_but_select db 'but_select',0
|
||||
key_but_cut db 'but_cut',0
|
||||
key_but_copy db 'but_copy',0
|
||||
key_but_paste db 'but_paste',0
|
||||
key_but_find db 'but_find',0
|
||||
key_but_replace db 'but_replace',0
|
||||
key_but_key_words db 'but_key_words',0
|
||||
key_but_upper db 'but_upper',0
|
||||
key_but_lower db 'but_lower',0
|
||||
key_but_reverse db 'but_reverse',0
|
||||
key_but_undo db 'but_undo',0
|
||||
key_but_redo db 'but_redo',0
|
||||
key_but_invisible db 'but_invisible',0
|
||||
key_but_syntax_list db 'but_syntax_list',0
|
||||
key_but_syntax_mode db 'but_syntax_mode',0
|
||||
key_but_convert_1251_866 db 'but_convert_1251_866',0
|
||||
key_but_convert_866_1251 db 'but_convert_866_1251',0
|
||||
ini_sec_options db 'Options',0
|
||||
key_synt_file:
|
||||
db 'syntax_'
|
||||
.numb: db '0',0
|
||||
key_synt_ext:
|
||||
db 'ext_'
|
||||
.numb: db '0',0
|
||||
ini_def_synt_f db 0
|
||||
|
||||
align 4
|
||||
max_synt_auto_open equ 10
|
||||
synt_auto_open:
|
||||
rb 64*max_synt_auto_open
|
||||
db 0
|
||||
|
||||
system_dir_0 db '/sys/lib/'
|
||||
lib_name_0 db 'box_lib.obj',0
|
||||
|
||||
system_dir_1 db '/sys/lib/'
|
||||
lib_name_1 db 'msgbox.obj',0
|
||||
|
||||
system_dir_2 db '/sys/lib/'
|
||||
lib_name_2 db 'proc_lib.obj',0
|
||||
|
||||
system_dir_3 db '/sys/lib/'
|
||||
lib_name_3 db 'libimg.obj',0
|
||||
|
||||
system_dir_4 db '/sys/lib/'
|
||||
lib_name_4 db 'libini.obj',0
|
||||
|
||||
system_dir_5 db '/sys/lib/'
|
||||
lib_name_5 db 'kmenu.obj',0
|
||||
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
import_box_lib:
|
||||
dd alib_init0 ;функция запускается макросом 1 раз при подключении бибилиотеки, потому в программе метка на нее не нужна
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
tl_data_init dd sz_tl_data_init
|
||||
tl_data_clear dd sz_tl_data_clear
|
||||
tl_info_clear dd sz_tl_info_clear
|
||||
tl_key dd sz_tl_key
|
||||
tl_mouse dd sz_tl_mouse
|
||||
tl_draw dd sz_tl_draw
|
||||
tl_info_undo dd sz_tl_info_undo
|
||||
tl_info_redo dd sz_tl_info_redo
|
||||
tl_node_add dd sz_tl_node_add
|
||||
tl_node_set_data dd sz_tl_node_set_data
|
||||
tl_node_get_data dd sz_tl_node_get_data
|
||||
tl_node_delete dd sz_tl_node_delete
|
||||
tl_cur_beg dd sz_tl_cur_beg
|
||||
tl_cur_next dd sz_tl_cur_next
|
||||
tl_cur_perv dd sz_tl_cur_perv
|
||||
;tl_node_close_open dd sz_tl_node_close_open
|
||||
tl_node_lev_inc dd sz_tl_node_lev_inc
|
||||
tl_node_lev_dec dd sz_tl_node_lev_dec
|
||||
|
||||
ted_but_sumb_upper dd sz_ted_but_sumb_upper
|
||||
ted_but_sumb_lover dd sz_ted_but_sumb_lover
|
||||
ted_but_convert_by_table dd sz_ted_but_convert_by_table
|
||||
ted_can_save dd sz_ted_can_save
|
||||
ted_clear dd sz_ted_clear
|
||||
ted_delete dd sz_ted_delete
|
||||
ted_draw dd sz_ted_draw
|
||||
ted_init dd sz_ted_init
|
||||
ted_init_scroll_bars dd sz_ted_init_scroll_bars
|
||||
ted_init_syntax_file dd sz_ted_init_syntax_file
|
||||
ted_is_select dd sz_ted_is_select
|
||||
ted_key dd sz_ted_key
|
||||
ted_mouse dd sz_ted_mouse
|
||||
ted_open_file dd sz_ted_open_file
|
||||
ted_save_file dd sz_ted_save_file
|
||||
ted_text_add dd sz_ted_text_add
|
||||
ted_but_select_word dd sz_ted_but_select_word
|
||||
ted_but_cut dd sz_ted_but_cut
|
||||
ted_but_copy dd sz_ted_but_copy
|
||||
ted_but_paste dd sz_ted_but_paste
|
||||
ted_but_undo dd sz_ted_but_undo
|
||||
ted_but_redo dd sz_ted_but_redo
|
||||
ted_but_reverse dd sz_ted_but_reverse
|
||||
ted_but_find dd sz_ted_but_find
|
||||
ted_but_replace dd sz_ted_but_replace
|
||||
ted_text_colored dd sz_ted_text_colored
|
||||
ted_go_to_position dd sz_ted_go_to_position
|
||||
version_text_edit dd sz_ted_version
|
||||
|
||||
dd 0,0
|
||||
alib_init0 db 'lib_init',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
|
||||
|
||||
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
|
||||
|
||||
sz_tl_data_init db 'tl_data_init',0
|
||||
sz_tl_data_clear db 'tl_data_clear',0
|
||||
sz_tl_info_clear db 'tl_info_clear',0
|
||||
sz_tl_key db 'tl_key',0
|
||||
sz_tl_mouse db 'tl_mouse',0
|
||||
sz_tl_draw db 'tl_draw',0
|
||||
sz_tl_info_undo db 'tl_info_undo',0
|
||||
sz_tl_info_redo db 'tl_info_redo',0
|
||||
sz_tl_node_add db 'tl_node_add',0
|
||||
sz_tl_node_set_data db 'tl_node_set_data',0
|
||||
sz_tl_node_get_data db 'tl_node_get_data',0
|
||||
sz_tl_node_delete db 'tl_node_delete',0
|
||||
sz_tl_cur_beg db 'tl_cur_beg',0
|
||||
sz_tl_cur_next db 'tl_cur_next',0
|
||||
sz_tl_cur_perv db 'tl_cur_perv',0
|
||||
;sz_tl_node_close_open db 'tl_node_close_open',0
|
||||
sz_tl_node_lev_inc db 'tl_node_lev_inc',0
|
||||
sz_tl_node_lev_dec db 'tl_node_lev_dec',0
|
||||
|
||||
sz_ted_but_sumb_upper db 'ted_but_sumb_upper',0
|
||||
sz_ted_but_sumb_lover db 'ted_but_sumb_lover',0
|
||||
sz_ted_but_convert_by_table db 'ted_but_convert_by_table',0
|
||||
sz_ted_can_save db 'ted_can_save',0
|
||||
sz_ted_clear db 'ted_clear',0
|
||||
sz_ted_delete db 'ted_delete',0
|
||||
sz_ted_draw db 'ted_draw',0
|
||||
sz_ted_init db 'ted_init',0
|
||||
sz_ted_init_scroll_bars db 'ted_init_scroll_bars',0
|
||||
sz_ted_init_syntax_file db 'ted_init_syntax_file',0
|
||||
sz_ted_is_select db 'ted_is_select',0
|
||||
sz_ted_key db 'ted_key',0
|
||||
sz_ted_mouse db 'ted_mouse',0
|
||||
sz_ted_open_file db 'ted_open_file',0
|
||||
sz_ted_save_file db 'ted_save_file',0
|
||||
sz_ted_text_add db 'ted_text_add',0
|
||||
sz_ted_but_select_word db 'ted_but_select_word',0
|
||||
sz_ted_but_cut db 'ted_but_cut',0
|
||||
sz_ted_but_copy db 'ted_but_copy',0
|
||||
sz_ted_but_paste db 'ted_but_paste',0
|
||||
sz_ted_but_undo db 'ted_but_undo',0
|
||||
sz_ted_but_redo db 'ted_but_redo',0
|
||||
sz_ted_but_reverse db 'ted_but_reverse',0
|
||||
sz_ted_but_find db 'ted_but_find',0
|
||||
sz_ted_but_replace db 'ted_but_replace',0
|
||||
sz_ted_text_colored db 'ted_text_colored',0
|
||||
sz_ted_go_to_position db 'ted_go_to_position',0
|
||||
sz_ted_version db 'version_text_edit',0
|
||||
|
||||
align 4
|
||||
import_proclib:
|
||||
OpenDialog_Init dd aOpenDialog_Init
|
||||
OpenDialog_Start dd aOpenDialog_Start
|
||||
dd 0,0
|
||||
aOpenDialog_Init db 'OpenDialog_init',0
|
||||
aOpenDialog_Start db 'OpenDialog_start',0
|
||||
|
||||
align 4
|
||||
import_msgbox_lib:
|
||||
mb_create dd amb_create
|
||||
mb_reinit dd amb_reinit
|
||||
mb_setfunctions dd amb_setfunctions
|
||||
dd 0,0
|
||||
amb_create db 'mb_create',0
|
||||
amb_reinit db 'mb_reinit',0
|
||||
amb_setfunctions db 'mb_setfunctions',0
|
||||
|
||||
align 4
|
||||
import_libimg:
|
||||
dd alib_init1
|
||||
img_to_rgb2 dd aimg_to_rgb2
|
||||
img_decode dd aimg_decode
|
||||
img_destroy dd aimg_destroy
|
||||
dd 0,0
|
||||
alib_init1 db 'lib_init',0
|
||||
aimg_to_rgb2 db 'img_to_rgb2',0
|
||||
aimg_decode db 'img_decode',0 ;автоматически определяет формат графических данных
|
||||
aimg_destroy db 'img_destroy',0
|
||||
|
||||
align 4
|
||||
import_libini:
|
||||
dd alib_init2
|
||||
ini_get_str dd aini_get_str
|
||||
ini_get_int dd aini_get_int
|
||||
ini_get_color dd aini_get_color
|
||||
dd 0,0
|
||||
alib_init2 db 'lib_init',0
|
||||
aini_get_str db 'ini_get_str',0
|
||||
aini_get_int db 'ini_get_int',0
|
||||
aini_get_color db 'ini_get_color',0
|
||||
|
||||
align 4
|
||||
import_libkmenu:
|
||||
kmenu_init dd akmenu_init
|
||||
kmainmenu_draw dd akmainmenu_draw
|
||||
kmainmenu_dispatch_cursorevent dd akmainmenu_dispatch_cursorevent
|
||||
ksubmenu_new dd aksubmenu_new
|
||||
ksubmenu_delete dd aksubmenu_delete
|
||||
ksubmenu_draw dd aksubmenu_draw
|
||||
ksubmenu_add dd aksubmenu_add
|
||||
kmenuitem_new dd akmenuitem_new
|
||||
kmenuitem_delete dd akmenuitem_delete
|
||||
kmenuitem_draw dd akmenuitem_draw
|
||||
dd 0,0
|
||||
akmenu_init db 'kmenu_init',0
|
||||
akmainmenu_draw db 'kmainmenu_draw',0
|
||||
akmainmenu_dispatch_cursorevent db 'kmainmenu_dispatch_cursorevent',0
|
||||
aksubmenu_new db 'ksubmenu_new',0
|
||||
aksubmenu_delete db 'ksubmenu_delete',0
|
||||
aksubmenu_draw db 'ksubmenu_draw',0
|
||||
aksubmenu_add db 'ksubmenu_add',0
|
||||
akmenuitem_new db 'kmenuitem_new',0
|
||||
akmenuitem_delete db 'kmenuitem_delete',0
|
||||
akmenuitem_draw db 'kmenuitem_draw',0
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
wScr scrollbar 16,50, 300,50, 15, 100,30,0, 0,0,0, 1
|
||||
|
||||
align 4
|
||||
hScr scrollbar 150,0, 16,50, 15, 100,30,0, 0,0,0, 1
|
||||
|
||||
;дочерний скроллинг для элемента ListBox
|
||||
align 4
|
||||
ws_dir_lbox scrollbar 16,0, 30,70, 15, 100,30,0, 0,0,0, 1
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
OpenDialog_data:
|
||||
.type dd 0
|
||||
.procinfo dd procinfo ;+4
|
||||
.com_area_name dd communication_area_name ;+8
|
||||
.com_area dd 0 ;+12
|
||||
.opendir_path dd plugin_path ;+16
|
||||
.dir_default_path dd default_dir ;+20
|
||||
.start_path dd file_name ;+24 путь к диалогу открытия файлов
|
||||
.draw_window dd draw_window ;+28
|
||||
.status dd 0 ;+32
|
||||
.openfile_path dd openfile_path ;+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
|
||||
|
||||
default_dir db '/sys',0 ;директория по умолчанию
|
||||
|
||||
communication_area_name:
|
||||
db 'FFFFFFFF_open_dialog',0
|
||||
open_dialog_name:
|
||||
db 'opendial',0
|
||||
communication_area_default_path:
|
||||
db '/sys/File managers/',0
|
||||
|
||||
Filter:
|
||||
dd Filter.end - Filter.1
|
||||
.1:
|
||||
db 'ASM',0
|
||||
db 'CPP',0
|
||||
db 'INC',0
|
||||
db 'MAC',0
|
||||
db 'INI',0
|
||||
db 'TXT',0
|
||||
db 'H',0
|
||||
db 'C',0
|
||||
db 'HTM',0
|
||||
db 'HTML',0
|
||||
db 'PY',0
|
||||
db 'SH',0
|
||||
db 'BAT',0
|
||||
db 'LUA',0
|
||||
db 'INF',0
|
||||
db 'LOG',0
|
||||
db 'DBG',0
|
||||
db 'DAT',0
|
||||
.end:
|
||||
db 0
|
||||
|
||||
txt_Info db '" -tI',0
|
||||
|
||||
TED_PANEL_NULL equ 0 ;нет открытой панели
|
||||
TED_PANEL_FIND equ 1 ;панель поиска
|
||||
TED_PANEL_REPLACE equ 2 ;панель замены
|
||||
TED_PANEL_SYNTAX equ 3 ;панель выбора файлов подсветки
|
||||
TED_PANEL_GOTO equ 4 ;панель перехода
|
||||
TED_PANEL_WIDTH equ 150 ;ширина панели
|
||||
|
||||
count_of_dir_list_files equ 15 ;максимальное число файлов синтаксиса показываемых в окне элемента tree1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
struct TexSelect
|
||||
x0 dd ?
|
||||
y0 dd ?
|
||||
x1 dd ?
|
||||
y1 dd ?
|
||||
ends
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
tedit0: ;структура текстового редактора
|
||||
.wnd BOX 0,50,440,150 ;+ 0
|
||||
.rec BOX 30,25,ini_def_symbol_w,ini_def_symbol_h ;+16
|
||||
.drag_m db 0 ;+32 выделение от мыши
|
||||
.drag_k db 0 ;+33 выделение от клавиатуры
|
||||
.sel TexSelect 0,0,0,0 ;+34 структура выделения
|
||||
.seln TexSelect ;+50 дополнительная структура выделения
|
||||
.tex dd 0 ;+66 text memory pointer
|
||||
.tex_1 dd 0 ;+70 text first symbol pointer
|
||||
.tex_end dd 0 ;+74 text end memory pointer
|
||||
.cur_x dd 0 ;+78 координата x курсора
|
||||
.cur_y dd 0 ;+82 координата y курсора
|
||||
.max_chars dd maxChars ;+86 максимальное число символов в одном документе
|
||||
.count_colors_text dd 1 ;+90 колличество цветов текста
|
||||
.count_key_words dd 0 ;+94 колличество ключевых слов
|
||||
.color_cursor dd 0x808080 ;+98 цвет курсора
|
||||
.color_wnd_capt dd 0x80 ;+102 цвет полей вокруг окна
|
||||
.color_wnd_work dd 0x0 ;+106 цвет фона окна
|
||||
.color_wnd_bord dd 0xd0d0d0 ;+110 цвет текста на полях
|
||||
.color_select dd 0x208080 ;+114 цвет выделения
|
||||
.color_cur_text dd 0xff0000 ;+118 цвет символа под курсором
|
||||
.color_wnd_text dd 0xffff00 ;+122 цвет текста в окне
|
||||
.syntax_file dd 0 ;+126 указатель на начало файла синтаксиса
|
||||
.syntax_file_size dd maxSyntaxFileSize ;+130 максимальный размер файла синтаксиса
|
||||
.text_colors dd 0 ;+134 указатель на массив цветов текста
|
||||
.help_text_f1 dd 0 ;+138 указатель на текст справки (по нажатии F1)
|
||||
.help_id dd -1 ;+142 идентификатор для справки
|
||||
.key_words_data dd 0 ;+146 указатель на структуры ключевых слов TexColViv
|
||||
.tim_ch dd ? ;+150 количество изменений в файле
|
||||
.tim_undo dd ? ;+154 количество отмененных действий
|
||||
.tim_ls dd ? ;+158 время последнего сохранения
|
||||
.tim_co dd ? ;+162 время последней цветовой разметки
|
||||
.el_focus dd el_focus ;+166 указатель на переменную элемента в фокусе
|
||||
.err_save db 0 ;+170 ошибка сохранения файла
|
||||
.panel_id db 0 ;+171 номер открытой панели
|
||||
.key_new db 0 ;+172 символ, который будет добавлятся с клавиатуры
|
||||
.symbol_new_line db 20 ;+173 символ завершения строки
|
||||
.scr_w dd wScr ;+174 вертикальный скроллинг
|
||||
.scr_h dd hScr ;+178 горизонтальный скроллинг
|
||||
.arr_key_pos dd 0 ;+182 указатель на массив позиций ключевых слов
|
||||
.buffer dd buf ;+186 указатель на буфер копирования/вставки
|
||||
.buffer_find dd buf_find ;+190 указатель на буфер для поиска
|
||||
.cur_ins db 1 ;+194 режим работы курсора (обычный или замена)
|
||||
.mode_color db 1 ;+195 режим выделения слов цветом (0-выкл. 1-вкл.)
|
||||
.mode_invis db 0 ;+196 режим показа непечатаемых символов
|
||||
.gp_opt db 0 ;+197 опции возвращаемые функцией ted_get_pos_by_cursor
|
||||
.fun_on_key_ctrl_all dd ted_but_ctrl_all ;+198 указатель на функцию вызываемую при нажатии Ctrl+N,O,S,F,H,G
|
||||
dd 0,0,0 ;зарезервировано
|
||||
.buffer_size dd BUF_SIZE ;+214 размер буфера копирования/вставки
|
||||
.fun_find_err dd ted_on_find_err ;+218 указатель на функцию вызываемую если поиск закончился неудачно
|
||||
.fun_init_synt_err dd 0 ;+222
|
||||
.fun_draw_panel_buttons dd draw_but_toolbar ;+226 указатель на функцию рисования панели с кнопками
|
||||
.fun_draw_panels dd draw_panels ;+230 указатель на функцию рисования панели поиска/замены
|
||||
dd 0 ;+234 зарезервировано
|
||||
.fun_save_err dd ted_save_err_msg ;+238 указатель на функцию вызываемую если сохранение файла закончилось неудачно
|
||||
.increase_size dd 200 ;+242 число символов на которые будет увечиваться память при нехватке
|
||||
.ptr_free_symb dd ? ;+246 используется внутри элемента для ускорения вставки текста
|
||||
.font_size dd 0 ;+250 множитель для размера шрифта
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
conv_tabl rb 128 ; таблица для конвертирования scan-кода в ascii-код
|
||||
|
||||
el_focus dd tedit0
|
||||
mouse_dd dd 0
|
||||
tree1 tree_list 264,count_of_dir_list_files+2, tl_key_no_edit+tl_draw_par_line+tl_list_box_mode,\
|
||||
16,16, 0x8080ff,0x0000ff,0xffffff, 0,70,TED_PANEL_WIDTH-17,120, 0,0,0, el_focus,\
|
||||
ws_dir_lbox,0
|
||||
|
||||
;dir_list memory
|
||||
tree_file_struct:
|
||||
dd 1,0,0,count_of_dir_list_files
|
||||
dd dir_mem
|
||||
db 0
|
||||
.f: dd file_name
|
||||
|
||||
align 4
|
||||
opt_gr1 dd opt1
|
||||
opt_grlist1 dd opt1,opt2,opt3,0 ;end option group
|
||||
|
||||
opt1 option_box opt_gr1, 5, 90,6,12,0xd0d0ff, 0xff, 0x80ff,txt_f_opt_next,txt_f_opt_next.end-txt_f_opt_next
|
||||
opt2 option_box opt_gr1, 5,108,6,12,0xd0d0ff, 0xff, 0x80ff,txt_f_opt_perv,txt_f_opt_perv.end-txt_f_opt_perv
|
||||
opt3 option_box opt_gr1, 5,126,6,12,0xd0d0ff, 0xff, 0x80ff,txt_f_opt_beg,txt_f_opt_beg.end-txt_f_opt_beg
|
||||
|
||||
check_boxes:
|
||||
ch1 check_box2 (5 shl 16+12),(144 shl 16 +12),5,0xffffff,0,0x80ff,ch_text.1,ch_flag_en+ch_flag_middle
|
||||
check_boxes_end:
|
||||
|
||||
|
||||
|
||||
if lang eq ru_RU
|
||||
|
||||
msgbox_1:
|
||||
db '"Замена',13,10,'Сделано замен: '
|
||||
.z: rb 10
|
||||
msgbox_2:
|
||||
db 3,0
|
||||
db 'Внимание',0
|
||||
db 'Сохранить изменения в файле?',0
|
||||
db 'Сохранить',0
|
||||
db 'Не сохранять',0
|
||||
db 'Отмена',0
|
||||
db 0
|
||||
msgbox_3:
|
||||
db 1,0
|
||||
db 'Внимание',0
|
||||
db 'Ошибка при открытии файла с цветовыми настройками!',13,\
|
||||
'Потому выделение слов цветом не возможно.',13,\
|
||||
' (код ошибки ='
|
||||
.err: db '?'
|
||||
db ')',0
|
||||
db 'Закрыть',0
|
||||
db 0
|
||||
msgbox_4:
|
||||
db 1,0
|
||||
db 'Внимание',0
|
||||
db 'Ошибка при открытии файла!',13,\
|
||||
'Возможно имя файла введено не правильно.',13,\
|
||||
' (код ошибки ='
|
||||
.err: db '?'
|
||||
db ')',0
|
||||
db 'Закрыть',0
|
||||
db 0
|
||||
msgbox_6:
|
||||
db 1,0
|
||||
db 'Внимание',0
|
||||
db 'Ошибка при сохранении файла!',13,\
|
||||
'Возможно имя файла введено не правильно.',13,\
|
||||
' (код ошибки ='
|
||||
.err: db '?'
|
||||
db ')',0
|
||||
db 'Закрыть',0
|
||||
db 0
|
||||
msgbox_7:
|
||||
db '"Текст не найден',13,10
|
||||
db 'Попробуйте или изменить запрос и повторить поиск." -tI',0
|
||||
msgbox_9:
|
||||
db 3,0
|
||||
db 'Внимание',0
|
||||
db 'Не открылся ',39,'диалог открытия файла',39,'.',13
|
||||
.fdp:
|
||||
rb 100
|
||||
db 0
|
||||
db 'Закрыть',0
|
||||
db 0
|
||||
|
||||
txtFindCapt db 'Поиск:',0
|
||||
txtFindNext db 'Найти далее',0
|
||||
txtRerlaceCapt db 'Чем заменить:',0
|
||||
txtRerlace db 'Заменить',0
|
||||
txtRerlaceAll db 'Заменить все',0
|
||||
txtFormatCapt db 'Формат',0
|
||||
txtFormatApply db 'Применить',0
|
||||
txtReplace db 'Заменить',0
|
||||
txtReplaceAll db 'Заменить все',0
|
||||
txtGotoCapt db 'Переход на строку:',0
|
||||
txtGoto db 'Перейти',0
|
||||
txt_f_opt_next: db 'Вниз'
|
||||
.end: db 0
|
||||
txt_f_opt_perv: db 'Вверх'
|
||||
.end: db 0
|
||||
txt_f_opt_beg: db 'С начала'
|
||||
.end: db 0
|
||||
ch_text:
|
||||
.1 db 'Учитывать регистр',0
|
||||
|
||||
else ; Default to en_US
|
||||
|
||||
msgbox_1:
|
||||
db '"Replace',13,10,'Made replacements: '
|
||||
.z: rb 10
|
||||
msgbox_2:
|
||||
db 3,0
|
||||
db 'Warning',0
|
||||
db 'Save changes to the file?',0
|
||||
db 'Save',0
|
||||
db 'Discard',0
|
||||
db 'Cancel',0
|
||||
db 0
|
||||
msgbox_3:
|
||||
db 1,0
|
||||
db 'Warning',0
|
||||
db 'Error opening the file with the color settings!',13,\
|
||||
'Because color selection of words is not possible.',13,\
|
||||
' (error code ='
|
||||
.err: db '?'
|
||||
db ')',0
|
||||
db 'Close',0
|
||||
db 0
|
||||
msgbox_4:
|
||||
db 1,0
|
||||
db 'Warning',0
|
||||
db 'Error opening file!',13,\
|
||||
'Maybe the file name is not entered correctly.',13,\
|
||||
' (error code ='
|
||||
.err: db '?'
|
||||
db ')',0
|
||||
db 'Close',0
|
||||
db 0
|
||||
msgbox_6:
|
||||
db 1,0
|
||||
db 'Warning',0
|
||||
db 'Error saving file!',13,\
|
||||
'Maybe the file name is not entered correctly.',13,\
|
||||
' (error code ='
|
||||
.err: db '?'
|
||||
db ')',0
|
||||
db 'Close',0
|
||||
db 0
|
||||
msgbox_7:
|
||||
db '"Text not found.',13,10
|
||||
db 'Try change the query and search again." -tI',0
|
||||
msgbox_9:
|
||||
db 3,0
|
||||
db 'Warning',0
|
||||
db 'Error run ',39,'open file dialog',39,'.',13
|
||||
.fdp:
|
||||
rb 100
|
||||
db 0
|
||||
db 'Close',0
|
||||
db 0
|
||||
|
||||
txtFindCapt db 'Search:',0
|
||||
txtFindNext db 'Find next',0
|
||||
txtRerlaceCapt db 'Replace with:',0
|
||||
txtRerlace db 'Replace',0
|
||||
txtRerlaceAll db 'Replace all',0
|
||||
txtFormatCapt db 'Format',0
|
||||
txtFormatApply db 'Apply',0
|
||||
txtReplace db 'Replace',0
|
||||
txtReplaceAll db 'Replace all',0
|
||||
txtGotoCapt db 'Go to line:',0
|
||||
txtGoto db 'Go to',0
|
||||
txt_f_opt_next: db 'Down'
|
||||
.end: db 0
|
||||
txt_f_opt_perv: db 'Up'
|
||||
.end: db 0
|
||||
txt_f_opt_beg: db 'At first'
|
||||
.end: db 0
|
||||
ch_text:
|
||||
.1 db 'Case sensitive',0
|
||||
|
||||
end if
|
||||
|
||||
;функции для кнопок в сообщениях
|
||||
msgbox_2N_funct:
|
||||
dd On_SaveAndNewFile
|
||||
dd On_NewFile
|
||||
dd 0
|
||||
msgbox_2O_funct:
|
||||
dd On_SaveAndOpenFile
|
||||
dd ted_but_open_file.no_msg
|
||||
dd 0
|
||||
msgbox_2E_funct:
|
||||
dd On_SaveAndExit
|
||||
dd On_Exit
|
||||
dd 0
|
||||
|
||||
KM_SHIFT equ 0x00010000
|
||||
KM_CTRL equ 0x00020000
|
||||
KM_ALT equ 0x00040000
|
||||
KM_NUMLOCK equ 0x00080000
|
||||
|
||||
; KEY CODES
|
||||
KEY_F1 equ 0x0000003B
|
||||
KEY_F2 equ 0x0000003C
|
||||
KEY_F3 equ 0x0000003D
|
||||
@@ -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 'Поиск в ключевых словах',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 'Поиск в ключевых словах',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
|
||||
+1075
-1080
File diff suppressed because it is too large.
Load diff
@@ -1,321 +1,323 @@
|
||||
; program data
|
||||
|
||||
curMonth dd ?
|
||||
curYear dd ?
|
||||
curDay dd ?
|
||||
|
||||
remainder dd ?
|
||||
quotient dd ?
|
||||
|
||||
firstday dd ?
|
||||
Year dd ?
|
||||
Month dd ?
|
||||
day_sel dd ?
|
||||
|
||||
datestr dd ?
|
||||
leap_year dd ?
|
||||
number dd ?
|
||||
|
||||
; colors
|
||||
COL_WINDOW_BG equ 0x54E7E7E7
|
||||
COL_TOOLBAR_BG equ 0x555555
|
||||
COL_ACTIVE_TEXT equ 0x10e7c750
|
||||
COL_WEEKDAY_BG equ 0xCCCDDD
|
||||
COL_DATE_BUTTONS equ 0xF3F3F3
|
||||
COL_TIME_BUTTONS equ 0x5555dd
|
||||
COL_GO_TODAY_T equ 0xd048c8
|
||||
COL_MONTH_YEAR_B equ 0x555555
|
||||
COL_DROPDOWN_BG equ 0x666666
|
||||
COL_DROPDOWN_T equ 0x10CCCccc
|
||||
COL_NEW_STYLE_T equ 0xef3333
|
||||
|
||||
COL_DATE_INACTIVE_1 equ 0x388CAF
|
||||
COL_DATE_INACTIVE_2 equ 0x75B9D5
|
||||
COL_DATE_INACTIVE_3 equ 0x9ECBDF
|
||||
COL_DATE_INACTIVE_4 equ 0xABD7E8
|
||||
|
||||
COL_DATE_ACTIVE_1 equ 0xA57F2C
|
||||
COL_DATE_ACTIVE_2 equ 0xEFB52D
|
||||
COL_DATE_ACTIVE_3 equ 0xFAD84C
|
||||
COL_DATE_ACTIVE_4 equ 0xFAE995
|
||||
|
||||
COL_DATE_1 equ 0x8C8C8C
|
||||
COL_DATE_2 equ 0xFFFfff
|
||||
COL_DATE_3 equ 0xF2F2F2
|
||||
COL_DATE_4 equ 0xF2F2F2
|
||||
|
||||
; definitions
|
||||
WIN_W equ 275
|
||||
WIN_H equ 326
|
||||
|
||||
DATE_BUTTON_WIDTH equ 32
|
||||
DATE_BUTTON_HEIGHT equ 30
|
||||
|
||||
|
||||
LINE1 equ 27 shl 16+16
|
||||
B_MONTH_X equ 15 shl 16+158
|
||||
B_Y equ LINE1
|
||||
B_MONTH equ 63 shl 16+27
|
||||
|
||||
BT_WBAR_Y equ 283 shl 16+43
|
||||
|
||||
B_WBAR_X equ 1 shl 16+WIN_W-1
|
||||
B_WBAR_Y equ 64 shl 16+20
|
||||
B_WEEK equ 34 shl 16+66
|
||||
B_WX_SHIFT equ 32 shl 16
|
||||
|
||||
B_DROP equ B_MONTH+16
|
||||
B_DAYS_Y equ 106
|
||||
B_DAYS_SHIFT equ 30
|
||||
|
||||
B_YEAR equ 204 shl 16+28
|
||||
|
||||
B_SPIN_X equ 186 shl 16+12
|
||||
B_SPIN equ 188 shl 16+28
|
||||
spinner db '< >'
|
||||
|
||||
B_TODAY_X equ 25 shl 16
|
||||
B_TODAY_Y equ 48 shl 16+10
|
||||
B_TODAY equ 30 shl 16+50
|
||||
|
||||
B_NS_X equ 185 shl 16+75
|
||||
B_NS_Y equ 48 shl 16+10
|
||||
B_NS equ 190 shl 16+50
|
||||
|
||||
FOCUSABLE equ 4
|
||||
|
||||
; multilanguage interface - configuratable in lang.inc
|
||||
day_count db 3,0,3,2,3,2,3,3,2,3,2,3
|
||||
Fkeys db 210,211,212,213,214,215,216,217,208,209,228,159
|
||||
|
||||
month_name:
|
||||
if lang eq ru_RU
|
||||
db 8
|
||||
db 'Январь '
|
||||
db 'Февраль '
|
||||
db 'Март '
|
||||
db 'Апрель '
|
||||
db 'Май '
|
||||
db 'Июнь '
|
||||
db 'Июль '
|
||||
db 'Август '
|
||||
db 'Сентябрь'
|
||||
db 'Октябрь '
|
||||
db 'Ноябрь '
|
||||
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 'Пн'
|
||||
db 'Вт'
|
||||
db 'Ср'
|
||||
db 'Чт'
|
||||
db 'Пт'
|
||||
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 'Ноябрь '
|
||||
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 'Пн'
|
||||
db 'Вт'
|
||||
db 'Ср'
|
||||
db 'Чт'
|
||||
db 'Пт'
|
||||
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
|
||||
+165
-163
@@ -1,163 +1,165 @@
|
||||
;
|
||||
; ╙яЁртыхэшх ыюЄърьш фшёъют√ї яЁштюфют ATAPI
|
||||
; 22.07.2007 Mario79 шёїюфэ√щ трЁшрэЄ
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
use32 ; тъы■ўшЄ№ 32-сшЄэ√щ Ёхцшь рёёхьсыхЁр
|
||||
org 0x0 ; рфЁхёрЎш ё эєы
|
||||
|
||||
db 'MENUET01' ; 8-срщЄэ√щ шфхэЄшЇшърЄюЁ MenuetOS
|
||||
dd 0x01 ; тхЁёш чруюыютър (тёхуфр 1)
|
||||
dd START ; рфЁхё яхЁтющ ъюьрэф√
|
||||
dd I_END ; ЁрчьхЁ яЁюуЁрьь√
|
||||
dd 0x11000 ; ъюышўхёЄтю ярь Єш
|
||||
dd 0x11000 ; рфЁхё тхЁ°шэ√ ёЄ¤ър
|
||||
dd 0x0 ; рфЁхё сєЇхЁр фы ярЁрьхЄЁют (эх шёяюы№чєхЄё )
|
||||
dd 0x0 ; чрЁхчхЁтшЁютрэю
|
||||
|
||||
include 'macros.inc' ; ьръЁюё√ юсыхуўр■Є цшчэ№ рёёхьсыхЁ∙шъют!
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
;--- ═└╫└╦╬ ╧╨╬├╨└╠╠█ ----------------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
START:
|
||||
|
||||
red: ; яхЁхЁшёютрЄ№ юъэю
|
||||
call draw_window ; т√ч√трхь яЁюЎхфєЁє юЄЁшёютъш юъэр
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
;--- ╓╚╩╦ ╬┴╨└┴╬╥╩╚ ╤╬┴█╥╚╔ ----------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
still:
|
||||
mcall 10 ; ЇєэъЎш 10 - цфрЄ№ ёюс√Єш
|
||||
|
||||
cmp eax,1 ; яхЁхЁшёютрЄ№ юъэю ?
|
||||
je red ; хёыш фр - эр ьхЄъє red
|
||||
cmp eax,2 ; эрцрЄр ъыртш°р ?
|
||||
je key ; хёыш фр - эр key
|
||||
cmp eax,3 ; эрцрЄр ъэюяър ?
|
||||
je button ; хёыш фр - эр button
|
||||
|
||||
jmp still ; хёыш фЁєуюх ёюс√Єшх - т эрўрыю Ўшъыр
|
||||
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
|
||||
key: ; эрцрЄр ъыртш°р эр ъыртшрЄєЁх
|
||||
mcall 2 ; ЇєэъЎш 2 - ёўшЄрЄ№ ъюф ёшьтюыр (т ah)
|
||||
|
||||
jmp still ; тхЁэєЄ№ё ъ эрўрыє Ўшъыр
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
button:
|
||||
mcall 17 ; 17 - яюыєўшЄ№ шфхэЄшЇшърЄюЁ эрцрЄющ ъэюяъш
|
||||
; ъэюяъш 2,3,4,5 - load tray CD0/CD1/CD2/CD3
|
||||
movzx ecx, ah
|
||||
sub ecx, 2
|
||||
cmp ecx, 3
|
||||
ja b6
|
||||
mcall 24,5
|
||||
jmp red
|
||||
b6:
|
||||
; ъэюяъш 6,7,8,9 - eject tray CD0/CD1/CD2/CD3
|
||||
sub ecx, 4
|
||||
cmp ecx, 3
|
||||
ja b1
|
||||
mcall 24,4
|
||||
jmp red
|
||||
b1:
|
||||
cmp ah, 1 ; хёыш ═┼ эрцрЄр ъэюяър ё эюьхЁюь 1,
|
||||
jne still ; тхЁэєЄ№ё
|
||||
|
||||
.exit:
|
||||
mcall -1 ; шэрўх ъюэхЎ яЁюуЁрьь√
|
||||
|
||||
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
;--- ╬╧╨┼─┼╦┼═╚┼ ╚ ╬╥╨╚╤╬┬╩└ ╬╩═└ ----------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
draw_window:
|
||||
mcall 12, 1 ; ЇєэъЎш 12: ёююс∙шЄ№ ╬╤ юс юЄЁшёютъх юъэр
|
||||
; 1 - эрўшэрхь ЁшёютрЄ№
|
||||
; ╤╬╟─└ш╠ ╬╩═╬
|
||||
|
||||
if lang eq it_IT
|
||||
mcall 0, <100,250>, <100,110>, 0x03AABBCC, 0x805080D0, 0x005080D0
|
||||
else
|
||||
mcall 0, <100,230>, <100,110>, 0x03AABBCC, 0x805080D0, 0x005080D0
|
||||
end if
|
||||
mcall 71, 1 ,header
|
||||
mcall 8,<15,42>,<40,20>,2,0xaaaaaa
|
||||
call draw_buttons
|
||||
mov edx,6
|
||||
add ecx,30 shl 16
|
||||
mcall
|
||||
call draw_buttons
|
||||
|
||||
if lang eq it_IT
|
||||
mcall 4, <16,25>, 0x80ffffff,text1
|
||||
else
|
||||
mcall 4, <25,25>, 0x80ffffff,text1
|
||||
end if
|
||||
mov edx,text2
|
||||
|
||||
add ebx,3 shl 16+20
|
||||
mcall
|
||||
mov edx,text3
|
||||
add ebx,30
|
||||
sub ebx,3 shl 16
|
||||
mcall
|
||||
|
||||
mcall 12, 2 ; ЇєэъЎш 12: ёююс∙шЄ№ ╬╤ юс юЄЁшёютъх юъэр
|
||||
; 2, чръюэўшыш ЁшёютрЄ№
|
||||
|
||||
ret ; т√їюфшь шч яЁюЎхфєЁ√
|
||||
|
||||
draw_buttons:
|
||||
pusha
|
||||
if lang eq it_IT
|
||||
add ebx,60 shl 16
|
||||
else
|
||||
add ebx,50 shl 16
|
||||
end if
|
||||
inc edx
|
||||
mcall
|
||||
if lang eq it_IT
|
||||
add ebx,60 shl 16
|
||||
else
|
||||
add ebx,50 shl 16
|
||||
end if
|
||||
inc edx
|
||||
mcall
|
||||
if lang eq it_IT
|
||||
add ebx,60 shl 16
|
||||
else
|
||||
add ebx,50 shl 16
|
||||
end if
|
||||
inc edx
|
||||
mcall
|
||||
popa
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
;--- ─└══█┼ ╧╨╬├╨└╠╠█ ----------------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
header db ' ATAPI Device Tray Control',0
|
||||
if lang eq it_IT
|
||||
text3 db 'espelli espelli espelli espelli',0
|
||||
text2 db 'carica carica carica carica',0
|
||||
text1 db '/cd0/ /cd1/ /cd2/ /cd3/',0
|
||||
else
|
||||
text3 db 'eject eject eject eject',0
|
||||
text2 db 'load load load load',0
|
||||
text1 db '/cd0/ /cd1/ /cd2/ /cd3/',0
|
||||
end if
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
I_END: ; ьхЄър ъюэЎр яЁюуЁрьь√
|
||||
;
|
||||
; ╙яЁртыхэшх ыюЄърьш фшёъют√ї яЁштюфют ATAPI
|
||||
; 22.07.2007 Mario79 шёїюфэ√щ трЁшрэЄ
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
use32 ; тъы■ўшЄ№ 32-сшЄэ√щ Ёхцшь рёёхьсыхЁр
|
||||
org 0x0 ; рфЁхёрЎш ё эєы
|
||||
|
||||
db 'MENUET01' ; 8-срщЄэ√щ шфхэЄшЇшърЄюЁ MenuetOS
|
||||
dd 0x01 ; тхЁёш чруюыютър (тёхуфр 1)
|
||||
dd START ; рфЁхё яхЁтющ ъюьрэф√
|
||||
dd I_END ; ЁрчьхЁ яЁюуЁрьь√
|
||||
dd 0x11000 ; ъюышўхёЄтю ярь Єш
|
||||
dd 0x11000 ; рфЁхё тхЁ°шэ√ ёЄ¤ър
|
||||
dd 0x0 ; рфЁхё сєЇхЁр фы ярЁрьхЄЁют (эх шёяюы№чєхЄё )
|
||||
dd 0x0 ; чрЁхчхЁтшЁютрэю
|
||||
|
||||
; Language support for locales: it_IT, en_US.
|
||||
|
||||
include 'macros.inc' ; ьръЁюё√ юсыхуўр■Є цшчэ№ рёёхьсыхЁ∙шъют!
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
;--- ═└╫└╦╬ ╧╨╬├╨└╠╠█ ----------------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
START:
|
||||
|
||||
red: ; яхЁхЁшёютрЄ№ юъэю
|
||||
call draw_window ; т√ч√трхь яЁюЎхфєЁє юЄЁшёютъш юъэр
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
;--- ╓╚╩╦ ╬┴╨└┴╬╥╩╚ ╤╬┴█╥╚╔ ----------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
still:
|
||||
mcall 10 ; ЇєэъЎш 10 - цфрЄ№ ёюс√Єш
|
||||
|
||||
cmp eax,1 ; яхЁхЁшёютрЄ№ юъэю ?
|
||||
je red ; хёыш фр - эр ьхЄъє red
|
||||
cmp eax,2 ; эрцрЄр ъыртш°р ?
|
||||
je key ; хёыш фр - эр key
|
||||
cmp eax,3 ; эрцрЄр ъэюяър ?
|
||||
je button ; хёыш фр - эр button
|
||||
|
||||
jmp still ; хёыш фЁєуюх ёюс√Єшх - т эрўрыю Ўшъыр
|
||||
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
|
||||
key: ; эрцрЄр ъыртш°р эр ъыртшрЄєЁх
|
||||
mcall 2 ; ЇєэъЎш 2 - ёўшЄрЄ№ ъюф ёшьтюыр (т ah)
|
||||
|
||||
jmp still ; тхЁэєЄ№ё ъ эрўрыє Ўшъыр
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
button:
|
||||
mcall 17 ; 17 - яюыєўшЄ№ шфхэЄшЇшърЄюЁ эрцрЄющ ъэюяъш
|
||||
; ъэюяъш 2,3,4,5 - load tray CD0/CD1/CD2/CD3
|
||||
movzx ecx, ah
|
||||
sub ecx, 2
|
||||
cmp ecx, 3
|
||||
ja b6
|
||||
mcall 24,5
|
||||
jmp red
|
||||
b6:
|
||||
; ъэюяъш 6,7,8,9 - eject tray CD0/CD1/CD2/CD3
|
||||
sub ecx, 4
|
||||
cmp ecx, 3
|
||||
ja b1
|
||||
mcall 24,4
|
||||
jmp red
|
||||
b1:
|
||||
cmp ah, 1 ; хёыш ═┼ эрцрЄр ъэюяър ё эюьхЁюь 1,
|
||||
jne still ; тхЁэєЄ№ё
|
||||
|
||||
.exit:
|
||||
mcall -1 ; шэрўх ъюэхЎ яЁюуЁрьь√
|
||||
|
||||
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
;--- ╬╧╨┼─┼╦┼═╚┼ ╚ ╬╥╨╚╤╬┬╩└ ╬╩═└ ----------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
draw_window:
|
||||
mcall 12, 1 ; ЇєэъЎш 12: ёююс∙шЄ№ ╬╤ юс юЄЁшёютъх юъэр
|
||||
; 1 - эрўшэрхь ЁшёютрЄ№
|
||||
; ╤╬╟─└ш╠ ╬╩═╬
|
||||
|
||||
if lang eq it_IT
|
||||
mcall 0, <100,250>, <100,110>, 0x03AABBCC, 0x805080D0, 0x005080D0
|
||||
else ; Default to en_US
|
||||
mcall 0, <100,230>, <100,110>, 0x03AABBCC, 0x805080D0, 0x005080D0
|
||||
end if
|
||||
mcall 71, 1 ,header
|
||||
mcall 8,<15,42>,<40,20>,2,0xaaaaaa
|
||||
call draw_buttons
|
||||
mov edx,6
|
||||
add ecx,30 shl 16
|
||||
mcall
|
||||
call draw_buttons
|
||||
|
||||
if lang eq it_IT
|
||||
mcall 4, <16,25>, 0x80ffffff,text1
|
||||
else ; Default to en_US
|
||||
mcall 4, <25,25>, 0x80ffffff,text1
|
||||
end if
|
||||
mov edx,text2
|
||||
|
||||
add ebx,3 shl 16+20
|
||||
mcall
|
||||
mov edx,text3
|
||||
add ebx,30
|
||||
sub ebx,3 shl 16
|
||||
mcall
|
||||
|
||||
mcall 12, 2 ; ЇєэъЎш 12: ёююс∙шЄ№ ╬╤ юс юЄЁшёютъх юъэр
|
||||
; 2, чръюэўшыш ЁшёютрЄ№
|
||||
|
||||
ret ; т√їюфшь шч яЁюЎхфєЁ√
|
||||
|
||||
draw_buttons:
|
||||
pusha
|
||||
if lang eq it_IT
|
||||
add ebx,60 shl 16
|
||||
else ; Default to en_US
|
||||
add ebx,50 shl 16
|
||||
end if
|
||||
inc edx
|
||||
mcall
|
||||
if lang eq it_IT
|
||||
add ebx,60 shl 16
|
||||
else ; Default to en_US
|
||||
add ebx,50 shl 16
|
||||
end if
|
||||
inc edx
|
||||
mcall
|
||||
if lang eq it_IT
|
||||
add ebx,60 shl 16
|
||||
else ; Default to en_US
|
||||
add ebx,50 shl 16
|
||||
end if
|
||||
inc edx
|
||||
mcall
|
||||
popa
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
;--- ─└══█┼ ╧╨╬├╨└╠╠█ ----------------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
header db ' ATAPI Device Tray Control',0
|
||||
if lang eq it_IT
|
||||
text3 db 'espelli espelli espelli espelli',0
|
||||
text2 db 'carica carica carica carica',0
|
||||
text1 db '/cd0/ /cd1/ /cd2/ /cd3/',0
|
||||
else ; Default to en_US
|
||||
text3 db 'eject eject eject eject',0
|
||||
text2 db 'load load load load',0
|
||||
text1 db '/cd0/ /cd1/ /cd2/ /cd3/',0
|
||||
end if
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
I_END: ; ьхЄър ъюэЎр яЁюуЁрьь√
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
use32
|
||||
org 0x0
|
||||
|
||||
|
||||
db "MENUET01" ; 8 byte id
|
||||
dd 0x01 ; header version
|
||||
dd START ; start of code
|
||||
@@ -16,7 +16,7 @@
|
||||
dd 0x0 ; boot parameters
|
||||
dd cur_dir_path ; path
|
||||
;-------------------------------------------------------------------------------
|
||||
include "lang.inc"
|
||||
include "lang.inc" ; Language support for locales (UTF-8): de_DE, et_EE, ru_RU, it_IT, en_US.
|
||||
include "../../../macros.inc"
|
||||
include "../../../develop/libraries/box_lib/trunk/box_lib.mac"
|
||||
include "../../../KOSfuncs.inc"
|
||||
@@ -43,7 +43,7 @@ EDITBOX:
|
||||
.Y = UNDERTABLE.Y + BUTTON.HEIGHT + 20
|
||||
.WIDTH = 465
|
||||
.HEIGHT = 23
|
||||
|
||||
|
||||
CHECKBOX:
|
||||
.X = PROCESS_TABLE.X
|
||||
.Y = UNDERTABLE.Y + BUTTON.HEIGHT + 25
|
||||
@@ -300,7 +300,7 @@ draw_next_process:
|
||||
add ebx, BUTTON.WIDTH
|
||||
mcall
|
||||
|
||||
;create terminate process button
|
||||
;create terminate process button
|
||||
;mov ecx,[curposy]
|
||||
shl ecx,16
|
||||
mov cx, BUTTON.HEIGHT
|
||||
@@ -478,7 +478,7 @@ align 4
|
||||
;show window y size
|
||||
movzx eax, word [process_info_buffer.box.top]
|
||||
add ebx, 70 shl 16
|
||||
call draw_ra_dec_number
|
||||
call draw_ra_dec_number
|
||||
pop edi
|
||||
;-------------------------------------------------------------------------------
|
||||
align 4
|
||||
@@ -515,36 +515,36 @@ draw_window:
|
||||
|
||||
test [window_status],10b ; window is minimized to panel
|
||||
jnz .exit
|
||||
|
||||
|
||||
mov eax, strings.process_name
|
||||
mov ebx, 130 shl 16 + 5
|
||||
xor ecx, ecx
|
||||
call draw_ra_text
|
||||
|
||||
|
||||
mov eax, strings.ptid
|
||||
add ebx, 80 shl 16
|
||||
call draw_ra_text
|
||||
|
||||
|
||||
mov eax, strings.cpu_usage_cycles
|
||||
add ebx, 100 shl 16
|
||||
call draw_ra_text
|
||||
|
||||
|
||||
mov eax, strings.cpu_usage_percent
|
||||
add ebx, 55 shl 16
|
||||
call draw_ra_text
|
||||
|
||||
|
||||
mov eax, strings.memory_usage
|
||||
add ebx, 60 shl 16
|
||||
call draw_ra_text
|
||||
|
||||
|
||||
mov eax, strings.window_stack_pos
|
||||
add ebx, 70 shl 16
|
||||
call draw_ra_text
|
||||
|
||||
|
||||
mov eax, strings.window_position.x
|
||||
add ebx, 70 shl 16
|
||||
call draw_ra_text
|
||||
|
||||
|
||||
mov eax, strings.window_position.y
|
||||
add ebx, 70 shl 16
|
||||
call draw_ra_text
|
||||
@@ -621,7 +621,7 @@ align 4
|
||||
align 4
|
||||
.exit:
|
||||
ret
|
||||
|
||||
|
||||
;-------------------------------------------------------------------------------
|
||||
|
||||
draw_ra_dec_number:
|
||||
@@ -638,13 +638,13 @@ draw_ra_dec_number:
|
||||
|
||||
ror ebx, 16
|
||||
mov ebp, eax
|
||||
|
||||
|
||||
test edx, edx
|
||||
jz .no_postfix
|
||||
|
||||
|
||||
mov eax, edx
|
||||
call count_utf8z_chars
|
||||
|
||||
|
||||
test eax, eax
|
||||
jz .no_postfix
|
||||
push ecx
|
||||
@@ -655,13 +655,13 @@ draw_ra_dec_number:
|
||||
mcall SF_DRAW_TEXT
|
||||
ror ebx, 16
|
||||
pop ecx
|
||||
|
||||
|
||||
.no_postfix:
|
||||
mov eax, ebp
|
||||
push edx
|
||||
|
||||
xor edi, edi
|
||||
|
||||
|
||||
mov esi, 10
|
||||
@@:
|
||||
xor edx, edx
|
||||
@@ -681,7 +681,7 @@ draw_ra_dec_number:
|
||||
sub dx, ax
|
||||
rol edx, 16
|
||||
mcall SF_DRAW_NUMBER, (11 shl 16) or 0x80000000
|
||||
|
||||
|
||||
popa
|
||||
ret
|
||||
;-------------------------------------------------------------------------------
|
||||
@@ -702,7 +702,7 @@ draw_ra_data_size:
|
||||
cmp eax, 1024
|
||||
ja @f
|
||||
jmp .draw_text
|
||||
|
||||
|
||||
@@:
|
||||
cmp eax, 1024*1024
|
||||
jae @f
|
||||
@@ -710,7 +710,7 @@ draw_ra_data_size:
|
||||
div esi
|
||||
mov edx, strings.KB
|
||||
jmp .draw_text
|
||||
|
||||
|
||||
@@:
|
||||
cmp eax, 1024*1024*1024
|
||||
jae @f
|
||||
@@ -718,15 +718,15 @@ draw_ra_data_size:
|
||||
div esi
|
||||
mov edx, strings.MB
|
||||
jmp .draw_text
|
||||
|
||||
|
||||
@@:
|
||||
mov esi, 1024*1024*1024
|
||||
div esi
|
||||
mov edx, strings.GB
|
||||
|
||||
|
||||
.draw_text:
|
||||
call draw_ra_dec_number
|
||||
|
||||
|
||||
popa
|
||||
ret
|
||||
;-------------------------------------------------------------------------------
|
||||
@@ -743,9 +743,9 @@ draw_ra_text:
|
||||
|
||||
ror ebx, 16
|
||||
mov edx, eax
|
||||
|
||||
|
||||
call count_utf8z_chars
|
||||
|
||||
|
||||
test eax, eax
|
||||
jz .ret
|
||||
lea eax, [eax*8]
|
||||
@@ -753,7 +753,7 @@ draw_ra_text:
|
||||
rol ebx, 16
|
||||
or ecx, 0xB0000000
|
||||
mcall SF_DRAW_TEXT
|
||||
|
||||
|
||||
.ret:
|
||||
popa
|
||||
ret
|
||||
@@ -773,7 +773,7 @@ draw_button_with_caption:
|
||||
;ebx = x+width shl 16 + y
|
||||
;-------------------------------------------------------------------------------
|
||||
pusha
|
||||
|
||||
|
||||
xor ebp, ebp
|
||||
mov edi, eax
|
||||
test eax, eax
|
||||
@@ -782,7 +782,7 @@ draw_button_with_caption:
|
||||
call count_utf8z_chars
|
||||
mov ebp, eax
|
||||
|
||||
.no_caption_0:
|
||||
.no_caption_0:
|
||||
push ebx esi
|
||||
lea eax, [ebp*8]
|
||||
mov esi, edx
|
||||
@@ -804,7 +804,7 @@ draw_button_with_caption:
|
||||
mov ecx, esi
|
||||
or ecx, 0xB0000000
|
||||
mcall SF_DRAW_TEXT
|
||||
|
||||
|
||||
.no_caption_1:
|
||||
popa
|
||||
ret
|
||||
@@ -820,7 +820,7 @@ count_utf8z_chars:
|
||||
push esi ebx
|
||||
mov esi, eax
|
||||
xor ebx, ebx
|
||||
|
||||
|
||||
.0:
|
||||
lodsb
|
||||
test al, al
|
||||
@@ -836,25 +836,25 @@ count_utf8z_chars:
|
||||
ja @f
|
||||
inc esi
|
||||
jmp .0
|
||||
|
||||
|
||||
@@:
|
||||
cmp al, 0xEF
|
||||
ja @f
|
||||
inc esi
|
||||
inc esi
|
||||
jmp .0
|
||||
|
||||
|
||||
@@:
|
||||
cmp al, 0xF7
|
||||
ja .err
|
||||
add esi, 3
|
||||
jmp .0
|
||||
|
||||
|
||||
.ok:
|
||||
mov eax, ebx
|
||||
pop ebx esi
|
||||
ret
|
||||
|
||||
|
||||
.err:
|
||||
xor eax, eax
|
||||
pop ebx esi
|
||||
@@ -920,7 +920,7 @@ sys_reboot:
|
||||
strings:
|
||||
if lang eq de_DE
|
||||
.window_caption utf8z "Prozesse v0.2.3 - [Ctrl+Alt+Del]"
|
||||
|
||||
|
||||
.process_name utf8z "NAME/BEENDEN"
|
||||
.ptid utf8z "PID/TID"
|
||||
.cpu_usage_cycles utf8z "CPU(ZYKLEN)"
|
||||
@@ -929,21 +929,21 @@ if lang eq de_DE
|
||||
.window_stack_pos utf8z "W-STACK"
|
||||
.window_position.x utf8z " WIN-X"
|
||||
.window_position.y utf8z " WIN-Y"
|
||||
|
||||
|
||||
.previous_page utf8z "SEITE ZURUECK"
|
||||
.next_page utf8z "SEITE VOR"
|
||||
.reboot utf8z "REBOOT SYSTEM"
|
||||
.run utf8z "START"
|
||||
|
||||
|
||||
.checkbox_caption utf8z "System"
|
||||
|
||||
|
||||
.KB utf8z " KB"
|
||||
.MB utf8z " MB"
|
||||
.GB utf8z " GB"
|
||||
;-------------------------------------------------------------------------------
|
||||
else if lang eq et_EE
|
||||
.window_caption utf8z "Protsessid v0.2.3 - [Ctrl+Alt+Del]"
|
||||
|
||||
|
||||
.process_name utf8z "NIMI/LÕPETA"
|
||||
.ptid utf8z "PID/TID"
|
||||
.cpu_usage_cycles utf8z "CPU(TSÜKLID)"
|
||||
@@ -952,21 +952,21 @@ else if lang eq et_EE
|
||||
.window_stack_pos utf8z "W-PUHVER"
|
||||
.window_position.x utf8z " WIN-X"
|
||||
.window_position.y utf8z " WIN-Y"
|
||||
|
||||
|
||||
.previous_page utf8z "EELMINE LEHT"
|
||||
.next_page utf8z "JÄRGMINE LEHT"
|
||||
.reboot utf8z "REBOODI SÜSTEEM"
|
||||
.run utf8z "START"
|
||||
|
||||
|
||||
.checkbox_caption utf8z "System"
|
||||
|
||||
|
||||
.KB utf8z " KB"
|
||||
.MB utf8z " MB"
|
||||
.GB utf8z " GB"
|
||||
;-------------------------------------------------------------------------------
|
||||
else if lang eq ru_RU
|
||||
.window_caption utf8z "Диспетчер процессов v0.2.3 - [Ctrl+Alt+Del]"
|
||||
|
||||
|
||||
.process_name utf8z "ИМЯ/ЗАВЕРШИТЬ"
|
||||
.ptid utf8z "PID/TID"
|
||||
.cpu_usage_cycles utf8z "CPU(ТАКТЫ)"
|
||||
@@ -975,21 +975,21 @@ else if lang eq ru_RU
|
||||
.window_stack_pos utf8z "W-STACK"
|
||||
.window_position.x utf8z " WIN-X"
|
||||
.window_position.y utf8z " WIN-Y"
|
||||
|
||||
|
||||
.previous_page utf8z "ПРЕД. СТР."
|
||||
.next_page utf8z "СЛЕД. СТР."
|
||||
.reboot utf8z "ПЕРЕЗАГРУЗКА"
|
||||
.run utf8z "ЗАПУСК"
|
||||
|
||||
|
||||
.checkbox_caption utf8z "Системные"
|
||||
|
||||
|
||||
.KB utf8z " КБ"
|
||||
.MB utf8z " МБ"
|
||||
.GB utf8z " ГБ"
|
||||
;-------------------------------------------------------------------------------
|
||||
else if lang eq it_IT
|
||||
.window_caption utf8z "Gestore processi v0.2.3 - [Ctrl+Alt+Del]"
|
||||
|
||||
|
||||
.process_name utf8z "NOME-PROGRAMMA"
|
||||
.ptid utf8z "PID/TID"
|
||||
.cpu_usage_cycles utf8z "CPU(CICLI)"
|
||||
@@ -998,21 +998,21 @@ else if lang eq it_IT
|
||||
.window_stack_pos utf8z "W-STACK"
|
||||
.window_position.x utf8z " WIN-X"
|
||||
.window_position.y utf8z " WIN-Y"
|
||||
|
||||
|
||||
.previous_page utf8z "INDIETRO"
|
||||
.next_page utf8z "AVANTI"
|
||||
.reboot utf8z "RIAVVIA SISTEMA"
|
||||
.run utf8z "START"
|
||||
|
||||
|
||||
.checkbox_caption utf8z "System"
|
||||
|
||||
|
||||
.KB utf8z " KB"
|
||||
.MB utf8z " MB"
|
||||
.GB utf8z " GB"
|
||||
;-------------------------------------------------------------------------------
|
||||
else
|
||||
else ; Default to en_US
|
||||
.window_caption utf8z "Process manager v0.2.3 - [Ctrl+Alt+Del]"
|
||||
|
||||
|
||||
.process_name utf8z "NAME/TERMINATE"
|
||||
.ptid utf8z "PID/TID"
|
||||
.cpu_usage_cycles utf8z "CPU(CYCLES)"
|
||||
@@ -1021,15 +1021,15 @@ else
|
||||
.window_stack_pos utf8z "W-STACK"
|
||||
.window_position.x utf8z " WIN-X"
|
||||
.window_position.y utf8z " WIN-Y"
|
||||
|
||||
|
||||
|
||||
|
||||
.previous_page utf8z "PREV PAGE"
|
||||
.next_page utf8z "NEXT PAGE"
|
||||
.reboot utf8z "REBOOT SYSTEM"
|
||||
.run utf8z "RUN"
|
||||
|
||||
|
||||
.checkbox_caption utf8z "System"
|
||||
|
||||
|
||||
.KB utf8z " KB"
|
||||
.MB utf8z " MB"
|
||||
.GB utf8z " GB"
|
||||
|
||||
@@ -1,227 +1,227 @@
|
||||
;---------------------------------------------------------------------
|
||||
;
|
||||
; DOCPAK FOR KOLIBRI v1.2
|
||||
; Written in pure assembly by Ivushkin Andrey aka Willow
|
||||
;
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
FILE_COUNT=0
|
||||
DEF_FILE equ 'g'
|
||||
|
||||
macro embed_docdir_file fn
|
||||
{
|
||||
forward
|
||||
local label,label2,label3
|
||||
dd label2-label
|
||||
dd label-label3
|
||||
label3:
|
||||
db fn
|
||||
label:
|
||||
file '%DOCDIR%' # fn
|
||||
label2:
|
||||
FILE_COUNT=FILE_COUNT+1
|
||||
}
|
||||
macro embed_local_file fn
|
||||
{
|
||||
forward
|
||||
local label,label2,label3
|
||||
dd label2-label
|
||||
dd label-label3
|
||||
label3:
|
||||
db fn
|
||||
label:
|
||||
file fn
|
||||
label2:
|
||||
FILE_COUNT=FILE_COUNT+1
|
||||
}
|
||||
|
||||
use32
|
||||
org 0x0
|
||||
db 'MENUET01' ; 8 byte id
|
||||
dd 0x01 ; header version
|
||||
dd start ; start of code
|
||||
dd I_END ; size of image
|
||||
dd I_END+0x400 ; memory for app
|
||||
dd I_END+0x400 ; esp
|
||||
dd my_param , 0x0 ; I_Param , I_Icon
|
||||
include '../../../macros.inc'
|
||||
include 'lang.inc'
|
||||
|
||||
start:
|
||||
cmp [my_param],0
|
||||
je red
|
||||
cmp [my_param],'a'
|
||||
jb .par_a
|
||||
cmp [my_param],'z'
|
||||
jbe .ok2
|
||||
.par_a:
|
||||
mov [my_param],DEF_FILE
|
||||
.ok2:
|
||||
movzx ecx,[my_param]
|
||||
mov [my_param],'*'
|
||||
.open:
|
||||
sub ecx,'a'-1
|
||||
mov edx,embedded
|
||||
xor esi,esi
|
||||
.list:
|
||||
lea edx,[edx+esi+8]
|
||||
mov esi,[edx-8]
|
||||
add edx,[edx-4]
|
||||
test esi,esi
|
||||
jz .close
|
||||
loop .list
|
||||
push edx
|
||||
; convert number in esi to decimal representation
|
||||
mov ecx, 10
|
||||
push -'0'
|
||||
mov eax, esi
|
||||
@@:
|
||||
xor edx, edx
|
||||
div ecx
|
||||
push edx
|
||||
test eax, eax
|
||||
jnz @b
|
||||
mov edi, fsize
|
||||
@@:
|
||||
pop eax
|
||||
add al, '0'
|
||||
stosb
|
||||
jnz @b
|
||||
mcall 70,fileinfo
|
||||
mov ecx,eax
|
||||
mcall 5,20
|
||||
pop edx
|
||||
mcall 60,2
|
||||
cmp [my_param],'*'
|
||||
jne still
|
||||
.close:
|
||||
mcall -1
|
||||
|
||||
red:
|
||||
mov [my_param],'a'
|
||||
|
||||
mcall 48, 3, sc, sizeof.system_colors
|
||||
|
||||
mcall 12,1
|
||||
|
||||
BTN_H equ 21
|
||||
|
||||
mov edx,[sc.work]
|
||||
or edx,0x34000000
|
||||
mcall 0, <220,141>, <30,FILECOUNT*(BTN_H+3)+37>, , ,title
|
||||
|
||||
mov ecx,FILECOUNT
|
||||
mov ebx,23 shl 16+100
|
||||
mov esi,[sc.work_button]
|
||||
mov edi,5 shl 16+BTN_H
|
||||
mov edx,10
|
||||
mov eax,8
|
||||
.btnlp:
|
||||
push ecx
|
||||
mcall ,,edi
|
||||
add edi,(BTN_H+3) shl 16
|
||||
inc edx
|
||||
pop ecx
|
||||
loop .btnlp
|
||||
mov ecx,FILECOUNT
|
||||
mov edx,embedded
|
||||
xor edi,edi
|
||||
mov ebx,30 shl 16+8
|
||||
mov eax,4
|
||||
.list:
|
||||
lea edx,[edx+edi+8]
|
||||
mov edi,[edx-8]
|
||||
pusha
|
||||
sub ebx,20 shl 16
|
||||
mov ecx, [sc.work_text]
|
||||
or ecx, 0x30000000
|
||||
mcall ,,,my_param,1
|
||||
inc [my_param]
|
||||
popa
|
||||
push ecx
|
||||
mov esi, [edx-4]
|
||||
sub esi, 4 ;remove .txt extension
|
||||
mov ecx, [sc.work_button_text]
|
||||
or ecx, 0x30000000
|
||||
mcall
|
||||
pop ecx
|
||||
add esi, 4
|
||||
add edx, esi
|
||||
add ebx,(BTN_H+3)
|
||||
loop .list
|
||||
mcall 12,2
|
||||
|
||||
still:
|
||||
mcall 10
|
||||
cmp eax,1
|
||||
je red
|
||||
cmp eax,2
|
||||
jne .nokey
|
||||
mcall 2
|
||||
cmp ah,27 ;Esc
|
||||
je start.close
|
||||
cmp ah,'a'
|
||||
jb still
|
||||
cmp ah,'a'+FILECOUNT
|
||||
jae still
|
||||
jmp .cxax
|
||||
.nokey:
|
||||
mcall 17
|
||||
cmp ah,1
|
||||
je start.close
|
||||
sub ah,10-'a'
|
||||
.cxax:
|
||||
movzx ecx,ah
|
||||
jmp start.open
|
||||
|
||||
fileinfo:
|
||||
dd 7
|
||||
dd 0
|
||||
dd param
|
||||
dd 0 ,0
|
||||
db '/sys/TINYPAD',0
|
||||
|
||||
param db '*'
|
||||
fsize:
|
||||
times 10 db '0'
|
||||
db 0
|
||||
|
||||
embedded:
|
||||
|
||||
; Please use only filenames w/o path!
|
||||
|
||||
; -- Start of embedding area ------
|
||||
embed_docdir_file 'CREDITS.TXT' ;a
|
||||
if lang eq ru_RU
|
||||
embed_docdir_file 'GNU.TXT' ;b
|
||||
else
|
||||
embed_docdir_file 'COPYING.TXT' ;b
|
||||
end if
|
||||
embed_docdir_file 'HOT_KEYS.TXT' ;c
|
||||
embed_local_file 'FASM.TXT' ;d
|
||||
embed_docdir_file 'MTDBG.TXT' ;e
|
||||
if lang eq ru_RU
|
||||
embed_local_file 'SYSFUNCR.TXT' ;f
|
||||
else
|
||||
embed_local_file 'SYSFUNCS.TXT' ;f
|
||||
end if
|
||||
embed_local_file 'STACK.TXT' ;g
|
||||
embed_docdir_file 'KFAR_KEYS.TXT' ;h
|
||||
embed_docdir_file 'INI.TXT' ;i
|
||||
embed_docdir_file 'OPENDIAL.TXT' ;j
|
||||
; -- End of embedding area -------
|
||||
|
||||
dd 0
|
||||
FILECOUNT = FILE_COUNT
|
||||
|
||||
if ~ FILECOUNT>0
|
||||
error 'No embedded files'
|
||||
end if
|
||||
|
||||
my_param db 0
|
||||
rb 256
|
||||
I_END:
|
||||
|
||||
title db 'Doc Pack',0
|
||||
|
||||
sc system_colors
|
||||
;---------------------------------------------------------------------
|
||||
;
|
||||
; DOCPAK FOR KOLIBRI v1.2
|
||||
; Written in pure assembly by Ivushkin Andrey aka Willow
|
||||
;
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
FILE_COUNT=0
|
||||
DEF_FILE equ 'g'
|
||||
|
||||
macro embed_docdir_file fn
|
||||
{
|
||||
forward
|
||||
local label,label2,label3
|
||||
dd label2-label
|
||||
dd label-label3
|
||||
label3:
|
||||
db fn
|
||||
label:
|
||||
file '%DOCDIR%' # fn
|
||||
label2:
|
||||
FILE_COUNT=FILE_COUNT+1
|
||||
}
|
||||
macro embed_local_file fn
|
||||
{
|
||||
forward
|
||||
local label,label2,label3
|
||||
dd label2-label
|
||||
dd label-label3
|
||||
label3:
|
||||
db fn
|
||||
label:
|
||||
file fn
|
||||
label2:
|
||||
FILE_COUNT=FILE_COUNT+1
|
||||
}
|
||||
|
||||
use32
|
||||
org 0x0
|
||||
db 'MENUET01' ; 8 byte id
|
||||
dd 0x01 ; header version
|
||||
dd start ; start of code
|
||||
dd I_END ; size of image
|
||||
dd I_END+0x400 ; memory for app
|
||||
dd I_END+0x400 ; esp
|
||||
dd my_param , 0x0 ; I_Param , I_Icon
|
||||
include '../../../macros.inc'
|
||||
include 'lang.inc' ; Language support for locales: ru_RU, en_US.
|
||||
|
||||
start:
|
||||
cmp [my_param],0
|
||||
je red
|
||||
cmp [my_param],'a'
|
||||
jb .par_a
|
||||
cmp [my_param],'z'
|
||||
jbe .ok2
|
||||
.par_a:
|
||||
mov [my_param],DEF_FILE
|
||||
.ok2:
|
||||
movzx ecx,[my_param]
|
||||
mov [my_param],'*'
|
||||
.open:
|
||||
sub ecx,'a'-1
|
||||
mov edx,embedded
|
||||
xor esi,esi
|
||||
.list:
|
||||
lea edx,[edx+esi+8]
|
||||
mov esi,[edx-8]
|
||||
add edx,[edx-4]
|
||||
test esi,esi
|
||||
jz .close
|
||||
loop .list
|
||||
push edx
|
||||
; convert number in esi to decimal representation
|
||||
mov ecx, 10
|
||||
push -'0'
|
||||
mov eax, esi
|
||||
@@:
|
||||
xor edx, edx
|
||||
div ecx
|
||||
push edx
|
||||
test eax, eax
|
||||
jnz @b
|
||||
mov edi, fsize
|
||||
@@:
|
||||
pop eax
|
||||
add al, '0'
|
||||
stosb
|
||||
jnz @b
|
||||
mcall 70,fileinfo
|
||||
mov ecx,eax
|
||||
mcall 5,20
|
||||
pop edx
|
||||
mcall 60,2
|
||||
cmp [my_param],'*'
|
||||
jne still
|
||||
.close:
|
||||
mcall -1
|
||||
|
||||
red:
|
||||
mov [my_param],'a'
|
||||
|
||||
mcall 48, 3, sc, sizeof.system_colors
|
||||
|
||||
mcall 12,1
|
||||
|
||||
BTN_H equ 21
|
||||
|
||||
mov edx,[sc.work]
|
||||
or edx,0x34000000
|
||||
mcall 0, <220,141>, <30,FILECOUNT*(BTN_H+3)+37>, , ,title
|
||||
|
||||
mov ecx,FILECOUNT
|
||||
mov ebx,23 shl 16+100
|
||||
mov esi,[sc.work_button]
|
||||
mov edi,5 shl 16+BTN_H
|
||||
mov edx,10
|
||||
mov eax,8
|
||||
.btnlp:
|
||||
push ecx
|
||||
mcall ,,edi
|
||||
add edi,(BTN_H+3) shl 16
|
||||
inc edx
|
||||
pop ecx
|
||||
loop .btnlp
|
||||
mov ecx,FILECOUNT
|
||||
mov edx,embedded
|
||||
xor edi,edi
|
||||
mov ebx,30 shl 16+8
|
||||
mov eax,4
|
||||
.list:
|
||||
lea edx,[edx+edi+8]
|
||||
mov edi,[edx-8]
|
||||
pusha
|
||||
sub ebx,20 shl 16
|
||||
mov ecx, [sc.work_text]
|
||||
or ecx, 0x30000000
|
||||
mcall ,,,my_param,1
|
||||
inc [my_param]
|
||||
popa
|
||||
push ecx
|
||||
mov esi, [edx-4]
|
||||
sub esi, 4 ;remove .txt extension
|
||||
mov ecx, [sc.work_button_text]
|
||||
or ecx, 0x30000000
|
||||
mcall
|
||||
pop ecx
|
||||
add esi, 4
|
||||
add edx, esi
|
||||
add ebx,(BTN_H+3)
|
||||
loop .list
|
||||
mcall 12,2
|
||||
|
||||
still:
|
||||
mcall 10
|
||||
cmp eax,1
|
||||
je red
|
||||
cmp eax,2
|
||||
jne .nokey
|
||||
mcall 2
|
||||
cmp ah,27 ;Esc
|
||||
je start.close
|
||||
cmp ah,'a'
|
||||
jb still
|
||||
cmp ah,'a'+FILECOUNT
|
||||
jae still
|
||||
jmp .cxax
|
||||
.nokey:
|
||||
mcall 17
|
||||
cmp ah,1
|
||||
je start.close
|
||||
sub ah,10-'a'
|
||||
.cxax:
|
||||
movzx ecx,ah
|
||||
jmp start.open
|
||||
|
||||
fileinfo:
|
||||
dd 7
|
||||
dd 0
|
||||
dd param
|
||||
dd 0 ,0
|
||||
db '/sys/TINYPAD',0
|
||||
|
||||
param db '*'
|
||||
fsize:
|
||||
times 10 db '0'
|
||||
db 0
|
||||
|
||||
embedded:
|
||||
|
||||
; Please use only filenames w/o path!
|
||||
|
||||
; -- Start of embedding area ------
|
||||
embed_docdir_file 'CREDITS.TXT' ;a
|
||||
if lang eq ru_RU
|
||||
embed_docdir_file 'GNU.TXT' ;b
|
||||
else ; Default to en_US
|
||||
embed_docdir_file 'COPYING.TXT' ;b
|
||||
end if
|
||||
embed_docdir_file 'HOT_KEYS.TXT' ;c
|
||||
embed_local_file 'FASM.TXT' ;d
|
||||
embed_docdir_file 'MTDBG.TXT' ;e
|
||||
if lang eq ru_RU
|
||||
embed_local_file 'SYSFUNCR.TXT' ;f
|
||||
else ; Default to en_US
|
||||
embed_local_file 'SYSFUNCS.TXT' ;f
|
||||
end if
|
||||
embed_local_file 'STACK.TXT' ;g
|
||||
embed_docdir_file 'KFAR_KEYS.TXT' ;h
|
||||
embed_docdir_file 'INI.TXT' ;i
|
||||
embed_docdir_file 'OPENDIAL.TXT' ;j
|
||||
; -- End of embedding area -------
|
||||
|
||||
dd 0
|
||||
FILECOUNT = FILE_COUNT
|
||||
|
||||
if ~ FILECOUNT>0
|
||||
error 'No embedded files'
|
||||
end if
|
||||
|
||||
my_param db 0
|
||||
rb 256
|
||||
I_END:
|
||||
|
||||
title db 'Doc Pack',0
|
||||
|
||||
sc system_colors
|
||||
@@ -1,68 +1,71 @@
|
||||
WIN_W = 440
|
||||
WIN_H = 200
|
||||
BOT_PANEL_H = 70
|
||||
;---------------------------------------------------------------------
|
||||
CANCEL_BUTTON_ID = 1+BT_HIDE
|
||||
HOME_BUTTON_ID = 2
|
||||
REBOOT_BUTTON_ID = 3
|
||||
POWEROFF_BUTTON_ID = 4
|
||||
CHECKBOX_BUTTON_ID = 5+BT_HIDE
|
||||
;---------------------------------------------------------------------
|
||||
TEXT_HOME: db 'Home',0
|
||||
TEXT_ENTER: db 'Enter',0
|
||||
TEXT_END: db 'End',0
|
||||
TEXT_CANCEL: db 'x',0
|
||||
;---------------------------------------------------------------------
|
||||
if lang eq ru_RU
|
||||
TEXT_WTITLE: db 'Завершение работы',0
|
||||
TEXT_RDSAVE1: db 'Сохранить изменения, сделанные в',0
|
||||
TEXT_RDSAVE2: db 'процессе работы в системе (Ctrl+S)',0
|
||||
TEXT_KERNEL: db 'Ядро',0
|
||||
TEXT_REBOOT: db 'Перезагрузка',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 'Перезагрузка',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 ?
|
||||
;---------------------------------------------------------------------
|
||||
+866
-866
File diff suppressed because it is too large.
Load diff
@@ -1,44 +1,45 @@
|
||||
;
|
||||
; Ghost Monitor - утилита (стресс) тестирования и мониторинга системы
|
||||
; Copyright (C) 2005, 2006, 2007 Mihailov Ilia (ghost.nsk@mail.ru)
|
||||
; All Right Reserved
|
||||
|
||||
|
||||
mov edx, msg_about
|
||||
mov ebx, 17 * 65536 + 285
|
||||
call show_text
|
||||
jmp redraw
|
||||
|
||||
if lang eq it_IT
|
||||
msg_about mls \
|
||||
' Ghost Monitor',\
|
||||
'',\
|
||||
'strumento per testare il proprio hardware',\
|
||||
'',\
|
||||
'Supported SuperIO : W83627HF,W83697HF',\
|
||||
' W83627THF,W83627THF-A,W83627EHF-A,',\
|
||||
' W83637THF,IT8705F,IT8712F,SiS950',\
|
||||
' ABIT uGuru',\
|
||||
'',\
|
||||
'Test basati su R.J.Redelmeier CPUBurn',\
|
||||
'',\
|
||||
'Mailto : ghost.nsk@mail.ru',\
|
||||
'',\
|
||||
' *** Usare a prioprio rischio ***'
|
||||
else
|
||||
msg_about mls \ ; должна быть хотябы одна строка
|
||||
' Ghost Monitor',\
|
||||
'',\
|
||||
' tool for testing and monitoring hardware',\
|
||||
'',\
|
||||
'Supported SuperIO : W83627HF,W83697HF',\
|
||||
' W83627THF,W83627THF-A,W83627EHF-A,',\
|
||||
' W83637THF,IT8705F,IT8712F,SiS950',\
|
||||
' ABIT uGuru',\
|
||||
'',\
|
||||
'Tests based on R.J.Redelmeier CPUBurn',\
|
||||
'',\
|
||||
'Mailto : ghost.nsk@mail.ru',\
|
||||
'',\
|
||||
' *** Use at YOUR own RISK ***'
|
||||
end if
|
||||
;
|
||||
; Ghost Monitor - утилита (стресс) тестирования и мониторинга системы
|
||||
; Copyright (C) 2005, 2006, 2007 Mihailov Ilia (ghost.nsk@mail.ru)
|
||||
; All Right Reserved
|
||||
|
||||
; Language support for locales: it_IT, en_US.
|
||||
|
||||
mov edx, msg_about
|
||||
mov ebx, 17 * 65536 + 285
|
||||
call show_text
|
||||
jmp redraw
|
||||
|
||||
if lang eq it_IT
|
||||
msg_about mls \
|
||||
' Ghost Monitor',\
|
||||
'',\
|
||||
'strumento per testare il proprio hardware',\
|
||||
'',\
|
||||
'Supported SuperIO : W83627HF,W83697HF',\
|
||||
' W83627THF,W83627THF-A,W83627EHF-A,',\
|
||||
' W83637THF,IT8705F,IT8712F,SiS950',\
|
||||
' ABIT uGuru',\
|
||||
'',\
|
||||
'Test basati su R.J.Redelmeier CPUBurn',\
|
||||
'',\
|
||||
'Mailto : ghost.nsk@mail.ru',\
|
||||
'',\
|
||||
' *** Usare a prioprio rischio ***'
|
||||
else ; Default to en_US
|
||||
msg_about mls \ ; должна быть хотябы одна строка
|
||||
' Ghost Monitor',\
|
||||
'',\
|
||||
' tool for testing and monitoring hardware',\
|
||||
'',\
|
||||
'Supported SuperIO : W83627HF,W83697HF',\
|
||||
' W83627THF,W83627THF-A,W83627EHF-A,',\
|
||||
' W83637THF,IT8705F,IT8712F,SiS950',\
|
||||
' ABIT uGuru',\
|
||||
'',\
|
||||
'Tests based on R.J.Redelmeier CPUBurn',\
|
||||
'',\
|
||||
'Mailto : ghost.nsk@mail.ru',\
|
||||
'',\
|
||||
' *** Use at your own risk ***'
|
||||
end if
|
||||
+125
-123
@@ -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
|
||||
+209
-206
@@ -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, ' ПРОГРАММА '
|
||||
db 255,255,255,0, ' ПАРАМЕТРЫ '
|
||||
db 255,255,255,0, ' ПРИМЕНИТЬ '
|
||||
db 255,255,255,0, ' ДОБАВИТЬ УДАЛИТЬ '
|
||||
db 0,0,0,0, 'НАЖМИТЕ НА ПОЗИЦИЮ ИКОНКИ ДЛЯ РЕДАКТИРОВАНИЯ '
|
||||
db 'x' ; <- END MARKER, DONT DELETE
|
||||
|
||||
add_text db 'НАЖМИТЕ НА ПОЗИЦИЮ НЕИСПОЛЬЗУЕМОЙ ИКОНКИ ',0
|
||||
rem_text db 'НАЖМИТЕ НА ПОЗИЦИЮ ИСПОЛЬЗУЕМОЙ ИКОНКИ ',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 'ЗНАЧКИ - ИЗ , ВЫБРАН #'
|
||||
;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, ' ПРОГРАММА '
|
||||
db 255,255,255,0, ' ПАРАМЕТРЫ '
|
||||
db 255,255,255,0, ' ПРИМЕНИТЬ '
|
||||
db 255,255,255,0, ' ДОБАВИТЬ УДАЛИТЬ '
|
||||
db 0,0,0,0, 'НАЖМИТЕ НА ПОЗИЦИЮ ИКОНКИ ДЛЯ РЕДАКТИРОВАНИЯ '
|
||||
db 'x' ; <- END MARKER, DO NOT DELETE
|
||||
|
||||
add_text db 'НАЖМИТЕ НА ПОЗИЦИЮ НЕИСПОЛЬЗУЕМОЙ ИКОНКИ ',0
|
||||
rem_text db 'НАЖМИТЕ НА ПОЗИЦИЮ ИСПОЛЬЗУЕМОЙ ИКОНКИ ',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 'ЗНАЧКИ - ИЗ , ВЫБРАН #'
|
||||
;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
|
||||
;------------------------------------------------------------------------------
|
||||
+844
-842
File diff suppressed because it is too large.
Load diff
+1350
-1349
File diff suppressed because it is too large.
Load diff
+198
-198
@@ -1,198 +1,198 @@
|
||||
; Keyboard indicators v0.2
|
||||
; by Albom and IgorA
|
||||
|
||||
use32
|
||||
org 0
|
||||
db 'MENUET01'
|
||||
dd 1
|
||||
dd _start
|
||||
dd _end
|
||||
dd _memory
|
||||
dd stacktop
|
||||
dd 0
|
||||
dd sys_path
|
||||
|
||||
include '../../macros.inc'
|
||||
include '../../proc32.inc'
|
||||
include '../../develop/libraries/box_lib/load_lib.mac'
|
||||
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
;include 'mem.inc'
|
||||
;include 'dll.inc'
|
||||
include 'lang.inc'
|
||||
|
||||
@use_library ;_mem mem.Alloc,mem.Free,mem.ReAlloc, dll.Load
|
||||
|
||||
align 4
|
||||
_start:
|
||||
load_libraries l_libs_start,l_libs_end
|
||||
mcall 48,3,sc,sizeof.system_colors
|
||||
mcall 40,0x27
|
||||
|
||||
init_checkboxes2 check_boxes,check_boxes_end
|
||||
check_boxes_set_sys_color2 check_boxes,check_boxes_end,sc
|
||||
call _key_set
|
||||
|
||||
align 4
|
||||
red_win:
|
||||
call draw_window
|
||||
|
||||
|
||||
align 4
|
||||
still:
|
||||
mcall 10
|
||||
|
||||
cmp al,1 ;шчь. яюыюцхэшх юъэр
|
||||
jz red_win
|
||||
cmp al,2
|
||||
jz key
|
||||
cmp al,3
|
||||
jz button
|
||||
|
||||
;stdcall [check_box_mouse], ch1
|
||||
;stdcall [check_box_mouse], ch2
|
||||
;stdcall [check_box_mouse], ch3
|
||||
|
||||
jmp still
|
||||
|
||||
;єёЄрэютшЄ№ юс∙хёшёЄхьэ√х "уюЁ ўшх ъыртш°ш"
|
||||
align 4
|
||||
_key_set:
|
||||
mov eax, 66
|
||||
mov ebx, 4
|
||||
mov edx, 0
|
||||
mov cl, 69
|
||||
int 0x40
|
||||
|
||||
mov eax, 66
|
||||
mov ebx, 4
|
||||
mov edx, 0
|
||||
mov cl, 58
|
||||
int 0x40
|
||||
|
||||
mov eax, 66
|
||||
mov ebx, 4
|
||||
mov edx, 0
|
||||
mov cl, 70
|
||||
int 0x40
|
||||
|
||||
ret
|
||||
|
||||
align 4
|
||||
draw_window:
|
||||
pushad
|
||||
mcall 12,1
|
||||
mov edx, [sc.work]
|
||||
or edx, 0x34000000
|
||||
mcall 0, (10 shl 16)+100, (10 shl 16)+75
|
||||
|
||||
stdcall [check_box_draw], ch1
|
||||
stdcall [check_box_draw], ch2
|
||||
stdcall [check_box_draw], ch3
|
||||
mcall 12,2
|
||||
popad
|
||||
ret
|
||||
|
||||
align 4
|
||||
key:
|
||||
mcall 2
|
||||
call _indicators_check
|
||||
jmp still
|
||||
|
||||
align 4
|
||||
_indicators_check:
|
||||
pusha
|
||||
mov eax, 66
|
||||
mov ebx, 3
|
||||
int 40h
|
||||
|
||||
test_ins:
|
||||
test eax, 0x80
|
||||
jz @f
|
||||
bts dword[ch1.flags],1
|
||||
jmp test_caps
|
||||
@@:
|
||||
btr dword[ch1.flags],1
|
||||
|
||||
test_caps:
|
||||
test eax, 0x40
|
||||
jz @f
|
||||
bts dword[ch2.flags],1
|
||||
jmp test_scroll
|
||||
@@:
|
||||
btr dword[ch2.flags],1
|
||||
|
||||
test_scroll:
|
||||
test eax, 0x100
|
||||
jz @f
|
||||
bts dword[ch3.flags],1
|
||||
jmp test_ok
|
||||
@@:
|
||||
btr dword[ch3.flags],1
|
||||
|
||||
test_ok:
|
||||
call draw_window
|
||||
popa
|
||||
ret
|
||||
|
||||
align 4
|
||||
button:
|
||||
mcall 17
|
||||
cmp ah,1
|
||||
jne still
|
||||
.exit:
|
||||
mcall -1
|
||||
|
||||
|
||||
check_boxes:
|
||||
ch1 check_box2 (5 shl 16)+15,(5 shl 16)+10,5, 0xffffff,0x8000,0xff,\
|
||||
txt_160,0+ch_flag_middle
|
||||
ch2 check_box2 (5 shl 16)+15,(17 shl 16)+10,5, 0xffffff,0x8000,0xff,\
|
||||
txt_159,0+ch_flag_middle
|
||||
ch3 check_box2 (5 shl 16)+15,(29 shl 16)+10,5, 0xffffff,0x8000,0xff,\
|
||||
txt_158,0+ch_flag_middle
|
||||
check_boxes_end:
|
||||
|
||||
if lang eq it_IT
|
||||
txt_160 db 'Bloc Num',0
|
||||
txt_159 db 'Bloc Maiusc',0
|
||||
txt_158 db 'Bloc Scorr',0
|
||||
else
|
||||
txt_160 db 'Num',0
|
||||
txt_159 db 'Caps',0
|
||||
txt_158 db 'Scroll',0
|
||||
end if
|
||||
head_f_i:
|
||||
head_f_l db '╤шёЄхьэр ю°шсър',0
|
||||
|
||||
system_dir_0 db '/sys/lib/'
|
||||
lib_name_0 db 'box_lib.obj',0
|
||||
err_msg_found_lib_0 db '═х эрщфхэр сшсышюЄхър box_lib.obj',0
|
||||
err_msg_import_0 db '╬°шсър яЁш шьяюЁЄх сшсышюЄхъш box_lib',0
|
||||
|
||||
l_libs_start:
|
||||
lib_0 l_libs lib_name_0, sys_path, library_path, system_dir_0,\
|
||||
err_msg_found_lib_0,head_f_l,import_box_lib,err_msg_import_0,head_f_i
|
||||
l_libs_end:
|
||||
|
||||
align 4
|
||||
import_box_lib:
|
||||
;init dd sz_init
|
||||
init_checkbox dd sz_init_checkbox
|
||||
check_box_draw dd sz_check_box_draw
|
||||
check_box_mouse dd sz_check_box_mouse
|
||||
dd 0,0
|
||||
;sz_init db 'lib_init',0
|
||||
sz_init_checkbox db 'init_checkbox2',0
|
||||
sz_check_box_draw db 'check_box_draw2',0
|
||||
sz_check_box_mouse db 'check_box_mouse2',0
|
||||
|
||||
;mouse_dd dd 0x0
|
||||
sc system_colors
|
||||
|
||||
_end:
|
||||
align 32
|
||||
rb 2048
|
||||
stacktop:
|
||||
sys_path rb 1024
|
||||
library_path rb 1024
|
||||
_memory:
|
||||
; Keyboard indicators v0.2
|
||||
; by Albom and IgorA
|
||||
|
||||
use32
|
||||
org 0
|
||||
db 'MENUET01'
|
||||
dd 1
|
||||
dd _start
|
||||
dd _end
|
||||
dd _memory
|
||||
dd stacktop
|
||||
dd 0
|
||||
dd sys_path
|
||||
|
||||
include '../../macros.inc'
|
||||
include '../../proc32.inc'
|
||||
include '../../develop/libraries/box_lib/load_lib.mac'
|
||||
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
;include 'mem.inc'
|
||||
;include 'dll.inc'
|
||||
include 'lang.inc' ; Language support for locales: it_IT, en_US.
|
||||
|
||||
@use_library ;_mem mem.Alloc,mem.Free,mem.ReAlloc, dll.Load
|
||||
|
||||
align 4
|
||||
_start:
|
||||
load_libraries l_libs_start,l_libs_end
|
||||
mcall 48,3,sc,sizeof.system_colors
|
||||
mcall 40,0x27
|
||||
|
||||
init_checkboxes2 check_boxes,check_boxes_end
|
||||
check_boxes_set_sys_color2 check_boxes,check_boxes_end,sc
|
||||
call _key_set
|
||||
|
||||
align 4
|
||||
red_win:
|
||||
call draw_window
|
||||
|
||||
|
||||
align 4
|
||||
still:
|
||||
mcall 10
|
||||
|
||||
cmp al,1 ;шчь. яюыюцхэшх юъэр
|
||||
jz red_win
|
||||
cmp al,2
|
||||
jz key
|
||||
cmp al,3
|
||||
jz button
|
||||
|
||||
;stdcall [check_box_mouse], ch1
|
||||
;stdcall [check_box_mouse], ch2
|
||||
;stdcall [check_box_mouse], ch3
|
||||
|
||||
jmp still
|
||||
|
||||
;єёЄрэютшЄ№ юс∙хёшёЄхьэ√х "уюЁ ўшх ъыртш°ш"
|
||||
align 4
|
||||
_key_set:
|
||||
mov eax, 66
|
||||
mov ebx, 4
|
||||
mov edx, 0
|
||||
mov cl, 69
|
||||
int 0x40
|
||||
|
||||
mov eax, 66
|
||||
mov ebx, 4
|
||||
mov edx, 0
|
||||
mov cl, 58
|
||||
int 0x40
|
||||
|
||||
mov eax, 66
|
||||
mov ebx, 4
|
||||
mov edx, 0
|
||||
mov cl, 70
|
||||
int 0x40
|
||||
|
||||
ret
|
||||
|
||||
align 4
|
||||
draw_window:
|
||||
pushad
|
||||
mcall 12,1
|
||||
mov edx, [sc.work]
|
||||
or edx, 0x34000000
|
||||
mcall 0, (10 shl 16)+100, (10 shl 16)+75
|
||||
|
||||
stdcall [check_box_draw], ch1
|
||||
stdcall [check_box_draw], ch2
|
||||
stdcall [check_box_draw], ch3
|
||||
mcall 12,2
|
||||
popad
|
||||
ret
|
||||
|
||||
align 4
|
||||
key:
|
||||
mcall 2
|
||||
call _indicators_check
|
||||
jmp still
|
||||
|
||||
align 4
|
||||
_indicators_check:
|
||||
pusha
|
||||
mov eax, 66
|
||||
mov ebx, 3
|
||||
int 40h
|
||||
|
||||
test_ins:
|
||||
test eax, 0x80
|
||||
jz @f
|
||||
bts dword[ch1.flags],1
|
||||
jmp test_caps
|
||||
@@:
|
||||
btr dword[ch1.flags],1
|
||||
|
||||
test_caps:
|
||||
test eax, 0x40
|
||||
jz @f
|
||||
bts dword[ch2.flags],1
|
||||
jmp test_scroll
|
||||
@@:
|
||||
btr dword[ch2.flags],1
|
||||
|
||||
test_scroll:
|
||||
test eax, 0x100
|
||||
jz @f
|
||||
bts dword[ch3.flags],1
|
||||
jmp test_ok
|
||||
@@:
|
||||
btr dword[ch3.flags],1
|
||||
|
||||
test_ok:
|
||||
call draw_window
|
||||
popa
|
||||
ret
|
||||
|
||||
align 4
|
||||
button:
|
||||
mcall 17
|
||||
cmp ah,1
|
||||
jne still
|
||||
.exit:
|
||||
mcall -1
|
||||
|
||||
|
||||
check_boxes:
|
||||
ch1 check_box2 (5 shl 16)+15,(5 shl 16)+10,5, 0xffffff,0x8000,0xff,\
|
||||
txt_160,0+ch_flag_middle
|
||||
ch2 check_box2 (5 shl 16)+15,(17 shl 16)+10,5, 0xffffff,0x8000,0xff,\
|
||||
txt_159,0+ch_flag_middle
|
||||
ch3 check_box2 (5 shl 16)+15,(29 shl 16)+10,5, 0xffffff,0x8000,0xff,\
|
||||
txt_158,0+ch_flag_middle
|
||||
check_boxes_end:
|
||||
|
||||
if lang eq it_IT
|
||||
txt_160 db 'Bloc Num',0
|
||||
txt_159 db 'Bloc Maiusc',0
|
||||
txt_158 db 'Bloc Scorr',0
|
||||
else ; Default to en_US
|
||||
txt_160 db 'Num',0
|
||||
txt_159 db 'Caps',0
|
||||
txt_158 db 'Scroll',0
|
||||
end if
|
||||
head_f_i:
|
||||
head_f_l db '╤шёЄхьэр ю°шсър',0
|
||||
|
||||
system_dir_0 db '/sys/lib/'
|
||||
lib_name_0 db 'box_lib.obj',0
|
||||
err_msg_found_lib_0 db '═х эрщфхэр сшсышюЄхър box_lib.obj',0
|
||||
err_msg_import_0 db '╬°шсър яЁш шьяюЁЄх сшсышюЄхъш box_lib',0
|
||||
|
||||
l_libs_start:
|
||||
lib_0 l_libs lib_name_0, sys_path, library_path, system_dir_0,\
|
||||
err_msg_found_lib_0,head_f_l,import_box_lib,err_msg_import_0,head_f_i
|
||||
l_libs_end:
|
||||
|
||||
align 4
|
||||
import_box_lib:
|
||||
;init dd sz_init
|
||||
init_checkbox dd sz_init_checkbox
|
||||
check_box_draw dd sz_check_box_draw
|
||||
check_box_mouse dd sz_check_box_mouse
|
||||
dd 0,0
|
||||
;sz_init db 'lib_init',0
|
||||
sz_init_checkbox db 'init_checkbox2',0
|
||||
sz_check_box_draw db 'check_box_draw2',0
|
||||
sz_check_box_mouse db 'check_box_mouse2',0
|
||||
|
||||
;mouse_dd dd 0x0
|
||||
sc system_colors
|
||||
|
||||
_end:
|
||||
align 32
|
||||
rb 2048
|
||||
stacktop:
|
||||
sys_path rb 1024
|
||||
library_path rb 1024
|
||||
_memory:
|
||||
@@ -1,468 +1,470 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Copyright (C) Vasiliy Kosenko (vkos), 2009 ;;
|
||||
;; Launch is free software: you can redistribute it and/or modify it under the terms of the GNU ;;
|
||||
;; General Public License as published by the Free Software Foundation, either version 3 ;;
|
||||
;; of the License, or (at your option) any later version. ;;
|
||||
;; ;;
|
||||
;; Launch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without ;;
|
||||
;; even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;
|
||||
;; General Public License for more details. ;;
|
||||
;; ;;
|
||||
;; You should have received a copy of the GNU General Public License along with Launch. ;;
|
||||
;; If not, see <http://www.gnu.org/licenses/>. ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Launch finds program in search dirictories and runs it. ;;
|
||||
;; For more details see readme.txt ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
format binary
|
||||
|
||||
APP_NAME fix 'Launch'
|
||||
APP_VERSION fix '0.1.80.1'
|
||||
|
||||
use32
|
||||
org 0x0
|
||||
|
||||
db 'MENUET01'
|
||||
dd 0x01
|
||||
dd START
|
||||
dd APP_END
|
||||
dd MEM_END
|
||||
dd APP_STACK
|
||||
dd args
|
||||
dd path
|
||||
|
||||
define DEBUG_NO 0
|
||||
define DEBUG_CONSOLE 1
|
||||
define DEBUG_BOARD 2 ;; Not used now
|
||||
|
||||
define PATH_MAX_LEN 1024
|
||||
define DEBUG_MAX_LEN 8
|
||||
define DEBUG_DEFAULT 0
|
||||
define BUFF_SIZE 1024
|
||||
|
||||
include 'proc32.inc'
|
||||
include 'macros.inc'
|
||||
include 'libio.inc'
|
||||
include 'dll.inc'
|
||||
|
||||
purge mov
|
||||
|
||||
include 'thread.inc'
|
||||
include 'ipc.inc'
|
||||
include 'kobra.inc'
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
;; Basic initialization
|
||||
START:
|
||||
;; Initialize process heap
|
||||
mcall 68,11
|
||||
test eax, eax
|
||||
jz exit
|
||||
|
||||
;; Import modules
|
||||
stdcall dll.Load,importTable
|
||||
test eax, eax
|
||||
jnz exit
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
;; Reading config
|
||||
read_ini_path: ;; Read search path
|
||||
;; First read config in /sys/etc
|
||||
invoke ini.get_str, etc_cfg, cfg_main, cfg_path, search_path, PATH_MAX_LEN, empty_str
|
||||
|
||||
;; Next, read config from current directory
|
||||
;; Find end of path string
|
||||
.find_path_eol:
|
||||
mov edi, path
|
||||
mov ecx, PATH_MAX_LEN
|
||||
xor al, al
|
||||
cld
|
||||
repne scasb
|
||||
|
||||
;; Append ext to run path (NOTE: this work only when config file has name <launch-file-name>.cfg and ext size is dword)
|
||||
mov eax, dword [cfg_ext]
|
||||
dec edi
|
||||
mov dword [edi], eax
|
||||
mov byte [edi+5], 0
|
||||
|
||||
;; Currently there is no checking for repeating pathes, so we should only concatenate two strings
|
||||
;; So we need to find end of current search_path string
|
||||
.find_search_eol:
|
||||
mov edi, search_path
|
||||
mov ecx, PATH_MAX_LEN
|
||||
xor al, al
|
||||
;cld
|
||||
repne scasb
|
||||
dec edi
|
||||
|
||||
;; Now we need to correct buffer length
|
||||
mov eax, path+PATH_MAX_LEN
|
||||
sub eax, edi
|
||||
;; Read ini
|
||||
invoke ini.get_str, path, cfg_main, cfg_path, edi, PATH_MAX_LEN, empty_str
|
||||
|
||||
read_ini_debug: ;; Read debug options
|
||||
;; Read debug options from config files
|
||||
invoke ini.get_option_str, etc_cfg, cfg_debug, cfg_debug, debug_strings, DEBUG_MAX_LEN, DEBUG_DEFAULT
|
||||
invoke ini.get_option_str, path, cfg_debug, cfg_debug, debug_strings, DEBUG_MAX_LEN, eax
|
||||
mov [debug_option], eax
|
||||
|
||||
test eax, eax ;; No console
|
||||
je .ok
|
||||
|
||||
jmp .con_init
|
||||
|
||||
.console_err:
|
||||
mov byte [debug_option], 0
|
||||
jmp .ok
|
||||
|
||||
.con_init:
|
||||
stdcall dll.Load, consoleImport
|
||||
test eax, eax
|
||||
jnz .console_err
|
||||
invoke con.init, -1, -1, -1, -1, window_title
|
||||
|
||||
.read_level:
|
||||
invoke ini.get_int, etc_cfg, cfg_debug, cfg_level, 0
|
||||
invoke ini.get_int, path, cfg_debug, cfg_level, eax
|
||||
mov byte [debug_level], al
|
||||
.ok:
|
||||
|
||||
read_ini_kobra:
|
||||
invoke ini.get_bool, etc_cfg, cfg_kobra, cfg_use, 0
|
||||
invoke ini.get_bool, path, cfg_kobra, cfg_use, eax
|
||||
|
||||
mov byte [kobra_use], al
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
;; Parse command line options
|
||||
parse_args:
|
||||
;; Now parse command line arguments
|
||||
;; TODO: use optparse library
|
||||
;; Currently the only argument to parse is program name with its' arguments
|
||||
|
||||
.skip_spaces:
|
||||
mov ecx, -1
|
||||
mov edi, args
|
||||
mov al, ' '
|
||||
xor bl, bl
|
||||
;cld
|
||||
repe scasb
|
||||
|
||||
push edi
|
||||
|
||||
mov ecx, -1
|
||||
@@:
|
||||
scasb
|
||||
je @f
|
||||
xchg al, bl
|
||||
dec edi
|
||||
scasb
|
||||
jne @b
|
||||
@@:
|
||||
mov dword [prog_args], edi
|
||||
|
||||
pop edi
|
||||
dec edi
|
||||
;; Now edi = program name
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
;; Finding file
|
||||
search_file:
|
||||
push edi
|
||||
mov esi, search_path
|
||||
xchg esi, [esp]
|
||||
.loop:
|
||||
or dl, dl
|
||||
je .prn_dbg
|
||||
xor dl, dl
|
||||
jmp .prn_end
|
||||
.prn_dbg:
|
||||
push eax
|
||||
mov al, byte [debug_option]
|
||||
; dec al
|
||||
test al, al
|
||||
je .prn_stp
|
||||
mov al, byte [debug_level]
|
||||
or al, al
|
||||
je .prn_stp
|
||||
dec al
|
||||
or al, al
|
||||
je .prn_1
|
||||
.prn_1:
|
||||
cinvoke con.printf, message_dbg_not_found, buff
|
||||
|
||||
.prn_stp:
|
||||
pop eax
|
||||
.prn_end:
|
||||
xor eax, eax ;; When we check is proramme launched we are checking for eax
|
||||
xchg esi, [esp]
|
||||
mov edi, buff
|
||||
.copy_path:
|
||||
lodsb
|
||||
cmp al, ';'
|
||||
je .copy_file
|
||||
or al, al
|
||||
je exit
|
||||
stosb
|
||||
jmp .copy_path
|
||||
|
||||
.copy_file:
|
||||
xchg esi, [esp]
|
||||
push esi
|
||||
.cp_file_loop:
|
||||
lodsb
|
||||
or al, al
|
||||
je .copy_end
|
||||
cmp al, ' '
|
||||
je .copy_end
|
||||
stosb
|
||||
jmp .cp_file_loop
|
||||
|
||||
.copy_end:
|
||||
pop esi
|
||||
xor al, al
|
||||
stosb
|
||||
|
||||
;; Try to launch
|
||||
|
||||
mov dword [LaunchStruct.Function], 7
|
||||
push dword [prog_args]
|
||||
pop dword [LaunchStruct.Arguments]
|
||||
mov dword [LaunchStruct.Flags], 0
|
||||
mov dword [LaunchStruct.Zero], 0
|
||||
mov dword [LaunchStruct.FileNameP], buff
|
||||
mcall 70, LaunchStruct
|
||||
cmp eax, 0
|
||||
jl .loop
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
;; Exit
|
||||
exit:
|
||||
mov dword [tid], eax
|
||||
;; If console is present we should write some info
|
||||
mov al, byte [debug_option]
|
||||
cmp al, DEBUG_CONSOLE
|
||||
jne .kobra
|
||||
|
||||
.write_console:
|
||||
mov eax, dword [tid]
|
||||
test eax, eax
|
||||
jz .write_error
|
||||
.write_launched:
|
||||
cinvoke con.printf, message_ok, buff, eax, eax
|
||||
jmp .wr_end
|
||||
.write_error:
|
||||
pop edi
|
||||
cinvoke con.printf, message_error, edi
|
||||
.wr_end:
|
||||
invoke con.exit, 0
|
||||
|
||||
.kobra:
|
||||
mov al, byte [kobra_use]
|
||||
test al, al
|
||||
je .close
|
||||
|
||||
.register:
|
||||
mov dword [IPC_area], buff
|
||||
call IPC_init
|
||||
; jnz .close
|
||||
|
||||
mov dword [thread_find_buff], another_buff
|
||||
|
||||
call kobra_register
|
||||
|
||||
test eax, eax
|
||||
jnz .close
|
||||
|
||||
;; Prepare message
|
||||
mov dword [kobra_message], KOBRA_MESSAGE_LAUNCH_STATE
|
||||
|
||||
mov eax, dword [tid]
|
||||
mov dword [kobra_message+4], eax
|
||||
|
||||
.kobra_send:
|
||||
stdcall kobra_send_message, kobra_group_launch_reactive, kobra_message, 8
|
||||
|
||||
.close:
|
||||
mcall -1
|
||||
|
||||
;; End of code
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
;; Imports
|
||||
align 16
|
||||
importTable:
|
||||
|
||||
library libini, 'libconfig.obj' ;, \
|
||||
; libio, 'libio.obj', \
|
||||
|
||||
import libini, \
|
||||
ini.get_str ,'ini_get_str', \
|
||||
\; ini.set_str ,'ini_set_str', \
|
||||
ini.get_int ,'ini_get_int', \
|
||||
\; ini.set_int ,'ini_set_int', \
|
||||
\; ini.get_color ,'ini_get_color', \
|
||||
\; ini.set_color ,'ini_set_color', \
|
||||
ini.get_option_str ,'ini_get_option_str', \
|
||||
ini.get_bool ,'ini_get_bool';,\
|
||||
|
||||
;import libio, \
|
||||
; file_find_first,'file_find_first', \
|
||||
; file_find_next ,'file_find_next', \
|
||||
; file_find_close,'file_find_close', \
|
||||
; file_size ,'file_size', \
|
||||
; file_open ,'file_open', \
|
||||
; file_read ,'file_read', \
|
||||
; file_write ,'file_write', \
|
||||
; file_seek ,'file_seek', \
|
||||
; file_tell ,'file_tell', \
|
||||
; file_eof? ,'file_eof?', \
|
||||
; file_truncate ,'file_truncate', \
|
||||
; file_close ,'file_close'
|
||||
|
||||
consoleImport:
|
||||
library \
|
||||
conlib, 'console.obj'
|
||||
|
||||
import conlib,\
|
||||
con.init, 'con_init',\
|
||||
con.exit, 'con_exit',\
|
||||
con.printf, 'con_printf' ;,\
|
||||
; con.write_asciiz, 'con_write_asciiz'
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
;; Data
|
||||
align 16
|
||||
APP_DATA:
|
||||
|
||||
;; Window title
|
||||
window_title:
|
||||
db APP_NAME, ' ', APP_VERSION, 0
|
||||
|
||||
;; Messages
|
||||
if lang eq it_IT
|
||||
message_dbg_not_found:
|
||||
db '%s non trovato', 10, 0
|
||||
|
||||
message_error:
|
||||
db 'File (%s) non trovato!', 0
|
||||
|
||||
message_ok:
|
||||
db '%s caricato correttamente. PID: %d (0x%X)', 0
|
||||
else
|
||||
message_dbg_not_found:
|
||||
db '%s not found', 10, 0
|
||||
|
||||
message_error:
|
||||
db 'File (%s) not found!', 0
|
||||
|
||||
message_ok:
|
||||
db '%s loaded succesfully. PID: %d (0x%X)', 0
|
||||
end if
|
||||
;; Configuration path
|
||||
etc_cfg:
|
||||
db '/sys/etc/'
|
||||
cfg_name:
|
||||
db 'launch'
|
||||
cfg_ext:
|
||||
db '.cfg', 0
|
||||
|
||||
;; Strings in config file
|
||||
cfg_main:
|
||||
db 'main', 0
|
||||
cfg_path:
|
||||
db 'path', 0
|
||||
cfg_debug:
|
||||
db 'debug', 0
|
||||
cfg_level:
|
||||
db 'level', 0
|
||||
cfg_kobra:
|
||||
db 'kobra', 0
|
||||
cfg_use:
|
||||
db 'use', 0
|
||||
|
||||
;; List of debug modes for parsing debug option
|
||||
debug_strings:
|
||||
dd debug_no
|
||||
dd debug_console
|
||||
dd 0
|
||||
|
||||
debug_no:
|
||||
db 'no', 0
|
||||
debug_console:
|
||||
db 'console', 0
|
||||
|
||||
;; Empty string
|
||||
empty_str:
|
||||
db 0
|
||||
|
||||
kobra_group_launch_reactive:
|
||||
db 'launch_reactive', 0
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
;; Configuration options
|
||||
debug_level:
|
||||
db 0
|
||||
|
||||
; debug_kobra:
|
||||
; db 0
|
||||
|
||||
;; debug option (bool)
|
||||
debug_option:
|
||||
db 0
|
||||
|
||||
kobra_use:
|
||||
db 0
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
tid:
|
||||
dd 0
|
||||
|
||||
struct FileInfoRun
|
||||
Function dd 7
|
||||
Flags dd ?
|
||||
Arguments dd 0
|
||||
Reserved0 dd ?
|
||||
Reserved1 dd ?
|
||||
union
|
||||
FileName rb 1024
|
||||
struct
|
||||
Zero db 0
|
||||
FileNameP dd ?
|
||||
ends
|
||||
ends
|
||||
ends
|
||||
|
||||
LaunchStruct FileInfoRun
|
||||
|
||||
args: db 0
|
||||
APP_END:
|
||||
rb 255
|
||||
|
||||
prog_args:
|
||||
rd 1
|
||||
path:
|
||||
rb 1024
|
||||
|
||||
;; Search path will be here
|
||||
search_path:
|
||||
rb PATH_MAX_LEN
|
||||
|
||||
;; Buffer
|
||||
buff:
|
||||
rb BUFF_SIZE
|
||||
|
||||
another_buff:
|
||||
rb 0x1000
|
||||
|
||||
kobra_message:
|
||||
rb 0x100
|
||||
|
||||
rb 0x1000 ;; 4 Kb stack
|
||||
APP_STACK:
|
||||
MEM_END:
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Copyright (C) Vasiliy Kosenko (vkos), 2009 ;;
|
||||
;; Launch is free software: you can redistribute it and/or modify it under the terms of the GNU ;;
|
||||
;; General Public License as published by the Free Software Foundation, either version 3 ;;
|
||||
;; of the License, or (at your option) any later version. ;;
|
||||
;; ;;
|
||||
;; Launch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without ;;
|
||||
;; even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;
|
||||
;; General Public License for more details. ;;
|
||||
;; ;;
|
||||
;; You should have received a copy of the GNU General Public License along with Launch. ;;
|
||||
;; If not, see <http://www.gnu.org/licenses/>. ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Launch finds program in search dirictories and runs it. ;;
|
||||
;; For more details see readme.txt ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
; Language support for locales: it_IT, en_US.
|
||||
|
||||
format binary
|
||||
|
||||
APP_NAME fix 'Launch'
|
||||
APP_VERSION fix '0.1.80.1'
|
||||
|
||||
use32
|
||||
org 0x0
|
||||
|
||||
db 'MENUET01'
|
||||
dd 0x01
|
||||
dd START
|
||||
dd APP_END
|
||||
dd MEM_END
|
||||
dd APP_STACK
|
||||
dd args
|
||||
dd path
|
||||
|
||||
define DEBUG_NO 0
|
||||
define DEBUG_CONSOLE 1
|
||||
define DEBUG_BOARD 2 ;; Not used now
|
||||
|
||||
define PATH_MAX_LEN 1024
|
||||
define DEBUG_MAX_LEN 8
|
||||
define DEBUG_DEFAULT 0
|
||||
define BUFF_SIZE 1024
|
||||
|
||||
include 'proc32.inc'
|
||||
include 'macros.inc'
|
||||
include 'libio.inc'
|
||||
include 'dll.inc'
|
||||
|
||||
purge mov
|
||||
|
||||
include 'thread.inc'
|
||||
include 'ipc.inc'
|
||||
include 'kobra.inc'
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
;; Basic initialization
|
||||
START:
|
||||
;; Initialize process heap
|
||||
mcall 68,11
|
||||
test eax, eax
|
||||
jz exit
|
||||
|
||||
;; Import modules
|
||||
stdcall dll.Load,importTable
|
||||
test eax, eax
|
||||
jnz exit
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
;; Reading config
|
||||
read_ini_path: ;; Read search path
|
||||
;; First read config in /sys/etc
|
||||
invoke ini.get_str, etc_cfg, cfg_main, cfg_path, search_path, PATH_MAX_LEN, empty_str
|
||||
|
||||
;; Next, read config from current directory
|
||||
;; Find end of path string
|
||||
.find_path_eol:
|
||||
mov edi, path
|
||||
mov ecx, PATH_MAX_LEN
|
||||
xor al, al
|
||||
cld
|
||||
repne scasb
|
||||
|
||||
;; Append ext to run path (NOTE: this work only when config file has name <launch-file-name>.cfg and ext size is dword)
|
||||
mov eax, dword [cfg_ext]
|
||||
dec edi
|
||||
mov dword [edi], eax
|
||||
mov byte [edi+5], 0
|
||||
|
||||
;; Currently there is no checking for repeating pathes, so we should only concatenate two strings
|
||||
;; So we need to find end of current search_path string
|
||||
.find_search_eol:
|
||||
mov edi, search_path
|
||||
mov ecx, PATH_MAX_LEN
|
||||
xor al, al
|
||||
;cld
|
||||
repne scasb
|
||||
dec edi
|
||||
|
||||
;; Now we need to correct buffer length
|
||||
mov eax, path+PATH_MAX_LEN
|
||||
sub eax, edi
|
||||
;; Read ini
|
||||
invoke ini.get_str, path, cfg_main, cfg_path, edi, PATH_MAX_LEN, empty_str
|
||||
|
||||
read_ini_debug: ;; Read debug options
|
||||
;; Read debug options from config files
|
||||
invoke ini.get_option_str, etc_cfg, cfg_debug, cfg_debug, debug_strings, DEBUG_MAX_LEN, DEBUG_DEFAULT
|
||||
invoke ini.get_option_str, path, cfg_debug, cfg_debug, debug_strings, DEBUG_MAX_LEN, eax
|
||||
mov [debug_option], eax
|
||||
|
||||
test eax, eax ;; No console
|
||||
je .ok
|
||||
|
||||
jmp .con_init
|
||||
|
||||
.console_err:
|
||||
mov byte [debug_option], 0
|
||||
jmp .ok
|
||||
|
||||
.con_init:
|
||||
stdcall dll.Load, consoleImport
|
||||
test eax, eax
|
||||
jnz .console_err
|
||||
invoke con.init, -1, -1, -1, -1, window_title
|
||||
|
||||
.read_level:
|
||||
invoke ini.get_int, etc_cfg, cfg_debug, cfg_level, 0
|
||||
invoke ini.get_int, path, cfg_debug, cfg_level, eax
|
||||
mov byte [debug_level], al
|
||||
.ok:
|
||||
|
||||
read_ini_kobra:
|
||||
invoke ini.get_bool, etc_cfg, cfg_kobra, cfg_use, 0
|
||||
invoke ini.get_bool, path, cfg_kobra, cfg_use, eax
|
||||
|
||||
mov byte [kobra_use], al
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
;; Parse command line options
|
||||
parse_args:
|
||||
;; Now parse command line arguments
|
||||
;; TODO: use optparse library
|
||||
;; Currently the only argument to parse is program name with its' arguments
|
||||
|
||||
.skip_spaces:
|
||||
mov ecx, -1
|
||||
mov edi, args
|
||||
mov al, ' '
|
||||
xor bl, bl
|
||||
;cld
|
||||
repe scasb
|
||||
|
||||
push edi
|
||||
|
||||
mov ecx, -1
|
||||
@@:
|
||||
scasb
|
||||
je @f
|
||||
xchg al, bl
|
||||
dec edi
|
||||
scasb
|
||||
jne @b
|
||||
@@:
|
||||
mov dword [prog_args], edi
|
||||
|
||||
pop edi
|
||||
dec edi
|
||||
;; Now edi = program name
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
;; Finding file
|
||||
search_file:
|
||||
push edi
|
||||
mov esi, search_path
|
||||
xchg esi, [esp]
|
||||
.loop:
|
||||
or dl, dl
|
||||
je .prn_dbg
|
||||
xor dl, dl
|
||||
jmp .prn_end
|
||||
.prn_dbg:
|
||||
push eax
|
||||
mov al, byte [debug_option]
|
||||
; dec al
|
||||
test al, al
|
||||
je .prn_stp
|
||||
mov al, byte [debug_level]
|
||||
or al, al
|
||||
je .prn_stp
|
||||
dec al
|
||||
or al, al
|
||||
je .prn_1
|
||||
.prn_1:
|
||||
cinvoke con.printf, message_dbg_not_found, buff
|
||||
|
||||
.prn_stp:
|
||||
pop eax
|
||||
.prn_end:
|
||||
xor eax, eax ;; When we check is proramme launched we are checking for eax
|
||||
xchg esi, [esp]
|
||||
mov edi, buff
|
||||
.copy_path:
|
||||
lodsb
|
||||
cmp al, ';'
|
||||
je .copy_file
|
||||
or al, al
|
||||
je exit
|
||||
stosb
|
||||
jmp .copy_path
|
||||
|
||||
.copy_file:
|
||||
xchg esi, [esp]
|
||||
push esi
|
||||
.cp_file_loop:
|
||||
lodsb
|
||||
or al, al
|
||||
je .copy_end
|
||||
cmp al, ' '
|
||||
je .copy_end
|
||||
stosb
|
||||
jmp .cp_file_loop
|
||||
|
||||
.copy_end:
|
||||
pop esi
|
||||
xor al, al
|
||||
stosb
|
||||
|
||||
;; Try to launch
|
||||
|
||||
mov dword [LaunchStruct.Function], 7
|
||||
push dword [prog_args]
|
||||
pop dword [LaunchStruct.Arguments]
|
||||
mov dword [LaunchStruct.Flags], 0
|
||||
mov dword [LaunchStruct.Zero], 0
|
||||
mov dword [LaunchStruct.FileNameP], buff
|
||||
mcall 70, LaunchStruct
|
||||
cmp eax, 0
|
||||
jl .loop
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
;; Exit
|
||||
exit:
|
||||
mov dword [tid], eax
|
||||
;; If console is present we should write some info
|
||||
mov al, byte [debug_option]
|
||||
cmp al, DEBUG_CONSOLE
|
||||
jne .kobra
|
||||
|
||||
.write_console:
|
||||
mov eax, dword [tid]
|
||||
test eax, eax
|
||||
jz .write_error
|
||||
.write_launched:
|
||||
cinvoke con.printf, message_ok, buff, eax, eax
|
||||
jmp .wr_end
|
||||
.write_error:
|
||||
pop edi
|
||||
cinvoke con.printf, message_error, edi
|
||||
.wr_end:
|
||||
invoke con.exit, 0
|
||||
|
||||
.kobra:
|
||||
mov al, byte [kobra_use]
|
||||
test al, al
|
||||
je .close
|
||||
|
||||
.register:
|
||||
mov dword [IPC_area], buff
|
||||
call IPC_init
|
||||
; jnz .close
|
||||
|
||||
mov dword [thread_find_buff], another_buff
|
||||
|
||||
call kobra_register
|
||||
|
||||
test eax, eax
|
||||
jnz .close
|
||||
|
||||
;; Prepare message
|
||||
mov dword [kobra_message], KOBRA_MESSAGE_LAUNCH_STATE
|
||||
|
||||
mov eax, dword [tid]
|
||||
mov dword [kobra_message+4], eax
|
||||
|
||||
.kobra_send:
|
||||
stdcall kobra_send_message, kobra_group_launch_reactive, kobra_message, 8
|
||||
|
||||
.close:
|
||||
mcall -1
|
||||
|
||||
;; End of code
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
;; Imports
|
||||
align 16
|
||||
importTable:
|
||||
|
||||
library libini, 'libconfig.obj' ;, \
|
||||
; libio, 'libio.obj', \
|
||||
|
||||
import libini, \
|
||||
ini.get_str ,'ini_get_str', \
|
||||
\; ini.set_str ,'ini_set_str', \
|
||||
ini.get_int ,'ini_get_int', \
|
||||
\; ini.set_int ,'ini_set_int', \
|
||||
\; ini.get_color ,'ini_get_color', \
|
||||
\; ini.set_color ,'ini_set_color', \
|
||||
ini.get_option_str ,'ini_get_option_str', \
|
||||
ini.get_bool ,'ini_get_bool';,\
|
||||
|
||||
;import libio, \
|
||||
; file_find_first,'file_find_first', \
|
||||
; file_find_next ,'file_find_next', \
|
||||
; file_find_close,'file_find_close', \
|
||||
; file_size ,'file_size', \
|
||||
; file_open ,'file_open', \
|
||||
; file_read ,'file_read', \
|
||||
; file_write ,'file_write', \
|
||||
; file_seek ,'file_seek', \
|
||||
; file_tell ,'file_tell', \
|
||||
; file_eof? ,'file_eof?', \
|
||||
; file_truncate ,'file_truncate', \
|
||||
; file_close ,'file_close'
|
||||
|
||||
consoleImport:
|
||||
library \
|
||||
conlib, 'console.obj'
|
||||
|
||||
import conlib,\
|
||||
con.init, 'con_init',\
|
||||
con.exit, 'con_exit',\
|
||||
con.printf, 'con_printf' ;,\
|
||||
; con.write_asciiz, 'con_write_asciiz'
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
;; Data
|
||||
align 16
|
||||
APP_DATA:
|
||||
|
||||
;; Window title
|
||||
window_title:
|
||||
db APP_NAME, ' ', APP_VERSION, 0
|
||||
|
||||
;; Messages
|
||||
if lang eq it_IT
|
||||
message_dbg_not_found:
|
||||
db '%s non trovato', 10, 0
|
||||
|
||||
message_error:
|
||||
db 'File (%s) non trovato!', 0
|
||||
|
||||
message_ok:
|
||||
db '%s caricato correttamente. PID: %d (0x%X)', 0
|
||||
else ; Default to en_US
|
||||
message_dbg_not_found:
|
||||
db '%s not found', 10, 0
|
||||
|
||||
message_error:
|
||||
db 'File (%s) not found!', 0
|
||||
|
||||
message_ok:
|
||||
db '%s loaded successfully. PID: %d (0x%X)', 0
|
||||
end if
|
||||
;; Configuration path
|
||||
etc_cfg:
|
||||
db '/sys/etc/'
|
||||
cfg_name:
|
||||
db 'launch'
|
||||
cfg_ext:
|
||||
db '.cfg', 0
|
||||
|
||||
;; Strings in config file
|
||||
cfg_main:
|
||||
db 'main', 0
|
||||
cfg_path:
|
||||
db 'path', 0
|
||||
cfg_debug:
|
||||
db 'debug', 0
|
||||
cfg_level:
|
||||
db 'level', 0
|
||||
cfg_kobra:
|
||||
db 'kobra', 0
|
||||
cfg_use:
|
||||
db 'use', 0
|
||||
|
||||
;; List of debug modes for parsing debug option
|
||||
debug_strings:
|
||||
dd debug_no
|
||||
dd debug_console
|
||||
dd 0
|
||||
|
||||
debug_no:
|
||||
db 'no', 0
|
||||
debug_console:
|
||||
db 'console', 0
|
||||
|
||||
;; Empty string
|
||||
empty_str:
|
||||
db 0
|
||||
|
||||
kobra_group_launch_reactive:
|
||||
db 'launch_reactive', 0
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
;; Configuration options
|
||||
debug_level:
|
||||
db 0
|
||||
|
||||
; debug_kobra:
|
||||
; db 0
|
||||
|
||||
;; debug option (bool)
|
||||
debug_option:
|
||||
db 0
|
||||
|
||||
kobra_use:
|
||||
db 0
|
||||
|
||||
;;--------------------------------------------------------------------------------------------------
|
||||
tid:
|
||||
dd 0
|
||||
|
||||
struct FileInfoRun
|
||||
Function dd 7
|
||||
Flags dd ?
|
||||
Arguments dd 0
|
||||
Reserved0 dd ?
|
||||
Reserved1 dd ?
|
||||
union
|
||||
FileName rb 1024
|
||||
struct
|
||||
Zero db 0
|
||||
FileNameP dd ?
|
||||
ends
|
||||
ends
|
||||
ends
|
||||
|
||||
LaunchStruct FileInfoRun
|
||||
|
||||
args: db 0
|
||||
APP_END:
|
||||
rb 255
|
||||
|
||||
prog_args:
|
||||
rd 1
|
||||
path:
|
||||
rb 1024
|
||||
|
||||
;; Search path will be here
|
||||
search_path:
|
||||
rb PATH_MAX_LEN
|
||||
|
||||
;; Buffer
|
||||
buff:
|
||||
rb BUFF_SIZE
|
||||
|
||||
another_buff:
|
||||
rb 0x1000
|
||||
|
||||
kobra_message:
|
||||
rb 0x100
|
||||
|
||||
rb 0x1000 ;; 4 Kb stack
|
||||
APP_STACK:
|
||||
MEM_END:
|
||||
+1066
-1066
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -7,7 +7,7 @@ include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
include 'txtbut.inc'
|
||||
include '../../../macros.inc'
|
||||
include 'run.mac'
|
||||
include 'lang.inc'
|
||||
include 'lang.inc' ; Language support for locales: ru_RU (CP866), it_IT, en_US.
|
||||
use32
|
||||
org 0
|
||||
db 'MENUET01'
|
||||
@@ -263,7 +263,7 @@ else if lang eq it_IT
|
||||
run_ok db 'Il programma eseguito correttamente',0
|
||||
grab_text db 'RUN',0
|
||||
run_but_text db 'Esegui',0
|
||||
else
|
||||
else ; Default to en_US
|
||||
hello db 'Enter full path to file and press <Enter>',0
|
||||
bad_file_sys db 'Unknown file system',0 ; 3
|
||||
file_not_find db 'File not found',0 ; 5
|
||||
|
||||
@@ -1,387 +1,385 @@
|
||||
;-----------------------------------------------------------------------------
|
||||
text:
|
||||
if lang eq ru_RU
|
||||
db ' Unused1 '
|
||||
db ' Unused2 '
|
||||
db ' 3d темная сторона '
|
||||
db ' 3d светлая сторона '
|
||||
db ' Заголовок окна '
|
||||
db ' Фон окна '
|
||||
db ' Кнопка '
|
||||
db ' Текст на кнопке '
|
||||
db ' Текст в окне '
|
||||
db ' Графика в окне '
|
||||
db 'x'
|
||||
else if lang eq et_EE
|
||||
db ' Unused1 '
|
||||
db ' Unused2 '
|
||||
db ' 3d dark '
|
||||
db ' 3d light '
|
||||
db ' Akna pealkiri '
|
||||
db ' Akna tЎЎpiirkond '
|
||||
db ' Akna tЎЎpiirkonna nupp '
|
||||
db ' Akna tЎЎpiirkonna nuppu tekst '
|
||||
db ' Akna tЎЎpiirkonna tekst '
|
||||
db ' Akna tЎЎpiirkonna graafika '
|
||||
db 'x'
|
||||
else
|
||||
db ' Unused1 '
|
||||
db ' Unused2 '
|
||||
db ' 3d dark '
|
||||
db ' 3d light '
|
||||
db ' Window title '
|
||||
db ' Window background '
|
||||
db ' Button '
|
||||
db ' Button text '
|
||||
db ' Window text '
|
||||
db ' Window graph '
|
||||
db 'x'
|
||||
end if
|
||||
;-----------------------------------------------------------------------------
|
||||
if lang eq ru_RU
|
||||
sz t1,'ЗАГРУЗИТЬ СОХРАНИТЬ ПРИМЕНИТЬ'
|
||||
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,'ЗАГРУЗИТЬ 3D ПЛОСКИЕ ПРИМЕНИТЬ'
|
||||
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 'Настройка окон',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,'ЗАГРУЗИТЬ СОХРАНИТЬ ПРИМЕНИТЬ'
|
||||
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,'ЗАГРУЗИТЬ 3D ПЛОСКИЕ ПРИМЕНИТЬ'
|
||||
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 'Настройка окон',0
|
||||
else if lang eq et_EE
|
||||
title db 'Akna seaded',0
|
||||
else if lang eq it_IT
|
||||
title db 'Impostazioni',0
|
||||
else ; Default to en_US
|
||||
title db 'Windows settings',0
|
||||
end if
|
||||
;---------------------------------------------------------------------
|
||||
LibIniImportTable:
|
||||
library \
|
||||
libini, 'libini.obj'
|
||||
|
||||
import libini, \
|
||||
ini_set_int ,'ini_set_int'
|
||||
|
||||
aIni db '/sys/settings/system.ini',0
|
||||
aSectionSkn db 'style',0
|
||||
aButtonStyle db 'buttons_gradient',0
|
||||
;---------------------------------------------------------------------
|
||||
l_libs_start:
|
||||
|
||||
library01 l_libs system_dir_Boxlib+9, library_path, system_dir_Boxlib, \
|
||||
Box_lib_import
|
||||
|
||||
library02 l_libs system_dir_ProcLib+9, library_path, system_dir_ProcLib, \
|
||||
ProcLib_import
|
||||
|
||||
end_l_libs:
|
||||
;---------------------------------------------------------------------
|
||||
system_dir_Boxlib db '/sys/lib/box_lib.obj',0
|
||||
system_dir_ProcLib db '/sys/lib/proc_lib.obj',0
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
|
||||
ProcLib_import:
|
||||
OpenDialog_Init dd aOpenDialog_Init
|
||||
OpenDialog_Start dd aOpenDialog_Start
|
||||
|
||||
ColorDialog_Init dd aColorDialog_Init
|
||||
ColorDialog_Start dd aColorDialog_Start
|
||||
;OpenDialog__Version dd aOpenDialog_Version
|
||||
dd 0
|
||||
dd 0
|
||||
|
||||
aOpenDialog_Init db 'OpenDialog_init',0
|
||||
aOpenDialog_Start db 'OpenDialog_start',0
|
||||
|
||||
aColorDialog_Init db 'ColorDialog_init',0
|
||||
aColorDialog_Start db 'ColorDialog_start',0
|
||||
;aOpenDialog_Version db 'Version_OpenDialog',0
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
Box_lib_import:
|
||||
;init_lib dd a_init
|
||||
;version_lib dd a_version
|
||||
|
||||
|
||||
;edit_box_draw dd aEdit_box_draw
|
||||
;edit_box_key dd aEdit_box_key
|
||||
;edit_box_mouse dd aEdit_box_mouse
|
||||
;version_ed dd aVersion_ed
|
||||
|
||||
;check_box_draw dd aCheck_box_draw
|
||||
;check_box_mouse dd aCheck_box_mouse
|
||||
;version_ch dd aVersion_ch
|
||||
|
||||
;option_box_draw dd aOption_box_draw
|
||||
;option_box_mouse dd aOption_box_mouse
|
||||
;version_op dd aVersion_op
|
||||
|
||||
;scrollbar_ver_draw dd aScrollbar_ver_draw
|
||||
;scrollbar_ver_mouse dd aScrollbar_ver_mouse
|
||||
;scrollbar_hor_draw dd aScrollbar_hor_draw
|
||||
;scrollbar_hor_mouse dd aScrollbar_hor_mouse
|
||||
;version_scrollbar dd aVersion_scrollbar
|
||||
|
||||
;dinamic_button_draw dd aDbutton_draw
|
||||
;dinamic_button_mouse dd aDbutton_mouse
|
||||
;version_dbutton dd aVersion_dbutton
|
||||
|
||||
;menu_bar_draw dd aMenu_bar_draw
|
||||
;menu_bar_mouse dd aMenu_bar_mouse
|
||||
;menu_bar_activate dd aMenu_bar_activate
|
||||
;version_menu_bar dd aVersion_menu_bar
|
||||
|
||||
;FileBrowser_draw dd aFileBrowser_draw
|
||||
;FileBrowser_mouse dd aFileBrowser_mouse
|
||||
;FileBrowser_key dd aFileBrowser_key
|
||||
;Version_FileBrowser dd aVersion_FileBrowser
|
||||
|
||||
PathShow_prepare dd sz_PathShow_prepare
|
||||
PathShow_draw dd sz_PathShow_draw
|
||||
;Version_path_show dd szVersion_path_show
|
||||
|
||||
Frame_draw dd sz_Frame_draw
|
||||
;Version_frame dd szVersion_frame
|
||||
|
||||
dd 0,0
|
||||
|
||||
;a_init db 'lib_init',0
|
||||
;a_version db 'version',0
|
||||
|
||||
;aEdit_box_draw db 'edit_box_draw',0
|
||||
;aEdit_box_key db 'edit_box_key',0
|
||||
;aEdit_box_mouse db 'edit_box_mouse',0
|
||||
;aVersion_ed db 'version_ed',0
|
||||
|
||||
;aCheck_box_draw db 'check_box_draw',0
|
||||
;aCheck_box_mouse db 'check_box_mouse',0
|
||||
;aVersion_ch db 'version_ch',0
|
||||
|
||||
;aOption_box_draw db 'option_box_draw',0
|
||||
;aOption_box_mouse db 'option_box_mouse',0
|
||||
;aVersion_op db 'version_op',0
|
||||
|
||||
;aScrollbar_ver_draw db 'scrollbar_v_draw',0
|
||||
;aScrollbar_ver_mouse db 'scrollbar_v_mouse',0
|
||||
;aScrollbar_hor_draw db 'scrollbar_h_draw',0
|
||||
;aScrollbar_hor_mouse db 'scrollbar_h_mouse',0
|
||||
;aVersion_scrollbar db 'version_scrollbar',0
|
||||
|
||||
;aDbutton_draw db 'dbutton_draw',0
|
||||
;aDbutton_mouse db 'dbutton_mouse',0
|
||||
;aVersion_dbutton db 'version_dbutton',0
|
||||
|
||||
;aMenu_bar_draw db 'menu_bar_draw',0
|
||||
;aMenu_bar_mouse db 'menu_bar_mouse',0
|
||||
;aMenu_bar_activate db 'menu_bar_activate',0
|
||||
;aVersion_menu_bar db 'version_menu_bar',0
|
||||
|
||||
;aFileBrowser_draw db 'FileBrowser_draw',0
|
||||
;aFileBrowser_mouse db 'FileBrowser_mouse',0
|
||||
;aFileBrowser_key db 'FileBrowser_key',0
|
||||
;aVersion_FileBrowser db 'version_FileBrowser',0
|
||||
|
||||
sz_PathShow_prepare db 'PathShow_prepare',0
|
||||
sz_PathShow_draw db 'PathShow_draw',0
|
||||
;szVersion_path_show db 'version_PathShow',0
|
||||
|
||||
sz_Frame_draw db 'frame_draw',0
|
||||
;szVersion_frame db 'version_frame',0
|
||||
;---------------------------------------------------------------------
|
||||
PathShow_data_1:
|
||||
.type dd 0 ;+0
|
||||
.start_y dw frame_1.y+19 ;+4
|
||||
.start_x dw frame_1.x+15 ;+6
|
||||
.font_size_x dw 6 ;+8 ; 6 - for font 0, 8 - for font 1
|
||||
.area_size_x dw frame_1.w-28 ;+10
|
||||
.font_number dd 0 ;+12 ; 0 - monospace, 1 - variable
|
||||
.background_flag dd 0 ;+16
|
||||
.font_color dd 0x0 ;+20
|
||||
.background_color dd 0x0 ;+24
|
||||
.text_pointer dd dtp_name ;+28
|
||||
.work_area_pointer dd text_work_area ;+32
|
||||
.temp_text_length dd 0 ;+36
|
||||
;---------------------------------------------------------------------
|
||||
PathShow_data_2:
|
||||
.type dd 0 ;+0
|
||||
.start_y dw frame_2.y+19 ;+4
|
||||
.start_x dw frame_2.x+15 ;+6
|
||||
.font_size_x dw 6 ;+8 ; 6 - for font 0, 8 - for font 1
|
||||
.area_size_x dw frame_2.w-28 ;+10
|
||||
.font_number dd 0 ;+12 ; 0 - monospace, 1 - variable
|
||||
.background_flag dd 0 ;+16
|
||||
.font_color dd 0x0 ;+20
|
||||
.background_color dd 0x0 ;+24
|
||||
.text_pointer dd skin_info ;+28
|
||||
.work_area_pointer dd text_work_area2 ;+32
|
||||
.temp_text_length dd 0 ;+36
|
||||
;---------------------------------------------------------------------
|
||||
OpenDialog_data:
|
||||
.type dd 0
|
||||
.procinfo dd procinfo ;+4
|
||||
.com_area_name dd communication_area_name ;+8
|
||||
.com_area dd 0 ;+12
|
||||
.opendir_pach dd temp_dir_pach ;+16
|
||||
.dir_default_pach dd communication_area_default_pach ;+20
|
||||
.start_path dd open_dialog_path ;+24
|
||||
.draw_window dd draw_window ;+28
|
||||
.status dd 0 ;+32
|
||||
.openfile_pach dd dtp_name ;+36
|
||||
.filename_area dd filename_area ;+40
|
||||
.filter_area dd Filter
|
||||
.x:
|
||||
.x_size dw 420 ;+48 ; Window X size
|
||||
.x_start dw 10 ;+50 ; Window X position
|
||||
.y:
|
||||
.y_size dw 320 ;+52 ; Window y size
|
||||
.y_start dw 10 ;+54 ; Window Y position
|
||||
|
||||
OpenDialog_data2:
|
||||
.type dd 0
|
||||
.procinfo dd procinfo ;+4
|
||||
.com_area_name dd communication_area_name2 ;+8
|
||||
.com_area dd 0 ;+12
|
||||
.opendir_pach dd temp_dir_pach2 ;+16
|
||||
.dir_default_pach dd communication_area_default_pach ;+20
|
||||
.start_path dd open_dialog_path ;+24
|
||||
.draw_window dd draw_window ;+28
|
||||
.status dd 0 ;+32
|
||||
.openfile_pach dd skin_info ;+36
|
||||
.filename_area dd filename_area2 ;+40
|
||||
.filter_area dd Filter2
|
||||
.x:
|
||||
.x_size dw 420 ;+48 ; Window X size
|
||||
.x_start dw 10 ;+50 ; Window X position
|
||||
.y:
|
||||
.y_size dw 320 ;+52 ; Window y size
|
||||
.y_start dw 10 ;+54 ; Window Y position
|
||||
|
||||
communication_area_name2:
|
||||
db 'FFFFFFFF_open_dialog',0
|
||||
|
||||
communication_area_name:
|
||||
db 'FFFFFFFF_open_dialog2',0
|
||||
open_dialog_path:
|
||||
if __nightbuild eq yes
|
||||
db '/sys/MANAGERS/opendial',0
|
||||
else
|
||||
db '/sys/File Managers/opendial',0
|
||||
end if
|
||||
communication_area_default_pach:
|
||||
db '/sys',0
|
||||
|
||||
Filter:
|
||||
dd Filter.end - Filter
|
||||
.1:
|
||||
db 'DTP',0
|
||||
.end:
|
||||
db 0
|
||||
|
||||
Filter2:
|
||||
dd Filter.end - Filter
|
||||
.1:
|
||||
db 'SKN',0
|
||||
.end:
|
||||
db 0
|
||||
|
||||
default_skin:
|
||||
db '/sys/default.skn',0
|
||||
default_dtp:
|
||||
db '/sys/default.dtp',0
|
||||
;---------------------------------------------------------------------
|
||||
ColorDialog_data:
|
||||
.type dd 0
|
||||
.procinfo dd procinfo ;+4
|
||||
.com_area_name dd cd_communication_area_name ;+8
|
||||
.com_area dd 0 ;+12
|
||||
.start_path dd colordialog_path ;+16
|
||||
.draw_window dd draw_window ;+20
|
||||
.status dd 0 ;+24
|
||||
.x:
|
||||
.x_size dw 510 ;+28 ; Window X size
|
||||
.x_start dw 10 ;+30 ; Window X position
|
||||
.y:
|
||||
.y_size dw 310 ;+32 ; Window y size
|
||||
.y_start dw 10 ;+34 ; Window Y position
|
||||
.color_type dd 0 ;+36 ; 0- RGB, 1 or other - reserved
|
||||
.color dd 0 ;+40 ; Selected color
|
||||
|
||||
cd_communication_area_name:
|
||||
db 'FFFFFFFF_color_dialog',0
|
||||
colordialog_path:
|
||||
db '/sys/colrdial',0
|
||||
;---------------------------------------------------------------------
|
||||
frame_data:
|
||||
.type dd 0 ;+0
|
||||
.x:
|
||||
.x_size dw 0 ;+4
|
||||
.x_start dw 0 ;+6
|
||||
.y:
|
||||
.y_size dw 0 ;+8
|
||||
.y_start dw 0 ;+10
|
||||
.ext_fr_col dd 0x0 ;+12
|
||||
.int_fr_col dd 0xffffff ;+16
|
||||
.draw_text_flag dd 1 ;+20
|
||||
.text_pointer dd 0 ;+24
|
||||
.text_position dd 0 ;+28
|
||||
.font_number dd 1 ;+32
|
||||
.font_size_y dd 14 ;+36
|
||||
.font_color dd 0x0 ;+40
|
||||
.font_backgr_color dd 0xffffff ;+44
|
||||
;---------------------------------------------------------------------
|
||||
IncludeIGlobals
|
||||
@@ -26,7 +26,7 @@
|
||||
M01header.params:
|
||||
dd app_param ; parameters
|
||||
dd cur_dir_path ; path to file
|
||||
|
||||
|
||||
include 'lang.inc'
|
||||
include '../../../proc32.inc'
|
||||
include '../../../config.inc' ;for nightbuild
|
||||
@@ -85,7 +85,7 @@ frame_1:
|
||||
.y = area.y + area.height + 20
|
||||
.w = area.w + 217
|
||||
.height = 65
|
||||
;--------------------------------------
|
||||
;--------------------------------------
|
||||
frame_2:
|
||||
.x = frame_1.x
|
||||
.y = frame_1.y + frame_1.height + 20
|
||||
@@ -99,11 +99,11 @@ win:
|
||||
START: ; start of execution
|
||||
;---------------------------------------------------------------------
|
||||
mcall SF_SYS_MISC,SSF_HEAP_INIT
|
||||
|
||||
test eax,eax
|
||||
jz close
|
||||
|
||||
stdcall dll.Load,LibIniImportTable
|
||||
test eax,eax
|
||||
jz close
|
||||
|
||||
stdcall dll.Load,LibIniImportTable
|
||||
load_libraries l_libs_start,end_l_libs
|
||||
|
||||
;if return code =-1 then exit, else nornary work
|
||||
@@ -125,7 +125,7 @@ load_libraries l_libs_start,end_l_libs
|
||||
cmp ecx, '.dtp'
|
||||
je load_dtp_from_param
|
||||
jmp no_param
|
||||
|
||||
|
||||
load_dtp_from_param:
|
||||
stdcall string.copy, [M01header.params], dtp_name
|
||||
call load_dtp_file.1
|
||||
@@ -139,8 +139,8 @@ load_skin_from_param:
|
||||
no_param:
|
||||
mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,color_table,4*10 ; get current colors
|
||||
call load_skin_file.2
|
||||
|
||||
skin_path_ready:
|
||||
|
||||
skin_path_ready:
|
||||
;---------------------------------------------------------------------
|
||||
;OpenDialog initialisation
|
||||
push dword OpenDialog_data
|
||||
@@ -156,13 +156,13 @@ skin_path_ready:
|
||||
; prepare for PathShow
|
||||
push dword PathShow_data_1
|
||||
call [PathShow_prepare]
|
||||
|
||||
|
||||
push dword PathShow_data_2
|
||||
call [PathShow_prepare]
|
||||
;---------------------------------------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
red:
|
||||
call draw_window ; at first, draw the window
|
||||
;---------------------------------------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
still:
|
||||
mcall SF_WAIT_EVENT
|
||||
|
||||
@@ -250,19 +250,19 @@ no_apply_skin:
|
||||
|
||||
cmp ah,41
|
||||
jg no_new_colour
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
.start_ColorDialog:
|
||||
push dword ColorDialog_data
|
||||
call [ColorDialog_Start]
|
||||
; 2 - use another method/not found program
|
||||
cmp [ColorDialog_data.status],2
|
||||
je still
|
||||
; 1 - OK, color selected
|
||||
; 1 - OK, color selected
|
||||
cmp [ColorDialog_data.status],1
|
||||
jne still
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
shr eax,8
|
||||
sub eax,31
|
||||
shl eax,2
|
||||
@@ -449,9 +449,9 @@ newcol:
|
||||
add bx,4
|
||||
sub ecx,2 shl 16
|
||||
add cx,4
|
||||
|
||||
|
||||
mov [frame_data.x],ebx
|
||||
mov [frame_data.y],ecx
|
||||
mov [frame_data.y],ecx
|
||||
|
||||
push dword frame_data
|
||||
call [Frame_draw]
|
||||
@@ -473,7 +473,7 @@ draw_PathShow:
|
||||
; draw for PathShow
|
||||
push dword PathShow_data_1
|
||||
call [PathShow_draw]
|
||||
|
||||
|
||||
push dword PathShow_data_2
|
||||
call [PathShow_draw]
|
||||
popa
|
||||
@@ -498,7 +498,7 @@ draw_window:
|
||||
mcall ,<110, win.w>,,,,title
|
||||
|
||||
mcall SF_THREAD_INFO,procinfo,-1
|
||||
|
||||
|
||||
mov eax,[procinfo+70] ;status of window
|
||||
test eax,100b
|
||||
jne .end
|
||||
@@ -527,8 +527,8 @@ draw_window:
|
||||
mcall SF_DEFINE_BUTTON,,,16 ; button 17
|
||||
; select color DTP button text
|
||||
mcall SF_DRAW_TEXT,<frame_1.x+16,frame_1.y+44>,[w_work_button_text],t1,t1.size
|
||||
;-----------------------------------
|
||||
; select skin frame
|
||||
;-----------------------------------
|
||||
; select skin frame
|
||||
; LOAD SKIN BUTTON ; button 17
|
||||
mcall SF_DEFINE_BUTTON,<frame_2.x+10,load_w>,<frame_2.y+38,18>,17,[w_work_button]
|
||||
; 3D
|
||||
@@ -543,7 +543,7 @@ draw_window:
|
||||
mcall ,,,18 ; button 18
|
||||
; select skin button text
|
||||
mcall SF_DRAW_TEXT,<frame_2.x+16,frame_2.y+44>,[w_work_button_text],t2,t2.size
|
||||
;-----------------------------------
|
||||
;-----------------------------------
|
||||
call draw_button_row
|
||||
call draw_button_row_of_texts
|
||||
call draw_colours
|
||||
@@ -556,7 +556,7 @@ draw_window:
|
||||
mov eax,[w_work_text]
|
||||
mov [frame_data.font_color],eax
|
||||
mov [frame_data.draw_text_flag],dword 1
|
||||
|
||||
|
||||
push dword frame_data
|
||||
call [Frame_draw]
|
||||
;-----------------------------------
|
||||
|
||||
+1178
-1178
File diff suppressed because it is too large.
Load diff
@@ -144,21 +144,21 @@ n_slot rd 1
|
||||
ctx_menu_PID rd 1
|
||||
;------------------------------------------------------------------------------
|
||||
lsz ctx_menu_text,\
|
||||
ru, <"X Закрыть Alt + F4",0>,\
|
||||
en, <"X Close Alt + F4",0>,\
|
||||
et, <"X Sulge Alt + F4",0>,\
|
||||
ru_RU, <"X Закрыть Alt + F4",0>,\
|
||||
en_US, <"X Close Alt + F4",0>,\
|
||||
et_EE, <"X Sulge Alt + F4",0>,\
|
||||
;------------------------------------------------------------------------------
|
||||
lsz ctx_menu_text2,\
|
||||
ru, <25," Свернуть ",0>,\
|
||||
en, <25," Minimize ",0>,\
|
||||
et, <25," Minimeeri ",0>,\
|
||||
ru_RU, <25," Свернуть ",0>,\
|
||||
en_US, <25," Minimize ",0>,\
|
||||
et_EE, <25," Minimeeri ",0>,\
|
||||
;------------------------------------------------------------------------------
|
||||
lsz ctx_menu_text3,\
|
||||
ru, <24," Восстановить ",0>,\
|
||||
en, <24," Restore ",0>,\
|
||||
et, <24," Taasta ",0>
|
||||
ru_RU, <24," Восстановить ",0>,\
|
||||
en_US, <24," Restore ",0>,\
|
||||
et_EE, <24," Taasta ",0>
|
||||
;------------------------------------------------------------------------------
|
||||
ctx_menu_title:
|
||||
db 'KolibriOS'
|
||||
ctx_menu_title_end:
|
||||
;------------------------------------------------------------------------------
|
||||
;------------------------------------------------------------------------------
|
||||
@@ -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
|
||||
|
||||
+4281
-4329
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
Loaded 100 of 102 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user