forked from KolibriOS/kolibrios
*kernel - fixes in 15.2 by Mario79 and 67 by mike.dld
updated sysfunc.txt
*programs
new icons and logo for CPUID and ICON
added new version of @ICON and ICONMNGR
fixes in iconedit and calendar from DedOK
new algoritm of fill background in pic4
all apps (fasm-writen only) rewriten to use common macros.inc for easy recompile in fastcall mode (there is a bug in https; run need rewrite to use common macros.inc)
small fixes in build_all.bat script
git-svn-id: svn://kolibrios.org@485 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix en >lang.inc
|
||||
@fasm https.asm https
|
||||
@erase lang.inc
|
||||
@pause
|
||||
@@ -1,4 +1,5 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix ru >lang.inc
|
||||
@fasm https.asm https
|
||||
@erase lang.inc
|
||||
@pause
|
||||
@@ -26,10 +26,10 @@ use32
|
||||
dd START ; program start
|
||||
dd I_END ; program image size
|
||||
dd 0x400000 ; required amount of memory
|
||||
dd 0x20000
|
||||
dd 0x400000
|
||||
dd 0,0 ; reserved=no extended header
|
||||
|
||||
include "MACROS.INC"
|
||||
include "..\..\..\MACROS.INC"
|
||||
|
||||
; 0x0+ - program image
|
||||
; 0x1ffff - stack
|
||||
@@ -57,7 +57,7 @@ START: ; start of execution
|
||||
|
||||
mov eax,70
|
||||
mov ebx,filel
|
||||
int 0x40
|
||||
mcall
|
||||
mov [board_size],ebx
|
||||
cmp eax,0
|
||||
je board_found
|
||||
@@ -75,7 +75,7 @@ START: ; start of execution
|
||||
mov ebx,files
|
||||
mov ecx,[board_size]
|
||||
mov [files+12],ecx
|
||||
int 0x40
|
||||
mcall
|
||||
|
||||
mov [status],-1
|
||||
mov [last_status],-2
|
||||
@@ -98,10 +98,10 @@ still:
|
||||
|
||||
mov eax,5
|
||||
mov ebx,1
|
||||
int 0x40
|
||||
mcall
|
||||
|
||||
mov eax,11
|
||||
int 0x40
|
||||
mcall
|
||||
call check_events
|
||||
|
||||
jmp still
|
||||
@@ -121,22 +121,22 @@ check_events:
|
||||
|
||||
key: ; Keys are not valid at this part of the
|
||||
mov al,2 ; loop. Just read it and ignore
|
||||
int 0x40
|
||||
mcall
|
||||
ret
|
||||
|
||||
button: ; button
|
||||
|
||||
mov al,17 ; get id
|
||||
int 0x40
|
||||
mcall
|
||||
|
||||
cmp ah,1 ; close
|
||||
jnz tst2
|
||||
mov eax,53
|
||||
mov ebx,8
|
||||
mov ecx,[socket]
|
||||
int 0x40
|
||||
mcall
|
||||
mov eax,-1
|
||||
int 0x40
|
||||
mcall
|
||||
tst2:
|
||||
|
||||
cmp ah,2 ; button id=2 ?
|
||||
@@ -149,7 +149,7 @@ button: ; button
|
||||
mov edx,0 ; no remote port specified
|
||||
mov esi,0 ; no remote ip specified
|
||||
mov edi,0 ; PASSIVE open
|
||||
int 0x40
|
||||
mcall
|
||||
mov [socket], eax
|
||||
mov [posy],1
|
||||
mov [posx],0
|
||||
@@ -167,14 +167,14 @@ button: ; button
|
||||
mov eax,53
|
||||
mov ebx,8
|
||||
mov ecx,[socket]
|
||||
int 0x40
|
||||
mcall
|
||||
mov eax,5
|
||||
mov ebx,2
|
||||
int 0x40
|
||||
mcall
|
||||
mov eax,53
|
||||
mov ebx,8
|
||||
mov ecx,[socket]
|
||||
int 0x40
|
||||
mcall
|
||||
|
||||
cmp [server_active],1
|
||||
jne no_re_open
|
||||
@@ -184,7 +184,7 @@ button: ; button
|
||||
mov edx,0 ; no remote port specified
|
||||
mov esi,0 ; no remote ip specified
|
||||
mov edi,0 ; PASSIVE open
|
||||
int 0x40
|
||||
mcall
|
||||
mov [socket], eax
|
||||
no_re_open:
|
||||
|
||||
@@ -245,7 +245,7 @@ start_transmission:
|
||||
je data_received
|
||||
mov eax,5
|
||||
mov ebx,1
|
||||
int 0x40
|
||||
mcall
|
||||
dec [retries]
|
||||
jnz wait_for_data
|
||||
jmp no_http_request
|
||||
@@ -280,7 +280,7 @@ start_transmission:
|
||||
mov ebx,7
|
||||
mov ecx,[socket]
|
||||
mov esi,[filepos]
|
||||
int 0x40
|
||||
mcall
|
||||
|
||||
mov eax,esi
|
||||
add eax,edx
|
||||
@@ -312,16 +312,16 @@ wait_for_empty_slot:
|
||||
|
||||
mov eax,5
|
||||
mov ebx,1
|
||||
int 0x40
|
||||
mcall
|
||||
|
||||
mov eax,11
|
||||
int 0x40
|
||||
mcall
|
||||
call check_events
|
||||
|
||||
mov eax,53
|
||||
mov ebx,255
|
||||
mov ecx,103
|
||||
int 0x40
|
||||
mcall
|
||||
|
||||
cmp eax,0
|
||||
je no_wait_more
|
||||
@@ -346,14 +346,14 @@ display_progress:
|
||||
mov ebx,115*65536+8*6
|
||||
mov ecx,178*65536+10
|
||||
mov edx,0xffffff
|
||||
int 0x40
|
||||
mcall
|
||||
|
||||
mov eax,47
|
||||
mov ebx,8*65536
|
||||
mov ecx,edi
|
||||
mov edx,115*65536+178
|
||||
mov esi,0x000000
|
||||
int 0x40
|
||||
mcall
|
||||
|
||||
popa
|
||||
ret
|
||||
@@ -368,14 +368,14 @@ send_header:
|
||||
mov ecx,[socket]
|
||||
mov edx,h_len-html_header
|
||||
mov esi,html_header
|
||||
int 0x40
|
||||
mcall
|
||||
|
||||
mov eax,53 ; send file type
|
||||
mov ebx,7
|
||||
mov ecx,[socket]
|
||||
mov edx,[type_len]
|
||||
mov esi,[file_type]
|
||||
int 0x40
|
||||
mcall
|
||||
|
||||
popa
|
||||
ret
|
||||
@@ -437,7 +437,7 @@ read_file: ; start of execution
|
||||
|
||||
mov eax,70
|
||||
mov ebx,filel
|
||||
int 0x40
|
||||
mcall
|
||||
mov [board_size],ebx
|
||||
|
||||
cmp [input_text+256+1],dword 'POST'
|
||||
@@ -599,7 +599,7 @@ read_file: ; start of execution
|
||||
|
||||
mov eax,70
|
||||
mov ebx,files
|
||||
int 0x40
|
||||
mcall
|
||||
|
||||
no_new_message:
|
||||
mov esi,0x20000
|
||||
@@ -769,7 +769,7 @@ read_file: ; start of execution
|
||||
mov [fileinfo+12],dword 1 ; file exists ?
|
||||
mov eax,70
|
||||
mov ebx,fileinfo
|
||||
int 0x40
|
||||
mcall
|
||||
|
||||
cmp eax,0 ; file not found - message
|
||||
je file_found
|
||||
@@ -795,7 +795,7 @@ read_file: ; start of execution
|
||||
mov [fileinfo+12],dword 0x2f0000 ; read all of file
|
||||
mov eax,70
|
||||
mov ebx,fileinfo
|
||||
int 0x40
|
||||
mcall
|
||||
|
||||
file_not_found:
|
||||
file_loaded:
|
||||
@@ -855,7 +855,7 @@ set_time:
|
||||
pusha
|
||||
|
||||
mov eax,3
|
||||
int 0x40
|
||||
mcall
|
||||
|
||||
mov ecx,3
|
||||
new_time_digit:
|
||||
@@ -880,7 +880,7 @@ set_date:
|
||||
pusha
|
||||
|
||||
mov eax,29
|
||||
int 0x40
|
||||
mcall
|
||||
|
||||
mov ecx,3
|
||||
add edi,6
|
||||
@@ -910,7 +910,7 @@ check_for_incoming_data:
|
||||
mov eax, 53
|
||||
mov ebx, 2
|
||||
mov ecx, [socket]
|
||||
int 0x40
|
||||
mcall
|
||||
|
||||
cmp eax,0
|
||||
je _ret_now
|
||||
@@ -920,7 +920,7 @@ check_for_incoming_data:
|
||||
mov eax,53
|
||||
mov ebx,2
|
||||
mov ecx,[socket]
|
||||
int 0x40
|
||||
mcall
|
||||
|
||||
cmp eax,0
|
||||
je _ret
|
||||
@@ -928,7 +928,7 @@ check_for_incoming_data:
|
||||
mov eax,53
|
||||
mov ebx,3
|
||||
mov ecx,[socket]
|
||||
int 0x40
|
||||
mcall
|
||||
|
||||
cmp bl,10
|
||||
jne no_lf
|
||||
@@ -964,7 +964,7 @@ check_for_incoming_data:
|
||||
jne no_ld
|
||||
mov ebx,50
|
||||
no_ld:
|
||||
int 0x40
|
||||
mcall
|
||||
|
||||
jmp check
|
||||
|
||||
@@ -985,7 +985,7 @@ check_status:
|
||||
mov eax,53
|
||||
mov ebx,6
|
||||
mov ecx,[socket]
|
||||
int 0x40
|
||||
mcall
|
||||
|
||||
cmp eax,[status]
|
||||
je c_ret
|
||||
@@ -1021,11 +1021,11 @@ read_string:
|
||||
|
||||
f11:
|
||||
mov eax,10
|
||||
int 0x40
|
||||
mcall
|
||||
cmp eax,2
|
||||
jne read_done
|
||||
mov eax,2
|
||||
int 0x40
|
||||
mcall
|
||||
shr eax,8
|
||||
cmp eax,13
|
||||
je read_done
|
||||
@@ -1083,7 +1083,7 @@ print_text:
|
||||
mov ecx,0x40000000
|
||||
mov esi,23
|
||||
mov edi,0xffffff
|
||||
int 0x40
|
||||
mcall
|
||||
|
||||
popa
|
||||
ret
|
||||
@@ -1098,54 +1098,54 @@ draw_window:
|
||||
|
||||
mov eax,12 ; function 12:tell os about windowdraw
|
||||
mov ebx,1 ; 1, start of draw
|
||||
int 0x40
|
||||
mcall
|
||||
|
||||
; DRAW WINDOW
|
||||
mov eax,0 ; function 0 : define and draw window
|
||||
mov ebx,100*65536+480 ; [x start] *65536 + [x size]
|
||||
mov ecx,100*65536+215 ; [y start] *65536 + [y size]
|
||||
mov edx,0x13ffffff ; color of work area RRGGBB
|
||||
mov edi,header ; WINDOW LABEL
|
||||
int 0x40
|
||||
mov edi,title ; WINDOW LABEL
|
||||
mcall
|
||||
|
||||
mov eax,8 ; function 8 : define and draw button
|
||||
mov ebx,(40)*65536+20 ; [x start] *65536 + [x size]
|
||||
mov ecx,59*65536+9 ; [y start] *65536 + [y size]
|
||||
mov edx,2 ; button id
|
||||
mov esi,0x66aa66 ; button color RRGGBB
|
||||
int 0x40
|
||||
mcall
|
||||
|
||||
; function 8 : define and draw button
|
||||
mov ebx,(40)*65536+20 ; [x start] *65536 + [x size]
|
||||
mov ecx,72*65536+9 ; [y start] *65536 + [y size]
|
||||
mov edx,4 ; button id
|
||||
mov esi,0xaa6666 ; button color RRGGBB
|
||||
int 0x40
|
||||
mcall
|
||||
|
||||
; Enter directory
|
||||
mov ebx,(25)*65536+66
|
||||
mov ecx,135*65536+15
|
||||
mov edx,6
|
||||
mov esi,0x3388dd
|
||||
int 0x40
|
||||
mcall
|
||||
|
||||
mov eax,38
|
||||
mov ebx,240*65536+240
|
||||
mov ecx,22*65536+210
|
||||
mov edx,0x6699cc ; 002288
|
||||
int 0x40
|
||||
mcall
|
||||
|
||||
|
||||
mov ebx,241*65536+241
|
||||
mov ecx,22*65536+210
|
||||
mov edx,0x336699 ; 002288
|
||||
int 0x40
|
||||
mcall
|
||||
|
||||
call draw_data
|
||||
|
||||
mov eax,12 ; function 12:tell os about windowdraw
|
||||
mov ebx,2 ; 2, end of draw
|
||||
int 0x40
|
||||
mcall
|
||||
|
||||
ret
|
||||
|
||||
@@ -1158,6 +1158,7 @@ draw_data:
|
||||
mov ecx,0x000000
|
||||
mov edx,text
|
||||
mov esi,35
|
||||
mov eax,13
|
||||
newline:
|
||||
pusha
|
||||
cmp ebx,25*65536+61
|
||||
@@ -1170,13 +1171,12 @@ draw_data:
|
||||
mov bx,35*6
|
||||
shl ecx,16
|
||||
mov cx,9
|
||||
mov eax,13
|
||||
mov edx,0xffffff
|
||||
int 0x40
|
||||
mcall
|
||||
now:
|
||||
popa
|
||||
mov eax,4
|
||||
int 0x40
|
||||
mcall
|
||||
add ebx,13
|
||||
add edx,40
|
||||
cmp [edx],byte 'x'
|
||||
@@ -1199,10 +1199,10 @@ draw_data:
|
||||
mov cx,9
|
||||
mov eax,13
|
||||
mov edx,0xffffff
|
||||
int 0x40
|
||||
mcall
|
||||
popa
|
||||
mov eax,4
|
||||
int 0x40
|
||||
mcall
|
||||
add ebx,10
|
||||
add edx,256
|
||||
dec edi
|
||||
@@ -1294,7 +1294,7 @@ unk: db 'Content-Type: unknown/unknown',13,10,13,10
|
||||
unkl:
|
||||
|
||||
|
||||
header db appname,version,0
|
||||
title db appname,version,0
|
||||
|
||||
socket dd 0x0
|
||||
server_active db 0x0
|
||||
|
||||
@@ -1,265 +0,0 @@
|
||||
; 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
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
; 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
|
||||
Reference in New Issue
Block a user