Screensaver optimization

git-svn-id: svn://kolibrios.org@5888 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
pathoswithin 2015-11-06 16:26:35 +00:00
parent 8b4cd9218d
commit 6dfe65cba8

View File

@ -1,11 +1,11 @@
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; @SS - screensaver ; @SS - screensaver
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; last update: 30/03/2012 ; last update: 30/03/2012
; changed by: Marat Zakiyanov aka Mario79, aka Mario ; changed by: Marat Zakiyanov aka Mario79, aka Mario
; changes: The program uses only 4 Kb memory is now. ; changes: The program uses only 4 Kb memory is now.
; Code refactoring. Using transparent cursor. ; Code refactoring. Using transparent cursor.
; Fix bug - using lots of buttons from f.8. ; Fix bug - using lots of buttons from f.8.
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
; SCREENSAVER APPLICATION by lisovin@26.ru ; SCREENSAVER APPLICATION by lisovin@26.ru
; ;
@ -16,7 +16,7 @@
org 0x0 org 0x0
db 'MENUET01' ; 8 byte id db 'MENUET01' ; 8 byte id
dd 0x01 ; header version dd 0x01 ; header version
dd START ; start of code dd START ; start of code
dd IM_END ; size of image dd IM_END ; size of image
dd I_END ; memory for app dd I_END ; memory for app
@ -79,14 +79,14 @@ still:
align 4 align 4
create_setup: create_setup:
test [params],2 test [params],2
jnz still ; ®ª­® ­ áâ஥ª 㦥 ᮧ¤ ­® jnz still ; ®ª­® ­ áâ஥ª 㦥 ᮧ¤ ­®
mcall 51,1,sthread,sthread_stack_top mcall 51,1,sthread,sthread_stack_top
or [params],2 or [params],2
jmp still jmp still
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
key: key:
mcall ; eax = 2 mcall ; eax = 2
jmp still jmp still
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
@ -110,7 +110,7 @@ thread:
push eax push eax
mov ecx,eax mov ecx,eax
mcall 37,4,,2 ; load own cursor mcall 37,4,,2 ; load own cursor
mov ecx,eax mov ecx,eax
mcall 37,5 ; set own cursor mcall 37,5 ; set own cursor
@ -125,7 +125,7 @@ thread:
je asminit je asminit
mov dword [delay],1 mov dword [delay],1
mov [lx1],10 ; for "draw line" mov [lx1],10 ; for "draw line"
mov [lx2],40 mov [lx2],40
mov [ly1],50 mov [ly1],50
mov [ly2],100 mov [ly2],100
@ -162,7 +162,7 @@ align 4
;-------------------------------------- ;--------------------------------------
align 4 align 4
@@: @@:
mov dword [delay],1 ;25 - old value mov dword [delay],1 ;25 - old value
;-------------------------------------- ;--------------------------------------
align 4 align 4
asminit1: asminit1:
@ -172,7 +172,7 @@ asminit1:
;-------------------------------------- ;--------------------------------------
align 4 align 4
newpage: newpage:
mov word [stringpos],10 mov [stringpos],16
;-------------------------------------- ;--------------------------------------
align 4 align 4
drawsswin: drawsswin:
@ -235,7 +235,7 @@ drawssasm:
;-------------------------------------- ;--------------------------------------
align 4 align 4
addstring: addstring:
add word [stringpos],10 add [stringpos],16
add edi,2 add edi,2
mov [stringstart],edi mov [stringstart],edi
mov dword [stringlen],1 mov dword [stringlen],1
@ -246,9 +246,13 @@ addstring:
;-------------------------------------- ;--------------------------------------
align 4 align 4
noaddstring: noaddstring:
mov ebx,10*65536 mov ebx,[stringlen]
shl ebx,19
mov bx,[stringpos] mov bx,[stringpos]
mcall 4,,0x104ba010,[stringstart],[stringlen] mov edx,[stringstart]
add edx,[stringlen]
dec edx
mcall 4,,0x104ba010,,1
inc dword [stringlen] inc dword [stringlen]
cmp [edi],byte ' ' cmp [edi],byte ' '
je drawssasm je drawssasm
@ -466,7 +470,7 @@ align 4
sdraw_window: sdraw_window:
mcall 12,1 mcall 12,1
xor eax,eax ; function 0 : define and draw window xor eax,eax ; function 0 : define and draw window
xor esi,esi xor esi,esi
mcall ,<100,215>,<100,70>,0x13400088,,title mcall ,<100,215>,<100,70>,0x13400088,,title
@ -556,69 +560,53 @@ setf:
mcall 4,<153,47>,,,1 mcall 4,<153,47>,,,1
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4 ; DATA AREA
; DATA AREA
buttext db 'SHOW',0
flag db 'V '
title db 'SCREENSAVER SETUP',0
setuptext db 'TYPE: < >',0
db 'TIME: < > MINUTES NEVER',0
typetext db 'BLACK SCREENCOLOR LINES ASSEMBLER '
type dd 12 type dd 12
time db 15 ; ¢à¥¬ï ¤® § ¯ã᪠ § áâ ¢ª¨ ¢ ¬¨­ãâ å
delay dd 100 delay dd 100
lx1 dd 10 lx1 dd 10
lx2 dd 40 lx2 dd 40
ly1 dd 50 ly1 dd 50
ly2 dd 100 ly2 dd 100
addx1 dd 1 addx1 dd 1
addx2 dd 1 addx2 dd 1
addy1 dd 1 addy1 dd 1
addy2 dd 1 addy2 dd 1
stringlen dd 1 stringlen dd 1
stringstart dd 0 stringstart dd 0
stringpos dw 10
params db 0 ;if bit 0 set-ssaver works if bit 1 set-setup works stringpos dw 16
time db 15 ; ¢à¥¬ï ¤® § ¯ã᪠ § áâ ¢ª¨ ¢ ¬¨­ãâ å
params db 0 ;if bit 0 set-ssaver works if bit 1 set-setup works
fileinfo: fileinfo:
dd 0 dd 0
dd 0 dd 0
dd 0 dd 0
.size: dd 0 .size: dd 0
.point: dd 0 .point: dd 0
db '/sys/macros.inc',0 db '/sys/macros.inc',0
;------------------------------------------------------------------------------
align 4
IM_END:
; UNINITIALIZED DATA:
buttext db 'SHOW',0
flag db 'V '
title db 'SCREENSAVER SETUP',0
setuptext db 'TYPE: < >',0
db 'TIME: < > MINUTES NEVER',0
typetext db 'BLACK SCREENCOLOR LINES ASSEMBLER '
;-------------------------------
IM_END: ; UNINITIALIZED DATA
top_right_corner rd 1
align 4
lcolor dd ? lcolor dd ?
x_max dw ? ; à §¬¥àë íªà ­  x_max dw ? ; à §¬¥àë íªà ­ 
y_max dw ? y_max dw ?
top_right_corner rd 1
;------------------------------------------------------------------------------
align 4
I_Param: I_Param:
fileinfo_buffer: fileinfo_buffer:
rb 40 rb 40
;------------------------------------------------------------------------------ ;-------------------------------
align 4
rb 512 rb 512
sthread_stack_top: sthread_stack_top:
;------------------------------------------------------------------------------
align 4
rb 512 rb 512
thread_stack_top: thread_stack_top:
;------------------------------------------------------------------------------
align 4
rb 512 rb 512
stack_top: stack_top:
I_END: I_END:
;------------------------------------------------------------------------------