2006-01-03 10:43:31 +01:00
|
|
|
|
; GIF VIEWER FOR MENUET v1.0
|
|
|
|
|
; Written in pure assembler by Ivushkin Andrey aka Willow
|
|
|
|
|
;
|
|
|
|
|
; Uses GIF_LITE 2.0
|
|
|
|
|
;
|
|
|
|
|
; Created: August 31, 2004
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 15:06:57 +02:00
|
|
|
|
; Last changed: August 25, 2006
|
2006-01-03 10:43:31 +01:00
|
|
|
|
;
|
|
|
|
|
; COMPILE WITH FASM
|
|
|
|
|
|
2006-10-26 16:43:39 +02:00
|
|
|
|
appname equ 'GIF VIEWER'
|
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
; input line dimensions
|
2006-10-26 16:43:39 +02:00
|
|
|
|
INP_X equ 5 shl 16+680
|
|
|
|
|
INP_Y equ 5 shl 16+16
|
|
|
|
|
INP_XY equ 10 shl 16+10
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
use32
|
|
|
|
|
|
|
|
|
|
org 0x0
|
|
|
|
|
|
|
|
|
|
db 'MENUET01'
|
|
|
|
|
dd 0x01
|
|
|
|
|
dd START
|
|
|
|
|
dd I_END
|
2007-06-25 19:20:49 +02:00
|
|
|
|
dd 0x400000
|
|
|
|
|
dd 0x400000
|
2006-01-03 10:43:31 +01:00
|
|
|
|
dd filename ;0x0
|
|
|
|
|
dd 0x0
|
|
|
|
|
|
|
|
|
|
include 'lang.inc'
|
2007-05-10 15:48:35 +02:00
|
|
|
|
include '..\..\..\macros.inc' ; decrease code size (optional)
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2007-06-25 19:20:49 +02:00
|
|
|
|
COLOR_ORDER equ PALETTE
|
|
|
|
|
GIF_SUPPORT_INTERLACED = 1
|
2006-01-03 10:43:31 +01:00
|
|
|
|
include 'gif_lite.inc'
|
|
|
|
|
|
|
|
|
|
START:
|
|
|
|
|
cmp [filename],byte 0
|
|
|
|
|
jne openfile2
|
|
|
|
|
; jmp openfile2
|
|
|
|
|
openfile:
|
|
|
|
|
xor eax,eax
|
2007-06-25 19:20:49 +02:00
|
|
|
|
mov [entered], eax
|
|
|
|
|
mov [gif_img_count],eax
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov esi,fn_input
|
|
|
|
|
mov edi,filename
|
|
|
|
|
mov ecx,[inp_pos]
|
|
|
|
|
rep movsb
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 15:06:57 +02:00
|
|
|
|
stosb
|
2006-01-03 10:43:31 +01:00
|
|
|
|
openfile2:
|
|
|
|
|
mov ebx,file_info
|
2007-06-25 19:20:49 +02:00
|
|
|
|
mov eax,70
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
cmp eax,6
|
|
|
|
|
je temp
|
|
|
|
|
test eax,eax
|
|
|
|
|
jnz ok2
|
|
|
|
|
temp:
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 15:06:57 +02:00
|
|
|
|
; cmp ebx,64
|
|
|
|
|
; jbe ok2
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
xor eax,eax
|
2007-06-25 19:20:49 +02:00
|
|
|
|
mov [entered], eax
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov esi,filename
|
|
|
|
|
mov edi,fn_input
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 15:06:57 +02:00
|
|
|
|
mov ecx,256/4 ;[filename_len]
|
|
|
|
|
rep movsd
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
mov edi,fn_input
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 15:06:57 +02:00
|
|
|
|
mov ecx,256
|
2006-01-03 10:43:31 +01:00
|
|
|
|
repne scasb
|
|
|
|
|
sub edi,fn_input
|
|
|
|
|
mov [inp_pos],edi
|
|
|
|
|
|
|
|
|
|
; test eax,eax
|
|
|
|
|
; jnz .ok2
|
|
|
|
|
; cmp ebx,64
|
|
|
|
|
; jbe .ok2
|
|
|
|
|
mov esi,workarea
|
|
|
|
|
mov edi,Image
|
|
|
|
|
call ReadGIF
|
|
|
|
|
test eax,eax
|
|
|
|
|
jz .ok
|
2007-06-25 19:20:49 +02:00
|
|
|
|
and [gif_img_count], 0
|
2006-01-03 10:43:31 +01:00
|
|
|
|
.ok:
|
|
|
|
|
ok2:
|
|
|
|
|
and dword[img_index],0
|
|
|
|
|
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mov ebx,3
|
|
|
|
|
mov ecx,sc
|
|
|
|
|
mov edx,sizeof.system_colors
|
2007-06-25 19:20:49 +02:00
|
|
|
|
mov eax,48
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
red:
|
|
|
|
|
|
2007-06-25 19:20:49 +02:00
|
|
|
|
; *********************************************
|
|
|
|
|
; ******* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> *******
|
|
|
|
|
; *********************************************
|
|
|
|
|
|
|
|
|
|
draw_window:
|
|
|
|
|
|
|
|
|
|
mov ebx,1
|
|
|
|
|
mov eax,12
|
|
|
|
|
mcall
|
|
|
|
|
|
|
|
|
|
xor eax,eax
|
|
|
|
|
mov ebx,50*65536+700
|
|
|
|
|
mov ecx,50*65536+500
|
|
|
|
|
mov edx,[sc.work]
|
|
|
|
|
or edx,0x33000000
|
|
|
|
|
mov edi,title
|
|
|
|
|
mcall
|
|
|
|
|
|
|
|
|
|
call draw_input
|
|
|
|
|
|
|
|
|
|
xor ecx,ecx
|
|
|
|
|
call draw_subimage
|
|
|
|
|
cmp [gif_img_count],1
|
|
|
|
|
jz @f
|
|
|
|
|
|
|
|
|
|
mov ecx,[img_index]
|
|
|
|
|
call draw_subimage
|
|
|
|
|
@@:
|
|
|
|
|
|
|
|
|
|
mov ebx,2
|
|
|
|
|
mov eax,12
|
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
still:
|
2007-06-25 19:20:49 +02:00
|
|
|
|
cmp [gif_img_count], 1
|
|
|
|
|
jbe .infinite
|
|
|
|
|
mov ebx, [cur_anim_delay]
|
|
|
|
|
test ebx, ebx
|
|
|
|
|
jz .infinite
|
|
|
|
|
mov eax, 23
|
|
|
|
|
mcall
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 15:06:57 +02:00
|
|
|
|
jmp @f
|
2007-06-25 19:20:49 +02:00
|
|
|
|
.infinite:
|
|
|
|
|
mov eax, 10
|
|
|
|
|
mcall
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 15:06:57 +02:00
|
|
|
|
@@:
|
|
|
|
|
dec eax
|
|
|
|
|
jz red
|
|
|
|
|
dec eax
|
|
|
|
|
jz key
|
|
|
|
|
dec eax
|
|
|
|
|
jz button
|
2007-06-25 19:20:49 +02:00
|
|
|
|
mov eax,[gif_img_count]
|
2006-01-03 10:43:31 +01:00
|
|
|
|
cmp eax,1
|
|
|
|
|
je still
|
|
|
|
|
inc [img_index]
|
|
|
|
|
cmp eax,[img_index]
|
|
|
|
|
jne redsub
|
|
|
|
|
and [img_index],0
|
|
|
|
|
redsub:
|
|
|
|
|
mov ecx,[img_index]
|
|
|
|
|
call draw_subimage
|
|
|
|
|
jmp still
|
|
|
|
|
|
|
|
|
|
key:
|
|
|
|
|
mov eax,2
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
cmp ah,13
|
|
|
|
|
je is_input
|
|
|
|
|
jmp still
|
|
|
|
|
|
|
|
|
|
button:
|
2007-06-25 19:20:49 +02:00
|
|
|
|
mcall 17
|
2006-01-03 10:43:31 +01:00
|
|
|
|
cmp ah,1
|
2007-06-25 19:20:49 +02:00
|
|
|
|
jnz wait_input
|
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
_close:
|
|
|
|
|
or eax,-1
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
is_input: ; simple input line with backspace feature
|
|
|
|
|
inc [entered] ; sorry - no cursor
|
|
|
|
|
wait_input:
|
|
|
|
|
call draw_input
|
|
|
|
|
mov eax,10
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2007-06-25 19:20:49 +02:00
|
|
|
|
cmp al,2
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jne still
|
|
|
|
|
mov edi,[inp_pos]
|
2007-06-25 19:20:49 +02:00
|
|
|
|
; mov eax,2
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
shr eax,8
|
2007-06-25 19:20:49 +02:00
|
|
|
|
cmp al,27
|
2006-01-03 10:43:31 +01:00
|
|
|
|
je still
|
2007-06-25 19:20:49 +02:00
|
|
|
|
cmp al,13
|
2006-01-03 10:43:31 +01:00
|
|
|
|
je openfile
|
2007-06-25 19:20:49 +02:00
|
|
|
|
cmp al,8
|
2006-01-03 10:43:31 +01:00
|
|
|
|
je backsp
|
|
|
|
|
mov [fn_input+edi],al
|
|
|
|
|
inc [inp_pos]
|
|
|
|
|
jmp wait_input
|
|
|
|
|
backsp:
|
|
|
|
|
test edi,edi
|
|
|
|
|
jz wait_input
|
|
|
|
|
dec [inp_pos]
|
|
|
|
|
jmp wait_input
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 15:06:57 +02:00
|
|
|
|
; jmp still
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
;****************************************
|
|
|
|
|
;******* DRAW CONTENTS OF INPUT LINE ****
|
|
|
|
|
;****************************************
|
|
|
|
|
draw_input:
|
2007-06-25 19:20:49 +02:00
|
|
|
|
mov esi,0xe0e0e0
|
2006-01-03 10:43:31 +01:00
|
|
|
|
cmp [entered],0
|
|
|
|
|
jne highlight
|
2006-10-26 16:43:39 +02:00
|
|
|
|
mov esi,0x00aabbcc
|
2006-01-03 10:43:31 +01:00
|
|
|
|
highlight:
|
|
|
|
|
mov ecx,INP_Y
|
|
|
|
|
mov edx,2
|
2007-06-25 19:20:49 +02:00
|
|
|
|
mov ebx,INP_X
|
|
|
|
|
mov eax,8
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-10-26 16:43:39 +02:00
|
|
|
|
mov ecx,0x00107a30
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov edx,fn_input
|
|
|
|
|
mov esi,[inp_pos]
|
2007-06-25 19:20:49 +02:00
|
|
|
|
mov ebx,INP_XY
|
|
|
|
|
mov eax,4
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
draw_subimage:
|
2007-06-25 19:20:49 +02:00
|
|
|
|
cmp [gif_img_count],0
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jz .enddraw
|
|
|
|
|
mov esi,Image
|
|
|
|
|
mov edi,gif_inf
|
|
|
|
|
call GetGIFinfo
|
|
|
|
|
test eax,eax
|
|
|
|
|
jz .enddraw
|
2007-06-25 19:20:49 +02:00
|
|
|
|
mov ecx, dword [edi+GIF_info.Width-2]
|
|
|
|
|
mov cx, [edi+GIF_info.Height]
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov ebx,eax
|
2007-06-25 19:20:49 +02:00
|
|
|
|
mov eax, [edi+GIF_info.Delay]
|
|
|
|
|
mov [cur_anim_delay],eax
|
|
|
|
|
mov edx, dword [edi+GIF_info.Left-2]
|
|
|
|
|
mov dx, [edi+GIF_info.Top]
|
2006-10-26 16:43:39 +02:00
|
|
|
|
add edx,5 shl 16 +25
|
2007-06-25 19:20:49 +02:00
|
|
|
|
mov esi, 8
|
|
|
|
|
mov edi, [edi+GIF_info.Palette]
|
|
|
|
|
xor ebp, ebp
|
|
|
|
|
mov eax, 65
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
.enddraw:
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD> <20><>室<EFBFBD><E5AEA4><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC>:
|
|
|
|
|
|
2007-05-10 15:48:35 +02:00
|
|
|
|
title db appname,0 ; <20><>ப<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
inp_pos dd inp_end-fn_input
|
|
|
|
|
fn_input:
|
|
|
|
|
; db '/hd/1/gif/smileys/sm100000.gif'
|
2007-05-30 16:45:45 +02:00
|
|
|
|
db '/sys/meos.gif'
|
2006-01-03 10:43:31 +01:00
|
|
|
|
; db '/hd/1/1/tex256.gif',0
|
|
|
|
|
; db '/rd/1/tex256.gif'
|
|
|
|
|
inp_end:
|
|
|
|
|
rb 256-(inp_end-fn_input)
|
|
|
|
|
|
|
|
|
|
file_info:
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 15:06:57 +02:00
|
|
|
|
dd 0
|
|
|
|
|
dd 0x100000;0x200000
|
|
|
|
|
dd workarea;0x100000
|
2006-01-03 10:43:31 +01:00
|
|
|
|
I_END: ; <20><><EFBFBD><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC>
|
|
|
|
|
filename:
|
|
|
|
|
; db '/hd/1/gif/smileys/sm112000.gif',0
|
|
|
|
|
; db '/hd/1/gif/test.gif',0
|
|
|
|
|
; db '/hd/1/gif/explode1.gif',0
|
|
|
|
|
; db '/hd/1/gif/tapeta.gif',0
|
|
|
|
|
; db '/hd/1/gif/meos.gif',0
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 15:06:57 +02:00
|
|
|
|
rb 257
|
2006-01-03 10:43:31 +01:00
|
|
|
|
;filename_len dd 0
|
2007-06-25 19:20:49 +02:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
entered rd 1
|
2006-10-26 16:43:39 +02:00
|
|
|
|
sc system_colors
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2007-06-25 19:20:49 +02:00
|
|
|
|
gif_img_count rd 1
|
|
|
|
|
cur_anim_delay rd 1
|
2006-01-03 10:43:31 +01:00
|
|
|
|
img_index rd 1
|
|
|
|
|
gif_inf GIF_info
|
|
|
|
|
|
2007-06-25 19:20:49 +02:00
|
|
|
|
IncludeUGlobals
|
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
workarea rb 0x100000
|
|
|
|
|
|
|
|
|
|
Image:
|