zSea - advanced image viewer for KolibriOS

v.1.0 rс3 12.06.2011

git-svn-id: svn://kolibrios.org@1951 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Marat Zakiyanov (Mario79) 2011-06-11 22:16:26 +00:00
parent b0b34108f2
commit d7b0867c02
70 changed files with 18331 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

View File

@ -0,0 +1,163 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1251">
<TITLE></TITLE>
<META NAME="GENERATOR" CONTENT="OpenOffice.org 3.2 (Win32)">
<META NAME="CREATED" CONTENT="20080921;16173700">
<META NAME="CHANGED" CONTENT="20081002;1473200">
<META NAME="Ïîëå 1" CONTENT="">
<META NAME="Ïîëå 2" CONTENT="">
<META NAME="Ïîëå 3" CONTENT="">
<META NAME="Ïîëå 4" CONTENT="">
</HEAD>
<BODY LANG="ru-RU" LINK="#000080" VLINK="#800000" DIR="LTR">
<P><FONT SIZE=4><B>Ñïåöèôèêàöèÿ RAW (íàø âíóòðåííèé ñòàíäàðò).</B></FONT></P>
<P><BR><BR>
</P>
<P>Ôîðìàò:</P>
<TABLE WIDTH=100% CELLPADDING=4 CELLSPACING=0>
<COL WIDTH=45*>
<COL WIDTH=36*>
<COL WIDTH=175*>
<TR VALIGN=TOP>
<TD WIDTH=18% HEIGHT=8 STYLE="; border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P>Ñìåùåíèå, áàéò</TD>
<TD WIDTH=14% STYLE="; border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P>Äëèííà, áàéò</TD>
<TD WIDTH=68% STYLE="; border: 1px solid #000000; padding: 0.1cm">
<P>Îïèñàíèå</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=18% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>0</TD>
<TD WIDTH=14% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>4</TD>
<TD WIDTH=68% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm">
<P>Çàãîëîâîê '<B>RAW</B>' è <B>ïðîáåë</B></TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=18% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>4</TD>
<TD WIDTH=14% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>4</TD>
<TD WIDTH=68% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm">
<P>Ðàçìåð ïî <B>X</B> (ïî ãîðèçîíòàëè), â ïèêñåëàõ</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=18% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>8</TD>
<TD WIDTH=14% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>4</TD>
<TD WIDTH=68% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm">
<P>Ðàçìåð ïî <B>Y</B> (ïî âåðòèêàëè), â ïèêñåëàõ</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=18% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>12</TD>
<TD WIDTH=14% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>4</TD>
<TD WIDTH=68% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm">
<DL>
<DT>Îáùàÿ ãëóáèíà ïèêñåëà = Ãëóáèíà êàíàëà * Êîëè÷åñòâî êàíàëîâ<DT>
Âîçìîæíûå çíà÷åíèÿ: <B>1, 4, 8, 16, 24, 32, 48, 64</B></DL>
</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=18% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>16</TD>
<TD WIDTH=14% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>2</TD>
<TD WIDTH=68% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm">
<DL>
<DT>Ãëóáèíà êàíàëà<DT>
Äëÿ Grayscale: <B>1, 4, 8, 16</B><DT>
Äëÿ R, G, B è T (<FONT COLOR="#000000"><FONT SIZE=2>Transparency
&mdash; Ïðîçðà÷íîñòü):</FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2><B>
5, 8, 16</B></FONT></FONT></DL>
</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=18% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>18</TD>
<TD WIDTH=14% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>2</TD>
<TD WIDTH=68% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm">
<DL>
<DT>Êîëè÷åñòâî êàíàëîâ:<DT>
Äëÿ Grayscale: <B>1, 2</B> (çíà÷åíèå 2 ïðè íàëè÷èè T è ãëóáèíå íå
ìåíåå 8)<DT>
Äëÿ R, G, B: <B>1</B>, (ïðè îáùåé ãëóáèíå ìåíüøå 16 áèò), <B>3</B><DT>
Äëÿ R, G, B è T (<FONT COLOR="#000000"><FONT SIZE=2>Transparency
&mdash; Ïðîçðà÷íîñòü): </FONT></FONT><FONT COLOR="#000000"><FONT SIZE=2><B>4</B></FONT></FONT></DL>
</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=18% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>20</TD>
<TD WIDTH=14% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>4</TD>
<TD WIDTH=68% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm">
<P>Óêàçàòåëü íà ïàëèòðó (ñìåùåíèå îò íà÷àëà ôàéëà), åñëè ïàëèòðû
íåò òî çíà÷åíèå <B>0</B></TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=18% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>24</TD>
<TD WIDTH=14% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>4</TD>
<TD WIDTH=68% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm">
<P>Ðàçìåð îáëàñòè ïàëèòðû, ìàêñèìàëüíîå çíà÷åíèå <B>256*4=1024</B>
áàéò.</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=18% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>28</TD>
<TD WIDTH=14% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>4</TD>
<TD WIDTH=68% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm">
<P>Óêàçàòåëü íà äàííûå ïèêñåëåé äëÿ R, G, B. Âîçìîæíî çíà÷åíèå <B>0</B>,
â ýòîì ñëó÷àå âûâîäèìàÿ îáëàñòü çàïîëíÿåòñÿ öâåòîì èç ïàëèòðû.</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=18% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>32</TD>
<TD WIDTH=14% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>4</TD>
<TD WIDTH=68% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm">
<P>Ðàçìåð îáëàñòè äàííûõ äëÿ ïèêñåëåé.</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=18% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>36</TD>
<TD WIDTH=14% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>4</TD>
<TD WIDTH=68% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm">
<P>Óêàçàòåëü íà T (<FONT COLOR="#000000"><FONT SIZE=2>Transparency
&mdash; Ïðîçðà÷íîñòü)</FONT></FONT></TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=18% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>40</TD>
<TD WIDTH=14% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>4</TD>
<TD WIDTH=68% STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm">
<P>Ðàçìåð îáëàñòè äàííûõ äëÿ T.</TD>
</TR>
<TR>
<TD COLSPAN=3 WIDTH=100% VALIGN=TOP STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm">
<P ALIGN=CENTER>Îáëàñòü äàííûõ ïàëèòðû</TD>
</TR>
<TR>
<TD COLSPAN=3 WIDTH=100% VALIGN=TOP STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm">
<P ALIGN=CENTER>Îáëàñòü äàííûõ R, G, B.</TD>
</TR>
<TR>
<TD COLSPAN=3 WIDTH=100% VALIGN=TOP STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm">
<P ALIGN=CENTER>Îáëàñòü äàííûõ T (<FONT COLOR="#000000"><FONT SIZE=2>Transparency
&mdash; Ïðîçðà÷íîñòü)</FONT></FONT></TD>
</TR>
</TABLE>
<P><BR>
</BODY>
</HTML>

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

View File

@ -0,0 +1,209 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1251">
<TITLE></TITLE>
<META NAME="GENERATOR" CONTENT="OpenOffice.org 3.2 (Win32)">
<META NAME="CREATED" CONTENT="20090304;23535200">
<META NAME="CHANGED" CONTENT="20090630;22142000">
<META NAME="Ïîëå 1" CONTENT="">
<META NAME="Ïîëå 2" CONTENT="">
<META NAME="Ïîëå 3" CONTENT="">
<META NAME="Ïîëå 4" CONTENT="">
</HEAD>
<BODY LANG="ru-RU" TEXT="#000000" LINK="#000080" VLINK="#800000" DIR="LTR">
<DL>
<DT><FONT SIZE=3><B>Ñïåöèôèêàöèÿ RAW</B></FONT><DT>
<BR>
<DT>Ïðè çàãðóçêå gif-ôàéëà ôóíêöèÿ START âîçâðàùàåò óêàçàòåëü íà
ñëåäóþùóþ ñòðóêòóðó:<DT>
<BR>
</DL>
<TABLE WIDTH=643 CELLPADDING=4 CELLSPACING=0>
<COL WIDTH=101>
<COL WIDTH=82>
<COL WIDTH=434>
<TR VALIGN=TOP>
<TD WIDTH=101 STYLE="; border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P>Ñìåùåíèå, áàéò
</TD>
<TD WIDTH=82 STYLE="; border-top: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0.1cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P>Äëèííà, áàéò</TD>
<TD WIDTH=434 STYLE="; border: 1px solid #000000; padding: 0.1cm">
<P>Îïèñàíèå</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=101 STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>0</TD>
<TD WIDTH=82 STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>4</TD>
<TD WIDTH=434 STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm">
<P>Çàãîëîâîê '<B>RAW1</B>'</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=101 STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>4</TD>
<TD WIDTH=82 STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>4</TD>
<TD WIDTH=434 STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm">
<P>n = ÷èñëî èçîáðàæåíèé</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=101 STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>8</TD>
<TD WIDTH=82 STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>4</TD>
<TD WIDTH=434 STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm">
<P>øèðèíà ëîãè÷åñêîãî ýêðàíà (íà êîòîðîì áóäóò ïîêàçûâàòüñÿ âñå
èçîáðàæåíèÿ), â ïèêñåëàõ</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=101 STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>12</TD>
<TD WIDTH=82 STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>4</TD>
<TD WIDTH=434 STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm">
<P>âûñîòà ëîãè÷åñêîãî ýêðàíà (íà êîòîðîì áóäóò ïîêàçûâàòüñÿ âñå
èçîáðàæåíèÿ), â ïèêñåëàõ</TD>
</TR>
<TR>
<TD COLSPAN=3 WIDTH=633 VALIGN=TOP STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm">
<P ALIGN=CENTER><B>Repeat 0</B> ; repeat n &mdash; ïîâòîðÿþùèåñÿ
áëîêè, 1 â ñëó÷àå ñòàòè÷íîãî GIF, íóìåðàöèÿ <B>N</B> íà÷èíàåòñÿ ñ
<B>0</B></TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=101 STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>16+N*16</TD>
<TD WIDTH=82 STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>4</TD>
<TD WIDTH=434 STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm">
<P>óêàçàòåëü íà î÷åðåäíîå èçîáðàæåíèå - ñ çàãîëîâêîì '<B>RAW</B>
'<SUP><FONT SIZE=3><B>**3</B></FONT></SUP></TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=101 STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>20+N*16</TD>
<TD WIDTH=82 STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>4</TD>
<TD WIDTH=434 STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm">
<P>x-êîîðäèíàòà èçîáðàæåíèÿ íà ëîãè÷åñêîì ýêðàíå, â ïèêñåëàõ</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=101 STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>24+N*16</TD>
<TD WIDTH=82 STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>4</TD>
<TD WIDTH=434 STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm">
<P>y-êîîðäèíàòà èçîáðàæåíèÿ íà ëîãè÷åñêîì íà ýêðàíå, â ïèêñåëàõ</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=101 STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>28+N*16</TD>
<TD WIDTH=82 STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>2</TD>
<TD WIDTH=434 STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm">
<P> çàäåðæêà, èçìåðÿåòñÿ â <B>0.01</B> ñåêóíäû<SUP><FONT SIZE=3><B>**2</B></FONT></SUP></TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=101 STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>30+N*16</TD>
<TD WIDTH=82 STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER><FONT FACE="Arial"><FONT SIZE=2>1</FONT></FONT></TD>
<TD WIDTH=434 STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm">
<DL>
<DT><FONT FACE="Arial"><FONT SIZE=2>&lt;Packed Fields&gt;</FONT></FONT><DT>
<BR>
<DT><FONT FACE="Arial"><FONT SIZE=2><B>0 bit</B></FONT></FONT><FONT FACE="Arial"><FONT SIZE=2>
- Ïðîçðà÷íîñòü</FONT></FONT><DT>
<FONT FACE="Arial"><FONT SIZE=2>0 - íåò ïðîçðà÷íîãî
öâåòà, 1 - åñòü ïðîçðà÷íûé öâåò</FONT></FONT><DT>
<BR>
<DT><FONT FACE="Arial"><FONT SIZE=2><B>1 bit</B></FONT></FONT><FONT FACE="Arial"><FONT SIZE=2>
&mdash; Ôëàã ïîëüçîâàòåëÿ</FONT></FONT><DT>
<FONT FACE="Arial"><FONT SIZE=2>Çíà÷åíèÿ:</FONT></FONT></DL>
<OL>
<P>
<FONT FACE="Arial"><FONT SIZE=2>0 - Íå îæèäàòü ââîä îò
ïîëüçîâàòåëÿ äëÿ ïðîäîëæåíèÿ.</FONT></FONT></OL>
<DL>
<DT><FONT COLOR="#000000"> </FONT><FONT COLOR="#000000"><FONT FACE="Arial"><FONT SIZE=2><SPAN LANG="ru-RU">1
- Îæèäàòü ââîä îò ïîëüçîâàòåëÿ.</SPAN></FONT></FONT></FONT><DT>
<BR>
<DT><FONT FACE="Arial"><FONT SIZE=2><B>2,3,4 bit</B></FONT></FONT><FONT FACE="Arial"><FONT SIZE=2>
&mdash; Ìåòîä ðàçìåùåíèÿ</FONT></FONT><DT>
<FONT FACE="Arial"><FONT SIZE=2>Çíà÷åíèÿ:</FONT></FONT><DT>
<FONT FACE="Arial"><FONT SIZE=2>0 - Íèêàêîå ðàçìåùåíèå íå
îïðåäåëåíî. Äåêîäåð íå îáÿçàí ïðåäïðèíèìàòü ëþáîå äåéñòâèå.</FONT></FONT><DT>
<FONT FACE="Arial"><FONT SIZE=2>1 - Íå ðàñïîëàãàòü. Ãðàôèêó
íóæíî îñòàâèòü íà ìåñòå</FONT></FONT><DT>
<FONT FACE="Arial"><FONT SIZE=2>2 - Âîññòàíîâèòü ê öâåò ôîíà.
Îáëàñòü, èñïîëüçóåìàÿ ãðàôèêîé, äîëæíà áûòü âîññòàíîâëåíà ê öâåòó
ôîíà.</FONT></FONT><DT>
<FONT FACE="Arial"><FONT SIZE=2>3 - Âîññòàíîâèòü ê ïðåäûäóùåìó.
Äåêîäåð îáÿçàí âîññòàíàâëèâàòü îáëàñòü, çàïèñàííóþ ïîâåðõ
ãðàôè÷åñêèì ñèìâîëîì ñ òåì, ÷òî áûëî òàì äî ïðåäîñòàâëåíèÿ
ãðàôè÷åñêîãî ñèìâîëà.</FONT></FONT><DT>
<FONT FACE="Arial"><FONT SIZE=2>4-7 -Çàðåçåðâèðîâàíî.</FONT></FONT><DT>
<BR>
<DT><FONT COLOR="#000000"><FONT FACE="Arial"><FONT SIZE=2><B>5,6,7
bit</B></FONT></FONT></FONT><FONT COLOR="#000000"><FONT FACE="Arial"><FONT SIZE=2>
- Çàðåçåðâèðîâàíî</FONT></FONT></FONT><DT>
<BR>
</DL>
</TD>
</TR>
<TR VALIGN=TOP>
<TD WIDTH=101 STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>31+N*16</TD>
<TD WIDTH=82 STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm">
<P ALIGN=CENTER>1</TD>
<TD WIDTH=434 STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm">
<P>èíäåêñ ïðîçðà÷íîãî öâåòà<SUP><FONT SIZE=3><B>**1</B></FONT></SUP>
(èãíîðèðóåòñÿ, åñëè ïðåäûäóùåå ïîëå íóëåâîå)</TD>
</TR>
<TR>
<TD COLSPAN=3 WIDTH=633 VALIGN=TOP STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm">
<P ALIGN=CENTER><B>end repeat 0</B></TD>
</TR>
<TR>
<TD COLSPAN=3 WIDTH=633 VALIGN=TOP STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm">
<P ALIGN=CENTER><B>Repeat 1</B></TD>
</TR>
<TR>
<TD COLSPAN=3 WIDTH=633 VALIGN=TOP STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm">
<P ALIGN=CENTER><B>Repeat 2</B></TD>
</TR>
<TR>
<TD COLSPAN=3 WIDTH=633 VALIGN=TOP STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm">
<P ALIGN=CENTER><B>Repeat 3</B></TD>
</TR>
<TR>
<TD COLSPAN=3 WIDTH=633 VALIGN=TOP STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm">
<P ALIGN=CENTER><B>...</B></TD>
</TR>
<TR>
<TD COLSPAN=3 WIDTH=633 VALIGN=TOP STYLE="; border-top: none; border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; padding-top: 0cm; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm">
<P ALIGN=CENTER><B>Repeat Nmax</B></TD>
</TR>
</TABLE>
<DL>
<DT><BR>
<DT>Ïðèìå÷àíèÿ:</DL>
<OL>
<LI>
**1 èíäåêñ ïðîçðà÷íîãî öâåòà - ïèêñåëè ñ òàêèì öâåòîì íóæíî íå
çàêðàøèâàòü, à îñòàâëÿòü ïðîçðà÷íûìè. Åñëè ñëåäóþùèé ýêðàí
íà÷èíàåòñÿ íå ñî ñìåùåíèÿ 0, à ïðîçðà÷íîãî öâåòà íåò, òî
íåçàòðàãèâàåìàÿ îáëàñòü âëþáîì ñëó÷àå îòñàåòñÿ íåçàòðàãèâàåìîé.<LI>
**2 çàäåðæêà - çàäåðæêà äëÿ êàäîãî êàäðà èíäèâèäóàëüíà<LI>
**3 óêàçàòåëè íà RAW &mdash; àáñîëþòíûå àäðåñà, êàæäûé RAW
íåçàâèñèìàÿ îò çàãîëîâêà îáëàñòü, ïðè ñìåíå ôàéëà èõ âñå íàäî
îñâîáîæäàòü.</OL>
<DL>
<DT><BR>
<DT><BR>
<DT><BR>
</DL>
</BODY>
</HTML>

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,68 @@
The block is passed to the plugin:
;---------------------------------------------------------------------
; not change this section!!!
; start section
;---------------------------------------------------------------------
align 4
image_file dd 0 ;+0
raw_pointer dd 0 ;+4
return_code dd 0 ;+8
img_size dd 0 ;+12
deflate_unpack dd 0 ;+16
raw_pointer_2 dd 0 ;+20
;---------------------------------------------------------------------
; end section
;---------------------------------------------------------------------
Calling plugins:
;---------------------------------------------------------------------
convert:
xor eax,eax
cmp [error_fs],eax
jnz .error
mov [return_code],eax
; mov eax,image_file
push image_file
call [plugin]
cmp [return_code],dword 0
je @f
cmp [return_code],dword 2
je @f
;-------------------------------
xor eax,eax
mov [return_code],eax
; mov eax,image_file
push image_file
call [plugin_1]
cmp [return_code],dword 0
je @f
cmp [return_code],dword 2
je @f
;-------------------------------
xor eax,eax
mov [return_code],eax
; mov eax,image_file
push image_file
call [plugin_2]
cmp [return_code],dword 0
je @f
cmp [return_code],dword 2
je @f
;-------------------------------
xor eax,eax
mov [return_code],eax
; mov eax,image_file
push image_file
call [plugin_3]
;-------------------------------
@@:
mov ecx,[image_file]
mcall 68,13
cmp [return_code],dword 0
je .all_ok
xor eax,eax
;-------------------------------

View File

@ -0,0 +1,66 @@
The block is passed to the plugin:
;---------------------------------------------------------------------
; not change this section!!!
; start section
;---------------------------------------------------------------------
align 4
image_file dd 0 ;+0
raw_pointer dd 0 ;+4
return_code dd 0 ;+8
img_size dd 0 ;+12
deflate_unpack dd 0 ;+16
raw_pointer_2 dd 0 ;+20
;---------------------------------------------------------------------
; end section
;---------------------------------------------------------------------
Calling plugins:
;---------------------------------------------------------------------
convert:
xor eax,eax
cmp [error_fs],eax
jnz .error
mov [return_code],eax
mov eax,image_file
call [plugin]
cmp [return_code],dword 0
je @f
cmp [return_code],dword 2
je @f
;-------------------------------
xor eax,eax
mov [return_code],eax
mov eax,image_file
call [plugin_1]
cmp [return_code],dword 0
je @f
cmp [return_code],dword 2
je @f
;-------------------------------
xor eax,eax
mov [return_code],eax
mov eax,image_file
call [plugin_2]
cmp [return_code],dword 0
je @f
cmp [return_code],dword 2
je @f
;-------------------------------
xor eax,eax
mov [return_code],eax
mov eax,image_file
call [plugin_3]
;-------------------------------
@@:
mov ecx,[image_file]
mcall 68, 13,
cmp [return_code],dword 0
je .all_ok
xor eax,eax
;-------------------------------

View File

@ -0,0 +1,10 @@
Use variable "status":
1 1h 1 open file
2 2h 10 file info
4 4h 100 window about
8 8h 1000 window background
16 10h 10000 window set sort mode
32 20h 100000 window error
64 40h 1000000 window option
128 80h 10000000

View File

@ -0,0 +1,63 @@
“¯à ¢«ïî騥 á®ç¥â ­¨ï ª« ¢¨è ¢ zSea v1.00 Beta (¨«¨ ⥪ãé ï ¢¥àá¨ï).
£« ¢­®¬ ®ª­¥:
PageUp - «¨áâ ­¨¥ 㪠§ â¥«ï ä ©«  ­  ®¤­ã ¯®§¨æ¨î ª ­ ç «ã ᯨ᪠.
PageDown - «¨áâ ­¨¥ 㪠§ â¥«ï ä ©«  ­  ®¤­ã ¯®§¨æ¨î ª ª®­æã ᯨ᪠.
Home - ¯¥à¥¬¥é¥­¨¥ 㪠§ â¥«ï ä ©«  ¢ ­ ç «® ᯨ᪠.
End - ¯¥à¥¬¥é¥­¨¥ 㪠§ â¥«ï ä ©«  ¢ ª®­¥æ ᯨ᪠.
"0" (­  £«. ª« ¢.) ¨ "*" (­  ¤®¯. ª« ¢.) -  ¢â®¬ áèâ ¡¨à®¢ ­¨¥ ¯®¤ à §¬¥à íªà ­ .
"+" - 㢥«¨ç¨âì ¬ áèâ ¡
"-" - 㬥­ìè¨âì ¬ áèâ ¡
"|" (­  £«. ª« ¢.) ¨ "/" (­  ¤®¯. ª« ¢.) - ¬ áèâ ¡ 100%
W - ¢â®à¨ç­®¥ ®ª­® "“áâ ­®¢ª  ª à⨭ª¨ à ¡®ç¥£® á⮫ "
I - ¢â®à¨ç­®¥ ®ª­® "‘¢¥¤¥­¨ï ® ¯à®á¬ âਢ ¥¬®¬ ä ©«¥"
S - ¢â®à¨ç­®¥ ®ª­® "‚ë¡®à ०¨¬  á®àâ¨à®¢ª¨"
O - ¢â®à¨ç­®¥ ®ª­® "Ž¯æ¨¨ ¯à¨«®¦¥­¨ï"
‘â५ª¨ ªãàá®à  (­  £«. ¨ ¤®¯ ª« ¢.) - ᤢ¨£ ª à⨭ª¨, ¥á«¨ ®­  ¡®«ìè¥ ®¡« á⨠®â®¡à ¦¥­¨ï.
Enter (­  £«. ¨ ¤®¯ ª« ¢.) - ®¡« áâì ®â®¡à ¦¥­¨ï ­  ¢¥áì íªà ­ ¨ ¢®§¢à â ¢ ®¡ëç­ë© ०¨¬.
PrintScreen - § ¯ã᪠SlideShow, ®áâ ­®¢ ¯® Esc ¨«¨ Space (<28>஡¥«).
Alt+F1 -  ªâ¨¢ æ¨ï ¬¥­î.
¬¥­î:
‘â५ª¨ ªãàá®à  ¢¢¥àå ¨ ¢­¨§ ¯¥à¥¬¥é¥­¨¥ ¯® ¯ã­ªâ ¬.
Esc - § ªàëâì ®ª­®.
Enter - ‡ ªàëâì ®ª­® á ¯®¤â¢¥à¦¤¥­¨¥¬ ¯ã­ªâ .
‘â५ª¨ ªãàá®à  ¢«¥¢® ¨ ¢¯à ¢® ¯¥à¥¬¥é¥­¨¥ ¢ á®á¥¤­¥¥ ¬¥­î.
‚® ¢â®à¨ç­ëå ®ª­ å:
Esc - § ªàëâì ®ª­®.
Enter - ‡ ªàëâì ®ª­® á ¯®¤â¢¥à¦¤¥­¨¥¬.
‘â५ª¨ ªãàá®à  ¢¢¥àå ¨ ¢­¨§ ¯¥à¥¬¥é¥­¨¥ ¯® ¯ã­ªâ ¬.
"+" ¨ "-" ¨§¬¥­¥­¨¥ ç¨á«®¢ëå ¤ ­­ëå.
Space (<28>஡¥«) -  ªâ¨¢¨à®¢ âì ¨«¨ ®âª«îç¨âì ¯ã­ªâ, ¥á«¨ íâ® checkbox.
®ª­ å ­¥ ¨á¯®«ì§ãîé¨å ª« ¢¨è¨ - ¢á¥ ª« ¢¨è¨ ¯à¨¢®¤ïâ ª § ªàëâ¨î.
OpenDialog - „¨ «®£ ®âªàëâ¨ï ä ©«  (®â¤¥«ì­ ï ¯à®£à ¬¬ ):
1) <20>¥à¥¬¥é¥­¨¥ ªãàá®à  ¯® ¯ ­¥«¨:
 ) áâ५ª¨ ¢¢¥àå ¨ ¢­¨§ (¢ ⮬ ç¨á«¥ à á¯®«®¦¥­­ë¥ ¢ ¤®¯®«­¨â¥«ì­®© ç á⨠ª« ¢¨ âãàë) - ¯¥à¥¬¥é¥­¨¥ ªãàá®à  ­  ®¤­ã ¯®§¨æ¨î ¢¢¥àå ¨«¨ ¢­¨§.
¡) PageUp - ¯®áâà ­¨ç­®¥ «¨áâ ­¨¥ ¢¢¥àå.
¢) PageDown - ¯®áâà ­¨ç­®¥ «¨áâ ­¨¥ ¢­¨§.
£) Home - ¢ ­ ç «® ª â «®£  á ä ©« ¬¨.
¤) End - ¢ ª®­¥æ ª â «®£  á ä ©« ¬¨.
2) Enter - ¤¥©á⢨ï á ä ©«®¬ ­  ¯®§¨æ¨¨ ª®â®à®£® ­ å®¤¨âáï ªãàá®à ¢ë¤¥«¥­¨ï:
 ) ¢å®¤ ¢ ¯ ¯ªã.
¡) § ¯ã᪠¯à®£à ¬¬ë.
3) <20> ¡®â  á ¬¥­î:
Alt+F1 - ¢ë§®¢ ¬¥­î ¢ë¡®à  ¤¨áª .
Alt+F2 - ¢ë§®¢ ¬¥­î á®àâ¨à®¢ª¨.
Alt+F3 - ¢ë§®¢ ¬¥­î 䨫ìâà æ¨¨.
¬¥­î:
‘â५ª¨ ªãàá®à  ¢¢¥àå ¨ ¢­¨§ ¯¥à¥¬¥é¥­¨¥ ¯® ¯ã­ªâ ¬.
Esc - § ªàëâì ®ª­®.
Enter - ‡ ªàëâì ®ª­® á ¯®¤â¢¥à¦¤¥­¨¥¬ ¯ã­ªâ .
‘â५ª¨ ªãàá®à  ¢«¥¢® ¨ ¢¯à ¢® ¯¥à¥¬¥é¥­¨¥ ¢ á®á¥¤­¥¥ ¬¥­î.
4) Ctrl+R - ®¡­®¢¨âì ᮤ¥à¦¨¬®£® ¤¨à¥ªâ®à¨¨.
5) Backspace (áâ५ª  ¢«¥¢® à冷¬ á Insert) - ¢ë室 ¨§ ¤¨à¥ªâ®à¨¨.
6) Insert - ¢ë¤¥«¥­¨¥ ªà á­ë¬ 梥⮬ ä ©«  ­  ª®â®à®¬ ­ å®¤¨âáï ªãàá®à ¨ ¯¥à¥¬¥é¥­¨¥ ªãàá®à  ­  1 ¯®§¨æ¨î ¢­¨§.
7) Ctrl+A ¨ Ctrl+(NumPad(+) Up) - ¢ë¤¥«¥­¨¥ ¢á¥å ä ©«®¢ ¨ ¤¨à¥ªâ®à¨© ¢  ªâ¨¢­®© ¯ ­¥«¨, §  ¨áª«î祭¨¥¬ ¤¨à¥ªâ®à¨¨ '..'
8) Ctrl+(NumPad(-) Up) - á­ïâì ¢ë¤¥«¥­¨¥ ¢á¥å ä ©«®¢ ¨ ¤¨à¥ªâ®à¨© ¢  ªâ¨¢­®© ¯ ­¥«¨, §  ¨áª«î祭¨¥¬ ¤¨à¥ªâ®à¨¨ '..'
9) Ctrl+(NumPad(*) Up) - ¨­¢¥àâ¨à®¢ âì ¢ë¤¥«¥­¨¥ ¢á¥å ä ©«®¢ ¨ ¤¨à¥ªâ®à¨© ¢  ªâ¨¢­®© ¯ ­¥«¨, §  ¨áª«î祭¨¥¬ ¤¨à¥ªâ®à¨¨ '..'
10) Esc - § ¢¥à襭¨¥ à ¡®âë ¯à®£à ¬¬ë, ¡¥§ ®âªàëâ¨ï ä ©« .

View File

@ -0,0 +1,345 @@
;---------------------------------------------------------------------
RAW1_processing:
; mov ebx,[raw_pointer]
; mov eax,[ebx+16]
; mov [raw_pointer],eax
; jmp convert.all_ok
xor eax,eax
mov [Repeat_N],eax
inc eax
mov [RAW1_flag],al
mov ebx,[raw_pointer]
mov [RAW1_pointer],ebx
mov eax,[ebx+4]
mov [Total_Repeat_N],eax
cmp eax,1
jne @f
xor eax,eax
mov [RAW1_flag],al
@@:
; mov [test1],eax
mov eax,[ebx+8]
mov [img_width],eax
mov [img_width_2],eax
; mov [test1],eax
mov ecx,[ebx+12]
mov [img_high],ecx
mov [img_high_2],ecx
; mov [test2],ecx
imul ecx,eax
; mov eax,ecx
; shl ecx,1
; add ecx,eax
shl ecx,2
add ecx,256*4
add ecx,44
push ecx
mcall 68,12
mov [raw_pointer],eax
mov ebx,[RAW1_pointer]
mov ecx,[ebx+8]
mov [eax+4],ecx ; x
mov ecx,[ebx+12]
mov [eax+8],ecx ; y
mov [eax+12],dword 32 ;8
mov [eax+20],dword 44
mov [eax+24],dword 1024
mov [eax+28],dword 44+1024
; mov [eax+32],
; mov [img_palette],eax
add eax,44+1024
mov [soi],eax
pop ecx
cmp [Total_Repeat_N],1
je @f
sub ecx,44+1024
mov [RAW1_size],ecx
mov edi,[soi]
mov eax,-1
shr ecx,2
cld
rep stosd
mov ecx,[RAW1_size]
mcall 68,12
mov [previous_frame_pointer],eax
@@:
mov [img_resolution_2],8
mov [img_resolution],32
call copy_next_frame
; inc [Repeat_N]
; call copy_next_frame
; inc [Repeat_N]
; call copy_next_frame
; mov [Repeat_N],0
jmp convert.img_resolution_ok
;---------------------------------------------------------------------
copy_next_frame:
mov eax,[RAW1_pointer]
mov ebx,[eax+8]
mov [RAW1_size_x],ebx
mov eax,[Repeat_N]
shl eax,4
; eax = (start of current Repeat_N) - 16
add eax,[RAW1_pointer]
mov esi,[eax+16]
; esi = pointer to current RAW
; mov ebx,[RAW1_pointer]
mov edi,[RAW1_size_x] ;[ebx+8]
mov ebx,[eax+24]
shl ebx,2
imul edi,ebx
mov ebx,[eax+20]
shl ebx,2
add edi,ebx
; add edi,[raw_pointer]
; add edi,44
add edi,[soi]
; edi = pointer to start for current frame
mov ebx,[eax+28]
test bx,bx
jnz @f
; inc ebx
mov bx,10
@@:
mov [Frame_delay],bx
shr ebx,16
mov [Transp_index],bh
mov al,bl
shr al,2
and al,111b
mov [Disposal_Method],al
; cmp al,2
; jne @f
; call save_previous_frame
;@@:
cmp al,3
jne @f
call save_previous_frame
@@:
and bl,1b
mov [Transp_flag],bl
mov ebx,[esi+4] ; X size og current frame
mov ecx,[esi+8] ; Y size og current frame
mov eax,[esi+20]
add eax,esi
mov [img_palette],eax
pusha
mov ebx,[raw_pointer]
mov edi,[ebx+20]
add edi,ebx
mov esi,eax
mov ecx,256
xor eax,eax
cld
rep movsd
popa
mov eax,[esi+28]
add esi,eax
.y:
push edi
push ebx
.x:
cld
lodsb
cmp [Transp_flag],0
je @f
cmp [Transp_index],al
jne @f
; cmp [Disposal_Method],2
; jne .not_disposal_backgr
; mov [edi],dword -1 ; 0xff
; inc edi
;.not_disposal_backgr:
add edi,4
jmp .no_store
@@:
push ebx edi
mov ebx,[raw_pointer]
mov edi,[ebx+20]
add edi,ebx
and eax,0xff
shl eax,2
add edi,eax
mov eax,[edi]
pop edi ebx
stosd
.no_store:
dec ebx
jnz .x
pop ebx
pop edi
mov eax,[RAW1_size_x]
shl eax,2
add edi,eax
dec ecx
jnz .y
inc [Repeat_N]
mov eax,[Repeat_N]
; mov [test2],eax
cmp [Total_Repeat_N],eax
ja @f
xor eax,eax
mov [Repeat_N],eax
@@:
mcall 26,9
movzx ebx,word [Frame_delay]
add eax,ebx
mov [Animation_timer],eax
ret
;---------------------------------------------------------------------
animation_handler:
mcall 23,1
; pusha
; mcall 26,9
; cmp [Animation_timer],eax
; ja @f
; call .draw_image
;@@:
; popa
cmp [open_file_flag],1
je kopen_1
cmp [sort_directory_flag],byte 1
je red_sort_directory
cmp [redraw_flag],byte 1
je redraw_window
cmp eax,1 ; ïåðåðèñîâàòü îêíî ?
je red ; åñëè äà - íà ìåòêó red
cmp eax,2 ; íàæàòà êëàâèøà ?
je key ; åñëè äà - íà key
cmp eax,3 ; íàæàòà êíîïêà ?
je button ; åñëè äà - íà button
cmp eax,6
je mouse
mcall 26,9
cmp [Animation_timer],eax
ja animation_handler ;@f
.1:
call .draw_image
; mov eax,[scaling_mode]
; jmp zoom_plus.2
jmp still
;@@:
; mcall 23,1
; jmp still.1
;---------------------------------------------------------------------
.draw_image:
; mov eax,[Repeat_N]
; test eax,eax
; jz .first_frame
mov al,[Disposal_Method]
cmp al,2
jne @f
call restore_background
jmp .first_frame
@@:
cmp al,3
jne @f
call restore_previous_frame
@@:
.first_frame:
call copy_next_frame
mov [no_fill],1
call drawimage
mov [no_fill],0
ret
;---------------------------------------------------------------------
restore_background:
; cmp [Transp_flag],0
; je @f
; pusha
; mov edi,[soi]
; mov eax,[fill_color] ; -1
; mov ecx,[RAW1_size]
; shr ecx,2
; cld
; rep stosd
; popa
; ret
;@@:
pusha
mov eax,[Repeat_N]
test eax,eax
jz @f
dec eax
@@:
shl eax,4
; eax = (start of current Repeat_N) - 16
add eax,[RAW1_pointer]
mov esi,[eax+16]
; esi = pointer to current RAW
mov edi,[RAW1_size_x] ;[ebx+8]
mov ebx,[eax+24]
shl ebx,2
imul edi,ebx
mov ebx,[eax+20]
shl ebx,2
add edi,ebx
add edi,[soi]
; edi = pointer to start for current frame
mov ebx,[esi+4] ; X size og current frame
mov ecx,[esi+8] ; Y size og current frame
.y:
push edi
push ebx
mov eax,[fill_color]
.x:
cld
stosd
dec ebx
jnz .x
pop ebx
pop edi
mov eax,[RAW1_size_x]
shl eax,2
add edi,eax
dec ecx
jnz .y
popa
ret
;---------------------------------------------------------------------
restore_previous_frame:
pusha
mov esi,[previous_frame_pointer]
mov edi,[soi]
mov ecx,[RAW1_size]
shr ecx,2
cld
rep movsd
popa
ret
;---------------------------------------------------------------------
save_previous_frame:
pusha
mov esi,[soi]
mov edi,[previous_frame_pointer]
mov ecx,[RAW1_size]
shr ecx,2
cld
rep movsd
popa
ret
;---------------------------------------------------------------------

View File

@ -0,0 +1,5 @@
@echo lang fix en >lang.inc
@fasm -m 16384 zSea.asm zSea
@erase lang.inc
@kpack zSea
@pause

View File

@ -0,0 +1,9 @@
#!/bin/bash
# This script does for linux the same as build.bat for DOS
echo "lang fix en"
echo "lang fix en" > lang.inc
fasm -m 65536 zSea.asm zSea
@kpack zSea
rm -f lang.inc
read
exit 0

View File

@ -0,0 +1,17 @@
;---------------------------------------------------------------------
clear_thread:
call get_memory_for_tread_stack
mov [clear_thread_stack],eax
mcall 51, 1, clear_thread_start ;, clear_thread_stack
ret
;---------------------------------------------------------------------
clear_thread_start:
mcall 5,100
@@:
mcall 23,10
cmp eax,5
je @f
mcall 15,3
mcall 68,13,[clear_thread_stack]
mcall -1
;---------------------------------------------------------------------

View File

@ -0,0 +1 @@
__CPU_type fix p5

View File

@ -0,0 +1,258 @@
;---------------------------------------------------------------------
convert_plugin_invoke:
mov eax,[plugin_0_name]
call prepare_convert
push eax
call [Convert_plugin_0.Start]
call check_convert
;-------------------------------
mov eax,[plugin_1_name]
call prepare_convert
push eax
call [Convert_plugin_1.Start]
call check_convert
;-------------------------------
mov eax,[plugin_2_name]
call prepare_convert
push eax
call [Convert_plugin_2.Start]
call check_convert
;-------------------------------
mov eax,[plugin_3_name]
call prepare_convert
push eax
call [Convert_plugin_3.Start]
call check_convert
;-------------------------------
mov eax,[plugin_4_name]
call prepare_convert
push eax
call [Convert_plugin_4.Start]
call check_convert
;-------------------------------
mov eax,[plugin_5_name]
call prepare_convert
push eax
call [Convert_plugin_5.Start]
call check_convert
;-------------------------------
mov eax,[plugin_6_name]
call prepare_convert
push eax
call [Convert_plugin_6.Start]
call check_convert
;-------------------------------
mov eax,[plugin_7_name]
call prepare_convert
push eax
call [Convert_plugin_7.Start]
call check_convert
;-------------------------------
mov eax,[plugin_8_name]
call prepare_convert
push eax
call [Convert_plugin_8.Start]
mov eax,[return_code]
call check_convert
;-------------------------------
mov eax,[plugin_9_name]
call prepare_convert
push eax
call [Convert_plugin_9.Start]
;-------------------------------
.end:
mov ecx,[image_file]
mcall 68, 13,
ret
;---------------------------------------------------------------------
prepare_convert:
cmp eax,dword 'NoKe'
je .1 ;@f
xor eax,eax
mov [return_code],eax
mov eax,image_file
ret
.1:
add esp,4
jmp convert_plugin_invoke.end
;---------------------------------------------------------------------
check_convert:
mov eax,[return_code]
test eax,eax
jz prepare_convert.1
cmp eax,dword 2
je prepare_convert.1
ret
;---------------------------------------------------------------------
convert:
xor eax,eax
cmp [error_fs],eax
jnz .error
call convert_plugin_invoke
cmp [return_code],dword 0
je .all_ok
xor eax,eax
;-------------------------------
.error_1:
mov [img_size],eax
mov [img_width],eax
mov [img_width_2],eax
mov [img_high],eax
mov [img_high_2],eax
mov [img_resolution],eax
mov [img_resolution_2],eax
mov [img_palette],eax
mov [soi],eax
mov [file_name],eax
mov [Total_Repeat_N],eax
mov [RAW1_pointer],eax
mov [RAW1_flag],al
mov [scaling_mode],dword 100
call error_window
ret
;-------------------------------
.error:
xor eax,eax
mov [return_code],eax
jmp .error_1
;-------------------------------
.all_ok:
mov ebx,[raw_pointer]
cmp [ebx],dword 'RAW1'
je RAW1_processing
xor eax,eax
mov [RAW1_flag],al
mov [RAW1_pointer],eax
inc eax
mov [Total_Repeat_N],eax
mov eax,[ebx+4]
mov [img_width],eax
mov [img_width_2],eax
mov eax,[ebx+8]
mov [img_high],eax
mov [img_high_2],eax
mov eax,[ebx+12]
mov [img_resolution_2],eax
; mov eax,[ebx+20]
; add eax,ebx
; mov [img_palette],eax
; mov eax,[ebx+28]
; add eax,ebx
; mov [soi],eax
;-------------------------------
; xor eax,eax
; mov [raw_pointer_2],eax
mov eax,image_file
; call [plugin_convert]
call [convert_Start]
mov ebx,[raw_pointer]
mov eax,[ebx+12]
; cmp [ebx+18],word 2
; jne @f
; shr eax,1
;@@:
cmp eax,15
jne @f
inc eax
@@:
mov [img_resolution],eax
mov eax,[ebx+20]
add eax,ebx
mov [img_palette],eax
mov eax,[ebx+28]
add eax,ebx
mov [soi],eax
; mov eax,[raw_pointer_2]
; test eax,eax
; jz @f
; mov [soi],eax
;@@:
;-------------------------------
; mov eax,[img_resolution]
; cmp eax,32
; ja @f
; cmp [ebx+18],word 2
; je @f
; cmp [ebx+18],word 1
; jne .img_resolution_ok
;.grayscale_16:
; cmp eax,16
; jne .img_resolution_ok
; shr eax,1
; mov [img_resolution],eax
; jmp .img_resolution_ok
;@@:
; shr eax,1
; cmp eax,16
; jne @f
; shr eax,1
;@@:
; mov [img_resolution],eax
.img_resolution_ok:
xor eax,eax
mov [scroll_bar_data_vertical.position],eax
mov [scroll_bar_data_horizontal.position],eax
call get_window_param
test [window_status],1b
jnz .end
cmp [scaling_mode],dword 100
jne .end
mov ebx,[img_high]
mov eax,[img_width]
test ebx, ebx
jns @f
neg ebx
@@:
add eax,9
cmp eax,770
jae @f
mov eax,770
@@:
add ebx,54
cmp ebx,150
jae @f
mov ebx,150
@@:
mov [wnd_width],eax
mov [wnd_height],ebx
mcall 14
mov ebx,eax
and eax,0xffff
shr ebx,16
inc eax
inc ebx
cmp eax,[wnd_height]
jae @f
xor eax,eax
mov ax,[scroll_bar_data_vertical.size_x]
add [wnd_width],eax
@@:
cmp ebx,[wnd_width]
jae @f
xor eax,eax
mov ax,[scroll_bar_data_horizontal.size_y]
add [wnd_height],eax
@@:
mov eax,[wnd_width]
mov ebx,[wnd_height]
test [bWasDraw],1
jz @f
mov esi,ebx
mov edx,eax
mcall 67,-1,-1
@@:
.end:
ret
;---------------------------------------------------------------------

View File

@ -0,0 +1,102 @@
string:
; rb string+257-$
rb 4096
;string_1:
; rb 4096
;----------------------
path:
rb 4096
;----------------------
;plugin_pach_1:
; rb 4096
;----------------------
plugin_pach:
rb 4096
;----------------------
library_path:
rb 4096
;----------------------
Filter:
rb 4096
;----------------------
Help_path:
rb 1024 ;4096
;----------------------
Editor_path:
rb 1024 ;4096
;----------------------
OpenDialog_path:
rb 1024 ;4096
;----------------------
key_help_name:
rb 128
;----------------------
plugin_0_name:
rb 128
plugin_1_name:
rb 128
plugin_2_name:
rb 128
plugin_3_name:
rb 128
plugin_4_name:
rb 128
plugin_5_name:
rb 128
plugin_6_name:
rb 128
plugin_7_name:
rb 128
plugin_8_name:
rb 128
plugin_9_name:
rb 128
;----------------------
file_name:
rb 1024
;----------------------
temp_area:
rb 4096
;----------------------
procinfo:
process_info:
rb 1024
;----------------------
procinfo_threads:
rb 1024
;----------------------
; clear bacground thread
; rb 512
;clear_thread_stack:
;----------------------
; window option
; rb 1024 ;4096
;thread_stack_7:
;----------------------
; window error message
; rb 1024 ;4096
;thread_stack_6:
;----------------------
; window set sort mode
; rb 1024 ;4096
;thread_stack_5:
;----------------------
; window background
; rb 1024 ;4096
;thread_stack_4:
;----------------------
; window about
; rb 1024 ;4096
;thread_stack_3:
;----------------------
; file info
; rb 1024 ;4096
;thread_stack_2:
;----------------------
; file open
; rb 1024 ;4096
;thread_stack:
;----------------------
rb 4096
stacktop:
;----------------------

1710
programs/media/zsea/data.inc Normal file

File diff suppressed because it is too large Load Diff

144
programs/media/zsea/dll.inc Normal file
View File

@ -0,0 +1,144 @@
;-----------------------------------------------------------------------------
proc dll.Load, import_table:dword
mov esi,[import_table]
.next_lib:
mov edx,[esi]
or edx,edx
jz .exit
push esi
mov esi,[esi+4]
mov edi,s_libdir.fname
@@:
lodsb
stosb
or al,al
jnz @b
mcall 68,19,s_libdir
or eax,eax
jz .fail
stdcall dll.Link,eax,edx
stdcall dll.Init,[eax+4]
pop esi
add esi,8
jmp .next_lib
.exit:
xor eax,eax
ret
.fail:
add esp,4
xor eax,eax
inc eax
ret
endp
;-----------------------------------------------------------------------------
proc dll.Link, exp:dword,imp:dword
push eax
mov esi,[imp]
test esi,esi
jz .done
.next:
lodsd
test eax,eax
jz .done
stdcall dll.GetProcAddress,[exp],eax
or eax,eax
jz @f
mov [esi-4],eax
jmp .next
@@:
mov dword[esp],0
.done:
pop eax
ret
endp
;-----------------------------------------------------------------------------
proc dll.Init, dllentry:dword
pushad
mov eax,mem.Alloc ;libini_alloc
mov ebx,mem.Free ;libini_free
mov ecx,mem.ReAlloc ;libini_realloc
mov edx,dll.Load
stdcall [dllentry]
popad
ret
endp
;-----------------------------------------------------------------------------
proc dll.GetProcAddress, exp:dword,sz_name:dword
mov edx,[exp]
xor eax,eax
.next:
or edx,edx
jz .end
cmp dword[edx],0
jz .end
stdcall strcmp,[edx],[sz_name]
test eax,eax
jz .ok
add edx,8
jmp .next
.ok:
mov eax,[edx+4]
.end:
ret
endp
;-----------------------------------------------------------------------------
proc strcmp, str1:dword,str2:dword
push esi edi
mov esi,[str1]
mov edi,[str2]
xor eax,eax
@@:
lodsb
scasb
jne .fail
or al,al
jnz @b
jmp .ok
.fail:
or eax,-1
.ok:
pop edi esi
ret
endp
;-----------------------------------------------------------------------------
s_libdir:
db '/sys/lib/'
.fname rb 32
;-----------------------------------------------------------------------------
proc mem.Alloc,size
push ebx ecx
mov ecx,[size]
mcall 68,12
pop ecx ebx
ret
endp
;-----------------------------------------------------------------------------
proc mem.ReAlloc,mptr,size
push ebx ecx edx
mov ecx,[size]
or ecx,ecx
jz @f
@@:
mov edx,[mptr]
or edx,edx
jz @f
@@:
mcall 68,20
or eax,eax
jz @f
@@:
pop edx ecx ebx
ret
endp
;-----------------------------------------------------------------------------
proc mem.Free,mptr
push ebx ecx
mov ecx,[mptr]
or ecx,ecx
jz @f
@@:
mcall 68,13
pop ecx ebx
ret
endp
;-----------------------------------------------------------------------------

View File

@ -0,0 +1,469 @@
;;****************************************************************************
;****************************************************************************
; Draw output part of the image and SCROLLBAR's
;****************************************************************************
;****************************************************************************
drawimage:
call get_window_param
;mov edx,5*65536+50
mov edx,0*65536+28
mov esi,[img_resolution] ;24
cmp esi,32
ja .exit_error ;.exit
mov edi,[img_palette]
;****************************************************************************
; Calculation of sizes of an output part of the image
;****************************************************************************
xor eax,eax
mov [draw_SB],al
mov [draw_SB1],al
mov eax,[window_width]
; sub eax,9
mov [wa_width],ax
mov [wa_width_1],ax
mov [wa_width_2],ax
mov ebx,[img_width]
test ebx,ebx
jz .exit_error ;.exit
cmp ax,bx
jae @f
sub ax,[scroll_bar_data_vertical.size_x]
mov [draw_SB],1
jmp .size_y
@@:
mov ax,bx
.size_y:
mov ebx,[img_high]
test ebx,ebx
jz .exit_error ;.exit
shl eax,16
add eax,[window_high]
cmp ax,50-22
jbe @f
sub ax,50-22
@@:
mov [wa_high],ax
mov [wa_high_1],ax
mov [wa_high_2],ax
cmp ax,bx
jae @f
sub ax,[scroll_bar_data_horizontal.size_y]
mov [draw_SB1],1
jmp .continue
@@:
mov ax,bx
.continue:
mov ecx,eax
;****************************************************************************
;
;****************************************************************************
cmp [draw_SB1],1
je @f
cmp [draw_SB],0
je @f
ror ecx,16
add cx,[scroll_bar_data_vertical.size_x]
rol ecx,16
@@:
cmp [draw_SB],1
je @f
cmp [draw_SB1],0
je @f
add cx,[scroll_bar_data_horizontal.size_y]
@@:
; call check_8bit_less
;.continue_1:
;****************************************************************************
; Prepare of data for SCROLLBAR's
;****************************************************************************
call correct_cur_area
mov eax,[img_width]
push edx
imul eax,[scaling_mode]
mov ebx,100
xor edx,edx
div ebx
mov [scroll_bar_data_horizontal.max_area],eax
pop edx
mov ebx,[img_high]
push eax edx
mov eax,ebx
imul eax,[scaling_mode]
mov ebx,100
xor edx,edx
div ebx
mov ebx,eax
pop edx eax
mov [scroll_bar_data_vertical.max_area],ebx
; cmp [scaling_mode],100
; jne .continue_1
call correct_width
call correct_cur_area
cmp [correct_w],0
je @f
call correct_high
call correct_cur_area
jmp .continue_1
@@:
call correct_high
call correct_cur_area
cmp [correct_h],0
je @f
call correct_width
call correct_cur_area
@@:
; call check_8bit_less
.continue_1:
; mov eax,[window_high]
; sub eax,55
; ror eax,16
; mov ax,dx
; rol eax,16
mov eax,edx
shl eax,16
mov ax,cx
mov [scroll_bar_data_vertical.y],eax
; mov eax,[window_width]
; sub eax,10
; ror eax,16
; ror edx,16
; mov ax,dx
; rol edx,16
; rol eax,16
mov eax,edx
mov ebx,ecx
shr ebx,16
mov ax,bx
mov [scroll_bar_data_horizontal.x],eax
; mov eax,edx
; mov ebx,ecx
; shr ebx,16
; shr eax,16
; add ax,bx
mov eax,[window_width]
sub ax,[scroll_bar_data_vertical.size_x]
; sub ax,4
mov [scroll_bar_data_vertical.start_x],ax
; mov eax,edx
; add ax,cx
mov eax,[window_high]
sub ax,[scroll_bar_data_horizontal.size_y]
; sub ax,4
mov [scroll_bar_data_horizontal.start_y],ax
;****************************************************************************
; Check necessity prepare of data
;****************************************************************************
mov eax,[scroll_bar_data_horizontal.max_area]
mov ebx,[scroll_bar_data_vertical.max_area]
cmp ebx,[scroll_bar_data_vertical.cur_area]
ja @f
cmp eax,[scroll_bar_data_horizontal.cur_area]
ja @f
mov ebp,0
mov ebx,[soi]
jmp .end
@@:
;****************************************************************************
; Calculate offset of next row data relative to previous row data
;****************************************************************************
mov ebp,eax
mov ebx,ecx
shr ebx,16
sub ebp,ebx
imul ebp,esi
mov eax,ebp
shr ebp,3
;****************************************************************************
; Vertical SCROLLBAR
; At a case of resizing of the window
; Check the position of a runner has crossed a limit
;****************************************************************************
mov eax,[scroll_bar_data_vertical.max_area]
sub eax,[scroll_bar_data_vertical.cur_area]
cmp eax,[scroll_bar_data_vertical.position]
jae @f
mov [scroll_bar_data_vertical.position],eax
@@:
;****************************************************************************
; Horizontal SCROLLBAR
; At a case of resizing of the window
; Check the position of a runner has crossed a limit
;****************************************************************************
mov eax,[scroll_bar_data_horizontal.max_area]
sub eax,[scroll_bar_data_horizontal.cur_area]
cmp eax,[scroll_bar_data_horizontal.position]
jae @f
mov [scroll_bar_data_horizontal.position],eax
@@:
;****************************************************************************
; Calculate offset from a beginning of a image
;****************************************************************************
mov ebx,[scroll_bar_data_horizontal.max_area]
imul ebx,esi
mov eax,ebx
shr ebx,3
imul ebx,[scroll_bar_data_vertical.position]
mov eax,[scroll_bar_data_horizontal.position]
imul eax,esi
shr eax,3
add ebx,eax
add ebx,[soi]
.end:
cmp [soi],0
je .exit_error ;.exit
;****************************************************************************
; Draw image
;****************************************************************************
cmp [img_resolution_2],15
jne @f
mov esi,15
@@:
mov [image_start_coordinates],edx
mov [image_draw_size],ecx
cmp [scaling_mode],dword 100
je .100
cmp [scaling_mode],dword 0
jne @f
call scaling.1
ret
@@:
mov [correct_scrollbar_100_flag],0
call zoom_all
ret
.100:
mov al,[correct_scrollbar_100_flag]
test al,al
jnz @r
;******************************
mov eax,wa_width_1
mov eax,[eax]
push eax
mov eax,wa_high_1
mov eax,[eax]
push eax
;******************************
rol ecx,16
mov eax,[scroll_bar_data_vertical.max_area]
cmp eax,[scroll_bar_data_vertical.cur_area]
mov ax,[wa_width_1]
jbe @f
sub ax,[scroll_bar_data_vertical.size_x]
mov [wa_width_1],ax
@@:
sub ax,cx
mov [wa_width_2],cx
ror ecx,16
shr ax,1
shl eax,16
add edx,eax
shr eax,16
test eax,eax
jz @f
call scaling.fill_for_L_R
@@:
mov eax,[scroll_bar_data_horizontal.max_area]
cmp eax,[scroll_bar_data_horizontal.cur_area]
mov ax,[wa_high_1]
jbe @f
sub ax,[scroll_bar_data_horizontal.size_y]
mov [wa_high_1],ax
@@:
sub ax,cx
mov [wa_high_2],cx
shr ax,1
add edx,eax
test eax,eax
jz @f
call scaling.fill_for_U_D
@@:
;******************************
mcall 65, ;[soi]
;******************************
pop eax
mov ebx,wa_high_1
mov [ebx],eax
pop eax
mov ebx,wa_width_1
mov [ebx],eax
;******************************
.exit:
call draw_file_name_to_work_area
ret
.exit_error:
xor eax,eax
mov [scroll_bar_data_vertical.cur_area],eax
mov [scroll_bar_data_horizontal.cur_area],eax
ret
;****************************************************************************
draw_file_name_to_work_area:
mov eax,[check1+32]
test eax,10b
jz @f
mov ebx,[file_name_length]
mov eax,ebx
lea ebx,[ebx*5]
add ebx,eax
add ebx,13 shl 16
mcall 13,,<59,11>,0xe5e5e5
mcall 4,<16,60>,0x80000000,file_name,,0xe5e5e5
@@:
ret
;****************************************************************************
;check_8bit_less:
; cmp esi,8
; jae .no_8bit_less
; mov eax,ecx
; ror eax,16
;; mov ebx,eax
; xor ecx,ecx
;
; inc ecx
; shr ax,1
;
; cmp esi,4
; je @f
;
; inc ecx
; shr ax,1
;
; cmp esi,2
; je @f
;
; inc ecx
; shr ax,1
;@@:
;; test ebx,ecx
;; jz @f
;; inc eax
;;@@:
; shl ax,cl
; rol eax,16
; mov ecx,eax
;.no_8bit_less:
; ret
;****************************************************************************
correct_width:
mov [correct_w],0
mov ebx,[scroll_bar_data_vertical.max_area]
cmp ebx,[scroll_bar_data_vertical.cur_area]
jbe @f
mov eax,ecx
shr eax,16
push eax
mov ax,[scroll_bar_data_vertical.size_x]
sub [wa_width],ax
pop eax
cmp [wa_width],ax
jae @f
ror ecx,16
mov cx,[wa_width]
rol ecx,16
mov [correct_w],1
@@:
ret
;****************************************************************************
correct_high:
mov [correct_h],0
mov eax,[scroll_bar_data_horizontal.max_area]
cmp eax,[scroll_bar_data_horizontal.cur_area]
jbe @f
push eax
mov ax,[scroll_bar_data_horizontal.size_y]
sub [wa_high],ax
pop eax
cmp [wa_high],cx
jae @f
mov cx,[wa_high]
mov [correct_h],1
@@:
ret
;****************************************************************************
correct_cur_area:
mov eax,ecx
xor ebx,ebx
mov bx,ax
mov [scroll_bar_data_vertical.cur_area],ebx
shr eax,16
mov [scroll_bar_data_horizontal.cur_area],eax
ret
;****************************************************************************
; Check draw vertical scrollbar
;****************************************************************************
draw_scrollbars:
xor eax,eax
mov [draw_scrollbar_counter],eax
mov eax,[scroll_bar_data_vertical.max_area]
cmp eax,[scroll_bar_data_vertical.cur_area]
jbe @f
cmp [scroll_bar_data_vertical.cur_area],0
je @f
push dword scroll_bar_data_vertical
call [scrollbar_ver_draw]
; draw_scroll_bar_vertical scroll_bar_data_vertical
inc [draw_scrollbar_counter]
@@:
;****************************************************************************
; Check draw horizontal scrollbar
;****************************************************************************
mov eax,[scroll_bar_data_horizontal.max_area]
cmp eax,[scroll_bar_data_horizontal.cur_area]
jbe @f
cmp [scroll_bar_data_horizontal.cur_area],0
je @f
push dword scroll_bar_data_horizontal
call [scrollbar_hor_draw]
; draw_scroll_bar_horizontal scroll_bar_data_horizontal
inc [draw_scrollbar_counter]
@@:
; nodrawimage:
cmp [draw_scrollbar_counter],2
jne @f
mov ebx,[scroll_bar_data_vertical.x]
mov ecx,[scroll_bar_data_horizontal.y]
mcall 13, , ,0xffffff
@@:
ret
;****************************************************************************
;debug_1:
; pushad
; mov eax,ecx
; shr eax,16
; mov ebx,ecx
; shl ebx,16
; shr ebx,16
; mov eax,[image_file]
; mov ebx,edi
; mov [temp_eax],eax
; mov [temp_ebx],ebx
; mcall 13,<90,500>,<2,20>,0
; mcall 47,0xa0000,[temp_eax],<100, 5>,0xffffff
; mcall 47,0xa0000,[temp_ebx],<300, 5>,0xffffff
; popad
; ret
;temp_eax dd 0
;temp_ebx dd 0
;****************************************************************************

View File

@ -0,0 +1,248 @@
; *********************************************
; ******* WINDOW DEFINITIONS AND DRAW ********
; *********************************************
draw_window:
or [bWasDraw],1
mcall 12,1
; DRAW WINDOW
xor eax,eax ; function 0 : define and draw window
; mov ebx,350 ; [x start] *65536 + [x size]
; mov ecx,400 ; [y start] *65536 + [y size]
mov ebx,0*65536+0
mov ecx,0*65536+0
add ebx,[wnd_width]
add ecx,[wnd_height]
cmp cx,55
ja @f
mov cx,55
@@:
mov edx,0x63ffffff ; color of work area RRGGBB,8->color gl
; pusha
xor esi,esi
mcall
; popa
; imul ecx,[load_file_number],304
; add ecx,32+40
; add ecx,[load_directory_pointer]
mov ecx,Authors_text.1 ; communication_area_name
; mov ecx,[communication_area]
; add ecx,4
; mov ecx,string
mcall 71,1, ;labelt ; plugin_pach ;file_name ;plugin_pach ;plugin_pach
call get_window_param
call draw_other
push dword menu_data_1
call [menu_bar_draw]
push dword menu_data_2
call [menu_bar_draw]
push dword menu_data_3
call [menu_bar_draw]
push dword menu_data_4
call [menu_bar_draw]
push dword menu_data_5
call [menu_bar_draw]
push dword menu_data_6
call [menu_bar_draw]
; draw_menu_bar menu_data_1
; draw_menu_bar menu_data_2
; draw_menu_bar menu_data_3
; draw_menu_bar menu_data_4
; draw_menu_bar menu_data_5
; draw_menu_bar menu_data_6
push dword dinamic_button_data_1
call [dinamic_button_draw]
push dword dinamic_button_data_2
call [dinamic_button_draw]
push dword dinamic_button_data_3
call [dinamic_button_draw]
push dword dinamic_button_data_4
call [dinamic_button_draw]
push dword dinamic_button_data_5
call [dinamic_button_draw]
push dword dinamic_button_data_6
call [dinamic_button_draw]
push dword dinamic_button_data_7
call [dinamic_button_draw]
push dword dinamic_button_data_8
call [dinamic_button_draw]
push dword dinamic_button_data_9
call [dinamic_button_draw]
push dword dinamic_button_data_10
call [dinamic_button_draw]
push dword dinamic_button_data_11
call [dinamic_button_draw]
push dword dinamic_button_data_12
call [dinamic_button_draw]
push dword dinamic_button_data_13
call [dinamic_button_draw]
push dword dinamic_button_data_14
call [dinamic_button_draw]
push dword dinamic_button_data_15
call [dinamic_button_draw]
; draw_dinamic_button dinamic_button_data_1 ; open file
; draw_dinamic_button dinamic_button_data_2 ; reload file
; draw_dinamic_button dinamic_button_data_3 ; left limit
; draw_dinamic_button dinamic_button_data_4 ; left arrow
; draw_dinamic_button dinamic_button_data_5 ; slide show
; draw_dinamic_button dinamic_button_data_6 ; right arrow
; draw_dinamic_button dinamic_button_data_7 ; right limit
; draw_dinamic_button dinamic_button_data_8 ; zoom +
; draw_dinamic_button dinamic_button_data_9 ; zoom -
; draw_dinamic_button dinamic_button_data_10 ; zoom 100%
; draw_dinamic_button dinamic_button_data_11 ; rotate clockwise
; draw_dinamic_button dinamic_button_data_12 ; rotate counter-clockwise
; draw_dinamic_button dinamic_button_data_13 ; file information
; draw_dinamic_button dinamic_button_data_14 ; wallpaper
; draw_dinamic_button dinamic_button_data_15 ; settings
mcall 13,<225,2>,<3,22>,0
mcall ,<280,2>
mcall ,<410,2>
mcall ,<490,2>
mcall ,<545,2>
mcall ,<625,2>
mcall ,<720,2>
; WINDOW LABEL
; mov esi, file_mount - file_mount_end
mcall 4,<630,3>,0x80000000, file_mount ;, file_mount - file_mount.end
; cmp [soi],0
; je @f
mcall 13,<677,40>,<13,11>,0xe5e5e5
mov ecx,[load_directory_pointer]
mov ecx,[ecx+4]
mcall 47,0x80060000, ,<679, 15>,0
mcall 8,[dinamic_button_data_5.x],[dinamic_button_data_5.y],0x40000002
;@@:
mcall 12,2
ret
;---------------------------------------------------------------------
set_draw_scrollbar_all:
xor eax,eax
inc eax
mov [scroll_bar_data_vertical.all_redraw],eax
mov [scroll_bar_data_horizontal.all_redraw],eax
ret
;---------------------------------------------------------------------
set_nodraw_scrollbar_all:
xor eax,eax
mov [scroll_bar_data_vertical.all_redraw],eax
mov [scroll_bar_data_horizontal.all_redraw],eax
ret
;---------------------------------------------------------------------
draw_other:
call drawimage
@@:
mov ebx,0 ;5
shl ebx,16
add ebx,[window_width]
; sub ebx,9
; push ebx
xor ecx,ecx
; mov ecx,[skin_high]
shl ecx,16
add ecx,50-22
; sub ecx,[skin_high]
mov edx,0xffffff
cmp [no_draw_window],0
jne @f
mcall 13 ; fill top area
@@:
mov eax,[soi]
test eax,eax
jnz @f
mov ecx,[window_high]
sub ecx,28 ;50+4
add ecx,(50-22) shl 16
mcall 13
@@:
call draw_number_of_file
call draw_zoom_factors
cmp [scaling_mode],dword 0
jne @f
; pop ebx
ret
@@:
; mov ecx,[scroll_bar_data_vertical.cur_area]
; mov ebx,[scroll_bar_data_horizontal.cur_area]
; push ecx
; add ebx,5
; mov ax,bx
; shl ebx,16
; add ebx,[window_width]
; sub ebx,4
; sub bx,ax
; cmp bx,0
; jbe @f
; add ecx,50 shl 16
; mcall 13, , ,0xffffff
;
;@@:
; pop ecx
; pop ebx
; add ecx,50
; mov ax,cx
; shl ecx,16
; add ecx,[window_high]
; sub cx,ax
; sub ecx,4
; cmp cx,0
; jbe @f
; mcall 13, , ,0xffffff
;@@:
call set_draw_scrollbar_all
call draw_scrollbars
call set_nodraw_scrollbar_all
ret
;---------------------------------------------------------------------
draw_number_of_file:
mcall 13,<630,42>,<13,11>,0xe5e5e5
xor ecx,ecx
mov eax,[load_directory_pointer]
cmp [eax+4],dword 0
je @f
mov ecx,[load_file_number]
inc ecx
@@:
mcall 47,0x80060000, ,<632, 15>,0
ret
;---------------------------------------------------------------------
draw_zoom_factors:
mcall 13,<725,30>,<13,11>,0xe5e5e5
mov ecx,[zoom_factors]
mov ecx,[ecx]
mov [scaling_mode],ecx
test ecx,ecx
jnz @f
mcall 4,<727,14>,0x80000000, zoom_auto_text
ret
@@:
mcall 47,0x80060000, ,<727, 15>,0
ret
;---------------------------------------------------------------------

View File

@ -0,0 +1,446 @@
;---------------------------------------------------------------------
full_screen:
xor eax,eax
mov [Repeat_N],eax
xor eax,eax
mov [press_Enter_flag],al
mov eax,[zoom_factors]
mov [zoom_factors_old],eax
mov eax,[scaling_mode]
mov [scaling_mode_old],eax
call get_window_param_1
mov eax,[window_start_x]
mov [window_start_x_old],eax
mov eax,[window_start_y]
mov [window_start_y_old],eax
mov eax,[window_high]
mov [window_high_old],eax
mov eax,[window_width]
mov [window_width_old],eax
;----------------------------------------
; get current work area
mcall 48,5
mov [work_area_LR_old],eax
mov [work_area_TB_old],ebx
;----------------------------------------
mov eax,[soi]
test eax,eax
jz still
mov eax,scaling_mode
xor ebx,ebx
mov [eax],ebx ;dword 0
mov [zoom_factors],dword zoom_factors.1
mcall 14
xor ebx,ebx
xor ecx,ecx
mov edx,eax
shr edx,16
xor esi,esi
mov si,ax
inc ax
mov [wa_high_1],ax
mov [wa_high_2],ax
shr eax,16
inc ax
mov [wa_width_1],ax
mov [wa_width_2],ax
mcall 67
;----------------------------------------
; set max work area
mov ecx,edx
mov dx,si
mcall 48,6
;----------------------------------------
mov eax,[fill_color]
mov [fill_color_old],eax
xor eax,eax
mov [fill_color],eax
jmp .still
;----------------------------------------
.red:
call .draw_window
.still:
cmp [RAW1_flag],1
je .animation_handler
mcall 10
cmp eax,1 ; ïåðåðèñîâàòü îêíî ?
je .red ; åñëè äà - íà ìåòêó red
cmp eax,2 ; íàæàòà êëàâèøà ?
je .key ; åñëè äà - íà key
cmp eax,3 ; íàæàòà êíîïêà ?
je .button ; åñëè äà - íà button
jmp .still ; åñëè äðóãîå ñîáûòèå - â íà÷àëî öèêëà
;----------------------------------------
.animation_handler:
mcall 23,1
; pusha
; mcall 26,9
; cmp [Animation_timer],eax
; ja @f
; call animation_handler.draw_image
;@@:
; popa
cmp eax,1 ; ïåðåðèñîâàòü îêíî ?
je .red ; åñëè äà - íà ìåòêó red
cmp eax,2 ; íàæàòà êëàâèøà ?
je .key ; åñëè äà - íà key
cmp eax,3 ; íàæàòà êíîïêà ?
je .button ; åñëè äà - íà button
mcall 26,9
cmp [Animation_timer],eax
ja .animation_handler
mov al,[Disposal_Method]
cmp al,2
jne @f
call restore_background
jmp .first_frame
@@:
cmp al,3
jne @f
call restore_previous_frame
@@:
.first_frame:
call copy_next_frame
mov [no_fill],1
call .draw_image
mov [no_fill],0
; call animation_handler.draw_image
jmp .still
;----------------------------------------
.key:
mcall 2
cmp [extended_key],1
je .extended_key
test al, al
jnz .still
cmp ah, 0xE0
jne @f
mov [extended_key],1
jmp .still
@@:
cmp ah,1 ; Esc
je .restore_main_window
cmp ah,156 ; Enter
je .restore_main_window_1
jmp .still
;----------------------------------------
.extended_key:
mov [extended_key],0
mov [current_key_code],ah
cmp ah,73
je move_to_left_1
cmp ah,81
je move_to_right_1
cmp ah,71
je left_limit_1
cmp ah,79
je right_limit_1
cmp ah,156 ; Enter
je .restore_main_window_1
cmp ah,183 ; Print Screen - Slides Show
je slide_show_1.3
jmp .still
;----------------------------------------
.button:
mcall 17
cmp ah,1 ; button id=1 ?
; je START.exit
; jmp .still ;red_1
jne .still
.exit:
call restore_work_area
jmp START.exit
;---------------------------------------------------------------------
.restore_main_window_1:
cmp [press_Enter_flag],1
je .restore_main_window
inc [press_Enter_flag]
jmp .still
;---------------------------------------------------------------------
.restore_main_window:
call restore_work_area
mov eax,[zoom_factors_old]
mov [zoom_factors],eax
mov eax,[scaling_mode_old]
mov [scaling_mode],eax
mov ebx,[window_start_x_old]
mov ecx,[window_start_y_old]
mov edx,[window_width_old]
mov esi,[window_high_old]
mcall 67
; call get_window_param
mov eax,[fill_color_old]
mov [fill_color],eax
xor eax,eax
mov [Repeat_N],eax
; mcall 15,3
mov [redraw_wallpaper_flag],1
jmp still ;red_1
;---------------------------------------------------------------------
.draw_window:
mcall 12,1
mcall 0,<0,800>,<0,600>,0x41000000,0,0
; call get_window_param_1
; mcall 8,0,0,1,0
call .draw_image
mcall 12,2
ret
;---------------------------------------------------------------------
.draw_image:
mcall 14
inc ax
mov [wa_high_1],ax
mov [wa_high_2],ax
shr eax,16
inc ax
mov [wa_width_1],ax
mov [wa_width_2],ax
mov [image_start_coordinates],0
mov [background_color],0
call scaling.1
mov [background_color],0xffffff
ret
;---------------------------------------------------------------------
get_window_param_1:
mcall 9, procinfo, -1
mov eax,[ebx+34]
mov [window_start_x],eax
mov eax,[ebx+38]
mov [window_start_y],eax
mov eax,[ebx+46]
mov [window_high],eax
mov eax,[ebx+42]
mov [window_width],eax
mov eax,[ebx+70]
mov [window_status],eax
ret
;----------------------------------------
restore_work_area:
; restore old work area
mov ecx,[work_area_LR_old]
mov edx,[work_area_TB_old]
mcall 48,6
ret
;---------------------------------------------------------------------
move_to_left_1:
xor eax,eax
cmp [load_file_number],eax
je full_screen.still
dec [load_file_number]
jmp right_limit_1.2
;----------------------------------------
move_to_right_1:
mov eax,[load_directory_pointer]
mov eax,[eax+4]
test eax,eax
jz @f
dec eax
@@:
cmp [load_file_number],eax
je full_screen.still
inc [load_file_number]
jmp right_limit_1.2
;----------------------------------------
left_limit_1:
xor eax,eax
jmp right_limit_1.1
;----------------------------------------
right_limit_1:
mov eax,[load_directory_pointer]
mov eax,[eax+4]
test eax,eax
jz @f
dec eax
@@:
.1:
cmp [load_file_number],eax
je full_screen.still
mov [load_file_number],eax
.2:
imul ebx,[load_file_number],304
add ebx,32+40
add ebx,[load_directory_pointer]
mov esi,string
mov edi,plugin_pach
call copy_file_path
mov esi,plugin_pach
mov edi,string
mov ecx,4096/4
cld
rep movsd
; jmp kopen
mov [open_file_flag],0
mov ecx,-1
call getappinfo
call load_image
test eax,eax
jnz kopen_1.err
call convert
call load_directory.copy_dir_path
; call get_window_param
; test [window_status],1b
; jz @f ;draw_still
; mov [no_draw_window],1
;*** call draw_other
; mov [no_draw_window],0
; jmp .3
;
;@@:
; call .draw_window
call full_screen.draw_image
.3:
mov al,[old_key_code]
mov ah,[current_key_code]
mov [old_key_code],ah
cmp al,ah
jne full_screen.still ;key.extended_key ;still
.still:
mcall 2
cmp [extended_key],1
je .extended_key
test al, al
jnz full_screen.still
cmp ah, 0xE0
jne @f
mov [extended_key],1
jmp .still
@@:
jmp full_screen.still
.extended_key:
mov [extended_key],0
mov [current_key_code],ah
jmp .3
.4:
mov ah,[current_key_code]
mov [old_key_code],ah
jmp full_screen.extended_key ;key.extended_key
;---------------------------------------------------------------------
slide_show_1:
mov eax,[load_directory_pointer]
cmp [eax+4],dword 1
jbe full_screen.still
mcall 26,9
cmp [timer],eax
jbe .1
jmp .still
.red:
call full_screen.draw_window
.still:
mcall 23,10
cmp eax,1
je .red
cmp eax,2
je .key
cmp eax,3
je .button
; mcall 68,1
jmp slide_show_1
;-------------------------------------------
.key:
mcall 2
cmp [extended_key],1
je .extended_key
test al, al
jnz .still
cmp ah, 0xE0
jne @f
mov [extended_key],1
jmp .still
@@:
cmp ah,1 ; Esc
je full_screen.still
cmp ah,185 ; Space
je full_screen.still
jmp .still
.extended_key:
mov [extended_key],0
mov [current_key_code],ah
jmp .still
;-------------------------------------------
.button: ; button
mov eax,17 ; get id
mcall
cmp ah,1 ; button id=1 ?
je full_screen.exit ;START.exit
.noclose:
cmp ah,2
je full_screen.still
jmp slide_show_1
;-------------------------------------------
.1:
; mcall 26,9
; add eax,[slide_show_delay] ;500
; mov [timer],eax
mov eax,[load_directory_pointer]
mov eax,[eax+4]
test eax,eax
jz @f
dec eax
@@:
cmp [load_file_number],eax
je full_screen.still
inc [load_file_number]
imul ebx,[load_file_number],304
add ebx,32+40
add ebx,[load_directory_pointer]
mov esi,string
mov edi,plugin_pach
call copy_file_path
mov esi,plugin_pach
mov edi,string
mov ecx,4096/4
cld
rep movsd
mov [open_file_flag],0
mov ecx,-1
call getappinfo
call load_image
test eax,eax
jnz kopen_1.err
call convert
; call get_window_param
; test [window_status],1b
; jz @f ;draw_still
; mov [no_draw_window],1
; call draw_other
; mov [no_draw_window],0
; jmp slide_show_1 ;.3
;@@:
; call draw_window
call load_directory.copy_dir_path
call full_screen.draw_image
; jmp slide_show_1
.3:
mcall 26,9
add eax,[slide_show_delay] ;500
mov [timer],eax
jmp slide_show_1
;---------------------------------------------------------------------

427
programs/media/zsea/key.inc Normal file
View File

@ -0,0 +1,427 @@
;---------------------------------------------------------------------
key: ; key
mcall 2
cmp [extended_key],1
je .extended_key
test al, al
jnz still
cmp ah, 0xE0
jne @f
mov [extended_key],1
jmp still
@@:
cmp ah,151 ; i - file information
je kinfo
cmp ah,152 ; o - application options
je check_key_O ;k_option
cmp ah,159 ; s - sort mode
je k_sort_directory
cmp ah,145 ; w - wallpaper
je k_background
cmp ah,183 ; * - scaling to window
je scaling
cmp ah,139 ; 0 - scaling to window
je scaling
cmp ah,202 ; "-" - zoom minus
je zoom_minus
cmp ah,140 ; "-" - zoom minus
je zoom_minus
cmp ah,206 ; "+" - zoom plus
je zoom_plus
cmp ah,141 ; "+" - zoom plus
je zoom_plus
cmp ah,171 ; "\" - zoom 100%
je no_scaling
cmp ah,72 ; up arrow
je key_up_arrow
cmp ah,80 ; down arrow
je key_down_arrow
cmp ah,75 ; left arrow
je key_left_arrow
cmp ah,77 ; right arrow
je key_right_arrow
cmp ah,28 ; Enter
je full_screen
cmp ah,187 ; F1
je select_menu ;key_alt_down
cmp ah,42
je key_shift_up
cmp ah,54
je key_shift_up
cmp ah,170
je key_shift_down
cmp ah,182
je key_shift_down
cmp ah,29
je key_ctrl_up
cmp ah,157
je key_ctrl_down
cmp ah,56
je key_alt_up
cmp ah,184
je key_alt_down
jmp still
.extended_key:
mov [extended_key],0
mov [current_key_code],ah
; push eax
; mcall 26,9
; mov [timer_counter],eax
; pop eax
; mov al,ah
; cmp al,130 ; 1
; je kfile
; cmp al,131 ; 2
; je kopen
; cmp al,132 ; 3
; je kinfo
; cmp al,133 ; 4
; je kbgrd
cmp ah,73
je move_to_left
cmp ah,81
je move_to_right
cmp ah,71
je left_limit
cmp ah,79
je right_limit
cmp ah,181 ; / - zoom 100%
je no_scaling
cmp ah,72 ; up arrow
je key_up_arrow
cmp ah,80 ; down arrow
je key_down_arrow
cmp ah,75 ; left arrow
je key_left_arrow
cmp ah,77 ; right arrow
je key_right_arrow
cmp ah,28 ; Enter
je full_screen
cmp ah,183 ; Print Screen - Slides Show
je slide_show.3
cmp ah,29
je key_ctrl_up
cmp ah,157
je key_ctrl_down
cmp ah,56
je key_alt_up
cmp ah,184
je key_alt_down
jmp still
;---------------------------------------------------------------------
key_shift_up:
mov [shift_flag],1
jmp still
;---------------------------------------------------------------------
key_shift_down:
mov [shift_flag],0
jmp still
;---------------------------------------------------------------------
key_ctrl_up:
mov [ctrl_flag],1
jmp still
;---------------------------------------------------------------------
key_ctrl_down:
mov [ctrl_flag],0
jmp still
;---------------------------------------------------------------------
key_alt_up:
mov [alt_flag],1
jmp still
;---------------------------------------------------------------------
key_alt_down:
mov [alt_flag],0
jmp still
;---------------------------------------------------------------------
check_key_O:
cmp [ctrl_flag],0
jne kfile
jmp k_option
;---------------------------------------------------------------------
move_to_left:
xor eax,eax
cmp [load_file_number],eax
je still
dec [load_file_number]
jmp right_limit.2
;----------------------------------------
move_to_right:
mov eax,[load_directory_pointer]
mov eax,[eax+4]
test eax,eax
jz @f
dec eax
@@:
cmp [load_file_number],eax
je still
inc [load_file_number]
jmp right_limit.2
;----------------------------------------
left_limit:
xor eax,eax
jmp right_limit.1
;----------------------------------------
right_limit:
mov eax,[load_directory_pointer]
mov eax,[eax+4]
test eax,eax
jz @f
dec eax
@@:
.1:
cmp [load_file_number],eax
je still
mov [load_file_number],eax
.2:
imul ebx,[load_file_number],304
add ebx,32+40
add ebx,[load_directory_pointer]
mov esi,string
mov edi,plugin_pach
call copy_file_path
mov esi,plugin_pach
mov edi,string
mov ecx,4096/4
cld
rep movsd
; jmp kopen
mov [open_file_flag],0
mov ecx,-1
call getappinfo
call load_image
test eax,eax
jnz kopen_1.err
call convert
call load_directory.copy_dir_path
call get_window_param
test [window_status],1b
jz @f ;draw_still
mov [no_draw_window],1
call draw_other
mov [no_draw_window],0
jmp .3
@@:
call draw_window
.3:
mov al,[old_key_code]
mov ah,[current_key_code]
mov [old_key_code],ah
cmp al,ah
jne still ;key.extended_key ;still
.still:
mcall 2
cmp [extended_key],1
je .extended_key
test al, al
jnz still
cmp ah, 0xE0
jne @f
mov [extended_key],1
jmp .still
@@:
jmp still
.extended_key:
mov [extended_key],0
mov [current_key_code],ah
jmp .3
.4:
mov ah,[current_key_code]
mov [old_key_code],ah
jmp key.extended_key
;---------------------------------------------------------------------
slide_show:
mov eax,[load_directory_pointer]
cmp [eax+4],dword 1
jbe still
mcall 26,9
cmp [timer],eax
jbe .1
jmp .still
.red:
call draw_window
.still:
mcall 23,10
cmp eax,1 ; ïåðåðèñîâàòü îêíî ?
je .red
cmp eax,2 ; íàæàòà êëàâèøà ?
je .key ; åñëè äà - íà key
cmp eax,3 ; íàæàòà êíîïêà ?
je .button ; åñëè äà - íà button
; mcall 68,1
jmp slide_show
;-------------------------------------------
.key:
mcall 2
cmp [extended_key],1
je .extended_key
test al, al
jnz .still
cmp ah, 0xE0
jne @f
mov [extended_key],1
jmp .still
@@:
cmp ah,1 ; Esc
je still
cmp ah,185 ; Space
je still
jmp .still
.extended_key:
mov [extended_key],0
mov [current_key_code],ah
jmp .still
;-------------------------------------------
.button: ; button
mov eax,17 ; get id
mcall
cmp ah,1 ; button id=1 ?
je START.exit
.noclose:
cmp ah,2
je still
jmp slide_show
;-------------------------------------------
.1:
; mcall 26,9
; add eax,[slide_show_delay] ;500
; mov [timer],eax
mov eax,[load_directory_pointer]
mov eax,[eax+4]
test eax,eax
jz @f
dec eax
@@:
cmp [load_file_number],eax
je still
inc [load_file_number]
imul ebx,[load_file_number],304
add ebx,32+40
add ebx,[load_directory_pointer]
mov esi,string
mov edi,plugin_pach
call copy_file_path
mov esi,plugin_pach
mov edi,string
mov ecx,4096/4
cld
rep movsd
mov [open_file_flag],0
mov ecx,-1
call getappinfo
call load_image
test eax,eax
jnz kopen_1.err
call convert
call load_directory.copy_dir_path
call get_window_param
test [window_status],1b
jz @f ;draw_still
mov [no_draw_window],1
call draw_other
mov [no_draw_window],0
jmp .3 ;slide_show
@@:
call draw_window
; jmp slide_show
.3:
mcall 26,9
add eax,[slide_show_delay] ;500
mov [timer],eax
jmp slide_show
;---------------------------------------------------------------------
key_up_arrow:
mov eax,[scroll_bar_data_vertical.ar_offset]
mov ebx,scroll_bar_data_vertical.position
cmp [ebx],eax
jbe @f
sub [ebx],eax
jmp .1
@@:
xor eax,eax
cmp [ebx],eax
je still
mov [ebx],eax
.1:
call drawimage
call draw_scrollbars
jmp still
;---------------------------------------------------------------------
key_down_arrow:
mov ecx,[scroll_bar_data_vertical.ar_offset]
mov ebx,scroll_bar_data_vertical.position
mov eax,[scroll_bar_data_vertical.max_area]
sub eax,[scroll_bar_data_vertical.cur_area]
cmp [ebx],eax
je still
push eax
sub eax,ecx
cmp [ebx],eax
pop eax
jae @f
add [ebx],ecx
jmp key_up_arrow.1
@@:
mov [ebx],eax
jmp key_up_arrow.1
;---------------------------------------------------------------------
key_left_arrow:
mov eax,[scroll_bar_data_horizontal.ar_offset]
mov ebx,scroll_bar_data_horizontal.position
cmp [ebx],eax
jbe @f
sub [ebx],eax
jmp key_up_arrow.1
@@:
xor eax,eax
cmp [ebx],eax
je still
mov [ebx],eax
jmp key_up_arrow.1
;---------------------------------------------------------------------
key_right_arrow:
mov ecx,[scroll_bar_data_horizontal.ar_offset]
mov ebx,scroll_bar_data_horizontal.position
mov eax,[scroll_bar_data_horizontal.max_area]
sub eax,[scroll_bar_data_horizontal.cur_area]
cmp [ebx],eax
je still
push eax
sub eax,ecx
cmp [ebx],eax
pop eax
jae @f
add [ebx],ecx
jmp key_up_arrow.1
@@:
mov [ebx],eax
; xor eax,eax
; mov ax,[scroll_bar_data_horizontal.size_x]
; sub eax,[scroll_bar_data_horizontal.btn_high]
; sub eax,[scroll_bar_data_horizontal.btn_high]
; sub eax,[scroll_bar_data_horizontal.run_size]
; mov [scroll_bar_data_horizontal.position2],eax
jmp key_up_arrow.1
;---------------------------------------------------------------------

View File

@ -0,0 +1,115 @@
;---------------------------------------------------------------------
Get_ini:
stdcall dll.Init,[lib_init]
mov ebx,ini_file_name
mov esi,path
mov edi,plugin_pach
call copy_file_path
invoke ini_get_int,plugin_pach,aVariables,aSortMode,2
cmp eax,0
jb .error_aSortMode
cmp eax,13
jb @f
.error_aSortMode:
mov eax,2
@@:
mov [sort_type],eax
invoke ini_get_int,plugin_pach,aVariables,aArrowsOffset,10
cmp eax,1
jb .error_aArrowsOffset
cmp eax,100
jb @f
.error_aArrowsOffset:
mov eax,10
@@:
mov [arrows_offset],eax
invoke ini_get_int,plugin_pach,aVariables,aSlideShowDelay,300
cmp eax,1
jb .error_aSlideShowDelay
cmp eax,99990
jb @f
.error_aSlideShowDelay:
mov eax,300
@@:
mov [slide_show_delay],eax
invoke ini_get_int,plugin_pach,aVariables,aShowFileName,0
cmp eax,0
jb .error_aShowFileName
cmp eax,1
jb @f
.error_aShowFileName:
mov eax,1
@@:
shl eax,1
mov [check1+32],eax
invoke ini_get_int,plugin_pach,aVariables,aFilteringFlag,0
cmp eax,0
jb .error_aFilteringFlag
cmp eax,1
jb @f
.error_aFilteringFlag:
mov eax,1
@@:
mov [filtering_flag],eax
shl eax,1
mov [check2+32],eax
; get convert plugins names
invoke ini_get_str,plugin_pach,aConvertPlugins,aCP0,plugin_0_name,127,ConvertPlugins_no_key
invoke ini_get_str,plugin_pach,aConvertPlugins,aCP1,plugin_1_name,127,ConvertPlugins_no_key
invoke ini_get_str,plugin_pach,aConvertPlugins,aCP2,plugin_2_name,127,ConvertPlugins_no_key
invoke ini_get_str,plugin_pach,aConvertPlugins,aCP3,plugin_3_name,127,ConvertPlugins_no_key
invoke ini_get_str,plugin_pach,aConvertPlugins,aCP4,plugin_4_name,127,ConvertPlugins_no_key
invoke ini_get_str,plugin_pach,aConvertPlugins,aCP5,plugin_5_name,127,ConvertPlugins_no_key
invoke ini_get_str,plugin_pach,aConvertPlugins,aCP6,plugin_6_name,127,ConvertPlugins_no_key
invoke ini_get_str,plugin_pach,aConvertPlugins,aCP7,plugin_7_name,127,ConvertPlugins_no_key
invoke ini_get_str,plugin_pach,aConvertPlugins,aCP8,plugin_8_name,127,ConvertPlugins_no_key
invoke ini_get_str,plugin_pach,aConvertPlugins,aCP9,plugin_9_name,127,ConvertPlugins_no_key
invoke ini_get_str,plugin_pach,aApplicationsPaths,aHelp,Help_path,1023,ConvertPlugins_no_key
invoke ini_get_str,plugin_pach,aApplicationsPaths,aEditor,Editor_path,1023,ConvertPlugins_no_key
invoke ini_get_str,plugin_pach,aApplicationsPaths,aOpenDialog,OpenDialog_path,1023,ConvertPlugins_no_key
invoke ini_get_str,plugin_pach,aOther,akey_help,key_help_name,127,ConvertPlugins_no_key
ret
;---------------------------------------------------------------------
Set_ini:
mov ebx,ini_file_name
mov esi,path
mov edi,plugin_pach
call copy_file_path
invoke ini_set_int,plugin_pach,aVariables,aSortMode,[sort_type]
invoke ini_set_int,plugin_pach,aVariables,aArrowsOffset,[arrows_offset]
invoke ini_set_int,plugin_pach,aVariables,aSlideShowDelay,[slide_show_delay]
mov eax,[check1+32]
shr eax,1
mov [check1+32],eax
invoke ini_set_int,plugin_pach,aVariables,aShowFileName,[check1+32]
invoke ini_set_int,plugin_pach,aVariables,aFilteringFlag,[filtering_flag]
ret
;---------------------------------------------------------------------
;libini_alloc:
; push ecx
; mov ecx, [esp+8]
; mcall 68,12
; pop ecx
; ret 4
;---------------------------------------------------------------------
;libini_free:
; push ecx
; mov ecx, [esp+8]
; mcall 68,13
; pop ecx
; ret 4
;---------------------------------------------------------------------
;libini_realloc:
; push ecx edx
; mov edx, [esp+8+4]
; mov ecx, [esp+8+8]
; mcall 68,20
; pop edx ecx
; ret 8
;---------------------------------------------------------------------

View File

@ -0,0 +1,886 @@
;---------------------------------------------------------------------
load_plugins:
load_libraries l_libs_start,end_l_libs
test eax,eax
jnz START.exit_1
;---------------------------------------------------------------------
; Get ini values
call Get_ini
; jmp last_plugin
;---------------------------------------------------------------------
; mov [cnv_plugin_name_pointer],plugin_0_name
load_convert_plugins:
mov ecx,10
.1:
push ecx
mov esi,[cnv_plugin_name_pointer]
cmp [esi],dword 'NoKe'
je clear_current_load_convert_plugins_area ;last_plugin
mov edi,system_path.1
mov ecx,128/4
cld
rep movsd
mov esi,[cnv_plugin_name_pointer]
mov edi,err_message_found_lib.1
mov ecx,128/4
rep movsd
mov esi,[cnv_plugin_name_pointer]
mov edi,err_message_import.1
mov ecx,128/4
rep movsd
load_library system_path.1, path, library_path, system_path, \
err_message_found_lib, head_f_l, \
[cnv_plugin_import_pointer], err_message_import, head_f_i, plugins_directory
test eax,eax
jnz START.exit_1
load_convert_plugins_next:
add [cnv_plugin_import_pointer],dword 24
add [cnv_plugin_name_pointer],128
pop ecx
dec ecx
jnz load_convert_plugins.1
; jmp load_convert_plugins
last_plugin:
; initialize sort
push dword 1
call dword [sort_init]
; unpack deflate
mov eax,[unpack_DeflateUnpack2]
mov [deflate_unpack],eax
ret
;-----------------------------------------
clear_current_load_convert_plugins_area:
xor eax,eax
mov edi,[cnv_plugin_import_pointer]
cld
push ecx
mov ecx,24/4
rep stosd
pop ecx
jmp load_convert_plugins_next
;---------------------------------------------------------------------
copy_path_my:
xor eax,eax
@@:
cld
lodsb
stosb
test eax,eax
jnz @b
mov esi,edi
@@:
std
lodsb
cmp al,'/'
jnz @b
mov edi,esi
add edi,2
mov esi,ebx
@@:
cld
lodsb
stosb
test eax,eax
jnz @b
mov esi,ecx
dec edi
@@:
cld
lodsb
stosb
test eax,eax
jnz @b
ret
;---------------------------------------------------------------------
load_image:
call delete_RAW1
mov [fileinfo+0],dword 5
mov [fileinfo+12],dword 0
mov [fileinfo+16],dword process_info
cmp [soi],0
je @f
mov ecx,[raw_pointer]
mcall 68, 13,
mov [soi],0
@@:
; cmp [raw_pointer_2],dword 0
; je @f
; mov ecx,[raw_pointer_2] ;[soi]
; mcall 68, 13,
; mov [raw_pointer_2],0
;@@:
.1:
mcall 70, fileinfo
test eax,eax
jnz .end
mov [fileinfo+0],dword 0
mov ecx,[process_info+32]
; for Diamond emulator, and broken files - size = 0
; test ecx,ecx
; jnz @f
cmp ecx,32
jae @f
mov eax,6
jmp .end
@@:
mov [fileinfo+12],ecx
mov [img_size],ecx
mcall 68, 12
mov [fileinfo+16],eax
mov [image_file],eax
mcall 70, fileinfo
.end:
mov [error_fs],eax
ret
;---------------------------------------------------------------------
delete_RAW1:
cmp [RAW1_pointer],0
jne @f
ret
@@:
mcall 68, 13,[previous_frame_pointer]
xor eax,eax
mov [Repeat_N],eax
@@:
mov edx,[Repeat_N]
shl edx,4
add edx,[RAW1_pointer]
mov ecx,[edx+16]
call .1
inc [Repeat_N]
mov eax,[Repeat_N]
cmp [Total_Repeat_N],eax
ja @r
mov ecx,[RAW1_pointer]
call .1
xor eax,eax
mov [RAW1_pointer],eax
ret
.1:
mcall 68, 13,
ret
;---------------------------------------------------------------------
load_buttons:
mov esi,path
mov edi,plugin_pach
mov ebx,buttons_directory
mov ecx,button_name ;buttons_passive_name
call copy_path_my
mov [fileinfo.name], dword plugin_pach
xor eax,eax
mov [raw_pointer_2],eax
call load_image
mov eax,[error_fs]
test eax,eax
jnz START.exit_1
call convert_plugin_invoke
mov eax,[return_code]
test eax,eax
jnz START.exit_1
mov ebx,[raw_pointer]
mov eax,[ebx+4]
mov [dinamic_button_data_1.size_x],ax
mov [dinamic_button_data_1.size_y],ax
mov [dinamic_button_data_2.size_x],ax
mov [dinamic_button_data_2.size_y],ax
mov [dinamic_button_data_3.size_x],ax
mov [dinamic_button_data_3.size_y],ax
mov [dinamic_button_data_4.size_x],ax
mov [dinamic_button_data_4.size_y],ax
mov [dinamic_button_data_5.size_x],ax
mov [dinamic_button_data_5.size_y],ax
mov [dinamic_button_data_6.size_x],ax
mov [dinamic_button_data_6.size_y],ax
mov [dinamic_button_data_7.size_x],ax
mov [dinamic_button_data_7.size_y],ax
mov [dinamic_button_data_8.size_x],ax
mov [dinamic_button_data_8.size_y],ax
mov [dinamic_button_data_9.size_x],ax
mov [dinamic_button_data_9.size_y],ax
mov [dinamic_button_data_10.size_x],ax
mov [dinamic_button_data_10.size_y],ax
mov [dinamic_button_data_11.size_x],ax
mov [dinamic_button_data_11.size_y],ax
mov [dinamic_button_data_12.size_x],ax
mov [dinamic_button_data_12.size_y],ax
mov [dinamic_button_data_13.size_x],ax
mov [dinamic_button_data_13.size_y],ax
mov [dinamic_button_data_14.size_x],ax
mov [dinamic_button_data_14.size_y],ax
mov [dinamic_button_data_15.size_x],ax
mov [dinamic_button_data_15.size_y],ax
mov eax,[ebx+12]
mov [dinamic_button_data_1.resolution_raw],eax
mov [dinamic_button_data_2.resolution_raw],eax
mov [dinamic_button_data_3.resolution_raw],eax
mov [dinamic_button_data_4.resolution_raw],eax
mov [dinamic_button_data_5.resolution_raw],eax
mov [dinamic_button_data_6.resolution_raw],eax
mov [dinamic_button_data_7.resolution_raw],eax
mov [dinamic_button_data_8.resolution_raw],eax
mov [dinamic_button_data_9.resolution_raw],eax
mov [dinamic_button_data_10.resolution_raw],eax
mov [dinamic_button_data_11.resolution_raw],eax
mov [dinamic_button_data_12.resolution_raw],eax
mov [dinamic_button_data_13.resolution_raw],eax
mov [dinamic_button_data_14.resolution_raw],eax
mov [dinamic_button_data_15.resolution_raw],eax
mov eax,[ebx+20]
add eax,ebx
mov [dinamic_button_data_1.palette_raw],eax
mov [dinamic_button_data_2.palette_raw],eax
mov [dinamic_button_data_3.palette_raw],eax
mov [dinamic_button_data_4.palette_raw],eax
mov [dinamic_button_data_5.palette_raw],eax
mov [dinamic_button_data_6.palette_raw],eax
mov [dinamic_button_data_7.palette_raw],eax
mov [dinamic_button_data_8.palette_raw],eax
mov [dinamic_button_data_9.palette_raw],eax
mov [dinamic_button_data_10.palette_raw],eax
mov [dinamic_button_data_11.palette_raw],eax
mov [dinamic_button_data_12.palette_raw],eax
mov [dinamic_button_data_13.palette_raw],eax
mov [dinamic_button_data_14.palette_raw],eax
mov [dinamic_button_data_15.palette_raw],eax
mov eax,[ebx+28]
add eax,ebx
push eax
mov [dinamic_button_data_1.passive_raw],eax
mov ecx,[ebx+4]
imul ecx,[ebx+4]
imul ecx,[ebx+12]
shr ecx,3
add eax,ecx
mov [dinamic_button_data_2.passive_raw],eax
add eax,ecx
mov [dinamic_button_data_3.passive_raw],eax
add eax,ecx
mov [dinamic_button_data_4.passive_raw],eax
add eax,ecx
mov [dinamic_button_data_5.passive_raw],eax
add eax,ecx
mov [dinamic_button_data_6.passive_raw],eax
add eax,ecx
mov [dinamic_button_data_7.passive_raw],eax
add eax,ecx
mov [dinamic_button_data_8.passive_raw],eax
add eax,ecx
mov [dinamic_button_data_9.passive_raw],eax
add eax,ecx
mov [dinamic_button_data_10.passive_raw],eax
add eax,ecx
mov [dinamic_button_data_11.passive_raw],eax
add eax,ecx
mov [dinamic_button_data_12.passive_raw],eax
add eax,ecx
mov [dinamic_button_data_13.passive_raw],eax
add eax,ecx
mov [dinamic_button_data_14.passive_raw],eax
add eax,ecx
mov [dinamic_button_data_15.passive_raw],eax
;------------------------------------
movzx ebx,word [dinamic_button_data_1.size_x]
movzx eax,word [dinamic_button_data_1.size_y]
imul eax,ebx
imul eax,15
mov ebx,[dinamic_button_data_1.resolution_raw]
shr ebx,3
imul ebx,eax
pop eax
add eax,ebx
push eax
mov [dinamic_button_data_1.active_raw],eax
add eax,ecx
mov [dinamic_button_data_2.active_raw],eax
add eax,ecx
mov [dinamic_button_data_3.active_raw],eax
add eax,ecx
mov [dinamic_button_data_4.active_raw],eax
add eax,ecx
mov [dinamic_button_data_5.active_raw],eax
add eax,ecx
mov [dinamic_button_data_6.active_raw],eax
add eax,ecx
mov [dinamic_button_data_7.active_raw],eax
add eax,ecx
mov [dinamic_button_data_8.active_raw],eax
add eax,ecx
mov [dinamic_button_data_9.active_raw],eax
add eax,ecx
mov [dinamic_button_data_10.active_raw],eax
add eax,ecx
mov [dinamic_button_data_11.active_raw],eax
add eax,ecx
mov [dinamic_button_data_12.active_raw],eax
add eax,ecx
mov [dinamic_button_data_13.active_raw],eax
add eax,ecx
mov [dinamic_button_data_14.active_raw],eax
add eax,ecx
mov [dinamic_button_data_15.active_raw],eax
;------------------------------------
pop eax
add eax,ebx
mov [dinamic_button_data_1.click_raw],eax
add eax,ecx
mov [dinamic_button_data_2.click_raw],eax
add eax,ecx
mov [dinamic_button_data_3.click_raw],eax
add eax,ecx
mov [dinamic_button_data_4.click_raw],eax
add eax,ecx
mov [dinamic_button_data_5.click_raw],eax
add eax,ecx
mov [dinamic_button_data_6.click_raw],eax
add eax,ecx
mov [dinamic_button_data_7.click_raw],eax
add eax,ecx
mov [dinamic_button_data_8.click_raw],eax
add eax,ecx
mov [dinamic_button_data_9.click_raw],eax
add eax,ecx
mov [dinamic_button_data_10.click_raw],eax
add eax,ecx
mov [dinamic_button_data_11.click_raw],eax
add eax,ecx
mov [dinamic_button_data_12.click_raw],eax
add eax,ecx
mov [dinamic_button_data_13.click_raw],eax
add eax,ecx
mov [dinamic_button_data_14.click_raw],eax
add eax,ecx
mov [dinamic_button_data_15.click_raw],eax
;------------------------------------
mov [fileinfo.name], dword string
xor eax,eax
mov [img_size],eax
ret
;---------------------------------------------------------------------
load_directory:
cmp [load_directory_pointer],dir_header ;dword 0
je @f
mcall 68, 13, [load_directory_pointer]
@@:
call .copy_dir_path
mov [dirinfo.size],dword 0
mov [dirinfo.return],dir_header ;procinfo
mcall 70, dirinfo
test eax,eax
jnz .end_err
mov ecx,[dir_header.totl_blocks] ;[procinfo+8]
mov [dirinfo.size],ecx
imul ecx,304
add ecx,32
mcall 68, 12
mov [dirinfo.return],eax
mov [load_directory_pointer],eax
mcall 70, dirinfo
test eax,eax
jnz .end_err
call delete_unsupported_BDFE
.sort:
call sort_directory
; add [load_directory_pointer],2*304+32+40
mov ebp,[load_directory_pointer]
mov ebp,[ebp+4]
; check ebp = 0
test ebp,ebp
jz .end_1 ;.start
dec ebp
jz .end_1
.start:
mov esi,file_name
mov ecx,[file_name_length]
imul edi,ebp,304
add edi,32+40
add edi,[load_directory_pointer]
@@:
cld
lodsb
call char_todown
xchg ah,al
xchg edi,esi
cld
lodsb
call char_todown
; xchg ah,al
xchg edi,esi
dec ecx
jz .end
cmp ah,al
je @r
dec ebp
jnz .start
.end_1:
xor eax,eax
mov [load_file_number],eax
ret
.end:
mov [load_file_number],ebp
xor eax,eax
.end_err:
ret
;-------------------------------------------
.copy_dir_path:
mov esi,string ;path
mov edi,plugin_pach
mov ebx,file_name
call copy_dir_path
mov [file_name_length],ebx
ret
;---------------------------------------------------------------------
sort_directory:
; pusha
push dword [sort_type] ;2 ; ðåæèì ñîðòèðîâêè
mov eax,[load_directory_pointer]
push dword [eax+4] ;[dirdata+4] ; ÷èñëî ôàéëîâ
; ìîæíî ïèñàòü push ebx, åñëè
; äåëî ïðîèñõîäèò íåïîñðåäñòâåííî ïîñëå int 0x40
add eax,32
push eax ;dirdata+32 ; äàííûå ôàéëîâ
; call [plugin_sort]
call [sort_dir]
; popa
ret
;---------------------------------------------------------------------
delete_unsupported_BDFE:
mov [fileinfo.subfunction],dword 0
mov [fileinfo.size],dword 32
mov [fileinfo.name], dword plugin_pach
mov eax,process_info
mov [fileinfo.return],eax
mov [image_file],eax
mov ebx,[load_directory_pointer]
add ebx,4
xor ecx,ecx
dec ecx
mov eax,[load_directory_pointer]
add eax,32+40
sub eax,304
.start:
inc ecx
add eax,304
.1:
cmp [ebx],ecx
je .end
cmp [eax],byte '.'
jne @f
cmp [eax+1],byte 0
je .delete
@@:
cmp [eax],word '..'
jne @f
cmp [eax+2],byte 0
je .delete
@@:
test [eax-40],byte 0x10
jnz .delete
push eax ebx
mov esi,eax
call search_expansion
test eax,eax
pop ebx eax
jnz .delete
; mov edi,[test_area+4]
; cmp [esi],edi
; je .start
mov edi,plugin_0_name
cmp [edi],dword 'NoKe'
je .delete
push eax ebx ecx esi
mov edi,[Convert_plugin_0.Assoc]
test edi,edi
jnz @f
pop esi ecx ebx eax
jmp .delete
@@:
call compare_expansion
test eax,eax
pop esi ecx ebx eax
jz .start
mov edi,plugin_1_name
cmp [edi],dword 'NoKe'
je .delete
push eax ebx ecx esi
mov edi,[Convert_plugin_1.Assoc]
test edi,edi
jnz @f
pop esi ecx ebx eax
jmp .delete
@@:
call compare_expansion
test eax,eax
pop esi ecx ebx eax
jz .start
mov edi,plugin_2_name
cmp [edi],dword 'NoKe'
je .delete
push eax ebx ecx esi
mov edi,[Convert_plugin_2.Assoc]
test edi,edi
jnz @f
pop esi ecx ebx eax
jmp .delete
@@:
call compare_expansion
test eax,eax
pop esi ecx ebx eax
jz .start
mov edi,plugin_3_name
cmp [edi],dword 'NoKe'
je .delete
push eax ebx ecx esi
mov edi,[Convert_plugin_3.Assoc]
test edi,edi
jnz @f
pop esi ecx ebx eax
jmp .delete
@@:
call compare_expansion
test eax,eax
pop esi ecx ebx eax
jz .start
mov edi,plugin_4_name
cmp [edi],dword 'NoKe'
je .delete
push eax ebx ecx esi
mov edi,[Convert_plugin_4.Assoc]
test edi,edi
jnz @f
pop esi ecx ebx eax
jmp .delete
@@:
call compare_expansion
test eax,eax
pop esi ecx ebx eax
jz .start
mov edi,plugin_5_name
cmp [edi],dword 'NoKe'
je .delete
push eax ebx ecx esi
mov edi,[Convert_plugin_5.Assoc]
test edi,edi
jnz @f
pop esi ecx ebx eax
jmp .delete
@@:
call compare_expansion
test eax,eax
pop esi ecx ebx eax
jz .start
mov edi,plugin_6_name
cmp [edi],dword 'NoKe'
je .delete
push eax ebx ecx esi
mov edi,[Convert_plugin_6.Assoc]
test edi,edi
jnz @f
pop esi ecx ebx eax
jmp .delete
@@:
call compare_expansion
test eax,eax
pop esi ecx ebx eax
jz .start
mov edi,plugin_7_name
cmp [edi],dword 'NoKe'
je .delete
push eax ebx ecx esi
mov edi,[Convert_plugin_7.Assoc]
test edi,edi
jnz @f
pop esi ecx ebx eax
jmp .delete
@@:
call compare_expansion
test eax,eax
pop esi ecx ebx eax
jz .start
mov edi,plugin_8_name
cmp [edi],dword 'NoKe'
je .delete
push eax ebx ecx esi
mov edi,[Convert_plugin_8.Assoc]
test edi,edi
jnz @f
pop esi ecx ebx eax
jmp .delete
@@:
call compare_expansion
test eax,eax
pop esi ecx ebx eax
jz .start
mov edi,plugin_9_name
cmp [edi],dword 'NoKe'
je .delete
push eax ebx ecx esi
mov edi,[Convert_plugin_9.Assoc]
test edi,edi
jnz @f
pop esi ecx ebx eax
jmp .delete
@@:
call compare_expansion
test eax,eax
pop esi ecx ebx eax
jz .start
;-------------------------------------------
.delete:
dec dword [ebx]
mov esi,[ebx]
sub esi,ecx
push ecx
mov ecx,esi
imul ecx,304/4
mov edi,eax
sub edi,40
mov esi,edi
add esi,304
cld
rep movsd
pop ecx
jmp .1
.end:
mov [fileinfo.name], dword string
ret
;---------------------------------------------------------------------
image_editor:
mov [start_appl.parameter],dword string
mov [start_appl.name],dword Editor_path
mcall 70, start_appl
jmp still
;---------------------------------------------------------------------
open_help:
mov ebx,key_help_name
mov esi,path
mov edi,library_path
call copy_file_path
mov [start_appl.parameter],dword library_path
mov [start_appl.name],dword Help_path
mcall 70, start_appl
jmp still
;---------------------------------------------------------------------
char_todown:
; convert character to uppercase, using cp866 encoding
; in: al=symbol
; out: al=converted symbol
cmp al, 'A'
jb .ret
cmp al, 'Z'
jbe .az
cmp al, '€'
jb .ret
cmp al, '<27>'
jb .rus1
cmp al, 'Ÿ'
ja .ret
; 0x90-0x9F -> 0xE0-0xEF
add al, 'à'-'<27>'
.ret:
ret
.rus1:
; 0x80-0x8F -> 0xA0-0xAF
.az:
add al, 0x20
ret
;---------------------------------------------------------------------
copy_dir_path:
xor eax,eax
cmp [esi],al
jne @f
mov [edi],al
mov [ebx],al
xor ebx,ebx
inc ebx
ret
@@:
cld
lodsb
stosb
test eax,eax
jnz @b
mov esi,edi
dec esi
@@:
std
lodsb
cmp al,'/'
jnz @b
push esi
add esi,2
mov edi,ebx ;file_name
xor ebx,ebx
@@:
cld
lodsb
stosb
inc ebx
test eax,eax
jnz @b
pop esi
mov [esi+1], byte 0
cld
ret
;---------------------------------------------------------------------
copy_file_path:
xor eax,eax
@@:
cld
lodsb
stosb
test eax,eax
jnz @b
mov esi,edi
dec esi
@@:
std
lodsb
cmp al,'/'
jnz @b
mov edi,esi
add edi,2
mov esi,ebx
@@:
cld
lodsb
stosb
test eax,eax
jnz @b
ret
;---------------------------------------------------------------------
search_expansion:
mov edi,esi
xor eax,eax
@@:
cld
lodsb
test eax,eax
jnz @b
mov ebx,esi
dec esi
@@:
std
lodsb
cmp esi,edi
jb .end_err
cmp al,'.'
jne @b
add esi,2
sub ebx,esi
dec ebx
mov [expansion_length],ebx
cld
xor eax,eax
ret
.end_err:
cld
xor eax,eax
inc eax
ret
;---------------------------------------------------------------------
compare_expansion:
mov ebx,[edi]
add ebx,edi
add edi,3
.start:
cmp ebx,edi
jb .end_err
mov ecx,[expansion_length]
inc edi
push esi edi
@@:
cld
lodsb
xchg esi,edi
shl eax,8
lodsb
xchg esi,edi
call char_todown
xchg al,ah
call char_todown
cmp al,ah
jne @f
dec ecx
jnz @b
jmp .end
@@:
pop edi esi
jmp .start
; jnz .start
.end:
pop edi esi
xor eax,eax
ret
.end_err:
xor eax,eax
inc eax
ret
;---------------------------------------------------------------------

View File

@ -0,0 +1,171 @@
select_menu:
call check_alt
.1:
xor eax,eax
mov [menu_data_1.ret_key],eax
push dword menu_data_1
call [menu_bar_activate]
call clear_control_key_flag
mov eax,[menu_data_1.ret_key]
mov [menu_data_1.ret_key],dword 0
cmp eax,1
je .6
cmp eax,2
je .2
cmp [menu_data_1.click],dword 1
jne still
cmp [menu_data_1.cursor_out],dword 0
jne analyse_out_menu_1
jmp still
;---------------------------------------------------------------------
.2:
xor eax,eax
mov [menu_data_2.ret_key],eax
push dword menu_data_2
call [menu_bar_activate]
call clear_control_key_flag
mov eax,[menu_data_2.ret_key]
mov [menu_data_2.ret_key],dword 0
cmp eax,1
je .1
cmp eax,2
je .3
cmp [menu_data_2.click],dword 1
jne still
cmp [menu_data_2.cursor_out],dword 0
jne analyse_out_menu_2
jmp still
;---------------------------------------------------------------------
.3:
xor eax,eax
mov [menu_data_3.ret_key],eax
push dword menu_data_3
call [menu_bar_activate]
call clear_control_key_flag
mov eax,[menu_data_3.ret_key]
mov [menu_data_3.ret_key],dword 0
cmp eax,1
je .2
cmp eax,2
je .4
cmp [menu_data_3.click],dword 1
jne still
cmp [menu_data_3.cursor_out],dword 0
jne analyse_out_menu_3
jmp still
;---------------------------------------------------------------------
.4:
xor eax,eax
mov [menu_data_4.ret_key],eax
push dword menu_data_4
call [menu_bar_activate]
call clear_control_key_flag
mov eax,[menu_data_4.ret_key]
mov [menu_data_4.ret_key],dword 0
cmp eax,1
je .3
cmp eax,2
je .5
cmp [menu_data_4.click],dword 1
jne still
cmp [menu_data_4.cursor_out],dword 0
jne analyse_out_menu_4
jmp still
;---------------------------------------------------------------------
.5:
xor eax,eax
mov [menu_data_5.ret_key],eax
push dword menu_data_5
call [menu_bar_activate]
call clear_control_key_flag
mov eax,[menu_data_5.ret_key]
mov [menu_data_5.ret_key],dword 0
cmp eax,1
je .4
cmp eax,2
je .6
cmp [menu_data_5.click],dword 1
jne still
cmp [menu_data_5.cursor_out],dword 0
jne analyse_out_menu_5
jmp still
;---------------------------------------------------------------------
.6:
xor eax,eax
mov [menu_data_6.ret_key],eax
push dword menu_data_6
call [menu_bar_activate]
call clear_control_key_flag
mov eax,[menu_data_6.ret_key]
mov [menu_data_6.ret_key],dword 0
cmp eax,1
je .5
cmp eax,2
je .1
cmp [menu_data_6.click],dword 1
jne still
cmp [menu_data_6.cursor_out],dword 0
jne analyse_out_menu_6
jmp still
;---------------------------------------------------------------------
clear_control_key_flag:
push eax
xor eax,eax
mov [shift_flag],al
mov [ctrl_flag],al
mov [alt_flag],al
pop eax
ret
;---------------------------------------------------------------------
check_alt:
xor eax,eax
mov al,[alt_flag]
test eax,eax
jz @f
xor ebx,ebx
ret
@@:
add esp,4
jmp still
;---------------------------------------------------------------------

View File

@ -0,0 +1,596 @@
;---------------------------------------------------------------------
mouse:
mcall 18,7
cmp [active_process],eax
jne still
mcall 37,7
mov [mouse_scroll_data],eax
mov eax,[mouse_position]
mov [mouse_position_old],eax
mcall 37,1
mov [mouse_position],eax
mov eax,[mouse_keys]
mov [mouse_keys_old],eax
mcall 37,2
mov [mouse_keys],eax
cmp [soi],dword 0
je .menu_bar
cmp [scaling_mode],dword 0
je .menu_bar
cmp [capture_image_area_flag],1
je capture_image_area
;-----------------------------------------------------
cmp [scroll_bar_data_vertical.delta2],0
jne .vertical
.horizontal:
mov eax,[scroll_bar_data_horizontal.max_area]
cmp eax,[scroll_bar_data_horizontal.cur_area]
jbe .vertical
push dword scroll_bar_data_horizontal
call [scrollbar_hor_mouse]
; mouse_scroll_bar_horizontal scroll_bar_data_horizontal
cmp [scroll_bar_data_horizontal.redraw],0
je @f
mov [scroll_bar_data_horizontal.redraw],0
jmp .draw
@@:
cmp [scroll_bar_data_horizontal.delta2],0
jne still
;-----------------------------------------------------
.vertical:
mov eax,[scroll_bar_data_vertical.max_area]
cmp eax,[scroll_bar_data_vertical.cur_area]
jbe .menu_bar
push dword scroll_bar_data_vertical
call [scrollbar_ver_mouse]
; mouse_scroll_bar_vertical scroll_bar_data_vertical
cmp [scroll_bar_data_vertical.redraw],0
je .menu_bar ;still
mov [scroll_bar_data_vertical.redraw],0
.draw:
call drawimage
jmp still
;---------------------------------------------------
.clear_mouse_keys_old:
xor eax,eax
mov [mouse_keys],eax
mov [mouse_keys_old],eax
ret
;---------------------------------------------------
.menu_bar:
cmp [scroll_bar_data_vertical.delta2],0
jne still
cmp [scroll_bar_data_horizontal.delta2],0
jne still
; xor eax,eax
; mov [menu_data_1.get_mouse_flag],eax
; mov [menu_data_2.get_mouse_flag],eax
; mov [menu_data_3.get_mouse_flag],eax
; mov [menu_data_4.get_mouse_flag],eax
; mov [menu_data_5.get_mouse_flag],eax
; mov [menu_data_6.get_mouse_flag],eax
.menu_bar_1:
call .set_mouse_flag
@@:
push dword menu_data_1
call [menu_bar_mouse]
; mouse_menubar menu_data_1
cmp [menu_data_1.click],dword 1
jne .menu_bar_2
call .clear_mouse_keys_old
cmp [menu_data_1.cursor_out],dword 0
jne analyse_out_menu_1
jmp .menu_bar_1
;--------------------------------------------
.menu_bar_2:
; Edit
push dword menu_data_2
call [menu_bar_mouse]
; mouse_menubar menu_data_2
cmp [menu_data_2.click],dword 1
jne .menu_bar_3
call .clear_mouse_keys_old
cmp [menu_data_2.cursor_out],dword 0
jne analyse_out_menu_2
jmp .menu_bar_1
;--------------------------------------------
.menu_bar_3:
; View
push dword menu_data_3
call [menu_bar_mouse]
; mouse_menubar menu_data_3
cmp [menu_data_3.click],dword 1
jne .menu_bar_4
call .clear_mouse_keys_old
cmp [menu_data_3.cursor_out],dword 0
jne analyse_out_menu_3 ;still
jmp .menu_bar_1
;--------------------------------------------
.menu_bar_4:
; Zoom
push dword menu_data_4
call [menu_bar_mouse]
; mouse_menubar menu_data_4
cmp [menu_data_4.click],dword 1
jne .menu_bar_5
call .clear_mouse_keys_old
cmp [menu_data_4.cursor_out],dword 0
jne analyse_out_menu_4
jmp .menu_bar_1
;--------------------------------------------
.menu_bar_5:
; Tools
push dword menu_data_5
call [menu_bar_mouse]
; mouse_menubar menu_data_5
cmp [menu_data_5.click],dword 1
jne .menu_bar_6
call .clear_mouse_keys_old
cmp [menu_data_5.cursor_out],dword 0
jne analyse_out_menu_5
jmp .menu_bar_1
;--------------------------------------------
.menu_bar_6:
; Help
push dword menu_data_6
call [menu_bar_mouse]
; mouse_menubar menu_data_6
cmp [menu_data_6.click],dword 1
jne .mouse_dinamic_button
call .clear_mouse_keys_old
cmp [menu_data_6.cursor_out],dword 0
jne analyse_out_menu_6
jmp .menu_bar_1
;---------------------------------------------------
.mouse_dinamic_button:
; open file
push dword dinamic_button_data_1
call [dinamic_button_mouse]
; mouse_dinamic_button dinamic_button_data_1
mov eax,dinamic_button_data_1.click
cmp [eax],dword 1
jne @f
mov [eax],dword 0
jmp kfile
;-------------------------------------------------
@@:
; reload file
push dword dinamic_button_data_2
call [dinamic_button_mouse]
; mouse_dinamic_button dinamic_button_data_2
mov eax,dinamic_button_data_2.click
cmp [eax],dword 1
jne @f
mov [eax],dword 0
jmp kopen
;-------------------------------------------------
@@:
; left limit
push dword dinamic_button_data_3
call [dinamic_button_mouse]
; mouse_dinamic_button dinamic_button_data_3
mov eax,dinamic_button_data_3.click
cmp [eax],dword 1
jne @f
mov [eax],dword 0
jmp left_limit
;-------------------------------------------------
@@:
; left arrow
push dword dinamic_button_data_4
call [dinamic_button_mouse]
; mouse_dinamic_button dinamic_button_data_4
mov eax,dinamic_button_data_4.click
cmp [eax],dword 1
jne @f
mov [eax],dword 0
jmp move_to_left
;-------------------------------------------------
@@:
; slide show
push dword dinamic_button_data_5
call [dinamic_button_mouse]
; mouse_dinamic_button dinamic_button_data_5
mov eax,dinamic_button_data_5.click
cmp [eax],dword 1
jne @f
mov [eax],dword 0
jmp slide_show.3
;-------------------------------------------------
@@:
; right arrow
push dword dinamic_button_data_6
call [dinamic_button_mouse]
; mouse_dinamic_button dinamic_button_data_6
mov eax,dinamic_button_data_6.click
cmp [eax],dword 1
jne @f
mov [eax],dword 0
jmp move_to_right
;-------------------------------------------------
@@:
; right limit
push dword dinamic_button_data_7
call [dinamic_button_mouse]
; mouse_dinamic_button dinamic_button_data_7
mov eax,dinamic_button_data_7.click
cmp [eax],dword 1
jne @f
mov [eax],dword 0
jmp right_limit
;-------------------------------------------------
@@:
; zoom +
push dword dinamic_button_data_8
call [dinamic_button_mouse]
; mouse_dinamic_button dinamic_button_data_8
mov eax,dinamic_button_data_8.click
cmp [eax],dword 1
jne @f
mov [eax],dword 0
jmp zoom_plus ;still
;-------------------------------------------------
@@:
; zoom -
push dword dinamic_button_data_9
call [dinamic_button_mouse]
; mouse_dinamic_button dinamic_button_data_9
mov eax,dinamic_button_data_9.click
cmp [eax],dword 1
jne @f
mov [eax],dword 0
jmp zoom_minus ;still
;-------------------------------------------------
@@:
; zoom 100%
push dword dinamic_button_data_10
call [dinamic_button_mouse]
; mouse_dinamic_button dinamic_button_data_10
mov eax,dinamic_button_data_10.click
cmp [eax],dword 1
jne @f
mov [eax],dword 0
jmp no_scaling ;still
;-------------------------------------------------
@@:
; rotate clockwise
push dword dinamic_button_data_11
call [dinamic_button_mouse]
; mouse_dinamic_button dinamic_button_data_11
mov eax,dinamic_button_data_11.click
cmp [eax],dword 1
jne @f
mov [eax],dword 0
jmp rotate_clockwise
;-------------------------------------------------
@@:
; rotate counter-clockwise
push dword dinamic_button_data_12
call [dinamic_button_mouse]
; mouse_dinamic_button dinamic_button_data_12
mov eax,dinamic_button_data_12.click
cmp [eax],dword 1
jne @f
mov [eax],dword 0
jmp rotate_counter_clockwise
;-------------------------------------------------
@@:
; file information
push dword dinamic_button_data_13
call [dinamic_button_mouse]
; mouse_dinamic_button dinamic_button_data_13
mov eax,dinamic_button_data_13.click
cmp [eax],dword 1
jne @f
mov [eax],dword 0
jmp kinfo
;-------------------------------------------------
@@:
; wallpaper
push dword dinamic_button_data_14
call [dinamic_button_mouse]
; mouse_dinamic_button dinamic_button_data_14
mov eax,dinamic_button_data_14.click
cmp [eax],dword 1
jne @f
mov [eax],dword 0
jmp k_background
;-------------------------------------------------
@@:
; settings
push dword dinamic_button_data_15
call [dinamic_button_mouse]
; mouse_dinamic_button dinamic_button_data_15
mov eax,dinamic_button_data_15.click
cmp [eax],dword 1
jne @f
mov [eax],dword 0
jmp k_option ;still
;-------------------------------------------------
@@:
jmp check_scroll_event
; jmp still
;---------------------------------------------------------------------
.set_mouse_flag:
xor eax,eax
inc eax
mov [menu_data_1.get_mouse_flag],eax
mov [menu_data_2.get_mouse_flag],eax
mov [menu_data_3.get_mouse_flag],eax
mov [menu_data_4.get_mouse_flag],eax
mov [menu_data_5.get_mouse_flag],eax
mov [menu_data_6.get_mouse_flag],eax
ret
;---------------------------------------------------------------------
analyse_out_menu_1:
; File
mov eax,[menu_data_1.cursor_out]
cmp eax,dword 1
je kfile
cmp eax,dword 2
je kinfo
cmp eax,dword 3
je START.exit
jmp still
;---------------------------------------------------------------------
analyse_out_menu_2:
; Edit
mov eax,[menu_data_2.cursor_out]
cmp eax,dword 1
je rotate_clockwise
cmp eax,dword 2
je rotate_counter_clockwise
cmp eax,dword 3
je invert_left_to_right
cmp eax,dword 4
je invert_up_to_down
jmp still
;---------------------------------------------------------------------
analyse_out_menu_3:
; View
mov eax,[menu_data_3.cursor_out]
cmp eax,dword 1
je k_sort_directory
cmp eax,dword 2
je full_screen
cmp eax,dword 3
je kopen
jmp still
;---------------------------------------------------------------------
analyse_out_menu_4:
; Zoom
mov eax,[menu_data_4.cursor_out]
cmp eax,dword 1
je no_scaling
cmp eax,dword 2
je zoom_plus
cmp eax,dword 3
je zoom_minus
cmp eax,dword 4
je scaling
jmp still
;---------------------------------------------------------------------
analyse_out_menu_5:
; Tools
mov eax,[menu_data_5.cursor_out]
cmp eax,dword 1
je image_editor
cmp eax,dword 2
je k_background
cmp eax,dword 3
je slide_show.3
cmp eax,dword 4
je k_option
jmp still
;---------------------------------------------------------------------
analyse_out_menu_6:
; Help
cmp [menu_data_6.cursor_out],dword 1
je open_help
cmp [menu_data_6.cursor_out],dword 2
je kabout
jmp still
;---------------------------------------------------------------------
check_scroll_event:
; jmp capture_image_area
mov eax,[mouse_scroll_data]
test eax,eax
jz capture_image_area ;still
test ax,0x8000
jnz .decr
shr eax,16
test ax,0x8000
jnz .decr_1
pusha
mov eax,[scaling_mode]
test eax,eax
jnz .continue_1
call calculation_next_value_minus
mov [calc_next_value_minus],1
.continue_1:
popa
mov eax,zoom_factors
cmp [eax],dword zoom_factors.min
jbe still
xor ecx,ecx
mov cx,[mouse_scroll_data.vertical]
test ecx,ecx
jnz @f
mov cx,[mouse_scroll_data.horizontal]
test ecx,ecx
jz still
@@:
;----------------------------------------
cmp [calc_next_value_minus],1
jne @f
mov [calc_next_value_minus],0
dec ecx
jz zoom_plus.1
@@:
mov ebx,4
@@:
cmp [eax],dword zoom_factors.min
jbe @f
sub [eax],ebx
dec ecx
jnz @r
jmp zoom_plus.1
@@:
mov [eax],dword zoom_factors.min
jmp zoom_plus.1
;----------------------------------------
.decr:
xor ebx,ebx
mov bx,[mouse_scroll_data.vertical]
jmp @f
.decr_1:
xor ebx,ebx
mov bx,[mouse_scroll_data.horizontal]
@@:
pusha
mov eax,[scaling_mode]
test eax,eax
jnz .continue_2
call calculation_next_value_plus
mov [calc_next_value_plus],1
.continue_2:
popa
mov eax,zoom_factors
cmp [eax],dword zoom_factors.max
jae still
mov ecx,0xffff
sub ecx,ebx
inc ecx
;---------------------------------------
cmp [calc_next_value_plus],1
jne @f
mov [calc_next_value_plus],0
dec ecx
jz zoom_plus.1
@@:
mov ebx,4
@@:
cmp [eax],dword zoom_factors.max
jae @f
add [eax],ebx
dec ecx
jnz @r
jmp zoom_plus.1
@@:
mov [eax],dword zoom_factors.max
jmp zoom_plus.1
;---------------------------------------------------------------------
capture_image_area:
cmp [scroll_bar_data_vertical.delta2],0
jne .no_capture
cmp [scroll_bar_data_horizontal.delta2],0
jne .no_capture
xor eax,eax
mov [draw_scrollbar_counter],eax
mov eax,[scroll_bar_data_vertical.max_area]
cmp eax,[scroll_bar_data_vertical.cur_area]
jbe @f
inc [draw_scrollbar_counter]
@@:
mov eax,[scroll_bar_data_horizontal.max_area]
cmp eax,[scroll_bar_data_horizontal.cur_area]
jbe @f
inc [draw_scrollbar_counter]
@@:
cmp [draw_scrollbar_counter],0
je still
mov eax,[mouse_position]
xor ebx,ebx
mov bx,ax ; EBX mouse y
shr eax,16 ; EAX mouse x
mov ecx,[image_start_coordinates]
xor edx,edx
mov dx,cx ; EDX start y
shr ecx,16 ; ECX start x
cmp ax,cx
jb still ; min x
cmp bx,dx
jb still ; min y
add cx,[wa_width_2]
cmp ax,cx
ja still ; max x
add dx,[wa_high_2]
cmp bx,dx
ja still ; max y
mov ecx,[mouse_keys]
test ecx,1b ; left button
jz .no_capture ;still
mov ecx,[mouse_keys_old]
test ecx,1b ; left button old
jz .no_capture ;still
mov [capture_image_area_flag],1
mov ecx,[mouse_position_old]
xor edx,edx
mov dx,cx ; EDX mouse y old
shr ecx,16 ; ECX mouse x old
cmp eax,ecx
je .y
ja @f
sub ecx,eax
add [scroll_bar_data_horizontal.position],ecx
jmp .y
@@:
sub eax,ecx
cmp eax,[scroll_bar_data_horizontal.position]
jb @f
xor eax,eax
mov [scroll_bar_data_horizontal.position],eax
jmp .y
@@:
sub [scroll_bar_data_horizontal.position],eax
.y:
cmp ebx,edx
je .draw
ja @f
sub edx,ebx
add [scroll_bar_data_vertical.position],edx
jmp .draw
@@:
sub ebx,edx
cmp ebx,[scroll_bar_data_vertical.position]
jb @f
xor eax,eax
mov [scroll_bar_data_vertical.position],eax
jmp .draw
@@:
sub [scroll_bar_data_vertical.position],ebx
.draw:
call drawimage
call draw_scrollbars
jmp still
.no_capture:
mov [capture_image_area_flag],0
.end:
jmp still
;---------------------------------------------------------------------

View File

@ -0,0 +1,3 @@
@fasm -m 16384 cnv_bmp.asm cnv_bmp.obj
@kpack cnv_bmp.obj
@pause

View File

@ -0,0 +1,10 @@
#!/bin/bash
# This script does for Linux the same as build.bat for DOS,
# it compiles the current KolibriOS applications
fasm -m 16384 cnv_bmp.asm cnv_bmp.obj
kpack cnv_bmp.obj
exit 0

View File

@ -0,0 +1,660 @@
;*****************************************************************************
; BMP to RAW convert plugin - for zSea image viewer
; Copyright (c) 2008-2011, Marat Zakiyanov aka Mario79, aka Mario
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:
; * Redistributions of source code must retain the above copyright
; notice, this list of conditions and the following disclaimer.
; * Redistributions in binary form must reproduce the above copyright
; notice, this list of conditions and the following disclaimer in the
; documentation and/or other materials provided with the distribution.
; * Neither the name of the <organization> nor the
; names of its contributors may be used to endorse or promote products
; derived from this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY Marat Zakiyanov ''AS IS'' AND ANY
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;*****************************************************************************
format MS COFF
public EXPORTS
section '.flat' code readable align 16
;include 'macros.inc'
include '../../../../macros.inc'
;---------------------------------------------------------------------
START:
pushad
mov eax,dword [esp+36]
call .check_header
je @f
.no_bmp_file:
xor eax,eax
mov [raw_area],eax
inc eax ; data corrupt eax = 1
jmp .ret
.check_header:
mov [pointer],eax
mov eax,[eax]
mov [image_file],eax
cmp [eax],word 'BM'
ret
;---------------------------------------------------------------------
@@:
mov [MinusHeight],byte 0
mov edx,[eax+22]
test edx,0x80000000
jz @f
neg edx
mov [eax+22],edx
mov [MinusHeight],byte 1
@@:
xor edx,edx
mov dx,[eax+28] ; color resolution 1,4,8,16,24,32 bits
; mov [ebx+16],edx ; store resolution BMP
mov [resolution],edx
mov ecx,[eax+30]
mov [compression],ecx
;---------------------------------------------------------------------
mov ecx,[eax+18] ; width BMP
imul ecx,edx ;[resolution]
mov edi,ecx
shr ecx,3
test edi,7
jz @f
inc ecx
@@:
imul ecx,[eax+22] ; size of pixels data area
;---------------------------------------------------------------------
cmp edx,16
jae .get_memory ; no palette
mov eax,4
xchg cl,dl
shl eax,cl
xchg cl,dl
add ecx,eax ; palette size
;---------------------------------------------------------------------
.get_memory:
add ecx,44 ; header
mcall 68,12
cmp eax,0
jne @f
xor eax,eax
mov [raw_area],eax
mov eax,2 ; not enough memory
jmp .ret
@@:
mov [raw_area],eax
;---------------------------------------------------------------------
mov edi,eax
xor eax,eax
shr ecx,2
cld
rep stosd ; clear memory
;---------------------------------------------------------------------
; Create RAW header
;---------------------------------------------------------------------
mov eax,[raw_area]
mov [eax],dword 'RAW '
mov ebx,[image_file]
;---------------------------------------------------------------------
mov ecx,[ebx+18] ; width BMP
mov [eax+4],ecx ; width RAW
;---------------------------------------------------------------------
mov ecx,[ebx+22] ; high BMP
mov [eax+8],ecx ; high RAW
;---------------------------------------------------------------------
mov ecx,[resolution] ; color resolution BMP
mov [eax+12],ecx ; color resolution RAW
;---------------------------------------------------------------------
mov ecx,[resolution]
cmp ecx,16
jb .1
push eax
mov eax,ecx
mov ecx,3
xor edx,edx
div ecx
cmp eax,8
jbe @f
mov eax,8
@@:
mov ecx,eax
pop eax
.1:
mov [eax+16],cx ; channel color resolution RAW
;---------------------------------------------------------------------
mov ecx,[resolution]
cmp ecx,16
jae @f
mov [eax+18],word 1 ; channels amount RAW
jmp .2
@@:
mov [eax+18],word 3 ; channels amount RAW
.2:
;---------------------------------------------------------------------
xor edx,edx
cmp ecx,16
jae @f
add edx,44
@@:
mov [eax+20],edx ; palette pointer (offset from file start)
;---------------------------------------------------------------------
mov ecx,[resolution]
cmp ecx,16
jae @f
mov ecx,[resolution]
push eax
mov eax,1
shl eax,cl
mov ecx,eax
pop eax
shl ecx,2
jmp .3
@@:
xor ecx,ecx
.3:
mov [eax+24],ecx ; palette area size
;---------------------------------------------------------------------
add ecx,dword 44
mov [eax+28],ecx ; pixels pointer (offset from file start)
;---------------------------------------------------------------------
mov ecx,[ebx+18] ; width BMP
imul ecx,[resolution]
mov edi,ecx
shr ecx,3
test edi,7
jz @f
inc ecx
@@:
imul ecx,[ebx+22] ; high BMP
mov [eax+32],ecx ; pixels area size
;---------------------------------------------------------------------
xor ecx,ecx ; Stub!!!
mov [eax+36],ecx ; Transparency pointer (offset from file start)
mov [eax+40],ecx ; Transparency area size
;---------------------------------------------------------------------
; Finish create RAW header
;---------------------------------------------------------------------
; mov ebx,[pointer]
; mov [ebx+4],eax ; store [soi] pointer of image area
; mov ecx,eax
.convert:
cmp [resolution],16
jae .no_palette
; mov [ebx+24],eax
; mov edi,eax
mov edi,[raw_area]
mov edi,[edi+20] ; palette pointer (offset from file start)
add edi,[raw_area]
mov esi,[image_file]
add esi,54
mov ecx,[resolution]
mov eax,1
shl eax,cl
mov ecx,eax
rep movsd
; mov [ebx+4],edi ; store [soi] pointer of image area
.no_palette:
mov ecx,[raw_area]
mov ecx,[ecx+28] ; pixels pointer (offset from file start)
add ecx,[raw_area]
;---------------------------------------------------------------------
mov eax,[image_file]
mov ebp,[eax+18] ; width BMP
; mov [ebx+8],ebp ; store width
imul ebp,[resolution]
mov edi,ebp
shr ebp,3 ; ebp = size of output scanline
test edi,7
jz @f
inc ebp
@@:
mov eax,[eax+22] ; high BMP
; mov [ebx+12],eax ; store high
dec eax
mul ebp
add eax,ecx
mov edi,ecx
mov bl,[MinusHeight]
test bl,bl
jnz @f
mov edi,eax ; edi points to last scanline
@@:
mov esi,[image_file]
add esi,[esi+10] ; start of pixels data
mov ebx,[image_file]
mov edx,[ebx+22] ; high BMP
add ebx,54
lea eax,[ebp*2]
mov [delta],eax
test edx,edx
jz .ret
jns @f
neg edx
and [delta], 0
mov edi,ecx
@@:
;---------------------------------------------------------------------
cmp [compression],3
je .BI_BITFIELDS ; @f
cmp [compression],2
je RLE4
cmp [compression],1
je RLE8
cmp [compression],0
je @f
jmp .no_bmp_file
;---------------------------------------------------------------------
@@:
cmp [resolution],16
jne .continue
mov ebx,[raw_area]
mov [ebx+12],dword 15
jmp .continue
;---------------------------------------------------------------------
.BI_BITFIELDS:
cmp [resolution],32
je .32
cmp [resolution],16
jne .continue
mov ebx,[raw_area]
mov eax,[image_file]
cmp [eax+54],dword 0x7C00
jne @f
mov [ebx+12],dword 15
jmp .continue
;---------------------------------------------------------------------
@@:
cmp [eax+54],dword 0xF800
jne @f
mov [ebx+12],dword 16
jmp .continue
;---------------------------------------------------------------------
@@:
cmp [eax+54],dword 0xF00
jne .no_bmp_file ; @f
mov [ebx+12],dword 15
@@:
mov ebx,ebp
neg ebx
and ebx,3
mov [aligner],ebx
shr ebp,1
mov cl,[MinusHeight]
test cl,cl
jnz .start_16_1
align 4
.start_16:
mov ecx,ebp
call .process_16b_x4r4g4b4
sub edi,[delta]
add esi,[aligner]
dec edx
jnz .start_16
jmp .ret_ok
;---------------------------------------------------------------------
.process_16b_x4r4g4b4:
cld
@@:
lodsw
xor ebx,ebx
mov bx,ax
xor eax,eax
ror ebx,8
and bl,0xf
mov al,bl
shl eax,6
rol ebx,4
and bx,0xf
shl bl,1
add ax,bx
shl eax,5
rol ebx,4
and bx,0xf
shl bl,1
add ax,bx
stosw
dec ecx
jnz @r
ret
;---------------------------------------------------------------------
.start_16_1: ;negative value of Height
mov ecx,ebp
call .process_16b_x4r4g4b4
add esi,[aligner]
dec edx
jnz .start_16_1
jmp .ret_ok
;---------------------------------------------------------------------
.32:
mov eax,[image_file]
cmp [eax+54],dword 0xFF000000
jne .no_bmp_file
shr ebp,2
mov al,[MinusHeight]
test al,al
jnz .start_32_1
align 4
.start_32:
mov ecx,ebp
@@:
cld
lodsd
shr eax,8
stosd
dec ecx
jnz @r
sub edi,[delta]
dec edx
jnz .start_32
jmp .ret_ok
;---------------------------------------------------------------------
.start_32_1: ;negative value of Height
mov ecx,ebp
imul ecx,edx
@@:
cld
lodsd
shr eax,8
stosd
dec ecx
jnz @r
jmp .ret_ok
;---------------------------------------------------------------------
.continue:
mov eax,ebp
neg eax
and eax,3
mov cl,[MinusHeight]
test cl,cl
jz .start_24
cld
align 4
@@: ;negative value of Height
mov ecx,ebp
rep movsb
add esi,eax
dec edx
jnz @r
jmp .ret_ok
;---------------------------------------------------------------------
align 4
.start_24:
@@:
mov ecx,ebp
rep movsb
sub edi,[delta]
add esi,eax
dec edx
jnz .start_24 ; @r
.ret_ok:
mov eax,0 ; convert OK
.ret:
mov ebx,[pointer]
mov [ebx+8],eax ; store return code
mov eax,[raw_area]
mov [ebx+4],eax ; store RAW pointer
popad
ret 4
;---------------------------------------------------------------------
RLE4:
cmp [resolution],4
jne START.no_bmp_file
xor ebx,ebx
xor edx,edx
align 4
.start:
cld
lodsb
cmp al,0
jnz .Encoded_Mode
cld
lodsb
cmp al,0
jz .end_line
cmp al,1
jz START.ret_ok ; .end_bitmap
cmp al,2
jz .Delta
.Absolute_Mode:
xor ecx,ecx
mov cl,al
add ebx,ecx
cmp dl,0
je @f
mov dh,[esi]
shr dh,4
mov dl,[edi-1]
and dl,11110000b
add dl,dh
mov [edi-1],dl
dec ecx
xor edx,edx
mov dh,1
@@:
test cl,1b
jz @f
inc ecx
inc edx
@@:
shr ecx,1
cmp dh,1
je .1
mov eax,ecx
cld
rep movsb
test eax,1b
jz @f
inc esi
@@:
jmp .start
;---------------------------------------------------------------------
.1:
mov dh,cl
@@:
cld
lodsb
mov ah,[esi]
shl al,4
shr ah,4
add al,ah
cld
stosb
dec ecx
jnz @r
test dh,1b
jz @f
inc esi
@@:
xor dh,dh
jmp .start
;---------------------------------------------------------------------
.Encoded_Mode:
xor ecx,ecx
mov cl,al
add ebx,ecx
cld
lodsb
cmp dl,0
je @f
rol al,4
mov dh,al
and dh,00001111b
mov dl,[edi-1]
and dl,11110000b
add dl,dh
mov [edi-1],dl
dec ecx
xor edx,edx
@@:
test cl,1b
jz @f
inc ecx
inc edx
@@:
shr ecx,1
cld
rep stosb
cmp dl,0
je @f
mov al,[edi-1]
and al,11110000b
mov [edi-1],al
@@:
jmp .start
;---------------------------------------------------------------------
.Delta:
xor eax,eax
cld
lodsb
add ebx,eax
cmp dl,0
je @f
dec eax
xor edx,edx
@@:
test al,1b
jz @f
inc eax
inc edx
@@:
shr eax,1
add edi,eax
cld
lodsb
imul eax,ebp
sub edi,eax
jmp .start
;---------------------------------------------------------------------
.end_line:
mov eax,ebp
test ebx,1b
jz @f
inc ebx
@@:
shr ebx,1
sub eax,ebx
add edi,eax
sub edi,[delta]
xor ebx,ebx
xor edx,edx
jmp .start
;---------------------------------------------------------------------
RLE8:
cmp [resolution],8
jne START.no_bmp_file
xor ebx,ebx
align 4
.start:
cld
lodsb
cmp al,0
jnz .Encoded_Mode
cld
lodsb
cmp al,0
jz .end_line
cmp al,1
jz START.ret_ok ; .end_bitmap
cmp al,2
jz .Delta
.Absolute_Mode:
xor ecx,ecx
mov cl,al
add ebx,ecx
mov eax,ecx
cld
rep movsb
test eax,1b
jz @f
inc esi
@@:
jmp .start
;---------------------------------------------------------------------
.Encoded_Mode:
xor ecx,ecx
mov cl,al
add ebx,ecx
cld
lodsb
rep stosb
jmp .start
;---------------------------------------------------------------------
.Delta:
xor eax,eax
cld
lodsb
add edi,eax
add ebx,eax
cld
lodsb
imul eax,ebp
sub edi,eax
jmp .start
;---------------------------------------------------------------------
.end_line:
mov eax,ebp
sub eax,ebx
add edi,eax
xor ebx,ebx
sub edi,[delta]
jmp .start
;---------------------------------------------------------------------
Check_Header:
pushad
mov eax,dword [esp+36]
call START.check_header
jne START.no_bmp_file
popad
ret 4
;---------------------------------------------------------------------
Associations:
dd Associations.end - Associations
db 'BMP',0
.end:
db 0
;---------------------------------------------------------------------
align 16
EXPORTS:
dd szStart, START
dd szVersion, 0x00010002
dd szCheck, Check_Header
dd szAssoc, Associations
dd 0
pointer dd 0
image_file dd 0
delta dd 0
aligner dd 0
resolution dd 0
compression dd 0
raw_area dd 0
MinusHeight db 0
szStart db 'START',0
szVersion db 'version',0
szCheck db 'Check_Header',0
szAssoc db 'Associations',0
;---------------------------------------------------------------------

View File

@ -0,0 +1,3 @@
@fasm -m 16384 convert.asm convert.obj
@kpack convert.obj
@pause

View File

@ -0,0 +1,10 @@
#!/bin/bash
# This script does for Linux the same as build.bat for DOS,
# it compiles the current KolibriOS applications
fasm -m 16384 convert.asm convert.obj
kpack convert.obj
exit 0

View File

@ -0,0 +1,496 @@
;*****************************************************************************
; RAW to RAW convert plugin - for zSea image viewer
; Copyright (c) 2008-2011, Marat Zakiyanov aka Mario79, aka Mario
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:
; * Redistributions of source code must retain the above copyright
; notice, this list of conditions and the following disclaimer.
; * Redistributions in binary form must reproduce the above copyright
; notice, this list of conditions and the following disclaimer in the
; documentation and/or other materials provided with the distribution.
; * Neither the name of the <organization> nor the
; names of its contributors may be used to endorse or promote products
; derived from this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY Marat Zakiyanov ''AS IS'' AND ANY
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;*****************************************************************************
; Convert:
; 16b in 8b
; 1b,2b,3b in 8b
format MS COFF
public EXPORTS
section '.flat' code readable align 16
;include 'macros.inc'
include '../../../../macros.inc'
;---------------------------------------------------------------------
START:
pushad
mov [pointer],eax
mov eax,[eax+4]
mov [image_file],eax
mov esi,[eax+28]
add esi,eax
mov edi,esi
mov ecx,[eax+32]
; xor ebx,ebx
; mov [raw_area],ebx
; mov ebx,[pointer]
; movzx eax,word [eax+18]
; mov [ebx+24],eax
; jmp .ret_ok
cmp [eax+16],word 16
je .16b
cmp [eax+12],dword 1
je .1b
cmp [eax+12],dword 2
je .2b
cmp [eax+12],dword 4
je .4b
;---------------------------------------------------------------------
.ret_ok:
; mov ebx,[pointer]
; mov eax,[raw_area]
; mov [ebx+20],eax ; store RAW pointer
; mov [ebx+24],ecx
mov ebx,[image_file]
cmp [ebx+18],word 2
jne @f
mov eax,[ebx+12]
shr eax,1
mov [ebx+12],eax
@@:
popad
ret
;---------------------------------------------------------------------
.less_8b:
mov edx,[image_file]
mov ecx,[area_size]
add ecx,[edx+28]
mcall 68,20
mov [image_file],eax
mov ecx,[area_size]
mov eax,ecx
shr ecx,2
test eax,3
jz @f
inc ecx
@@:
mov esi,[raw_area]
mov edi,[image_file]
add edi,[edi+28]
cld
rep movsd
mov ecx,[raw_area]
mcall 68,13
mov eax,[image_file]
mov ebx,[pointer]
mov [ebx+4],eax
popad
ret
;---------------------------------------------------------------------
.16b:
cmp [eax+18],word 3
je @f ;.convert_16_in_8
cmp [eax+18],word 4
jne .16b_1
@@:
xor ebx,ebx
mov bx,[eax+18]
xchg eax,ecx
xor edx,edx
div ebx
xchg ecx,eax
shr ecx,1
mov [eax+16],word 8
mov ebx,[eax+12]
shr ebx,1
mov [eax+12],ebx
mov ebx,eax
; jmp .ret_ok
.convert_16_in_8: ; converting 16 bit sample to 8 bit
cld
lodsw
mov al,ah
stosb
lodsw
mov al,ah
stosb
lodsw
mov al,ah
stosb
cmp [ebx+18],word 4
jne @f
lodsw
mov al,ah
stosb
@@:
dec ecx
jnz .convert_16_in_8
jmp .16b_end
;---------------------------------------------------------------------
.16b_1:
cmp [eax+18],word 1
je @f ;.convert_16_in_8_1
cmp [eax+18],word 2
jne .16b_end
@@:
shr ecx,1
mov [eax+16],word 8
mov ebx,[eax+12]
shr ebx,1
mov [eax+12],ebx
.convert_16_in_8_1:
cld
lodsw
; shr ax,8
; mov al,ah
stosb
dec ecx
jnz .convert_16_in_8_1
;---------------------------------------------------------------------
.16b_end:
xor eax,eax
mov [raw_area],eax
jmp .ret_ok
;---------------------------------------------------------------------
.4b:
call .get_memory
mov edx,ebx
inc ebx
shr ebx,1
.4b_1:
push ebx edi
@@:
cld
lodsb
shl eax,8
mov al,ah
and ah,0xf
shr al,4
stosw
dec ebx
jnz @b
pop edi ebx
add edi,edx
dec ecx
jnz .4b_1
jmp .less_8b ;.ret_ok
;---------------------------------------------------------------------
.2b:
call .get_memory
; jmp .ret_ok
; shr ecx,1
mov edx,ebx
mov eax,ebx
shr ebx,2
test eax,3
jz @f
inc ebx
@@:
mov ebp,ebx
.2b_1:
push ebp edi
@@:
cld
lodsb
mov bl,al
and al,11b
shl ax,8
mov al,bl
shr al,2
and al,11b
shl eax,8
mov al,bl
shr al,4
and al,11b
shl eax,8
mov al,bl
shr al,6
and al,11b
stosd
dec ebp
jnz @b
pop edi ebp
add edi,edx
dec ecx
jnz .2b_1
jmp .less_8b ;.ret_ok
;---------------------------------------------------------------------
.1b:
call .get_memory
mov edx,ebx
mov eax,ebx
shr ebx,3
test eax,7
jz @f
inc ebx
@@:
mov ebp,ebx
.1b_1:
push ebp edi
@@:
cld
lodsb
mov bl,al
shr al,4
and al,1b
shl ax,8
mov al,bl
shr al,5
and al,1b
shl eax,8
mov al,bl
shr al,6
and al,1b
shl eax,8
mov al,bl
shr al,7
; and al,1b
; shl eax,8
stosd
mov al,bl
and al,1b
shl ax,8
mov al,bl
shr al,1
and al,1b
shl eax,8
mov al,bl
shr al,2
and al,1b
shl eax,8
mov al,bl
shr al,3
and al,1b
stosd
dec ebp
jnz @b
pop edi ebp
add edi,edx
dec ecx
jnz .1b_1
jmp .less_8b ;.ret_ok
;---------------------------------------------------------------------
.get_memory:
mov ebx,dword 8
mov [eax+16],bx
mov [eax+12],ebx
; mov esi,[eax+28]
; add esi,eax
; push ecx
mov ecx,[eax+4]
imul ecx,[eax+8]
push eax
mov [area_size],ecx
mcall 68,12
; pop ecx
mov [raw_area],eax
mov edi,eax
pop eax
mov ebx,[eax+4]
mov ecx,[eax+8]
ret
;---------------------------------------------------------------------
Convert24b:
pushad
mov [pointer],eax
mov eax,[eax+4]
mov [image_file],eax
mov esi,[eax+28]
add esi,eax
mov ebp,[eax+20]
add ebp,eax
mov ecx,[eax+4]
imul ecx,[eax+8]
push eax ecx
lea ecx,[ecx*3]
mcall 68,12
mov [raw_area],eax
mov edi,eax
pop ecx eax
cmp [eax+12],dword 32
je .32b
cmp [eax+12],dword 16
je .16b
cmp [eax+12],dword 15
je .15b
cmp [eax+12],dword 8
je .8b
.ret_ok:
mov ebx,[pointer]
mov eax,[raw_area]
mov [ebx+20],eax ; store RAW pointer
popad
ret
;---------------------------------------------------------------------
.32b:
cld
lodsd
stosw
shr eax,16
stosb
dec ecx
jnz .32b
jmp .ret_ok
;---------------------------------------------------------------------
.16b:
cld
lodsw
xor ebx,ebx
ror ax,11
mov bl,al
and bl,11111b
shl bl,3
shl ebx,8
rol ax,6
mov bl,al
and bl,111111b
shl bl,2
shl ebx,8
rol ax,5
mov bl,al
and bl,11111b
shl bl,3
mov eax,ebx
cld
stosw
shr eax,16
stosb
dec ecx
jnz .16b
jmp .ret_ok
;---------------------------------------------------------------------
.15b:
cld
lodsw
xor ebx,ebx
ror ax,10
mov bl,al
and bl,11111b
shl bl,3
shl ebx,8
rol ax,5
mov bl,al
and bl,11111b
shl bl,3
shl ebx,8
rol ax,5
mov bl,al
and bl,11111b
shl bl,3
mov eax,ebx
cld
stosw
shr eax,16
stosb
dec ecx
jnz .15b
jmp .ret_ok
;---------------------------------------------------------------------
.8b:
xor eax,eax
cld
lodsb
shl eax,2
mov eax,[eax+ebp]
cld
stosw
shr eax,16
stosb
dec ecx
jnz .8b
jmp .ret_ok
;---------------------------------------------------------------------
align 16
EXPORTS:
dd szStart, START
dd szVersion, 0x00010001
dd szConv_24b, Convert24b
dd 0
szStart db 'START',0
szVersion db 'version',0
szConv_24b db 'Convert24b',0
pointer dd 0
image_file dd 0
;delta dd 0
;resolution dd 0
;compression dd 0
raw_area dd 0
area_size dd 0

View File

@ -0,0 +1,3 @@
@fasm -m 16384 cnv_gif.asm cnv_gif.obj
@kpack cnv_gif.obj
@pause

View File

@ -0,0 +1,10 @@
#!/bin/bash
# This script does for Linux the same as build.bat for DOS,
# it compiles the current KolibriOS applications
fasm -m 16384 cnv_gif.asm cnv_gif.obj
kpack cnv_gif.obj
exit 0

View File

@ -0,0 +1,534 @@
;*****************************************************************************
; GIF to RAW1 convert plugin - for zSea image viewer
; Copyright (c) 2009, Evgeny Grechnikov aka Diamond
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:
; * Redistributions of source code must retain the above copyright
; notice, this list of conditions and the following disclaimer.
; * Redistributions in binary form must reproduce the above copyright
; notice, this list of conditions and the following disclaimer in the
; documentation and/or other materials provided with the distribution.
; * Neither the name of the <organization> nor the
; names of its contributors may be used to endorse or promote products
; derived from this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY Evgeny Grechnikov ''AS IS'' AND ANY
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;*****************************************************************************
; Based on gif_lite.inc (c) Ivuskin Andrey aka Willow and Diamond 2004-2007
;*****************************************************************************
; Some small changes (c) 2011 Marat Zakiyanov aka Mario79, aka Mario
;*****************************************************************************
format MS COFF
public EXPORTS
section '.flat' code readable align 16
START:
pushad
mov eax,dword [esp+36]
mov esi, [eax] ; esi -> GIF data
mov ebp, [eax+12] ; ebp = file size
xor ebx, ebx ; ebx -> list of images, not allocated yet
call check_header_1
jz ReadGIF
ReadGIF.end:
; general exit from the function
xor eax, eax
cmp ebx, eax
jz .bad
cmp dword [ebx+4], eax
jnz ReadGIF.ret
mov ecx, ebx
push 68
pop eax
push 13
pop ebx
int 40h
xor ebx, ebx
.bad:
inc eax ; bad image
ReadGIF.ret:
mov ecx, [esp+28]
mov [ecx+4], ebx ; save RAW data ptr
mov [ecx+8], eax ; save result
popad
ret 4
ReadGIF.animated.ret:
mov ebx, [ReadGIF.gifList]
jmp ReadGIF.ret
_null fix 0x1000
ReadGIF:
; allocate one page for list of images
mov ecx, 0x1000
push 68
pop eax
push 12
pop ebx
int 40h
xchg eax, ebx
test ebx, ebx
jnz @f
mov al, 2 ; no memory
jmp .ret
@@:
mov dword[ebx],'RAW1'
xor eax,eax
mov [.globalColor],eax
mov [.globalColorSize],eax
mov [.curImageIndex],eax
sub ebp,0xd
jb .end
movzx eax,word[esi+6]
mov [ebx+8],eax
movzx eax,word[esi+8]
mov [ebx+12],eax
mov cl,[esi+0xa]
add esi,0xd
test cl,cl
jns .nextblock
mov [.globalColor],esi
push ebx
call .Gif_skipmap
mov [.globalColorSize],ebx
pop ebx
jb .end
.nextblock:
dec ebp
js .end
cmp byte[esi],0x21
jne .noextblock
inc esi
cmp byte[esi],0xf9 ; Graphic Control Ext
jne .no_gc
sub ebp,7
jc .end
mov ecx,[ebx+4]
shl ecx,4
add ecx,ebx
mov eax,[esi+3]
mov [ecx+16+12],ax
; test byte[esi+2],1
; setnz byte[ecx+16+14]
mov al,[esi+2]
mov [ecx+16+14], al
mov al,[esi+5]
mov [ecx+16+15],al
add esi,7
jmp .nextblock
.no_gc:
inc esi
xor eax,eax
.block_skip:
dec ebp
js .end
lodsb
add esi,eax
sub ebp,eax
jc .end2
test eax,eax
jnz .block_skip
jmp .nextblock
.noextblock:
cmp byte[esi],0x2c ; image beginning
jne .end
inc esi
sub ebp,11
jc .end2
movzx ecx,word[esi+4] ; ecx = width
jecxz .end2
mov [.width],ecx
movzx eax,word[esi+6] ; eax = height
test eax,eax
jz .end2
push eax ecx
imul ecx,eax
cmp ecx,4000000h
jb @f
pop ecx eax
.end2:
jmp .end
@@:
push ebx
push ecx
add ecx,44+256*4
push 68
pop eax
push 12
pop ebx
int 0x40
pop ecx
pop ebx
test eax,eax
jnz @f
pop ecx ecx
jmp .end2
@@:
xchg eax,edi
inc dword[ebx+4]
mov [edi+32],ecx ; size of pixels area
mov byte[edi+20],44 ; pointer to palette
mov byte[edi+24+1],4 ; size of palette=256*4
mov dword[edi+28],44+256*4 ; pointer to RAW data
pop ecx eax
mov dword[edi], 'RAW ' ; signature
mov dword[edi+4],ecx ; width
mov dword[edi+8],eax ; height
mov byte[edi+12],8 ; total pixel size
mov byte[edi+16],8 ; 8 bits per component
mov byte[edi+18],1 ; number of components
mov eax,[ebx+4]
shl eax,4
add eax,ebx
mov [eax],edi
movzx ecx,word[esi]
mov [eax+4],ecx
movzx ecx,word[esi+2]
mov [eax+8],ecx
mov eax,[edi+32]
mov [.img_end],eax
inc eax
mov [.row_end],eax
and [.pass],0
test byte[esi+8],40h
jz @f
mov ecx,[edi+4]
mov [.row_end],ecx
@@:
mov cl,[esi+8]
add esi,9
add edi,44
push edi
test cl,cl
js .uselocal
push esi
mov esi,[.globalColor]
mov ecx,[.globalColorSize]
call .swap_palette
pop esi
jmp .setPal
.uselocal:
push ebx
call .Gif_skipmap
jnc @f
pop ebx
pop edi
jmp .end
@@:
sub esi,ebx
mov ecx,ebx
pop ebx
call .swap_palette
.setPal:
movzx ecx,byte[esi]
inc ecx
mov [.codesize],ecx
dec ecx
inc esi
mov edi,.gif_workarea
xor eax,eax
lodsb ; eax - block_count
add eax,esi
mov [.block_ofs],eax
mov [.bit_count],8
mov eax,1
shl eax,cl
mov [.CC],eax
mov ecx,eax
inc eax
mov [.EOI],eax
mov eax, _null shl 16
.filltable:
stosd
inc eax
loop .filltable
pop edi
add edi,256*4
mov [.img_start],edi
add [.img_end],edi
add [.row_end],edi
mov [.ebx],ebx
.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 .unpend
call .Gif_output
.add:
mov dword [.gif_workarea+edx*4],ebx
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
.unpend:
mov ebx,[.ebx]
add ebp,esi
mov esi,[.block_ofs]
sub ebp,esi
jc .end2
xor eax,eax
@@:
dec ebp
js .end2
lodsb
test eax,eax
jz @f
sub ebp,eax
jc .end2
add esi,eax
jmp @b
@@:
test ebp,ebp
jz .end2
cmp byte[esi],0x3b
jz .end2
; next image
mov ecx,[ebx+4]
cmp cl,0xFF
jnz .noresize
mov edx,ebx
inc ecx
inc ecx
shl ecx,4
push 68
pop eax
push 20
pop ebx
int 40h
test eax,eax
jnz @f
mov ebx,edx
jmp .end2
@@:
xchg ebx,eax
.noresize:
jmp .nextblock
.Gif_skipmap:
; in: ecx - image descriptor, esi - pointer to colormap
; out: edi - pointer to area after colormap
and ecx,111b ; color map size
mov ebx,3*2
shl ebx,cl
add esi,ebx
sub ebp,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
dec ebp
js .dataend
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
.dataend:
pop eax eax
mov ebx, [.ebx]
jmp .end2
.Gif_output:
push esi eax edx
mov edx,.gif_workarea
.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
stosb
cmp edi,[.row_end]
jb .norowend
mov eax,[.width]
push eax
sub edi,eax
add eax,eax
cmp [.pass],3
jz @f
add eax,eax
cmp [.pass],2
jz @f
add eax,eax
@@:
add edi,eax
pop eax
cmp edi,[.img_end]
jb .nextrow
mov edi,[.img_start]
inc [.pass]
add edi,eax
cmp [.pass],3
jz @f
add edi,eax
cmp [.pass],2
jz @f
add edi,eax
add edi,eax
@@:
.nextrow:
add eax,edi
mov [.row_end],eax
xor eax,eax
.norowend:
loop .loop2
pop edx eax esi
ret
.swap_palette:
xor eax,eax
@@:
lodsb
mov ah,al
lodsb
shl eax,8
lodsb
stosd
sub ecx,3
jnz @b
ret
;---------------------------------------------------------------------
check_header_1:
and dword [eax+8], 0
cmp dword [eax+12], 6
jb .err
push eax
mov eax, [eax]
cmp dword [eax], 'GIF8'
jnz .errpop
cmp byte [eax+5], 'a'
jnz .errpop
cmp byte [eax+4], '7'
jz @f
cmp byte [eax+4], '9'
jnz .errpop
@@:
pop eax
ret
.errpop:
pop eax
.err:
inc dword [eax+8]
ret
;---------------------------------------------------------------------
check_header:
pushad
mov eax,dword [esp+36]
call check_header_1
popad
ret 4
;---------------------------------------------------------------------
Associations:
dd Associations.end - Associations
db 'GIF',0
.end:
db 0
;---------------------------------------------------------------------
align 4
EXPORTS:
dd szStart, START
dd szVersion, 0x00010002
dd szCheck, check_header
dd szAssoc, Associations
dd 0
szStart db 'START',0
szVersion db 'version',0
szCheck db 'Check_Header',0
szAssoc db 'Associations',0
section '.data' data readable writable align 16
ReadGIF.globalColor rd 1
ReadGIF.globalColorSize rd 1
ReadGIF.cur_info rd 1 ; image table pointer
ReadGIF.codesize rd 1
ReadGIF.compsize rd 1
ReadGIF.bit_count rd 1
ReadGIF.CC rd 1
ReadGIF.EOI rd 1
ReadGIF.block_ofs rd 1
ReadGIF.row_end rd 1
ReadGIF.img_end rd 1
ReadGIF.img_start rd 1
ReadGIF.pass rd 1
ReadGIF.width rd 1
ReadGIF.ebx rd 1
ReadGIF.gifList rd 1
ReadGIF.curImageIndex rd 1
ReadGIF.gif_workarea rb 16*1024

View File

@ -0,0 +1,3 @@
@fasm -m 16384 cnv_jpeg.asm cnv_jpeg.obj
@kpack cnv_jpeg.obj
@pause

View File

@ -0,0 +1,10 @@
#!/bin/bash
# This script does for Linux the same as build.bat for DOS,
# it compiles the current KolibriOS applications
fasm -m 16384 cnv_jpeg.asm cnv_jpeg.obj
kpack cnv_jpeg.obj
exit 0

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,3 @@
@fasm -m 16384 cnv_png.asm cnv_png.obj
@kpack cnv_png.obj
@pause

View File

@ -0,0 +1,10 @@
#!/bin/bash
# This script does for Linux the same as build.bat for DOS,
# it compiles the current KolibriOS applications
fasm -m 16384 cnv_png.asm cnv_png.obj
kpack cnv_png.obj
exit 0

View File

@ -0,0 +1,896 @@
;*****************************************************************************
; PNG to RAW convert plugin - for zSea image viewer
; Copyright (c) 2008-2011, Marat Zakiyanov aka Mario79, aka Mario
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:
; * Redistributions of source code must retain the above copyright
; notice, this list of conditions and the following disclaimer.
; * Redistributions in binary form must reproduce the above copyright
; notice, this list of conditions and the following disclaimer in the
; documentation and/or other materials provided with the distribution.
; * Neither the name of the <organization> nor the
; names of its contributors may be used to endorse or promote products
; derived from this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY Marat Zakiyanov ''AS IS'' AND ANY
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;*****************************************************************************
format MS COFF
public EXPORTS
section '.flat' code readable align 16
;include 'macros.inc'
include '../../../../macros.inc'
;---------------------------------------------------------------------
START:
pushad
mov eax,dword [esp+36]
call check_header_1
je header_OK
;---------------------------------------------------------------------
no_png_file:
xor eax,eax
mov [raw_area],eax
inc eax ; data corrupt eax = 1
jmp header_OK.ret
;---------------------------------------------------------------------
check_header_1:
mov [pointer],eax
mov ebx,[eax]
mov [image_file],ebx
cmp [ebx],dword 0x474E5089 ; check main label p.1
jne @f ;no_png_file
cmp [ebx+4],dword 0x0A1A0A0D ; check main label p.2
ret
@@:
add esp,4
jmp no_png_file
;---------------------------------------------------------------------
header_OK:
mov ebx,[eax+12] ; file size
mov [file_size],ebx
;---------------------------------------------------------------------
mov ebx,[eax+16]
mov [deflate_unpack],ebx
;---------------------------------------------------------------------
mov ebx,[pointer]
;---------------------------------------------------------------------
xor eax,eax
; mov [IDAT.pointer],eax
; mov [IDAT.size],eax
mov [deflate_start_offset],eax
mov eax,[image_file]
mov [next_Chunk],eax
call search_IHDR
call search_IDAT
; call search_IEND
;---------------------------------------------------------------------
mov eax,[IHDR.pointer]
mov ecx,[eax] ; get width PNG
call convert_NBO_to_PC
mov [IHDR_data.Width],ecx ; store width PNG
mov [Image_Width],ecx
mov ecx,[eax+4] ; get height PNG
call convert_NBO_to_PC
mov [IHDR_data.Height],ecx ; store height PNG
mov [Image_Height],ecx
mov ecx,[eax+9] ; Color type
; Compression method
; Filter method
; Interlace method
mov [IHDR_data.Color_type],ecx
xor ecx,ecx
mov cl,[eax+8] ; Bit depth
mov [IHDR_data.Bit_depth],cl
;---------------------------------------------------------------------
mov al,[eax+9] ; check Color type
cmp al,byte 0 ; Each pixel is a grayscale sample.
je .resolution
cmp al,byte 2 ; Each pixel is an R,G,B triple.
je .Bit_depth_2
cmp al,byte 3 ; Each pixel is a palette index
; a PLTE chunk must appear.
jne .no_PLTE
call search_PLTE
jmp .resolution
.no_PLTE:
cmp al,byte 4 ; Each pixel is a grayscale sample,
; followed by an alpha sample.
je .Bit_depth_4
cmp al,byte 6 ; Each pixel is an R,G,B triple,
; followed by an alpha sample.
jne no_png_file
;---------------------------------------------------------------------
.Bit_depth_6:
shl ecx,1
.Bit_depth_4:
shl ecx,1
jmp .resolution
.Bit_depth_2:
lea ecx,[ecx*3]
.resolution:
;---------------------------------------------------------------------
cmp [IHDR_data.Compression_method], byte 0 ; check Compression method
jne no_png_file
cmp [IHDR_data.Filter_method], byte 0 ; check Filtering method
jne no_png_file
cmp [IHDR_data.Interlace_method], byte 0 ; No Interlaced
je @f
cmp [IHDR_data.Interlace_method], byte 1 ; Interlaced
jne no_png_file
@@:
;---------------------------------------------------------------------
mov [resolution],ecx
imul ecx,[IHDR_data.Width]
mov edi,ecx
shr ecx,3
test edi,7
jz @f
inc ecx
@@:
imul ecx,[IHDR_data.Height]
cmp [IHDR_data.Color_type],byte 3
jne @f
mov eax,[PLTE.size]
mov ebx,3
xor edx,edx
div ebx
shl eax,2
add ecx,eax ; PLTE table area
jmp .RAW_header
;--------------------------------------
@@:
cmp [IHDR_data.Color_type],byte 0
je @f
cmp [IHDR_data.Color_type],byte 4
jne .RAW_header
@@:
push ecx
mov eax,1
movzx ecx,byte [IHDR_data.Bit_depth]
cmp ecx,16
jne @f
shr ecx,1
@@:
shl eax,cl
shl eax,2
pop ecx
add ecx,eax
; mov ebx,[pointer]
; mov [ebx+20],eax
;--------------------------------------
.RAW_header:
add ecx,44 ; RAW header
; mov ebx,[pointer]
; mov [ebx+24],ecx
; shl ecx,1
mcall 68, 12
cmp eax,0
jne @f
xor eax,eax
mov [raw_area],eax ; store pointer of image area
mov eax,2 ; not enough memory
jmp .ret
@@:
mov [raw_area],eax
; mov ebx,[pointer]
; mov [ebx+28],eax
;---------------------------------------------------------------------
mov edi,eax
xor eax,eax
shr ecx,2
cld
rep stosd ; clear memory
;---------------------------------------------------------------------
; Create RAW header
;---------------------------------------------------------------------
mov eax,[raw_area]
mov [eax],dword 'RAW '
;---------------------------------------------------------------------
mov ecx,[IHDR_data.Width] ; width BMP
mov [eax+4],ecx ; width RAW
;---------------------------------------------------------------------
mov ecx,[IHDR_data.Height] ; high BMP
mov [eax+8],ecx ;high RAW
;---------------------------------------------------------------------
mov ecx,[resolution] ; color resolution BMP
mov [eax+12],ecx ;color resolution RAW
;---------------------------------------------------------------------
xor ecx,ecx
mov cl,[IHDR_data.Bit_depth]
mov [eax+16],cx ;channel color resolution RAW
;---------------------------------------------------------------------
mov ecx,[IHDR_data.Color_type]
xor ebx,ebx
inc ebx
cmp cl,byte 0 ; Each pixel is a grayscale sample.
je .1
cmp cl,byte 2 ; Each pixel is an R,G,B triple.
je .Bit_depth_2_1
cmp cl,byte 3 ; Each pixel is a palette index
; a PLTE chunk must appear.
je .1
cmp cl,byte 4 ; Each pixel is a grayscale sample,
; followed by an alpha sample.
je .Bit_depth_4_1
cmp cl,byte 6
jne no_png_file
.Bit_depth_6_1:
shl ebx,1
.Bit_depth_4_1:
shl ebx,1
jmp .1
.Bit_depth_2_1:
lea ebx,[ebx*3]
.1:
mov [eax+18],bx ; channels amount RAW
;---------------------------------------------------------------------
xor edx,edx
cmp cl,byte 3 ; Each pixel is a palette index
; a PLTE chunk must appear.
je @f
cmp cl,0
je @f
cmp cl,4
jne .no_PLTE_1
@@:
add edx,44
mov [eax+20],edx ; palette pointer (offset from file start)
;---------------------------------------------------------------------
cmp cl,0
je @f
cmp cl,4
jne .PLTE
@@:
mov ecx,256*4
jmp .PLTE_1
.PLTE:
push eax
mov eax,[PLTE.size]
xor edx,edx
mov ebx,3
div ebx
shl eax,2
mov ecx,eax
pop eax
.PLTE_1:
mov [eax+24],ecx ; palette area size
jmp @f
.no_PLTE_1:
xor ecx,ecx
@@:
;---------------------------------------------------------------------
add ecx,dword 44
mov [eax+28],ecx ; pixels pointer (offset from file start)
; mov ebx,[pointer]
; mov [ebx+44],ecx
;---------------------------------------------------------------------
mov ecx, [IHDR_data.Width] ; width BMP
imul ecx,[resolution]
mov edi,ecx
shr ecx,3
test edi,7
jz @f
inc ecx
@@:
imul ecx,[IHDR_data.Height] ; high BMP
mov [eax+32],ecx ; pixels area size
;---------------------------------------------------------------------
xor ecx,ecx ; Stub!!!
mov [eax+36],ecx ;Transparency pointer (offset from file start)
mov [eax+40],ecx ;Transparency area size
;---------------------------------------------------------------------
; Finish create RAW header
;---------------------------------------------------------------------
mov eax,[raw_area]
mov edi,[eax+20] ; palette pointer (offset from file start)
add edi,eax
mov esi,[PLTE.pointer]
mov eax,[PLTE.size]
xor edx,edx
mov ebx,3
div ebx
mov ecx,eax
mov eax,[IHDR_data.Color_type]
cmp al,byte 0
je .grayscale_palette
cmp al,byte 4
je .grayscale_palette
cmp al,byte 3 ; Each pixel is a palette index
; a PLTE chunk must appear.
jne .no_palette
@@:
cld
lodsd
dec esi
and eax,0xffffff
mov bl,al
shr eax,8
xchg ah,bl
shl eax,8
mov al,bl
cld
stosd
dec ecx
jnz @r
jmp .no_palette
;-------------------------------
.grayscale_palette:
; cmp [IHDR_data.Bit_depth], dword 1
; jne @f
; xor eax,eax
; cld
; stosd
; dec eax
; and eax,0xffffff
; cld
; stosd
; jmp .no_palette
@@:
mov eax,1
mov ecx,[resolution]
cmp ecx,8
jbe @f
mov ecx,8
@@:
shl eax,cl
mov ecx,eax
mov eax,256
; mov ebx,[resolution]
xor edx,edx
div ecx ;ebx
mov edx,eax
cmp edx,0
jne @f
inc edx
@@:
xor eax,eax
; mov eax,0xffffff
; mov ecx,256
@@:
cld
stosd
; inc ah
add ah,dl
; inc al
add al,dl
shl eax,8
mov al,ah
; dec ah
; dec al
; shl eax,8
; mov al,ah
and eax,0xffffff
dec ecx
jnz @r
sub edi,4
xor eax,eax
dec eax
and eax,0xffffff
cld
stosd
;-------------------------------
.no_palette:
;---------------------------------------------------------------------
mov ebx,[IDAT.pointer]
mov al,[ebx]
mov [IDAT_CMF],al ; Compression Method and flags
mov ah,al
and al,1111b
mov [IDAT_ÑÌ],al ; Compression method
shr ah,4
mov [IDAT_CINFO],ah ; Compression info
mov al,[ebx+1]
mov [IDAT_FLG],al ; FLaGs
mov ah,al
and al,11111b
mov [IDAT_FCHECK],al
mov al,ah
and al,100000b
shr al,5
mov [IDAT_FDICT],al ; Preset dictionary
shr ah,6
mov [IDAT_FLEVEL],ah ; Compression level
mov al,[IDAT_ÑÌ]
; test al,1000b ; Compression method = 8 ?
cmp al,8
jnz no_png_file
add [IDAT.pointer],2
sub [IDAT.size],2
; xor eax,eax
; mov ah,[IDAT_FLG]
; mov al,[IDAT_CMF]
; imul eax,31
; shr eax,16
; cmp [IDAT_FCHECK],al
; jne no_png_file
;
; cmp [IDAT_FDICT],1
; jne .no_IDAT_FDICT
; mov ecx,[ebx+2]
; jmp .IDAT_DICT
;.no_IDAT_FDICT:
; mov eax,[IDAT.pointer]
; add eax,[IDAT.size]
; mov ecx,[eax]
;.IDAT_DICT:
; call convert_NBO_to_PC
; mov [IDAT_DICT],ecx
; jmp .ret_ok
; jmp no_png_file
; mov ecx,[file_size]
; mcall 68, 12
; mov [IDAT_raw_area],eax ; store pointer of image area
;---------------------------------------------------------------------
.start_Deflate_unpack:
push eax ; âûäåëÿåì â ñòåêå ïåðåìåííóþ äëÿ *pUnpackedLength
; ïîñêîëüêó çíà÷åíèå íåâàæíî, êîðî÷å è áûñòðåå âñåãî
; ñäåëàòü ýòî îäíîáàéòîâûì push <ðåãèñòð>
push esp ; à âîò è ñàì óêàçàòåëü pUnpackedLength
push esi ; êàêîé-íèáóäü ïàðàìåòð
push deflate_callback
call [deflate_unpack]
pop ecx ; âûòàëêèâàåì UnpackedLength
; êàê è â ïåðâîì ñëó÷àå, eax = óêàçàòåëü íà ðàñïàêîâàííûå äàííûå, ecx = ðàçìåð
mov [unpacked_data],eax
mov esi,eax
;---------------------------------------------------------------------
mov eax,[raw_area]
mov edi,[eax+28] ; pixels pointer (offset from file start)
add edi,eax
; mov ecx,edx
sub ecx,[IHDR_data.Height]
mov [first_line],byte 1
cmp [IHDR_data.Color_type],byte 0
je .PLTE_and_grayscale
cmp [IHDR_data.Color_type],byte 3
je .PLTE_and_grayscale
cmp [IHDR_data.Color_type],byte 4
je .PLTE_and_grayscale
;---------------------------------------------------------------------
; Processing filtering RGB; type 2 and 6, sample 8b
;---------------------------------------------------------------------
mov eax,ecx
; sub eax,[IHDR_data.Height]
xor edx,edx
mov ebx,3
cmp [IHDR_data.Color_type],byte 6
jne @f
inc ebx
@@:
cmp [IHDR_data.Bit_depth],byte 16
jne @f
shl ebx,1
@@:
div ebx
mov ecx,eax
cmp [IHDR_data.Bit_depth],byte 16
je .filter_Bit_depth_16
; jmp .ret_ok
;---------------------------------------------------------------------
cmp [IHDR_data.Interlace_method], byte 0 ; Interlaced
je @f
call filtering_RGB_Interlaced
jmp .converting_MSB_to_LSB
@@:
;---------------------------------------------------------------------
push edi
call filtering_RGB
pop edi
;---------------------------------------------------------------------
; converting MSB to LSB
; 24b = 1B x 3 sample
; 32b = 1B x 4 sample
.converting_MSB_to_LSB:
call .calculate_all_pixels
mov ebx,3
cmp [IHDR_data.Color_type],byte 6
jne @f
inc ebx
@@:
sub edi,ebx
@@:
add edi,ebx
mov al,[edi]
mov ah,[edi+2]
mov [edi+2],al
mov [edi],ah
dec ecx
jnz @r
jmp .ret_ok
;---------------------------------------------------------------------
.calculate_all_pixels:
mov ecx,[Image_Height]
imul ecx,[Image_Width]
ret
;---------------------------------------------------------------------
; Processing filtering RGB; type 2 and 6, sample 16b
;---------------------------------------------------------------------
.filter_Bit_depth_16:
cmp [IHDR_data.Interlace_method], byte 0 ; Interlaced
je @f
call filtering_RGB_16_Interlaced
jmp .converting_MSB_to_LSB_16
@@:
;---------------------------------------------------------------------
push edi
call filtering_RGB_16
pop edi
;---------------------------------------------------------------------
; converting MSB to LSB 48 or 64b
; 48b = 2B x 3 sample
; 64b = 2B x 4 sample
.converting_MSB_to_LSB_16:
call .calculate_all_pixels
mov ebx,3
cmp [IHDR_data.Color_type],byte 6
jne @f
inc ebx
@@:
shl ebx,1
sub edi,ebx
@@:
add edi,ebx
mov ax,[edi]
xchg al,ah
shl eax,16
mov ax,[edi+4]
xchg al,ah
mov [edi],ax
shr eax,16
mov [edi+4],ax
mov ax,[edi+2]
xchg al,ah
mov [edi+2],ax
; mov ax,[edi+6]
; xchg al,ah
; mov [edi+6],al
dec ecx
jnz @r
jmp .ret_ok
;---------------------------------------------------------------------
; Processing filtering Grayscale and RGB; type 2, 3 and 4, sample 8b
;---------------------------------------------------------------------
.PLTE_and_grayscale:
cmp [IHDR_data.Color_type],byte 4
jne @f
shr ecx,1
@@:
cmp [IHDR_data.Bit_depth],byte 16
jne @f
shr ecx,1
jmp .filter_grayscale_Bit_depth_16_1
@@:
;---------------------------------------------------------------------
cmp [IHDR_data.Interlace_method], byte 0 ; Interlaced
je @f
call filtering_grayscale_Interlaced
jmp .continue_1
@@:
;---------------------------------------------------------------------
push edi
call filtering_grayscale
pop edi
;---------------------------------------------------------------------
.continue_1:
cmp [IHDR_data.Color_type],byte 4
jne .ret_ok
;-------------------------------
; 8b or less
mov esi,edi
call .calculate_all_pixels
.convert_transp_to_notransp:
cld
lodsw
stosb
dec ecx
jnz .convert_transp_to_notransp
jmp .ret_ok
;---------------------------------------------------------------------
; Processing filtering Grayscale and RGB; type 2, 3 and 4, sample 16b
;---------------------------------------------------------------------
.filter_grayscale_Bit_depth_16_1:
cmp [IHDR_data.Interlace_method], byte 0 ; Interlaced
je @f
call filtering_grayscale_16_Interlaced
jmp .continue_2
@@:
;---------------------------------------------------------------------
push edi
call filtering_grayscale_16
pop edi
;---------------------------------------------------------------------
.continue_2:
cmp [IHDR_data.Color_type],byte 4
jne .ret_ok
;-------------------------------
; 16b
mov esi,edi
call .calculate_all_pixels
.convert_transp_to_notransp_1:
cld
lodsd
stosw
dec ecx
jnz .convert_transp_to_notransp_1
;---------------------------------------------------------------------
.ret_ok:
mov ecx,[unpacked_data]
mcall 68, 13,
xor eax,eax
;---------------------------------------------------------------------
.ret:
mov ebx,[pointer]
mov [ebx+8],eax ; store return code
mov eax,[raw_area]
mov [ebx+4],eax ; store RAW pointer
popad
ret 4
;---------------------------------------------------------------------
include 'filter.inc'
include 'proced.inc'
include 'fl_call.inc'
include 'interlac.inc'
;---------------------------------------------------------------------
Check_Header:
pushad
mov eax,dword [esp+36]
call check_header_1
jne no_png_file
popad
ret 4
;---------------------------------------------------------------------
Associations:
dd Associations.end - Associations
db 'PNG',0
.end:
db 0
;---------------------------------------------------------------------
align 4
EXPORTS:
dd szStart, START
dd szVersion, 0x00010002
dd szCheck, Check_Header
dd szAssoc, Associations
dd 0
szStart db 'START',0
szVersion db 'version',0
szCheck db 'Check_Header',0
szAssoc db 'Associations',0
;*****************************************************************************
; Chunks names
;*****************************************************************************
; Critical chunks
IHDR_name: db 'IHDR' ; Image header
PLTE_name: db 'PLTE' ; Palette
IDAT_name: db 'IDAT' ; Image data
IEND_name: db 'IEND' ; Image trailer
; Ancillary chunks
;tRNS_name: db 'tRNS' ; Transparency
;; Color space information
;gAMA_name: db 'gAMA' ; Image gamma
;cHRM_name: db 'cHRM' ; Primary chromaticities
;sRGB_name: db 'sRGB' ; Standard RGB color space
;iCCP_name: db 'iCCP' ; Embedded ICC profile
;; Textual information
;tEXt_name: db 'tEXt' ; Textual data
;zTXt_name: db 'zTXt' ; Compressed textual data
;iTXt_name: db 'iTXt' ; International textual data
;; Miscellaneous information
;bKGD_name: db 'bKGD' ; Background color
;pHYs_name: db 'pHYs' ; Physical pixel dimensions
;sBIT_name: db 'sBIT' ; Significant bits
;sPLT_name: db 'sPLT' ; Suggested palette
;hIST_name: db 'hIST' ; Palette histogram
;tIME_name: db 'tIME' ; Imagelast-modification time
;*****************************************************************************
calculate_Interlaced_counters:
.1: dd calculate_Interlaced_1
.2: dd calculate_Interlaced_2
.3: dd calculate_Interlaced_3
.4: dd calculate_Interlaced_4
.5: dd calculate_Interlaced_5
.6: dd calculate_Interlaced_6
.7: dd calculate_Interlaced_7
deflate_start_offset dd 0
pointer dd 0
image_file dd 0
file_size dd 0
raw_area dd 0
resolution dd 0
Chunk_pointer dd 0
next_Chunk dd 0
deflate_unpack dd 0
unpacked_data dd 0
;IDAT_raw_area dd 0
;IDAT_raw_counter dd 0
Interlaced_area dd 0
Starting_Row: dd 0
Starting_Col: dd 0
Row_Increment: dd 0
Col_Increment: dd 0
Interlaced_step dd 0
counter_IDAT_Chunk dd 0
;CRC32 dd 0
;CRC32table: rd 256
;Adler32 dd 0
Image_Width dd 0
Image_Height dd 0
IHDR_data:
.Width dd 0 ;+0
.Height dd 0 ;+4
.Bit_depth: db 0 ;+8
.Color_type: db 0 ;+9
.Compression_method: db 0 ;+10
.Filter_method: db 0 ;+11
.Interlace_method: db 0 ;+12
IDAT_CMF db 0 ; Compression Method and flags
IDAT_ÑÌ db 0 ; Compression method
IDAT_CINFO db 0 ; Compression info
IDAT_FLG db 0 ; FLaGs
IDAT_FCHECK db 0 ;
IDAT_FDICT db 0 ; Preset dictionary
IDAT_FLEVEL db 0 ; Compression level
; "deflate" method (CM = 8) sets these flags:
; 0 - compressor used fastest algorithm
; 1 - compressor used fast algorithm
; 2 - compressor used default algorithm
; 3 - compressor used maximum compression, slowest algorithm
IDAT_DICT dd 0 ; dictionary identifier = Adler-32 checksum
BFINAL db 0 ; set 1 only if this is the last block of the data set
BTYPE db 0 ; specifies how the data are compressed:
; 00 - no compression
; 01 - compressed with fixed Huffman codes
; 10 - compressed with dynamic Huffman codes
; 11 - reserved (error)
line_filter_type dd 0 ; 0 None
; 1 Sub
; 2 Up
; 3 Averag
; 4 Paeth
first_line db 0
first_pixel db 0
previous_pixel_value:
rb 8
Paeth_filter:
.a: dw 0
.b: dw 0
.c: dw 0
.p dd 0
.pa dd 0
.pb dd 0
.pc dd 0
;*****************************************************************************
; Chunks pointer
;*****************************************************************************
IHDR:
.pointer dd 0
.size dd 0
PLTE:
.pointer dd 0
.size dd 0
IDAT:
.pointer dd 0
.size dd 0
IEND:
.pointer dd 0
.size dd 0
;tRNS:
;.pointer dd 0
;.size dd 0
;gAMA:
;.pointer dd 0
;.size dd 0
;cHRM:
;.pointer dd 0
;.size dd 0
;sRGB:
;.pointer dd 0
;.size dd 0
;iCCP:
;.pointer dd 0
;.size dd 0
;tEXt:
;.pointer dd 0
;.size dd 0
;zTXt:
;.pointer dd 0
;.size dd 0
;iTXt:
;.pointer dd 0
;.size dd 0
;bKGD:
;.pointer dd 0
;.size dd 0
;pHYs:
;.pointer dd 0
;.size dd 0
;sBIT:
;.pointer dd 0
;.size dd 0
;sPLT:
;.pointer dd 0
;.size dd 0
;hIST:
;.pointer dd 0
;.size dd 0
;tIME:
;.pointer dd 0
;.size dd 0

View File

@ -0,0 +1,472 @@
;*****************************************************************************
; PNG to RAW convert plugin - for zSea image viewer
; Copyright (c) 2008, 2009, Marat Zakiyanov aka Mario79, aka Mario
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:
; * Redistributions of source code must retain the above copyright
; notice, this list of conditions and the following disclaimer.
; * Redistributions in binary form must reproduce the above copyright
; notice, this list of conditions and the following disclaimer in the
; documentation and/or other materials provided with the distribution.
; * Neither the name of the <organization> nor the
; names of its contributors may be used to endorse or promote products
; derived from this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY Marat Zakiyanov ''AS IS'' AND ANY
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;---------------------------------------------------------------------
filtering:
push eax ecx edx
mov ebp,[line_filter_type]
cmp ebp,0
je .end
cmp ebp,1
je .Sub
cmp ebp,2
je .Up
cmp ebp,3
je .Averag
cmp ebp,4
je .Paeth
jmp .end
;---------------------------------------------------------------------
.Sub:
cmp [IHDR_data.Bit_depth],byte 16
jne @f
mov eax,ebx
shr eax,16
add bl,al
add bh,ah
jmp .end
@@:
add bl,bh
jmp .end
;---------------------------------------------------------------------
.Up:
cmp [first_line],byte 0
jne .end
mov eax,[IHDR_data.Width]
cmp [IHDR_data.Color_type],byte 0
je .Up_Color_type_0_and_3
cmp [IHDR_data.Color_type],byte 3
je .Up_Color_type_0_and_3
cmp [IHDR_data.Color_type],byte 4
je @f
lea eax,[eax*3]
@@:
cmp [IHDR_data.Color_type],byte 4
je .Up_Alpfa
cmp [IHDR_data.Color_type],byte 6
jne @f
.Up_Alpfa:
add eax,[IHDR_data.Width]
@@:
.Up_8:
cmp [IHDR_data.Bit_depth],byte 16
je .Up_16
mov ebp,edi
sub ebp,eax
mov bh,[ebp]
add bl,bh
jmp .end
.Up_Color_type_0_and_3:
cmp [IHDR_data.Bit_depth],byte 16
je .Up_16
call .Bit_depth_less_8
jmp .Up_8
.Bit_depth_less_8:
; imul eax,[resolution]
cmp [resolution],8
jne @f
ret
@@:
cmp [resolution],4
jne @f
shl eax,2
jmp .continue_Bit_depth_less_8
@@:
cmp [resolution],2
jne .continue_Bit_depth_less_8
shl eax,1
.continue_Bit_depth_less_8:
push ebx
mov ebx,eax
shr eax,3
test ebx,7
jz @f
inc eax
@@:
pop ebx
ret
.Up_16:
shl eax,1
mov ebp,edi
sub ebp,eax
mov ax,[ebp]
add bl,al
add bh,ah
jmp .end
;---------------------------------------------------------------------
.Averag:
cmp [first_line],byte 0
je @f
xor eax,eax
cmp [IHDR_data.Bit_depth],byte 16
je .Averag_2
jmp .Averag_1
@@:
mov eax,[IHDR_data.Width]
cmp [IHDR_data.Color_type],byte 0
je .Averag_Color_type_0_and_3 ;@f
cmp [IHDR_data.Color_type],byte 3
je .Averag_Color_type_0_and_3 ;@f
cmp [IHDR_data.Color_type],byte 4
je @f
lea eax,[eax*3]
@@:
cmp [IHDR_data.Color_type],byte 4
je .Averag_Alpfa
cmp [IHDR_data.Color_type],byte 6
jne @f
.Averag_Alpfa:
add eax,[IHDR_data.Width]
@@:
.Averag_8:
cmp [IHDR_data.Bit_depth],byte 16
je .Averag_16
mov ebp,edi
sub ebp,eax
xor eax,eax
mov al,[ebp]
.Averag_1:
movzx ebp,bh
add eax,ebp
shr eax,1
add bl,al
jmp .end
.Averag_Color_type_0_and_3:
cmp [IHDR_data.Bit_depth],byte 16
je .Averag_16
call .Bit_depth_less_8
jmp .Averag_8
.Averag_16:
shl eax,1
mov ebp,edi
sub ebp,eax
xor eax,eax
mov ax,[ebp]
.Averag_2:
mov ebp,ebx
shr ebp,16
mov ecx,ebp
and ecx,0xff
mov edx,eax
and edx,0xff
add ecx,edx
shr ecx,1
add bl,cl
shr ebp,8
shr eax,8
add eax,ebp
shr eax,1
add bh,al
jmp .end
;---------------------------------------------------------------------
.Paeth:
cmp [first_line],byte 0
je @f
xor eax,eax
cmp [IHDR_data.Bit_depth],byte 16
je .Paeth_16_1
jmp .Paeth_1
@@:
mov eax,[IHDR_data.Width]
cmp [IHDR_data.Color_type],byte 0
je .Paeth_Color_type_0_and_3 ;@f
cmp [IHDR_data.Color_type],byte 3
je .Paeth_Color_type_0_and_3 ;@f
cmp [IHDR_data.Color_type],byte 4
je @f
lea eax,[eax*3]
@@:
cmp [IHDR_data.Color_type],byte 4
je .Paeth_Alpfa
cmp [IHDR_data.Color_type],byte 6
jne @f
.Paeth_Alpfa:
add eax,[IHDR_data.Width]
@@:
cmp [IHDR_data.Bit_depth],byte 16
je .Paeth_16
.Paeth_8:
mov ebp,edi
sub ebp,eax
xor eax,eax
mov al,[ebp]
.Paeth_1:
mov [Paeth_filter.b],al
cmp [first_line],byte 0
jne @f
cmp [first_pixel],0
jne @f
mov ah,[ebp-1]
cmp [IHDR_data.Color_type],byte 0
je @f
cmp [IHDR_data.Color_type],byte 3
je @f
mov ah,[ebp-2]
cmp [IHDR_data.Color_type],byte 4
je @f
mov ah,[ebp-3]
cmp [IHDR_data.Color_type],byte 2
je @f
mov ah,[ebp-4]
@@:
mov [Paeth_filter.c],ah
mov [Paeth_filter.a],bh
xor eax,eax
mov al,[Paeth_filter.a]
mov ebp,eax
mov al,[Paeth_filter.b]
add ebp,eax
mov al,[Paeth_filter.c]
sub ebp,eax
mov [Paeth_filter.p],ebp
;----------------------------------------
mov al,[Paeth_filter.a]
sub ebp,eax
test ebp,0x80000000
jz @f
neg ebp
@@:
mov [Paeth_filter.pa],ebp
mov ebp,[Paeth_filter.p]
mov al,[Paeth_filter.b]
sub ebp,eax
test ebp,0x80000000
jz @f
neg ebp
@@:
mov [Paeth_filter.pb],ebp
mov ebp,[Paeth_filter.p]
mov al,[Paeth_filter.c]
sub ebp,eax
test ebp,0x80000000
jz @f
neg ebp
@@:
mov [Paeth_filter.pc],ebp
mov eax,[Paeth_filter.pa]
mov ebp,[Paeth_filter.pb]
cmp eax,ebp
ja .no_return_a
cmp eax,[Paeth_filter.pc]
ja .no_return_a
add bl,[Paeth_filter.a]
jmp .end
.no_return_a:
cmp ebp,[Paeth_filter.pc]
ja .no_return_b
add bl,[Paeth_filter.b]
jmp .end
.no_return_b:
add bl,[Paeth_filter.c]
.end:
pop edx ecx eax
ret
;----------------------------------------
.Paeth_Color_type_0_and_3:
cmp [IHDR_data.Bit_depth],byte 16
je .Paeth_16
call .Bit_depth_less_8
jmp .Paeth_8
;----------------------------------------
.Paeth_16:
shl eax,1
mov ebp,edi
sub ebp,eax
xor eax,eax
mov ax,[ebp]
.Paeth_16_1:
mov [Paeth_filter.b],ax
xor eax,eax
cmp [first_line],byte 0
jne @f
cmp [first_pixel],0
jne @f
mov ax,[ebp-2]
cmp [IHDR_data.Color_type],byte 0
je @f
mov ax,[ebp-4]
cmp [IHDR_data.Color_type],byte 4
je @f
mov ax,[ebp-6]
cmp [IHDR_data.Color_type],byte 2
je @f
mov ax,[ebp-8]
@@:
mov [Paeth_filter.c],ax
mov eax,ebx
shr eax,16
mov [Paeth_filter.a],ax
;----------------------------------------
xor eax,eax
mov ax,[Paeth_filter.a]
shr ax,8
mov bp,ax
mov ax,[Paeth_filter.b]
shr ax,8
add bp,ax
mov ax,[Paeth_filter.c]
shr ax,8
sub bp,ax
shl ebp,16
xor eax,eax
mov al,[Paeth_filter.a]
mov bp,ax
mov al,[Paeth_filter.b]
add bp,ax
mov al,[Paeth_filter.c]
sub bp,ax
mov [Paeth_filter.p],ebp
;----------------------------------------
xor eax,eax
mov ax,[Paeth_filter.a]
mov ecx,ebp
mov dx,ax
shr ecx,16
shr dx,8
sub cx,dx
test cx,0x8000
jz @f
neg cx
@@:
shl ecx,16
and ebp,0xffff
and eax,0xff
sub bp,ax
test bp,0x8000
jz @f
neg bp
@@:
add ebp,ecx
mov [Paeth_filter.pa],ebp
;----------------------------------------
xor eax,eax
mov ebp,[Paeth_filter.p]
mov ax,[Paeth_filter.b]
mov ecx,ebp
mov dx,ax
shr ecx,16
shr dx,8
sub cx,dx
test cx,0x8000
jz @f
neg cx
@@:
shl ecx,16
and ebp,0xffff
and eax,0xff
sub bp,ax
test bp,0x8000
jz @f
neg bp
@@:
add ebp,ecx
mov [Paeth_filter.pb],ebp
;----------------------------------------
xor eax,eax
mov ebp,[Paeth_filter.p]
mov ax,[Paeth_filter.c]
mov ecx,ebp
mov dx,ax
shr ecx,16
shr dx,8
sub cx,dx
test cx,0x8000
jz @f
neg cx
@@:
shl ecx,16
and ebp,0xffff
and eax,0xff
sub bp,ax
test bp,0x8000
jz @f
neg bp
@@:
add ebp,ecx
mov [Paeth_filter.pc],ebp
;----------------------------------------
mov eax,[Paeth_filter.pa]
mov ebp,[Paeth_filter.pb]
mov ecx,[Paeth_filter.pc]
shr eax,16
shr ebp,16
shr ecx,16
cmp ax,bp
ja .no_return_a_1
cmp ax,cx
ja .no_return_a_1
mov ax,[Paeth_filter.a]
add bh,ah
jmp .end_1
.no_return_a_1:
cmp bp,cx
ja .no_return_b_1
mov ax,[Paeth_filter.b]
add bh,ah
jmp .end_1
.no_return_b_1:
mov ax,[Paeth_filter.c]
add bh,ah
.end_1:
;----------------------------------------
mov eax,[Paeth_filter.pa]
mov ebp,[Paeth_filter.pb]
mov ecx,[Paeth_filter.pc]
cmp ax,bp
ja .no_return_a_2
cmp ax,cx
ja .no_return_a_2
add bl,[Paeth_filter.a]
jmp .end_2
.no_return_a_2:
cmp bp,cx
ja .no_return_b_2
add bl,[Paeth_filter.b]
jmp .end_2
.no_return_b_2:
add bl,[Paeth_filter.c]
.end_2:
pop edx ecx eax
ret
;---------------------------------------------------------------------

View File

@ -0,0 +1,225 @@
;*****************************************************************************
; PNG to RAW convert plugin - for zSea image viewer
; Copyright (c) 2008, 2009, Marat Zakiyanov aka Mario79, aka Mario
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:
; * Redistributions of source code must retain the above copyright
; notice, this list of conditions and the following disclaimer.
; * Redistributions in binary form must reproduce the above copyright
; notice, this list of conditions and the following disclaimer in the
; documentation and/or other materials provided with the distribution.
; * Neither the name of the <organization> nor the
; names of its contributors may be used to endorse or promote products
; derived from this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY Marat Zakiyanov ''AS IS'' AND ANY
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;---------------------------------------------------------------------
filtering_RGB:
mov ecx,[IHDR_data.Height]
test ecx,ecx
jz .filter_end
.filter:
mov edx,[IHDR_data.Width]
test edx,edx
jz .filter_end
xor eax,eax
mov [previous_pixel_value],eax
mov [first_pixel],byte 1
mov al,[esi]
mov [line_filter_type],eax
inc esi
.filter_x:
mov bh,[previous_pixel_value]
call filtering_sample_8
mov [previous_pixel_value],bl
mov bh,[previous_pixel_value+1]
call filtering_sample_8
mov [previous_pixel_value+1],bl
mov bh,[previous_pixel_value+2]
call filtering_sample_8
mov [previous_pixel_value+2],bl
cmp [IHDR_data.Color_type],byte 6
jne @f
mov bh,[previous_pixel_value+3]
call filtering_sample_8
mov [previous_pixel_value+3],bl
@@:
mov [first_pixel],byte 0
dec edx
jnz .filter_x
mov [first_line],byte 0
dec ecx
jnz .filter
.filter_end:
ret
;-------------------------------
filtering_sample_8:
cld
lodsb
mov bl,al
call filtering
mov al,bl
cld
stosb
ret
;---------------------------------------------------------------------
filtering_RGB_16:
mov ecx,[IHDR_data.Height]
test ecx,ecx
jz .filter_end_16
.filter_16:
mov edx,[IHDR_data.Width]
test edx,edx
jz .filter_end_16
xor eax,eax
mov [previous_pixel_value],eax
mov [previous_pixel_value+4],eax
mov [first_pixel],byte 1
mov al,[esi]
mov [line_filter_type],eax
inc esi
.filter_x_16:
mov bx,[previous_pixel_value]
call filtering_sample_16
mov [previous_pixel_value],bx
mov bx,[previous_pixel_value+2]
call filtering_sample_16
mov [previous_pixel_value+2],bx
mov bx,[previous_pixel_value+4]
call filtering_sample_16
mov [previous_pixel_value+4],bx
cmp [IHDR_data.Color_type],byte 6
jne @f
mov bx,[previous_pixel_value+6]
call filtering_sample_16
mov [previous_pixel_value+6],bx
@@:
mov [first_pixel],byte 0
dec edx
jnz .filter_x_16
mov [first_line],byte 0
dec ecx
jnz .filter_16
.filter_end_16:
ret
;-------------------------------
filtering_sample_16:
shl ebx,16
cld
lodsw
mov bx,ax
call filtering
mov ax,bx
cld
stosw
ret
;---------------------------------------------------------------------
filtering_grayscale:
mov ecx,[IHDR_data.Height]
test ecx,ecx
jz .filter_end_grayscale
mov edx,[IHDR_data.Width]
test edx,edx
jz .filter_end_grayscale
cmp [IHDR_data.Color_type],byte 4
je @f
imul edx,[resolution]
mov eax,edx
shr edx,3
test eax,7
jz @f
inc edx
@@:
.filter_grayscale:
push edx
xor eax,eax
mov [previous_pixel_value],eax
mov [first_pixel],byte 1
mov al,[esi]
mov [line_filter_type],eax
inc esi
.filter_x_grayscale:
mov bh,[previous_pixel_value]
call filtering_sample_8
mov [previous_pixel_value],bl
cmp [IHDR_data.Color_type],byte 4
jne @f
mov bh,[previous_pixel_value+1]
call filtering_sample_8
mov [previous_pixel_value+1],bl
@@:
mov [first_pixel],byte 0
dec edx
jnz .filter_x_grayscale
pop edx
mov [first_line],byte 0
dec ecx
jnz .filter_grayscale
.filter_end_grayscale:
ret
;---------------------------------------------------------------------
filtering_grayscale_16:
mov ecx,[IHDR_data.Height]
test ecx,ecx
jz .filter_end_grayscale_16
.filter_grayscale_Bit_depth_16:
mov edx,[IHDR_data.Width]
test edx,edx
jz .filter_end_grayscale_16
xor eax,eax
mov [previous_pixel_value],eax
mov [first_pixel],byte 1
mov al,[esi]
mov [line_filter_type],eax
inc esi
.filter_x_grayscale_16:
mov bx,[previous_pixel_value]
call filtering_sample_16
mov [previous_pixel_value],bx
cmp [IHDR_data.Color_type],byte 4
jne @f
mov bx,[previous_pixel_value+2]
call filtering_sample_16
mov [previous_pixel_value+2],bx
@@:
mov [first_pixel],byte 0
dec edx
jnz .filter_x_grayscale_16
mov [first_line],byte 0
dec ecx
jnz .filter_grayscale_Bit_depth_16
.filter_end_grayscale_16:
ret
;---------------------------------------------------------------------

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,159 @@
;*****************************************************************************
; PNG to RAW convert plugin - for zSea image viewer
; Copyright (c) 2008, 2009, Marat Zakiyanov aka Mario79, aka Mario
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:
; * Redistributions of source code must retain the above copyright
; notice, this list of conditions and the following disclaimer.
; * Redistributions in binary form must reproduce the above copyright
; notice, this list of conditions and the following disclaimer in the
; documentation and/or other materials provided with the distribution.
; * Neither the name of the <organization> nor the
; names of its contributors may be used to endorse or promote products
; derived from this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY Marat Zakiyanov ''AS IS'' AND ANY
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;---------------------------------------------------------------------
deflate_callback:
cmp [deflate_start_offset],1
je @f
mov [deflate_start_offset],1
jmp .1
@@:
mov eax,[IDAT.pointer]
add eax,[IDAT.size]
mov ebx,[image_file]
add ebx,[file_size]
sub ebx,32
cmp ebx,eax
jbe @f
mov [next_Chunk],eax
call search_IDAT
jmp .1
@@:
xor eax,eax
mov [IDAT.size],eax
mov [IDAT.pointer],eax
.1:
mov ecx, [esp+8]
mov eax,[IDAT.size]
mov [ecx], eax ;length
mov eax,[IDAT.pointer] ; buffer
ret 8
;---------------------------------------------------------------------
search_IHDR:
mov [Chunk_pointer],IHDR_name
call get_Chunk_data_pointer
mov eax,[Chunk_pointer]
cmp eax,0
je .no_png_file
mov [IHDR.pointer],eax
mov ecx,[eax-8]
call convert_NBO_to_PC
mov [IHDR.size],ecx
ret
.no_png_file:
add esp,4
jmp no_png_file
;---------------------------------------------------------------------
search_PLTE:
push eax ecx
mov [Chunk_pointer],PLTE_name
call get_Chunk_data_pointer
mov eax,[Chunk_pointer]
cmp eax,0
je .no_png_file
mov [PLTE.pointer],eax
mov ecx,[eax-8]
call convert_NBO_to_PC
mov [PLTE.size],ecx
pop ecx eax
ret
.no_png_file:
add esp,12
jmp no_png_file
;---------------------------------------------------------------------
search_IDAT:
mov [Chunk_pointer],IDAT_name
call get_Chunk_data_pointer
mov eax,[Chunk_pointer]
cmp eax,0
je .no_IDAT_next
mov [IDAT.pointer],eax
mov ecx,[eax-8]
call convert_NBO_to_PC
mov [IDAT.size],ecx
xor eax,eax
ret
.no_IDAT_next:
; add esp,4
; jmp no_png_file
mov eax,1
ret
;---------------------------------------------------------------------
search_IEND:
mov [Chunk_pointer],IEND_name
call get_Chunk_data_pointer
mov eax,[Chunk_pointer]
cmp eax,0
je .no_png_file
mov [IEND.pointer],eax
mov ecx,[eax-8]
call convert_NBO_to_PC
mov [IEND.size],ecx
ret
.no_png_file:
add esp,4
jmp no_png_file
;---------------------------------------------------------------------
convert_NBO_to_PC: ;network byte order value to PC value
push eax
mov al,ch
mov ah,cl
shl eax,16
shr ecx,16
mov al,ch
mov ah,cl
mov ecx,eax
pop eax
ret
;---------------------------------------------------------------------
get_Chunk_data_pointer:
pushad
mov ebp,4
; mov edi,[image_file]
mov edi,[next_Chunk]
mov edx,[image_file] ;edi
add edx,[file_size]
dec edi
.search_Chunk:
cmp edx,edi
jbe .end
mov esi,[Chunk_pointer]
mov ecx,ebp
inc edi
mov ebx,edi
cld
rep cmpsb
mov edi,ebx
jne .search_Chunk
add edi,ebp
mov [Chunk_pointer],edi
popad
ret
.end:
mov [Chunk_pointer],0
popad
ret
;---------------------------------------------------------------------

View File

@ -0,0 +1,3 @@
@fasm -m 16384 rotate.asm rotate.obj
@kpack rotate.obj
@pause

View File

@ -0,0 +1,10 @@
#!/bin/bash
# This script does for Linux the same as build.bat for DOS,
# it compiles the current KolibriOS applications
fasm -m 16384 rotate.asm rotate.obj
kpack rotate.obj
exit 0

View File

@ -0,0 +1,301 @@
;*****************************************************************************
; Rotate RAW image plugin - for zSea image viewer
; Copyright (c) 2009 - 2011, Marat Zakiyanov aka Mario79, aka Mario
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:
; * Redistributions of source code must retain the above copyright
; notice, this list of conditions and the following disclaimer.
; * Redistributions in binary form must reproduce the above copyright
; notice, this list of conditions and the following disclaimer in the
; documentation and/or other materials provided with the distribution.
; * Neither the name of the <organization> nor the
; names of its contributors may be used to endorse or promote products
; derived from this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY Marat Zakiyanov ''AS IS'' AND ANY
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;*****************************************************************************
; Rotate 32b, 24b, 16b, 8b
format MS COFF
public EXPORTS
section '.flat' code readable align 16
;include 'macros.inc'
include '../../../../macros.inc'
;---------------------------------------------------------------------
START:
pushad
mov [pointer],eax
; ebx - direction
; 1 - clockwise, 2 - counter clockwise
; 3 - Left&Right, 4 - Up&Down
mov [direction],ebx
mov eax,[eax+4]
mov [image_file],eax
mov esi,[eax+28]
add esi,eax
; mov ecx,[eax+32]
; xor ebx,ebx
; mov [raw_area],ebx
mov ebx,[eax+12]
cmp ebx,32
jne @f
mov ebp,dword START.32
jmp .1
@@:
cmp ebx,24
jne @f
mov ebp,dword START.24
jmp .1
@@:
cmp ebx,16
jne @f
mov ebp,dword START.16
jmp .1
@@:
cmp ebx,15
jne @f
inc ebx
mov ebp,dword START.16
jmp .1
@@:
cmp ebx,8
jne @f
mov ebp,dword START.8
@@:
.1:
shr ebx,3
mov [bytes_to_pixel],ebx
mov ebx,[eax+4]
imul ebx,[bytes_to_pixel]
mov [size_x],ebx
mov ebx,[eax+8]
imul ebx,[bytes_to_pixel]
mov [size_y],ebx
call .get_memory
cmp [direction],1
jne @f
call .clockwise
jmp .end
@@:
cmp [direction],2
jne @f
call .counter_clockwise
jmp .end
@@:
cmp [direction],3
jne @f
call .Left_Right
jmp .end
@@:
cmp [direction],4
jne .exit
call .Up_Down
.end:
xchg esi,edi
mov ecx,[image_file]
mov eax,[ecx+4]
imul eax,[bytes_to_pixel]
imul eax,[ecx+8]
mov ecx,eax
cld
rep movsb
mov ecx,[raw_area]
mcall 68,13
;---------------------------------------------------------------------
.ret_ok:
cmp [direction],1
jne @f
call .XY_data_exchange
jmp .exit
@@:
cmp [direction],2
jne .exit
call .XY_data_exchange
.exit:
popad
ret
;---------------------------------------------------------------------
.XY_data_exchange:
mov ecx,[image_file]
mov eax,[ecx+4]
mov ebx,[ecx+8]
mov [ecx+8],eax
mov [ecx+4],ebx
ret
;---------------------------------------------------------------------
.clockwise:
push edi esi
add edi,[size_y]
sub edi,[bytes_to_pixel]
.y:
push edi
push ebx
.x:
call ebp
add edi,[size_y]
dec ebx
jnz .x
pop ebx
pop edi
sub edi,[bytes_to_pixel]
dec ecx
jnz .y
pop esi edi
ret
;---------------------------------------------------------------------
.counter_clockwise:
push edi esi
mov eax,[eax+4]
dec eax
imul eax,[size_y]
add edi,eax
.y1:
push edi
push ebx
.x1:
call ebp
sub edi,[size_y]
dec ebx
jnz .x1
pop ebx
pop edi
add edi,[bytes_to_pixel]
dec ecx
jnz .y1
pop esi edi
ret
;---------------------------------------------------------------------
.Left_Right:
push edi esi
add edi,[size_x]
.y2:
push edi
push ebx
.x2:
sub edi,[bytes_to_pixel]
call ebp
dec ebx
jnz .x2
pop ebx
pop edi
add edi,[size_x]
dec ecx
jnz .y2
pop esi edi
ret
;---------------------------------------------------------------------
.Up_Down:
push edi esi
mov eax,[eax+8]
dec eax
imul eax,[size_x]
add edi,eax
.y3:
push edi
push ebx
.x3:
call ebp
add edi,[bytes_to_pixel]
dec ebx
jnz .x3
pop ebx
pop edi
sub edi,[size_x]
dec ecx
jnz .y3
pop esi edi
ret
;---------------------------------------------------------------------
.32:
cld
lodsd
mov [edi],eax
ret
;---------------------------------------------------------------------
.24:
cld
lodsw
mov [edi],ax
lodsb
mov [edi+2],al
ret
;---------------------------------------------------------------------
.16:
cld
lodsw
mov [edi],ax
ret
;---------------------------------------------------------------------
.8:
cld
lodsb
mov [edi],al
ret
;---------------------------------------------------------------------
.get_memory:
mov ecx,[eax+4]
imul ecx,[eax+8]
imul ecx,[bytes_to_pixel]
push eax
mcall 68,12
mov [raw_area],eax
mov edi,eax
pop eax
mov ebx,[eax+4]
mov ecx,[eax+8]
ret
;---------------------------------------------------------------------
align 16
EXPORTS:
dd szStart, START
dd szVersion, 0x00010001
dd 0
szStart db 'START',0
szVersion db 'version',0
pointer dd 0
image_file dd 0
direction dd 0
size_x dd 0
size_y dd 0
bytes_to_pixel dd 0
;delta dd 0
;resolution dd 0
;compression dd 0
raw_area dd 0

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,3 @@
@fasm -m 16384 scaling.asm scaling.obj
@kpack scaling.obj
@pause

View File

@ -0,0 +1,10 @@
#!/bin/bash
# This script does for Linux the same as build.bat for DOS,
# it compiles the current KolibriOS applications
fasm -m 16384 scaling.asm scaling.obj
kpack scaling.obj
exit 0

View File

@ -0,0 +1,269 @@
; 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,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
}
; 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) | (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
dw ? ; +52 - reserved
.client_left dd ? ; +54
.client_top dd ? ; +58
.client_width dd ? ; +62
.client_height dd ? ; +66
.wnd_state db ? ; +70
rb (1024-71)
}
;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

View File

@ -0,0 +1,481 @@
;*****************************************************************************
; Scaling RAW image plugin - for zSea image viewer
; Copyright (c) 2009 - 2011, Marat Zakiyanov aka Mario79, aka Mario
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:
; * Redistributions of source code must retain the above copyright
; notice, this list of conditions and the following disclaimer.
; * Redistributions in binary form must reproduce the above copyright
; notice, this list of conditions and the following disclaimer in the
; documentation and/or other materials provided with the distribution.
; * Neither the name of the <organization> nor the
; names of its contributors may be used to endorse or promote products
; derived from this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY Marat Zakiyanov ''AS IS'' AND ANY
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;*****************************************************************************
; Scaling 32b, 24b, 16b, 8b
format MS COFF
public EXPORTS
section '.flat' code readable align 16
include 'macros.inc'
include '../../../../macros.inc'
;---------------------------------------------------------------------
START:
pushad
mov [pointer],eax
test bx,bx
jnz @f
inc bx
@@:
ror ebx,16
test bx,bx
jnz @f
inc bx
@@:
rol ebx,16
mov [new_size],ebx
mov [start_coordinates],ecx
mov [scaling_mode],edx
mov [filtering],esi
mov [background_color],edi
mov eax,[eax+4]
mov [image_file],eax
mov esi,[eax+28]
add esi,eax
mov ebx,[eax+20]
add ebx,eax
mov [palette],ebx
mov ebx,[eax+12]
mov [resolution],ebx
cmp ebx,32
jne @f
mov ebp,dword START.32
jmp .1
@@:
cmp ebx,24
jne @f
mov ebp,dword START.24
jmp .1
@@:
cmp ebx,16
jne @f
mov ebp,dword START.16
jmp .1
@@:
cmp ebx,15
jne @f
inc ebx
mov ebp,dword START.16
jmp .1
@@:
cmp ebx,8
jne @f
mov ebp,dword START.8
@@:
.1:
shr ebx,3
mov [bytes_to_pixel],ebx
mov ebx,[eax+8]
mov [y],ebx
mov ebx,[eax+4]
mov [x],ebx
imul ebx,[bytes_to_pixel]
mov [size_x],ebx
mov eax,100
shl eax,12
mov ebx,[scaling_mode]
test ebx,ebx
jnz @f
inc ebx
@@:
xor edx,edx
div ebx
mov [scaling_delta],eax
call .get_memory
cmp [scaling_mode],0
jne @f
call .scaling
jmp .ret_ok
@@:
call .scaling_2
;---------------------------------------------------------------------
.ret_ok:
mcall 68,13,[area_for_x]
mov ebx,[pointer]
mov eax,[raw_area]
mov [ebx+20],eax ; store RAW pointer
; movzx eax,word [new_size.x1]
; mov [ebx+24],esi ;eax
; movzx eax,word [new_size.y1]
; mov [ebx+28],eax
; mov eax,[size_x]
; mov [ebx+32],eax
; mov eax,[bytes_to_pixel]
; mov [ebx+36],eax
; mov eax,[x]
; mov [ebx+40],eax
; mov eax,[y]
; mov [ebx+44],eax
.exit:
popad
ret
;---------------------------------------------------------------------
align 4
.scaling:
xor ecx,ecx
.y:
xor ebx,ebx
;-------------------------
.x:
call ebp
inc ebx
cmp bx,[new_size.x1]
jb .x
;-------------------------
inc ecx
cmp cx,[new_size.y1]
jb .y
ret
;---------------------------------------------------------------------
align 4
.scaling_2:
xor eax,eax
mov ax,[start_coordinates.y]
imul eax,[size_x]
add esi,eax
xor eax,eax
mov ax,[start_coordinates.x]
imul eax,[bytes_to_pixel]
add esi,eax
xor eax,eax
dec eax
mov [temp_y],eax
xor ecx,ecx
align 4
.y_2:
xor ebx,ebx
;-------------------------
align 4
.x_2:
call ebp
inc ebx
cmp bx,[new_size.x1]
jb .x_2
;-------------------------
inc ecx
cmp cx,[new_size.y1]
jb .y_2
ret
;---------------------------------------------------------------------
align 4
.32:
push ecx ebx
call .calculate_pixel
mov eax,[ecx]
call .check_filtering_32
pop ebx ecx
cld
stosd
ret
;---------------------------------------------------------------------
align 4
.24:
push ecx ebx
call .calculate_pixel
mov eax,[ecx]
call .check_filtering_24
cld
stosw
shr eax,16
pop ebx ecx
cld
stosb
ret
;---------------------------------------------------------------------
align 4
.16:
push ecx ebx
call .calculate_pixel
xor eax,eax
mov ax,[ecx]
call .check_filtering_16
pop ebx ecx
cld
stosw
ret
;---------------------------------------------------------------------
align 4
.8:
push ecx ebx
call .calculate_pixel
cmp [filtering],0
jne @f
mov al,[ecx]
pop ebx ecx
cld
stosb
ret
@@:
call .check_filtering_8
cld
stosw
shr eax,16
pop ebx ecx
cld
stosb
ret
;---------------------------------------------------------------------
align 4
.calculate_pixel:
test ecx,ecx
jz .offset_x
;.offset_y:
mov eax,ecx
mov ecx,[temp_y]
cmp eax,ecx
jne .new_y
mov eax,[temp_y_offset]
mov ecx,eax
jmp .offset_x
;--------------------------------
align 4
.new_y:
mov [temp_y],eax
mov ebx,[scaling_mode]
test ebx,ebx
jz @f
imul eax,[scaling_delta]
;--------------------------------
push ebx
mov ebx,eax
shr eax,12
and ebx,0xFFF
shl ebx,7 ;multiply 128
shr ebx,12
mov [next_pixel_y],ebx
pop ebx
;--------------------------------
jmp .ex_1
align 4
@@:
;--------------------------------
imul eax,dword [y]
mov bx,word [new_size.y1]
;--------------------------------
align 4
.y_div:
test ebx,ebx
jnz @f
inc ebx
align 4
@@:
xor edx,edx
div ebx
;--------------------------------
push eax
mov eax,edx
shl eax,7 ;multiply 128
xor edx,edx
div ebx
mov [next_pixel_y],eax
pop eax
;--------------------------------
align 4
.ex_1:
mov [temp_y1],eax
imul eax,[size_x]
mov [temp_y_offset],eax
mov ecx,eax
align 4
.offset_x:
test ebx,ebx
jz .finish
mov eax,[esp+4] ;ebx
mov edx,[esp+8]
test edx,edx
jz .continue
shl eax,3
add eax,[area_for_x]
mov edx,[eax+4]
mov [next_pixel_x],edx
mov eax,[eax]
jmp .ex_3
;--------------------------------
align 4
.continue:
mov ebx,[scaling_mode]
test ebx,ebx
jz @f
imul eax,[scaling_delta]
;--------------------------------
mov ebx,eax
shr eax,12
and ebx,0xFFF
shl ebx,7 ;multiply 128
shr ebx,12
mov [next_pixel_x],ebx
;--------------------------------
jmp .ex_2
;--------------------------------
align 4
@@:
imul eax,dword [x]
mov bx,word [new_size.x1]
;--------------------------------
align 4
.x_div:
test ebx,ebx
jnz @f
inc ebx
align 4
@@:
xor edx,edx
div ebx
;--------------------------------
push eax
mov eax,edx
shl eax,7 ;multiply 128
xor edx,edx
div ebx
mov [next_pixel_x],eax
pop eax
;--------------------------------
align 4
.ex_2:
mov edx,[bytes_to_pixel]
mov ebx,eax
xor eax,eax
align 4
@@:
add eax,ebx
dec edx
jnz @r
mov ebx,[esp+4]
shl ebx,3
add ebx,[area_for_x]
mov [ebx],eax
mov edx,[next_pixel_x]
mov [ebx+4],edx
align 4
.ex_3:
mov [temp_x1],eax
add ecx,eax
align 4
.finish:
add ecx,esi
ret
;---------------------------------------------------------------------
align 4
.get_memory:
xor ecx,ecx
mov cx,[new_size.x1]
shl ecx,3
mcall 68,12
mov [area_for_x],eax
xor ecx,ecx
mov ebx,[new_size]
mov cx,bx
shr ebx,16
imul ecx,ebx ;[eax+8]
mov eax,[bytes_to_pixel]
cmp eax,1
jne @f
mov eax,3
@@:
imul ecx,eax
mcall 68,12
mov [raw_area],eax
mov edi,eax
ret
;---------------------------------------------------------------------
include 'b_filter.inc'
;---------------------------------------------------------------------
align 4
EXPORTS:
dd szStart, START
dd szVersion, 0x00010001
dd 0
szStart db 'START',0
szVersion db 'version',0
align 4
pointer dd 0
image_file dd 0
new_size:
.y1: dw 0
.x1: dw 0
x: dd 0
y: dd 0
size_x dd 0
bytes_to_pixel dd 0
start_coordinates:
.y dw 0
.x dw 0
scaling_mode dd 0
raw_area dd 0
scaling_delta dd 0
area_for_x dd 0
temp_y dd 0
temp_y_offset dd 0
resolution dd 0
filtering dd 0
next_pixel_y dd 0
next_pixel_x dd 0
temp_y1 dd 0
temp_x1 dd 0
B_sample dd 0
G_sample dd 0
R_sample dd 0
B_sample_1 dd 0
G_sample_1 dd 0
R_sample_1 dd 0
palette dd 0
background_color dd 0

Binary file not shown.

View File

@ -0,0 +1,128 @@
;---------------------------------------------------------------------
kabout:
test dword [status],4
jnz still
or dword [status],4
call get_memory_for_tread_stack
mov [thread_stack_3],eax
mcall 51,1,thread3 ;,thread_stack_3
jmp still
;---------------------------------------------------------------------
thread3: ; start of bgrd thread
mcall 9, procinfo_threads, -1
mov eax,[ebx+30]
mov [PID3],eax
mcall 40, 0x7
.red:
call .draw_window
.still:
mov eax,10 ; wait here for event
mcall
cmp eax,1 ; redraw request ?
je .red
cmp eax,2 ; key in buffer ?
je .close ;.key
cmp eax,3 ; button in buffer ?
je .button
jmp .still
; .key:
; mcall
; cmp ah,27
; je .close
; jmp .still
.button: ; button
mov eax,17 ; get id
mcall
cmp ah,1 ; button id=1 ?
je .close
cmp ah,2
jne .still ;noclose3
.close:
; btr dword [status],3
; bts dword [status],2
xor dword [status],4
xor eax,eax
mov [PID3],eax
mcall 68,13,[thread_stack_3]
mov eax,-1 ; close this program
mcall
; .noclose:
; jmp still3
; *********************************************
; ******* WINDOW DEFINITIONS AND DRAW ********
; *********************************************
.draw_window:
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
; DRAW WINDOW
xor eax,eax ; function 0 : define and draw window
mov ebx,100*65536+300 ; [x start] *65536 + [x size]
mov ecx,100*65536+240 ; [y start] *65536 + [y size]
mov edx,0x03eeeeee ; color of work area RRGGBB,8->color gl
mcall
mov ebx,120*65536+40
mov ecx,210*65536+20
mov edx,2
mov esi,0xdddddd
mcall 8
pusha
mcall 4,<20,30>,0x80000000,Authors_text.1
mcall ,<30,45>, ,Authors_text.2
mcall ,<30,60>, ,Authors_text.3
mcall ,<60,70>, ,Authors_text.4
mcall ,<60,80>, ,Authors_text.5
mcall ,<60,90>, ,Authors_text.6
mcall ,<60,100>, ,Authors_text.7
mcall ,<30,115>, ,Authors_text.8
mcall ,<60,125>, ,Authors_text.9
mcall ,<60,135>, ,Authors_text.10
mcall ,<30,150>, ,Authors_text.11
mcall ,<60,160>, ,Authors_text.12
mcall ,<30,175>, ,Authors_text.13
mcall ,<60,185>, ,Authors_text.14
popa
add ebx,15 shl 16
shr ecx,16
mov bx,cx
add ebx,6
mov ecx,0
mov edx, ok_btn
mov esi, ok_btn.size ;2
mcall 4
; WINDOW LABEL
mcall 71,1, labelt3
; mcall 47,0x80000,[PID3],<200, 5>,0xffffff
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
ret
;---------------------------------------------------------------------

View File

@ -0,0 +1,92 @@
error_window:
test dword [status],32
jnz still
or dword [status],32
mcall 9, procinfo, -1
mov eax,[ebx+46]
test eax,eax
jnz @f
mov eax,100
mov [error_window_y+2],ax
mov [error_window_x+2],ax
jmp .end
@@:
shr eax,1
add eax,[ebx+38]
sub eax,50
mov [error_window_y+2],ax
mov eax,[ebx+42]
shr eax,1
add eax,[ebx+34]
sub eax,150
mov [error_window_x+2],ax
.end:
call get_memory_for_tread_stack
mov [thread_stack_6],eax
mcall 51,1,thread6 ;,thread_stack_6
ret
;---------------------------------------------------------------------
thread6:
mcall 9, procinfo_threads, -1
mov eax,[ebx+30]
mov [PID6],eax
mcall 40, 0x7
mov [error_pointer],string
.red:
call .draw_error_window
.still:
mcall 10
cmp eax,1
je .red
cmp eax,2 ; key in buffer ?
je .key
cmp eax,3
je .button
jmp .still
.key: ; key
.button:
xor dword [status],32
xor eax,eax
mov [PID6],eax
mcall 68,13,[thread_stack_6]
mcall -1
jmp .still
;---------------------------------------------------------------------
.draw_error_window:
mcall 12, 1
mcall 0,[error_window_x] ,[error_window_y], 0x03ff0000
mcall 71,1, errortext
mcall 4,<10,30>,0x80ffffff,[error_pointer]
cmp [return_code],0
je .continue
cmp [return_code],1
jne @f
mcall 4,<10,50>,0x90ffffff,error_not_supported_file
jmp .end
@@:
cmp [return_code],2
jne @f
mcall 4,<10,50>,0x90ffffff,error_not_enough_memory
jmp .end
@@:
mcall 4,<10,50>,0x90ffffff,error_unknown
jmp .end
.continue:
mcall 4,<10,50>,0x90ffffff,error_type
mcall 47,0x800a0000,[error_fs],<140,50>,0x10ffffff
mov edx,[error_fs]
cmp edx,0
jb .end
cmp edx,11
ja .end
shl edx,2
add edx,error_fs_text_pointers
mov edx,[edx]
mcall 4,<10,70>,0x90ffffff,
; mcall 47,0x800a0000,[error_locate],<140,5>,0x10ffffff
.end:
; mcall 47,0x80000,[PID6],<200, 5>,0xffffff
mcall 12, 2
ret
;---------------------------------------------------------------------

View File

@ -0,0 +1,143 @@
;---------------------------------------------------------------------
k_background:
test dword [status],8
jnz still
or dword [status],8
call get_memory_for_tread_stack
mov [thread_stack_4],eax
mcall 51,1,thread4 ;, thread_stack_4
jmp still
;---------------------------------------------------------------------
thread4: ; start of bgrd thread
mcall 9, procinfo_threads, -1
mov eax,[ebx+30]
mov [PID4],eax
mcall 40, 0x27
.red:
call .draw_window
.still:
mov eax,10 ; wait here for event
mcall
cmp eax,1 ; redraw request ?
je .red
cmp eax,2 ; key in buffer ?
je .key
cmp eax,3 ; button in buffer ?
je .button
cmp eax,6 ; mouse in buffer ?
je .mouse
jmp .still
.mouse:
push dword option_boxes_bcgr
call [option_box_mouse]
cmp [option_group1],op1
jne @f
mov [bgrmode],dword 1
jmp .still
@@:
mov [bgrmode],dword 2
jmp .still
.key:
mcall
cmp ah,27
je .close
cmp ah,13
je .kok
cmp ah,178 ;up
jne .nofup
cmp dword [bgrmode],1
je .fdn
.fup:
dec dword [bgrmode]
jmp .flagcont
.nofup:
cmp ah,177 ;down
jne .still
cmp dword [bgrmode],2
je .fup
.fdn:
inc dword [bgrmode]
.flagcont:
cmp [bgrmode],dword 1
jne @f
mov [option_group1],op1
call .draw_opt_boxes
jmp .still
@@:
mov [option_group1],op2
call .draw_opt_boxes
jmp .still
.button: ; button
mov eax,17 ; get id
mcall
cmp ah,1 ; button id=1 ?
jne .noclose
.close:
xor dword [status],8
xor eax,eax
mov [PID4],eax
mcall 68,13,[thread_stack_4]
mov eax,-1 ; close this program
mcall
.noclose:
.kok:
call background
jmp .close
; *********************************************
; ******* WINDOW DEFINITIONS AND DRAW ********
; *********************************************
.draw_window:
mcall 12,1
; DRAW WINDOW
xor eax,eax ; function 0 : define and draw window
mov ebx,100*65536+200 ; [x start] *65536 + [x size]
mov ecx,100*65536+100 ; [y start] *65536 + [y size]
mov edx,0x03909090 ; color of work area RRGGBB,8->color gl
mcall
mov eax,8
mov ebx,70*65536+40
mov ecx,70*65536+20
mov edx,4
mov esi,0xdddddd
mcall
; WINDOW LABEL
mcall 71,1, labelt4
mov eax,4 ; function 4 : write text to window
mov ebx,46*65536+28 ; [x start] *65536 + [y start]
mov ecx,0xffffff
mov edx, bgrdtext
mov esi, bgrdtext.size
mcall
add ebx,40*65536+48
mov edx, ok_btn
mov esi, ok_btn.size ;2
mov ecx,0
mcall
call .draw_opt_boxes
; mcall 47,0x80000,[PID4],<200, 5>,0xffffff
mcall 12,2
ret
;---------------------------------------------------------------------
.draw_opt_boxes:
push dword option_boxes_bcgr
call [option_box_draw]
ret

View File

@ -0,0 +1,195 @@
;---------------------------------------------------------------------
kfile:
test dword [status],1
jnz still
or dword [status],1
call load_directory.copy_dir_path
; call get_filter_data
cmp [OpenDialog_path],dword 'NoKe'
je @f
mov [OpenDialog_data.start_path],dword OpenDialog_path
jmp .start_OpenDialog
@@:
mov ebx,open_dialog_name
mov esi,path
mov edi,library_path
call copy_file_path
.start_OpenDialog:
;start_OpenDialog OpenDialog_data
push dword OpenDialog_data
call [OpenDialog_Start]
call clear_control_key_flag
cmp [OpenDialog_data.status],2
je thread1_start
cmp [OpenDialog_data.status],1
jne @f
xor dword [status],1
jmp kopen_1
@@:
xor dword [status],1
jmp still
thread1_start:
call get_memory_for_tread_stack
mov [thread_stack],eax
mcall 51,1,thread1 ;, thread_stack
jmp still
;---------------------------------------------------------------------
get_filter_data:
mov edi,Filter+4
xor eax,eax
mov ecx,10
cld
@@:
mov esi,10
sub esi,ecx
lea esi,[esi+esi*2] ; x 3
shl esi,3 ; x 8
add esi,dword Convert_plugin_0.Assoc
mov esi,[esi]
add esi,4
test esi,esi
jz @f
call .start
dec ecx
jnz @r
@@:
mov [edi],byte 0
mov eax,Filter
sub edi,eax
mov [eax],edi
ret
.start:
@@:
lodsb
stosb
test eax,eax
jnz @r
cmp [esi],ah
jne @r
ret
;---------------------------------------------------------------------
thread1: ; start of thread1
mcall 9, procinfo_threads, -1
mov eax,[ebx+30]
mov [PID1],eax
mcall 40, 0x27
or ecx,-1 ; get information about me
call getappinfo
mov esi,string
@@:
cld
lodsb
test al,al
jne @r
sub esi,string
mov eax,esi
dec eax
mov edi, edit1
mov [edi+48], eax ;ed_size
mov [edi+52], eax ;ed_pos
.red:
call .draw_window
.still:
mcall 10 ; wait here for event
cmp eax,1 ; redraw request ?
je .red
cmp eax,2 ; key in buffer ?
je .key
cmp eax,3 ; button in buffer ?
je .button
push dword name_editboxes
call [edit_box_mouse]
; mouse_edit_box name_editboxes
; mouse_menubar menu_data_2
jmp .still
.key: ; key
mcall 2
cmp ah,13
je .close_with_open_file
cmp ah,27
je .close
push dword name_editboxes
call [edit_box_key]
; key_edit_box name_editboxes
jmp .still
.close_with_open_file:
mov [open_file_flag],byte 1
jmp .close
.button: ; button
mov eax,17 ; get id
mcall
cmp ah,1 ; button id=1 ?
jne .still
.close:
; bts dword [status],2
; btr dword [status],0
xor dword [status],1
xor eax,eax
mov [PID1],eax
mcall 68,13,[thread_stack]
mov eax,-1 ; close this program
mcall
jmp .still
; *********************************************
; ******* WINDOW DEFINITIONS AND DRAW ********
; *********************************************
.draw_window:
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
; DRAW WINDOW
xor eax,eax ; function 0 : define and draw window
mov ebx,100*65536+300 ; [x start] *65536 + [x size]
mov ecx,100*65536+80 ; [y start] *65536 + [y size]
mov edx,0x03eeeeee ; color of work area RRGGBB,8->color gl
mcall
; WINDOW LABEL
mcall 71,1, labelt1
push dword name_editboxes
call [edit_box_draw]
; draw_edit_box name_editboxes
; mcall 47,0x80000,[PID1],<200, 5>,0xffffff
; mcall 71,1, proverka
; mcall 47,0x80001,0,<300, 5>,0xffffff
; draw_menu_bar menu_data_2
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
ret
;---------------------------------------------------------------------

View File

@ -0,0 +1,269 @@
;---------------------------------------------------------------------
kinfo:
test dword [status],2
jnz still
or dword [status],2
call get_memory_for_tread_stack
mov [thread_stack_2],eax
mcall 51,1,thread2 ;, thread_stack_2
jmp still
;---------------------------------------------------------------------
thread2: ; start of info thread
mcall 9, procinfo_threads, -1
mov eax,[ebx+30]
mov [PID2],eax
mcall 40, 0x7
call load_directory.copy_dir_path
.red:
call .draw_window
.still:
mov eax,10 ; wait here for event
mcall
cmp eax,1 ; redraw request ?
je .red
cmp eax,2 ; key in buffer ?
je .close
cmp eax,3 ; button in buffer ?
je .button
jmp .still
.button: ; button
mov eax,17 ; get id
mcall
cmp ah,1 ; button id=1 ?
jne .still ;.noclose
.close:
; btr dword [status],1
; bts dword [status],2
xor dword [status],2
xor eax,eax
mov [PID2],eax
mcall 68,13,[thread_stack_2]
mov eax,-1 ; close this program
mcall
;.noclose:
; jmp .still
; *********************************************
; ******* WINDOW DEFINITIONS AND DRAW ********
; *********************************************
.draw_window:
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
; DRAW WINDOW
xor eax,eax ; function 0 : define and draw window
mov ebx,100*65536+330 ; [x start] *65536 + [x size]
mov ecx,100*65536+120 ;290 ; [y start] *65536 + [y size]
mov edx,0x03eeeeee ; color of work area RRGGBB,8->color gl
mcall
; WINDOW LABEL
mcall 71,1, labelt2
; mov ecx,0x80000000 ; font 1 & color ( 0xF0RRGGBB )
; mov ebx,120*65536+30
; mov edx,file_name ;string
; mov esi,1 ;43
mcall 4,<120,30>,0x80000000,file_name
mov edx,fitext
mov esi,14
mov ebx,10*65536+30
mov ecx,0x10000000
@@:
mcall
add ebx,10
add edx,esi
cmp ebx,10*65536+80
jbe @r
mov eax,47
mov edx,120*65536+40
mov esi,ecx
mov ecx, [img_size]
mov ebx,0x800a0000
mcall
add edx,10
mov ecx,[img_width_2]
mcall
add edx,10
mov ecx,[img_high_2]
mcall
add edx,10
mov ecx,[img_resolution_2]
mcall
add edx,10
mov ecx,[Total_Repeat_N]
mcall
; add edx,10
; mov ecx,[communication_area]
; mov ecx,[ecx+4096]
; mcall
; add edx,10
; mov ecx,[communication_area]
; mov ecx,[ecx+4096+4]
; mcall
; add edx,10+10
; mov ecx,[zoom_auto_factor]
; mcall
; add edx,10+10
; mov ecx,[scroll_bar_data_vertical.max_area] ;[img_resolution]
; mcall
; add edx,10
; mov ecx,[scroll_bar_data_vertical.cur_area] ;[return_code]
; mcall
; add edx,10
; mov ecx,[scroll_bar_data_vertical.position]
; mcall
; add edx,10
; xor ecx,ecx
; mov cx,[scroll_bar_data_vertical.size_y]
; mcall
; add edx,10+10
; mcall 47,0x80000,[OpenDialog_Init]
; add edx,10+10
; mcall 47,0x80000,[OpenDialog_Start]
; add edx,10+10
; mcall 47,0x80000,[OpenDialog_data.com_area]
; add edx,10+10
; mcall 47,0x80000,I_END
; add edx,10+10
; mov ecx,[scroll_bar_data_horizontal.max_area] ;[img_resolution]
; mcall
; add edx,10
; mov ecx,[scroll_bar_data_horizontal.cur_area] ;[return_code]
; mcall
; add edx,10
; mov ecx,[scroll_bar_data_horizontal.position]
; mcall
; add edx,10
; xor ecx,ecx
; mov cx,[scroll_bar_data_horizontal.size_x]
; mcall
; add edx,10
; mov ecx,[raw_pointer] ;[deflate_unpack]
; mcall
; add edx,10+10
; mov ebp,test1 ;raw_pointer_2
; mov ecx,[ebp]
; mcall
; add edx,10+10
; mov ebp,size_before_open_dir ;lib_init ;test1 ;raw_pointer_2
; mov ecx,[ebp]
; mcall
; add edx,10
; add ebp,4
; mov ecx,[ebp]
; mcall
; add edx,10
; add ebp,4
; mov ecx,[ebp]
; mcall
; add edx,10
; add ebp,4
; mov ecx,[ebp]
; mcall
; add edx,10
; add ebp,4
; mov ecx,[ebp]
; mcall
; add edx,10
; add ebp,4
; mov ecx,[ebp]
; mcall
; add edx,10
; add ebp,4
; mov ecx,[ebp]
; mcall
; add edx,10
; add ebp,4
; mov ecx,[ebp]
; mcall
; add edx,10
; add ebp,4
; mov ecx,[ebp]
; mcall
; add edx,10
; add ebp,4
; mov ecx,[ebp]
; mcall
; add edx,10
; add ebp,4
; mov ecx,[version_lib_ini]
;; mov ecx,[ecx]
; mcall
; add edx,10
; movzx ecx,word [image_draw_size.x]
; mcall
; add edx,10
; movzx ecx,word [image_draw_size.y]
; mcall
; add edx,10+10
; movzx ecx,word [wa_width]
; mcall
; add edx,10
; movzx ecx,word [wa_high]
; mcall
; add edx,10
; movzx ecx,word [wa_width_1]
; mcall
; add edx,10
; movzx ecx,word [wa_width_2]
; mcall
; add edx,10
; movzx ecx,word [wa_high_1]
; mcall
; add edx,10
; movzx ecx,word [wa_high_2]
; mcall
; add edx,10+10
; mov ecx,[window_width]
; mcall
; add edx,10
; mov ecx,[window_high]
; mcall
; add edx,10
; xor ecx,ecx
; mov cl,[Disposal_Method]
; mcall
; add edx,10
; mov ecx,[soi]
; mcall
; mcall 47,0x80000,[PID2],<200, 5>,0xffffff
; mcall 47,0x800a0000,[error_locate],<140,5>,0x10ffffff
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
ret
;---------------------------------------------------------------------

View File

@ -0,0 +1,386 @@
;---------------------------------------------------------------------
k_option:
test dword [status],64
jnz still
or dword [status],64
call get_memory_for_tread_stack
mov [thread_stack_7],eax
mcall 51,1,thread7 ;,thread_stack_7
jmp still
;---------------------------------------------------------------------
get_memory_for_tread_stack:
mcall 68,12,4096
mov edx,eax
add edx,4096
ret
;---------------------------------------------------------------------
thread7: ; start of bgrd thread
mcall 9, procinfo_threads, -1
mov eax,[ebx+30]
mov [PID7],eax
mcall 40, 0x27
mov eax,[slide_show_delay]
mov [slide_show_delay_old],eax
mov eax,[arrows_offset]
mov [arrows_offset_old],eax
mov eax,[check1+32]
mov [show_file_name_old],eax
mov eax,[check2+32]
mov [filtering_flag_old],eax
xor eax,eax
mov [option_pointer],eax
call .set_pointers
.red:
call .draw_window
.still:
mov eax,10 ; wait here for event
mcall
cmp eax,1 ; redraw request ?
je .red
cmp eax,2 ; key in buffer ?
je .key
cmp eax,3 ; button in buffer ?
je .button
cmp eax,6 ; mouse in buffer ?
je .mouse
jmp .still
.mouse:
mov ebx,[check1+32]
and ebx,10b
push dword check1
call [check_box_mouse]
mov eax,[check1+32]
and eax,10b
cmp ebx,eax
je @f ;.still
mov [option_pointer],2
call .set_pointers
call .draw_all_options_values
jmp .still
@@:
mov ebx,[check2+32]
and ebx,10b
push dword check2
call [check_box_mouse]
mov eax,[check2+32]
and eax,10b
cmp ebx,eax
je .still
mov [option_pointer],3
call .set_pointers
call .draw_all_options_values
jmp .still
;---------------------------------------------------------------------
.key:
mcall
cmp ah,27
je .close
cmp ah,13
je .kok
cmp ah,32
je .select_space
cmp ah,56 ;plus
je .select_plus ;.plus_slide_show_delay
cmp ah,43 ;plus
je .select_plus ;.plus_slide_show_delay
cmp ah,61 ;plus
je .select_plus ;.plus_slide_show_delay
cmp ah,54 ;minus
je .select_minus ;.minus_slide_show_delay
cmp ah,45 ;minus
je .select_minus ;.minus_slide_show_delay
cmp ah,95 ;minus
je .select_minus ;.minus_slide_show_delay
cmp ah,178 ;up arrow
je .up_arrow
cmp ah,177 ;down arrow
je .down_arrow
jmp .still
;---------------------------------------------------------------------
.button: ; button
mov eax,17 ; get id
mcall
cmp ah,5
je .minus_arrows_offset
cmp ah,4
je .plus_arrows_offset
cmp ah,3
je .minus_slide_show_delay
cmp ah,2
je .plus_slide_show_delay
cmp ah,1 ; button id=1 ?
jne .noclose
.close:
mov eax,[slide_show_delay_old]
mov [slide_show_delay],eax
mov eax,[arrows_offset_old]
mov [arrows_offset],eax
mov eax,[show_file_name_old]
mov [check1+32],eax
mov eax,[filtering_flag_old]
mov [check2+32],eax
jmp .close_all
.close_1:
mov eax,[check2+32]
test eax,10b
jz @f
mov [filtering_flag],1
jmp .redraw_flag
@@:
mov [filtering_flag],0
.redraw_flag:
mov [redraw_flag],byte 1
.close_all:
xor dword [status],64
xor eax,eax
mov [PID7],eax
mcall 68,13,[thread_stack_7]
mov eax,-1 ; close this program
mcall
.noclose:
.kok:
jmp .close_1
;---------------------------------------------------------------------
.select_plus:
jmp [plus_pointer]
;---------------------------------------------------------------------
.select_minus:
jmp [minus_pointer]
;---------------------------------------------------------------------
.select_space:
jmp [space_pointer]
;---------------------------------------------------------------------
.plus_slide_show_delay:
cmp [option_pointer],0
je @f
mov [option_pointer],0
call .draw_all_options_values
@@:
cmp [slide_show_delay],99990
je .still
add [slide_show_delay],10
call .draw_slide_show_delay
jmp .still
;---------------------------------------------------------------------
.minus_slide_show_delay:
cmp [option_pointer],0
je @f
mov [option_pointer],0
call .draw_all_options_values
@@:
cmp [slide_show_delay],0
je .still
sub [slide_show_delay],10
call .draw_slide_show_delay
jmp .still
;---------------------------------------------------------------------
.plus_arrows_offset:
cmp [option_pointer],1
je @f
mov [option_pointer],1
call .draw_all_options_values
@@:
cmp [arrows_offset],100
je .still
inc [arrows_offset]
call .draw_arrows_offset
call calculate_arrows_offset
jmp .still
;---------------------------------------------------------------------
.minus_arrows_offset:
cmp [option_pointer],1
je @f
mov [option_pointer],1
call .draw_all_options_values
@@:
cmp [arrows_offset],1
je .still
dec [arrows_offset]
call .draw_arrows_offset
call calculate_arrows_offset
jmp .still
;---------------------------------------------------------------------
.space_check1:
test [check1+32],dword 10b
jnz @f
or [check1+32],dword 10b
jmp .space_check1_1
@@:
xor [check1+32],dword 10b
.space_check1_1:
call .draw_all_options_values
jmp .still
;---------------------------------------------------------------------
.space_check2:
test [check2+32],dword 10b
jnz @f
or [check2+32],dword 10b
jmp .space_check2_1
@@:
xor [check2+32],dword 10b
.space_check2_1:
call .draw_all_options_values
jmp .still
;---------------------------------------------------------------------
.down_arrow:
cmp [option_pointer],3
je .still
inc [option_pointer]
.draw_all_points:
call .set_pointers
call .draw_all_options_values
jmp .still
;---------------------------------------------------------------------
.up_arrow:
cmp [option_pointer],0
je .still
dec [option_pointer]
jmp .draw_all_points
;---------------------------------------------------------------------
.set_pointers:
cmp [option_pointer],0
jne @f
mov [plus_pointer],thread7.plus_slide_show_delay
mov [minus_pointer],thread7.minus_slide_show_delay
mov [space_pointer],thread7.still
ret
@@:
cmp [option_pointer],1
jne @f
mov [plus_pointer],thread7.plus_arrows_offset
mov [minus_pointer],thread7.minus_arrows_offset
mov [space_pointer],thread7.still
ret
@@:
cmp [option_pointer],2
jne @f
mov [plus_pointer],thread7.still
mov [minus_pointer],thread7.still
mov [space_pointer],thread7.space_check1
ret
@@:
mov [plus_pointer],thread7.still
mov [minus_pointer],thread7.still
mov [space_pointer],thread7.space_check2
ret
;---------------------------------------------------------------------
.draw_all_options_values:
call .draw_slide_show_delay
call .draw_arrows_offset
call .draw_check1
call .draw_check2
ret
;---------------------------------------------------------------------
; *********************************************
; ******* WINDOW DEFINITIONS AND DRAW ********
; *********************************************
.draw_window:
mcall 12,1
; DRAW WINDOW
xor eax,eax ; function 0 : define and draw window
mov ebx,100*65536+300 ; [x start] *65536 + [x size]
mov ecx,100*65536+120 ; [y start] *65536 + [y size]
mov edx,0x03909090 ; color of work area RRGGBB,8->color gl
mcall
mcall 8,<15,10>,<50,11>,2,0xdddddd
inc edx
mcall ,<77,10>
;---------------------------------
inc edx
mcall ,<15,10>,<90,11>
inc edx
mcall ,<77,10>
;---------------------------------
inc edx
mcall ,<250,40>,<50,20>
;---------------------------------
; mcall 13,<50,45>,<25,12>,0xffffff
; mov ecx,[ch_flag_en]
; mcall 47,0x800a0000,,<72,27>,0x10000000; 0x40000000,0xffffff
; WINDOW LABEL
mcall 71,1, optiontext
; mov eax,4 ; function 4 : write text to window
; mov ebx,46*65536+28 ; [x start] *65536 + [y start]
; mov ecx,0xffffff
; mov edx, sorttext
; mov esi, sorttext.size
; mcall
; mov ebx,135*65536+57
; mov edx, ok_btn
; mov esi, ok_btn.size ;2
mcall 4,<10,35>,0x80ffffff,slide_show_delay_title
mcall ,<17,53>,0x90000000,slide_show_delay_text
mcall ,<10,75>,0x80ffffff,arrows_offset_title
mcall ,<17,93>,0x90000000,slide_show_delay_text
mcall ,<265,57>, ,ok_btn
call .draw_all_options_values
; mcall 47,0x80000,[PID5],<200, 5>,0xffffff
mcall 12,2
ret
;---------------------------------------------------------------------
;.draw_opt_boxes:
; draw_option_boxes option_boxes_sort,option_boxes_sort_end
; ret
;---------------------------------------------------------------------
.draw_slide_show_delay:
mov edx,0xffffff
cmp [option_pointer],0
jne @f
mov edx,0xffff80
@@:
mcall 13,<29,45>,<50,12>,
mcall 47,0x800a0000,[slide_show_delay],<32,52>,0x10000000; 0x40000000,0xffffff
ret
;---------------------------------------------------------------------
.draw_arrows_offset:
mov edx,0xffffff
cmp [option_pointer],1
jne @f
mov edx,0xffff80
@@:
mcall 13,<29,45>,<90,12>,
mcall 47,0x800a0000,[arrows_offset],<32,92>,0x10000000; 0x40000000,0xffffff
ret
;---------------------------------------------------------------------
.draw_check1:
mov [check1+12],dword 0xffffff
cmp [option_pointer],2
jne @f
mov [check1+12],dword 0xffff80
@@:
push dword check1
call [check_box_draw]
ret
;---------------------------------------------------------------------
.draw_check2:
mov [check2+12],dword 0xffffff
cmp [option_pointer],3
jne @f
mov [check2+12],dword 0xffff80
@@:
push dword check2
call [check_box_draw]
ret
;---------------------------------------------------------------------

View File

@ -0,0 +1,206 @@
;---------------------------------------------------------------------
k_sort_directory:
test dword [status],16
jnz still
or dword [status],16
call get_memory_for_tread_stack
mov [thread_stack_5],eax
mcall 51, 1, thread5 ;, thread_stack_5
jmp still
;---------------------------------------------------------------------
thread5: ; start of bgrd thread
mcall 9, procinfo_threads, -1
mov eax,[ebx+30]
mov [PID5],eax
mcall 40, 0x27
mov eax,[sort_type]
cmp [sort_type],dword 0
jne @f
mov [option_group2],sort0
jmp .thread5
@@:
cmp [sort_type],dword 2
jne @f
mov [option_group2],sort2
jmp .thread5
@@:
cmp [sort_type],dword 4
jne @f
mov [option_group2],sort4
jmp .thread5
@@:
; cmp [sort_type],dword 6
; jne @f
mov [option_group2],sort6
; jmp .thread5
;@@:
.thread5:
mov [sort_type_old],eax
mov eax,[option_group2]
mov [option_group2_old],eax
.red:
call .draw_window
.still:
mov eax,10 ; wait here for event
mcall
cmp eax,1 ; redraw request ?
je .red
cmp eax,2 ; key in buffer ?
je .key
cmp eax,3 ; button in buffer ?
je .button
cmp eax,6 ; mouse in buffer ?
je .mouse
jmp .still
.mouse:
push dword option_boxes_sort
call [option_box_mouse]
cmp [option_group2],sort0
jne @f
mov [sort_type],dword 0
jmp .still
@@:
cmp [option_group2],sort2
jne @f
mov [sort_type],dword 2
jmp .still
@@:
cmp [option_group2],sort4
jne @f
mov [sort_type],dword 4
jmp .still
@@:
cmp [option_group2],sort6
jne @f
mov [sort_type],dword 6
jmp .still
.key:
mcall
cmp ah,27
je .close
cmp ah,13
je .kok
cmp ah,177 ;down
je .fdn
cmp ah,178 ;up
jne .still
cmp [sort_type],0
je .still
sub [sort_type],2
jmp .flagcont
.fdn:
cmp [sort_type],6
je .still
add [sort_type],2
.flagcont:
cmp [sort_type],dword 0
jne @f
mov [option_group2],sort0
call .draw_opt_boxes
jmp .still
@@:
cmp [sort_type],dword 2
jne @f
mov [option_group2],sort2
call .draw_opt_boxes
jmp .still
@@:
cmp [sort_type],dword 4
jne @f
mov [option_group2],sort4
call .draw_opt_boxes
jmp .still
@@:
cmp [sort_type],dword 6
jne .still ;@f
mov [option_group2],sort6
call .draw_opt_boxes
jmp .still
.button: ; button
mov eax,17 ; get id
mcall
cmp ah,1 ; button id=1 ?
jne .noclose
.close:
mov eax,[sort_type_old]
mov [sort_type],eax
mov eax,[option_group2_old]
mov [option_group2],eax
.close_1:
xor dword [status],16
xor eax,eax
mov [PID5],eax
mcall 68,13,[thread_stack_5]
mov eax,-1 ; close this program
mcall
.noclose:
.kok:
mov eax,[load_directory_pointer]
cmp [eax+4],dword 0
je .close_1
call load_directory.copy_dir_path
call load_directory.sort
mov [sort_directory_flag],byte 1
jmp .close_1
; *********************************************
; ******* WINDOW DEFINITIONS AND DRAW ********
; *********************************************
.draw_window:
mcall 12,1
; DRAW WINDOW
xor eax,eax ; function 0 : define and draw window
mov ebx,100*65536+300 ; [x start] *65536 + [x size]
mov ecx,100*65536+110 ; [y start] *65536 + [y size]
mov edx,0x03909090 ; color of work area RRGGBB,8->color gl
mcall
mov eax,8
mov ebx,120*65536+40
mov ecx,50*65536+20
mov edx,4
mov esi,0xdddddd
mcall
; WINDOW LABEL
mcall 71,1, labelt5
mov eax,4 ; function 4 : write text to window
mov ebx,46*65536+28 ; [x start] *65536 + [y start]
mov ecx,0xffffff
mov edx, sorttext
mov esi, sorttext.size
mcall
mov ebx,135*65536+57
mov edx, ok_btn
mov esi, ok_btn.size ;2
mov ecx,0
mcall
call .draw_opt_boxes
; mcall 47,0x80000,[PID5],<200, 5>,0xffffff
mcall 12,2
ret
;---------------------------------------------------------------------
.draw_opt_boxes:
push dword option_boxes_sort
call [option_box_draw]
ret

View File

@ -0,0 +1,448 @@
;*****************************************************************************
; zSea - advanced image viewer for KolibriOS
; Copyright (c) 2008-2011, Marat Zakiyanov aka Mario79, aka Mario
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:
; * Redistributions of source code must retain the above copyright
; notice, this list of conditions and the following disclaimer.
; * Redistributions in binary form must reproduce the above copyright
; notice, this list of conditions and the following disclaimer in the
; documentation and/or other materials provided with the distribution.
; * Neither the name of the <organization> nor the
; names of its contributors may be used to endorse or promote products
; derived from this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY Marat Zakiyanov ''AS IS'' AND ANY
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;*****************************************************************************
; v.1.0 rñ3 12.06.2011
;******************************************************************************
use32
org 0x0
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 stacktop ; esp
dd temp_area ; I_Param
dd path ; APPLICATION PACH
include 'lang.inc'
;include 'macros.inc'
;include 'editbox_ex.mac'
;include 'proc32.inc'
include '../../macros.inc'
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
include '../../proc32.inc'
;include 'load_lib.mac'
include '../../develop/libraries/box_lib/load_lib.mac'
@use_library ;use load lib macros
;******************************************************************************
START: ; start of execution
mcall 68, 11
mcall 66, 1,1
mcall 40, 0x27
mcall 9, procinfo, -1
mov eax,[ebx+30]
mov [PID],eax
xor ecx,ecx
@@:
inc ecx
mcall 9, procinfo
mov eax,[PID]
cmp eax,[ebx+30]
jne @r
mov [active_process],ecx
mcall 68,12,1024
mov [menu_data_1.procinfo],eax
mov [menu_data_2.procinfo],eax
mov [menu_data_3.procinfo],eax
mov [menu_data_4.procinfo],eax
mov [menu_data_5.procinfo],eax
mov [menu_data_6.procinfo],eax
mov [load_directory_pointer],dir_header
call load_plugins
call load_buttons
; call init_data_OpenDialog
;init_OpenDialog OpenDialog_data
push dword OpenDialog_data
call [OpenDialog_Init]
call get_filter_data
;-----------------------------------------------------
; check for parameters
cmp dword [temp_area],'BOOT'
jne .no_boot
.background:
call load_image
cmp [error_fs],0
jnz .exit
call convert
call background
.exit:
call Set_ini
.exit_1:
mov ebx,18
mov edx,PID1
mov esi,7
.kill_successors:
mov ecx,[edx]
add edx,4
test ecx,ecx
jz @f
mcall 18
@@:
dec esi
jnz .kill_successors
mcall -1
;-----------------------------------------------------
.no_boot:
xor eax,eax
cmp byte [temp_area],al
jnz @f
mov [file_name],eax
jmp .no_param
@@:
mov edi,string ; clear string
mov ecx,256/4 ; length of a string
xor eax,eax ; symbol <0>
rep stosd
mov edi,temp_area ; look for <0> in temp_area
cmp [edi],byte "\"
jne .continue
cmp [edi+1],byte "T"
jne @f
mov [bgrmode],dword 1
jmp .continue_1
@@:
cmp [edi+1],byte "S"
jne START.exit
mov [bgrmode],dword 2
.continue_1:
add edi,4
.continue:
mov esi,edi
mov ecx,257 ; strlen
repne scasb
lea ecx, [edi-temp_area]
mov edi,string
rep movsb ; copy string from temp_area to "string" (filename)
cmp [temp_area],byte "\"
je START.background
call load_directory
test eax,eax
jnz @f
call load_image
test eax,eax
jnz @f
call convert
jmp .no_param
@@:
mov [load_directory_pointer],dir_header
mov [error_fs],eax
call convert.error
;-----------------------------------------------------
.no_param:
; or ecx,-1 ; get information about me
; call getappinfo
; mov edx,[process_info+30] ; òåïåðü â edx íàø èäåíòèôèêàòîð
; mov ecx,eax
; @@:
; call getappinfo
; cmp edx,[process_info+30]
; je @f ; åñëè íàø PID ñîâïàë ñ PID ðàññìàòðèâàåìîãî ïðîöåññà, ìû íàøëè ñåáÿ
; dec ecx ; èíà÷å ñìîòðèì ñëåäóþùèé ïðîöåññ
; jne @b ; âîçâðàùàåìñÿ, åñëè íå âñå ïðîöåññû ðàññìîòðåíû
; @@:
; òåïåðü â ecx íîìåð ïðîöåññà
; mov [process],ecx
;---------------------------------------------------------------------
cmp [wnd_width],635
jae @f
mov [wnd_width],635
@@:
cmp [wnd_height],150
jae @f
mov [wnd_height],150
@@:
; call draw_window
red:
;draw_still:
; pusha
call get_window_param
test [window_status],10b
jnz red_1 ;still
test [window_status],100b
jnz red_1
test [window_status],1b
jnz red_1
mov esi,-1
mov eax,procinfo
mov eax,[eax+66]
cmp eax,150
; cmp [window_high],150
jae @f
mov esi,150
mcall 67,-1,ebx,ebx
@@:
mov edx,-1
mov eax,procinfo
mov eax,[eax+62]
cmp eax,635
; cmp [window_width],635
jae @f ;red_1
mov edx,635
mcall 67,-1,ebx, ,ebx
@@:
; mcall 67,-1,ebx
; popa
; xor esi,esi
red_1:
; xor eax,eax
; mov [scroll_bar_data_vertical.position],eax
; mov [scroll_bar_data_horizontal.position],eax
call draw_window
cmp [redraw_wallpaper_flag],0
je still
mov [redraw_wallpaper_flag],0
call clear_thread
; mcall 15,3
; jmp red_1
still:
cmp [RAW1_flag],1
je animation_handler
mcall 10
.1:
cmp [open_file_flag],1
je kopen_1
cmp [sort_directory_flag],byte 1
je red_sort_directory
cmp [redraw_flag],byte 1
je redraw_window
cmp eax,1 ; ïåðåðèñîâàòü îêíî ?
je red ; åñëè äà - íà ìåòêó red
cmp eax,2 ; íàæàòà êëàâèøà ?
je key ; åñëè äà - íà key
cmp eax,3 ; íàæàòà êíîïêà ?
je button ; åñëè äà - íà button
cmp eax,6
je mouse
; cmp [redraw_wallpaper_flag],1
; jne still
; mov [redraw_wallpaper_flag],0
; mcall 15,3
jmp still ; åñëè äðóãîå ñîáûòèå - â íà÷àëî öèêëà
red_sort_directory:
mov [sort_directory_flag],byte 0
jmp red_1
redraw_window:
mov [redraw_flag],byte 0
jmp red_1
;---------------------------------------------------------------------
; red:
; test dword [status], 4
; jz draw_still
; mov al,18
; mov ebx,3
; mov ecx,[process]
; mcall 18,3,[active_process]
; and byte [status], not 4
; jmp still
;---------------------------------------------------------------------
button: ; button
mov eax,17 ; get id
mcall
cmp ah,1 ; button id=1 ?
je START.exit
; jne .noclose
;
; mov eax,-1 ; close this program
; mcall
.noclose:
cmp ah,2
je slide_show.3 ;still
jmp slide_show
;---------------------------------------------------------------------
kopen_1:
mov [open_file_flag],0
call load_directory
test eax,eax
jz kopen
.err:
mov [load_directory_pointer],dir_header
mov [error_fs],eax
call convert.error
jmp still ;red_1
kopen:
cmp [string],byte 0
je still
mov ecx,-1
call getappinfo
call load_image
test eax,eax
jnz kopen_1.err
call convert
.1:
call get_window_param
test [window_status],1b
jz red ;draw_still
mov [no_draw_window],1
; push edx
; mov edx,size_after_convert_2
; call write_memory_size
; pop edx
call draw_other
mov [no_draw_window],0
; jmp draw_still
jmp still
;---------------------------------------------------------------------
getappinfo:
mov eax,9
mov ebx,process_info
mcall
ret
;---------------------------------------------------------------------
; ÓÑÒÀÍÎÂÈÒÜ ÔÎÍ
background:
cmp [soi],0
je .end
mov ecx,[img_width] ; øèðèíà
test ecx,ecx
jz .end
mov edx,[img_high] ; âûñîòà 
test edx,edx
jz .end
mcall 15,1 ; set size
mov esi,ecx
imul esi,edx
lea esi,[esi*3]
; mov ebx,5
mov ecx,[soi]
xor edx,edx
cmp [img_resolution],24
je @f
mov eax,image_file
; call [plugin_convert_background]
call [convert_Conv_24b]
mov ecx,[raw_pointer_2]
mcall 15,5 ;15,5 set data
mov ecx,[raw_pointer_2]
mcall 68,13
jmp .set_mode
@@:
mcall 15,5 ; 15,5 set data
.set_mode:
; dec ebx ;tile/stretch
mov ecx,[bgrmode]
mcall 15,4 ; 15,4 set mode
dec ebx ; 15,3 redraw background
mcall
.end:
ret
;---------------------------------------------------------------------
get_window_param:
mcall 9, procinfo, -1
mov eax,[ebx+34]
mov [window_start_x],eax
mov eax,[ebx+38]
mov [window_start_y],eax
mov eax,[ebx+66] ;46]
inc eax
mov [window_high],eax
mov eax,[ebx+62] ;42]
inc eax
mov [window_width],eax
mov eax,[ebx+70]
mov [window_status],eax
; mcall 48,4
; mov [skin_high],eax
ret
;---------------------------------------------------------------------
;write_memory_size:
; pusha
; mcall 9, procinfo, -1
; mov eax,[ebx+26]
; mov [edx],eax
; popa
; ret
;---------------------------------------------------------------------
include 'draw_win.inc'
include 'full_win.inc'
include 'mouse.inc'
include 'key.inc'
include 'menu_key.inc'
include 'clr_bcgr.inc'
include 'w_error.inc'
include 'load.inc'
include 'animat.inc'
include 'draw_img.inc'
include 'convert.inc'
include 'zoom.inc'
include 'w_about.inc'
include 'win_file.inc'
include 'win_info.inc'
include 'win_bcgr.inc'
include 'win_sort.inc'
include 'win_opti.inc'
include 'libini.inc'
include 'dll.inc'
include 'data.inc'
;---------------------------------------------------------------------
IM_END:
include 'dat_area.inc'
I_END:

View File

@ -0,0 +1,35 @@
[Associations]
ImageEditor=/sys/media/animage
TextViewer=/sys/tinypad
[Path]
Plugins=/plugins/
SysLibrary=/sys/lib/
ButtonPictures=/buttons/
[Files]
PassiveButtonsPic=1.png
AktiveButtonsPic=2.png
ClickButtonsPic=3.png
DisableAButtonsPic=4.png
HelpText=zSea_keys.txt
[Plugins]
BoxLib=box_lib.obj
Sort=sort.obj
Convert=convert.obj
Rotate=rotate.obj
Scaling=scaling.obj
Plugin1=cnv_bmp.obj
Plugin2=cnv_png.obj
Plugin3=cnv_jpeg.obj
Plugin4=cnv_gif.obj
[Var]
SortMode=2
ArrowsOffset=10
SlideShowDelay=300
ShowFileName=1
FullScreen=1
Zoom=100

View File

@ -0,0 +1,725 @@
;---------------------------------------------------------------------
invert_left_to_right:
mov ebx,3
jmp rotate_counter_clockwise.1
;---------------------------------------------------------------------
invert_up_to_down:
mov ebx,4
jmp rotate_counter_clockwise.1
;---------------------------------------------------------------------
rotate_clockwise:
mov ebx,1
jmp rotate_counter_clockwise.1
;---------------------------------------------------------------------
rotate_counter_clockwise:
mov ebx,2
.1:
mov eax,[soi]
test eax,eax
jz still
mov eax,[RAW1_pointer]
test eax,eax
jz @f
cmp [Total_Repeat_N],1
ja still
@@:
push ebx
call proc_position_correct
mov eax,[vertical_position_coorect]
mov ebx,[horizontal_position_coorect]
mov [horizontal_position_coorect],eax
mov [vertical_position_coorect],ebx
pop ebx
mov eax,image_file
; call [plugin_rotate]
call [rotate_Start]
mov ebx,[raw_pointer]
mov eax,[ebx+4]
mov [img_width],eax
mov eax,[ebx+8]
mov [img_high],eax
call convert.img_resolution_ok
jmp kopen.1
;---------------------------------------------------------------------
calculate_arrows_offset:
mov eax,[arrows_offset]
imul eax,[scaling_mode]
mov ebx,100
xor edx,edx
div ebx
mov [scroll_bar_data_vertical.ar_offset],eax
mov [scroll_bar_data_horizontal.ar_offset],eax
ret
;---------------------------------------------------------------------
no_scaling:
mov eax,scaling_mode
cmp [eax],dword 100
je still
.1:
mov [eax],dword 100
mov [zoom_factors],dword zoom_factors.100
mov eax,[eax]
jmp zoom_plus.2
; call calculate_arrows_offset
; call draw_zoom_factors
; jmp red
;---------------------------------------------------------------------
scaling:
mov eax,[soi]
test eax,eax
jz still
mov eax,scaling_mode
xor ebx,ebx
cmp [eax],ebx ;dword 0
je still
mov [eax],ebx ;dword 0
mov [zoom_factors],dword zoom_factors.1
call .1
call draw_zoom_factors
jmp still
;---------------------------
.compens_x:
call .get_x_y
xor ecx,ecx
mov cx,[wa_high_1]
imul eax,ecx
xor edx,edx
div ebx
ret
;---------------------------
.compens_y:
call .get_x_y
xchg eax,ebx
xor ecx,ecx
mov cx,[wa_width_1]
imul eax,ecx
xor edx,edx
div ebx
ret
;---------------------------
.get_x_y:
mov ebx,[raw_pointer]
mov eax,[ebx+4]
mov ebx,[ebx+8]
ret
;---------------------------
.fill_for_L_R:
cmp [no_fill],1
je @f
; xor eax,eax
; mov [no_fill],al
; ret
;@@:
pusha
mov ebx,[image_start_coordinates]
mov ecx,ebx
shl ecx,16
mov bx,ax
mov cx,[wa_high_1]
mcall 13,,,[fill_color] ;0xffffff
mov ax,bx
ror ebx,16
add bx,ax
add bx,[wa_width_2]
mov ax,[wa_width_1]
; add ax,5
sub ax,bx
rol ebx,16
mov bx,ax
mcall 13,,,[fill_color] ;0xffffff
popa
@@:
ret
;---------------------------
.fill_for_U_D:
cmp [no_fill],1
je @f
; xor eax,eax
; mov [no_fill],al
; ret
;@@:
pusha
mov ebx,[image_start_coordinates]
mov ecx,ebx
shl ecx,16
mov cx,ax
mov bx,[wa_width_1]
mcall 13,,,[fill_color] ;0xffffff
mov ax,cx
ror ecx,16
add cx,ax
add cx,[wa_high_2]
mov ax,[wa_high_1]
add ax,28 ;50
sub ax,cx
rol ecx,16
mov cx,ax
mcall 13,,,[fill_color] ;0xffffff
popa
@@:
ret
;---------------------------
.1:
call .get_x_y
cmp eax,ebx
jb .y
;---------------------------
.x:
call .compens_y
cmp ax,[wa_high_1]
jbe @f
call .compens_x
mov [wa_width_2],ax
jmp .4
@@:
mov [wa_high_2],ax
jmp .4
;---------------------------
.y:
call .compens_x
cmp ax,[wa_width_1]
jbe @f
call .compens_y
mov [wa_high_2],ax
jmp .4
@@:
mov [wa_width_2],ax
;---------------------------
.4:
mov bx,[wa_width_2]
shl ebx,16
mov bx,[wa_high_2]
xor ecx,ecx
.5:
; mov eax,ebx
; and eax,0xffff
; mov [test1],eax
; mov eax,ebx
; shr eax,16
; mov [test2],eax
; mov eax,ecx
; and eax,0xffff
; mov [test3],eax
; mov eax,ecx
; shr eax,16
; mov [test4],eax
mov eax,image_file
mov edx,[scaling_mode]
movzx esi,byte [filtering_flag]
mov edi,[background_color]
; pusha
; mcall 26,9
; mov [test1],eax
; popa
; call [plugin_scaling]
call [Scaling_Start]
; pusha
; mcall 26,9
; mov ebx,[test1]
; sub eax,ebx
; cmp [test2],0
; je @f
; add eax,[test2]
; shr eax,1
; cmp eax,[test3]
; jbe @f
; mov [test3],eax
;@@:
; mov [test2],eax
; popa
mov ecx,ebx
mov edx,[image_start_coordinates]
mov eax,edx
shl eax,16
mov ax,cx
mov [scroll_bar_data_vertical.y],eax
mov eax,edx
mov ebx,ecx
shr ebx,16
mov ax,bx
mov [scroll_bar_data_horizontal.x],eax
; call correct_cur_area
; movzx eax,[wa_width_1]
; mov [test1],eax
; movzx eax,[wa_width_2]
; mov [test2],eax
; movzx eax,[wa_high_1]
; mov [test3],eax
; movzx eax,[wa_high_2]
; mov [test4],eax
xor eax,eax
mov ax,[wa_width_1]
sub ax,[wa_width_2]
shr ax,1
test ax,ax
jz @f
shl eax,16
add edx,eax
shr eax,16
call .fill_for_L_R
@@:
mov ax,[wa_high_1]
sub ax,[wa_high_2]
shr ax,1
test ax,ax
jz @f
add edx,eax
call .fill_for_U_D
@@:
mov esi,[img_resolution]
cmp [img_resolution_2],15
jne @f
mov esi,15
@@:
mov eax,[raw_pointer]
mov edi,[eax+20]
add edi,eax
; mov edi,[img_palette]
xor ebp,ebp
mov ebx,[raw_pointer_2]
mov eax,ecx
test ax,ax
jz .no_draw ;@f
shr eax,16
test eax,eax
jz .no_draw ;@f
cmp [filtering_flag],0
je @f
cmp esi,8
jne @f
mov esi,24
@@:
mcall 65
.no_draw:
; mov eax,ecx
; shr eax,16
; mov [test1],eax
;
; mov eax,ecx
; and eax,0xffff
; mov [test2],eax
;
; mov eax,edx
; shr eax,16
; mov [test3],eax
;
; mov eax,edx
; and eax,0xffff
; mov [test4],eax
push ebx
call draw_file_name_to_work_area
pop ebx
mov ecx,ebx ;[raw_pointer_2]
mcall 68,13
xor eax,eax
mov ax,[wa_width_2]
; imul eax,100
; ÅÀÕ = ÅÀÕ * 100
shl eax,2 ; óìíîæåíèå íà 4
lea eax,[eax+eax*4] ; óìíîæåíèå íà 5
lea eax,[eax+eax*4] ; óìíîæåíèå íà 5
mov ebx,[img_width]
test ebx,ebx
jnz @f
inc ebx
@@:
xor edx,edx
div ebx
shl edx,1
cmp ebx,edx
jb @f
inc eax
@@:
mov [zoom_auto_factor],eax
ret
;---------------------------------------------------------------------
calculation_next_value_plus:
mov ebx,[zoom_auto_factor]
mov ecx,zoom_factors.min
sub ecx,4
@@:
add ecx,4
cmp ecx,dword zoom_factors.max
jae .max
mov eax,[ecx]
cmp eax,ebx
jb @r
@@:
mov eax,zoom_factors
mov [eax],ecx
; jmp zoom_plus.1
ret
.max:
mov ecx,dword zoom_factors.max
jmp @r
;---------------------------------------------------------------------
calculation_next_value_minus:
mov ebx,[zoom_auto_factor]
mov ecx,zoom_factors.max
add ecx,4
@@:
sub ecx,4
cmp ecx,dword zoom_factors.min
jbe .min
mov eax,[ecx]
cmp eax,ebx
ja @r
@@:
mov eax,zoom_factors
mov [eax],ecx
; jmp zoom_plus.1
ret
.min:
mov ecx,dword zoom_factors.min
jmp @r
;---------------------------------------------------------------------
proc_position_correct:
mov [position_coorect],1
mov eax,[scroll_bar_data_vertical.max_area]
xor ebx,ebx
mov bx,[wa_high_1]
shr ebx,1
shl eax,8
add ebx,[scroll_bar_data_vertical.position]
test ebx,ebx
jnz @f
inc ebx
@@:
xor edx,edx
div ebx
mov [vertical_position_coorect],eax
mov eax,[scroll_bar_data_horizontal.max_area]
xor ebx,ebx
mov bx,[wa_width_1]
shr ebx,1
shl eax,8
add ebx,[scroll_bar_data_horizontal.position]
test ebx,ebx
jnz @f
inc ebx
@@:
xor edx,edx
div ebx
mov [horizontal_position_coorect],eax
ret
;---------------------------------------------------------------------
zoom_plus:
; cmp [scaling_mode],dword 0
mov eax,[scaling_mode]
test eax,eax
; jz no_scaling.1
; jz calculation_next_value_plus
jnz @f
call calculation_next_value_plus
jmp .1
@@:
; jne @f
; mov [scaling_mode],dword 100
; mov [zoom_factors],dword zoom_factors.100
; call draw_zoom_factors
; jmp red
;@@:
mov eax,zoom_factors
cmp [eax],dword zoom_factors.max
jae still
add [eax],dword 4
.1:
mov eax,[eax]
mov eax,[eax]
.2:
mov [scaling_mode],eax
mov [correct_scrollbar_100_flag],1
call calculate_arrows_offset
call proc_position_correct
call drawimage
call set_draw_scrollbar_all
call draw_scrollbars
call set_nodraw_scrollbar_all
call draw_zoom_factors
jmp still
zoom_all:
;******************************
mov eax,wa_width_1
mov eax,[eax]
push eax
mov eax,wa_high_1
mov eax,[eax]
push eax
;******************************
cmp [position_coorect],0
je .correct_end
mov [position_coorect],0
mov eax,[scroll_bar_data_vertical.max_area]
; xor ebx,ebx
; mov bx,[wa_high_1]
; shr ebx,1
; add eax,ebx ;[scroll_bar_data_vertical.cur_area]
shl eax,8
mov ebx,[vertical_position_coorect]
test ebx,ebx
jnz @f
inc ebx
@@:
xor edx,edx
div ebx
; shr eax,8
xor ebx,ebx
mov bx,[wa_high_1]
shr ebx,1
cmp eax,ebx
jae @f
xor eax,eax
jmp .position_vertical_correct
@@:
sub eax,ebx
.position_vertical_correct:
mov [scroll_bar_data_vertical.position],eax
mov eax,[scroll_bar_data_horizontal.max_area]
; xor ebx,ebx
; mov bx,[wa_width_1]
; shr ebx,1
; add eax,ebx ;[scroll_bar_data_horizontal.cur_area]
shl eax,8
mov ebx,[horizontal_position_coorect]
test ebx,ebx
jnz @f
inc ebx
@@:
xor edx,edx
div ebx
; shr eax,8
xor ebx,ebx
mov bx,[wa_width_1]
shr ebx,1
cmp eax,ebx
jae @f
xor eax,eax
jmp .position_horizontal_correct
@@:
sub eax,ebx
.position_horizontal_correct:
mov [scroll_bar_data_horizontal.position],eax
.correct_end:
;****************************************************************************
; Vertical SCROLLBAR
; At a case of resizing of the window
; Check the position of a runner has crossed a limit
;****************************************************************************
mov eax,[scroll_bar_data_vertical.max_area]
xor ebx,ebx
mov bx,[wa_high_1]
cmp eax,ebx
ja @f
xor eax,eax
jmp .p_5
@@:
sub eax,ebx ;[scroll_bar_data_vertical.cur_area]
cmp eax,[scroll_bar_data_vertical.position]
jae @f
.p_5:
mov [scroll_bar_data_vertical.position],eax
@@:
;****************************************************************************
; Horizontal SCROLLBAR
; At a case of resizing of the window
; Check the position of a runner has crossed a limit
;****************************************************************************
mov eax,[scroll_bar_data_horizontal.max_area]
xor ebx,ebx
mov bx,[wa_width_1]
cmp eax,ebx
ja @f
xor eax,eax
jmp .p_6
@@:
sub eax,ebx ;[scroll_bar_data_horizontal.cur_area]
cmp eax,[scroll_bar_data_horizontal.position]
jae @f
.p_6:
mov [scroll_bar_data_horizontal.position],eax
@@:
;****************************************************************************
mov eax,[scroll_bar_data_horizontal.max_area]
mov ebx,[scroll_bar_data_vertical.max_area]
sub eax,[scroll_bar_data_horizontal.position] ;100
sub ebx,[scroll_bar_data_vertical.position] ;100
xor ecx,ecx
mov cx,word [wa_width_1]
cmp eax,ecx
jbe @f
xor eax,eax
mov ax,[wa_width_1]
@@:
mov [wa_width_2],ax
mov ecx,eax
shl ecx,16
xchg eax,ebx
xor edx,edx
mov dx,word [wa_high_1]
cmp eax,edx
jbe @f
xor eax,eax
mov ax,[wa_high_1]
@@:
mov [wa_high_2],ax
mov cx,ax
call correct_cur_area
mov ebx,ecx
push eax
mov eax,[scroll_bar_data_vertical.max_area]
cmp eax,[scroll_bar_data_vertical.cur_area]
jbe .horizontal ;@f
mov ax,[wa_width_1]
sub ax,[scroll_bar_data_vertical.size_x]
mov [wa_width_1],ax
cmp ax,[wa_width_2]
jae .horizontal
mov [wa_width_2],ax
.horizontal:
mov eax,[scroll_bar_data_horizontal.max_area]
cmp eax,[scroll_bar_data_horizontal.cur_area]
jbe .finish ;@f
mov ax,[wa_high_1]
sub ax,[scroll_bar_data_horizontal.size_y]
mov [wa_high_1],ax
cmp ax,[wa_high_2]
jae .finish
mov [wa_high_2],ax
.finish: ;@@:
pop eax
mov cx,[wa_width_2]
shl ecx,16
mov cx,[wa_high_2]
call correct_cur_area
mov ebx,ecx
mov eax,[scroll_bar_data_horizontal.position]
; imul eax,100
; ÅÀÕ = ÅÀÕ * 100
shl eax,2 ; óìíîæåíèå íà 4
lea eax,[eax+eax*4] ; óìíîæåíèå íà 5
lea eax,[eax+eax*4] ; óìíîæåíèå íà 5
push ebx
mov ebx,[scaling_mode]
xor edx,edx
div ebx
; shl edx,1
; cmp edx,ebx
; jb @f
; inc eax
;@@:
pop ebx
mov ecx,eax
shl ecx,16
mov eax,[scroll_bar_data_vertical.position]
; imul eax,100
; ÅÀÕ = ÅÀÕ * 100
shl eax,2 ; óìíîæåíèå íà 4
lea eax,[eax+eax*4] ; óìíîæåíèå íà 5
lea eax,[eax+eax*4] ; óìíîæåíèå íà 5
push ebx
mov ebx,[scaling_mode]
xor edx,edx
div ebx
; shl edx,1
; cmp edx,ebx
; jb @f
; inc eax
;@@:
pop ebx
mov cx,ax
call scaling.5
;******************************
pop eax
mov ebx,wa_high_1
mov [ebx],eax
pop eax
mov ebx,wa_width_1
mov [ebx],eax
;******************************
ret
;---------------------------------------------------------------------
zoom_minus:
; cmp [scaling_mode],dword 0
mov eax,[scaling_mode]
test eax,eax
; jz no_scaling.1
; jz calculation_next_value_minus
jnz @f
call calculation_next_value_minus
jmp zoom_plus.1
@@:
; je no_scaling.1
; jne @f
; mov [scaling_mode],dword 100
; mov [zoom_factors],dword zoom_factors.100
; call draw_zoom_factors
; jmp red
;@@:
mov eax,zoom_factors
cmp [eax],dword zoom_factors.min
jbe still
sub [eax],dword 4
jmp zoom_plus.1
;---------------------------------------------------------------------

View File

@ -0,0 +1,124 @@
ACD See
5
7
10
15
20
30
50
70
100
150
200
300
500
700
1000
2000
3000
5000
Fast Stone
2
5
10
15
20
30
40
50
60
100
125
150
175
200
300
500
700
1000
2000
3000
5000
Photoshop
0,2
0,3
0,4
0,5
0,7
1
1,5
2
3
4
5
6,25
8,33
12,5
16,67
25
33,33
50
66,67
100
200
300
400
500
600
700
800
1200
1600
zSea
1
2
3
4
5
7
10
17
25
37
50
62
75
87
100
112
125
150
175
200
225
250
275
300
350
400
450
500
600
700
800
900
1000
1100
1250 1200
1300
1400
1500
1750
2000
2250
2500
2750
3000
3500
4000
4500
5000