2006-03-04 12:44:33 +01:00
|
|
|
;********************************
|
|
|
|
;* *
|
|
|
|
;* DESKTOP ICON MANAGER *
|
|
|
|
;* *
|
|
|
|
;* Compile with flat assembler *
|
|
|
|
;* *
|
|
|
|
;********************************
|
2012-05-28 01:11:44 +02:00
|
|
|
; version: 3.11
|
|
|
|
; last update: 28/05/2012
|
|
|
|
; changed by: Marat Zakiyanov aka Mario79, aka Mario
|
|
|
|
; changes: Fixed crash when trying to select some of the icons.
|
|
|
|
; (bug 000013)
|
|
|
|
;---------------------------------------------------------------------
|
2012-04-03 00:46:20 +02:00
|
|
|
; version: 3.10
|
|
|
|
; last update: 03/04/2012
|
|
|
|
; changed by: Marat Zakiyanov aka Mario79, aka Mario
|
|
|
|
; changes: Drawing selection rectangle.
|
|
|
|
; Using new kernel function: 15.9
|
|
|
|
;---------------------------------------------------------------------
|
2012-04-02 18:30:55 +02:00
|
|
|
; version: 3.01
|
|
|
|
; last update: 02/04/2012
|
|
|
|
; changed by: Marat Zakiyanov aka Mario79, aka Mario
|
|
|
|
; changes: Fix for previous revision - not drawed icons after
|
|
|
|
; startup in certain cases.
|
|
|
|
;---------------------------------------------------------------------
|
2012-04-02 01:55:52 +02:00
|
|
|
; version: 3.00
|
|
|
|
; last update: 02/04/2012
|
|
|
|
; changed by: Marat Zakiyanov aka Mario79, aka Mario
|
2012-04-03 00:46:20 +02:00
|
|
|
; changes: Program use only 2 threads: draw and mouse
|
|
|
|
; Using new kernel functions: 25, 34, 15.8, 4 (redirect).
|
|
|
|
; Using PNG icons with transparent.
|
2012-04-02 01:55:52 +02:00
|
|
|
;---------------------------------------------------------------------
|
2012-03-18 22:54:01 +01:00
|
|
|
; version: 2.11
|
|
|
|
; last update: 19/03/2012
|
|
|
|
; changed by: Marat Zakiyanov aka Mario79, aka Mario
|
|
|
|
; changes: The program uses only 140 Kb memory is now.
|
|
|
|
; Some speedup.
|
2012-03-17 19:39:13 +01:00
|
|
|
;---------------------------------------------------------------------
|
|
|
|
; version: 2.1
|
|
|
|
; last update: 17/03/2012
|
|
|
|
; changed by: Marat Zakiyanov aka Mario79, aka Mario
|
|
|
|
; changes: Global optimization! The program uses
|
|
|
|
; only 161 KB of memory instead of 603 kb is now.
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
; version: 2.02
|
|
|
|
; last update: 15/03/2012
|
|
|
|
; changed by: Marat Zakiyanov aka Mario79, aka Mario
|
|
|
|
; changes: some optimisations and code refactoring
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
; version: 2.01
|
|
|
|
; last update: 27/09/2011
|
|
|
|
; changed by: Marat Zakiyanov aka Mario79, aka Mario
|
|
|
|
; changes: deactivate the window after click
|
|
|
|
; (working to kernel r.2244 and above)
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
; Many fix's and changes created by:
|
|
|
|
; Halyavin, Diamond, Heavyiron,
|
|
|
|
; SPraid, Dunkaist
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
; version: 2.00
|
2012-04-02 01:55:52 +02:00
|
|
|
; last update: 22/02/2005
|
2012-03-17 19:39:13 +01:00
|
|
|
; changed by: Willow and Mario79
|
|
|
|
; changes: modified for work with new multi-thread ICON.
|
2006-03-04 12:44:33 +01:00
|
|
|
;******************************************************************************
|
2012-04-02 01:55:52 +02:00
|
|
|
ICON_SIZE equ 32*32*4
|
2006-03-04 12:44:33 +01:00
|
|
|
REC_SIZE equ 80
|
2012-04-02 01:55:52 +02:00
|
|
|
ICONS_DAT equ '/sys/icons.dat'
|
2012-04-03 00:46:20 +02:00
|
|
|
ICON_APP equ '/sys/ICON'
|
2022-01-07 13:42:44 +01:00
|
|
|
ICON_STRIP equ '/sys/iconstrp.png'
|
2012-03-15 21:05:00 +01:00
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
use32
|
|
|
|
org 0x0
|
2012-03-17 19:39:13 +01:00
|
|
|
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 I_Param ; boot parameters
|
2012-04-02 01:55:52 +02:00
|
|
|
dd path ; path
|
2012-03-15 21:05:00 +01:00
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
include 'lang.inc'
|
2012-04-02 01:55:52 +02:00
|
|
|
include '../../../macros.inc'
|
2022-01-04 19:37:25 +01:00
|
|
|
include '../../../KOSfuncs.inc'
|
|
|
|
include '../../../load_lib.mac'
|
2012-11-09 10:19:16 +01:00
|
|
|
;include '../../../debug.inc'
|
2012-04-02 01:55:52 +02:00
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
@use_library ;use load lib macros
|
2012-03-15 21:05:00 +01:00
|
|
|
;------------------------------------------------------------------------------
|
2012-03-17 19:39:13 +01:00
|
|
|
START: ; start of execution
|
2012-03-18 22:54:01 +01:00
|
|
|
mcall 68,11
|
2012-04-02 01:55:52 +02:00
|
|
|
;---------------------------------------------------------------------
|
|
|
|
load_libraries l_libs_start,end_l_libs
|
|
|
|
test eax,eax
|
|
|
|
jnz close
|
|
|
|
|
|
|
|
; unpack deflate
|
|
|
|
mov eax,[unpack_DeflateUnpack2]
|
|
|
|
mov [deflate_unpack],eax
|
|
|
|
;---------------------------------------------------------------------
|
2012-05-28 01:11:44 +02:00
|
|
|
; get size of file ICONSTRP.PNG
|
2012-03-15 21:05:00 +01:00
|
|
|
mcall 70,finfo
|
2012-03-18 22:54:01 +01:00
|
|
|
test eax,eax
|
|
|
|
jnz close
|
2012-05-28 01:11:44 +02:00
|
|
|
; get memory for ICONSTRP.PNG
|
2012-04-02 01:55:52 +02:00
|
|
|
mov ecx,[procinfo+32]
|
2012-03-18 22:54:01 +01:00
|
|
|
mov [finfo.size],ecx
|
2012-04-02 01:55:52 +02:00
|
|
|
mov [img_size],ecx
|
2012-03-18 22:54:01 +01:00
|
|
|
mcall 68,12
|
|
|
|
mov [finfo.point],eax
|
2012-04-02 01:55:52 +02:00
|
|
|
mov [image_file],eax
|
2012-05-28 01:11:44 +02:00
|
|
|
; load ICONSTRP.PNG
|
2012-03-18 22:54:01 +01:00
|
|
|
mov [finfo],dword 0
|
|
|
|
mcall 70,finfo
|
|
|
|
test eax,eax
|
|
|
|
jnz close
|
2012-04-02 01:55:52 +02:00
|
|
|
; convert PNG to RAW
|
|
|
|
xor eax,eax
|
|
|
|
mov [return_code],eax
|
|
|
|
|
|
|
|
push image_file
|
|
|
|
call [cnv_png_import.Start]
|
|
|
|
|
|
|
|
mov eax,[raw_pointer]
|
2012-05-28 01:11:44 +02:00
|
|
|
mov ebx,[eax+32]
|
|
|
|
mov [strip_file_size],ebx
|
2012-04-02 01:55:52 +02:00
|
|
|
mov eax,[eax+28]
|
|
|
|
add eax,[raw_pointer]
|
2012-03-18 22:54:01 +01:00
|
|
|
mov [strip_file],eax
|
|
|
|
; back memeory to system
|
|
|
|
mcall 68,13,[finfo.point]
|
2012-04-02 01:55:52 +02:00
|
|
|
|
|
|
|
mov eax,[raw_pointer]
|
|
|
|
mov eax,[eax+8]
|
2012-03-15 21:05:00 +01:00
|
|
|
shr eax,5
|
|
|
|
mov [icon_count],eax
|
2012-05-28 01:11:44 +02:00
|
|
|
|
|
|
|
and eax,0x7
|
|
|
|
mov [cur_band_compensation],eax
|
2012-03-18 22:54:01 +01:00
|
|
|
; load ICON.DAT
|
2012-03-15 21:05:00 +01:00
|
|
|
call load_ic
|
|
|
|
boot_str:
|
|
|
|
cmp [I_Param],dword 'BOOT'
|
2012-04-02 01:55:52 +02:00
|
|
|
je START2
|
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
; ICON EDITOR MODE - START1 entering label
|
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
START1:
|
2012-03-15 21:05:00 +01:00
|
|
|
call load_icon_list
|
2012-04-02 01:55:52 +02:00
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
align 4
|
2012-03-15 21:05:00 +01:00
|
|
|
red:
|
2012-03-17 19:39:13 +01:00
|
|
|
call draw_window ; at first, draw the window
|
2012-03-15 21:05:00 +01:00
|
|
|
mov esi,[current_icon]
|
|
|
|
jmp band
|
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
align 4
|
2006-03-04 12:44:33 +01:00
|
|
|
still:
|
2012-03-15 21:05:00 +01:00
|
|
|
mcall 10 ; wait here for event
|
2012-03-17 19:39:13 +01:00
|
|
|
dec eax ; redraw request ?
|
2012-03-15 21:05:00 +01:00
|
|
|
jz red
|
|
|
|
|
2012-03-17 19:39:13 +01:00
|
|
|
dec eax ; key in buffer ?
|
2012-03-15 21:05:00 +01:00
|
|
|
jz key
|
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
align 4
|
2012-03-17 19:39:13 +01:00
|
|
|
button:
|
2012-03-15 21:05:00 +01:00
|
|
|
mcall 17 ; get id
|
|
|
|
shr eax,8
|
|
|
|
|
2012-03-17 19:39:13 +01:00
|
|
|
cmp eax,1 ; button id=1 ?
|
2012-03-15 21:05:00 +01:00
|
|
|
je close
|
2012-04-02 01:55:52 +02:00
|
|
|
|
2012-03-15 21:05:00 +01:00
|
|
|
mov esi,[current_icon]
|
|
|
|
add esi,12
|
2012-04-02 01:55:52 +02:00
|
|
|
mov ebx,[cur_band]
|
|
|
|
|
|
|
|
cmp eax,11
|
|
|
|
jb @f
|
|
|
|
cmp eax,13
|
|
|
|
ja @f
|
|
|
|
call read_string
|
|
|
|
jmp still
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
@@:
|
|
|
|
cmp eax,21 ; apply changes
|
|
|
|
je apply
|
|
|
|
|
|
|
|
cmp eax,22 ; user pressed the 'add icon' button
|
|
|
|
je add_icon
|
|
|
|
|
|
|
|
cmp eax,23 ; user pressed the remove icon button
|
|
|
|
je remove_icon
|
|
|
|
|
|
|
|
|
|
|
|
cmp eax,30 ; left arrow to icons bar
|
|
|
|
je arrow.left
|
|
|
|
|
2012-03-15 21:05:00 +01:00
|
|
|
cmp eax,31 ; right arrow to icons bar
|
2012-04-02 01:55:52 +02:00
|
|
|
je arrow.right
|
|
|
|
|
|
|
|
cmp eax,32
|
|
|
|
je ico
|
|
|
|
|
|
|
|
cmp eax,40 ; user pressed button for icon position
|
|
|
|
jae press_button_for_icon_position
|
|
|
|
|
|
|
|
jmp still
|
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
align 4
|
|
|
|
arrow:
|
|
|
|
.right:
|
2012-03-15 21:05:00 +01:00
|
|
|
|
|
|
|
mov eax,[icon_count]
|
2012-04-02 01:55:52 +02:00
|
|
|
sub eax,8
|
|
|
|
cmp ebx,eax
|
|
|
|
jae still ;.drwic2
|
2012-03-15 21:05:00 +01:00
|
|
|
|
2012-04-02 01:55:52 +02:00
|
|
|
add ebx,1
|
2012-03-15 21:05:00 +01:00
|
|
|
jmp .drwic2
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
2012-04-02 01:55:52 +02:00
|
|
|
.left:
|
2012-03-15 21:05:00 +01:00
|
|
|
test ebx,ebx
|
2012-04-02 01:55:52 +02:00
|
|
|
jz still
|
2012-03-15 21:05:00 +01:00
|
|
|
|
2012-04-02 01:55:52 +02:00
|
|
|
sub ebx,1
|
2012-03-15 21:05:00 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
.drwic2:
|
|
|
|
mov [cur_band],ebx
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
.drwic1:
|
|
|
|
call draw_icon
|
|
|
|
jmp still
|
2012-04-02 01:55:52 +02:00
|
|
|
;------------------------------------------------------------------------------
|
2012-03-15 21:05:00 +01:00
|
|
|
align 4
|
2012-04-02 01:55:52 +02:00
|
|
|
ico:
|
2012-03-15 21:05:00 +01:00
|
|
|
push ebx
|
|
|
|
mcall 37,1
|
|
|
|
pop ebx
|
|
|
|
shr eax,16
|
|
|
|
sub eax,33-19
|
|
|
|
mov edi,34
|
|
|
|
xor edx,edx
|
|
|
|
div edi
|
|
|
|
lea ecx,[ebx+eax]
|
|
|
|
cmp ecx,[icon_count]
|
|
|
|
jae still
|
|
|
|
|
|
|
|
mov ecx,eax
|
|
|
|
add eax,ebx
|
|
|
|
call itoa
|
2012-04-02 01:55:52 +02:00
|
|
|
jmp arrow.drwic1
|
|
|
|
;------------------------------------------------------------------------------
|
2012-03-17 19:39:13 +01:00
|
|
|
align 4
|
2012-04-02 01:55:52 +02:00
|
|
|
apply:
|
2012-03-15 21:05:00 +01:00
|
|
|
; (1) save list
|
2012-04-02 01:55:52 +02:00
|
|
|
mov ebx,finfo
|
2012-03-15 21:05:00 +01:00
|
|
|
mov dword[ebx],2
|
|
|
|
mov edx,REC_SIZE
|
|
|
|
imul edx,dword [icons]
|
|
|
|
mov [ebx+12],edx
|
|
|
|
mov esi,iconlst
|
|
|
|
call lst_path
|
|
|
|
mcall 70
|
|
|
|
; (2) terminate all icons
|
2012-03-17 19:39:13 +01:00
|
|
|
or ecx,-1
|
2012-04-02 01:55:52 +02:00
|
|
|
mcall 9,procinfo
|
2012-03-15 21:05:00 +01:00
|
|
|
mov edi,[ebx+30]
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
newread2:
|
|
|
|
mov esi,1
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
newread:
|
|
|
|
inc esi
|
|
|
|
mov ecx,esi
|
2012-04-02 01:55:52 +02:00
|
|
|
mcall 9,procinfo
|
|
|
|
|
2012-03-15 21:05:00 +01:00
|
|
|
cmp edi,[ebx+30]
|
|
|
|
je newread
|
|
|
|
|
|
|
|
cmp esi,eax
|
2012-04-02 01:55:52 +02:00
|
|
|
jg .apply_changes
|
2012-03-15 21:05:00 +01:00
|
|
|
|
2012-03-17 19:39:13 +01:00
|
|
|
mov eax,[ebx+10]
|
2012-03-15 21:05:00 +01:00
|
|
|
and eax,not 20202020h
|
|
|
|
cmp eax,'@ICO'
|
|
|
|
jz @f
|
|
|
|
cmp eax,'ICON'
|
|
|
|
jne newread
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
@@:
|
2012-04-02 01:55:52 +02:00
|
|
|
xor eax,eax
|
2012-03-17 19:39:13 +01:00
|
|
|
cmp eax,[ebx+42]
|
2012-03-15 21:05:00 +01:00
|
|
|
jne newread
|
|
|
|
|
2012-03-17 19:39:13 +01:00
|
|
|
cmp eax,[ebx+46]
|
2012-03-15 21:05:00 +01:00
|
|
|
jne newread
|
|
|
|
|
|
|
|
mov ecx,esi
|
|
|
|
mcall 18,2
|
2012-04-02 01:55:52 +02:00
|
|
|
|
2012-03-15 21:05:00 +01:00
|
|
|
jmp newread2
|
2012-04-02 01:55:52 +02:00
|
|
|
;--------------------------------------
|
2012-03-15 21:05:00 +01:00
|
|
|
align 4
|
2012-04-02 01:55:52 +02:00
|
|
|
.apply_changes:
|
2012-03-15 21:05:00 +01:00
|
|
|
mov ebx, finfo_start
|
|
|
|
mov dword [ebx+8], boot_str+6
|
|
|
|
mov esi, iconname
|
|
|
|
call lst_path
|
|
|
|
mcall 70
|
2012-04-02 01:55:52 +02:00
|
|
|
mcall 68,1
|
|
|
|
mcall 15,3
|
2012-03-15 21:05:00 +01:00
|
|
|
jmp still
|
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
align 4
|
2012-04-02 01:55:52 +02:00
|
|
|
add_icon:
|
2012-03-15 21:05:00 +01:00
|
|
|
mov ebx,24*65536+250+8*14
|
|
|
|
mcall 4,,0xc0ff0000,add_text,,0xffffff
|
|
|
|
|
|
|
|
mcall 10
|
|
|
|
cmp eax,3
|
|
|
|
jne still
|
|
|
|
|
|
|
|
mcall 17
|
|
|
|
shr eax,8
|
|
|
|
cmp eax,40
|
|
|
|
jb no_f
|
|
|
|
mov edi,eax
|
|
|
|
sub eax,40
|
|
|
|
|
2012-03-17 19:39:13 +01:00
|
|
|
xor edx,edx ; bcd -> 10
|
2012-03-15 21:05:00 +01:00
|
|
|
mov ebx,16
|
|
|
|
div ebx
|
|
|
|
; multiply x10
|
|
|
|
shl eax,1 ; multiply x2
|
|
|
|
lea eax,[eax+eax*4] ; multiply x5
|
|
|
|
add eax,edx
|
|
|
|
|
|
|
|
mov ebx,eax
|
|
|
|
add ebx,icons_reserved
|
|
|
|
cmp [ebx],byte 'x'
|
|
|
|
je no_f
|
|
|
|
mov [ebx],byte 'x'
|
|
|
|
|
|
|
|
mov [cur_btn],edi
|
|
|
|
xor edx,edx
|
|
|
|
mov ebx,10
|
|
|
|
div ebx
|
|
|
|
add eax,65
|
|
|
|
add edx,65
|
|
|
|
mov [icon_default+0],dl
|
|
|
|
mov [icon_default+1],al
|
|
|
|
|
|
|
|
inc dword [icons]
|
|
|
|
mov edi,[icons]
|
|
|
|
dec edi
|
|
|
|
imul edi,REC_SIZE
|
|
|
|
add edi,icon_data
|
|
|
|
|
|
|
|
mov [current_icon],edi
|
|
|
|
|
|
|
|
mov esi,icon_default
|
|
|
|
mov ecx,REC_SIZE
|
|
|
|
cld
|
|
|
|
rep movsb
|
|
|
|
mov esi,[current_icon]
|
|
|
|
jmp band
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
no_f:
|
|
|
|
call draw_btns ;draw_window
|
|
|
|
jmp still
|
2012-04-02 01:55:52 +02:00
|
|
|
;------------------------------------------------------------------------------
|
2012-03-15 21:05:00 +01:00
|
|
|
align 4
|
2012-04-02 01:55:52 +02:00
|
|
|
remove_icon:
|
2012-03-15 21:05:00 +01:00
|
|
|
mov ebx,24*65536+250+8*14
|
|
|
|
mcall 4,,0xc0ff0000,rem_text,,0xffffff
|
|
|
|
|
|
|
|
mcall 10
|
|
|
|
cmp eax,3
|
2012-03-18 22:54:01 +01:00
|
|
|
jne no_f
|
2012-03-15 21:05:00 +01:00
|
|
|
|
|
|
|
mcall 17
|
|
|
|
shr eax,8
|
|
|
|
cmp eax,40
|
2012-03-17 19:39:13 +01:00
|
|
|
jb red
|
2012-03-15 21:05:00 +01:00
|
|
|
sub eax,40
|
|
|
|
|
|
|
|
xor edx,edx
|
|
|
|
mov ebx,16
|
|
|
|
div ebx
|
|
|
|
; multiply x10
|
|
|
|
shl eax,1 ; multiply x2
|
|
|
|
lea eax,[eax+eax*4] ; multiply x5
|
|
|
|
add eax,edx
|
|
|
|
|
|
|
|
mov ebx,eax
|
|
|
|
add ebx,icons_reserved
|
|
|
|
cmp [ebx],byte 'x'
|
|
|
|
jne red
|
|
|
|
mov [ebx],byte ' '
|
|
|
|
|
|
|
|
xor edx,edx
|
|
|
|
mov ebx,10
|
|
|
|
div ebx
|
|
|
|
shl eax,8
|
|
|
|
mov al,dl
|
|
|
|
|
|
|
|
add eax,65*256+65
|
|
|
|
|
|
|
|
mov esi,icon_data
|
|
|
|
mov edi,REC_SIZE
|
|
|
|
imul edi,[icons]
|
|
|
|
add edi,icon_data
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
news:
|
|
|
|
cmp word [esi],ax
|
|
|
|
je foundi
|
|
|
|
add esi,REC_SIZE
|
|
|
|
cmp esi,edi
|
|
|
|
jb news
|
|
|
|
jmp red
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
foundi:
|
|
|
|
mov ecx,edi
|
|
|
|
sub ecx,esi
|
|
|
|
|
|
|
|
mov edi,esi
|
|
|
|
add esi,REC_SIZE
|
|
|
|
|
|
|
|
cld
|
|
|
|
rep movsb
|
|
|
|
|
|
|
|
dec [icons]
|
|
|
|
|
|
|
|
mov eax,icon_data
|
|
|
|
mov [current_icon],eax
|
|
|
|
movzx ebx,word[eax]
|
|
|
|
sub bx,'AA'
|
|
|
|
shl bl,4
|
|
|
|
shr ebx,4
|
|
|
|
add ebx,40
|
|
|
|
mov [cur_btn],ebx
|
|
|
|
jmp red
|
2012-04-02 01:55:52 +02:00
|
|
|
;------------------------------------------------------------------------------
|
2012-03-15 21:05:00 +01:00
|
|
|
align 4
|
2012-04-02 01:55:52 +02:00
|
|
|
press_button_for_icon_position:
|
2012-03-15 21:05:00 +01:00
|
|
|
mov edi,eax
|
|
|
|
sub eax,40
|
|
|
|
mov edx,eax
|
|
|
|
shl eax,4
|
|
|
|
and edx,0xf
|
|
|
|
mov dh,ah
|
|
|
|
add edx,65*256+65
|
|
|
|
mov esi,icon_data
|
|
|
|
mov ecx,[icons]
|
|
|
|
cld
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
findl1:
|
|
|
|
cmp dx,[esi]
|
|
|
|
je foundl1
|
|
|
|
add esi,REC_SIZE
|
|
|
|
loop findl1
|
|
|
|
jmp still
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
foundl1:
|
|
|
|
mov [current_icon],esi
|
|
|
|
mov [cur_btn],edi
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
band:
|
|
|
|
add esi,12
|
2012-04-02 01:55:52 +02:00
|
|
|
call ASCII_to_icon_number
|
2012-05-28 01:11:44 +02:00
|
|
|
; and eax,0xfffff8
|
|
|
|
cmp eax,[cur_band_compensation]
|
|
|
|
jb @f
|
|
|
|
|
|
|
|
sub eax,[cur_band_compensation]
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
@@:
|
2012-03-15 21:05:00 +01:00
|
|
|
mov [cur_band],eax
|
|
|
|
call draw_btns
|
|
|
|
jmp still
|
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
align 4
|
2006-03-04 12:44:33 +01:00
|
|
|
print_strings:
|
2012-03-15 21:05:00 +01:00
|
|
|
pusha
|
|
|
|
mcall 13,<100,180>,<278+12,40>,0xffffff ; clear text area
|
|
|
|
xor edi,edi
|
2012-03-17 19:39:13 +01:00
|
|
|
mov eax,4 ; icon text
|
2012-03-15 21:05:00 +01:00
|
|
|
mov ebx,100*65536+278+14
|
|
|
|
mov ecx,3
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
.ll:
|
|
|
|
push ecx
|
|
|
|
mov ecx,0x000000
|
|
|
|
mov edx,[current_icon]
|
|
|
|
add edx,[positions+edi*4]
|
|
|
|
movzx esi,byte[str_lens+edi]
|
|
|
|
inc edi
|
|
|
|
mcall
|
|
|
|
add ebx,14
|
|
|
|
pop ecx
|
|
|
|
loop .ll
|
|
|
|
|
|
|
|
popa
|
|
|
|
ret
|
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
align 4
|
2006-03-04 12:44:33 +01:00
|
|
|
load_icon_list:
|
2012-03-17 19:39:13 +01:00
|
|
|
mov edi,icons_reserved ; clear reserved area
|
2012-03-15 21:05:00 +01:00
|
|
|
mov eax,32
|
|
|
|
mov ecx,10*9
|
|
|
|
cld
|
|
|
|
rep stosb
|
|
|
|
|
2012-03-17 19:39:13 +01:00
|
|
|
mov ecx,[icons] ; set used icons to reserved area
|
2012-03-15 21:05:00 +01:00
|
|
|
mov esi,icon_data
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
ldl1:
|
|
|
|
movzx ebx,byte [esi+1]
|
|
|
|
sub ebx,65
|
|
|
|
; multiply x10
|
|
|
|
shl ebx,1 ; multiply x2
|
|
|
|
lea ebx,[ebx+ebx*4] ; multiply x5
|
|
|
|
movzx eax,byte [esi]
|
|
|
|
add ebx,eax
|
|
|
|
sub ebx,65
|
|
|
|
add ebx,icons_reserved
|
|
|
|
mov [ebx],byte 'x'
|
|
|
|
add esi,REC_SIZE
|
|
|
|
loop ldl1
|
|
|
|
ret
|
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
align 4
|
2006-03-04 12:44:33 +01:00
|
|
|
lst_path:
|
2012-03-15 21:05:00 +01:00
|
|
|
mov ecx,30
|
|
|
|
mov edi,finfo.path
|
|
|
|
rep movsb
|
|
|
|
ret
|
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
align 4
|
2006-03-04 12:44:33 +01:00
|
|
|
load_ic:
|
2012-03-15 21:05:00 +01:00
|
|
|
mov ebx,finfo
|
|
|
|
mov dword[ebx+12],48*REC_SIZE
|
|
|
|
mov dword[ebx+16],icon_data
|
|
|
|
mov esi,iconlst
|
|
|
|
call lst_path
|
|
|
|
mcall 70
|
|
|
|
lea eax,[ebx+10]
|
|
|
|
xor edx,edx
|
|
|
|
mov ebx,REC_SIZE
|
|
|
|
div ebx
|
|
|
|
mov [icons],eax
|
|
|
|
ret
|
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
align 4
|
2006-03-04 12:44:33 +01:00
|
|
|
read_string:
|
2012-03-15 21:05:00 +01:00
|
|
|
pusha
|
|
|
|
sub eax,11
|
|
|
|
movzx ecx,byte[str_lens+eax]
|
|
|
|
mov [cur_str],ecx
|
|
|
|
mov eax,[positions+eax*4]
|
|
|
|
mov edi,[current_icon]
|
|
|
|
add edi,eax
|
|
|
|
mov [addr],edi
|
|
|
|
add edi,ecx
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
.l1:
|
|
|
|
dec edi
|
|
|
|
cmp byte[edi],' '
|
|
|
|
jne .found
|
|
|
|
|
|
|
|
mov byte[edi],'_'
|
|
|
|
loop .l1
|
|
|
|
|
|
|
|
dec edi
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
.found:
|
|
|
|
inc edi
|
|
|
|
push edi
|
|
|
|
call print_strings
|
|
|
|
pop edi
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
f11:
|
|
|
|
mcall 10
|
|
|
|
cmp eax,2
|
|
|
|
jz fbu
|
|
|
|
jmp rs_done
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
fbu:
|
|
|
|
mcall 2
|
|
|
|
shr eax,8
|
|
|
|
cmp eax,13
|
|
|
|
je rs_done
|
|
|
|
cmp eax,8
|
|
|
|
jnz nobsl
|
|
|
|
cmp edi,[addr]
|
|
|
|
jz f11
|
|
|
|
dec edi
|
|
|
|
mov [edi],byte '_'
|
|
|
|
call print_strings
|
|
|
|
jmp f11
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
nobsl:
|
|
|
|
cmp eax,31
|
|
|
|
jbe f11
|
|
|
|
mov [edi],al
|
|
|
|
call print_strings
|
|
|
|
inc edi
|
|
|
|
mov esi,[addr]
|
|
|
|
add esi,[cur_str]
|
|
|
|
cmp esi,edi
|
|
|
|
jnz f11
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
rs_done:
|
|
|
|
mov ecx,[addr]
|
|
|
|
add ecx,[cur_str]
|
|
|
|
sub ecx,edi
|
|
|
|
mov eax,32
|
|
|
|
cld
|
|
|
|
rep stosb
|
|
|
|
call print_strings
|
|
|
|
popa
|
|
|
|
ret
|
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
align 4
|
2012-03-17 19:39:13 +01:00
|
|
|
key:
|
|
|
|
mcall 2 ; just read it and ignore
|
2012-03-15 21:05:00 +01:00
|
|
|
jmp still
|
|
|
|
;------------------------------------------------------------------------------
|
2006-03-04 12:44:33 +01:00
|
|
|
; *********************************************
|
|
|
|
; ******* WINDOW DEFINITIONS AND DRAW ********
|
|
|
|
; *********************************************
|
2012-03-15 21:05:00 +01:00
|
|
|
align 4
|
2006-03-04 12:44:33 +01:00
|
|
|
draw_window:
|
2012-03-15 21:05:00 +01:00
|
|
|
mcall 12,1
|
2012-03-17 19:39:13 +01:00
|
|
|
; DRAW WINDOW
|
2012-03-15 21:05:00 +01:00
|
|
|
xor eax,eax
|
|
|
|
xor esi,esi
|
|
|
|
mcall ,<210,300>,<30,(390-14)>,0x14ffffff,,title
|
2006-03-04 12:44:33 +01:00
|
|
|
|
2012-03-15 21:05:00 +01:00
|
|
|
mcall 13,<20,260>,<35,200>,0x3366cc ; WINDOW AREA
|
2006-03-04 12:44:33 +01:00
|
|
|
|
2012-03-15 21:05:00 +01:00
|
|
|
mcall 38,<150,150>,<35,235>,0xffffff ; VERTICAL LINE ON WINDOW AREA
|
2006-03-04 12:44:33 +01:00
|
|
|
|
2012-03-15 21:05:00 +01:00
|
|
|
mcall ,<20,280>,<135,135> ; HOROZONTAL LINE ON WINDOW AREA
|
2006-03-04 12:44:33 +01:00
|
|
|
|
2012-03-15 21:05:00 +01:00
|
|
|
mcall 8,<20,72>,<(275+1+14),(13-2)>,11,[bcolor] ;id 11 TEXT ENTER BUTTONS
|
|
|
|
|
|
|
|
inc edx
|
|
|
|
add ecx,14*65536
|
|
|
|
mcall ; id 12
|
|
|
|
|
|
|
|
inc edx
|
|
|
|
add ecx,14*65536
|
|
|
|
mcall ; id 13
|
2006-03-04 12:44:33 +01:00
|
|
|
|
2012-03-15 21:05:00 +01:00
|
|
|
mcall ,<20,259>,<(329+2),(15-4)>,21 ; id 21 APPLY AND SAVE CHANGES BUTTON
|
2006-03-04 12:44:33 +01:00
|
|
|
|
2012-03-15 21:05:00 +01:00
|
|
|
add ecx,14*65536
|
|
|
|
inc edx
|
|
|
|
mcall ,<20,(129-2)> ; id 22 ADD ICON BUTTON
|
2006-03-04 12:44:33 +01:00
|
|
|
|
2012-03-15 21:05:00 +01:00
|
|
|
add ebx,(130+2)*65536
|
|
|
|
inc edx
|
|
|
|
mcall ; id 23 REMOVE ICON BUTTON
|
2006-03-04 12:44:33 +01:00
|
|
|
|
2012-03-15 21:05:00 +01:00
|
|
|
mcall ,<(20-14),8>,<(260-23),32>,30 + 1 shl 30 ; id 30 IMAGE BUTTON
|
2006-03-04 12:44:33 +01:00
|
|
|
|
2012-03-15 21:05:00 +01:00
|
|
|
inc edx
|
|
|
|
add ebx,(36*7+26) shl 16
|
|
|
|
mcall ; id 31
|
2006-03-04 12:44:33 +01:00
|
|
|
|
2012-03-15 21:05:00 +01:00
|
|
|
add edx,1 + 1 shl 29
|
|
|
|
mcall ,<(33-19),(34*8)> ; id 32
|
|
|
|
|
|
|
|
mcall 4,<(23-15),(273-24)>,0,arrows,1
|
|
|
|
|
|
|
|
add ebx,(36*7+27)shl 16
|
|
|
|
add edx,2
|
|
|
|
mcall
|
|
|
|
|
|
|
|
dec edx
|
|
|
|
mcall ,<120,250>
|
|
|
|
|
|
|
|
lea edx,[ebx+8 shl 16]
|
|
|
|
mcall 47,0x30000,[icon_count],,0
|
|
|
|
|
|
|
|
mov eax,4
|
|
|
|
mov ebx,24 shl 16+(250+14+14+14)
|
|
|
|
mov ecx,0xffffff
|
|
|
|
mov edx,text
|
|
|
|
mov esi,47
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
2012-04-02 01:55:52 +02:00
|
|
|
.newline:
|
2012-03-15 21:05:00 +01:00
|
|
|
mov ecx,[edx]
|
|
|
|
add edx,4
|
|
|
|
mcall
|
|
|
|
add ebx,14
|
|
|
|
add edx,47
|
|
|
|
cmp [edx],byte 'x'
|
2012-04-02 01:55:52 +02:00
|
|
|
jne .newline
|
2012-03-15 21:05:00 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
draw_btns:
|
2012-03-17 19:39:13 +01:00
|
|
|
mov eax,0 ; DRAW BUTTONS ON WINDOW AREA
|
2012-03-15 21:05:00 +01:00
|
|
|
mov ebx,20 shl 16+25
|
|
|
|
mov ecx,35 shl 16+19
|
|
|
|
mov edi,icon_table
|
|
|
|
mov edx,40
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
newbline:
|
|
|
|
cmp [edi],byte 'x'
|
|
|
|
jne no_button
|
|
|
|
|
|
|
|
mov esi,0x5577cc
|
|
|
|
cmp [edi+90],byte 'x'
|
|
|
|
jne nores
|
|
|
|
|
|
|
|
mov esi,0xcc5555
|
|
|
|
cmp edx,[cur_btn]
|
|
|
|
jne nores
|
|
|
|
|
|
|
|
mov esi,0xe7e05a
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
nores:
|
|
|
|
push eax
|
|
|
|
mcall 8
|
|
|
|
pop eax
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
no_button:
|
|
|
|
add ebx,26 shl 16
|
|
|
|
|
|
|
|
inc edi
|
|
|
|
inc edx
|
|
|
|
inc al
|
|
|
|
cmp al,9
|
|
|
|
jbe newbline
|
|
|
|
|
|
|
|
mov al,0
|
|
|
|
add edx,6
|
|
|
|
ror ebx,16
|
|
|
|
mov bx,20
|
|
|
|
ror ebx,16
|
|
|
|
add ecx,20 shl 16
|
|
|
|
inc ah
|
2012-04-02 01:55:52 +02:00
|
|
|
cmp ah,8
|
2012-03-15 21:05:00 +01:00
|
|
|
jbe newbline
|
|
|
|
|
|
|
|
call print_strings
|
|
|
|
call draw_icon
|
|
|
|
mcall 12,2
|
|
|
|
ret
|
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
align 4
|
|
|
|
draw_icon:
|
|
|
|
mcall 13,<(33-20),(34*8+2)>,<(260-24),(37+15-2)>,0xffffff
|
|
|
|
mov esi,[current_icon]
|
|
|
|
add esi,12
|
2012-04-02 01:55:52 +02:00
|
|
|
call ASCII_to_icon_number
|
2012-03-15 21:05:00 +01:00
|
|
|
push eax
|
|
|
|
cmp eax,[cur_band]
|
|
|
|
jb .nou
|
|
|
|
sub eax,[cur_band]
|
|
|
|
cmp eax,7
|
|
|
|
ja .nou
|
|
|
|
imul eax,34 shl 16
|
|
|
|
lea ebx,[eax+(33-19) shl 16]
|
|
|
|
mov bx,34
|
|
|
|
mcall 13,,<(236+35),3>,0xff0000
|
|
|
|
mov eax,[esp]
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
.nou:
|
|
|
|
mov eax,[cur_band]
|
|
|
|
push eax
|
|
|
|
imul eax,ICON_SIZE
|
2012-03-18 22:54:01 +01:00
|
|
|
mov ebx,[strip_file]
|
2012-04-02 01:55:52 +02:00
|
|
|
add ebx,eax
|
2012-03-15 21:05:00 +01:00
|
|
|
mov ecx,8
|
|
|
|
mov edx,(33-18) shl 16+238
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
.nxt:
|
|
|
|
push ecx
|
2012-04-02 01:55:52 +02:00
|
|
|
pusha
|
|
|
|
mov ebp,0
|
2012-05-28 01:11:44 +02:00
|
|
|
|
|
|
|
mov eax,[strip_file_size]
|
|
|
|
add eax,[strip_file]
|
|
|
|
cmp eax,ebx
|
|
|
|
ja @f
|
|
|
|
; draw a rectangle if icon does not exist
|
|
|
|
mov ebx,edx ; X
|
|
|
|
mov ecx,edx ; Y
|
|
|
|
shl ecx,16
|
|
|
|
mov bx,32
|
|
|
|
mov cx,bx
|
|
|
|
xor edx,edx
|
|
|
|
mcall 13
|
|
|
|
jmp .draw_pict_end
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
@@:
|
2012-04-02 01:55:52 +02:00
|
|
|
mcall 65,,<32,32>,,32
|
2012-05-28 01:11:44 +02:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
.draw_pict_end:
|
2012-04-02 01:55:52 +02:00
|
|
|
popa
|
2012-03-15 21:05:00 +01:00
|
|
|
pop ecx
|
|
|
|
add ebx,ICON_SIZE
|
|
|
|
add edx,34 shl 16
|
2012-05-28 01:11:44 +02:00
|
|
|
|
|
|
|
dec ecx
|
|
|
|
jnz .nxt
|
2012-03-15 21:05:00 +01:00
|
|
|
|
|
|
|
mcall 4,<45,280-2>,0,rep_text,rep_text_len-rep_text
|
|
|
|
lea edx,[ebx+(8*5)shl 16]
|
|
|
|
pop ecx
|
|
|
|
mcall 47,0x30000,,,0xff
|
|
|
|
|
|
|
|
add ecx,7
|
|
|
|
add edx,(3*8+4)shl 16
|
|
|
|
mcall
|
|
|
|
|
|
|
|
add edx,(5*8+4)shl 16
|
|
|
|
mcall ,,[icon_count]
|
|
|
|
|
|
|
|
pop ecx
|
|
|
|
add edx,(10*8+4)shl 16
|
|
|
|
mcall ,,,,0xff0000
|
|
|
|
ret
|
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
align 4
|
|
|
|
close:
|
|
|
|
or eax,-1
|
|
|
|
mcall
|
|
|
|
;------------------------------------------------------------------------------
|
2012-04-02 01:55:52 +02:00
|
|
|
; ICON PROCESSING MODE - START2 entering label
|
2012-03-17 19:39:13 +01:00
|
|
|
;------------------------------------------------------------------------------
|
2012-03-15 21:05:00 +01:00
|
|
|
align 4
|
2012-04-02 01:55:52 +02:00
|
|
|
START2:
|
|
|
|
mcall 40,10000b ; only Event 5 - draw background
|
|
|
|
|
2012-04-02 18:30:55 +02:00
|
|
|
mcall 48,5
|
|
|
|
mov [warea.by_x],eax
|
|
|
|
mov [warea.by_y],ebx
|
|
|
|
|
2012-04-02 01:55:52 +02:00
|
|
|
mcall 51,1,START_mouse_thread,stack_mouse_thread
|
2012-04-02 18:30:55 +02:00
|
|
|
|
|
|
|
xor eax,eax
|
|
|
|
mov [x_left],eax
|
|
|
|
mov [y_top],eax
|
|
|
|
|
|
|
|
mcall 14
|
|
|
|
mov ebx,eax
|
|
|
|
shr eax,16
|
|
|
|
and ebx,0xffff
|
|
|
|
mov [x_right],eax
|
|
|
|
mov [y_bottom],ebx
|
|
|
|
jmp still2.1
|
2012-03-15 21:05:00 +01:00
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
align 4
|
2006-03-04 12:44:33 +01:00
|
|
|
still2:
|
2012-03-15 21:05:00 +01:00
|
|
|
mcall 10
|
2006-03-04 12:44:33 +01:00
|
|
|
|
2012-04-02 01:55:52 +02:00
|
|
|
mcall 15,8
|
|
|
|
|
|
|
|
mov ecx,eax
|
|
|
|
shr ecx,16
|
|
|
|
mov [x_left],ecx
|
|
|
|
and eax,0xffff
|
|
|
|
mov [x_right],eax
|
|
|
|
|
|
|
|
mov ecx,ebx
|
|
|
|
shr ecx,16
|
|
|
|
mov [y_top],ecx
|
|
|
|
and ebx,0xffff
|
|
|
|
mov [y_bottom],ebx
|
|
|
|
|
2012-04-02 18:30:55 +02:00
|
|
|
mcall 48,5
|
|
|
|
mov [warea.by_x],eax
|
|
|
|
mov [warea.by_y],ebx
|
|
|
|
.1:
|
2012-04-02 01:55:52 +02:00
|
|
|
mov ecx,[icons]
|
|
|
|
mov ebx,icon_data
|
2012-03-15 21:05:00 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
2012-04-02 01:55:52 +02:00
|
|
|
.start_new:
|
|
|
|
push ebx ecx
|
|
|
|
mov [adress_of_icon_data],ebx
|
|
|
|
mov eax,[ebx]
|
|
|
|
call calc_icon_pos
|
|
|
|
mov [current_X],ebx
|
|
|
|
mov [current_Y],eax
|
|
|
|
|
|
|
|
call draw_picture
|
|
|
|
pop ecx ebx
|
|
|
|
add ebx,REC_SIZE
|
|
|
|
dec ecx
|
|
|
|
jnz .start_new
|
2012-03-15 21:05:00 +01:00
|
|
|
jmp still2
|
2012-04-02 01:55:52 +02:00
|
|
|
;------------------------------------------------------------------------------
|
2012-03-15 21:05:00 +01:00
|
|
|
align 4
|
2012-04-02 01:55:52 +02:00
|
|
|
draw_picture:
|
|
|
|
mov eax,[current_X]
|
|
|
|
cmp eax,[x_right]
|
|
|
|
ja .exit
|
|
|
|
|
|
|
|
add eax,52
|
|
|
|
cmp eax,[x_left]
|
|
|
|
jb .exit
|
|
|
|
|
|
|
|
mov eax,[current_Y]
|
|
|
|
cmp eax,[y_bottom]
|
|
|
|
ja .exit
|
|
|
|
|
|
|
|
add eax,52
|
|
|
|
cmp eax,[y_top]
|
|
|
|
jb .exit
|
2012-03-15 21:05:00 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
2012-03-18 22:54:01 +01:00
|
|
|
@@:
|
2012-04-03 00:46:20 +02:00
|
|
|
mov edi,[adress_of_icon_data]
|
2012-03-15 21:05:00 +01:00
|
|
|
lea esi,[edi+12]
|
2012-04-02 01:55:52 +02:00
|
|
|
call ASCII_to_icon_number
|
|
|
|
; protect for icon area RAW size limit
|
2012-03-15 21:05:00 +01:00
|
|
|
cmp eax,[icon_count]
|
2012-04-02 01:55:52 +02:00
|
|
|
jbe @f
|
2012-03-15 21:05:00 +01:00
|
|
|
;--------------------------------------
|
2012-03-18 22:54:01 +01:00
|
|
|
align 4
|
2012-04-02 01:55:52 +02:00
|
|
|
.exit:
|
|
|
|
ret
|
2012-03-18 22:54:01 +01:00
|
|
|
;--------------------------------------
|
2012-03-15 21:05:00 +01:00
|
|
|
align 4
|
2012-04-02 01:55:52 +02:00
|
|
|
@@:
|
|
|
|
push eax
|
|
|
|
mcall 68,12,52*52*4+8
|
|
|
|
mov [draw_area],eax
|
|
|
|
mov ebx,52
|
|
|
|
mov [eax],ebx
|
|
|
|
mov [eax+4],ebx
|
|
|
|
pop eax
|
2012-03-15 21:05:00 +01:00
|
|
|
|
2012-04-02 01:55:52 +02:00
|
|
|
shl eax,12 ; multiply x4096
|
|
|
|
add eax,[strip_file]
|
|
|
|
mov esi,eax
|
2012-03-15 21:05:00 +01:00
|
|
|
|
2012-04-02 01:55:52 +02:00
|
|
|
mov edi,[draw_area]
|
|
|
|
add edi,(52-32)/2*4+8
|
|
|
|
mov ebx,32
|
|
|
|
cld
|
2012-03-15 21:05:00 +01:00
|
|
|
;--------------------------------------
|
2012-04-02 01:55:52 +02:00
|
|
|
align 4
|
|
|
|
.y:
|
|
|
|
mov ecx,32
|
|
|
|
rep movsd
|
2012-03-17 19:39:13 +01:00
|
|
|
|
2012-04-02 01:55:52 +02:00
|
|
|
add edi,(52-32)*4
|
|
|
|
dec ebx
|
|
|
|
jnz .y
|
2012-03-18 22:54:01 +01:00
|
|
|
|
2012-04-02 01:55:52 +02:00
|
|
|
call draw_text
|
2012-03-17 19:39:13 +01:00
|
|
|
|
2012-04-03 00:46:20 +02:00
|
|
|
mov edx,[current_X]
|
2012-04-02 01:55:52 +02:00
|
|
|
shl edx,16
|
2012-04-03 00:46:20 +02:00
|
|
|
add edx,[current_Y]
|
2012-04-02 01:55:52 +02:00
|
|
|
mov ebx,[draw_area]
|
|
|
|
add ebx,8
|
|
|
|
mcall 25,,<52,52>
|
|
|
|
mcall 68,13,[draw_area]
|
2012-03-15 21:05:00 +01:00
|
|
|
ret
|
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
align 4
|
|
|
|
draw_text:
|
2012-04-03 00:46:20 +02:00
|
|
|
mov esi,[adress_of_icon_data]
|
2012-03-15 21:05:00 +01:00
|
|
|
add esi,3
|
|
|
|
push edi
|
|
|
|
mov edi,title
|
|
|
|
mov ecx,8/4
|
|
|
|
cld
|
|
|
|
rep movsd
|
|
|
|
pop edi
|
|
|
|
mov eax,title
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
news2:
|
|
|
|
cmp [eax],byte 33
|
|
|
|
jb founde
|
|
|
|
inc eax
|
|
|
|
cmp eax,title+8 ;11
|
|
|
|
jb news2
|
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
|
|
|
founde:
|
|
|
|
sub eax,title
|
|
|
|
mov [tl],eax
|
|
|
|
|
|
|
|
mov eax,[tl]
|
2012-03-17 19:39:13 +01:00
|
|
|
lea eax,[eax+eax*2] ; eax *= char_width/2
|
2012-03-15 21:05:00 +01:00
|
|
|
shl eax,16
|
|
|
|
|
|
|
|
mov ebx,27 shl 16+40
|
|
|
|
sub ebx,eax
|
2011-09-27 09:12:16 +02:00
|
|
|
|
2012-03-17 19:39:13 +01:00
|
|
|
xor ecx,ecx ; black shade of text
|
2012-04-02 01:55:52 +02:00
|
|
|
or ecx,0x08000000 ; redirect the output to the user area
|
2012-03-17 19:39:13 +01:00
|
|
|
add ebx,1 shl 16 ;*65536+1
|
2012-04-02 01:55:52 +02:00
|
|
|
|
|
|
|
mov edi,[draw_area]
|
2012-03-15 21:05:00 +01:00
|
|
|
mcall 4,,,title,[tl]
|
2006-03-04 12:44:33 +01:00
|
|
|
|
2012-03-15 21:05:00 +01:00
|
|
|
inc ebx
|
|
|
|
mcall
|
2006-03-04 12:44:33 +01:00
|
|
|
|
2012-03-15 21:05:00 +01:00
|
|
|
add ebx,1 shl 16
|
|
|
|
mcall
|
2006-03-04 12:44:33 +01:00
|
|
|
|
2012-03-15 21:05:00 +01:00
|
|
|
inc ebx
|
|
|
|
mcall
|
2006-03-04 12:44:33 +01:00
|
|
|
|
2012-03-15 21:05:00 +01:00
|
|
|
sub ebx,1 shl 16
|
|
|
|
mcall
|
2006-03-04 12:44:33 +01:00
|
|
|
|
2012-03-15 21:05:00 +01:00
|
|
|
dec ebx
|
|
|
|
sub ebx,1 shl 16
|
|
|
|
mcall
|
2006-03-04 12:44:33 +01:00
|
|
|
|
2012-03-15 21:05:00 +01:00
|
|
|
sub ebx,1 shl 16
|
|
|
|
dec ebx
|
|
|
|
mcall
|
2006-03-04 12:44:33 +01:00
|
|
|
|
2012-03-15 21:05:00 +01:00
|
|
|
dec ebx
|
|
|
|
add ebx,1 shl 16
|
|
|
|
mcall
|
2006-03-04 12:44:33 +01:00
|
|
|
|
2012-03-15 21:05:00 +01:00
|
|
|
inc ebx
|
2012-04-02 01:55:52 +02:00
|
|
|
mov ecx,0xffffff ; white text
|
|
|
|
or ecx,0x08000000 ; redirect the output to the user area
|
|
|
|
mcall
|
2012-03-15 21:05:00 +01:00
|
|
|
ret
|
|
|
|
;------------------------------------------------------------------------------
|
2012-03-17 19:39:13 +01:00
|
|
|
align 4
|
2012-04-02 01:55:52 +02:00
|
|
|
ASCII_to_icon_number:
|
|
|
|
;
|
|
|
|
; in:
|
|
|
|
; esi - adress of icon ASCII text number (line start + 12)
|
|
|
|
;
|
|
|
|
; out:
|
|
|
|
; eax - number of icon
|
|
|
|
;
|
|
|
|
push esi
|
|
|
|
xor eax,eax
|
|
|
|
xor ebx,ebx
|
2012-03-15 21:05:00 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
2012-04-02 01:55:52 +02:00
|
|
|
.next:
|
|
|
|
lodsb
|
|
|
|
cmp al,'0'
|
|
|
|
jb .done
|
|
|
|
cmp al,'9'
|
|
|
|
ja .done
|
|
|
|
sub eax,'0'
|
|
|
|
; multiply x10
|
|
|
|
shl ebx,1 ; multiply x2
|
|
|
|
lea ebx,[ebx+ebx*4] ; multiply x5
|
|
|
|
add ebx,eax
|
|
|
|
jmp .next
|
2012-03-15 21:05:00 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
2012-04-02 01:55:52 +02:00
|
|
|
.done:
|
|
|
|
pop esi
|
|
|
|
mov eax,ebx
|
|
|
|
ret
|
|
|
|
;------------------------------------------------------------------------------
|
2012-03-15 21:05:00 +01:00
|
|
|
align 4
|
2012-04-02 01:55:52 +02:00
|
|
|
itoa:
|
|
|
|
add esi,2
|
|
|
|
mov ebx,10
|
|
|
|
mov ecx,3
|
2012-03-15 21:05:00 +01:00
|
|
|
;--------------------------------------
|
|
|
|
align 4
|
2012-04-02 01:55:52 +02:00
|
|
|
.l0:
|
|
|
|
xor edx,edx
|
|
|
|
div ebx
|
|
|
|
add dl,'0'
|
|
|
|
mov [esi],dl
|
|
|
|
dec esi
|
|
|
|
loop .l0
|
2012-03-15 21:05:00 +01:00
|
|
|
ret
|
|
|
|
;------------------------------------------------------------------------------
|
2012-04-02 01:55:52 +02:00
|
|
|
align 4
|
|
|
|
calc_icon_pos:
|
|
|
|
; in:
|
|
|
|
; eax - dword [icon_position]
|
|
|
|
; out:
|
|
|
|
; eax - current Y
|
|
|
|
; ebx - current X
|
|
|
|
push eax
|
|
|
|
movzx eax,al
|
|
|
|
sub eax,'A' ;eax - number of letter
|
|
|
|
cmp eax,4
|
|
|
|
jg no_left
|
|
|
|
|
|
|
|
shl eax,6 ;imul eax,64
|
|
|
|
add eax,16
|
|
|
|
movzx ebx,[warea.left]
|
|
|
|
add eax,ebx
|
|
|
|
jmp x_done
|
|
|
|
;--------------------------------------
|
2012-03-17 19:39:13 +01:00
|
|
|
align 4
|
2012-04-02 01:55:52 +02:00
|
|
|
no_left:
|
|
|
|
sub eax,9
|
|
|
|
sal eax,6 ;imul eax,64
|
|
|
|
sub eax,16+52-1
|
|
|
|
movzx ebx,[warea.right]
|
|
|
|
add eax,ebx
|
|
|
|
;--------------------------------------
|
2012-03-17 19:39:13 +01:00
|
|
|
align 4
|
2012-04-02 01:55:52 +02:00
|
|
|
x_done:
|
|
|
|
mov ebx,eax
|
|
|
|
pop eax
|
|
|
|
push ebx
|
|
|
|
movzx eax,ah
|
|
|
|
sub eax,'A' ; eax - number of letter
|
|
|
|
cmp eax,4
|
|
|
|
jg no_up
|
|
|
|
|
|
|
|
shl eax,6 ;imul eax,80
|
|
|
|
add eax,16
|
|
|
|
movzx ebx,[warea.top]
|
|
|
|
add eax,ebx
|
|
|
|
jmp y_done
|
|
|
|
;--------------------------------------
|
2012-03-17 19:39:13 +01:00
|
|
|
align 4
|
2012-04-02 01:55:52 +02:00
|
|
|
no_up:
|
|
|
|
sub eax,9
|
|
|
|
shl eax,6 ;imul eax,80
|
|
|
|
sub eax,16-1
|
|
|
|
movzx ebx,[warea.bottom]
|
|
|
|
add eax,ebx
|
|
|
|
;--------------------------------------
|
2012-03-17 19:39:13 +01:00
|
|
|
align 4
|
2012-04-02 01:55:52 +02:00
|
|
|
y_done:
|
|
|
|
pop ebx
|
|
|
|
ret
|
2012-03-17 19:39:13 +01:00
|
|
|
;------------------------------------------------------------------------------
|
2012-04-02 01:55:52 +02:00
|
|
|
include 'mouse.inc'
|
2012-03-17 19:39:13 +01:00
|
|
|
;------------------------------------------------------------------------------
|
2012-04-02 01:55:52 +02:00
|
|
|
include 'data.inc'
|
2012-03-17 19:39:13 +01:00
|
|
|
;------------------------------------------------------------------------------
|
2012-04-02 01:55:52 +02:00
|
|
|
IM_END:
|
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
include 'dat_area.inc'
|
2012-03-17 19:39:13 +01:00
|
|
|
;------------------------------------------------------------------------------
|
2006-03-04 12:44:33 +01:00
|
|
|
I_END:
|
2012-04-02 01:55:52 +02:00
|
|
|
;------------------------------------------------------------------------------
|