Subversion Repositories Kolibri OS

Compare Revisions

No changes between revisions

Regard whitespace Rev 3012 → Rev 3013

/programs/debug.inc
0,0 → 1,131
macro debug_print str
{
local ..string, ..label
 
jmp ..label
..string db str,0
..label:
 
pushf
pushad
mov edx,..string
call debug_outstr
popad
popf
}
 
dps fix debug_print
 
macro debug_print_dec arg
{
pushf
pushad
if ~arg eq eax
mov eax,arg
end if
call debug_outdec
popad
popf
}
 
dpd fix debug_print_dec
 
;---------------------------------
debug_outdec: ;(eax - num, edi-str)
push 10 ;2
pop ecx ;1
push -'0' ;2
.l0:
xor edx,edx ;2
div ecx ;2
push edx ;1
test eax,eax ;2
jnz .l0 ;2
.l1:
pop eax ;1
add al,'0' ;2
call debug_outchar ; stosb
jnz .l1 ;2
ret ;1
;---------------------------------
 
debug_outchar: ; al - char
pushf
pushad
mov cl,al
mov eax,63
mov ebx,1
int 0x40
popad
popf
ret
 
debug_outstr:
mov eax,63
mov ebx,1
@@:
mov cl,[edx]
test cl,cl
jz @f
int 40h
inc edx
jmp @b
@@:
ret
 
 
macro newline
{
dps <13,10>
}
 
macro print message
{
dps message
newline
}
 
macro pregs
{
dps "EAX: "
dpd eax
dps " EBX: "
dpd ebx
newline
dps "ECX: "
dpd ecx
dps " EDX: "
dpd edx
newline
}
 
macro debug_print_hex arg
{
pushf
pushad
if ~arg eq eax
mov eax, arg
end if
call debug_outhex
popad
popf
}
dph fix debug_print_hex
 
debug_outhex:
; eax - number
mov edx, 8
.new_char:
rol eax, 4
movzx ecx, al
and cl, 0x0f
mov cl, [__hexdigits + ecx]
pushad
mcall 63, 1
popad
dec edx
jnz .new_char
ret
 
__hexdigits:
db '0123456789ABCDEF'
/programs/develop/fast_call_test/debug.inc
File deleted
\ No newline at end of file
/programs/develop/fast_call_test/MACROS.INC
File deleted
/programs/develop/fast_call_test/macros.inc
0,0 → 1,292
; new application structure
macro meos_app_start
{
use32
org 0x0
 
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
 
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
 
dd 0x0
}
MEOS_APP_START fix meos_app_start
 
macro code
{
__start:
}
CODE fix code
 
macro data
{
__data:
}
DATA fix data
 
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
 
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
 
 
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
 
 
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
 
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
 
 
 
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
 
macro __mov reg,a { ; mike.dld
if ~a eq
mov reg,a
end if
}
 
__CPU_type equ p6
SYSENTER_VAR equ 0
 
macro mcall a,b,c,d,e,f { ; mike.dld, updated by Ghost for Fast System Calls
local ..ret_point
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
 
if __CPU_type eq p5
int 0x40
else
if __CPU_type eq p6
push ebp
mov ebp, esp
push ..ret_point ; it may be 2 or 5 byte
sysenter
..ret_point:
pop edx
pop ecx
 
else
if __CPU_type eq k6
push ecx
syscall
pop ecx
else
display 'ERROR : unknown CPU type'
int 0x40
end if
end if
end if
}
 
 
; language for programs
lang fix ru ; ru en fr ge fi
 
 
 
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
 
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
 
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
 
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
 
 
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
 
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
 
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
 
 
; constants
 
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
 
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b
/programs/develop/fast_call_test/test.ASM
15,7 → 15,7
dd 0x0, 0x0
 
include 'macros.inc'
include 'debug.inc'
include '../../debug.inc'
 
START: print 'Please wait'
; ÷åðåç áûñòðûé âûçîâ (SYSENTER)
/programs/games/megamaze/trunk/tam.INC
File deleted
/programs/games/megamaze/trunk/debug.inc
File deleted
\ No newline at end of file
/programs/games/megamaze/trunk/MACROS.INC
File deleted
/programs/games/megamaze/trunk/GIF_LITE.INC
File deleted
/programs/games/megamaze/trunk/gif_lite.inc
0,0 → 1,318
; GIF LITE v2.0 by Willow
; Written in pure assembler by Ivushkin Andrey aka Willow
;
; This include file will contain functions to handle GIF image format
;
; Created: August 15, 2004
; Last changed: September 9, 2004
 
; Change COLOR_ORDER in your program
; if colors are displayed improperly
 
if ~ (COLOR_ORDER in <MENUETOS,OTHER>)
; This message may not appear under MenuetOS, so watch...
display 'Please define COLOR_ORDER: MENUETOS or OTHER',13,10
end if
 
struc GIF_info
{
; .NextImg rd 1 ; used internally
.Left rw 1
.Top rw 1
.Width rw 1
.Height rw 1
}
 
_null fix 0x1000
 
; ****************************************
; FUNCTION GetGIFinfo - retrieve Nth image info
; ****************************************
; in:
; esi - pointer to image list header
; ecx - image_index (0...img_count-1)
; edi - pointer to GIF_info structure to be filled
 
; out:
; eax - pointer to RAW data, or 0, if error
 
GetGIFinfo:
push esi ecx edi
xor eax,eax
jecxz .eloop
.lp:
mov esi,[esi]
test esi,esi
jz .error
loop .lp
.eloop:
add esi,4
movsd
movsd
mov eax,esi
.error:
pop edi ecx esi
ret
 
; ****************************************
; FUNCTION ReadGIF - unpacks GIF image
; ****************************************
; in:
; esi - pointer to GIF file in memory
; edi - pointer to output image list
; eax - pointer to work area (MIN 16 KB!)
 
; out:
; eax - 0, all OK;
; eax - 1, invalid signature;
; eax >=8, unsupported image attributes
;
; ecx - number of images
 
ReadGIF:
push esi edi
mov [.table_ptr],eax
mov [.cur_info],edi
xor eax,eax
mov [.globalColor],eax
mov [.img_count],eax
inc eax
cmp dword[esi],'GIF8'
jne .er ; signature
mov ecx,[esi+0xa]
inc eax
add esi,0xd
mov edi,esi
bt ecx,7
jnc .nextblock
mov [.globalColor],esi
call .Gif_skipmap
.nextblock:
cmp byte[edi],0x21
jne .noextblock
inc edi
cmp byte[edi],0xf9 ; Graphic Control Ext
jne .no_gc
add edi,7
jmp .nextblock
.no_gc:
cmp byte[edi],0xfe ; Comment Ext
jne .no_comm
inc edi
.block_skip:
movzx eax,byte[edi]
lea edi,[edi+eax+1]
cmp byte[edi],0
jnz .block_skip
inc edi
jmp .nextblock
.no_comm:
cmp byte[edi],0xff ; Application Ext
jne .nextblock
add edi,13
jmp .block_skip
.noextblock:
cmp byte[edi],0x2c ; image beginning
jne .er
inc [.img_count]
inc edi
mov esi,[.cur_info]
add esi,4
xchg esi,edi
movsd
movsd
push edi
movzx ecx,word[esi]
inc esi
bt ecx,7
jc .uselocal
push [.globalColor]
mov edi,esi
jmp .setPal
.uselocal:
call .Gif_skipmap
push esi
.setPal:
movzx ecx,byte[edi]
inc ecx
mov [.codesize],ecx
dec ecx
pop [.Palette]
lea esi,[edi+1]
mov edi,[.table_ptr]
xor eax,eax
cld
lodsb ; eax - block_count
add eax,esi
mov [.block_ofs],eax
mov [.bit_count],8
mov eax,1
shl eax,cl
mov [.CC],eax
inc eax
mov [.EOI],eax
lea ecx,[eax-1]
mov eax, _null shl 16
.filltable:
stosd
inc eax
loop .filltable
pop edi
mov [.img_start],edi
.reinit:
mov edx,[.EOI]
inc edx
push [.codesize]
pop [.compsize]
call .Gif_get_sym
cmp eax,[.CC]
je .reinit
call .Gif_output
.cycle:
movzx ebx,ax
call .Gif_get_sym
cmp eax,edx
jae .notintable
cmp eax,[.CC]
je .reinit
cmp eax,[.EOI]
je .end
call .Gif_output
.add:
push eax
mov eax,[.table_ptr]
mov [eax+edx*4],ebx
pop eax
cmp edx,0xFFF
jae .cycle
inc edx
bsr ebx,edx
cmp ebx,[.compsize]
jne .noinc
inc [.compsize]
.noinc:
jmp .cycle
.notintable:
push eax
mov eax,ebx
call .Gif_output
push ebx
movzx eax,bx
call .Gif_output
pop ebx eax
jmp .add
.er:
pop edi
jmp .ex
.end:
mov eax,[.cur_info]
mov [eax],edi
mov [.cur_info],edi
add esi,2
xchg esi,edi
.nxt:
cmp byte[edi],0
jnz .continue
inc edi
jmp .nxt
.continue:
cmp byte[edi],0x3b
jne .nextblock
xor eax,eax
stosd
mov ecx,[.img_count]
.ex:
pop edi esi
ret
 
.Gif_skipmap:
; in: ecx - image descriptor, esi - pointer to colormap
; out: edi - pointer to area after colormap
 
and ecx,111b
inc ecx ; color map size
mov ebx,1
shl ebx,cl
lea ebx,[ebx*2+ebx]
lea edi,[esi+ebx]
ret
 
.Gif_get_sym:
mov ecx,[.compsize]
push ecx
xor eax,eax
.shift:
ror byte[esi],1
rcr eax,1
dec [.bit_count]
jnz .loop1
inc esi
cmp esi,[.block_ofs]
jb .noblock
push eax
xor eax,eax
lodsb
test eax,eax
jnz .nextbl
mov eax,[.EOI]
sub esi,2
add esp,8
jmp .exx
.nextbl:
add eax,esi
mov [.block_ofs],eax
pop eax
.noblock:
mov [.bit_count],8
.loop1:
loop .shift
pop ecx
rol eax,cl
.exx:
xor ecx,ecx
ret
 
.Gif_output:
push esi eax edx
mov edx,[.table_ptr]
.next:
push word[edx+eax*4]
mov ax,word[edx+eax*4+2]
inc ecx
cmp ax,_null
jnz .next
shl ebx,16
mov bx,[esp]
.loop2:
pop ax
 
lea esi,[eax+eax*2]
add esi,[.Palette]
 
if COLOR_ORDER eq MENUETOS
mov esi,[esi]
bswap esi
shr esi,8
mov [edi],esi
add edi,3
else
movsw
movsb
end if
 
loop .loop2
pop edx eax esi
ret
 
.globalColor rd 1
.img_count rd 1
.cur_info rd 1 ; image table pointer
.img_start rd 1
.codesize rd 1
.compsize rd 1
.bit_count rd 1
.CC rd 1
.EOI rd 1
.Palette rd 1
.block_ofs rd 1
.table_ptr rd 1
/programs/games/megamaze/trunk/macros.inc
0,0 → 1,264
; new application structure
macro meos_app_start
{
use32
org 0x0
 
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
 
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
 
dd 0x0
}
MEOS_APP_START fix meos_app_start
 
macro code
{
__start:
}
CODE fix code
 
macro data
{
__data:
}
DATA fix data
 
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
 
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
 
 
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
 
 
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
 
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
label name
forward
if lang eq lng
db data
end if
common
.size = $-name
}
 
 
 
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
 
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
 
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
 
 
 
; language for programs
;lang fix ru ; ru en fr ge fi
 
 
 
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
 
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
 
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
 
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
 
 
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
 
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
 
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
 
 
; constants
 
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
 
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b
/programs/games/megamaze/trunk/megamaze.asm
25,9 → 25,9
dd stack_end ; esp
dd 0x0 , 0x0 ; I_Param , I_Icon
lang fix ru
include "MACROS.INC"
include "macros.inc"
purge mov
;include "DEBUG.INC"
;include "../../../debug.inc"
COLOR_ORDER equ MENUETOS
 
include 'gif_lite.inc'
/programs/games/megamaze/trunk/tam.inc
0,0 → 1,164
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
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
/programs/media/gifview/trunk/debug.inc
File deleted
\ No newline at end of file
Property changes:
Deleted: svn:eol-style
-native
\ No newline at end of property
/programs/media/midamp/trunk/debug.inc
File deleted
\ No newline at end of file
/programs/media/midamp/trunk/midamp.asm
73,7 → 73,7
 
lang fix en
;purge mov
include 'debug.inc'
include '../../../debug.inc'
;include 'dlg.inc'
include 'playlist.inc'
include 'gif_lite.inc'
/programs/network/downloader/trunk/debug.inc
File deleted
\ No newline at end of file
/programs/network/downloader/trunk/downloader.asm
49,7 → 49,7
include '../../../develop/libraries/box_lib/load_lib.mac'
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
include 'dll.inc'
include 'debug.inc'
include '../../../debug.inc'
 
URLMAXLEN equ 256 ; maximum length of url string
 
/programs/network/icq/trunk/EDITBOX.INC
File deleted
\ No newline at end of file
/programs/network/icq/trunk/debug.inc
File deleted
\ No newline at end of file
/programs/network/icq/trunk/CMDIPC.INC
File deleted
/programs/network/icq/trunk/cmdipc.inc
0,0 → 1,221
include "MACROS.INC"
 
initipc:
mov eax,9
mov ebx,prc
mov ecx,-1
int 0x40
 
mov ecx,eax
loop1:
push ecx
 
mov eax,9
mov ebx,prc
int 0x40
 
cmp word [prc+10],'CM'
jne no_cmd
cmp byte [prc+12],'D'
jne no_cmd
 
mov ebx,[prc+30]
mov dword [cmdpid],ebx
 
mov dword [cmdnumb],ecx
 
no_cmd:
pop ecx
loop loop1
 
cmp dword [cmdpid],0
jne no_exit
 
jmp exit
 
no_exit:
mov eax,60
mov ebx,2
mov ecx,dword [cmdpid]
mov edx,printf
mov esi,4
int 0x40
 
call initcmd
 
waitcmdinit:
mov eax,40
mov ebx,01000000b
int 0x40
 
mov eax,23
mov ebx,100
int 0x40
 
cmp eax,7
je cmd_ok
 
jmp exit
 
cmd_ok:
cmp byte [ipcb+16],'.'
jne exit
 
mov eax,18
mov ebx,3
mov ecx,dword [cmdnumb]
int 0x40
 
ret
 
pause1:
mov eax,5
mov ebx,1
int 0x40
ret
 
exit:
mov eax,-1
int 0x40
 
cls:
mov eax,60
mov ebx,2
mov ecx,dword [cmdpid]
mov edx,ipccls
mov esi,4
int 0x40
 
call pause1
 
ret
 
print:
mov ecx,84
loopprt:
mov edi,stripc
add edi,ecx
mov esi,fill_symbol
movsb
 
loop loopprt
 
cld
mov ecx,4
mov edi,stripc
mov esi,printf
rep movsb
 
cld
mov edx,79
sub edx,eax
mov ecx,79
sub ecx,edx
mov edi,stripc+4
mov esi,ebx
rep movsb
 
mov eax,60
mov ebx,2
mov ecx,dword [cmdpid]
mov edx,stripc
mov esi,84
int 0x40
 
call pause1
 
ret
 
eol:
mov eax,60
mov ebx,2
mov ecx,dword [cmdpid]
mov edx,ipceol
mov esi,4
int 0x40
 
call pause1
 
ret
 
initcmd:
mov eax,60
mov ebx,2
mov ecx,dword [cmdpid]
mov edx,ipckey
mov esi,4
int 0x40
 
mov eax,60
mov ebx,1
mov ecx,ipcb
mov edx,28
int 0x40
 
cld
mov ecx,28
mov edi,ipcb
mov esi,ipcc
rep movsb
 
ret
 
getkey:
call initcmd
 
waitagain:
mov eax,40
mov ebx,01000000b
int 0x40
 
mov eax,10
int 0x40
 
cmp eax,7
jne waitagain
 
mov edi,key
mov esi,ipcb+16
movsb
 
ret
 
endipc:
mov eax,60
mov ebx,2
mov ecx,dword [cmdpid]
mov edx,ipcend
mov esi,4
int 0x40
 
jmp exit
 
cmdpid dd 0
cmdnumb dd 0
 
printf db '~ppp'
ipceol db '~lll'
ipcend db '~eee'
ipccls db '~ccc'
ipckey db '~kkk'
 
key db 0
 
ipcb:
db 0
db 0,0,0
dd 8
times 20 db 0
 
ipcc:
db 0
db 0,0,0
dd 8
times 20 db 0
 
stripc: times 84 db 0
 
fill_symbol db 0
 
prc: times 52 db 0
 
/programs/network/icq/trunk/editbox.inc
0,0 → 1,275
; SEE YOU File FAQ.txt and HISTORY. Good Like!
;;;;;;;;;;;;;;;;;;
include 'editbox.mac' ;¬ ªà®á ª®â®àë© ¤®«¦¥­ ®¡«¥£ç¨âì ¦¨§­ì :) ᯥ樠«ì­® ¤«ï editbox
;;;;;;;;;;;;;;;;;;
macro use_edit_box procinfo,scr_h,scr_w
{
edit_box:
ed_width equ [edi] ;è¨à¨­  ª®¬¯®­¥­â 
ed_left equ [edi+4] ;¯®«®¦¥­¨¥ ¯® ®á¨ å
ed_top equ [edi+8] ;¯®«®¦¥­¨¥ ¯® ®á¨ ã
ed_color equ [edi+12] ;梥â ä®­  ª®¬¯®­¥­â 
shift_color equ [edi+16] ;=0x6a9480
ed_focus_border_color equ [edi+20] ;梥â à ¬ª¨ ª®¬¯®­¥­â 
ed_blur_border_color equ [edi+24] ;梥⠭¥  ªâ¨¢­®£® ª®¬¯®­¥­â 
ed_text_color equ [edi+28] ;梥â ⥪áâ 
ed_max equ [edi+32] ;ª®«-¢® ᨬ¢®«®¢ ª®â®àë¥ ¬®¦­® ¬ ªá¨¬ «ì­® ¢¢¥áâ¨
ed_text equ [edi+36] ;㪠§ â¥«ì ­  ¡ãä¥à
ed_flags equ [edi+40] ;ä« £¨
ed_size equ [edi+42] ;ª®«-¢® ᨬ¢®«®¢
ed_pos equ [edi+46] ;¯®§¨æ¨ï ªãàá®à 
ed_offset equ [edi+50] ;ᬥ饭¨¥
cl_curs_x equ [edi+54] ;¯à¥¤ë¤ã饥 ª®®à¤¨­ â  ªãàá®à  ¯® å
cl_curs_y equ [edi+58] ;¯à¥¤ë¤ã饥 ª®®à¤¨­ â  ªãàá®à  ¯® ã
ed_shift_pos equ [edi+62] ;¯®«®¦¥­¨¥ ªãàá®à 
ed_shift_pos_old equ [edi+66] ;áâ à®¥ ¯®«®¦¥­¨¥ ªãàá®à 
;==========================================================
;=== ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ =================================
;==========================================================
.draw:
pusha
;--- à¨á㥬 à ¬ªã ---
call .draw_border ; ”ã­ªæ¨ï áâ ¡¨«ì­ 
.draw_bg_cursor_text:
;--- ¨§¬¥­ï¥¬ ᬥ饭¨¥, ¥á«¨ ­ ¤® ---
call .check_offset ;¢ëç¨á«¥­¨¥ ¯®§¨æ¨¨ ªãàá®à  áâ ¡¨«ì­ 
;--- à¨á㥬 ¢­ãâ७­îî ®¡« áâì ---
call .draw_bg ;­ à¨á®¢ âì ¯àאַ㣮«ì­¨ª à ¡®ç¥© ®¡« áâ¨
;---- à¨á㥬 ¢ë¤¥«¥­¨¥, ¯® shift ¥á«¨ ¥áâì
call .draw_shift
.draw_cursor_text:
;--- à¨á㥬 ªãàá®à ---
;--- ¬®¦¥â ¥£® ­¥ ­ ¤® à¨á®¢ âì ----
test word ed_flags,ed_focus
je @f
call .draw_cursor
@@:
call .draw_text
;;;;;;;;;;;;;;;;;;;;;;;;;;
;Ž¡é¨© ¢ë室 ¨§ editbox ¤«ï ¢á¥å ä㭪権 ¨ ¯®áâ ®¡à ¡®â稪®¢
;;;;;;;;;;;;;;;;;;;;;;;;;;
.editbox_exit:
edit_ex
;==========================================================
;=== ®¡à ¡®âª  ª« ¢¨ âãàë =================================
;==========================================================
.key:
pusha
test word ed_flags,ed_focus ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
je .editbox_exit
;à®¢¥àª  ­ ¦ â shift ?
call .check_shift
;----------------------------------------------------------
;--- ¯à®¢¥à塞, çâ® ­ ¦ â® --------------------------------
;----------------------------------------------------------
use_key_process backspase,delete,left,right,home,end,insert
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;‡ £«ã誠 ­  ®¡à ¡®âªã ª« ¢¨è ¢¢¥àå ¨ ¢­¨§ â.¥. ¯à¨ ®¡­ à㦥­¨¨ íâ¨å ª®¤®¢ ¯à®¨á室¨â ¢ë室 ¨§ ®¡à ¡®â稪 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use_key_no_process up,down,esc
;--- ­ ¦ â  ¤àã£ ï ª« ¢¨è  ---
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;à®¢¥àª  ãáâ ­®¢«¥­ «¨ ä« £ ¯à¨ ª®â®à®¬ ­ã¦­® ¢ë¢®¤¨âì ⮫쪮 æ¨äàë ¢ ­ã¦­®¬ ¡®ªá¥ ¥á«¨ â ª®©­¥®¡å®¤¨¬®á⨠­¥â ­ã¦­® § ª®¬¥­â¨à®¢ âì ¬ ªà®á
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use_key_figures_only
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;¯à®¢¥àª  ­  shift ¡ë« «¨ ­ ¦ â
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
are_key_shift_press
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ¯à®¢¥à塞, ­ å®¤¨âáï «¨ ªãàá®à ¢ ª®­æ¥ + ¤ «ì­¥©è ï ®¡à ¡®âª 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
are_key_cur_end
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Ž¡à ¡®âª  ª« ¢¨è insert,delete.backspase,home,end,left,right
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use_work_key
;==========================================================
;=== ®¡à ¡®âª  ¬ëè¨ =======================================
;==========================================================
.mouse:
pusha
;debug
;----------------------------------------------------------
;--- ¯®«ãç ¥¬ á®áâ®ï­¨¥ ª­®¯®ª ¬ëè¨ -----------------------
;----------------------------------------------------------
mcall 37,2
;----------------------------------------------------------
;--- ¯à®¢¥à塞 á®áâ®ï­¨¥ ----------------------------------
;----------------------------------------------------------
test eax,1
jnz .mouse_left_button
and word ed_flags,ed_mouse_on_off
xor ebx,ebx
mov dword [mouse_flag],ebx
jmp .editbox_exit
.mouse_left_button:
;----------------------------------------------------------
;--- ¡«®ª¨à®¢ª  ®â 䮪ãá¨à®¢ª¨ ¢ ¤àã£¨å ¡®ªá å ¯à¨ ¯®¯ ¤ ­¨¨ ­  ­¨å ªãàá®à 
;----------------------------------------------------------
mov eax,dword [mouse_flag]
test eax,eax
jz @f
cmp eax,edi
je @f
jmp ._blur
;----------------------------------------------------------
;--- ¯®«ãç ¥¬ ª®®à¤¨­ âë ¬ëè¨ ®â­®á¨â¥«ì­® 0 â.¥ ¢á¥© ®¡« á⨠íªà ­ 
;----------------------------------------------------------
@@: mcall 37,0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;”ã­ªæ¨ï ®¡à ¡®âª¨ ¬ë誨 ¯®«ã祭¨¥ ª®®à¤¨­ â ¨ ¯à®¢¥àª  ¨å + ¢ë¤¥«¥­¨ï
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use_work_mause scr_h,scr_w
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Ž¡é¨¥ ä㭪樨 ®¡à ¡®âª¨
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use_general_func
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;”㭪樨 ¤«ï à ¡®âë á key
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use_key_func
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;”㭪樨 ¤«ï à ¡®âë á mouse
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use_mouse_func scr_w
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Bit mask from editbox
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ed_figure_only= 1000000000000000b ;®¤­¨ ᨬ¢®«ë
ed_always_focus= 100000000000000b
ed_focus= 10b ;䮪ãá ¯à¨«®¦¥­¨ï
ed_shift_on= 1000b ;¥á«¨ ­¥ ãáâ ­®¢«¥­ -§­ ç¨â ¢¯¥à¢ë¥ ­ ¦ â shift,¥á«¨ ¡ë« ãáâ ­®¢«¥­, §­ ç¨â ¬ë 㦥 çâ® - â® ¤¥« «¨ 㤥ন¢ ï shift
ed_shift_on_off=1111111111110111b
ed_shift= 100b ;¢ª«îç ¥âáï ¯à¨ ­ ¦ â¨¨ ­  shift â.¥. ¥á«¨ ­ ¦¨¬ î
ed_shift_off= 1111111111111011b
ed_shift_bac= 10000b ;¡¨â ¤«ï ®ç¨á⪨ ¢ë¤¥«¥­®£® shift â.¥. ¯à¨ ãáâ ­®¢ª¥ £®¢®à¨â çâ® ¥áâì ¢ë¤¥«¥­¨¥
ed_shift_bac_cl=1111111111101111b ;®ç¨á⪠ ¯à¨ 㤠«¥­¨¨ ¢ë¤¥«¥­¨ï
ed_shift_cl= 1111111111100011b
ed_shift_mcl= 1111111111111011b
ed_left_fl= 100000b
ed_right_fl= 1111111111011111b
ed_offset_fl= 1000000b
ed_offset_cl= 1111111110111111b
ed_insert= 10000000b
ed_insert_cl= 1111111101111111b
ed_mouse_on = 100000000b
ed_mous_adn_b= 100011000b
ed_mouse_on_off=1111111011111111b
ed_height=14 ; ¢ëá®â 
macro draw_edit_boxes start,_end,use_f9,procinfo
{
if use_f9 eq
else
mcall 9,procinfo,-1
end if
mov edi,start
mov ecx,((_end-start)/ed_struc_size)
@@:
call edit_box.draw
add edi,ed_struc_size
loop @b
}
 
macro mouse_edit_boxes start,_end
{
mov edi,start
mov ecx,((_end-start)/ed_struc_size)
@@:
call edit_box.mouse
add edi,ed_struc_size
loop @b
}
 
macro key_edit_boxes start,end
{
mov edi,start
mov ecx,((end-start)/ed_struc_size)
@@:
call edit_box.key
add edi,ed_struc_size
loop @b
}
ed_struc_size=70
struc edit_box width,left,top,color,shift_color,focus_border_color,\
blur_border_color,text_color,max,text,flags,size,pos
{
.width dd width
.left dd left
.top dd top
.color dd color
.shift_color dd shift_color
.focus_border_color dd focus_border_color
.blur_border_color dd blur_border_color
.text_color dd text_color
.max dd max
.text dd text
.flags dw flags+0
.size dd size+0
.pos dd pos+0
.offset dd 0
.cl_curs_x dd 0
.cl_curs_y dd 0
.shift dd 0
.shift_old dd 0
}
 
 
macro edit_boxes_set_sys_color start,end,color_table
{
mov edi,start
mov ecx,((end-start)/ed_struc_size)
mov esi,color_table
@@:
mov eax,[esi+36]
mov ebx,[esi+20]
mov ed_focus_border_color,eax
shr bh,1
shr bl,1
shr ah,1
shr al,1
add ah,bh
add al,bl
ror eax,16
ror ebx,16
shr bl,1
shr al,1
add al,bl
ror eax,16
mov ed_blur_border_color,eax
add edi,ed_struc_size
loop @b
}
 
macro draw_edit_box ed_ptr,use_f9,procinfo
{
if use_f9 eq
else
mcall 9,procinfo,-1
end if
mov edi,ed_ptr
call edit_box.draw
}
 
macro mouse_edit_box ed_ptr
{
mov edi,ed_ptr
call edit_box.mouse
}
 
macro key_edit_box ed_ptr
{
mov edi,ed_ptr
call edit_box.key
}
macro default_box ed_ptr
{
pusha
; xor eax,eax
; mov ed_shift_pos,eax
; mov ed_shift_pos_old,eax
and word ed_flags,ed_shift_cl
; mov ed_offset,eax
popa
}
/programs/network/icq/trunk/ki.asm
6,15 → 6,15
 
 
include "lang.inc"
include "MACROS.INC"
include "macros.inc"
;purge mov
;include "ASCL9/ascl.inc"
;include "debug.inc"
;include "../../../debug.inc"
include "editbox.inc"
 
MEOS_APP_START
 
;include "debug.inc"
;include "../../../debug.inc"
include "2000.inc"
include "comp.inc"
;include "fsio.inc"
/programs/network/icq/trunk/lang.inc
1,0 → 0,0
lang fix ru
lang fix en
/programs/other/debug.inc
File deleted
\ No newline at end of file
/programs/other/archer/trunk/@RCHER.ASM
79,7 → 79,7
;{
include "..\..\..\macros.inc"
; purge mov
include "..\..\debug.inc"
include "..\..\..\debug.inc"
include 'dump.inc'
;}
end if
158,7 → 158,7
Newline
xor eax,eax
; and [Flags],STAY_MODE
and [CRC32],eax
and [_CRC32_],eax
and [IDATsize],eax
mov [Adler32],1
call OpenFile
282,7 → 282,7
push esi ecx
call UCRC
Msg 11
mov eax,[CRC32]
mov eax,[_CRC32_]
mov edx,36
cmp eax,[CRC_check]
je .crcok
/programs/other/archer/trunk/data.inc
121,7 → 121,7
outp dd ?
unp_size dd ?
CRC_check dd ?
CRC32 dd ?
_CRC32_ dd ?
CRC32table rd 256
Adler32 dd ?
child dd ?
/programs/other/archer/trunk/deflate.inc
562,14 → 562,14
UCRC:
; in: esi - data to calculate CRC
; ecx - its length
; [CRC32] - previous CRC32
; out: [CRC32]- partial CRC32 (no pre- & post-conditioning!)
; [_CRC32_] - previous CRC32
; out: [_CRC32_]- partial CRC32 (no pre- & post-conditioning!)
pusha
cmp dword[CRC32table+4],0x77073096
je .tbl_rdy
call makeCRC
.tbl_rdy:
mov eax,[CRC32]
mov eax,[_CRC32_]
not eax
.m1:
movzx ebx,al
579,7 → 579,7
inc esi
loop .m1
not eax
mov [CRC32],eax
mov [_CRC32_],eax
popa
ret
 
/programs/other/archer/trunk/parser.inc
469,9 → 469,9
mov byte[esi],al
mov ecx,1
push dword[ebx]
pop [CRC32]
pop [_CRC32_]
call UCRC
push [CRC32]
push [_CRC32_]
pop dword[ebx]
mov eax,[ebx]
and eax,0xff
482,9 → 482,9
shr eax,24
mov byte[esi],al
push dword[ebx+8]
pop [CRC32]
pop [_CRC32_]
call UCRC
push [CRC32]
push [_CRC32_]
pop dword[ebx+8]
popa
ret
/programs/other/fft/FHT4A.asm
24,7 → 24,7
dd 0x0 , 0x0 ; I_Param , I_Icon
 
include '../../macros.inc'
include '../debug.inc'
include '../../debug.inc'
include 'fht4code.asm'
 
 
/programs/other/rtfread/trunk/rtfread.asm
69,7 → 69,7
 
@use_library
 
;include '../../debug.inc'
;include '../../../debug.inc'
 
if ~ RENDER eq PIX
TOP=TOP+4
/programs/system/board/trunk/debug.inc
File deleted
\ No newline at end of file
/programs/system/board/trunk/board.asm
19,7 → 19,7
dd mem ; esp
dd filename , 0x0 ; I_Param , I_Icon
include '../../../macros.inc'
include 'debug.inc'
include '../../../debug.inc'
purge newline
MAXSTRINGS = 16
TMP = 80*(MAXSTRINGS+1)
/programs/system/cropflat/debug.inc
File deleted
\ No newline at end of file
/programs/system/cropflat/cropflat.asm
43,7 → 43,7
dd 0x0
 
include '../../macros.inc'
;include 'debug.inc'
;include '../../debug.inc'
;------------------------------------------------------------------------------
START:
mcall 14
/programs/system/icon/trunk/debug.inc
File deleted
\ No newline at end of file
/programs/system/icon/trunk/icon.asm
82,7 → 82,7
include 'lang.inc'
include '../../../macros.inc'
include '../../../develop/libraries/box_lib/load_lib.mac'
;include 'debug.inc'
;include '../../../debug.inc'
;------------------------------------------------------------------------------
@use_library ;use load lib macros
;------------------------------------------------------------------------------
/programs/system/menu/trunk/debug.inc
File deleted
\ No newline at end of file
/programs/system/menu/trunk/menu.asm
41,7 → 41,7
;------------------------------------------------------------------------------
include "lang.inc"
include "..\..\..\macros.inc"
;include "DEBUG.INC" ; debug macros
;include "../../../debug.inc" ; debug macros
;------------------------------------------------------------------------------
align 4
conversion_ASCII_to_HEX:
/programs/system/panel/trunk/debug.inc
File deleted
\ No newline at end of file
/programs/system/panel/trunk/@PANEL.ASM
63,7 → 63,7
include 'lang.inc'
include '../../../macros.inc'
include '../../../proc32.inc'
;include 'debug.inc'
;include '../../../debug.inc'
include 'MOI.INC' ;à áª« ¤ª¨ ª« ¢¨ âãàë
include '../../../develop/libraries/box_lib/load_lib.mac'
@use_library ;use load lib macros