1 Commits

Author SHA1 Message Date
b6c850c47c kernel: Clean up svn-related code and data
Some checks failed
Build system / Check kernel codestyle (pull_request) Successful in 52s
Build system / Build (pull_request) Failing after 3h12m25s
* Rearrange sf18.13 version structure to
  + mention git hash and release offset,
  + separate OS release and kernel ABI numbers,
  + include an optional debug tag.
* Update the boot log and the blue screen to print the new fields.
* Update docs.
* No breaking changes.

Resolves #99.
2025-03-17 12:43:17 +01:00
62 changed files with 1022 additions and 6897 deletions

View File

@@ -28,8 +28,6 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get describe - name: Get describe
id: vars id: vars
@@ -76,15 +74,20 @@ jobs:
g++ -o /home/autobuild/tools/win32/bin/objconv -O2 *.cpp g++ -o /home/autobuild/tools/win32/bin/objconv -O2 *.cpp
chmod +x /home/autobuild/tools/win32/bin/objconv chmod +x /home/autobuild/tools/win32/bin/objconv
- name: Build and install kerpack and kpack - name: Build and install kerpack
if: steps.cache-toolchain.outputs.cache-hit != 'true' if: steps.cache-toolchain.outputs.cache-hit != 'true'
run: | run: |
export PATH=/home/autobuild/tools/win32/bin:$PATH
cd ${{ gitea.workspace }}/programs/other/kpack/kerpack_linux/ cd ${{ gitea.workspace }}/programs/other/kpack/kerpack_linux/
make make
chmod +x kerpack chmod +x kerpack
chmod +x kpack
mv kerpack /home/autobuild/tools/win32/bin/. mv kerpack /home/autobuild/tools/win32/bin/.
- name: Build and install kpack
if: steps.cache-toolchain.outputs.cache-hit != 'true'
run: |
cd ${{ gitea.workspace }}/programs/other/kpack/linux/
bash build.sh
chmod +x kpack
mv kpack /home/autobuild/tools/win32/bin/. mv kpack /home/autobuild/tools/win32/bin/.
- name: Build and install clink - name: Build and install clink
@@ -141,7 +144,6 @@ jobs:
- name: (en_US) Build KolibriOS - name: (en_US) Build KolibriOS
run: | run: |
export PATH=/home/autobuild/tools/win32/bin:$PATH export PATH=/home/autobuild/tools/win32/bin:$PATH
source kos32-export-env-vars ${{ gitea.workspace }}
tup build-en_US tup build-en_US
- name: (en_US) Upload floppy image - name: (en_US) Upload floppy image
@@ -166,7 +168,6 @@ jobs:
- name: (ru_RU) Build KolibriOS - name: (ru_RU) Build KolibriOS
run: | run: |
export PATH=/home/autobuild/tools/win32/bin:$PATH export PATH=/home/autobuild/tools/win32/bin:$PATH
source kos32-export-env-vars ${{ gitea.workspace }}
tup build-ru_RU tup build-ru_RU
- name: (ru_RU) Upload floppy image - name: (ru_RU) Upload floppy image
@@ -191,7 +192,6 @@ jobs:
- name: (es_ES) Build KolibriOS - name: (es_ES) Build KolibriOS
run: | run: |
export PATH=/home/autobuild/tools/win32/bin:$PATH export PATH=/home/autobuild/tools/win32/bin:$PATH
source kos32-export-env-vars ${{ gitea.workspace }}
tup build-es_ES tup build-es_ES
- name: (es_ES) Upload floppy image - name: (es_ES) Upload floppy image

View File

@@ -1,82 +0,0 @@
# Contributing guide
## Type of contributing
There are two main types of contributions accepted to the main KolibriOS repository:
- Submitting issues about problems in the project
- Submitting code to the project via pull requests
Both these types are described in detail below.
## Issues
You can help us by submitting issues about problems found in the system. Currently, there are two main ways of submitting an issue in the project: **Bug Reports** and **Feature Requests**:
- Bug Reports are suitable if you find a **bug** (crash, error, unexpected behavior) in some part of the system (kernel, drivers, apps, etc.) and want to report it
- Feature Requests are used, when you want to propose some **improvement** to the system (missing features, improved user experience, etc.)
## Pull requests
You can also help us by submitting code via pull requests. The process of submitting a pull request consists of the following steps:
1. Find what you want to implement or improve
2. Make a fork of kolibrios (or other needed) repository
3. Create a branch with a name that matches your changes
4. Implement and test the changes
5. Create commits according to the [accepted style](#commit-style)
6. Create and submit a pull request into `main` branch
7. Wait for CI/CD pipelines and code review to pass
When a pull request is submitted, at least two project participants must conduct a code review, after which the proposed changes need to be corrected (if requested) and merged into the project.
## Commit style
### Message pattern
The commit message should look like this:
```test
Commit message header
Commit message body, if needed
```
- Commit message header and body should reflect changes made in commit
- Commit message body should be separated from the header by one empty line
### Length
Maximum number of characters in a commit header is **72** (standard for **Git**). Also, **72** is the maximum length of a line in a commit body.
### Multiple authors
If you are making a commit together with another developer, you need to add:
```
Co-authored-by: ANOTHER-NAME <ANOTHER-NAME@EXAMPLE.COM>
```
to the end commit message body on a new line.
### Merge commits
> [!WARNING]
> Merge commits are **prohibited** in the project
Use **rebase** to keep your branch up to date.
## Licensing
For new source code files and for existing ones without a license, you need to add the following header to the beginning of the file:
```asm
; SPDX-License-Identifier: GPL-2.0-only
; Program - Brief description.
; Copyright (C) 2011-2025 KolibriOS team
```
Be careful when setting copyright and date interval. Review the file's history to verify its origin.
## Conclusion
We hope this small instructions will help you to get familiar with KolibriOS contribution rules and inspire you to participate in the life of our project.

338
LICENSE
View File

@@ -1,338 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
<https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Moe Ghoul>, 1 April 1989
Moe Ghoul, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View File

@@ -1,22 +0,0 @@
# KolibriOS
[![License](https://img.shields.io/badge/License-GPL%202.0-green)](./LICENSE)
[![Build system](https://git.kolibrios.org/KolibriOS/kolibrios/actions/workflows/build.yaml/badge.svg)](https://git.kolibrios.org/KolibriOS/kolibrios/actions)
KolibriOS is a hobby operating system for x86-compatible computers, which is currently being developed by a small but passionate team of enthusiasts.
Its kernel, most drivers, and many programs are written entirely in [FASM](https://flatassembler.net/) assembly language, making them very compact and lean on system resources.
Based on [MenuetOS](https://www.menuetos.net/), it uses its own standards and is NOT fully POSIX or UNIX compliant.
## Contributing
We would appreciate any participation in the project and always welcome new users and contributors.
Detailed instructions for the contribution process can be found in the [contributing guide](./CONTRIBUTING.md).
Common list of tasks, issues and enhancement proposals can be found on [this page](https://git.kolibrios.org/KolibriOS/kolibrios/issues).
## Special thanks
The KolibriOS team expresses special thanks to the author of the 32-bit **MenuetOS**, [Ville Turjanmaa](https://www.menuetos.net/contact.htm). We also want to note that all **MenuetOS** copyrights have been preserved.

View File

@@ -85,7 +85,6 @@ if build_type == "ru_RU" then tup.append_table(img_files, {
{"SETTINGS/MYKEY.INI", SRC_PROGS .. "/system/MyKey/trunk/mykey.ini"}, {"SETTINGS/MYKEY.INI", SRC_PROGS .. "/system/MyKey/trunk/mykey.ini"},
{"SETTINGS/SYSPANEL.INI", "ru_RU/settings/syspanel.ini"}, {"SETTINGS/SYSPANEL.INI", "ru_RU/settings/syspanel.ini"},
}) elseif build_type == "en_US" then tup.append_table(img_files, { }) elseif build_type == "en_US" then tup.append_table(img_files, {
{"WELCOME.HTM", VAR_DATA .. "/" .. build_type .. "/welcome.htm.kpack"},
{"EXAMPLE.ASM", SRC_PROGS .. "/develop/examples/example/trunk/example.asm"}, {"EXAMPLE.ASM", SRC_PROGS .. "/develop/examples/example/trunk/example.asm"},
{"DEVELOP/BACKY", SRC_PROGS .. "/develop/backy/Backy"}, {"DEVELOP/BACKY", SRC_PROGS .. "/develop/backy/Backy"},
{"File Managers/KFAR.INI", "common/File Managers/kfar.ini"}, {"File Managers/KFAR.INI", "common/File Managers/kfar.ini"},
@@ -157,7 +156,7 @@ extra_files = {
{"kolibrios/3D/info3ds/OBJECTS.PNG", SRC_PROGS .. "/develop/info3ds/objects.png"}, {"kolibrios/3D/info3ds/OBJECTS.PNG", SRC_PROGS .. "/develop/info3ds/objects.png"},
{"kolibrios/3D/info3ds/TOOLBAR.PNG", SRC_PROGS .. "/develop/info3ds/toolbar.png"}, {"kolibrios/3D/info3ds/TOOLBAR.PNG", SRC_PROGS .. "/develop/info3ds/toolbar.png"},
{"kolibrios/3D/info3ds/FONT8X9.BMP", SRC_PROGS .. "/fs/kfar/trunk/font8x9.bmp"}, {"kolibrios/3D/info3ds/FONT8X9.BMP", SRC_PROGS .. "/fs/kfar/trunk/font8x9.bmp"},
{"kolibrios/3D/blocks/blocks.kex", "../programs/bcc32/games/blocks/bin/blocks.kex"}, {"kolibrios/3D/blocks/", "../programs/bcc32/games/blocks/bin/*"},
{"kolibrios/3D/blocks/models/", "../programs/bcc32/games/blocks/models/*"}, {"kolibrios/3D/blocks/models/", "../programs/bcc32/games/blocks/models/*"},
{"kolibrios/3D/md2view/", "common/3d/md2view/*"}, {"kolibrios/3D/md2view/", "common/3d/md2view/*"},
{"kolibrios/3D/md2view/md2_model/", "common/3d/md2view/md2_model/*"}, {"kolibrios/3D/md2view/md2_model/", "common/3d/md2view/md2_model/*"},
@@ -290,7 +289,6 @@ extra_files = {
{"kolibrios/res/templates/NES/", "common/templates/NES/*"}, {"kolibrios/res/templates/NES/", "common/templates/NES/*"},
{"kolibrios/res/wallpapers/", "common/wallpapers/*"}, {"kolibrios/res/wallpapers/", "common/wallpapers/*"},
{"kolibrios/res/system/", build_type .. "/settings/kolibri.lbl"}, {"kolibrios/res/system/", build_type .. "/settings/kolibri.lbl"},
{"kolibrios/res/system/", "common/signs.png"},
{"kolibrios/utils/vmode", "common/vmode"}, {"kolibrios/utils/vmode", "common/vmode"},
{"kolibrios/utils/texture", "common/utils/texture"}, {"kolibrios/utils/texture", "common/utils/texture"},
{"kolibrios/utils/cnc_editor/cnc_editor", VAR_PROGS .. "/other/cnc_editor/cnc_editor"}, {"kolibrios/utils/cnc_editor/cnc_editor", VAR_PROGS .. "/other/cnc_editor/cnc_editor"},
@@ -459,7 +457,7 @@ tup.append_table(img_files, {
{"DEMOS/BUDHBROT", VAR_PROGS .. "/demos/buddhabrot/trunk/buddhabrot"}, {"DEMOS/BUDHBROT", VAR_PROGS .. "/demos/buddhabrot/trunk/buddhabrot"},
{"DEMOS/EYES", VAR_PROGS .. "/demos/eyes/trunk/eyes"}, {"DEMOS/EYES", VAR_PROGS .. "/demos/eyes/trunk/eyes"},
{"DEMOS/FIREWORK", VAR_PROGS .. "/demos/firework/firework"}, {"DEMOS/FIREWORK", VAR_PROGS .. "/demos/firework/firework"},
{"DEMOS/MOVBACK", VAR_PROGS .. "/demos/movback/movback"}, {"DEMOS/MOVBACK", VAR_PROGS .. "/demos/movback/trunk/movback"},
{"DEMOS/PLASMA", VAR_PROGS .. "/demos/plasma/plasma"}, {"DEMOS/PLASMA", VAR_PROGS .. "/demos/plasma/plasma"},
{"DEMOS/SPIRAL", VAR_PROGS .. "/demos/spiral/spiral"}, {"DEMOS/SPIRAL", VAR_PROGS .. "/demos/spiral/spiral"},
{"DEMOS/TINYFRAC", VAR_PROGS .. "/demos/tinyfrac/trunk/tinyfrac"}, {"DEMOS/TINYFRAC", VAR_PROGS .. "/demos/tinyfrac/trunk/tinyfrac"},
@@ -631,10 +629,10 @@ tup.append_table(extra_files, {
{"kolibrios/utils/calcplus", VAR_PROGS .. "/other/calcplus/calcplus"}, {"kolibrios/utils/calcplus", VAR_PROGS .. "/other/calcplus/calcplus"},
{"kolibrios/utils/kfm/kfm", VAR_PROGS .. "/fs/kfm/trunk/kfm"}, {"kolibrios/utils/kfm/kfm", VAR_PROGS .. "/fs/kfm/trunk/kfm"},
{"kolibrios/utils/tedit/t_edit", VAR_PROGS .. "/other/t_edit/t_edit"}, {"kolibrios/utils/tedit/t_edit", VAR_PROGS .. "/other/t_edit/t_edit"},
{"kolibrios/3D/blocks/block.bin", VAR_PROGS .. "/bcc32/games/blocks/block.bin"}
}) })
-- For russian build, add russian-only programs. -- For russian build, add russian-only programs.
if build_type == "ru_RU" then tup.append_table(img_files, { if build_type == "ru_RU" then tup.append_table(img_files, {
{"PERIOD", VAR_PROGS .. "/other/period/trunk/period"},
{"GAMES/KLAVISHA", VAR_PROGS .. "/games/klavisha/klavisha"}, {"GAMES/KLAVISHA", VAR_PROGS .. "/games/klavisha/klavisha"},
{"DEVELOP/EXAMPLES/TESTCON2", VAR_PROGS .. "/develop/libraries/console_coff/examples/testcon2_rus"}, {"DEVELOP/EXAMPLES/TESTCON2", VAR_PROGS .. "/develop/libraries/console_coff/examples/testcon2_rus"},
}) else tup.append_table(img_files, { }) else tup.append_table(img_files, {
@@ -642,7 +640,6 @@ if build_type == "ru_RU" then tup.append_table(img_files, {
}) end }) end
if build_type == "ru_RU" then tup.append_table(extra_files, { if build_type == "ru_RU" then tup.append_table(extra_files, {
{"kolibrios/utils/period", VAR_PROGS .. "/other/period/trunk/period"},
{"kolibrios/games/Dungeons/Dungeons", VAR_PROGS .. "/games/Dungeons/Dungeons"}, {"kolibrios/games/Dungeons/Dungeons", VAR_PROGS .. "/games/Dungeons/Dungeons"},
}) end }) end
@@ -668,7 +665,6 @@ tup.append_table(img_files, {
{"EASYSHOT", VAR_PROGS .. "/cmm/misc/easyshot.com"}, {"EASYSHOT", VAR_PROGS .. "/cmm/misc/easyshot.com"},
{"MOUSECFG", VAR_PROGS .. "/cmm/mousecfg/mousecfg.com"}, {"MOUSECFG", VAR_PROGS .. "/cmm/mousecfg/mousecfg.com"},
{"BARSCFG", VAR_PROGS .. "/cmm/barscfg/barscfg.com"}, {"BARSCFG", VAR_PROGS .. "/cmm/barscfg/barscfg.com"},
{"SEARCH", VAR_PROGS .. "/cmm/misc/search.com"},
{"SYSPANEL", VAR_PROGS .. "/cmm/misc/software_widget.com"}, {"SYSPANEL", VAR_PROGS .. "/cmm/misc/software_widget.com"},
{"SYSMON", VAR_PROGS .. "/cmm/sysmon/sysmon.com"}, {"SYSMON", VAR_PROGS .. "/cmm/sysmon/sysmon.com"},
{"TMPDISK", VAR_PROGS .. "/cmm/tmpdisk/tmpdisk.com"}, {"TMPDISK", VAR_PROGS .. "/cmm/tmpdisk/tmpdisk.com"},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

View File

@@ -1,2 +0,0 @@
if tup.getconfig("NO_FASM") ~= "" then return end
tup.rule("welcome.htm", "cp %f %o" .. tup.getconfig("KPACK_CMD"), "welcome.htm.kpack")

View File

@@ -12,7 +12,6 @@
23 Game Center |allgames 23 Game Center |allgames
60 System panel |syspanel 60 System panel |syspanel
18 Documentation |docpack 18 Documentation |docpack
49 Search |search
53 Run |run 53 Run |run
04 Shut down |end 04 Shut down |end
#1 **** DEMOS #1 **** DEMOS

View File

@@ -1,95 +0,0 @@
<html>
<title>Welcome notes</title>
<body bgcolor=#fff>
<h1>
<font color=1BB71A>Welcome to KolibriOS</font>
</h1>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">
Dear friends,
What you see now is the most compact operating system in the whole world. KolibriOS is a piece of programming art that is based on logic and coffee.
As no one reads manuals, I'm here to help with the most common issues that new users of KolibriOS are facing. This document is also required to read for any <b>YouTube blogger</b> who wants to make a review of the system :)
<dd><h3><kosicon n=5> Floppy version</h3>
The asterisk [*] in the Menu means the app isn't available in the Floppy version, only in the Big distro (Flash/ISO/UEFI-HDD). Not all programs are available via Menu to encourage you to explore KolibriOS files by yourself.
<h3><kosicon n=25> If you have problems with USB</h3>
Only USB 1.1 and USB 2.0 ports are supported, not USB 3+. And yep, the USB driver is written entirely in assembler. Some motherboards have options like "USB Legacy Support" or something similar, which may help the system detect your device. Also, some ports on your motherboard may work while others may not, only G-d knows why. So, play with the BIOS/UEFI settings and try different ports.
<h3><kosicon n=7> Sound</h3>
List of supported devices:
- Most AC97 cards: Intel, nForce, VIA
- A variety of HD Audio devices: Intel, Realtek...
- SIS PCI audio (Sis 7012)
- Creative labs EMU10K1X (Dell OEM)
- Media Forte FM801
- ISA Sound Blaster 16
<i>Only THIS particular model works,
not other cards that have software SB16-emulation</i>
<h3><kosicon n=61> Video</h3>
By default, you can change the resolution only on the blue boot screen. The modes listed there are provided by the video card's BIOS. It is impossible to 'simply add additional screen modes to the list'. If video card's BIOS doesn't provide some modes then you need a driver. It is not possible to write a generic video card driver. Separate driver must be written for each specific video card model.
Intel and AMD drivers for some video cards are ported from Linux and are available in the Big distro.
Check SYSPANEL. Features: ability to change resolution in KolibriOS, hardware cursor (not actual anymore), bit-blit operations acceleration.
<h3><kosicon n=25> Wi-Fi</h3>
Not supported. You have to know that the Wi-Fi specification is so complex that it is almost impossible to write the code for it from scratch. Only big OSes like Windows / Linux / BSD have it. MacOS and Haiku just ported the BSD drivers. I don't say porting them to KolibiOS is not possible, but the required effort is going to be tremendous.
<h3><kosicon n=25> LAN/Ethernet</h3>
List of supported devices:
- 3c59x 3Com Fast EtherLink (3c59x/450/555/556/575/900/905/980)
- ar81xx Atheros 8131/8132/8151/8152/8161/8162/8171/8172
Killer E2200/E2400/E2500
- dec21x4x* Accton en1207B-TX, DEC 21140, ..., VirtualPC
- forcedeth* Nvidia nForce chipset integrated Ethernet
- i8255x Intel eepro/100 (i8255x, i82562, i82801, ...), QEMU
- i8254x Intel PRO/1000 (i8254x), Virtualbox, BOCHS, QEMU
- mtd80x Myson MTD803
- pcnet32 AMD PCnet (79c970, 79c978, 79c973, ...), Virtualbox, QEMU
- r6040 RDC Semiconductors R6040
- rhine VIA Rhine II and III
- rtl8029 Realtek 8029/8019, ne2000 PCI, BOCHS, QEMU
- rtl8139 Realtek 8139 and clones, QEMU
- rtl8169 Realtek 8110/8111/8167/8168/8169
- sis900 SiS900, 7016
* - in development
Blessed be our Flemish friend Jeffrey, who has written most of the Network staff by him: stack, drivers, and a lot of apps (except WebView).
<h3><kosicon n=12> WebView</h3>
It was never intended to be a browser, but rather a Help Center that uses HTML markup. It fits this purpose well, doesn't it? According to current WebView's codebase (that was my first app ever) it will never become a normal web browser. Please help us and write/port something good. For example, it will be nice try to finish Netsurf port.
<h3><kosicon n=9> How did you achieve so much while being so small?</h3>
- Kernel, almost all drivers and most applications are written in assembly language
- Files in IMG are packed via the LZMA algorithm from 7-Zip. They are unpacked to RAM when accessed
- Most of the images are manually optimized: posterization, dithering and other techniques were used
- Files names in IMG fit 8.3 naming convention (name.extension) which doesn't use additional FAT12 space
- Image files are combined into a single file
- Compact binary header of applications, no sections
- Resources are reused, and file duplication is avoided, for example:
~ Many apps use shared libraries
~ KFM2 and Eolite are a single app, just with different appearance
~ APP+, Games Center and System Panel are a single app also
~ Memory Blocks game uses system icons as images
See more <a href=http://wiki.kolibrios.org/wiki/Hardware_Support>http://wiki.kolibrios.org/wiki/Hardware_Support</a>
</dd>
<h3><kosicon n=13> Last words</h3>
<font bg=#F9F0A3>We want to express our gratitude to every KolibriOS contributor. Also, we would like to give special thanks to Ville M. Turjanmaa, the author of MenuetOS, the predecessor of our system.
Finally, we want to thank you, brave and curious users, as we are doing it all for you!
Have fun!</font>
Sincerely yours,
KolibriOS Team
<img src=/kolibrios/res/system/signs.png alt="You have to use Big Distro to see this image!">
<!-- Somewhere deep in the Galaxy stars light up and go out, empires are born and turn to dust. In this impenetrable darkness and decadence, there are people who are still working on KolibriOS. Many years will pass and perhaps you and I will no longer be here, and our great-grandchildren will ask "Who were those insane who made such an incredible OS?" -->

View File

@@ -13,7 +13,6 @@
16 Centro de juegos |allgames 16 Centro de juegos |allgames
60 System panel |syspanel 60 System panel |syspanel
18 Ayuda |docpack 18 Ayuda |docpack
49 Buscar |search
53 Ejecutar aplicaci<63>n |run 53 Ejecutar aplicaci<63>n |run
04 Apagar |end 04 Apagar |end
#1 **** DEMOS #1 **** DEMOS

View File

@@ -12,7 +12,6 @@
23 <20><><EFBFBD><E0AEA2><><E6A5AD> |allgames 23 <20><><EFBFBD><E0AEA2><><E6A5AD> |allgames
60 <20><><EFBFBD><EFBFBD><E2A5AC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |syspanel 60 <20><><EFBFBD><EFBFBD><E2A5AC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |syspanel
18 <20><><EFBFBD><EFBFBD><E3ACA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |docpack 18 <20><><EFBFBD><EFBFBD><E3ACA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |docpack
49 <20><><EFBFBD><EFBFBD><EFBFBD> |search
53 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC> |run 53 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC> |run
04 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E8A5AD><><E0A0A1><EFBFBD> |end 04 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E8A5AD><><E0A0A1><EFBFBD> |end
#1 **** 2D <20><><EFBFBD><EFBFBD><EFBFBD> #1 **** 2D <20><><EFBFBD><EFBFBD><EFBFBD>

View File

@@ -1,2 +0,0 @@
if tup.getconfig("NO_FASM") ~= "" then return end
tup.rule("block.asm", "fasm -m 65636 %f %o " .. tup.getconfig("KPACK_CMD"), "block.bin")

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -1,229 +0,0 @@
// block name, color, step, coord: x,y,z, rotation: x,y,z
const m1=16711680;
const m2=16776960;
const m3=655615;
const m4=65315;
const m5=16777215;
const m6=16756655;
const m7=16776367;
const m8=0;
const m9=65498;
model_list=[
['b2x3x1', m1, 0, 4,-20, 3, 0,0,90],
['b2x3x1', m1, 0, 4,-12, 3, 0,0,90],
['b2x3x1', m1, 0, 4, -4, 3, 0,0,90],
['b2x3x1', m1, 0, 4, 4, 3, 0,0,90],
['b2x3x1', m1, 0, 4, 12, 3, 0,0,90],
['t2x3x1', m1, 0, 0, 20, 3, 0,0,90],
['b1x1x1', m1, 0, 0, 28, 3, 0,0,0],
['b1x1x1', m1, 0, -8,-16, 3, 0,0,0],
['b1x1x1', m1, 0, 8,-16, 3, 0,0,0],
['b2x4x1', m1, 0,-12,-12, 3, 0,0,0],
['b2x4x1', m1, 0, 8,-12, 3, 0,0,0],
['l2x2x1', m1, 0, -8, 4, 3, 0,0,90],
['l2x2x1', m1, 0, 8, 4, 3, 0,0,0],
['b1x6x1', m1, 1, 0, 20, 6, 0,0,0],
['b1x6x1', m1, 1, -4, 16, 6, 0,0,0],
['b1x6x1', m1, 1, 4, 16, 6, 0,0,0],
['b1x10x1', m1, 1, 0,-24, 6, 0,0,0],
['b2x8x1', m1, 1, -8,-16, 6, 0,0,0],
['b2x8x1', m1, 1, 4,-16, 6, 0,0,0],
['b2x3x1', m1, 1,-16, -8, 6, 0,0,0],
['b2x3x1', m1, 1, 12, -8, 6, 0,0,0],
['l2x2x1', m1, 1, -4,-20, 6, 0,0,-180],
['l2x2x1', m1, 1,-12,-12, 6, 0,0,-180],
['l2x2x1', m1, 1,-12, 4, 6, 0,0,90],
['l2x2x1', m1, 1, 12, 4, 6, 0,0,0],
['l2x2x1', m1, 1, 12,-12, 6, 0,0,-90],
['l2x2x1', m1, 1, 4,-20, 6, 0,0,-90],
['b2x3x1', m1, 2, 4,-24, 9, 0,0,90],
['b1x3x1', m1, 2, -8,-24, 9, 0,0,0],
['b1x3x1', m1, 2, 8,-24, 9, 0,0,0],
['b1x4x1', m1, 2,-12,-20, 9, 0,0,0],
['b1x4x1', m1, 2, 12,-20, 9, 0,0,0],
['b1x6x1', m1, 2,-16,-16, 9, 0,0,0],
['b1x6x1', m1, 2, 16,-16, 9, 0,0,0],
['t2x3x1', m1, 2,-12, 8, 9, 0,0,90],
['t2x3x1', m1, 2, 12, 8, 9, 0,0,90],
['b2x4x1', m1, 2, 4, 12, 9, 0,0,90],
['b1x2x1', m1, 2, 8, 12, 9, 0,0,0],
['b1x3x1', m2, 2, 4, 20, 9, 0,0,90],
['b1x3x1', m3, 2, 4, 24, 9, 0,0,90],
['t2x3x1', m3, 2, 0, 28, 9, 0,0,90],
['b2x3x1', m1, 3, 0,-28, 12, 0,0,90],
['b2x2x1', m1, 3, 4,-28, 12, 0,0,0],
['l2x2x1', m1, 3,-12,-20, 12, 0,0,-180],
['l2x2x1', m1, 3, 12,-20, 12, 0,0,-90],
['b2x4x1', m1, 3,-16,-16, 12, 0,0,0],
['b2x4x1', m1, 3, 12,-16, 12, 0,0,0],
['b1x3x1', m1, 3,-16, 0, 12, 0,0,0],
['b1x3x1', m1, 3, 16, 0, 12, 0,0,0],
['l2x2x1', m1, 3,-12, 12, 12, 0,0,-90],
['l2x2x1', m1, 3, 12, 12, 12, 0,0,180],
['b1x2x1', m2, 3, -4, 16, 12, 0,0,90],
['b1x2x1', m2, 3, 8, 16, 12, 0,0,90],
['t2x3x1', m3, 3, 0, 20, 12, 0,0,90],
['b1x3x1', m1, 4, 4,-28, 15, 0,0,90],
['l2x2x1', m1, 4, -8,-24, 15, 0,0,180],
['l2x2x1', m1, 4, 8,-24, 15, 0,0,-90],
['b1x2x1', m1, 4,-12,-20, 15, 0,0,90],
['b1x2x1', m1, 4, 16,-20, 15, 0,0,90],
['c1x2x1', m4, 4,-16,-16, 15, 0,0,90],
['c1x2x1', m4, 4, 20,-16, 15, 0,0,90],
['b1x4x1', m1, 4,-16,-12, 15, 0,0,0],
['b1x4x1', m1, 4, 16,-12, 15, 0,0,0],
['l2x2x1', m1, 4,-12, 4, 15, 0,0,90],
['l2x2x1', m1, 4, 12, 4, 15, 0,0,0],
['b1x1x1', m1, 4,-12, 12, 15, 0,0,0],
['b1x1x1', m1, 4, 12, 12, 15, 0,0,0],
['l2x2x1', m2, 4, -4, 12, 15, 0,0,90],
['l2x2x1', m2, 4, 4, 12, 15, 0,0,0],
['b1x2x1', m2, 4, 0, 16, 15, 0,0,0],
['b1x6x1', m1, 5,-16,-20, 18, 0,0,0],
['b1x6x1', m1, 5, 16,-20, 18, 0,0,0],
['b1x3x1', m1, 5, -8, 4, 18, 0,0,90],
['b1x3x1', m1, 5, 16, 4, 18, 0,0,90],
['l2x2x1', m1, 5, -8, 12, 18, 0,0,-90],
['l2x2x1', m1, 5, 8, 12, 18, 0,0,-180],
['b1x3x1', m2, 5, 4, 16, 18, 0,0,90],
['b1x2x1', m1, 5,-12,-24, 18, 0,0,0],
['b1x2x1', m1, 5, 12,-24, 18, 0,0,0],
['b2x3x1', m1, 5, 0,-28, 18, 0,0,90],
['b2x2x1', m1, 5, 4,-28, 18, 0,0,0],
['t2x3x1', m1, 6, 0,-28, 21, 0,0,90],
['l2x2x1', m1, 6, -8,-24, 21, 0,0,0],
['l2x2x1', m1, 6,-16,-20, 21, 0,0,0],
['l2x2x1', m1, 6, 8,-24, 21, 0,0,90],
['l2x2x1', m1, 6, 16,-20, 21, 0,0,90],
['b1x3x1', m1, 6,-16,-12, 21, 0,0,0],
['b1x3x1', m1, 6, 16,-12, 21, 0,0,0],
['l2x2x1', m1, 6,-12, 0, 21, 0,0,90],
['l2x2x1', m1, 6, -8, 8, 21, 0,0,-90],
['l2x2x1', m1, 6, 12, 0, 21, 0,0,0],
['l2x2x1', m1, 6, 8, 8, 21, 0,0,-180],
['b1x3x1', m1, 6, -4, 12, 21, 0,0,-90],
['b1x1x1', m1, 7, -8, 8, 24, 0,0,0],
['b2x3x1', m1, 7, -4, 12, 24, 0,0,-90],
['b1x1x1', m1, 7, 8, 8, 24, 0,0,0],
['l2x2x1', m1, 7,-12, 4, 24, 0,0,-90],
['l2x2x1', m1, 7, 12, 4, 24, 0,0,-180],
['b1x3x1', m1, 7,-16, 0, 24, 0,0,180],
['b1x3x1', m1, 7, 16, 0, 24, 0,0,180],
['l2x2x1', m1, 7,-16,-16, 24, 0,0,0],
['l2x2x1', m1, 7, 16,-16, 24, 0,0,90],
['l2x2x1', m1, 7, -8,-20, 24, 0,0,180],
['l2x2x1', m1, 7, 8,-20, 24, 0,0,-90],
['b1x3x1', m3, 7, 4,-24, 24, 0,0,90],
['b2x2x1', m5, 8, -8,-24, 27, 0,0,0],
['b2x3x1', m5, 8, 8,-24, 27, 0,0,90],
['b1x3x1', m1, 8,-12,-24, 27, 0,0,0],
['b1x3x1', m1, 8, 12,-24, 27, 0,0,0],
['b1x4x1', m1, 8,-16,-20, 27, 0,0,0],
['b1x4x1', m1, 8, 16,-20, 27, 0,0,0],
['l2x2x1', m1, 8,-16, 0, 27, 0,0,-90],
['l2x2x1', m1, 8, 16, 0, 27, 0,0,-180],
['l2x2x1', m1, 8, 8, 4, 27, 0,0,0],
['b2x4x1', m1, 8, 4, 4, 27, 0,0,90],
['b1x1x1', m1, 8,-12, 4, 27, 0,0,0],
['r1x1x1', m5, 9,-16,-20, 30, 0,0,0],
['r1x1x1', m5, 9, 16,-20, 30, 0,0,0],
['b1x2x1', m5, 9, -8,-20, 30, 0,0,90],
['b1x2x1', m5, 9, 12,-20, 30, 0,0,90],
['t2x3x1', m5, 9, 0,-20, 30, 0,0,-90],
['r1x1x1', m6, 9,-12,-24, 30, 0,0,0],
['r1x1x1', m6, 9, 12,-24, 30, 0,0,0],
['r1x2x1', m7, 9, -4,-28, 30, 0,0,0],
['r1x2x1', m7, 9, 4,-28, 30, 0,0,0],
['b1x4x1', m1, 9,-16,-16, 30, 0,0,0],
['b1x4x1', m1, 9, 16,-16, 30, 0,0,0],
['l2x2x1', m1, 9,-12, 0, 30, 0,0,90],
['l2x2x1', m1, 9, 12, 0, 30, 0,0,0],
['l2x2x1', m1, 9, 8, 8, 30, 0,0,-180],
['b2x3x1', m1, 9, 0, 4, 30, 0,0,90],
['l2x2x1', m5, 10, -4,-20, 33, 0,0,-180],
['l2x2x1', m5, 10,-12,-16, 33, 0,0,-180],
['l2x2x1', m5, 10, 4,-20, 33, 0,0,-90],
['l2x2x1', m5, 10, 12,-16, 33, 0,0,-90],
['a1x2x2', m7, 10, 0,-24, 30, 0,0,-180],
['r1x2x1', m7, 10, 0,-24, 33, 0,0,0],
['b1x2x1', m1, 10,-16,-12, 33, 0,0,0],
['l2x2x1', m1, 10,-16, 0, 33, 0,0,-90],
['b1x1x1', m1, 10,-12, 4, 33, 0,0,0],
['b2x4x1', m1, 10, 4, 4, 33, 0,0,90],
['l2x2x1', m1, 10, 8, 4, 33, 0,0,0],
['b2x4x1', m1, 10, 12,-12, 33, 0,0,0],
['b1x1x1', m1, 11, 0,-24, 36, 0,0,0],
['b1x1x1', m5, 11, -4,-24, 36, 0,0,0],
['b1x1x1', m5, 11, 4,-24, 36, 0,0,0],
['b1x1x3', m8, 11, -8,-24, 30, 0,0,0],
['b1x1x3', m8, 11, 8,-24, 30, 0,0,0],
['l2x2x1', m5, 11,-12,-20, 36, 0,0,0],
['l2x2x1', m5, 11, 12,-20, 36, 0,0,90],
['r1x1x1', m5, 11,-16,-16, 36, 0,0,90],
['r1x1x1', m5, 11, 16,-16, 36, 0,0,90],
['b1x4x1', m1, 11,-16,-12, 36, 0,0,0],
['b2x4x1', m1, 11, 12,-12, 36, 0,0,0],
['b2x3x1', m1, 11, 4, 0, 36, 0,0,0],
['l2x2x1', m1, 11, -8, 0, 36, 0,0,90],
['b1x3x1', m1, 11, 0, 8, 36, 0,0,90],
['b1x3x1', m1, 12, 4,-24, 39, 0,0,90],
['r1x1x1', m5, 12, -8,-24, 39, 0,0,0],
['r1x1x1', m5, 12, 8,-24, 39, 0,0,0],
['b1x1x1', m5, 12,-12,-20, 39, 0,0,0],
['b1x6x1', m5, 12, 12,-20, 39, 0,0,90],
['b1x1x1', m1, 12,-12,-16, 39, 0,0,0],
['l2x2x1', m1, 12,-16,-12, 39, 0,0,0],
['l2x2x1', m1, 12,-12, -4, 39, 0,0,90],
['b1x1x1', m1, 12, -8, 0, 39, 0,0,0],
['l2x2x1', m1, 12, -4, 4, 39, 0,0,90],
['l2x2x1', m1, 12, 4, 8, 39, 0,0,-180],
['b1x1x1', m1, 12, 8, 4, 39, 0,0,0],
['l2x2x1', m1, 12, 12, 0, 39, 0,0,-180],
['b1x2x1', m1, 12, 16, -8, 39, 0,0,0],
['l2x2x1', m1, 12, 12,-12, 39, 0,0,-90],
['l2x2x1', m1, 13, 4,-20, 42, 0,0,-90],
['l2x2x1', m1, 13, -4,-24, 42, 0,0,0],
['b2x6x1', m1, 13,-12,-20, 42, 0,0,0],
['b1x3x1', m1, 13, 0, 4, 42, 0,0,90],
['b2x2x1', m1, 13, 4, 0, 42, 0,0,0],
['b1x6x1', m1, 13, 12,-20, 42, 0,0,0],
['b1x4x1', m1, 14,-12,-16, 45, 0,0,0],
['b2x4x1', m1, 14, 4,-20, 45, 0,0,90],
['b2x6x1', m1, 14, 12,-12, 45, 0,0,90],
['b2x4x1', m1, 14, 4, -4, 45, 0,0,90],
['b1x3x1', m1, 14, 4, 4, 45, 0,0,90],
['l2x2x1', m1, 14, 8, -4, 45, 0,0,0],
['l2x2x1', m1, 14, 8,-16, 45, 0,0,-90],
['b2x4x1', m1, 15, -4,-16, 48, 0,0,0],
['b1x3x1', m1, 15, -8,-12, 48, 0,0,0],
['b1x3x1', m1, 15, 4, 0, 48, 0,0,90],
['b2x2x1', m1, 15, 4, -8, 48, 0,0,0],
['l2x2x1', m1, 15, 4,-12, 48, 0,0,-90],
['b1x3x1', m2, 16, 8,-12, 0, 0,0,0],
['b1x3x1', m2, 16, -8,-12, 0, 0,0,0],
['c1x2x1', m9, 17, 20,-16, 12, 0,0,0],
['b1x6x1', m4, 17, 0, 8, 0, 0,0,0, 1],
['b1x6x1', m9, 17, 0, 4, -3, 0,0,0, 1],
['b1x3x1', m4, 18, 0, 4, 3, 0,0,0, 1],
['b1x3x1', m2, 18, 0, 16, 3, 0,0,0, 1],
['c1x2x1', m4, 18, 0, 0, 6, 0,0,0, 1],
['b1x1x1', m4, 18, 0, 8, 6, 0,0,0, 1],
['b1x2x1', m2, 18, 0, 12, 6, 0,0,0, 1],
['b1x3x1', m2, 18, 0, 4, 9, 0,0,0, 1],
['c1x2x1', m9, 17, -20,-16, 12, 0,0,0],
['b1x6x1', m4, 17, 0, 8, 0, 0,0,0, 1],
['b1x6x1', m9, 17, 0, 4, -3, 0,0,0, 1],
['b1x3x1', m4, 18, 0, 4, 3, 0,0,0, 1],
['b1x3x1', m2, 18, 0, 16, 3, 0,0,0, 1],
['c1x2x1', m4, 18, 0, 0, 6, 0,0,0, 1],
['b1x1x1', m4, 18, 0, 8, 6, 0,0,0, 1],
['b1x2x1', m2, 18, 0, 12, 6, 0,0,0, 1],
['b1x3x1', m2, 18, 0, 4, 9, 0,0,0, 1],
];
model_animat=[
[192,'rotation','z','Left', -1.570796327, 0, 0.017453293],
[201,'rotation','z','Right', 0, 1.570796327, 0.017453293],
];

View File

@@ -1,531 +0,0 @@
// block name, color, step, coord: x,y,z, rotation: x,y,z
const m1=32768;
const m2=9474192;
const m3=16777215;
const m4=2164260863;
const m5=655615;
const m6=255;
const m7=16776960;
const m8=10824234;
const m9=16384;
const m10=0xc97e3b;
model_list=[
['b2x4x1', m2, 0,-28, -4, 6, 0,0,90],
['b2x3x1', m2, 0,-40, 4, 6, 0,0,0],
['b2x3x1', m2, 0,-32, 8, 6, 0,0,0],
['b2x6x1', m2, 0, -4, 8, 6, 0,0,90],
['b1x3x1', m2, 0, -4, 4, 6, 0,0,90],
['b2x4x1', m2, 0, -4, -4, 6, 0,0,90],
['b1x2x1', m2, 0, -8, -8, 6, 0,0,90],
['b2x3x1', m2, 0,-24, -8, 6, 0,0,0],
['b2x4x1', m2, 1,-12, -8, 9, 0,0,0],
['b2x2x1', m2, 1,-20, -4, 9, 0,0,0],
['b1x2x1', m2, 1,-20, -8, 9, 0,0,90],
['b2x3x1', m2, 1,-24, -4, 9, 0,0,90],
['b2x3x1', m2, 1,-40, -4, 9, 0,0,0],
['b1x2x1', m2, 1,-40, 8, 9, 0,0,0],
['b2x4x1', m2, 1,-24, 8, 9, 0,0,90],
['b1x2x1', m2, 1,-28, 16, 9, 0,0,90],
['l2x2x1', m2, 2, 0,-12, 6, 0,0,-90],
['l2x2x1', m2, 2, 8,-12, 6, 0,0,-90],
['b2x4x1', m2, 2, 12, -8, 6, 0,0,90],
['b2x4x1', m2, 2, 12, 0, 6, 0,0,90],
['b2x4x1', m2, 2, 12, 8, 6, 0,0,90],
['b2x4x1', m2, 2, 12, 16, 6, 0,0,90],
['b2x4x1', m2, 2, 28, 16, 6, 0,0,90],
['b2x4x1', m2, 2, 28, 8, 6, 0,0,90],
['b2x4x1', m2, 2, 28, 0, 6, 0,0,90],
['b1x4x1', m2, 2, 28, -4, 6, 0,0,90],
['b1x2x1', m2, 2, 24, -8, 6, 0,0,90],
['b2x2x1', m3, 3, 20, 16, 9, 0,0,0],
['b2x2x1', m2, 3, 12, 16, 9, 0,0,0],
['b1x3x1', m2, 3, 20, 12, 9, 0,0,90],
['b1x2x1', m2, 3, 20, 4, 9, 0,0,0],
['b1x3x1', m2, 3, 20, -8, 9, 0,0,0],
['l2x2x1', m2, 3, 24, -4, 9, 0,0,-90],
['b2x4x1', m2, 3, 12, -4, 9, 0,0,0],
['b2x6x1', m2, 3, 4, -4, 9, 0,0,0],
['b1x2x1', m2, 3, 8, 20, 9, 0,0,90],
['b1x2x1', m2, 3, 0, 16, 9, 0,0,0],
['b2x6x1', m2, 3, 0, 8, 9, 0,0,90],
['b2x3x1', m2, 3, -4, -4, 9, 0,0,0],
['b2x4x1', m2, 3, 12,-12, 9, 0,0,90],
['b1x1x1', m2, 3, 8,-16, 9, 0,0,0],
['b1x1x1', m2, 3, 0,-16, 9, 0,0,0],
['b1x4x1', m2, 4,-28, -4, 3, 0,0,90],
['b1x4x1', m2, 4,-40, 0, 3, 0,0,0],
['b1x4x1', m2, 4,-24, 12, 3, 0,0,90],
['b1x2x1', m2, 4,-28, 16, 3, 0,0,90],
['b1x4x1', m2, 4, -8, 12, 3, 0,0,90],
['l2x2x1', m2, 4, 0, 12, 3, 0,0,90],
['b1x4x1', m2, 4, 12, 20, 3, 0,0,90],
['b1x3x1', m2, 4, 24, 20, 3, 0,0,90],
['b1x3x1', m2, 4, 28, 12, 3, 0,0,0],
['b1x3x1', m2, 4, 28, 0, 3, 0,0,0],
['b1x4x1', m2, 4, 28, -4, 3, 0,0,90],
['b1x2x1', m2, 4, 24, -8, 3, 0,0,90],
['b1x3x1', m2, 4, 12,-12, 3, 0,0,0],
['l2x2x1', m2, 4, 8,-12, 3, 0,0,-180],
['b1x4x1', m2, 4, 0,-16, 3, 0,0,0],
['b1x2x1', m2, 4, -4, -4, 3, 0,0,90],
['b1x2x1', m2, 4, -8, -8, 3, 0,0,90],
['b1x4x1', m2, 4,-12, -4, 3, 0,0,90],
['b1x2x1', m2, 4,-20, -8, 3, 0,0,90],
['b20x20x1', m1, 5,-40,-40, 0, 0,0,0],
['b1x4x1', m3, 6,-28, -4, 12, 0,0,90],
['b2x4x1', m2, 6,-40, 0, 12, 0,0,0],
['b2x4x1', m2, 6,-32, 4, 12, 0,0,0],
['b2x6x1', m2, 6,-24, -8, 12, 0,0,0],
['b2x4x1', m2, 6, -4, 8, 12, 0,0,90],
['b2x4x1', m2, 6, -4, -4, 12, 0,0,90],
['b1x2x1', m2, 6, -8, -8, 12, 0,0,90],
['b1x3x1', m2, 6, 0, -8, 12, 0,0,0],
['b1x2x1', m2, 6, 0,-16, 12, 0,0,0],
['b1x2x1', m2, 6, 4,-12, 12, 0,0,0],
['b1x4x1', m2, 6, 8,-16, 12, 0,0,0],
['b1x4x1', m2, 6, 12,-12, 12, 0,0,0],
['b1x2x1', m2, 6, 20, -4, 12, 0,0,90],
['b1x2x1', m2, 6, 24, -8, 12, 0,0,90],
['b2x4x1', m2, 6, 16, 0, 12, 0,0,0],
['b1x2x1', m2, 6, 16, 16, 12, 0,0,0],
['b2x2x1', m3, 6, 20, 16, 12, 0,0,0],
['b2x4x1', m2, 6, 8, 8, 12, 0,0,0],
['b2x4x1', m2, 6, 0, 8, 12, 0,0,0],
['b2x6x1', m3, 7, 24, 16, 15, 0,0,90],
['b1x2x1', m3, 7, 0, 16, 15, 0,0,0],
['b1x4x1', m2, 7, 20, 0, 15, 0,0,0],
['b1x4x1', m2, 7, 16, 12, 15, 0,0,90],
['b2x4x1', m2, 7, 16, 4, 15, 0,0,90],
['b2x4x1', m2, 7, 16, -4, 15, 0,0,90],
['b2x4x1', m2, 7, -4, 0, 15, 0,0,0],
['b1x4x1', m2, 7, -8, 12, 15, 0,0,90],
['b1x4x1', m3, 7,-24, 12, 15, 0,0,90],
['b1x3x1', m3, 7,-40, 4, 15, 0,0,0],
['l2x2x1', m3, 7,-40, -4, 15, 0,0,0],
['b1x4x1', m3, 7,-20, -4, 15, 0,0,90],
['l2x2x1', m2, 7,-12, -4, 15, 0,0,180],
['l2x2x1', m2, 7, -8, -4, 15, 0,0,-90],
['b1x4x1', m2, 7, 0,-16, 15, 0,0,0],
['b1x2x1', m2, 7, 4,-12, 15, 0,0,0],
['b1x2x1', m2, 7, 8,-16, 15, 0,0,0],
['b1x2x1', m2, 7, 12,-12, 15, 0,0,0],
['b1x1x1', m3, 8, 24, 16, 18, 0,0,0],
['c1x1x1', m4, 8, 24, 20, 18, 0,0,0],
['b2x2x1', m3, 8, 16, 16, 18, 0,0,0],
['c1x1x1', m4, 8, 12, 20, 18, 0,0,0],
['c1x1x1', m4, 8, 12, 16, 18, 0,0,0],
['b1x2x1', m3, 8, 8, 16, 18, 0,0,0],
['c1x1x1', m4, 8, 4, 20, 18, 0,0,0],
['c1x1x1', m4, 8, 4, 16, 18, 0,0,0],
['b1x2x1', m3, 8, 0, 16, 18, 0,0,0],
['b1x2x1', m3, 8, -4, 12, 18, 0,0,90],
['b1x4x1', m3, 8,-12, 12, 18, 0,0,90],
['b1x4x1', m3, 8,-28, 12, 18, 0,0,90],
['b1x4x1', m3, 8,-40, -4, 18, 0,0,0],
['b1x4x1', m3, 8,-24, -4, 18, 0,0,90],
['b1x2x1', m3, 8,-16, -4, 18, 0,0,90],
['b2x2x1', m3, 8,-12, -8, 18, 0,0,0],
['b1x4x1', m3, 8, -4, -4, 18, 0,0,0],
['b2x4x1', m3, 8, 12,-12, 18, 0,0,90],
['b1x1x1', m3, 8, 0,-16, 18, 0,0,0],
['b1x1x1', m3, 8, 8,-16, 18, 0,0,0],
['b2x2x1', m3, 9, 20, 16, 21, 0,0,0],
['b1x2x1', m5, 9, 16, 16, 21, 0,0,0],
['b2x2x1', m3, 9, 8, 16, 21, 0,0,0],
['b2x2x1', m5, 9, 0, 16, 21, 0,0,0],
['b1x1x1', m3, 9, -4, 12, 21, 0,0,0],
['c1x1x1', m4, 9, -8, 12, 21, 0,0,0],
['b1x1x1', m3, 9,-12, 12, 21, 0,0,0],
['c1x1x1', m4, 9,-16, 12, 21, 0,0,0],
['b1x1x1', m3, 9,-20, 12, 21, 0,0,0],
['c1x1x1', m4, 9,-24, 12, 21, 0,0,0],
['b1x2x1', m3, 9,-28, 12, 21, 0,0,90],
['c1x1x1', m4, 9,-36, 12, 21, 0,0,0],
['b1x1x1', m3, 9,-40, 12, 21, 0,0,0],
['b2x3x1', m3, 9,-44, 0, 21, 0,0,0],
['b1x1x1', m3, 9,-40, -4, 21, 0,0,0],
['c1x1x1', m4, 9,-36, -4, 21, 0,0,0],
['b1x1x1', m3, 9,-32, -4, 21, 0,0,0],
['c1x1x1', m4, 9,-28, -4, 21, 0,0,0],
['b1x2x1', m3, 9,-20, -4, 21, 0,0,90],
['c1x1x1', m4, 9,-16, -4, 21, 0,0,0],
['b1x2x1', m3, 9,-12, -8, 21, 0,0,0],
['c1x1x1', m4, 9, -8, -8, 21, 0,0,0],
['b1x2x1', m3, 9, -4, -4, 21, 0,0,90],
['c1x1x1', m4, 9, -4, 0, 21, 0,0,0],
['b1x1x1', m3, 9, -4, 4, 21, 0,0,0],
['c1x1x1', m4, 9, -4, 8, 21, 0,0,0],
['b2x4x1', m3, 9, 12,-12, 21, 0,0,90],
['c1x1x1', m4, 9, 0,-16, 21, 0,0,0],
['c1x1x1', m4, 9, 8,-16, 21, 0,0,0],
['c1x1x1', m4, 10, 24, 20, 24, 0,0,0],
['l2x2x1', m3, 10, 20, 16, 24, 0,0,0],
['c1x1x1', m4, 10, 12, 20, 24, 0,0,0],
['c1x1x1', m4, 10, 8, 20, 24, 0,0,0],
['c1x1x1', m4, 10, 8, 16, 24, 0,0,0],
['c1x1x1', m4, 10, 12, 16, 24, 0,0,0],
['b1x4x1', m3, 10, -4, 0, 24, 0,0,0],
['b1x4x1', m3, 10, -8, 12, 24, 0,0,90],
['b1x4x1', m3, 10,-24, 12, 24, 0,0,90],
['b1x4x1', m3, 10,-40, 0, 24, 0,0,0],
['c1x1x1', m4, 10,-44, 8, 24, 0,0,0],
['c1x1x1', m4, 10,-44, 4, 24, 0,0,0],
['c1x1x1', m4, 10,-44, 0, 24, 0,0,0],
['b1x2x1', m3, 10,-36, -4, 24, 0,0,90],
['b1x4x1', m3, 10,-20, -4, 24, 0,0,90],
['b1x4x1', m3, 10, -4, -4, 24, 0,0,90],
['b1x2x1', m3, 10, -8, -8, 24, 0,0,90],
['l2x2x1', m3, 10, 4, -8, 24, 0,0,180],
['b1x2x1', m5, 10, 0,-16, 24, 0,0,0],
['l2x2x1', m3, 10, 12, -8, 24, 0,0,180],
['b1x2x1', m5, 10, 8,-16, 24, 0,0,0],
['b2x2x1', m3, 11, 24, 16, 27, 0,0,90],
['b2x2x1', m5, 11, 8, 16, 27, 0,0,0],
['b1x1x1', m3, 11, -4, 12, 27, 0,0,0],
['c1x1x1', m4, 11, -8, 12, 27, 0,0,0],
['b1x1x1', m3, 11,-12, 12, 27, 0,0,0],
['c1x1x1', m4, 11,-16, 12, 27, 0,0,0],
['b1x1x1', m3, 11,-20, 12, 27, 0,0,0],
['c1x1x1', m4, 11,-24, 12, 27, 0,0,0],
['b1x2x1', m3, 11,-28, 12, 27, 0,0,90],
['c1x1x1', m4, 11,-36, 12, 27, 0,0,0],
['b1x1x1', m3, 11,-40, 12, 27, 0,0,0],
['b2x3x1', m3, 11,-44, 0, 27, 0,0,0],
['b1x1x1', m3, 11,-40, -4, 27, 0,0,0],
['c1x1x1', m4, 11,-36, -4, 27, 0,0,0],
['b1x1x1', m3, 11,-32, -4, 27, 0,0,0],
['c1x1x1', m4, 11,-28, -4, 27, 0,0,0],
['b1x2x1', m3, 11,-20, -4, 27, 0,0,90],
['c1x1x1', m4, 11,-16, -4, 27, 0,0,0],
['b1x2x1', m3, 11,-12, -8, 27, 0,0,0],
['c1x1x1', m4, 11, -8, -8, 27, 0,0,0],
['b1x2x1', m3, 11, -4, -4, 27, 0,0,90],
['c1x1x1', m4, 11, -4, 0, 27, 0,0,0],
['b1x1x1', m3, 11, -4, 4, 27, 0,0,0],
['c1x1x1', m4, 11, -4, 8, 27, 0,0,0],
['b1x2x1', m5, 11, 0,-12, 27, 0,0,0],
['c1x1x1', m5, 11, 0,-16, 27, 0,0,0],
['f1x2x1', m5, 11, 4,-12, 27, 0,0,0],
['f1x2x1', m5, 11, 8,-12, 27, 0,0,0],
['c1x1x1', m5, 11, 8,-16, 27, 0,0,0],
['b1x2x1', m5, 11, 12,-12, 27, 0,0,0],
['b2x2x1', m3, 12, 20, 16, 30, 0,0,0],
['b1x4x1', m3, 12, -4, 0, 30, 0,0,0],
['b1x4x1', m3, 12, -8, 12, 30, 0,0,90],
['b1x4x1', m3, 12,-24, 12, 30, 0,0,90],
['b1x4x1', m3, 12,-40, 0, 30, 0,0,0],
['c1x1x1', m4, 12,-44, 8, 30, 0,0,0],
['c1x1x1', m4, 12,-44, 4, 30, 0,0,0],
['c1x1x1', m4, 12,-44, 0, 30, 0,0,0],
['b1x2x1', m3, 12,-36, -4, 30, 0,0,90],
['b1x4x1', m3, 12,-20, -4, 30, 0,0,90],
['b1x4x1', m3, 12, -4, -4, 30, 0,0,90],
['b1x2x1', m3, 12, -8, -8, 30, 0,0,90],
['b1x2x1', m5, 12, 8,-10, 30, 0,0,90],
['b2x2x1', m3, 13, -4, 12, 33, 0,0,0],
['c1x1x1', m4, 13, -8, 12, 33, 0,0,0],
['b1x1x1', m3, 13,-12, 12, 33, 0,0,0],
['c1x1x1', m4, 13,-16, 12, 33, 0,0,0],
['b1x1x1', m3, 13,-20, 12, 33, 0,0,0],
['c1x1x1', m4, 13,-24, 12, 33, 0,0,0],
['b1x2x1', m3, 13,-28, 12, 33, 0,0,90],
['c1x1x1', m4, 13,-36, 12, 33, 0,0,0],
['b1x1x1', m3, 13,-40, 12, 33, 0,0,0],
['b2x3x1', m3, 13,-44, 0, 33, 0,0,0],
['b1x1x1', m3, 13,-40, -4, 33, 0,0,0],
['c1x1x1', m4, 13,-36, -4, 33, 0,0,0],
['b1x1x1', m3, 13,-32, -4, 33, 0,0,0],
['c1x1x1', m4, 13,-28, -4, 33, 0,0,0],
['b1x2x1', m3, 13,-20, -4, 33, 0,0,90],
['c1x1x1', m4, 13,-16, -4, 33, 0,0,0],
['b1x2x1', m3, 13,-12, -8, 33, 0,0,0],
['c1x1x1', m4, 13, -8, -8, 33, 0,0,0],
['b1x1x1', m3, 13, -8, -4, 33, 0,0,90],
['c1x1x1', m4, 13, -4, 0, 33, 0,0,0],
['b1x1x1', m3, 13, -4, 4, 33, 0,0,0],
['c1x1x1', m4, 13, -4, 8, 33, 0,0,0],
['b2x2x1', m3, 13, -4, -8, 33, 0,0,0],
['b2x4x1', m3, 13, 28, 16, 33, 0,0,90],
['b1x2x1', m3, 14, 24, 12, 33, 0,0,90],
['b1x2x1', m3, 14, 24, 24, 33, 0,0,90],
['b2x4x1', m6, 14, 20, 12, 36, 0,0,0],
['b1x2x1', m6, 14, 28, 16, 36, 0,0,0],
['b1x2x1', m6, 14, 16, 16, 36, 0,0,0],
['c1x1x1', m4, 14, 0, 16, 36, 0,0,0],
['b1x1x1', m3, 14, -4, 16, 36, 0,0,0],
['b1x1x1', m3, 14, 0, 12, 36, 0,0,0],
['b1x4x1', m3, 14, -8, 12, 36, 0,0,90],
['b1x4x1', m3, 14,-24, 12, 36, 0,0,90],
['b1x4x1', m3, 14,-40, 0, 36, 0,0,0],
['b1x2x1', m3, 14,-36, -4, 36, 0,0,90],
['b1x4x1', m3, 14,-20, -4, 36, 0,0,90],
['b1x4x1', m3, 14, -4, -4, 36, 0,0,90],
['b1x4x1', m3, 14, -4, 0, 36, 0,0,0],
['b1x1x1', m3, 14, 0, -4, 36, 0,0,0],
['c1x1x1', m4, 14, 0, -8, 36, 0,0,0],
['b1x1x1', m3, 14, -4, -8, 36, 0,0,0],
['b1x2x1', m6, 14, -8, -8, 36, 0,0,90],
['b2x2x1', m3, 15, -4, 12, 39, 0,0,0],
['c1x1x1', m4, 15, -8, 12, 39, 0,0,0],
['b1x1x1', m3, 15,-12, 12, 39, 0,0,0],
['c1x1x1', m4, 15,-16, 12, 39, 0,0,0],
['b1x1x1', m3, 15,-20, 12, 39, 0,0,0],
['c1x1x1', m4, 15,-24, 12, 39, 0,0,0],
['b1x2x1', m3, 15,-28, 12, 39, 0,0,90],
['c1x1x1', m4, 15,-36, 12, 39, 0,0,0],
['b1x1x1', m3, 15,-40, 12, 39, 0,0,0],
['b1x1x1', m3, 15,-40, 4, 39, 0,0,0],
['b1x1x1', m3, 15,-40, -4, 39, 0,0,0],
['c1x1x1', m4, 15,-36, -4, 39, 0,0,0],
['b1x1x1', m3, 15,-32, -4, 39, 0,0,0],
['c1x1x1', m4, 15,-28, -4, 39, 0,0,0],
['b1x2x1', m3, 15,-20, -4, 39, 0,0,90],
['c1x1x1', m4, 15,-16, -4, 39, 0,0,0],
['b1x1x1', m3, 15,-12, -4, 39, 0,0,0],
['c1x1x1', m4, 15,-40, 8, 39, 0,0,0],
['c1x1x1', m4, 15, -4, 0, 39, 0,0,0],
['b1x1x1', m3, 15, -4, 4, 39, 0,0,0],
['c1x1x1', m4, 15, -4, 8, 39, 0,0,0],
['b2x2x1', m3, 15, -4, -8, 39, 0,0,0],
['c1x1x1', m4, 15,-40, 0, 39, 0,0,0],
['c1x1x1', m4, 15, -8, -4, 39, 0,0,0],
['c1x1x1', m4, 16, 0, 16, 42, 0,0,0],
['b1x1x1', m3, 16, -4, 16, 42, 0,0,0],
['b1x1x1', m3, 16, 0, 12, 42, 0,0,0],
['b1x4x1', m3, 16, -8, 12, 42, 0,0,90],
['b1x4x1', m3, 16,-24, 12, 42, 0,0,90],
['b1x4x1', m3, 16,-40, 0, 42, 0,0,0],
['b1x2x1', m3, 16,-36, -4, 42, 0,0,90],
['b1x4x1', m3, 16,-20, -4, 42, 0,0,90],
['b1x4x1', m3, 16, -4, -4, 42, 0,0,90],
['b1x4x1', m3, 16, -4, 0, 42, 0,0,0],
['b1x1x1', m3, 16, 0, -4, 42, 0,0,0],
['c1x1x1', m4, 16, 0, -8, 42, 0,0,0],
['b1x1x1', m3, 16, -4, -8, 42, 0,0,0],
['b2x2x1', m3, 17, -4, 12, 45, 0,0,0],
['b2x3x1', m6, 17, -8, 12, 45, 0,0,90],
['b2x2x1', m6, 17,-24, 12, 45, 0,0,0],
['b1x2x1', m6, 17,-28, 12, 45, 0,0,90],
['b2x2x1', m6, 17,-40, 12, 45, 0,0,0],
['b1x1x1', m3, 17,-40, 8, 45, 0,0,0],
['c1x1x1', m4, 17,-40, 4, 45, 0,0,0],
['b1x1x1', m3, 17,-40, 0, 45, 0,0,0],
['b2x4x1', m6, 17,-28, -8, 45, 0,0,90],
['b1x2x1', m6, 17,-20, -4, 45, 0,0,90],
['b2x3x1', m6, 17, -8, -8, 45, 0,0,90],
['b2x2x1', m3, 17, -4, -8, 45, 0,0,0],
['b1x1x1', m3, 17, -4, 0, 45, 0,0,0],
['c1x1x1', m4, 17, -4, 4, 45, 0,0,0],
['b1x1x1', m3, 17, -4, 8, 45, 0,0,0],
['c1x1x1', m3, 18,-24, -8, 15, 0,0,0],
['c1x1x1', m3, 18,-20, -8, 15, 0,0,0],
['c1x1x1', m3, 18,-32, 16, 15, 0,0,0],
['c1x1x1', m3, 18,-28, 16, 15, 0,0,0],
['c1x1x1', m3, 18,-24, -8, 18, 0,0,0],
['c1x1x1', m3, 18,-20, -8, 18, 0,0,0],
['c1x1x1', m3, 18,-32, 16, 18, 0,0,0],
['c1x1x1', m3, 18,-28, 16, 18, 0,0,0],
['c1x1x1', m3, 18,-24, -8, 21, 0,0,0],
['c1x1x1', m3, 18,-20, -8, 21, 0,0,0],
['c1x1x1', m3, 18,-32, 16, 21, 0,0,0],
['c1x1x1', m3, 18,-28, 16, 21, 0,0,0],
['c1x1x1', m4, 19,-24, -8, 24, 0,0,0],
['c1x1x1', m4, 19,-20, -8, 24, 0,0,0],
['c1x1x1', m4, 19,-32, 16, 24, 0,0,0],
['c1x1x1', m4, 19,-28, 16, 24, 0,0,0],
['c1x1x1', m3, 19,-24, -8, 27, 0,0,0],
['c1x1x1', m3, 19,-20, -8, 27, 0,0,0],
['c1x1x1', m3, 19,-32, 16, 27, 0,0,0],
['c1x1x1', m3, 19,-28, 16, 27, 0,0,0],
['c1x1x1', m3, 19,-24, -8, 30, 0,0,0],
['c1x1x1', m3, 19,-20, -8, 30, 0,0,0],
['c1x1x1', m3, 19,-32, 16, 30, 0,0,0],
['c1x1x1', m3, 19,-28, 16, 30, 0,0,0],
['c1x1x1', m4, 20,-24, -8, 33, 0,0,0],
['c1x1x1', m4, 20,-20, -8, 33, 0,0,0],
['c1x1x1', m4, 20,-32, 16, 33, 0,0,0],
['c1x1x1', m4, 20,-28, 16, 33, 0,0,0],
['c1x1x1', m3, 20,-24, -8, 36, 0,0,0],
['c1x1x1', m3, 20,-20, -8, 36, 0,0,0],
['c1x1x1', m3, 20,-32, 16, 36, 0,0,0],
['c1x1x1', m3, 20,-28, 16, 36, 0,0,0],
['c1x1x1', m3, 20,-24, -8, 39, 0,0,0],
['c1x1x1', m3, 20,-20, -8, 39, 0,0,0],
['c1x1x1', m3, 20,-32, 16, 39, 0,0,0],
['c1x1x1', m3, 20,-28, 16, 39, 0,0,0],
['c1x1x1', m4, 21,-24, -8, 42, 0,0,0],
['c1x1x1', m4, 21,-20, -8, 42, 0,0,0],
['c1x1x1', m4, 21,-32, 16, 42, 0,0,0],
['c1x1x1', m4, 21,-28, 16, 42, 0,0,0],
['c1x1x1', m3, 21,-24, -8, 45, 0,0,0],
['c1x1x1', m3, 21,-20, -8, 45, 0,0,0],
['c1x1x1', m3, 21,-32, 16, 45, 0,0,0],
['c1x1x1', m3, 21,-28, 16, 45, 0,0,0],
['c1x1x1', m3, 21,-24, -8, 48, 0,0,0],
['c1x1x1', m3, 21,-20, -8, 48, 0,0,0],
['c1x1x1', m3, 21,-32, 16, 48, 0,0,0],
['c1x1x1', m3, 21,-28, 16, 48, 0,0,0],
['c1x1x1', m3, 22, 20, 16, 39, 0,0,0],
['c1x1x1', m3, 22, 24, 16, 39, 0,0,0],
['c1x1x1', m3, 22, 24, 20, 39, 0,0,0],
['c1x1x1', m3, 22, 20, 20, 39, 0,0,0],
['b2x2x1', m3, 22, 20, 16, 42, 0,0,0],
['f1x2x1', m6, 22, 20, 16, 45, 0,0,0],
['f1x2x1', m6, 22, 24, 16, 45, 0,0,0],
['f1x2x1', m6, 23, 24, 18, 48, 0,0,90],
['c1x1x1', m6, 23, 0, 16, 48, 0,0,0],
['b1x3x1', m6, 23, -4, 12, 48, 0,0,90],
['b1x1x1', m3, 23, -8, 16, 48, 0,0,0],
['b2x4x1', m6, 23,-16, 8, 48, 0,0,90],
['b1x3x1', m6, 23,-32, 12, 48, 0,0,90],
['b1x1x1', m3, 23,-40, 16, 48, 0,0,0],
['b1x3x1', m3, 23,-40, 0, 48, 0,0,0],
['b1x3x1', m6, 23,-32, -4, 48, 0,0,90],
['b1x1x1', m3, 23,-40, -8, 48, 0,0,0],
['b2x4x1', m6, 23,-16, -4, 48, 0,0,90],
['b1x3x1', m6, 23, -4, -4, 48, 0,0,90],
['b1x1x1', m3, 23, -8, -8, 48, 0,0,0],
['c1x1x1', m6, 23, 0, -8, 48, 0,0,0],
['b1x3x1', m3, 23, -4, 0, 48, 0,0,0],
['c1x1x1', m6, 24, 22, 18, 51, 0,0,0],
['c1x1x1', m6, 24, 0, 16, 51, 0,0,90],
['c1x1x1', m6, 24, -8, 16, 51, 0,0,0],
['b2x6x1', m6, 24, -4, 8, 51, 0,0,90],
['b1x2x1', m6, 24,-28, 8, 51, 0,0,90],
['b2x2x1', m3, 24,-32, 12, 51, 0,0,0],
['b2x2x1', m6, 24,-40, 8, 51, 0,0,0],
['c1x1x1', m6, 24,-40, 16, 51, 0,0,0],
['b1x1x1', m3, 24,-40, 4, 51, 0,0,0],
['b2x4x1', m6, 24,-28, -4, 51, 0,0,90],
['c1x1x1', m6, 24,-40, -8, 51, 0,0,0],
['b1x2x1', m6, 24,-20, 0, 51, 0,0,90],
['b2x2x1', m3, 24,-24, -8, 51, 0,0,0],
['b2x4x1', m6, 24, -4, -4, 51, 0,0,90],
['c1x1x1', m6, 24, -8, -8, 51, 0,0,0],
['c1x1x1', m6, 24, 0, -8, 51, 0,0,0],
['b1x1x1', m3, 24, -4, 4, 51, 0,0,0],
['c1x1x1', m7, 25, 22, 18, 54, 0,0,0],
['b1x1x1', m3, 25, -4, 4, 54, 0,0,0],
['b1x3x1', m5, 25, -4, 8, 54, 0,0,90],
['b1x3x1', m5, 25, -4, 0, 54, 0,0,90],
['b2x3x1', m5, 25,-20, 0, 54, 0,0,0],
['b2x3x1', m5, 25,-28, 0, 54, 0,0,0],
['b1x3x1', m5, 25,-32, 8, 54, 0,0,90],
['b1x1x1', m3, 25,-40, 4, 54, 0,0,0],
['b1x3x1', m5, 25,-32, 0, 54, 0,0,90],
['c1x1x1', m3, 25,-32, 12, 54, 0,0,0],
['c1x1x1', m3, 25,-28, 12, 54, 0,0,0],
['c1x1x1', m3, 25,-28, 16, 54, 0,0,0],
['c1x1x1', m3, 25,-32, 16, 54, 0,0,0],
['c1x1x1', m3, 25,-24, -4, 54, 0,0,0],
['c1x1x1', m3, 25,-20, -4, 54, 0,0,0],
['c1x1x1', m3, 25,-20, -8, 54, 0,0,0],
['c1x1x1', m3, 25,-24, -8, 54, 0,0,0],
['c1x1x1', m3, 26,-32, 12, 57, 0,0,0],
['c1x1x1', m3, 26,-28, 12, 57, 0,0,0],
['c1x1x1', m3, 26,-28, 16, 57, 0,0,0],
['c1x1x1', m3, 26,-32, 16, 57, 0,0,0],
['c1x1x1', m3, 26,-24, -4, 57, 0,0,0],
['c1x1x1', m3, 26,-20, -4, 57, 0,0,0],
['c1x1x1', m3, 26,-20, -8, 57, 0,0,0],
['c1x1x1', m3, 26,-24, -8, 57, 0,0,0],
['f1x2x1', m6, 27,-20, -8, 60, 0,0,90],
['f1x2x1', m6, 27,-20, -4, 60, 0,0,90],
['f1x2x1', m6, 27,-22, -8, 63, 0,0,0],
['c1x1x1', m6, 27,-22, -6, 66, 0,0,0],
['c1x1x1', m7, 27,-22, -6, 69, 0,0,0],
['b2x2x1', m3, 28,-32, 12, 60, 0,0,0],
['b2x2x1', m5, 28,-32, 12, 63, 0,0,0],
['c1x1x1', m3, 28,-32, 12, 66, 0,0,0],
['c1x1x1', m3, 28,-28, 12, 66, 0,0,0],
['c1x1x1', m3, 28,-28, 16, 66, 0,0,0],
['c1x1x1', m3, 28,-32, 16, 66, 0,0,0],
['b2x2x1', m3, 28,-32, 12, 69, 0,0,0],
['f1x2x1', m5, 29,-28, 12, 72, 0,0,90],
['f1x2x1', m5, 29,-28, 16, 72, 0,0,90],
['f1x2x1', m5, 29,-30, 12, 75, 0,0,0],
['c1x1x1', m5, 29,-30, 12, 78, 0,0,0],
['c1x1x1', m5, 29,-30, 12, 81, 0,0,0],
['c1x1x1', m7, 29,-30, 12, 84, 0,0,0],
['b2x3x1', m5, 30, -8, 0, 57, 0,0,0],
['b2x3x1', m5, 30,-16, 0, 57, 0,0,0],
['b2x3x1', m5, 30,-24, 0, 57, 0,0,0],
['b2x3x1', m5, 30,-32, 0, 57, 0,0,0],
['b2x3x1', m5, 30,-40, 0, 57, 0,0,0],
['b1x4x1', m5, 30, -4, 4, 60, 0,0,90],
['b1x2x1', m5, 30,-20, 4, 60, 0,0,90],
['b1x4x1', m5, 30,-28, 4, 60, 0,0,90],
['b1x3x1', m5, 31, -4, 4, 63, 0,0,90],
['b1x4x1', m5, 31,-16, 4, 63, 0,0,90],
['b1x3x1', m5, 31,-32, 4, 63, 0,0,90],
['c1x1x1', m7, 31, -4, 4, 66, 0,0,0],
['c1x1x1', m7, 31,-40, 4, 66, 0,0,0],
['c1x1x1', m8, 32,-32,-36, 3, 0,0,0],
['b1x2x1', m9, 32, 0, 0, 3, 0,0,45, 1],
['b1x2x1', m9, 32, 0, 0, 6, 0,0,-45, 1],
['b1x2x1', m9, 32, 0, 0, 9, 0,0,45, 1],
['c1x1x1', m9, 32, 0, 0, 12, 0,0,0, 1],
['c1x1x1', m8, 33,-12,-24, 3, 0,0,0],
['b1x2x1', m9, 33, 0, 0, 3, 0,0,45, 1],
['b1x2x1', m9, 33, 0, 0, 6, 0,0,-45, 1],
['b1x2x1', m9, 33, 0, 0, 9, 0,0,45, 1],
['b1x2x1', m9, 33, 0, 0, 12, 0,0,-45, 1],
['b1x2x1', m9, 33, 0, 0, 15, 0,0,45, 1],
['c1x1x1', m9, 33, 0, 0, 18, 0,0,0, 1],
['c1x1x1', m8, 34, 16,-36, 3, 0,0,0],
['b1x2x1', m9, 34, 0, 0, 3, 0,0,45, 1],
['b1x2x1', m9, 34, 0, 0, 6, 0,0,-45, 1],
['b1x2x1', m9, 34, 0, 0, 9, 0,0,45, 1],
['c1x1x1', m9, 34, 0, 0, 12, 0,0,0, 1],
['c1x1x1', m8, 35, 32,-24, 3, 0,0,0],
['b1x2x1', m9, 35, 0, 0, 3, 0,0,45, 1],
['b1x2x1', m9, 35, 0, 0, 6, 0,0,-45, 1],
['b1x2x1', m9, 35, 0, 0, 9, 0,0,45, 1],
['b1x2x1', m9, 35, 0, 0, 12, 0,0,-45, 1],
['b1x2x1', m9, 35, 0, 0, 15, 0,0,45, 1],
['c1x1x1', m9, 35, 0, 0, 18, 0,0,0, 1],
['c1x1x1', m8, 36,-20, 28, 3, 0,0,0],
['b1x2x1', m9, 36, 0, 0, 3, 0,0,45, 1],
['b1x2x1', m9, 36, 0, 0, 6, 0,0,-45, 1],
['b1x2x1', m9, 36, 0, 0, 9, 0,0,45, 1],
['b1x2x1', m9, 36, 0, 0, 12, 0,0,-45, 1],
['b1x2x1', m9, 36, 0, 0, 15, 0,0,45, 1],
['c1x1x1', m9, 36, 0, 0, 18, 0,0,0, 1],
['c1x1x1', m8, 37, 16, 32, 3, 0,0,0],
['b1x2x1', m9, 37, 0, 0, 3, 0,0,45, 1],
['b1x2x1', m9, 37, 0, 0, 6, 0,0,-45, 1],
['b1x2x1', m9, 37, 0, 0, 9, 0,0,45, 1],
['c1x1x1', m9, 37, 0, 0, 12, 0,0,0, 1],
['c1x1x1', m3, 38, 36, -4, 3, 0,0,0],
['b1x2x1', m10, 38, 36, 0, 3, 0,0,90],
['b1x2x1', m10, 38, 36, 12, 3, 0,0,90],
['c1x1x1', m3, 38, 36, 16, 3, 0,0,0],
['c1x1x1', m3, 39, 36, -4, 6, 0,0,0],
['b1x2x1', m10, 39, 36, 0, 6, 0,0,90],
['b1x2x1', m10, 39, 36, 12, 6, 0,0,90],
['c1x1x1', m3, 39, 36, 16, 6, 0,0,0],
['c1x1x1', m3, 40, 36, -4, 9, 0,0,0],
['b1x2x1', m10, 40, 36, 0, 9, 0,0,90],
['b1x2x1', m10, 40, 36, 12, 9, 0,0,90],
['c1x1x1', m3, 40, 36, 16, 9, 0,0,0],
['c1x1x1', m3, 41, 36, -4, 12, 0,0,0],
['b1x2x1', m10, 41, 36, 0, 12, 0,0,90],
['b1x2x1', m10, 41, 36, 12, 12, 0,0,90],
['c1x1x1', m3, 41, 36, 16, 12, 0,0,0],
['b2x2x1', m3, 41, 32, 4, 12, 0,0,0],
['c1x1x1', m3, 42, 36, -4, 15, 0,0,0],
['b2x4x1', m10, 42, 32, 0, 15, 0,0,0],
['c1x1x1', m3, 42, 36, 16, 15, 0,0,0],
['b1x1x1', m3, 43, 36, -4, 18, 0,0,0],
['b1x2x1', m6, 43, 36, 0, 18, 0,0,90],
['b1x2x1', m6, 43, 36, 12, 18, 0,0,90],
['b1x1x1', m3, 43, 36, 16, 18, 0,0,0],
['b2x2x1', m10, 43, 32, 4, 18, 0,0,0],
['c1x1x1', m6, 44, 36, -4, 21, 0,0,0],
['c1x1x1', m6, 44, 36, 16, 21, 0,0,0],
['f1x2x1', m6, 44, 36, 4, 21, 0,0,0],
['f1x2x1', m6, 44, 32, 4, 21, 0,0,0],
['f1x2x1', m6, 44, 36, 6, 24, 0,0,90],
];

View File

@@ -1,8 +1,9 @@
//Leency, Veliant, Punk_Joker, PavelYakov & KolibriOS Team 2008-2025 //Leency, Veliant, Punk_Joker, PavelYakov & KolibriOS Team 2008-2022
//GNU GPL license. //GNU GPL license.
/* /*
BUGS: BUGS:
- F1 in KFM (move Properties to an external app)
- Ctrl+1+2+3+4 in KFM - Ctrl+1+2+3+4 in KFM
- Highlight another commands on Ctrl|Shift in KFM like in Classic KFM - Highlight another commands on Ctrl|Shift in KFM like in Classic KFM
TODO: TODO:
@@ -10,9 +11,9 @@ TODO:
http://board.kolibrios.org/viewtopic.php?f=23&t=4521&p=77334#p77334 http://board.kolibrios.org/viewtopic.php?f=23&t=4521&p=77334#p77334
*/ */
#define ABOUT_TITLE "Eolite 5.32" #define ABOUT_TITLE "EOLITE 5.28"
#define TITLE_EOLITE "Eolite File Manager 5.32" #define TITLE_EOLITE "Eolite File Manager 5.28"
#define TITLE_KFM "Kolibri File Manager 2.32"; #define TITLE_KFM "Kolibri File Manager 2.28";
#define MEMSIZE 1024 * 250 #define MEMSIZE 1024 * 250
#include "../lib/clipboard.h" #include "../lib/clipboard.h"
@@ -25,15 +26,12 @@ TODO:
#include "../lib/kfont.h" #include "../lib/kfont.h"
#include "../lib/collection.h" #include "../lib/collection.h"
#include "../lib/copyf.h" #include "../lib/copyf.h"
#include "../lib/dll.h"
#include "../lib/obj/libini.h" #include "../lib/obj/libini.h"
#include "../lib/obj/box_lib.h" #include "../lib/obj/box_lib.h"
#include "../lib/obj/libimg.h" #include "../lib/obj/libimg.h"
#include "../lib/obj/proc_lib.h"
#include "../lib/patterns/history.h" #include "../lib/patterns/history.h"
#include "../lib/patterns/select_list.h"
#include "imgs/images.h" #include "imgs/images.h"
#include "include/const.h" #include "include/const.h"
@@ -112,8 +110,6 @@ edit_box popin_text = {200,213,180,0xFFFFFF,0x94AECE,0xFFFFFF,0xFFFFFF,0x1000000
PathShow_data FileShow = {0, 56,215, 8, 100, 1, 0, 0x0, 0xFFFfff, #file_name, #temp, 0}; PathShow_data FileShow = {0, 56,215, 8, 100, 1, 0, 0x0, 0xFFFfff, #file_name, #temp, 0};
_ini icons_ini = { "/sys/File managers/icons.ini", NULL };
#include "include\settings.h" #include "include\settings.h"
#include "include\gui.h" #include "include\gui.h"
#include "include\progress_dialog.h" #include "include\progress_dialog.h"
@@ -125,8 +121,6 @@ _ini icons_ini = { "/sys/File managers/icons.ini", NULL };
#include "include\about.h" #include "include\about.h"
#include "include\properties.h" #include "include\properties.h"
#include "search.c"
void handle_param() void handle_param()
{ {
//-p <path> : just show file/folder properties dialog //-p <path> : just show file/folder properties dialog
@@ -152,14 +146,6 @@ void handle_param()
if (ESBYTE[p]=='\0') return; if (ESBYTE[p]=='\0') return;
if (ESBYTE[p]=='\\') switch (ESBYTE[p+1])
{
case 's':
strcpy(path, p + 3);
SearchThread();
ExitProcess();
}
if (ESBYTE[p]=='-') switch (ESBYTE[p+1]) if (ESBYTE[p]=='-') switch (ESBYTE[p+1])
{ {
case 'p': case 'p':
@@ -209,8 +195,6 @@ void main()
handle_param(); handle_param();
kfont.init(DEFAULT_FONT);
SystemDiscs.Get(); SystemDiscs.Get();
OpenDir(ONLY_OPEN); OpenDir(ONLY_OPEN);
llist_copy(#files_inactive, #files); llist_copy(#files_inactive, #files);
@@ -443,9 +427,6 @@ void main()
} }
EventDriveClick(key_scancode); EventDriveClick(key_scancode);
break; break;
case SCAN_CODE_KEY_P:
EventCopyItemPath();
break;
case SCAN_CODE_KEY_X: case SCAN_CODE_KEY_X:
CopyFilesListToClipboard(CUT); CopyFilesListToClipboard(CUT);
break; break;
@@ -455,9 +436,6 @@ void main()
case SCAN_CODE_KEY_G: case SCAN_CODE_KEY_G:
EventOpenConsoleHere(); EventOpenConsoleHere();
break; break;
case SCAN_CODE_KEY_F:
EventOpenSearch();
break;
case SCAN_CODE_KEY_V: case SCAN_CODE_KEY_V:
EventPaste(path); EventPaste(path);
break; break;
@@ -718,7 +696,7 @@ void DrawFilePanels()
DrawButtonsAroundList(); DrawButtonsAroundList();
path = location[active_panel^1]; path = location[active_panel^1];
active_panel ^= 1; active_panel ^= 1;
OpenDir_without_unselect(WITH_REDRAW); OpenDir2(WITH_REDRAW);
active_panel ^= 1; active_panel ^= 1;
if (!getSelectedCount()) files_inactive.count = files.count; if (!getSelectedCount()) files_inactive.count = files.count;
llist_copy(#files, #files_active); llist_copy(#files, #files_active);
@@ -731,22 +709,38 @@ void DrawFilePanels()
DrawButtonsAroundList(); DrawButtonsAroundList();
path = location[active_panel]; path = location[active_panel];
OpenDir_without_unselect(WITH_REDRAW); OpenDir2(WITH_REDRAW);
} }
} }
void OpenDir(char redraw) { void OpenDir2(char redraw){
unselectAll(); if (buf) free(buf);
OpenDir_without_unselect(redraw); if (GetDir(#buf, #files.count, path, DIRS_NOROOT)) {
Write_Error(EAX);
history.add(path);
EventHistoryGoBack();
return;
}
SetCurDir(path);
if (files.count>0) && (files.cur_y-files.first==-1) files.cur_y=0;
files.visible = math.min(files.h / files.item_h, files.count);
if (!strncmp(path, "/rd/1",5)) || (!strncmp(path, "/sys/",4))
dir_at_fat16 = true; else dir_at_fat16 = false;
Sorting();
SystemDiscs.Draw();
list_full_redraw = true;
List_ReDraw();
DrawPathBar();
} }
void OpenDir_without_unselect(char redraw) { void OpenDir(char redraw){
int errornum; int errornum;
unselectAll();
if (buf) free(buf); if (buf) free(buf);
if (errornum = GetDir(#buf, #files.count, path, DIRS_NOROOT)) { if (errornum = GetDir(#buf, #files.count, path, DIRS_NOROOT)) {
history.add(path); history.add(path);
//EventHistoryGoBack();
Dir_Up(); Dir_Up();
Write_Error(errornum); Write_Error(errornum);
return; return;
@@ -1041,6 +1035,7 @@ void EventHistoryGoForward()
} }
} }
void ShowOpenWithDialog() void ShowOpenWithDialog()
{ {
byte open_param[4097]; byte open_param[4097];
@@ -1134,7 +1129,6 @@ void ShowPopinForm(byte _popin_type)
break; break;
case POPIN_DELETE: case POPIN_DELETE:
if (!files.count) return; if (!files.count) return;
popin_string[0] = -1;
if (!getSelectedCount()) && (!strncmp(#file_name,"..",2)) return; if (!getSelectedCount()) && (!strncmp(#file_name,"..",2)) return;
popinx = DrawEolitePopup(T_YES, T_NO); popinx = DrawEolitePopup(T_YES, T_NO);
WriteTextCenter(popinx, 178, POPIN_W, sc.work_text, T_DELETE_FILE); WriteTextCenter(popinx, 178, POPIN_W, sc.work_text, T_DELETE_FILE);
@@ -1326,18 +1320,6 @@ void EventOpenConsoleHere()
RunProgram("/sys/shell", #param); RunProgram("/sys/shell", #param);
} }
void EventOpenSearch()
{
sprintf(#param, "\\s %s", path);
RunProgram(#program_path, #param);
}
void EventCopyItemPath()
{
Clipboard__CopyText(#file_path);
}
void ProceedMouseGestures() void ProceedMouseGestures()
{ {
char stats; char stats;

View File

@@ -1,8 +1,16 @@
if tup.getconfig("NO_CMM") ~= "" then return end if tup.getconfig("NO_CMM") ~= "" then return end
if tup.getconfig("NO_TCC") ~= "" then return end
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR")
tup.include(HELPERDIR .. "/use_tcc.lua")
if tup.getconfig("LANG") == "ru_RU" if tup.getconfig("LANG") == "ru_RU"
then C_LANG = "LANG_RUS" then C_LANG = "LANG_RUS"
else C_LANG = "LANG_ENG" -- this includes default case without config else C_LANG = "LANG_ENG" -- this includes default case without config
end end
tup.rule("Eolite.c", "c-- /D=$(C_LANG) /OPATH=%o %f" .. tup.getconfig("KPACK_CMD"), "Eolite.com") LFLAGS = LFLAGS .. " -stack=20480"
LIBS += " ../../develop/ktcc/trunk/bin/lib/tiny.o -nostdlib -lbox_lib -lini -limg"
tup.rule("Eolite.c", "c-- -coff /D=" .. C_LANG .. " /OPATH=%o %f", "%B.obj")
tup.rule("Eolite.obj", "objconv -felf32 %f %o", "%B.o")
link_tcc("Eolite.o", "%B.com")

View File

@@ -1,3 +1,4 @@
_ini icons_ini = { "/sys/File managers/icons.ini", NULL };
struct ICONS_INI { struct ICONS_INI {
collection exts; collection exts;

View File

@@ -4,11 +4,9 @@ char file_actions[]=
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |Enter "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |Enter
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |Ctrl+Ent <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |Ctrl+Ent
- -
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> |Ctrl+P <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |Ctrl+C
- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |Ctrl+X
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>|Ctrl+C <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |Ctrl+V
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>|Ctrl+X
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>|Ctrl+V
- -
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |F2 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |F2
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |Del <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |Del
@@ -17,10 +15,8 @@ char empty_folder_actions[]=
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |Ctrl+V"; "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |Ctrl+V";
char burger_menu_items[] = char burger_menu_items[] =
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>|Ctrl+N "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>|Ctrl+N
-
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>|Ctrl+G <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>|Ctrl+G
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>|Ctrl+F <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>|Ctrl+R
-
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>|F10 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>|F10
<EFBFBD> <EFBFBD><EFBFBD><EFBFBD>"; <EFBFBD> <EFBFBD><EFBFBD><EFBFBD>";
@@ -29,8 +25,6 @@ char file_actions[]=
"Ava |Enter "Ava |Enter
Ava ... |Ctrl+Ent Ava ... |Ctrl+Ent
- -
Copy path |Ctrl+P
-
Kopeeri |Ctrl+C Kopeeri |Ctrl+C
L<EFBFBD>ika |Ctrl+X L<EFBFBD>ika |Ctrl+X
Aseta |Ctrl+V Aseta |Ctrl+V
@@ -42,10 +36,8 @@ char empty_folder_actions[]=
"Aseta |Ctrl+V"; "Aseta |Ctrl+V";
char burger_menu_items[] = char burger_menu_items[] =
"New window|Ctrl+N "New window|Ctrl+N
-
Open console here|Ctrl+G Open console here|Ctrl+G
Search|Ctrl+F V<EFBFBD>rskenda|Ctrl+R
-
Settings|F10 Settings|F10
About"; About";
@@ -54,8 +46,6 @@ char file_actions[]=
"Open |Enter "Open |Enter
Open with... |Ctrl+Ent Open with... |Ctrl+Ent
- -
Copy path |Ctrl+P
-
Copy |Ctrl+C Copy |Ctrl+C
Cut |Ctrl+X Cut |Ctrl+X
Paste |Ctrl+V Paste |Ctrl+V
@@ -67,10 +57,8 @@ char empty_folder_actions[]=
"Paste |Ctrl+V"; "Paste |Ctrl+V";
char burger_menu_items[] = char burger_menu_items[] =
"New window|Ctrl+N "New window|Ctrl+N
-
Open console here|Ctrl+G Open console here|Ctrl+G
Search|Ctrl+F Refresh folder|Ctrl+R
-
Settings|F10 Settings|F10
About"; About";
#endif #endif
@@ -88,18 +76,17 @@ void EventMenuClick(dword _id)
if (active_menu == MENU_FILE) switch(_id) { if (active_menu == MENU_FILE) switch(_id) {
case 1: EventOpen(0); break; case 1: EventOpen(0); break;
case 2: ShowOpenWithDialog(); break; case 2: ShowOpenWithDialog(); break;
case 3: EventCopyItemPath(); break; case 3: CopyFilesListToClipboard(COPY); break;
case 4: CopyFilesListToClipboard(COPY); break; case 4: CopyFilesListToClipboard(CUT); break;
case 5: CopyFilesListToClipboard(CUT); break; case 5: EventPaste(path); break;
case 6: EventPaste(path); break; case 6: FnProcess(2); break;
case 7: FnProcess(2); break; case 7: ShowPopinForm(POPIN_DELETE); break;
case 8: ShowPopinForm(POPIN_DELETE); break; case 8: FnProcess(1); break;
case 9: FnProcess(1); break;
} }
if (active_menu == MENU_BURGER) switch(_id) { if (active_menu == MENU_BURGER) switch(_id) {
case 1: EventOpenNewEolite(); break; case 1: EventOpenNewEolite(); break;
case 2: EventOpenConsoleHere(); break; case 2: EventOpenConsoleHere(); break;
case 3: EventOpenSearch(); break; case 3: EventRefreshDisksAndFolders(); break;
case 4: FnProcess(10); break; case 4: FnProcess(10); break;
case 5: EventShowAbout(); break; case 5: EventShowAbout(); break;
} }

View File

@@ -175,10 +175,8 @@ void properties_dialog()
break; break;
case evMouse: case evMouse:
if (!apply_question_active) { edit_box_mouse stdcall (#file_name_ed);
edit_box_mouse stdcall (#file_name_ed); edit_box_mouse stdcall (#path_to_file_ed);
edit_box_mouse stdcall (#path_to_file_ed);
}
break; break;
case evKey: case evKey:

View File

@@ -7,7 +7,7 @@ edit_box path_start_ed = {290,50,57,0xffffff,0x94AECE,0xffffff,0xffffff,0x100000
#path_start,0, 100000000000010b,0,0}; #path_start,0, 100000000000010b,0,0};
more_less_box font_size = { NULL, 9, 22, FONT_SIZE_LABEL }; more_less_box font_size = { NULL, 9, 22, FONT_SIZE_LABEL };
more_less_box line_height = { NULL, 18, 64, LIST_LINE_HEIGHT }; more_less_box line_height = { NULL, 16, 64, LIST_LINE_HEIGHT };
checkbox show_dev_name = { SHOW_DEVICE_CLASS }; checkbox show_dev_name = { SHOW_DEVICE_CLASS };
checkbox big_icons = { BIG_ICONS }; checkbox big_icons = { BIG_ICONS };
checkbox colored_lines = { COLORED_LINES }; checkbox colored_lines = { COLORED_LINES };
@@ -69,7 +69,7 @@ void settings_dialog()
case evKey: case evKey:
GetKeys(); GetKeys();
if (key_scancode==SCAN_CODE_ESC) ExitSettings(); if (key_scancode==SCAN_CODE_ESC) ExitSettings();
edit_box_key_c stdcall (#path_start_ed,key_editbox); edit_box_key_c stdcall (#path_start_ed,key_ascii << 8);
break; break;
case evReDraw: case evReDraw:
@@ -134,6 +134,7 @@ void LoadIniSettings()
Form.height = ini.GetInt("WinH", efm*100+517); Form.height = ini.GetInt("WinH", efm*100+517);
ini.GetString("DefaultPath", #path_start, 4096, "/sys"); ini.GetString("DefaultPath", #path_start, 4096, "/sys");
path_start_ed.size = path_start_ed.pos = strlen(#path_start); path_start_ed.size = path_start_ed.pos = strlen(#path_start);
kfont.init(DEFAULT_FONT);
ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font smoothing",#temp,4096,"on"); ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font smoothing",#temp,4096,"on");
if(streq(#temp,"off")) kfont.smooth = false; else kfont.smooth = true; if(streq(#temp,"off")) kfont.smooth = false; else kfont.smooth = true;
} }

View File

@@ -9,6 +9,7 @@
#pragma option -CPA #pragma option -CPA
#initallvar 0 #initallvar 0
#ifndef __COFF__
#jumptomain FALSE #jumptomain FALSE
#startaddress 0 #startaddress 0
@@ -29,6 +30,17 @@ dword I_Param = #param;
dword I_Path = #program_path; dword I_Path = #program_path;
char param[4096]; char param[4096];
char program_path[4096]; char program_path[4096];
#else
extern dword __argv;
extern dword __path;
dword I_Param = #__argv;
dword I_Path = #__path;
#define param __argv
#define program_path __path
#define ______INIT______ start
#endif
#define bool int #define bool int
@@ -391,7 +403,6 @@ inline fastcall int TestBit( EAX, CL)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#define MINIMIZED 0x02
#define ROLLED_UP 0x04 #define ROLLED_UP 0x04
:void DefineAndDrawWindow(dword _x, _y, _w, _h, _window_type, _bgcolor, _title, _flags) :void DefineAndDrawWindow(dword _x, _y, _w, _h, _window_type, _bgcolor, _title, _flags)
{ {

View File

@@ -116,10 +116,17 @@
EAX = 37; EAX = 37;
EBX = 2; EBX = 2;
$int 64 $int 64
$mov ebx, eax
$mov ecx, eax
key = EAX; key = EAX;
lkm = EAX&MOUSE_LEFT; $and eax, 0x00000001
pkm = EAX&MOUSE_RIGHT; $shr ebx, 1
mkm = EAX&MOUSE_MIDDLE; $and ebx, 0x00000001
$shr ecx, 2
$and ecx, 0x00000001
lkm = EAX;
pkm = EBX;
mkm = ECX;
//when you release the MOUSE button //when you release the MOUSE button
// Mouse Move Event // Mouse Move Event

View File

@@ -6,6 +6,37 @@
#include "../lib/kolibri.h" #include "../lib/kolibri.h"
#endif #endif
#ifdef __COFF__
extern dword edit_box_draw;
extern dword edit_box_key_safe;
extern dword edit_box_mouse;
extern dword edit_box_set_text;
extern dword scrollbar_v_draw;
extern dword scrollbar_v_mouse;
extern dword scrollbar_h_draw;
extern dword scrollbar_h_mouse;
extern dword PathShow_prepare;
extern dword PathShow_draw;
extern dword progressbar_draw;
extern dword progressbar_progress;
extern dword frame_draw;
/*
Legacy support
For new programs need to use edit_box_key_safe (or edit_box_key_c
with a define below)
TODO: change in all cmm programs edit_box_key to edit_box_key_safe (edit_box_key_c)
See examples in eolite and imgedit
This define changed all edit_box_key_c to edit_box_key_safe identifier's
*/
#define edit_box_key_c edit_box_key_safe
#else
#ifndef INCLUDE_DLL_H #ifndef INCLUDE_DLL_H
#include "../lib/dll.h" #include "../lib/dll.h"
#endif #endif
@@ -211,3 +242,5 @@ struct frame
frame_draw stdcall (#frame123); frame_draw stdcall (#frame123);
} }
#endif

View File

@@ -44,14 +44,15 @@ signed SelectList_ProcessMouse()
return true; return true;
} }
if (mouse.up) && (select_list.ProcessMouse(mouse.x, mouse.y)) { if (mouse.up) && (mouse.click)
SelectList_LineChanged(); if (select_list.ProcessMouse(mouse.x, mouse.y)) {
return true; SelectList_LineChanged();
} return true;
}
return false; return false;
} }
:void SelectList_DrawBorder() { void SelectList_DrawBorder() {
DrawRectangle3D(select_list.x-2, select_list.y-2, DrawRectangle3D(select_list.x-2, select_list.y-2,
select_list.w+3+scroll1.size_x, select_list.h+3, select_list.w+3+scroll1.size_x, select_list.h+3,
sc.dark, sc.light); sc.dark, sc.light);
@@ -60,8 +61,8 @@ signed SelectList_ProcessMouse()
void SelectList_DrawScroller() void SelectList_DrawScroller()
{ {
scroll1.bckg_col = sc.dark; // MixColors(sc.work, 0xBBBbbb, 80); scroll1.bckg_col = MixColors(sc.work, 0xBBBbbb, 80);
scroll1.frnt_col = sc.light; // MixColors(sc.work,0xFFFfff,120); scroll1.frnt_col = MixColors(sc.work,0xFFFfff,120);
scroll1.line_col = sc.line; scroll1.line_col = sc.line;
scroll1.max_area = select_list.count; scroll1.max_area = select_list.count;

View File

@@ -1,13 +0,0 @@
#define MEMSIZE 1024*20
#define ENTRY_POINT #main
#include "../lib/fs.h"
void main()
{
char param2[4096];
strcpy(#param2, "\\s ");
strncpy(#param2 + 3, #param, sizeof(param2) - 2 - 3);
RunProgram("/sys/File managers/Eolite", #param2);
ExitProcess();
}

View File

@@ -0,0 +1,6 @@
if tup.getconfig("NO_CMM") ~= "" then return end
if tup.getconfig("LANG") == "ru_RU"
then C_LANG = "LANG_RUS"
else C_LANG = "LANG_ENG" -- this includes default case without config
end
tup.rule("search.c", "c-- /D=$(C_LANG) /OPATH=%o %f" .. tup.getconfig("KPACK_CMD"), "search.com")

View File

@@ -0,0 +1,10 @@
@del search
@c-- /D=LANG_ENG search.c
@rename search.com search
@del warning.txt
if exist search (
@exit
) else (
@pause
)

View File

@@ -0,0 +1,10 @@
@del search
@c-- /D=LANG_RUS search.c
@rename search.com search
@del warning.txt
if exist search (
@exit
) else (
@pause
)

View File

@@ -1,3 +1,13 @@
#define MEMSIZE 100*1000
#include "../lib/fs.h"
#include "../lib/gui.h"
#include "../lib/list_box.h"
#include "../lib/obj/box_lib.h"
#include "../lib/obj/proc_lib.h"
#include "../lib/obj/libini.h"
#include "../lib/patterns/select_list.h"
//===================================================// //===================================================//
// // // //
// DATA // // DATA //
@@ -24,11 +34,11 @@ enum {
BTN_CHOOSE_PATH BTN_CHOOSE_PATH
}; };
dword mouse_dd; proc_info Form;
edit_box edit_name = {230,13, 30,0xffffff,0x94AECE,0xffffff,0xffffff, #define TOOLBAR_H 100
0x10000000,sizeof(search_name)-2,#search_name,#mouse_dd, ed_focus,0,0};
edit_box edit_path = {310,260,30,0xffffff,0x94AECE,0xffffff,0xffffff, edit_box edit_name = {230,13, 30,0xffffff,0x94AECE,0xffffff,0xffffff,0x10000000,sizeof(search_name)-2,#search_name,0, ed_focus,0,0};
0x10000000,sizeof(search_path)-2,#search_path,#mouse_dd, 0b,0,0}; edit_box edit_path = {310,260,30,0xffffff,0x94AECE,0xffffff,0xffffff,0x10000000,sizeof(search_path)-2,#search_path,0, 0b,0,0};
opendialog open_folder_dialog = opendialog open_folder_dialog =
{ {
@@ -39,7 +49,7 @@ opendialog open_folder_dialog =
0, //dword opendir_path, 0, //dword opendir_path,
#search_path, //dword dir_default_path, #search_path, //dword dir_default_path,
#open_dialog_path, #open_dialog_path,
#draw_window_search, #draw_window,
0, 0,
#search_path, //dword openfile_path, #search_path, //dword openfile_path,
0, //dword filename_area, 0, //dword filename_area,
@@ -87,72 +97,47 @@ void RESULTS::drop()
// // // //
//===================================================// //===================================================//
void SearchThread() void main()
{ {
int prev_first, prev_cur_y; int prev_first, prev_cur_y;
load_dll(boxlib, #box_lib_init,0);
load_dll(libini, #lib_init,1);
load_dll(Proc_lib, #OpenDialog_init,0); load_dll(Proc_lib, #OpenDialog_init,0);
OpenDialog_init stdcall (#open_folder_dialog); OpenDialog_init stdcall (#open_folder_dialog);
if (!ESBYTE[path]) strcpy(path, "/sys"); edit_box_set_text stdcall (#edit_name, ".ini");
edit_box_set_text stdcall (#edit_path, path); edit_box_set_text stdcall (#edit_path, "/kolibrios");
@SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER); @SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER);
loop() switch(@WaitEvent()) loop() switch(@WaitEvent())
{ {
case evMouse: case evMouse:
edit_box_mouse stdcall (#edit_name); edit_box_mouse stdcall (#edit_name);
edit_box_mouse stdcall (#edit_path); edit_box_mouse stdcall (#edit_path);
prev_cur_y = select_list.cur_y;
if (SelectList_ProcessMouse()) { if (SelectList_ProcessMouse()) {
SelectList_Draw(); SelectList_Draw();
} else { } else {
SelectList_DrawLine(select_list.cur_y); SelectList_DrawLine(select_list.cur_y);
if (select_list.MouseOver(mouse.x, mouse.y))
{
if (mouse.key&MOUSE_LEFT) && (mouse.up) {
if (prev_cur_y == select_list.cur_y) EventRunFile();
}
if (mouse.key&MOUSE_RIGHT) && (mouse.up) {
EventShowFileInFolder();
}
}
} }
if (mouse.key&MOUSE_RIGHT) && (mouse.up) && (select_list.MouseOver()) EventOpenFile(false);
break; break;
case evButton: case evButton:
switch (@GetButtonID()) { switch (@GetButtonID()) {
case 1: @ExitProcess(); break; case 1: @ExitProcess(); break;
case BTN_SEARCH: EventSearch(); break; case BTN_SEARCH: EventSearch(); break;
case BTN_CHOOSE_PATH: EventChooseSearchInPath(); case BTN_CHOOSE_PATH: EventChooseSearchInPath();
} }
break;
break;
case evKey: case evKey:
GetKeys(); @GetKeys();
edit_box_key_c stdcall (#edit_name, key_editbox); edit_box_key stdcall (#edit_name);
edit_box_key_c stdcall (#edit_path, key_editbox); edit_box_key stdcall (#edit_path);
if (key_scancode == SCAN_CODE_TAB) {
if (edit_name.flags & ed_focus) {
edit_name.flags >< edit_path.flags;
} else if (edit_path.flags & ed_focus) {
edit_path.flags -= ed_focus;
} else {
edit_name.flags += ed_focus;
}
draw_window_search();
break;
}
if (edit_name.flags & ed_focus) || (edit_path.flags & ed_focus) { if (edit_name.flags & ed_focus) || (edit_path.flags & ed_focus) {
if (SCAN_CODE_ENTER == key_scancode) EventSearch(); if (SCAN_CODE_ENTER == key_scancode) EventSearch();
} else { } else {
if (SCAN_CODE_ENTER == key_scancode) EventRunFile(); if (SCAN_CODE_ENTER == key_scancode) EventOpenFile(true);
prev_first = select_list.first; prev_first = select_list.first;
prev_cur_y = select_list.cur_y; prev_cur_y = select_list.cur_y;
if (select_list.ProcessKey(key_scancode)) { if (select_list.ProcessKey(key_scancode)) {
@@ -167,37 +152,33 @@ void SearchThread()
break; break;
case evReDraw: case evReDraw:
sc.get(); draw_window();
DefineAndDrawWindow(screen.w-600/2,100,640,600,0x73,sc.work,T_WINDOW_HEADER,0);
GetProcessInfo(#Form, SelfInfo);
IF (Form.status_window&ROLLED_UP) break;
if (Form.width < 370) { MoveSize(OLD,OLD,370,OLD); break; }
if (Form.height < 250) { MoveSize(OLD,OLD,OLD,250); break; }
draw_window_search();
break; break;
} }
} }
#define TOOLBAR_H 100 void draw_window()
#define PAD 10
#define LISTX PAD
#define LISTY TOOLBAR_H
void draw_window_search()
{ {
SelectList_Init(LISTX, LISTY, Form.cwidth-scroll1.size_x-LISTX-LISTX, Form.cheight-TOOLBAR_H-PAD); sc.get();
DefineAndDrawWindow(screen.w-600/2,100,640,600,0x73,sc.work,T_WINDOW_HEADER,0);
GetProcessInfo(#Form, SelfInfo);
IF (Form.status_window&ROLLED_UP) return;
if (Form.width < 270) { MoveSize(OLD,OLD,270,OLD); return; }
if (Form.height < 200) { MoveSize(OLD,OLD,OLD,200); return; }
SelectList_Init( 0, TOOLBAR_H,
Form.cwidth-scroll1.size_x-1,
Form.cheight-TOOLBAR_H-1);
SelectList_Draw(); SelectList_Draw();
DrawWideRectangle(0, LISTY-PAD-1, Form.cwidth, Form.cheight-TOOLBAR_H+PAD+1, 9, sc.work); DrawBar(0, TOOLBAR_H-1, Form.cwidth, 1, sc.line);
DrawRectangle(PAD-1, LISTY-1, select_list.w+1, select_list.h+1, sc.line);
DrawBar(0, 0, Form.cwidth, TOOLBAR_H-1, sc.work); DrawBar(0, 0, Form.cwidth, TOOLBAR_H-1, sc.work);
DrawEditBox(#edit_name); DrawEditBox(#edit_name);
WriteText(edit_name.left-2, edit_name.top-20, 0x90, sc.work_text, T_SEARCH_NAME); WriteText(edit_name.left-2, edit_name.top-20, 0x90, sc.work_text, T_SEARCH_NAME);
edit_path.width = Form.cwidth - 314; edit_path.width = Form.cwidth - 314;
DrawStandartCaptButton(PAD, 63, BTN_SEARCH, T_BUTTON_SEARCH);
DrawFileBox(#edit_path, T_SEARCH_PATH, BTN_CHOOSE_PATH); DrawFileBox(#edit_path, T_SEARCH_PATH, BTN_CHOOSE_PATH);
DrawStandartCaptButton(10, 63, BTN_SEARCH, T_BUTTON_SEARCH);
} }
_ini ini = { "/sys/File managers/icons.ini", "icons16" };
void SelectList_DrawLine(dword i) void SelectList_DrawLine(dword i)
{ {
int yyy = i*select_list.item_h+select_list.y; int yyy = i*select_list.item_h+select_list.y;
@@ -220,19 +201,16 @@ void SelectList_DrawLine(dword i)
} else { } else {
strcpy(#tname, results.name.get(select_list.first + i)); strcpy(#tname, results.name.get(select_list.first + i));
strlwr(#tname); strlwr(#tname);
icons_ini.section = "icons16"; icon = ini.GetInt(#tname + strrchr(#tname, '.'), 2);
icon = icons_ini.GetInt(#tname + strrchr(#tname, '.'), 2);
} }
#define ICONX 7 #define ICONX 7
DrawBar(LISTX, yyy, ICONX, select_list.item_h, 0xFFFfff); DrawBar(select_list.x, yyy, ICONX-1, select_list.item_h, 0xFFFfff);
DrawBar(LISTX+ICONX, yyy, 18, 1, 0xFFFfff); DrawBar(select_list.x+ICONX+18, yyy, select_list.w-ICONX-18, select_list.item_h, bg);
DrawBar(LISTX+ICONX, yyy + select_list.item_h-1, 18, 1, 0xFFFfff); draw_icon_16(select_list.x+ICONX, yyy+1, icon);
DrawBar(LISTX+ICONX+18, yyy, select_list.w-ICONX-18, select_list.item_h, bg);
draw_icon_16(LISTX+ICONX, yyy+1, icon);
WriteText(LISTX + ICONX+18+4,yyy+select_list.text_y,0x90, col, results.name.get(select_list.first + i)); WriteText(select_list.x + ICONX+18+4,yyy+select_list.text_y,0x90, col, results.name.get(select_list.first + i));
WriteText(LISTX + ICONX+18+206,yyy+select_list.text_y,0x90, col, results.path.get(select_list.first + i)); WriteText(select_list.x + ICONX+18+206,yyy+select_list.text_y,0x90, col, results.path.get(select_list.first + i));
} }
void SelectList_LineChanged() void SelectList_LineChanged()
@@ -240,12 +218,6 @@ void SelectList_LineChanged()
return; return;
} }
void getfullpath(dword to, path, name) {
strcpy(to, path);
chrcat(to, '/');
strcat(to, name);
}
//===================================================// //===================================================//
// // // //
// EVENTS // // EVENTS //
@@ -260,21 +232,22 @@ void EventChooseSearchInPath()
} }
} }
void EventShowFileInFolder() void getfullpath(dword to, path, name) {
{ strcpy(to, path);
char full_path[4096]; chrcat(to, '/');
int pos = select_list.cur_y; strcat(to, name);
getfullpath(#full_path, results.path.get(pos), results.name.get(pos));
RunProgram(#program_path, #full_path);
} }
void EventRunFile() void EventOpenFile(int run_file_not_show_in_folder)
{ {
char full_path[4096]; char full_path[4096];
int pos = select_list.cur_y; int pos = select_list.cur_y;
getfullpath(#full_path, results.path.get(pos), results.name.get(pos)); getfullpath(#full_path, results.path.get(pos), results.name.get(pos));
if (dir_exists(#full_path)) chrcat(#full_path, '/'); if (run_file_not_show_in_folder) {
RunProgram("/sys/@open", #full_path); RunProgram("/sys/@open", #full_path);
} else {
RunProgram("/sys/file managers/eolite", #full_path);
}
} }
void EventSearch() void EventSearch()
@@ -316,4 +289,6 @@ void find_loop(dword way)
} }
} }
stop:

View File

@@ -1,2 +0,0 @@
if tup.getconfig("NO_FASM") ~= "" then return end
tup.rule("movback.asm", "fasm %f %o " .. tup.getconfig("KPACK_CMD"), "movback")

View File

@@ -0,0 +1,7 @@
if tup.getconfig("NO_FASM") ~= "" then return end
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../.." or tup.getconfig("HELPERDIR")
tup.include(HELPERDIR .. "/use_fasm.lua")
add_include(tup.getvariantdir())
tup.rule("echo lang fix " .. ((tup.getconfig("LANG") == "") and "en_US" or tup.getconfig("LANG")) .. " > %o", {"lang.inc"})
tup.rule({"movback.asm", extra_inputs = {"lang.inc"}}, FASM .. " %f %o " .. tup.getconfig("KPACK_CMD"), "movback")

View File

@@ -0,0 +1,5 @@
@erase lang.inc
@echo lang fix en_US >lang.inc
@fasm movback.asm movback
@erase lang.inc
@pause

View File

@@ -0,0 +1,5 @@
@erase lang.inc
@echo lang fix ru_RU >lang.inc
@fasm movback.asm movback
@erase lang.inc
@pause

View File

@@ -1,24 +1,15 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; include "lang.inc"
; SPDX-License-Identifier: GPL-2.0-only include "../../../macros.inc"
; A MoveBack demo include "../../../KOSfuncs.inc"
; Copyright (C) 2010-2025 KolibriOS team
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
include "../../macros.inc" WND_SIZE_X = 320
include "../../KOSfuncs.inc" WND_SIZE_Y = 200
KOS_APP_START
Screen_W dd 600-10 ;10 px for borders
Screen_H dd 400
VC_DELTA = 1 VC_DELTA = 1
HC_DELTA = 2 HC_DELTA = 2
MEOS_APP_START
CODE CODE
mcall SF_SYS_MISC,SSF_HEAP_INIT
call OnResize
fninit fninit
call init_sinus_table call init_sinus_table
call init_background call init_background
@@ -26,7 +17,6 @@ CODE
mcall SF_SET_EVENTS_MASK, 101b mcall SF_SET_EVENTS_MASK, 101b
jmp .paint_window jmp .paint_window
align 4
.event_loop: .event_loop:
mcall SF_WAIT_EVENT_TIMEOUT, 1 mcall SF_WAIT_EVENT_TIMEOUT, 1
@@ -44,63 +34,24 @@ align 4
add word [hor_counter],HC_DELTA add word [hor_counter],HC_DELTA
call handle_animation call handle_animation
xor ebp,ebp xor ebp,ebp
mov ecx,[Screen_W] mcall SF_PUT_IMAGE_EXT, virtual_screen_8,<WND_SIZE_X,WND_SIZE_Y>,<0,0>,8,_palette
shl ecx,16
add ecx,[Screen_H]
mcall SF_PUT_IMAGE_EXT, [virtual_screen_8],,<0,0>,8,_palette
jmp .event_loop jmp .event_loop
.paint_window: .paint_window:
mcall SF_THREAD_INFO, proc_info,-1 mcall SF_THREAD_INFO, proc_info,-1
cmp dword[proc_info.box.height],0
je .resize_end
mcall SF_STYLE_SETTINGS, SSF_GET_SKIN_HEIGHT
add eax,4
sub eax,[proc_info.box.height]
neg eax
cmp eax,[Screen_H]
je .end_h
cmp eax,32 ;min height
jge @f
mov eax,32
@@:
mov [Screen_H],eax
xor eax,eax
mov [Screen_W],eax
.end_h:
mov eax,[proc_info.box.width]
sub eax,9
cmp eax,[Screen_W]
je .resize_end
cmp eax,64 ;min width
jge @f
mov eax,64
@@:
mov [Screen_W],eax
call OnResize
.resize_end:
mcall SF_REDRAW, SSF_BEGIN_DRAW mcall SF_REDRAW, SSF_BEGIN_DRAW
mcall SF_STYLE_SETTINGS, SSF_GET_SKIN_HEIGHT mcall SF_STYLE_SETTINGS, SSF_GET_SKIN_HEIGHT
lea ecx,[eax + (100 shl 16) +4] lea ecx,[eax + (100 shl 16) + WND_SIZE_Y+4]
add ecx,[Screen_H]
mov edi,title mov edi,title
mov ebx,(100 shl 16)+9 mcall SF_CREATE_WINDOW, <100,WND_SIZE_X+9>,,0x74000000
add ebx,[Screen_W]
mcall SF_CREATE_WINDOW,,,0x73000000
test [proc_info.wnd_state], 0x04 test [proc_info.wnd_state], 0x04
jnz @f jnz @f
xor ebp,ebp xor ebp,ebp
mov ecx,[Screen_W] mcall SF_PUT_IMAGE_EXT, virtual_screen_8,<WND_SIZE_X,WND_SIZE_Y>,<0,0>,8,_palette
shl ecx,16 @@:
add ecx,[Screen_H]
mcall SF_PUT_IMAGE_EXT, [virtual_screen_8],,<0,0>,8,_palette
@@:
mcall SF_REDRAW, SSF_END_DRAW mcall SF_REDRAW, SSF_END_DRAW
jmp .event_loop jmp .event_loop
@@ -154,16 +105,8 @@ init_background:
jne .ib_vertical jne .ib_vertical
ret ret
align 4 s_OFFX = 0
OnResize: s_OFFY = 2
mov ecx,[Screen_W]
imul ecx,[Screen_H]
mcall SF_SYS_MISC,SSF_MEM_REALLOC,,[virtual_screen_8]
mov [virtual_screen_8],eax
ret
s_OFFX = 0
s_OFFY = 2
handle_animation: handle_animation:
sub esp,4 sub esp,4
@@ -177,12 +120,10 @@ handle_animation:
add ebx,ebx add ebx,ebx
mov ax,[sinetable+ebx] mov ax,[sinetable+ebx]
mov [esp+s_OFFX],ax mov [esp+s_OFFX],ax
mov edi,[virtual_screen_8] mov edi,virtual_screen_8
mov edx,[Screen_H] mov edx,WND_SIZE_Y-1
dec edx
.a_ver: .a_ver:
mov ecx,[Screen_W] mov ecx,WND_SIZE_X-1
dec ecx
mov bx,[esp+s_OFFY] mov bx,[esp+s_OFFY]
add bx,dx add bx,dx
and ebx,255 and ebx,255
@@ -201,25 +142,26 @@ handle_animation:
ret ret
DATA DATA
delta_angle dd 0.0245436926066 ; pi/128 delta_angle dd 0.0245436926066 ; pi/128
scale_sin dd 128.0 scale_sin dd 128.0
title db 'MoveBack',0 title db 'MoveBack',0
UDATA UDATA
ver_counter dd ? ver_counter dd ?
hor_counter dd ? hor_counter dd ?
_palette: rd 256 _palette: rd 256
virtual_screen_8 dd ? virtual_screen_8:
rb WND_SIZE_X*WND_SIZE_Y
background: background:
rb 256*256 rb 256*256
sinetable: sinetable:
rw 256 rw 256
proc_info process_information proc_info process_information
KOS_APP_END MEOS_APP_END

View File

@@ -20,7 +20,7 @@ include '../../KOSfuncs.inc'
title db 'Tube - FPU',0 title db 'Tube - FPU',0
SCREEN_W dd 600-10 ;10 px for borders SCREEN_W dd 640-10 ;10 px for borders
SCREEN_H dd 400-10 SCREEN_H dd 400-10
align 4 align 4
@@ -28,8 +28,7 @@ START:
mcall SF_SYS_MISC,SSF_HEAP_INIT mcall SF_SYS_MISC,SSF_HEAP_INIT
call OnResize call OnResize
call draw_window call draw_window
fninit call init_tube
fldz
push ebx push ebx
still: still:
@@ -57,6 +56,8 @@ OnResize:
;ecx = SCREEN_W*SCREEN_H ;ecx = SCREEN_W*SCREEN_H
mcall SF_SYS_MISC,SSF_MEM_REALLOC,,[PIXBUF] mcall SF_SYS_MISC,SSF_MEM_REALLOC,,[PIXBUF]
mov [PIXBUF],eax mov [PIXBUF],eax
mcall SF_SYS_MISC,SSF_MEM_REALLOC,,[buf1]
mov [buf1],eax
lea ecx,[ecx+2*ecx] lea ecx,[ecx+2*ecx]
mcall SF_SYS_MISC,SSF_MEM_REALLOC,,[buf2] mcall SF_SYS_MISC,SSF_MEM_REALLOC,,[buf2]
mov [buf2],eax mov [buf2],eax
@@ -158,14 +159,14 @@ STORE_1:
call display_image call display_image
pop esi ;esi=PIXBUF pop esi
mov ecx,[SCREEN_W] mov ecx,[SCREEN_W]
imul ecx,[SCREEN_H] imul ecx,[SCREEN_H]
align 4 align 4
BLUR: BLUR:
sar byte [esi],2
inc esi inc esi
sar byte [esi],2
loop BLUR loop BLUR
ret ret
@@ -184,15 +185,13 @@ newp:
movzx edx,byte [esi] movzx edx,byte [esi]
shl edx,4 shl edx,4
mov word [edi],dx ;blue,green mov [edi],edx
;shr edx,16
;mov [edi+2],dl ;red - not used
add edi,3 add edi,3
inc esi inc esi
cmp esi,eax cmp esi,eax
jb newp jbe newp
xor edx,edx xor edx,edx
mov ecx,[SCREEN_W] mov ecx,[SCREEN_W]
@@ -254,10 +253,57 @@ align 4
TEXUV: TEXUV:
rd 1 rd 1
align 4
init_tube:
mov ecx,256
mov edi,[buf1]
PAL1:
mov edx,3C8h
mov eax,ecx
inc edx
sar al,1
js PAL2
mul al
shr ax,6
PAL2:
mov al,0
jns PAL3
sub al,cl
shr al,1
shr al,1
PAL3:
mov ebx,ecx
mov [ebx+edi],bh
loop PAL1
mov ecx,256
TEX:
mov bx,cx
add ax,cx
rol ax,cl
mov dh,al
sar dh,5
adc dl,dh
adc dl,[ebx+255+edi]
shr dl,1
mov [ebx+edi],dl
not bh
mov [ebx+edi],dl
loop TEX
fninit
fldz
ret
align 4 align 4
image_end: image_end:
PIXBUF rd 1 PIXBUF rd 1
buf1 rd 1
buf2 rd 1 buf2 rd 1
procinfo process_information procinfo process_information

View File

@@ -1,6 +1,7 @@
; SPDX-License-Identifier: GPL-2.0-only ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> TreeList <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> box_lib.obj
; TreeList: used as a ListBox or Tree control (determined by settings) ; <EFBFBD><EFBFBD> <20><><EFBFBD> <20><EFBFBD><E0A8AC><EFBFBD><EFBFBD><EFBFBD> GPL2 <20><><EFBFBD><E6A5AD><EFBFBD>
; Copyright (C) 2009-2025 IgorA <aie85playm@gmail.com> ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E4A8AA><EFBFBD><EFBFBD> 12.01.2021 IgorA
struct TreeNode struct TreeNode
type dw ? ;+ 0 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><> type dw ? ;+ 0 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><>
@@ -13,52 +14,6 @@ struct TreeNode
ends ends
;input:
; ecx - 0xXX...... font options
;output:
; eax - font height in pixels
align 4
proc get_font_h uses ebx
mov eax,ecx
shr eax,24
bt eax,4
jc @f
bt eax,5
jc @f
mov ebx,9
jmp .siz0
@@:
mov ebx,16
.siz0:
and eax,7
inc eax
imul eax,ebx
ret
endp
;input:
; ecx - 0xXX...... font options
;output:
; eax - font width in pixels
align 4
proc get_font_w uses ebx
mov eax,ecx
shr eax,24
bt eax,4
jc @f
bt eax,5
jc @f
mov ebx,6
jmp .siz0
@@:
mov ebx,8
.siz0:
and eax,7
inc eax
imul eax,ebx
ret
endp
;<3B><EFBFBD><EBA4A5><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᯨ᪠ <20> <20><EFBFBD><E1ADAE><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>樨 (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ;<3B><EFBFBD><EBA4A5><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᯨ᪠ <20> <20><EFBFBD><E1ADAE><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>樨 (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
align 16 align 16
proc tl_data_init uses eax ecx edi, tlist:dword proc tl_data_init uses eax ecx edi, tlist:dword
@@ -508,24 +463,34 @@ proc tl_draw, tlist:dword
cmp tl_capt_cy,9 ;9 - minimum caption height cmp tl_capt_cy,9 ;9 - minimum caption height
jl @f jl @f
call tl_draw_caption_cur_pos mov ebx,edi ;calculate cursor position
mov eax,tl_cur_pos
inc eax
lea edi,[txt_capt_cur.v]
stdcall tl_convert_to_str, 5
mov edi,ebx
mov eax,tl_tim_undo mov eax,tl_tim_undo
or eax,eax
jz @f
mov ebx,edi ;save edi
lea edi,[txt_capt_otm.v] lea edi,[txt_capt_otm.v]
stdcall tl_convert_to_str, 5 stdcall tl_convert_to_str, 5
mov edi,ebx ;restore edi mov edi,ebx ;restore edi
mov eax,SF_DRAW_TEXT ;captions
mov ebx,tl_box_left
shl ebx,16
add ebx,5*65536+3
add ebx,tl_box_top
mov ecx,tl_col_txt
or ecx,0x80000000
lea edx,[txt_capt_cur]
int 0x40
mov ebx,tl_box_left mov ebx,tl_box_left
shl ebx,16 shl ebx,16
add ebx,100*65536+3 add ebx,100*65536+3
mov ecx,tl_col_txt
and ecx,0x00ffffff
or ecx,0x80000000
add ebx,tl_box_top add ebx,tl_box_top
lea edx,[txt_capt_otm] lea edx,[txt_capt_otm]
mcall SF_DRAW_TEXT ;undo int 0x40
@@: @@:
;cycle to nodes ;cycle to nodes
@@ -1198,11 +1163,10 @@ proc tl_draw_node_caption uses ebx ecx edx esi
ror ecx,16 ror ecx,16
mov ebx,ecx mov ebx,ecx
add bx,tl_img_cy ;<3B><><EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E0A0AD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> add bx,tl_img_cy ;<3B><><EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E0A0AD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
sub bx,9 ;<3B><EFBFBD><E2ADA8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E2A5AA><EFBFBD>
mov ecx,tl_col_txt mov ecx,tl_col_txt
call get_font_h and ecx,0xffffff
sub bx,ax ;<3B><EFBFBD><E2ADA8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E2A5AA><EFBFBD> mcall SF_DRAW_TEXT
and ecx,0x37ffffff
mcall SF_DRAW_TEXT ;node text
@@: @@:
ret ret
endp endp
@@ -1215,15 +1179,13 @@ endp
align 4 align 4
proc tl_get_draw_text_len uses eax ecx edx proc tl_get_draw_text_len uses eax ecx edx
mov esi,eax ;<3B><><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> mov esi,eax ;<3B><><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
mov ecx,tl_col_txt
call get_font_w
mov ecx,eax
mov eax,tl_box_left mov eax,tl_box_left
add eax,tl_box_width add eax,tl_box_width
cmp eax,ebx cmp eax,ebx
jle .text_null ;<3B><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><> <20><><EFBFBD><E0A0AD> jle .text_null ;<3B><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><> <20><><EFBFBD><E0A0AD>
sub eax,ebx sub eax,ebx
xor edx,edx xor edx,edx
mov ecx,6 ;<3B><><EFBFBD> <20><><EFBFBD><EFBFBD><E2A5AC><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
div ecx ;ᬮ<>ਬ ᪮<>쪮 ᨬ<><E1A8AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> div ecx ;ᬮ<>ਬ ᪮<>쪮 ᨬ<><E1A8AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD>
cmp esi,eax cmp esi,eax
jl @f jl @f
@@ -1896,8 +1858,10 @@ pushad
.po8: .po8:
call tl_node_move_po8 ;㧫<> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>塞 8 <20><><EFBFBD> call tl_node_move_po8 ;㧫<> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>塞 8 <20><><EFBFBD>
.cur_mov: .cur_mov:
stdcall tl_cur_perv, edi push dword edi
stdcall tl_draw, edi call tl_cur_perv
push dword edi
call tl_draw
@@: @@:
popad popad
ret ret
@@ -2017,11 +1981,10 @@ tl_draw_caption_cur_pos:
add ebx,5*65536+3 add ebx,5*65536+3
add ebx,tl_box_top add ebx,tl_box_top
mov ecx,tl_col_txt mov ecx,tl_col_txt
and ecx,0x00ffffff
or ecx,0xc0000000 ;0x40000000 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E8A8A2><EFBFBD> 䮭 梥⮬ edi or ecx,0xc0000000 ;0x40000000 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E8A8A2><EFBFBD> 䮭 梥⮬ edi
lea edx,[txt_capt_cur] lea edx,[txt_capt_cur]
mov edi,tl_col_zag mov edi,tl_col_zag
mcall SF_DRAW_TEXT ;row number mcall SF_DRAW_TEXT ;captions
popad popad
@@: @@:
ret ret
@@ -2290,6 +2253,6 @@ align 4
jge @f jge @f
or al,0x30 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塞 ᨬ<><E1A8AC><EFBFBD> '0' or al,0x30 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塞 ᨬ<><E1A8AC><EFBFBD> '0'
stosb ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> al <20> <20><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> [edi] stosb ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> al <20> <20><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> [edi]
mov word[edi],' ' ;add space symbol and 0 mov byte[edi],0
@@: @@:
ret ret

View File

@@ -1053,8 +1053,6 @@ endl
test [_flip_kind], FLIP_VERTICAL test [_flip_kind], FLIP_VERTICAL
jz .dont_flip_vert jz .dont_flip_vert
cmp dword [ebx + Image.Height], 2
jl .dont_flip_vert
imul eax, ecx imul eax, ecx
sub eax, [scanline_len] sub eax, [scanline_len]
@@ -1103,8 +1101,6 @@ endl
test [_flip_kind], FLIP_HORIZONTAL test [_flip_kind], FLIP_HORIZONTAL
jz .exit jz .exit
cmp dword [ebx + Image.Width], 2
jl .exit
mov ecx, [ebx + Image.Height] mov ecx, [ebx + Image.Height]
mov eax, [ebx + Image.Type] mov eax, [ebx + Image.Type]

View File

@@ -6,7 +6,7 @@ MK_C_SYM(__ieee754_expf)
fstl %st(1) fstl %st(1)
frndint frndint
fstl %st(2) fstl %st(2)
fsubp fsubrp
f2xm1 f2xm1
fld1 fld1
faddp faddp

View File

@@ -32,6 +32,7 @@ section '.flat' code readable align 16
include "..\..\..\KOSfuncs.inc" include "..\..\..\KOSfuncs.inc"
include "..\..\..\proc32.inc" include "..\..\..\proc32.inc"
include "..\..\..\macros.inc" include "..\..\..\macros.inc"
include "..\..\..\dll.inc"
include "..\..\..\bcc32\include\kos_func.inc" include "..\..\..\bcc32\include\kos_func.inc"
include "..\..\..\bcc32\include\kos_heap.inc" include "..\..\..\bcc32\include\kos_heap.inc"
@@ -43,9 +44,9 @@ include "..\..\..\bcc32\include\kos_heap.inc"
@@StrToInt$qpc equ @StrToInt$qpc @@StrToInt$qpc equ @StrToInt$qpc
@@StrToDouble$qpc equ @StrToDouble$qpc @@StrToDouble$qpc equ @StrToDouble$qpc
mem.alloc dd ? ;memory allocation function mem.alloc dd ? ;функция для выделения памяти
mem.free dd ? ;function to free up memory mem.free dd ? ;функция для освобождения памяти
mem.realloc dd ? ;function for memory reallocation mem.realloc dd ? ;функция для перераспределения памяти
dll.load dd ? dll.load dd ?
PRECISION equ 16 PRECISION equ 16
@@ -53,20 +54,20 @@ NNP_FF_BIN equ 0x6e6962
NNP_FF_JSON equ 0x6e6f736a NNP_FF_JSON equ 0x6e6f736a
struct Layer struct Layer
c_size dd ? ;+ 0 curent size - number of neurons in the current layer c_size dd ? ;+ 0 curent size - число нейронов в текущем слое
n_size dd ? ;+ 4 next size - number of neurons in the next layer n_size dd ? ;+ 4 next size - число нейронов на следующем слое
neurons dd ? ;+ 8 [] neurons dd ? ;+ 8 []
biases dd ? ;+12 [] biases dd ? ;+12 []
weights dd ? ;+16 [][] weights dd ? ;+16 [][]
ends ends
struct NeuralNetwork struct NeuralNetwork
learningRate dq ? ;+ 0 learningRate dq ? ;+ 0 скорость обучения
layers dd ? ;+ 8 [] layers dd ? ;+ 8 [] слои
layers_length dd ? ;+12 number of layers layers_length dd ? ;+12 число слоев
activation dd ? ;+16 pointer to activation function activation dd ? ;+16 указатель на функцию активации
derivative dd ? ;+20 function pointer derivative dd ? ;+20 указатель на функцию
errors dd ? ;+24 array for calculations errors dd ? ;+24 массив для вычислений
errorsNext dd ? ;+28 errorsNext dd ? ;+28
gradients dd ? ;+32 gradients dd ? ;+32
deltas dd ? ;+36 deltas dd ? ;+36
@@ -112,6 +113,11 @@ proc lib_init
mov [mem.free], ebx mov [mem.free], ebx
mov [mem.realloc], ecx mov [mem.realloc], ecx
mov [dll.load], edx mov [dll.load], edx
or edx, edx
jz @f
invoke dll.load, @IMPORT
@@:
ret ret
endp endp
@@ -131,21 +137,6 @@ Math_random:
@@: @@:
db 0,0,128,55 ;dd 1.0/65536.0 db 0,0,128,55 ;dd 1.0/65536.0
align 16
ieee754_exp:
fld qword[esp+4]
fldl2e ;push log2(e) onto stack
fmulp
fst st1 ;copies st0 to st1
frndint ;round to integer
fst st2 ;copies st0 to st2
fsubp ;subtraction with stack pop
f2xm1 ;raises 2 to the power st0 and subtracts 1
fld1
faddp
fscale ;scale by powers of two
ret
align 16 align 16
sigmoid: sigmoid:
push ebp push ebp
@@ -154,7 +145,7 @@ sigmoid:
fld qword[ebp+8] fld qword[ebp+8]
fchs fchs
fstp qword[esp] fstp qword[esp]
call ieee754_exp call dword[_exp]
add esp,8 add esp,8
fadd dword[f_1_0] fadd dword[f_1_0]
fdivr dword[f_1_0] fdivr dword[f_1_0]
@@ -199,7 +190,7 @@ Layer_Create:
mov dword[esi+Layer.weights],eax mov dword[esi+Layer.weights],eax
xor ebx,ebx xor ebx,ebx
cmp edi,ebx cmp edi,ebx
jbe .end_f jbe .end_f
@@: @@:
mov eax,[ebp+16] mov eax,[ebp+16]
shl eax,3 shl eax,3
@@ -259,18 +250,18 @@ NNP_Create:
mov eax,[ebp+28] ;sizes mov eax,[ebp+28] ;sizes
lea edx,[eax+4] lea edx,[eax+4]
mov dword[ebp-8],edx ;save &sizes[i+1] mov dword[ebp-8],edx ;save &sizes[i+1]
jmp .3 jmp .150
.cycle_0: ;for (i=0; i < sizes_length; i++) .cycle_0: ;for (i=0; i < sizes_length; i++)
xor ecx,ecx xor ecx,ecx
mov dword[ebp-4],ecx ;nextSize = 0 mov dword[ebp-4],ecx ;nextSize = 0
mov eax,[ebp+32] ;sizes_length mov eax,[ebp+32] ;sizes_length
dec eax dec eax
cmp edi,eax cmp edi,eax
jae @f jae .152
mov edx,[ebp-8] mov edx,[ebp-8]
mov ecx,[edx] mov ecx,[edx]
mov dword[ebp-4],ecx ;nextSize = sizes[i+1] mov dword[ebp-4],ecx ;nextSize = sizes[i+1]
@@: .152:
mov eax,[ebp-4] mov eax,[ebp-4]
push eax push eax
mov edx,[ebp-8] mov edx,[ebp-8]
@@ -286,7 +277,7 @@ NNP_Create:
mov eax,[ebp-8] mov eax,[ebp-8]
lea edx,[eax-4] lea edx,[eax-4]
mov dword[ebp-12],edx ;save &sizes[i] mov dword[ebp-12],edx ;save &sizes[i]
jmp .2 jmp .154
.cycle_1: ;for (j=0; j < sizes[i]; j++) .cycle_1: ;for (j=0; j < sizes[i]; j++)
call Math_random call Math_random
fmul dword[f_2_0] fmul dword[f_2_0]
@@ -299,7 +290,7 @@ NNP_Create:
fstp qword[ecx+8*esi] fstp qword[ecx+8*esi]
xor ebx,ebx ;k=0 xor ebx,ebx ;k=0
cmp ebx,[ebp-4] cmp ebx,[ebp-4]
jae .1 jae .157
@@: ;for (k=0; k < nextSize; k++) @@: ;for (k=0; k < nextSize; k++)
call Math_random call Math_random
fmul dword[f_2_0] fmul dword[f_2_0]
@@ -314,15 +305,15 @@ NNP_Create:
inc ebx inc ebx
cmp ebx,[ebp-4] cmp ebx,[ebp-4]
jb @b jb @b
.1: .157:
inc esi inc esi
.2: .154:
mov ecx,[ebp-12] mov ecx,[ebp-12]
cmp esi,[ecx] cmp esi,[ecx]
jb .cycle_1 jb .cycle_1
inc edi inc edi
add dword[ebp-8],4 add dword[ebp-8],4
.3: .150:
cmp edi,[ebp+32] ;sizes_length cmp edi,[ebp+32] ;sizes_length
jb .cycle_0 jb .cycle_0
;create errors array ;create errors array
@@ -358,7 +349,7 @@ f_2_0:
f_1_0: f_1_0:
dd 1.0 dd 1.0
;random number filling ;заполнение случайными числами
;+ 8 NeuralNetwork* o ;+ 8 NeuralNetwork* o
align 16 align 16
NNP_Reset: NNP_Reset:
@@ -422,7 +413,7 @@ NNP_Reset:
pop ebp pop ebp
ret 4 ret 4
;calculation of input and output neurons ;расчет входных и выходных нейронов
;+ 8 NeuralNetwork* o ;+ 8 NeuralNetwork* o
;+12 double* inputs ;+12 double* inputs
align 16 align 16
@@ -517,7 +508,7 @@ NNP_BackPropagation:
add edi,[esi+NeuralNetwork.layers] add edi,[esi+NeuralNetwork.layers]
xor ebx,ebx ;i=0 xor ebx,ebx ;i=0
mov eax,[ebp+12] ;eax = targets[] mov eax,[ebp+12] ;eax = targets[]
jmp .1 jmp .180
align 4 align 4
.cycle_0: .cycle_0:
mov edx,[edi+Layer.neurons] mov edx,[edi+Layer.neurons]
@@ -527,7 +518,7 @@ align 4
fstp qword[ecx+8*ebx] fstp qword[ecx+8*ebx]
inc ebx inc ebx
add eax,8 add eax,8
.1: .180:
cmp ebx,[edi+Layer.c_size] cmp ebx,[edi+Layer.c_size]
jb .cycle_0 jb .cycle_0
dec dword[ebp-4] ;k-- dec dword[ebp-4] ;k--
@@ -537,7 +528,7 @@ align 4
.cycle_1: .cycle_1:
sub edi,sizeof.Layer sub edi,sizeof.Layer
xor ebx,ebx ;i=0 xor ebx,ebx ;i=0
jmp .2 jmp .186
align 4 align 4
.cycle_2: .cycle_2:
mov eax,[edi+sizeof.Layer+Layer.neurons] mov eax,[edi+sizeof.Layer+Layer.neurons]
@@ -550,12 +541,12 @@ align 4
mov edx,[esi+NeuralNetwork.gradients] mov edx,[esi+NeuralNetwork.gradients]
fstp qword[edx+8*ebx] fstp qword[edx+8*ebx]
inc ebx inc ebx
.2: .186:
cmp ebx,[edi+sizeof.Layer+Layer.c_size] cmp ebx,[edi+sizeof.Layer+Layer.c_size]
jb .cycle_2 jb .cycle_2
mov edx,[esi+NeuralNetwork.deltas] mov edx,[esi+NeuralNetwork.deltas]
xor ebx,ebx xor ebx,ebx
jmp .3 jmp .189
align 4 align 4
.cycle_3: .cycle_3:
mov eax,[edi+Layer.c_size] mov eax,[edi+Layer.c_size]
@@ -565,7 +556,7 @@ align 4
pop ecx pop ecx
mov dword[edx],eax mov dword[edx],eax
xor eax,eax ;j=0 xor eax,eax ;j=0
jmp @f jmp .191
align 4 align 4
.cycle_4: .cycle_4:
mov ecx,[esi+NeuralNetwork.gradients] mov ecx,[esi+NeuralNetwork.gradients]
@@ -575,16 +566,16 @@ align 4
mov ecx,[edx] mov ecx,[edx]
fstp qword[ecx+8*eax] fstp qword[ecx+8*eax]
inc eax inc eax
@@: .191:
cmp eax,[edi+Layer.c_size] cmp eax,[edi+Layer.c_size]
jb .cycle_4 jb .cycle_4
inc ebx inc ebx
add edx,4 add edx,4
.3: .189:
cmp ebx,[edi+sizeof.Layer+Layer.c_size] cmp ebx,[edi+sizeof.Layer+Layer.c_size]
jb .cycle_3 jb .cycle_3
xor ebx,ebx xor ebx,ebx
jmp .4 jmp .195
align 4 align 4
.cycle_5: .cycle_5:
mov eax,[esi+NeuralNetwork.errorsNext] mov eax,[esi+NeuralNetwork.errorsNext]
@@ -592,7 +583,7 @@ align 4
mov dword[eax+8*ebx],edx mov dword[eax+8*ebx],edx
mov dword[eax+8*ebx+4],edx mov dword[eax+8*ebx+4],edx
xor eax,eax ;j=0 xor eax,eax ;j=0
jmp @f jmp .197
align 4 align 4
.cycle_6: .cycle_6:
mov edx,[edi+Layer.weights] mov edx,[edi+Layer.weights]
@@ -604,11 +595,11 @@ align 4
fadd qword[ecx+8*ebx] fadd qword[ecx+8*ebx]
fstp qword[ecx+8*ebx] fstp qword[ecx+8*ebx]
inc eax inc eax
@@: .197:
cmp eax,[edi+sizeof.Layer+Layer.c_size] cmp eax,[edi+sizeof.Layer+Layer.c_size]
jb .cycle_6 jb .cycle_6
inc ebx inc ebx
.4: .195:
cmp ebx,[edi] cmp ebx,[edi]
jb .cycle_5 jb .cycle_5
;copy errors to next level ;copy errors to next level
@@ -619,7 +610,7 @@ align 4
mov eax,[esi+NeuralNetwork.deltas] mov eax,[esi+NeuralNetwork.deltas]
mov dword[ebp-12],eax mov dword[ebp-12],eax
xor ebx,ebx ;i=0 xor ebx,ebx ;i=0
jmp .6 jmp .201
align 4 align 4
.cycle_7: .cycle_7:
mov ecx,[esi+NeuralNetwork.gradients] mov ecx,[esi+NeuralNetwork.gradients]
@@ -629,7 +620,7 @@ align 4
fstp qword[eax+8*ebx] fstp qword[eax+8*ebx]
xor eax,eax ;j=0 xor eax,eax ;j=0
mov edx,[ebp-12] ;edx = deltas[i] mov edx,[ebp-12] ;edx = deltas[i]
jmp .5 jmp .203
align 4 align 4
.cycle_8: .cycle_8:
; mov ecx,[edx] ; mov ecx,[edx]
@@ -665,7 +656,7 @@ align 4
; pop edx ; pop edx
;@@: ;@@:
inc eax inc eax
.5: .203:
cmp eax,[edi+Layer.c_size] cmp eax,[edi+Layer.c_size]
jb .cycle_8 jb .cycle_8
mov eax,[ebp-12] mov eax,[ebp-12]
@@ -673,7 +664,7 @@ align 4
pop ecx pop ecx
inc ebx inc ebx
add dword[ebp-12],4 add dword[ebp-12],4
.6: .201:
cmp ebx,[edi+sizeof.Layer+Layer.c_size] cmp ebx,[edi+sizeof.Layer+Layer.c_size]
jb .cycle_7 jb .cycle_7
dec dword[ebp-4] dec dword[ebp-4]
@@ -702,7 +693,8 @@ NNP_GetMemData:
jne .end_f jne .end_f
mov esi,[ebp+16] mov esi,[ebp+16]
mov byte[esi],0 mov byte[esi],0
stdcall str_cat, esi,txt_QlearningRateQ_ stdcall [_strcat], esi,txt_QlearningRateQ_
add esp,8
push 1 push 1
push PRECISION push PRECISION
mov eax,[ebp+8] mov eax,[ebp+8]
@@ -710,9 +702,12 @@ NNP_GetMemData:
push dword[eax+NeuralNetwork.learningRate] push dword[eax+NeuralNetwork.learningRate]
call @@DoubleToStr$qduso call @@DoubleToStr$qduso
add esp,16 add esp,16
stdcall str_cat, esi,eax stdcall [_strcat], esi,eax
stdcall str_cat, esi,txt_zap_nl add esp,8
stdcall str_cat, esi,txt_Qlayers_lengthQ stdcall [_strcat], esi,txt_zap_nl
add esp,8
stdcall [_strcat], esi,txt_Qlayers_lengthQ
add esp,8
push 1 push 1
push 0 push 0
mov ecx,[ebp+8] mov ecx,[ebp+8]
@@ -721,18 +716,23 @@ NNP_GetMemData:
fstp qword[esp] fstp qword[esp]
call @@DoubleToStr$qduso call @@DoubleToStr$qduso
add esp,16 add esp,16
stdcall str_cat, esi,eax stdcall [_strcat], esi,eax
stdcall str_cat, esi,txt_zap_nl add esp,8
stdcall str_cat, esi,txt_QlayersQ stdcall [_strcat], esi,txt_zap_nl
add esp,8
.230:
stdcall [_strcat], esi,txt_QlayersQ
add esp,8
xor edi,edi ;i=0 xor edi,edi ;i=0
jmp .7 jmp .232
align 4 align 4
.cycle_0: .cycle_0:
push esi push esi
call @@strlen$qpxc call @@strlen$qpxc
pop ecx pop ecx
add esi,eax add esi,eax
stdcall str_cat, esi,txt_nl_t_Qc_sizeQ stdcall [_strcat], esi,txt_nl_t_Qc_sizeQ
add esp,8
mov ebx,edi mov ebx,edi
imul ebx,sizeof.Layer imul ebx,sizeof.Layer
push 1 push 1
@@ -748,8 +748,10 @@ align 4
fstp qword[esp] fstp qword[esp]
call @@DoubleToStr$qduso call @@DoubleToStr$qduso
add esp,16 add esp,16
stdcall str_cat, esi,eax stdcall [_strcat], esi,eax
stdcall str_cat, esi,txt_zap_nl_t_Qn_sizeQ add esp,8
stdcall [_strcat], esi,txt_zap_nl_t_Qn_sizeQ
add esp,8
push 1 push 1
push 0 push 0
mov ecx,[ebp+8] mov ecx,[ebp+8]
@@ -763,17 +765,21 @@ align 4
fstp qword[esp] fstp qword[esp]
call @@DoubleToStr$qduso call @@DoubleToStr$qduso
add esp,16 add esp,16
stdcall str_cat, esi,eax stdcall [_strcat], esi,eax
stdcall str_cat, esi,txt_zap_nl add esp,8
stdcall str_cat, esi,txt_t_QneuronsQ stdcall [_strcat], esi,txt_zap_nl
add esp,8
stdcall [_strcat], esi,txt_t_QneuronsQ
add esp,8
xor ebx,ebx ;j=0 xor ebx,ebx ;j=0
jmp .1 jmp .234
align 4 align 4
.cycle_1: .cycle_1:
test ebx,ebx test ebx,ebx
je @f je .235
stdcall str_cat, esi,txt_zap_sp stdcall [_strcat], esi,txt_zap_sp
@@: add esp,8
.235:
push 1 push 1
push PRECISION push PRECISION
mov eax,edi mov eax,edi
@@ -785,25 +791,29 @@ align 4
push dword[eax+8*ebx] push dword[eax+8*ebx]
call @@DoubleToStr$qduso call @@DoubleToStr$qduso
add esp,16 add esp,16
stdcall str_cat, esi,eax stdcall [_strcat], esi,eax
add esp,8
inc ebx inc ebx
.1: .234:
mov ecx,edi mov ecx,edi
imul ecx,sizeof.Layer imul ecx,sizeof.Layer
mov eax,[ebp+8] mov eax,[ebp+8]
add ecx,[eax+NeuralNetwork.layers] add ecx,[eax+NeuralNetwork.layers]
cmp ebx,[ecx+Layer.c_size] cmp ebx,[ecx+Layer.c_size]
jb .cycle_1 jb .cycle_1
stdcall str_cat, esi,txt_sqbr_zap_nl stdcall [_strcat], esi,txt_sqbr_zap_nl
stdcall str_cat, esi,txt_t_QbiasesQ add esp,8
stdcall [_strcat], esi,txt_t_QbiasesQ
add esp,8
xor ebx,ebx ;j=0 xor ebx,ebx ;j=0
jmp .2 jmp .238
align 4 align 4
.cycle_2: .cycle_2:
test ebx,ebx test ebx,ebx
je @f je .239
stdcall str_cat, esi,txt_zap_sp stdcall [_strcat], esi,txt_zap_sp
@@: add esp,8
.239:
push 1 push 1
push PRECISION push PRECISION
mov eax,edi mov eax,edi
@@ -815,38 +825,43 @@ align 4
push dword[eax+8*ebx] push dword[eax+8*ebx]
call @@DoubleToStr$qduso call @@DoubleToStr$qduso
add esp,16 add esp,16
stdcall str_cat, esi,eax stdcall [_strcat], esi,eax
add esp,8
inc ebx inc ebx
.2: .238:
mov ecx,edi mov ecx,edi
imul ecx,sizeof.Layer imul ecx,sizeof.Layer
mov eax,[ebp+8] mov eax,[ebp+8]
add ecx,[eax+NeuralNetwork.layers] add ecx,[eax+NeuralNetwork.layers]
cmp ebx,[ecx+Layer.c_size] cmp ebx,[ecx+Layer.c_size]
jb .cycle_2 jb .cycle_2
stdcall str_cat, esi,txt_sqbr_zap_t_QweightsQ stdcall [_strcat], esi,txt_sqbr_zap_t_QweightsQ
add esp,8
mov eax,[ebp+8] mov eax,[ebp+8]
mov ecx,edi mov ecx,edi
imul ecx,sizeof.Layer imul ecx,sizeof.Layer
add ecx,[eax+NeuralNetwork.layers] add ecx,[eax+NeuralNetwork.layers]
cmp dword[ecx+Layer.n_size],0 cmp dword[ecx+Layer.n_size],0
je .6 je .241
xor ebx,ebx xor ebx,ebx
jmp .5 jmp .243
.cycle_3: .242:
test ebx,ebx test ebx,ebx
je @f je .244
stdcall str_cat, esi,txt_zap_nl_t_t stdcall [_strcat], esi,txt_zap_nl_t_t
@@: add esp,8
stdcall str_cat, esi,txt_sqbro .244:
stdcall [_strcat], esi,txt_sqbro
add esp,8
xor eax,eax xor eax,eax
mov dword[ebp-4],eax mov dword[ebp-4],eax
jmp .4 jmp .246
.3: .245:
cmp dword[ebp-4],0 cmp dword[ebp-4],0
je @f je .247
stdcall str_cat, esi,txt_zap_sp stdcall [_strcat], esi,txt_zap_sp
@@: add esp,8
.247:
push 1 push 1
push PRECISION push PRECISION
mov edx,edi mov edx,edi
@@ -860,39 +875,43 @@ align 4
push dword[ecx+8*eax] push dword[ecx+8*eax]
@@: @@:
call @@DoubleToStr$qduso call @@DoubleToStr$qduso
dec dword[esp+8] ;decrease PRECISION dec dword[esp+8] ;уменьшаем PRECISION
jz @f ;to avoid looping jz @f ;для избежания зацикливания
cmp word[eax],'#' cmp word[eax],'#'
je @b ;if the number does not fit, we try to translate with less precision je @b ;если число не поместилось пробуем перевести с меньшей точностью
@@: @@:
add esp,16 add esp,16
stdcall str_cat, esi,eax stdcall [_strcat], esi,eax
add esp,8
inc dword[ebp-4] inc dword[ebp-4]
.4: .246:
mov ecx,edi mov ecx,edi
imul ecx,sizeof.Layer imul ecx,sizeof.Layer
mov eax,[ebp+8] mov eax,[ebp+8]
add ecx,[eax+NeuralNetwork.layers] add ecx,[eax+NeuralNetwork.layers]
mov ecx,[ecx+Layer.n_size] mov ecx,[ecx+Layer.n_size]
cmp ecx,[ebp-4] cmp ecx,[ebp-4]
ja .3 ja .245
stdcall str_cat, esi,txt_sqbr stdcall [_strcat], esi,txt_sqbr
add esp,8
inc ebx inc ebx
.5: .243:
mov eax,edi mov eax,edi
imul eax,sizeof.Layer imul eax,sizeof.Layer
mov ecx,[ebp+8] mov ecx,[ebp+8]
add eax,[ecx+NeuralNetwork.layers] add eax,[ecx+NeuralNetwork.layers]
cmp ebx,[eax+Layer.c_size] cmp ebx,[eax+Layer.c_size]
jb .cycle_3 jb .242
.6: .241:
stdcall str_cat, esi,txt_sqbr_fbr_zap stdcall [_strcat], esi,txt_sqbr_fbr_zap
add esp,8
inc edi inc edi
.7: .232:
mov eax,[ebp+8] mov eax,[ebp+8]
cmp edi,[eax+NeuralNetwork.layers_length] cmp edi,[eax+NeuralNetwork.layers_length]
jb .cycle_0 jb .cycle_0
stdcall str_cat, esi,txt_nl_t_sqbr stdcall [_strcat], esi,txt_nl_t_sqbr
add esp,8
.end_f: .end_f:
pop edi esi ebx pop edi esi ebx
mov esp,ebp mov esp,ebp
@@ -944,11 +963,12 @@ NNP_SetMemData:
mov eax,[ebp+16] mov eax,[ebp+16]
mov edx,[ebp+12] mov edx,[ebp+12]
; cmp edx,NNP_FF_BIN ; cmp edx,NNP_FF_BIN
; jne @f ; jne .191
;... ;...
;@@: ;.191:
cmp edx,NNP_FF_JSON cmp edx,NNP_FF_JSON
jne .9 jne .198
.199:
stdcall @@strstr$qpxct1, eax,txt_learningRate stdcall @@strstr$qpxct1, eax,txt_learningRate
add esp,8 add esp,8
mov esi,eax mov esi,eax
@@ -956,27 +976,27 @@ NNP_SetMemData:
add esp,8 add esp,8
mov esi,eax mov esi,eax
test esi,esi test esi,esi
jne @f jne .200
mov eax,1 mov eax,1
jmp .end_f jmp .193
@@: .200:
stdcall @@strchr$qpxci, esi,':' stdcall @@strchr$qpxci, esi,':'
add esp,8 add esp,8
mov ebx,eax mov ebx,eax
test ebx,ebx test ebx,ebx
jne @f jne .201
mov eax,2 mov eax,2
jmp .end_f jmp .193
@@: .201:
inc ebx inc ebx
stdcall @@strchr$qpxci, esi,',' stdcall @@strchr$qpxci, esi,','
add esp,8 add esp,8
mov esi,eax mov esi,eax
test esi,esi test esi,esi
jne @f jne .202
mov eax,3 mov eax,3
jmp .end_f jmp .193
@@: .202:
mov byte[esi],0 mov byte[esi],0
inc esi inc esi
stdcall @@StrToInt$qpc, ebx stdcall @@StrToInt$qpc, ebx
@@ -988,38 +1008,38 @@ NNP_SetMemData:
mov eax,[ebp+8] mov eax,[ebp+8]
mov edx,[eax+12] mov edx,[eax+12]
cmp edx,[ebp-4] cmp edx,[ebp-4]
je @f je .203
mov eax,txt_err_layers_neq mov eax,txt_err_layers_neq
jmp .end_f jmp .193
@@: .203:
xor edi,edi ;i=0 xor edi,edi ;i=0
jmp .8 jmp .205
.cycle_0: ;for(i=0;i<o->layers_length;i++) .204: ;for(i=0;i<o->layers_length;i++)
stdcall @@strstr$qpxct1, esi,txt_c_size stdcall @@strstr$qpxct1, esi,txt_c_size
add esp,8 add esp,8
mov esi,eax mov esi,eax
test esi,esi test esi,esi
jne @f jne .206
mov eax,txt_err_c_size mov eax,txt_err_c_size
jmp .end_f jmp .193
@@: .206:
stdcall @@strchr$qpxci, esi,':' stdcall @@strchr$qpxci, esi,':'
add esp,8 add esp,8
mov ebx,eax mov ebx,eax
test ebx,ebx test ebx,ebx
jne @f jne .207
mov eax,6 mov eax,6
jmp .end_f jmp .193
@@: .207:
inc ebx inc ebx
stdcall @@strchr$qpxci, esi,',' stdcall @@strchr$qpxci, esi,','
add esp,8 add esp,8
mov esi,eax mov esi,eax
test esi,esi test esi,esi
jne @f jne .208
mov eax,7 mov eax,7
jmp .end_f jmp .193
@@: .208:
mov byte[esi],0 mov byte[esi],0
inc esi inc esi
stdcall @@StrToInt$qpc, ebx stdcall @@StrToInt$qpc, ebx
@@ -1029,27 +1049,27 @@ NNP_SetMemData:
add esp,8 add esp,8
mov esi,eax mov esi,eax
test esi,esi test esi,esi
jne @f jne .209
mov eax,8 mov eax,8
jmp .end_f jmp .193
@@: .209:
stdcall @@strchr$qpxci, esi,':' stdcall @@strchr$qpxci, esi,':'
add esp,8 add esp,8
mov ebx,eax mov ebx,eax
test ebx,ebx test ebx,ebx
jne @f jne .210
mov eax,9 mov eax,9
jmp .end_f jmp .193
@@: .210:
inc ebx inc ebx
stdcall @@strchr$qpxci, esi,',' stdcall @@strchr$qpxci, esi,','
add esp,8 add esp,8
mov esi,eax mov esi,eax
test esi,esi test esi,esi
jne @f jne .211
mov eax,10 mov eax,10
jmp .end_f jmp .193
@@: .211:
mov byte[esi],0 mov byte[esi],0
inc esi inc esi
stdcall @@StrToInt$qpc,ebx stdcall @@StrToInt$qpc,ebx
@@ -1061,11 +1081,11 @@ NNP_SetMemData:
add eax,[edx+NeuralNetwork.layers] add eax,[edx+NeuralNetwork.layers]
mov edx,[eax+Layer.c_size] mov edx,[eax+Layer.c_size]
cmp edx,[ebp-4] cmp edx,[ebp-4]
jne @f jne .213
mov edx,[eax+Layer.n_size] mov edx,[eax+Layer.n_size]
cmp edx,[ebp-8] cmp edx,[ebp-8]
je .1 je .214
@@: .213:
mov ecx,[ebp+8] mov ecx,[ebp+8]
stdcall NNP_GetMaxLLen,ecx stdcall NNP_GetMaxLLen,ecx
mov ecx,edi mov ecx,edi
@@ -1086,10 +1106,10 @@ NNP_SetMemData:
add eax,edx add eax,edx
stdcall Layer_Create,eax stdcall Layer_Create,eax
cmp ebx,[ebp-4] ;if(n>s || k>s) cmp ebx,[ebp-4] ;if(n>s || k>s)
jb @f jb .215
cmp ebx,[ebp-8] cmp ebx,[ebp-8]
jae .1 jae .214
@@: .215:
mov edx,[ebp+8] mov edx,[ebp+8]
mov ecx,[edx+NeuralNetwork.errors] mov ecx,[edx+NeuralNetwork.errors]
cmp ecx,[edx+NeuralNetwork.errorsNext] cmp ecx,[edx+NeuralNetwork.errorsNext]
@@ -1115,45 +1135,45 @@ NNP_SetMemData:
stdcall [mem.realloc], [edx+NeuralNetwork.deltas],ebx stdcall [mem.realloc], [edx+NeuralNetwork.deltas],ebx
mov edx,[ebp+8] mov edx,[ebp+8]
mov dword[edx+NeuralNetwork.deltas],eax mov dword[edx+NeuralNetwork.deltas],eax
.1: .214:
stdcall @@strstr$qpxct1, esi,txt_biases stdcall @@strstr$qpxct1, esi,txt_biases
add esp,8 add esp,8
mov esi,eax mov esi,eax
test esi,esi test esi,esi
jne @f jne .216
mov eax,11 mov eax,11
jmp .end_f jmp .193
@@: .216:
stdcall @@strchr$qpxci, esi,'[' stdcall @@strchr$qpxci, esi,'['
add esp,8 add esp,8
mov ebx,eax mov ebx,eax
test ebx,ebx test ebx,ebx
jne @f jne .217
mov eax,txt_err_sqbrl_b1 mov eax,txt_err_sqbrl_b1
jmp .end_f jmp .193
@@: .217:
inc ebx inc ebx
xor edx,edx xor edx,edx
mov dword[ebp-8],edx mov dword[ebp-8],edx
jmp .4 jmp .219
.2: .218:
dec edx dec edx
cmp eax,edx cmp eax,edx
jae @f jae .220
stdcall @@strchr$qpxci, ebx,',' stdcall @@strchr$qpxci, ebx,','
add esp,8 add esp,8
mov esi,eax mov esi,eax
jmp .3 jmp .221
@@: .220:
stdcall @@strchr$qpxci, ebx,']' stdcall @@strchr$qpxci, ebx,']'
add esp,8 add esp,8
mov esi,eax mov esi,eax
.3: .221:
test esi,esi test esi,esi
jne @f jne .222
mov eax,13 mov eax,13
jmp .end_f jmp .193
@@: .222:
mov byte[esi],0 mov byte[esi],0
stdcall @@StrToDouble$qpc,ebx stdcall @@StrToDouble$qpc,ebx
pop ecx pop ecx
@@ -1166,7 +1186,7 @@ NNP_SetMemData:
mov edx,[eax+edx+Layer.biases] mov edx,[eax+edx+Layer.biases]
fstp qword[edx+8*ecx] fstp qword[edx+8*ecx]
inc dword[ebp-8] inc dword[ebp-8]
.4: .219:
mov edx,edi mov edx,edi
imul edx,sizeof.Layer imul edx,sizeof.Layer
mov ecx,[ebp+8] mov ecx,[ebp+8]
@@ -1174,29 +1194,29 @@ NNP_SetMemData:
mov edx,[edx+Layer.c_size] mov edx,[edx+Layer.c_size]
mov eax,[ebp-8] mov eax,[ebp-8]
cmp edx,eax cmp edx,eax
ja .2 ja .218
mov esi,ebx mov esi,ebx
stdcall @@strstr$qpxct1, esi,txt_weights stdcall @@strstr$qpxct1, esi,txt_weights
add esp,8 add esp,8
mov esi,eax mov esi,eax
test esi,esi test esi,esi
jne @f jne .224
mov eax,14 mov eax,14
jmp .end_f jmp .193
@@: .224:
stdcall @@strchr$qpxci, esi,'[' stdcall @@strchr$qpxci, esi,'['
add esp,8 add esp,8
mov esi,eax mov esi,eax
test esi,esi test esi,esi
jne @f jne .225
mov eax,txt_err_sqbrl_w1 mov eax,txt_err_sqbrl_w1
jmp .end_f jmp .193
@@: .225:
inc esi inc esi
xor edx,edx xor edx,edx
mov dword[ebp-8],edx ;k=0 mov dword[ebp-8],edx ;k=0
jmp .7 jmp .227
.cycle_1: ;for(k=0;k<o->layers[i].c_size;k++) .226: ;for(k=0;k<o->layers[i].c_size;k++)
mov eax,edi mov eax,edi
imul eax,sizeof.Layer imul eax,sizeof.Layer
@@ -1206,39 +1226,39 @@ NNP_SetMemData:
or eax,eax or eax,eax
jnz .end_null_we jnz .end_null_we
inc dword[ebp-8] ;k++ inc dword[ebp-8] ;k++
jmp .7 ;if 'weights' is null array jmp .227 ;if 'weights' is null array
.end_null_we: .end_null_we:
stdcall @@strchr$qpxci, esi,'[' stdcall @@strchr$qpxci, esi,'['
add esp,8 add esp,8
mov ebx,eax mov ebx,eax
test ebx,ebx test ebx,ebx
jne @f jne .228
mov eax,txt_err_sqbrl_w2 mov eax,txt_err_sqbrl_w2
jmp .end_f jmp .193
@@: .228:
inc ebx inc ebx
xor edx,edx xor edx,edx
mov dword[ebp-12],edx ;j=0 mov dword[ebp-12],edx ;j=0
jmp .6 jmp .230
.cycle_2: ;for(j=0;j<o->layers[i].n_size;j++) .229: ;for(j=0;j<o->layers[i].n_size;j++)
dec edx dec edx
cmp eax,edx ;eax = j, edx = n_size-1 cmp eax,edx ;eax = j, edx = n_size-1
jae @f jae .231
stdcall @@strchr$qpxci, ebx,',' stdcall @@strchr$qpxci, ebx,','
add esp,8 add esp,8
mov esi,eax mov esi,eax
jmp .5 jmp .232
@@: .231:
stdcall @@strchr$qpxci, ebx,']' stdcall @@strchr$qpxci, ebx,']'
add esp,8 add esp,8
mov esi,eax mov esi,eax
.5: .232:
test esi,esi test esi,esi
jne @f jne .233
mov eax,txt_err_sqbrr_w2 mov eax,txt_err_sqbrr_w2
jmp .end_f jmp .193
@@: .233:
mov byte[esi],0 mov byte[esi],0
stdcall @@StrToDouble$qpc,ebx stdcall @@StrToDouble$qpc,ebx
pop ecx pop ecx
@@ -1253,7 +1273,7 @@ NNP_SetMemData:
mov edx,[ebp-12] mov edx,[ebp-12]
fstp qword[eax+8*edx] fstp qword[eax+8*edx]
inc dword[ebp-12] inc dword[ebp-12]
.6: .230:
mov edx,edi mov edx,edi
imul edx,sizeof.Layer imul edx,sizeof.Layer
mov ecx,[ebp+8] mov ecx,[ebp+8]
@@ -1261,27 +1281,27 @@ NNP_SetMemData:
mov edx,[edx+Layer.n_size] mov edx,[edx+Layer.n_size]
mov eax,[ebp-12] mov eax,[ebp-12]
cmp edx,eax cmp edx,eax
ja .cycle_2 ja .229
mov esi,ebx mov esi,ebx
inc dword[ebp-8] inc dword[ebp-8]
.7: .227:
mov eax,edi mov eax,edi
imul eax,sizeof.Layer imul eax,sizeof.Layer
mov edx,[ebp+8] mov edx,[ebp+8]
add eax,[edx+NeuralNetwork.layers] add eax,[edx+NeuralNetwork.layers]
mov eax,[eax+Layer.c_size] mov eax,[eax+Layer.c_size]
cmp eax,[ebp-8] cmp eax,[ebp-8]
ja .cycle_1 ja .226
inc edi inc edi
.8: .205:
mov edx,[ebp+8] mov edx,[ebp+8]
cmp edi,[edx+NeuralNetwork.layers_length] cmp edi,[edx+NeuralNetwork.layers_length]
jb .cycle_0 jb .204
xor eax,eax xor eax,eax
jmp .end_f jmp .193
.9: .198:
mov eax,1000 mov eax,1000
.end_f: .193:
pop edi esi ebx pop edi esi ebx
mov esp,ebp mov esp,ebp
pop ebp pop ebp
@@ -1300,19 +1320,20 @@ Layer_Destroy:
call @$bdele$qpv call @$bdele$qpv
pop ecx pop ecx
xor ebx,ebx xor ebx,ebx
jmp @f jmp .143
.cycle_1: .142:
mov eax,[esi+Layer.weights] mov eax,[esi+Layer.weights]
push dword[eax+4*ebx] push dword[eax+4*ebx]
call @$bdele$qpv call @$bdele$qpv
pop ecx pop ecx
inc ebx inc ebx
@@: .143:
cmp ebx,[esi+Layer.c_size] cmp ebx,[esi+Layer.c_size]
jb .cycle_1 jb .142
push dword[esi+Layer.weights] push dword[esi+Layer.weights]
call @$bdele$qpv call @$bdele$qpv
pop ecx pop ecx
.145:
pop esi ebx ebp pop esi ebx ebp
ret 4 ret 4
@@ -1323,17 +1344,17 @@ NNP_Destroy:
push ebx esi push ebx esi
mov esi,[ebp+8] mov esi,[ebp+8]
xor ebx,ebx xor ebx,ebx
jmp @f jmp .232
.cycle_1: .231:
mov eax,ebx mov eax,ebx
imul eax,sizeof.Layer imul eax,sizeof.Layer
add eax,[esi+NeuralNetwork.layers] add eax,[esi+NeuralNetwork.layers]
push eax push eax
call Layer_Destroy call Layer_Destroy
inc ebx inc ebx
@@: .232:
cmp ebx,[esi+NeuralNetwork.layers_length] cmp ebx,[esi+NeuralNetwork.layers_length]
jb .cycle_1 jb .231
push dword[esi+NeuralNetwork.layers] push dword[esi+NeuralNetwork.layers]
call @$bdele$qpv call @$bdele$qpv
pop ecx pop ecx
@@ -1377,3 +1398,14 @@ EXPORTS:
sz_getmemdata db 'NNP_GetMemData',0 sz_getmemdata db 'NNP_GetMemData',0
sz_setmemdata db 'NNP_SetMemData',0 sz_setmemdata db 'NNP_SetMemData',0
sz_destroy db 'NNP_Destroy',0 sz_destroy db 'NNP_Destroy',0
align 16
@IMPORT:
library \
libc, 'libc.obj'
import libc, \
_strcat, 'strcat',\
_exp, 'exp'
;_scanf, 'scanf',\ ;???

View File

@@ -41,7 +41,6 @@ dd 1, start, init_end, end_mem, stack_top, params, 0
include 'lang.inc' ; Language support for locales: ru_RU (CP866), es_ES, en_US. include 'lang.inc' ; Language support for locales: ru_RU (CP866), es_ES, en_US.
include '../../macros.inc' include '../../macros.inc'
include '../../proc32.inc' include '../../proc32.inc'
include "../../string.inc"
include '../../develop/libraries/box_lib/trunk/box_lib.mac' include '../../develop/libraries/box_lib/trunk/box_lib.mac'
include '../../dll.inc' include '../../dll.inc'
;include '../../debug.inc' ;include '../../debug.inc'
@@ -370,12 +369,6 @@ endl
mcall 30,4,,1 mcall 30,4,,1
jmp .n jmp .n
@@:
stdcall string.length, pathOut
add eax, pathOut
cmpne [eax - 1], byte '/', @f
mov [eax - 1], byte 0
dec dword[edtUnpPath.size]
@@: @@:
mcall 30,4,pathOut,1 mcall 30,4,pathOut,1
.n: .n:

View File

@@ -1,5 +0,0 @@
@del *.
@For /R %%i In (*.c) Do c-- "%%i"
@rename *.com *.
@pause
@del warning.txt

View File

@@ -0,0 +1,9 @@
@del lang.h--
@echo #define LANG_ENG 1 >lang.h--
C-- flood-it.c
@del flood-it
@rename flood-it.com flood-it
@kpack flood-it
@del lang.h--
@del warning.txt
@pause

View File

@@ -0,0 +1,9 @@
@del lang.h--
@echo #define LANG_RUS 1 >lang.h--
C-- flood-it.c
@del flood-it
@rename flood-it.com flood-it
@kpack flood-it
@del lang.h--
@del warning.txt
@pause

View File

@@ -1,44 +1,49 @@
// SPDX-License-Identifier: GPL-2.0-only //Leency 06.10.2011, Flood-it! v2.41, GPL
// Flood-it! - Strategy game: Flood the board with one color, within a step limit.
// Copyright (C) 2011-2025 Leency <lipatov.kiril@gmail.com>
#include "lib\kolibri.h" #include "lib\kolibri.h"
#include "lib\random.h" #include "lib\random.h"
#ifndef AUTOBUILD
#include "lang.h--"
#endif
system_colors sc; system_colors sc;
proc_info Form; proc_info Form;
dword help_window_stak[100]; dword stak[100]; //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define DEFAULT_BLOCK_COUNT 14 //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define DEFAULT_MAX_CLICKS 25 int DIFFICULTY_LEV_PARAMS[]={ 28, 14, 25, //<2F><><EFBFBD><EFBFBD><EFBFBD>
#define MAX_BLOCK_SIZE 28 17, 28, 50}; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
char board_size = -1;
int BLOCK_SIZE; //cell size //<2F><>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> "<22><><EFBFBD><EFBFBD><EFBFBD>"
int BLOCKS_NUM; //number of cells by X and Y int BLOCK_SIZE = 28; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
int MAX_CLICKS; //max clicks for win int BLOCKS_NUM = 14; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20> <20> <20><> Y
int CLICKS; //how many clicks user already did int MAX_CLICKS = 25; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
int game_end;
#define USER_PANEL_WIDTH 144 int CLICKS = 0; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
//six colors are used in a game for a cells #define USER_PANEL_WIDTH 119
//and seventh color is used to mark a cell during filling process
dword FIELD_COLORS[] = {0xf18db6, 0x605ca8, 0xfddc80, 0xdc4a20, 0x46b1e2, 0x7e9d1e, 0x232323}; //<2F><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) <20><><EFBFBD> <20><><EFBFBD><EFBFBD>,
char BOARD_SIZES[] = "S\0L"; //<2F><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
dword FIELD_COLORS[]= {0xf18db6, 0x605ca8, 0xfddc80, 0xdc4a20, 0x46b1e2, 0x7e9d1e, 0x232323, 0};
char *BOARD_SIZES[]={ "S", "L", 0 };
#ifdef LANG_RUS #ifdef LANG_RUS
char *BUTTON_CAPTIONS[]={ " <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> [F2]", " <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> [F1]", " <20><>室 [Esc]", 0}; char *BUTTON_CAPTIONS[]={ " <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> [F2]", " <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> [F1]", " <20><>室 [Esc]", 0};
char CLICKS_TEXT[]="<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: /"; char CLICKS_TEXT[]=" <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: /";
char LEVELS_TEXT[]=" <EFBFBD><EFBFBD><EFBFBD><EFBFBD>:"; char LEVELS_TEXT[]="<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:";
char HELP_WINDOW_CAPTION[]="<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"; char HELP_WINDOW_CAPTION[]="<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
char *HELP_TEXT[]={ "<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> Flood-it?", char *HELP_TEXT[]={ "<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> Flood-it?",
"", "",
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> 梥⮬ <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>᫮ 室<><E5AEA4>.",
"<EFBFBD>⨬ 梥⮬ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> - ⠪ <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD> <20><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>⪨. <20><EFBFBD><EBA1A5><EFBFBD><EFBFBD><>, <20><><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>",
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>⪨ ⮩ <EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>᪨. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD> <20><>", "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20> <EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>⨬ 梥⮬ - ⠪ <20><> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>᫮ 室<EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><><E0A0A7><EFBFBD><EFBFBD> <20><>᪨.", "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>⪨ ⮩ <20><> <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
"<EFBFBD><EFBFBD>᫮ 室<><E5AEA4>. <20><><EFBFBD><E8A0A3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E2A5A3> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ਭ樯<E0A8AD><E6A8AF> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,",
"<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!",
"", "",
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E2A0AA> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:", "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E2A0AA> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:",
"[Q] [W] [E]", "[Q] [W] [E]",
@@ -57,25 +62,28 @@ char BOARD_SIZES[] = "S\0L";
"vajutades nuppudele vasakul. Kui sa muudad v<>rvi pragusel alal,", "vajutades nuppudele vasakul. Kui sa muudad v<>rvi pragusel alal,",
"siis iga kokkupuutuv sama v<>rv muutub samaks. Nii saad ujutada", "siis iga kokkupuutuv sama v<>rv muutub samaks. Nii saad ujutada",
"teised alad m<>nguv<75>ljal <20>le. Valida saad 2 m<>nguv<75>lja suuruse", "teised alad m<>nguv<75>ljal <20>le. Valida saad 2 m<>nguv<75>lja suuruse",
"vahel.", "vahel. Proovi v<>li <20>le ujutada etteandtud k<>ikude arvuga!",
"Kaasahaarav ja l<>bus!",
"", "",
"M<EFBFBD>ngida saab ka klaviatuuriga:", "M<EFBFBD>ngida saab ka klaviatuuriga:",
"[Q] [W] [E]", "[Q] [W] [E]",
"[A] [S] [D]", "[A] [S] [D]",
0}; 0};
#else #else
char *BUTTON_CAPTIONS[]={ "Restart [F2]", " Help [F1]", " Exit [Esc]", 0}; char *BUTTON_CAPTIONS[]={ "New Game [F2]", "Help [F1]", "Exit [Esc]", 0};
char CLICKS_TEXT[]="Clicks: /"; char CLICKS_TEXT[]="Clicks: /";
char LEVELS_TEXT[]="Board:"; char LEVELS_TEXT[]="Board:";
char HELP_WINDOW_CAPTION[]="Help"; char HELP_WINDOW_CAPTION[]="Help";
char *HELP_TEXT[]={ "How to play Flood-it?", char *HELP_TEXT[]={ "How to play Flood-it?",
"", "",
"You start from the TOP LEFT corner and progress by selecting one", "Flood the whole board with one color within the allowed steps.",
"You start from the top left corner and progress by selecting one",
"of the colored buttons on the left. When you change your current area", "of the colored buttons on the left. When you change your current area",
"color, every adjacent square with the same color also changes, that", "color, every adjacent square with the same color also changes, that",
"way you can flood other areas of the board. Select from 2 sizes of", "way you can flood other areas of the board. Select from 3 sizes of",
"the board and try to flood-it in the least amount of steps!", "the board and try to flood-it in the least amount of steps!",
"Addictive and Fun!",
"", "",
"You can also play with keyboard:", "You can also play with keyboard:",
"[Q] [W] [E]", "[Q] [W] [E]",
@@ -84,7 +92,7 @@ char BOARD_SIZES[] = "S\0L";
#endif #endif
unsigned char color_matrix[28*28]; //our field unsigned char color_matrix[28*28]; //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
unsigned char loss_matrix[14*14]={ unsigned char loss_matrix[14*14]={
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -124,160 +132,152 @@ void main()
{ {
int key, id; int key, id;
set_board_size(0); //small board by default
new_game(); new_game();
loop() switch(WaitEvent()) loop()
{ {
case evButton: switch(WaitEvent())
id = GetButtonID(); {
IF (id==1) || (id==4) ExitProcess(); case evButton:
IF (id==2) goto _NEW_GAME_MARK; id = GetButtonID();
IF (id==3) goto _HELP_MARK; IF (id==1) || (id==4) ExitProcess();
IF (id>=100) { IF (id==2) goto _NEW_GAME_MARK;
make_turn(id-100); IF (id==3) goto _HELP_MARK;
} IF (id>=100)
if (id==10) set_board_size(0); {
if (id==11) set_board_size(1); make_turn(id-100);
break;
case evKey:
key = GetKeyScancode();
IF (key==01) //Escape
ExitProcess();
IF (key==59) //F1
{
_HELP_MARK:
CreateThread(#help_thread,#help_window_stak);
break; break;
} }
IF (key==60) //F2 if (id>=10)
{ {
_NEW_GAME_MARK: id=id-10*3;
IF (BLOCK_SIZE == DIFFICULTY_LEV_PARAMS[id]) break; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BLOCK_SIZE = DIFFICULTY_LEV_PARAMS[id]; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BLOCKS_NUM = DIFFICULTY_LEV_PARAMS[id+1]; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20> <20> <20><> Y
MAX_CLICKS = DIFFICULTY_LEV_PARAMS[id+2]; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
new_game(); new_game();
draw_clicks_num();
draw_field(); MoveSize(-1, -1, BLOCK_SIZE*BLOCKS_NUM +14+USER_PANEL_WIDTH, BLOCK_SIZE*BLOCKS_NUM +GetSkinHeight()+14);
break; }
} break;
IF (key==16) make_turn(0); //Q case evKey:
IF (key==17) make_turn(1); //W key = GetKeyScancode();
IF (key==18) make_turn(2); //E IF (key==01) //Escape
IF (key==30) make_turn(3); //A ExitProcess();
IF (key==31) make_turn(4); //S IF (key==59) //F1
IF (key==32) make_turn(5); //D {
break; _HELP_MARK:
case evReDraw: CreateThread(#help,#stak);
draw_window(); }
} IF (key==60) //F2
} {
_NEW_GAME_MARK:
void set_board_size(char s) new_game();
{ draw_clicks_num();
if (board_size != s) { draw_field();
board_size = s; }
IF (key==16) make_turn(0); //Q
BLOCKS_NUM = board_size + 1 * DEFAULT_BLOCK_COUNT; IF (key==17) make_turn(1); //W
MAX_CLICKS = board_size + 1 * DEFAULT_MAX_CLICKS; IF (key==18) make_turn(2); //E
IF (key==30) make_turn(3); //A
BLOCK_SIZE = GetScreenHeight() - 70 / BLOCKS_NUM; IF (key==31) make_turn(4); //S
if (BLOCK_SIZE > MAX_BLOCK_SIZE) BLOCK_SIZE = MAX_BLOCK_SIZE; IF (key==32) make_turn(5); //D
break;
new_game(); case evReDraw:
draw_window();
MoveSize(-1, -1, BLOCK_SIZE*BLOCKS_NUM +14+USER_PANEL_WIDTH, }
BLOCK_SIZE*BLOCKS_NUM +GetSkinHeight()+14);
} }
} }
void make_turn(int turn_id) void make_turn(int turn_id)
{ {
IF (color_matrix[0]==turn_id) return; //ignore no-sence click: first item color is equal to a new color IF (color_matrix[0]==turn_id) return; //<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
IF (!game_is_ended()) { IF (CLICKS>=MAX_CLICKS) return; //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
CLICKS++;
draw_clicks_num(); CLICKS++;
fill_field(turn_id); draw_clicks_num();
if (!game_is_ended()) draw_field();
} fill_field(turn_id);
draw_field();
check_for_end(); //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
} }
void draw_window() void draw_window()
{ {
int i; int i, j;
#define BUTTON_SIZE 28 #define BUTTON_SIZE 28
sc.get(); sc.get();
DefineAndDrawWindow(300,176, BLOCK_SIZE*BLOCKS_NUM +14+USER_PANEL_WIDTH, DefineAndDrawWindow(300,176, BLOCK_SIZE*BLOCKS_NUM +14+USER_PANEL_WIDTH, BLOCK_SIZE*BLOCKS_NUM +GetSkinHeight()+14, 0x74,sc.work,0,0,"Flood-it!");
BLOCK_SIZE*BLOCKS_NUM +GetSkinHeight()+14, 0x74,0,"Flood-it!");
// Fix rolled-up bug //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
GetProcessInfo(#Form, SelfInfo); GetProcessInfo(#Form, SelfInfo);
IF (Form.status_window==4) return; IF (Form.status_window==4) return;
// Fill background to reduce window redraw //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> -> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
for (i=0;i<=4;i++) for (i=0;i<=4;i++)
{ {
ESI = sc.work; IF (i<>4)
IF (i==4) ESI = sc.work_graph; DrawRegion(USER_PANEL_WIDTH+i-5,i, BLOCK_SIZE*BLOCKS_NUM +9-i-i, BLOCK_SIZE*BLOCKS_NUM+9-i-i, sc.work);
DrawRegion(USER_PANEL_WIDTH+i-5,i, BLOCK_SIZE*BLOCKS_NUM +9-i-i, ESI); else
DrawRegion(USER_PANEL_WIDTH+i-5,i, BLOCK_SIZE*BLOCKS_NUM +9-i-i, BLOCK_SIZE*BLOCKS_NUM+9-i-i, sc.work_graph); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
} }
DrawBar(0,0, USER_PANEL_WIDTH-5, BLOCK_SIZE*BLOCKS_NUM+10, sc.work); DrawBar(0,0, USER_PANEL_WIDTH-5, BLOCK_SIZE*BLOCKS_NUM+10, sc.work);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
for (i=0;i<2;i++)
for (j=0;j<3;j++)
DefineButton(j*BUTTON_SIZE+17,i*BUTTON_SIZE+15,BUTTON_SIZE,BUTTON_SIZE, i*3+j+100,FIELD_COLORS[i*3+j]);
// Main buttons to fill the board //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define FILL_BUTTON_SIZE BUTTON_SIZE+8 for (j=0;j<3;j++)
for (i=0;i<6;i++)
DefineButton(i%3*FILL_BUTTON_SIZE+17,i/3*FILL_BUTTON_SIZE+15,FILL_BUTTON_SIZE,FILL_BUTTON_SIZE, i+100,FIELD_COLORS[i]);
// Menu buttons
for (i=0;i<3;i++)
{ {
DefineButton(17,i*31+140, 13*8+6, 25, i+2,sc.work_button); DefineButton(17,j*25+120, 13*6+6, 20, j+2,sc.work_button);
WriteText(17+4,i*31+146,0x90,sc.work_button_text,BUTTON_CAPTIONS[i],0); WriteText(17+4,j*25+127,0x80,sc.work_button_text,BUTTON_CAPTIONS[j],0);
} }
// Board size //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
WriteText(17,BLOCKS_NUM*BLOCK_SIZE-25+7,0x90,sc.work_text,#LEVELS_TEXT,0); WriteText(17,BLOCKS_NUM*BLOCK_SIZE-20+7,0x80,sc.work_text,#LEVELS_TEXT,0);
for (i=0;i<2;i++) for (j=0;j<2;j++)
{ {
IF (board_size == i) { DefineButton(j*25+56,BLOCKS_NUM*BLOCK_SIZE-20, 20,20, j+10,sc.work_button);
ESI=sc.work_button;
EDI=sc.work_button_text; IF (BLOCK_SIZE == DIFFICULTY_LEV_PARAMS[j*3]) EDI=0x800080;
} ELSE { else EDI=sc.work_button_text;
ESI = sc.work;
EDI = sc.work_text; WriteText(j*25+56+8,BLOCKS_NUM*BLOCK_SIZE-20+7,0x80,EDI,BOARD_SIZES[j],0);
} WriteText(j*25+56+9,BLOCKS_NUM*BLOCK_SIZE-20+7,0x80,EDI,BOARD_SIZES[j],0);
DefineButton(i*32+69,BLOCKS_NUM*BLOCK_SIZE-24, 26,25, i+10,ESI);
WriteText(i*32+69+9,BLOCKS_NUM*BLOCK_SIZE-24+6,0x90,EDI,#BOARD_SIZES+i+i,0);
$add ebx, 1<<16 //bold
$int 0x40
} }
draw_clicks_num(); draw_clicks_num();
draw_field(); draw_field();
} }
void randomly_fill_the_board()
{
int i;
for (i=0;i<BLOCKS_NUM*BLOCKS_NUM;i++) {
color_matrix[i] = random(6);
}
}
void new_game() void new_game()
{ {
int i;
CLICKS = 0; CLICKS = 0;
game_end = false;
randomly_fill_the_board(); for (i=0;i<BLOCKS_NUM*BLOCKS_NUM;i++)
color_matrix[i] = random(6);
} }
void fill_field(int new_color_id) void fill_field(int new_color_id)
{ {
int i, j, int i, j,
old_color_id=color_matrix[0], old_color_id=color_matrix[0],
restart; restart;
int cur_cell;
#define MARKED 6 #define MARKED 6
color_matrix[0]=MARKED; color_matrix[0]=MARKED;
@@ -289,16 +289,15 @@ void fill_field(int new_color_id)
for (i=0;i<BLOCKS_NUM;i++) for (i=0;i<BLOCKS_NUM;i++)
for (j=0;j<BLOCKS_NUM;j++) for (j=0;j<BLOCKS_NUM;j++)
{ {
cur_cell = i*BLOCKS_NUM+j; IF (color_matrix[i*BLOCKS_NUM+j]<>old_color_id) continue; //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
IF (color_matrix[cur_cell]<>old_color_id) continue; //if not a needed color then continue IF (color_matrix[i*BLOCKS_NUM+j]==MARKED) continue; //<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
IF (color_matrix[cur_cell]==MARKED) continue; //if already marked then continue
IF (j>0) && (color_matrix[i*BLOCKS_NUM+j-1]==MARKED) color_matrix[cur_cell]=MARKED; //left IF (j>0) && (color_matrix[i*BLOCKS_NUM+j-1]==MARKED) color_matrix[i*BLOCKS_NUM+j]=MARKED; //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
IF (i>0) && (color_matrix[i-1*BLOCKS_NUM+j]==MARKED) color_matrix[cur_cell]=MARKED; //top IF (i>0) && (color_matrix[i-1*BLOCKS_NUM+j]==MARKED) color_matrix[i*BLOCKS_NUM+j]=MARKED; //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
IF (j<BLOCKS_NUM-1) && (color_matrix[i*BLOCKS_NUM+j+1]==MARKED) color_matrix[cur_cell]=MARKED; //right IF (j<BLOCKS_NUM-1) && (color_matrix[i*BLOCKS_NUM+j+1]==MARKED) color_matrix[i*BLOCKS_NUM+j]=MARKED; //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
IF (i<BLOCKS_NUM-1) && (color_matrix[i+1*BLOCKS_NUM+j]==MARKED) color_matrix[cur_cell]=MARKED; //bottom IF (i<BLOCKS_NUM-1) && (color_matrix[i+1*BLOCKS_NUM+j]==MARKED) color_matrix[i*BLOCKS_NUM+j]=MARKED; //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
IF (color_matrix[cur_cell]==MARKED) restart=1; IF (color_matrix[i*BLOCKS_NUM+j]==MARKED) restart=1; //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD> <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
} }
IF (restart) goto _RESTART_MARK; IF (restart) goto _RESTART_MARK;
@@ -306,83 +305,101 @@ void fill_field(int new_color_id)
IF (color_matrix[i]==MARKED) color_matrix[i]=new_color_id; IF (color_matrix[i]==MARKED) color_matrix[i]=new_color_id;
} }
void draw_win_or_loose_animation(dword matrix)
int check_for_end()
{ {
int i, j, ii, jj; int i, j, ii, jj;
for (i=0;i<14;i++) {
if (CLICKS>=MAX_CLICKS) //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
{
IF (CLICKS==MAX_CLICKS) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
{
for (i=0;i<BLOCKS_NUM*BLOCKS_NUM;i++) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
IF (color_matrix[i]<>color_matrix[0]) goto _loss_MARK;
goto _WIN_MARK;
}
_loss_MARK:
for (i=0;i<14;i++)
for (j=0;j<14;j++)
{
IF (BLOCK_SIZE == DIFFICULTY_LEV_PARAMS[0])
{
ii=i;
jj=j;
}
else
{
ii=i*2;
jj=j*2;
}
color_matrix[ii*BLOCKS_NUM+jj]=loss_matrix[i*14+j];
color_matrix[ii+1*BLOCKS_NUM+jj]=loss_matrix[i*14+j];
color_matrix[ii*BLOCKS_NUM+jj+1]=loss_matrix[i*14+j];
color_matrix[ii+1*BLOCKS_NUM+jj+1]=loss_matrix[i*14+j];
draw_field();
//Pause(5);
}
return 1;
}
for (i=0;i<BLOCKS_NUM*BLOCKS_NUM;i++) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
IF (color_matrix[i]<>color_matrix[0]) return 0;
//<2F><><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> MAX_CLICKS -> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
_WIN_MARK:
for (i=0;i<25;i++)
{
new_game();
draw_field();
Pause(7);
}
CLICKS=MAX_CLICKS;
for (i=0;i<14;i++)
for (j=0;j<14;j++) for (j=0;j<14;j++)
{ {
ii = board_size * 2 + i; IF (BLOCK_SIZE == DIFFICULTY_LEV_PARAMS[0]) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
jj = board_size * 2 + j; {
color_matrix[ii*BLOCKS_NUM+jj]= ii=i;
color_matrix[ii+1*BLOCKS_NUM+jj]= jj=j;
color_matrix[ii*BLOCKS_NUM+jj+1]= }
color_matrix[ii+1*BLOCKS_NUM+jj+1]=ESBYTE[i*14+j+matrix]; else
draw_field(); {
} ii=i*2;
} jj=j*2;
} }
color_matrix[ii*BLOCKS_NUM+jj]=win_matrix[i*14+j];
int field_is_solid() color_matrix[ii+1*BLOCKS_NUM+jj]=win_matrix[i*14+j];
{ color_matrix[ii*BLOCKS_NUM+jj+1]=win_matrix[i*14+j];
int i; color_matrix[ii+1*BLOCKS_NUM+jj+1]=win_matrix[i*14+j];
if (game_end) return 1;
game_end = 1;
for (i=0;i<BLOCKS_NUM*BLOCKS_NUM;i++) {
IF (color_matrix[i]<>color_matrix[0]) game_end = 0;
}
return game_end;
}
int game_is_ended()
{
int i;
if (game_end) return 1;
if (CLICKS>=MAX_CLICKS) //check for game end via max_clicks
{
IF (CLICKS==MAX_CLICKS) //probably user won on the last step
{
if (field_is_solid()) goto _WIN_MARK;
}
draw_win_or_loose_animation(#loss_matrix);
return 1;
} else {
if (!field_is_solid()) return 0;
//field is solid and CLICKS<MAX_CLICKS -> win
_WIN_MARK:
for (i=0;i<25;i++)
{
randomly_fill_the_board();
draw_field(); draw_field();
Pause(7); //Pause(5);
} }
return 1;
draw_win_or_loose_animation(#win_matrix);
return 1;
}
} }
void draw_clicks_num() void draw_clicks_num()
{ {
#define TEXT_X 19 #define TEXT_X 21
#define TEXT_Y 100 #define TEXT_Y 92
DrawBar(TEXT_X, TEXT_Y, USER_PANEL_WIDTH-TEXT_X-5,16, sc.work); DrawBar(TEXT_X, TEXT_Y, USER_PANEL_WIDTH-TEXT_X-3,9, sc.work);
WriteText(TEXT_X,TEXT_Y,0x90,sc.work_text,#CLICKS_TEXT,0); WriteText(TEXT_X,TEXT_Y,0x80,sc.work_text,#CLICKS_TEXT,0);
IF (CLICKS<10) EBX=9*8+TEXT_X; IF (CLICKS<10) EBX=9*6+TEXT_X;
else EBX=8*8+TEXT_X; else EBX=8*6+TEXT_X;
WriteText(EBX,TEXT_Y,0x90,sc.work_text,itoa_nosign(CLICKS),0); WriteText(EBX,TEXT_Y,0x80,sc.work_text,IntToStr(CLICKS),0);
WriteText(11*8+TEXT_X,TEXT_Y,0x90,sc.work_text,itoa_nosign(MAX_CLICKS),0); WriteText(11*6+TEXT_X,TEXT_Y,0x80,sc.work_text,IntToStr(MAX_CLICKS),0);
} }
@@ -400,7 +417,7 @@ void draw_field()
} }
void help_thread() void help()
{ {
int i; int i;
@@ -412,10 +429,10 @@ void help_thread()
IF (GetKeyScancode()==001) ExitProcess(); //Esc IF (GetKeyScancode()==001) ExitProcess(); //Esc
break; break;
case evReDraw: case evReDraw:
//for (i=0; HELP_TEXT[i]<>0; i++;) {}; //calculate line numbers, predefined i=12 used to reduce size for (i=0; HELP_TEXT[i]<>0; i++;) {};
DefineAndDrawWindow(400,200,612,12*19+25+GetSkinHeight(),0x34,sc.work,#HELP_WINDOW_CAPTION); DefineAndDrawWindow(400,200,610,i*19+25+GetSkinHeight(),0x34,sc.work,0,0,#HELP_WINDOW_CAPTION);
WriteText(6,12,0x90,sc.work_text,HELP_TEXT[0],0); //for a bold text WriteText(6,12,0x90,sc.work_text,HELP_TEXT[0],0); //<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
for (i=0; HELP_TEXT[i]<>0; i++;) WriteText(7,i*19+12,0x90,sc.work_text,HELP_TEXT[i],0); for (i=0; HELP_TEXT[i]<>0; i++;) WriteText(5,i*19+12,0x90,sc.work_text,HELP_TEXT[i],0);
} }
} }

View File

@@ -23,10 +23,6 @@ dword I_Path = 0;
#define BT_HIDE 0x40000000 #define BT_HIDE 0x40000000
#define BT_NOFRAME 0x20000000 #define BT_NOFRAME 0x20000000
#define bool char
#define true 1
#define false 0
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
@@ -98,11 +94,16 @@ inline fastcall Pause(dword EBX)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
char buffer[5]; char buffer[11]="";
inline fastcall dword itoa_nosign(dword ESI) inline fastcall dword IntToStr(dword ESI)
{ {
$mov edi, #buffer $mov edi, #buffer
$mov ecx, 10 $mov ecx, 10
$test esi, esi
$jns f1
$mov al, '-'
$stosb
$neg esi
f1: f1:
$mov eax, esi $mov eax, esi
$push -'0' $push -'0'
@@ -125,7 +126,7 @@ f3:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void DefineAndDrawWindow(dword x,y,sizeX,sizeY,byte mainAreaType,dword mainAreaColour,EDI) void DefineAndDrawWindow(dword x,y,sizeX,sizeY,byte mainAreaType,dword mainAreaColour,byte headerType,dword headerColour,EDI)
{ {
EAX = 12; // function 12:tell os about windowdraw EAX = 12; // function 12:tell os about windowdraw
EBX = 1; EBX = 1;
@@ -134,7 +135,7 @@ void DefineAndDrawWindow(dword x,y,sizeX,sizeY,byte mainAreaType,dword mainAreaC
EBX = x << 16 + sizeX; EBX = x << 16 + sizeX;
ECX = y << 16 + sizeY; ECX = y << 16 + sizeY;
EDX = mainAreaType << 24 | mainAreaColour; EDX = mainAreaType << 24 | mainAreaColour;
ESI = 0; ESI = headerType << 24 | headerColour;
$xor eax,eax $xor eax,eax
$int 0x40 $int 0x40
@@ -165,13 +166,6 @@ dword GetSkinHeight()
$pop ebx $pop ebx
} }
inline fastcall int GetScreenHeight()
{
$mov eax, 14
$int 0x40
$and eax,0x0000FFFF
}
void WriteText(dword x,y,byte fontType, dword color, EDX, ESI) void WriteText(dword x,y,byte fontType, dword color, EDX, ESI)
{ {
EAX = 4; EAX = 4;
@@ -196,20 +190,12 @@ void DefineButton(dword x,y,w,h,EDX,ESI)
$int 0x40 $int 0x40
} }
void DrawRegion(dword x,y,s,EDX) void DrawRegion(dword x,y,width,height,EDX)
{ {
EAX = 13; DrawBar(x,y,width,1,EDX);
EBX = x<<16+s; DrawBar(x,y+height,width,1,EDX);
ECX = y<<16+1; DrawBar(x,y,1,height,EDX);
$int 0x40 DrawBar(x+width,y,1,height+1,EDX);
ECX = y+s<<16+1;
$int 0x40
EBX = x<<16+1;
ECX = y<<16+s;
$int 0x40
EBX = x+s<<16+1;
ECX = y<<16+s+1;
$int 0x40
} }
inline fastcall dword WriteDebug(dword EDX) inline fastcall dword WriteDebug(dword EDX)

View File

@@ -1,11 +1,5 @@
====Leency==== ====Leency====
v0.62 (21/03/2025)
- proper window rolling up fix
- bigger cells and fonts
- add icon to a new game button
- better alignment of ui elements in header
v0.52 (16/12/2008) v0.52 (16/12/2008)
- window rolling up fix - window rolling up fix

View File

@@ -18,42 +18,43 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*******************************************************************************/ *******************************************************************************/
?define HEADER_Y 4
?define BTNSIZE 19
char game_mode[] = "1/3"; char game_mode[] = "1/3";
void draw_window() void draw_window() // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
{ {
dword iconimg = sys_memopen("ICONS18", 0, SHM_READ); sys_get_colors(#colors, 40);
//sys_get_colors(#colors, 40);
// WINDOW
sys_window_redraw(1); sys_window_redraw(1);
EBX = xpos << 16 + xsize + 9; EBX = xpos << 16 + xsize + 9;
ECX = ypos << 16 + ysize; ECX = ypos << 16 + ysize;
sys_draw_window(EBX, ECX, 0x34CCCCCC, clGray | 0x80000000, "MineSweeper"); sys_draw_window(EBX, ECX, 0x34CCCCCC, colors.w_work | 0x80000000, "MineSweeper");
sys_window_redraw(2);
// Leency ROLLED UP FIX
sys_process_info(#procinfo, -1); sys_process_info(#procinfo, -1);
#define ROLLED_UP 0x04 IF (procinfo.ysize<70) return;
IF (procinfo.status_window&ROLLED_UP) return;
// <NEW GAME> BUTTON (911) // <NEW GAME> BUTTON (911)
sys_draw_button(CENTER_POS << 16 + BTNSIZE, HEADER_Y<<16+BTNSIZE, 911+BT_HIDE, clLightGray); EBX = xsize / 2 - 10;
draw_rectangle(CENTER_POS,HEADER_Y,BTNSIZE,BTNSIZE,clWhite,clDarkGray); EBX = EBX << 16 + BTNSIZE;
draw_rectangle(CENTER_POS+1,HEADER_Y+1,BTNSIZE-2,BTNSIZE-2,clWhite,clWhite); sys_draw_button(EBX, HEADER_Y<<16+BTNSIZE, 911+BT_HIDE, clLightGray);
sys_put_palette_image(18*18*4*58 + iconimg, 18<<16+18, CENTER_POS+2<<16+HEADER_Y+2, 32, 0); draw_rectangle(xsize/2-10,HEADER_Y,BTNSIZE,BTNSIZE,clWhite,clDarkGray);
// <CHANGE MODE> BUTTON (1001) // <CHANGE MODE> BUTTON (1001)
sys_draw_button(5<<16+32, HEADER_Y<<16+BTNSIZE, 1001+BT_HIDE, clLightGray); sys_draw_button(5<<16+32, HEADER_Y<<16+BTNSIZE, 1001+BT_HIDE, clLightGray);
draw_rectangle(5,HEADER_Y,32,BTNSIZE,clWhite,clDarkGray); draw_rectangle(5,HEADER_Y,32,BTNSIZE,clWhite,clDarkGray);
game_mode[0] = mode + '0'; game_mode[0] = mode + '0';
sys_write_text(9<<16+HEADER_Y+4, 0x90656565, #game_mode, 3); sys_write_text(9<<16+HEADER_Y+3, 0x90000000+clDarkGray, #game_mode, 3);
// <USER FIELD> BUTTON (1002) // <USER FIELD> BUTTON (1002)
//sys_draw_button(BTNSIZE<<16+7, ECX, EDX+1, 0xddbb44); //sys_draw_button(BTNSIZE<<16+7, ECX, EDX+1, 0xddbb44);
draw_time(); draw_time(); // draw timer
draw_mines_left(); draw_mines_left(); // draw mines
draw_squares(); draw_squares(); // draw field
sys_window_redraw(2);
} }
dword num_colors[8]= dword num_colors[8]=
@@ -69,11 +70,11 @@ dword num_colors[8]=
}; };
// Draw a single square // <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void draw_square(int x, y) void draw_square(int x, y)
{ {
int xl, xr, yt, yb; // lefx, right, top, bottom int xl, xr, yt, yb; // <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD>
dword tcolor = clBlack; // set default color as black dword tcolor = clBlack; // <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
byte tchar, tval; byte tchar, tval;
xl = XPX * x + XST; xl = XPX * x + XST;
@@ -85,7 +86,7 @@ void draw_square(int x, y)
ECX = yt+1 << 16 + yb - yt-1; ECX = yt+1 << 16 + yb - yt-1;
$inc ebx $inc ebx
$inc ecx $inc ecx
sys_draw_bar(EBX, ECX, clLightGray); // fill bg sys_draw_bar(EBX, ECX, clLightGray); // <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if (!get_open(x, y)) if (!get_open(x, y))
{ {
@@ -99,16 +100,16 @@ void draw_square(int x, y)
SWITCH (get_mark(x, y)) SWITCH (get_mark(x, y))
{ {
CASE 2: tcolor = 0x10121288; tchar = '?'; BREAK; CASE 2: tcolor = 0x121288; tchar = '?'; BREAK;
CASE 1: tcolor = 0x10d04444; tchar = 'P'; CASE 1: tcolor = 0xd04444; tchar = 'P';
} }
IF (get_mark(x,y)) IF (get_mark(x,y))
{ {
EBX = xl + 6 << 16 + yt + 4; EBX = xl + 5 << 16 + yt + 4;
sys_write_text(EBX, tcolor, #tchar, 1); sys_write_text(EBX, tcolor, #tchar, 1);
EBX += 0x00010000; EBX += 0x00010000;
/* Second run - registers are saved */ /* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
sys_write_text(EBX, ECX, EDX, ESI); sys_write_text(EBX, ECX, EDX, ESI);
} }
} }
@@ -119,15 +120,15 @@ void draw_square(int x, y)
{ {
IF (tval == MINE) IF (tval == MINE)
{ {
tcolor = 0x10ee1111; tcolor = 0xee1111;
tchar = '*'; tchar = '*';
} }
ELSE ELSE
{ {
tchar = tval + '0'; tchar = tval + '0';
tcolor = num_colors[tval-1]+0x10000000; tcolor = num_colors[tval-1];
} }
EBX = xl + 7 << 16 + yt + 4; EBX = xl + 5 << 16 + yt + 5;
sys_write_text(EBX, tcolor, #tchar, 1); sys_write_text(EBX, tcolor, #tchar, 1);
EBX += 0x00010000; EBX += 0x00010000;
sys_write_text(EBX, ECX, EDX, ESI); sys_write_text(EBX, ECX, EDX, ESI);
@@ -139,19 +140,19 @@ void draw_square(int x, y)
void draw_time() void draw_time()
{ {
sys_draw_bar(xsize-XST-63<<16+34, HEADER_Y<<16+22, clWhiteGray); sys_draw_bar(xsize-XST-58<<16+29, HEADER_Y<<16+20, clWhiteGray);
sys_write_number(0x00030000, time, xsize-XST-58<<16+HEADER_Y+4, 0x101166C3); sys_write_number(0x00030000, time, xsize-XST-56<<16+HEADER_Y+3, 0x101166C3);
} }
void draw_mines_left() void draw_mines_left()
{ {
sys_draw_bar(xsize-XST-32<<16+32, HEADER_Y<<16+22, clWhiteGray); sys_draw_bar(xsize-XST-29<<16+29, HEADER_Y<<16+20, clWhiteGray);
sys_write_number(0x00030000, cmines, xsize-XST-29<<16+HEADER_Y+4, 0x10ff0000); sys_write_number(0x00030000, cmines, xsize-XST-27<<16+HEADER_Y+3, 0x10ff0000);
} }
// Draw mine field // <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
void draw_squares() void draw_squares()
{ {
int x,y; int x,y;

View File

@@ -64,8 +64,7 @@ struct ProcessInfo
ystart, ystart,
xsize, xsize,
ysize; ysize;
char status_window; byte not_used2[974];
byte reserved[1024-71];
}; };
#define SystemColors SystemColours // usa/british #define SystemColors SystemColours // usa/british
@@ -213,15 +212,6 @@ inline fastcall dword sys_put_image(dword EBX, ECX, EDX)
$int 0x40 $int 0x40
} }
inline fastcall void sys_put_palette_image(dword EBX,ECX,EDX,ESI,EDI)
{
$push ebp
EAX = 65;
EBP = 0;
$int 0x40
$pop ebp
}
/********************************************************* /*********************************************************
08 = DEFINE BUTTON 08 = DEFINE BUTTON
@@ -1127,44 +1117,11 @@ inline fastcall dword sys_debug_read_char(dword EBX)
} }
inline fastcall dword sys_window_move_size(dword EBX,ECX,EDX,ESI){ inline fastcall dword window_move_size(dword EBX,ECX,EDX,ESI){
EAX = 67; EAX = 67;
$int 0x40 $int 0x40
} }
/*********************************************************
68.11 = mem_init is required to work with heap
*********************************************************/
inline fastcall void sys_mem_init()
{
$mov eax, 68
$mov ebx, 11
$int 0x40
}
/*********************************************************
68.22 = shared memory
in:
ecx = area name, 31 symbols max
edx = area size for SHM_CREATE SHM_OPEN_ALWAYS
esi = flags, see the list below
out:
eax = pointer to memory or 0
edx = memsize
*********************************************************/
#define SHM_OPEN 0x00
#define SHM_OPEN_ALWAYS 0x04
#define SHM_CREATE 0x08
#define SHM_READ 0x00
#define SHM_WRITE 0x01
inline fastcall dword sys_memopen(ECX, EDX, ESI)
{
$mov eax, 68
$mov ebx, 22
$int 0x40
}
/********************************************************* /*********************************************************
-1 = EXIT PROCESS -1 = EXIT PROCESS

View File

@@ -26,26 +26,17 @@
//? define DEBUG 1 //? define DEBUG 1
? print "\n<><6E><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ" ? print "\n<><6E><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ"
? print "\n<> KolibriOS MineSweeper v0.62 <20>" ? print "\n<> KolibriOS MineSweeper v0.52 <20>"
? print "\n<> (C) Leency (leency@mail.ru) 2010-2025 <20>" ? print "\n<> (C) Leency (leency@mail.ru) 2010,2011 <20>"
? print "\n<> (C) Ivan Poddubny (ivan-yar@bk.ru) 2003,2004 <20>" ? print "\n<> (C) Ivan Poddubny (ivan-yar@bk.ru) 2003,2004 <20>"
? print "\n<><6E><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n\n" ? print "\n<><6E><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n\n"
/************************************* DEFINES *************************************/
?define HEADER_Y 5
?define BTNSIZE 21
?define CENTER_POS xsize / 2 - 10
?define XST 5 // offset of first pixel X - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
?define YST 32
? define XPX 21 // X pixels by square - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
? define YPX 21 // Y pixels by square
? define MINE 255 // <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD> value = MINE
/************************************** DATA **************************************/ /************************************** DATA **************************************/
? define XPX 16 // X pixels by square - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
? define YPX 16 // Y pixels by square
? define MINE 255 // <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD> value = MINE
struct struct
{ {
byte value; // number of mines - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> byte value; // number of mines - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
@@ -67,6 +58,9 @@ struct
byte nmines; byte nmines;
} stdmodes[3] = {9,9,10, 16,16,40, 30,16,99}; // {x,y,m} } stdmodes[3] = {9,9,10, 16,16,40, 30,16,99}; // {x,y,m}
?define XST 5 // offset of first pixel X - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
?define YST 28
int ncx, // number of squares in X - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> int ncx, // number of squares in X - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
ncy, ncy,
cmines, // mines discovered - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> cmines, // mines discovered - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
@@ -85,7 +79,7 @@ byte stop_game = FALSE, // game stopped -
firstmine; firstmine;
ProcessInfo procinfo; ProcessInfo procinfo;
//SystemColors colors; SystemColors colors;
/************************************** CODE **************************************/ /************************************** CODE **************************************/
@@ -435,8 +429,6 @@ void end_game()
void main() void main()
{ {
sys_mem_init();
new_game(); new_game();
draw_window(); draw_window();
@@ -466,11 +458,11 @@ void main()
ELSE IF (EAX == 1001) // change mode ELSE IF (EAX == 1001) // change mode
{ {
mode++; mode++;
IF (mode==4) mode=1; if (mode==4) mode=1;
//EAX = mode; EAX++; EAX = EAX%3; EAX++; mode = AL; //EAX = mode; EAX++; EAX = EAX%3; EAX++; mode = AL;
new_game(); new_game();
sys_window_move_size(OLD,OLD,xsize+9,ysize); window_move_size(OLD,OLD,xsize+9,ysize);
CONTINUE; CONTINUE;
} }
// ELSE IF (EAX == 1002) // ELSE IF (EAX == 1002)

View File

@@ -436,14 +436,12 @@ struc POINT _t,_dx,_dy {
; structure definition helper ; structure definition helper
include 'struct.inc' include 'struct.inc'
macro define@lstruct name,[field] struct RECT
{ local value left dd ?
common struc name [value] \{ top dd ?
forward \.#field = value right dd ?
common \} } bottom dd ?
ends
;usecase
define@lstruct RECT,X,Y,W,H
struct BOX struct BOX
left dd ? left dd ?

View File

@@ -1675,14 +1675,6 @@ proc generate_window_header
mov eax, [ebx+Image.Height] mov eax, [ebx+Image.Height]
call bin2dec call bin2dec
mov eax, [ebx+Image.Type]
dec eax
shl eax, 2
add eax, BppTypeNames
mov eax, [eax]
mov dword[edi], eax
add edi, 4
mov byte[edi], ')' mov byte[edi], ')'
inc edi inc edi
@@ -2552,18 +2544,6 @@ db 'XBM',0
.end: .end:
db 0 db 0
BppTypeNames:
db '@08b'
db '@24b'
db '@32b'
db '@15b'
db '@16b'
db '@01b'
db '@8gr'
db '@02b'
db '@04b'
db '@08a'
draw_window_fake: draw_window_fake:
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------

View File

@@ -40,6 +40,7 @@ START:
mcall SF_SYS_MISC, SSF_MEM_OPEN, win_icons_name, , 0 mcall SF_SYS_MISC, SSF_MEM_OPEN, win_icons_name, , 0
add eax, 39*18*18*4 add eax, 39*18*18*4
mov [win_icons], eax
mov esi, eax mov esi, eax
mov edi, [pip_icon] mov edi, [pip_icon]
@@ -129,11 +130,25 @@ draw_window:
mcall , SSF_GET_SKIN_HEIGHT, mcall , SSF_GET_SKIN_HEIGHT,
mov ecx, eax mov ecx, eax
add ecx, WIN.Y * 65536 + WIN.H add ecx, WIN_Y * 65536 + WIN_H
mov edx, [win_cols.work] mov edx, [win_cols.work]
add edx, 0x34000000 add edx, 0x34000000
mcall SF_CREATE_WINDOW, <WIN.X, WIN.W>, , , , header mcall SF_CREATE_WINDOW, <WIN_X, WIN_W>, , , , header
; icon background color conversion
mov esi, [pip_icon]
mov ecx, 18*18
.icon_loop:
mov eax, [esi]
cmp eax, [win_cols.work]
jne .skip_change
mov ebx, [win_cols.work_light]
mov [esi], ebx
.skip_change:
add esi, 4
loop .icon_loop
call draw_base call draw_base
call draw_update call draw_update
@@ -147,30 +162,29 @@ draw_window:
; draw basic elements of window ; draw basic elements of window
draw_base: draw_base:
mcall SF_DRAW_RECT, <BUT_PIP.X, BUT_PIP.H>, <BUT_PIP.Y, BUT_PIP.H>, [win_cols.work_graph] mcall SF_DRAW_RECT, <BUT_PIP_X, BUT_PIP_H>, <BUT_PIP_Y, BUT_PIP_H>, [win_cols.work_graph]
mcall , <BUT_COL.X, BUT_COL.W>, , mcall , <BUT_COL_X, BUT_COL_W>, ,
mcall , <BUT_HEX.X, BUT_HEX.W>, <BUT_HEX.Y, BUT_HEX.H>, mcall , <BUT_HEX_X, BUT_HEX_W>, <BUT_HEX_Y, BUT_HEX_H>,
mcall , , <BUT_RGB.Y, BUT_HEX.H>, mcall , , <BUT_RGB_Y, BUT_HEX_H>,
mcall , <BUT_REC.X, BUT_REC.W>, <BUT_REC.Y, BUT_REC.H>, mcall , <BUT_REC_X, BUT_REC_W>, <BUT_REC_Y, BUT_REC_H>,
mcall , <BUT_PIP.X, BUT_PIP.H - 1>, <BUT_PIP.Y, BUT_PIP.H - 1>, [win_cols.work_dark] mcall , <BUT_PIP_X, BUT_PIP_H - 1>, <BUT_PIP_Y, BUT_PIP_H - 1>, [win_cols.work_dark]
mcall , <BUT_COL.X, BUT_COL.W - 1>, , mcall , <BUT_COL_X, BUT_COL_W - 1>, ,
mcall , <BUT_HEX.X, BUT_HEX.W - 1>, <BUT_HEX.Y, BUT_HEX.H - 1>, mcall , <BUT_HEX_X, BUT_HEX_W - 1>, <BUT_HEX_Y, BUT_HEX_H - 1>,
mcall , , <BUT_RGB.Y, BUT_HEX.H - 1>, mcall , , <BUT_RGB_Y, BUT_HEX_H - 1>,
mcall , <BUT_REC.X, BUT_REC.W - 1>, <BUT_REC.Y, BUT_REC.H - 1>, mcall , <BUT_REC_X, BUT_REC_W - 1>, <BUT_REC_Y, BUT_REC_H - 1>,
mcall , <BUT_PIP.X + 1, BUT_PIP.H - 2>, <BUT_PIP.Y + 1, BUT_PIP.H - 2>, [col_white]
mcall , <BUT_COL.X + 1, BUT_COL.W - 2>, ,
mcall , <BUT_HEX.X + 1, BUT_HEX.W - 2>, <BUT_HEX.Y + 1, BUT_HEX.H - 2>,
mcall , , <BUT_RGB.Y + 1, BUT_HEX.H - 2>,
mcall , <BUT_REC.X + 1, BUT_REC.W - 2>, <BUT_REC.Y + 1, BUT_REC.H - 2>,
mcall , <BUT_PIP_X + 1, BUT_PIP_H - 2>, <BUT_PIP_Y + 1, BUT_PIP_H - 2>, [win_cols.work_light]
mcall , <BUT_COL_X + 1, BUT_COL_W - 2>, , [win_cols.work_button_text]
mcall , <BUT_HEX_X + 1, BUT_HEX_W - 2>, <BUT_HEX_Y + 1, BUT_HEX_H - 2>,
mcall , , <BUT_RGB_Y + 1, BUT_HEX_H - 2>,
mcall , <BUT_REC_X + 1, BUT_REC_W - 2>, <BUT_REC_Y + 1, BUT_REC_H - 2>,
; buttons 11, 12, 13 and 14 ; buttons 11, 12, 13 and 14
mcall SF_DEFINE_BUTTON, <BUT_PIP.X + 1, BUT_PIP.W - 3>, <BUT_PIP.Y + 1, BUT_PIP.H - 3>, 0x4000000B mcall SF_DEFINE_BUTTON, <BUT_PIP_X + 1, BUT_PIP_W - 3>, <BUT_PIP_Y + 1, BUT_PIP_H - 3>, 0x4000000B
mcall , <BUT_HEX.X + 1, BUT_HEX.W - 3>, <BUT_HEX.Y + 1, BUT_HEX.H - 3>, 0x4000000C mcall , <BUT_HEX_X + 1, BUT_HEX_W - 3>, <BUT_HEX_Y + 1, BUT_HEX_H - 3>, 0x4000000C
mcall , , <BUT_RGB.Y + 1, BUT_RGB.H - 3>, 0x4000000D mcall , , <BUT_RGB_Y + 1, BUT_HEX_H - 3>, 0x4000000D
mcall , <BUT_REC.X + 2, BUT_REC.W - 4>, <BUT_REC.Y + 2, BUT_REC.H - 4>, 0x6000000E mcall , <BUT_REC_X + 2, BUT_REC_W - 4>, <BUT_REC_Y + 2, BUT_REC_H - 4>, 0x6000000E
; 18*18 pixels icon ; 18*18 pixels icon
mcall SF_PUT_IMAGE_EXT, [pip_icon], 0x00120012, 0x000B000F, 32 mcall SF_PUT_IMAGE_EXT, [pip_icon], 0x00120012, 0x000B000F, 32
@@ -182,12 +196,12 @@ draw_base:
draw_update: draw_update:
; current color rect ; current color rect
mcall SF_DRAW_RECT, <BUT_COL.X + 2, BUT_COL.W - 4>, <BUT_COL.Y + 2, BUT_COL.H - 4>, [sel_color] mcall SF_DRAW_RECT, <BUT_COL_X + 2, BUT_COL_W - 4>, <BUT_COL_Y + 2, BUT_COL_H - 4>, [sel_color]
; color codes ; color codes
mcall , <BUT_RGB.X + 1, BUT_HEX.W - 2>, <BUT_RGB.Y + 1, BUT_HEX.H - 2>, [col_white] mcall , <BUT_RGB_X + 1, BUT_HEX_W - 2>, <BUT_RGB_Y + 1, BUT_HEX_H - 2>, [win_cols.work_button_text]
mcall SF_DRAW_NUMBER, 0x00060100, [sel_color], <BUT_HEX.X + 26, BUT_HEX.Y + 5>, 0x50000000, [col_white] mcall SF_DRAW_NUMBER, 0x00060100, [sel_color], <BUT_HEX_X + 26, BUT_HEX_Y + 5>, 0x50000000, [win_cols.work_button_text]
mov ebx, 0x00030000 mov ebx, 0x00030000
xor ecx, ecx xor ecx, ecx
@@ -218,10 +232,10 @@ draw_update:
jle .du_loop_rect_row jle .du_loop_rect_row
mov ebx, 118 * 65536 + 12 mov ebx, 118 * 65536 + 12
add ecx, 12 * 65536 add ecx, 12 * 65536
.du_loop_rect_row: .du_loop_rect_row:
add esi, 3 add esi, 3
dec edi dec edi
cmp edi, 0
jne .du_loop_rect jne .du_loop_rect
; selection of one pixel from 7*7 grid ; selection of one pixel from 7*7 grid
@@ -253,16 +267,17 @@ draw_update:
; making pipet active again ; making pipet active again
make_pick_active: make_pick_active:
mov [pick_act], 0x01 mov [pick_act], 0x01
mov [cell_act_x], 0x03 mov [cell_act_x], 0x03
mov [cell_act_y], 0x03 mov [cell_act_y], 0x03
mcall SF_DRAW_RECT, <BUT_REC.X + 1, BUT_REC.W - 2>, <BUT_REC.Y + 1, BUT_REC.H - 2>, [col_white]
mcall SF_DRAW_TEXT, <BUT_REC.X + 28, BUT_REC.Y + 37>, 0x10000000, mes_pick, 4 mcall SF_DRAW_RECT, <BUT_REC_X + 1, BUT_REC_W - 2>, <BUT_REC_Y + 1, BUT_REC_H - 2>, [win_cols.work_button_text]
mcall SF_DRAW_TEXT, <BUT_REC_X + 28, BUT_REC_Y + 37>, 0x10000000, mes_pick, 4
mcall SF_SLEEP, 50 mcall SF_SLEEP, 50
mcall SF_DRAW_RECT, <BUT_PIP.X + 1, BUT_PIP.W - 2>, <BUT_PIP.Y + 1, BUT_PIP.H - 2>, [win_cols.work_light] mcall SF_DRAW_RECT, <BUT_PIP_X + 1, BUT_PIP_W - 2>, <BUT_PIP_Y + 1, BUT_PIP_H - 2>, [win_cols.work_light]
mcall SF_PUT_IMAGE_EXT, [pip_icon], 0x00120012, 0x000B000F, 32 mcall SF_PUT_IMAGE_EXT, [pip_icon], 0x00120012, 0x000B000F, 32
call draw_update call draw_update
@@ -330,9 +345,10 @@ clamp_pixels:
mov ax, dx mov ax, dx
.combine_coords: .combine_coords:
xor edx, edx
mov dx, cx mov dx, cx
shl edx, 16 rol edx, 16
or dx, ax mov dx, ax
ret ret
@@ -340,7 +356,7 @@ clamp_pixels:
; copy color HEX code ; copy color HEX code
copy_col_hex: copy_col_hex:
mcall SF_DRAW_RECT, <BUT_HEX.X + 2, BUT_HEX.W - 4>, <BUT_HEX.Y + 2, BUT_HEX.H - 4>, [col_white] mcall SF_DRAW_RECT, <BUT_HEX_X + 2, BUT_HEX_W - 4>, <BUT_HEX_Y + 2, BUT_HEX_H - 4>, [win_cols.work_button_text]
mov ebx, [sel_color] mov ebx, [sel_color]
mov ecx, 6 mov ecx, 6
@@ -360,10 +376,10 @@ copy_col_hex:
loop ch_loop loop ch_loop
mcall SF_CLIPBOARD, 2, color_hex.end - color_hex, color_hex mcall SF_CLIPBOARD, 2, color_hex.end - color_hex, color_hex
mcall SF_DRAW_TEXT, <BUT_HEX.X + 1, BUT_HEX.Y + 5>, 0x10000000, mes_copy, 12 mcall SF_DRAW_TEXT, <BUT_HEX_X + 1, BUT_HEX_Y + 5>, 0x10000000, mes_copy, 12
mcall SF_SLEEP, 50 mcall SF_SLEEP, 50
mcall SF_DRAW_RECT, <BUT_HEX.X + 1, BUT_HEX.W - 2>, <BUT_HEX.Y + 1, BUT_HEX.H - 2>, [col_white] mcall SF_DRAW_RECT, <BUT_HEX_X + 1, BUT_HEX_W - 2>, <BUT_HEX_Y + 1, BUT_HEX_H - 2>, [win_cols.work_button_text]
call draw_update call draw_update
jmp still jmp still
@@ -372,7 +388,7 @@ copy_col_hex:
; copy color RGB code ; copy color RGB code
copy_col_rgb: copy_col_rgb:
mcall SF_DRAW_RECT, <BUT_HEX.X + 2, BUT_HEX.W - 4>, <BUT_RGB.Y + 2, BUT_HEX.H - 4>, [col_white] mcall SF_DRAW_RECT, <BUT_HEX_X + 2, BUT_HEX_W - 4>, <BUT_RGB_Y + 2, BUT_HEX_H - 4>, [win_cols.work_button_text]
mov bl, 10 mov bl, 10
mov edx, [sel_color] mov edx, [sel_color]
@@ -396,14 +412,15 @@ copy_col_rgb:
shr edx, 8 shr edx, 8
sub esi, 4 sub esi, 4
dec edi dec edi
cmp edi, 0
jg cr_loop jg cr_loop
mcall SF_CLIPBOARD, 2, color_rgb.end - color_rgb, color_rgb mcall SF_CLIPBOARD, 2, color_rgb.end - color_rgb, color_rgb
mcall SF_DRAW_TEXT, <BUT_HEX.X + 1, BUT_RGB.Y + 5>, 0x10000000, mes_copy, 12 mcall SF_DRAW_TEXT, <BUT_HEX_X + 1, BUT_RGB_Y + 5>, 0x10000000, mes_copy, 12
mcall SF_SLEEP, 50 mcall SF_SLEEP, 50
mcall SF_DRAW_RECT, <BUT_HEX.X + 1, BUT_HEX.W - 2>, <BUT_RGB.Y + 1, BUT_HEX.H - 2>, [col_white] mcall SF_DRAW_RECT, <BUT_HEX_X + 1, BUT_HEX_W - 2>, <BUT_RGB_Y + 1, BUT_HEX_H - 2>, [win_cols.work_button_text]
call draw_update call draw_update
jmp still jmp still
@@ -440,27 +457,48 @@ pick_col_cell:
mov [sel_color], ebx mov [sel_color], ebx
call draw_update call draw_update
jmp still jmp still
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
WIN RECT 100,100,221,112 WIN_X = 100
WIN_W = 221
WIN_Y = 100
WIN_H = 112
BUT_PIP RECT 8, 12, 24, 24 BUT_PIP_X = 8
BUT_COL RECT 40, 12, 68, 24 BUT_PIP_W = 24
BUT_HEX RECT 8, 44,100, 24 BUT_PIP_Y = 12
BUT_RGB RECT 8, 76,100, 24 BUT_PIP_H = 24
BUT_REC RECT 116, 12, 88, 88
BUT_COL_X = 40
BUT_COL_W = 68
BUT_COL_Y = 12
BUT_COL_H = 24
BUT_HEX_X = 8
BUT_HEX_W = 100
BUT_HEX_Y = 44
BUT_HEX_H = 24
BUT_RGB_X = 8
BUT_RGB_Y = 76
BUT_REC_X = 116
BUT_REC_W = 88
BUT_REC_Y = 12
BUT_REC_H = 88
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
win_cols system_colors win_cols system_colors
win_icons_name db 'ICONS18', 0 win_icons_name db 'ICONS18W', 0
win_icons dd 0x00000000
pip_icon dd 0x00000000 pip_icon dd 0x00000000
col_white dd 0x00FFFFFF
if lang eq ru_RU if lang eq ru_RU
header db '<27><><EFBFBD><EFBFBD>⪠', 0 header db '<27><><EFBFBD><EFBFBD>⪠', 0
else if lang eq es_ES else if lang eq es_ES
header db 'Pipeta', 0 header db 'Pipeta', 0
else else

View File

@@ -1,4 +1,3 @@
#include "../system/kolibri.h"
void get_str_meminfo(char *str) { void get_str_meminfo(char *str) {
unsigned mem_all_mib = kol_system_mem() / 1024; unsigned mem_all_mib = kol_system_mem() / 1024;
@@ -7,28 +6,16 @@ void get_str_meminfo(char *str) {
} }
int cmd_kfetch(char param[]) { int cmd_kfetch(char param[]) {
struct kernel_version kv; char *str_krnl_ver = malloc(64);
int eol; get_str_kernel_version(str_krnl_ver, "%d.%d.%d.%d. SVN-rev.: %d");
kol_get_kernel_ver(&kv); char *str_uptime = malloc(64);
char str_os_rel_offset_dbgtag[24];
eol = sprintf(str_os_rel_offset_dbgtag, "%d.%d.%d.%d", kv.osrel[0],
kv.osrel[1], kv.osrel[2], kv.osrel[3]);
if (kv.offset)
eol += sprintf(str_os_rel_offset_dbgtag + eol, "+%u", kv.offset);
if (kv.dbgtag)
sprintf(str_os_rel_offset_dbgtag + eol, "-%c", kv.dbgtag);
char str_krn_abi_cmtid[32];
eol = sprintf(str_krn_abi_cmtid, "ABI %u.%u", kv.abimaj, kv.abimin);
if (kv.cmtid)
sprintf(str_krn_abi_cmtid + eol, ", git %08x", kv.cmtid);
char str_uptime[64];
get_str_uptime(str_uptime, "%d day(s), %d:%d:%d.%d"); get_str_uptime(str_uptime, "%d day(s), %d:%d:%d.%d");
char str_resolution[24]; char *str_resolution = malloc(24);
ksys_pos_t resol = _ksys_screen_size(); ksys_pos_t resol = _ksys_screen_size();
sprintf(str_resolution, "%u x %u", resol.x + 1, resol.y + 1); sprintf(str_resolution, "%u x %u", resol.x + 1, resol.y + 1);
char str_cpu_info[16]; char *str_cpu_info = malloc(16);
get_str_cpu_info(str_cpu_info); get_str_cpu_info(str_cpu_info);
char str_meminfo[24]; char *str_meminfo = malloc(24);
get_str_meminfo(str_meminfo); get_str_meminfo(str_meminfo);
printf( printf(
@@ -38,7 +25,7 @@ int cmd_kfetch(char param[]) {
"\033[0;5;34;40m8\033[0;1;30;45m8\033[0;5;35;44m:\033[0;5;37;44m8\033[0;37;46m@\033[0;5;36;40m8\033[0;32;40m;;\033[0;30;44m8\033[0;1;34;45m8\033[0;5;1;35;44m8\033[0;5;37;46m8\033[0;1;36;46m%%\033[0;1;30;40m8\033[0;31;40m \033[0;34;40m \033[0;32;40m.\033[0;34;40m.\033[0;31;40mt\033[0;34;46m8\033[0;5;37;46m@\033[0;5;37;47m.\033[0;5;37;46m%%\033[0;5;36;46m @\033[0;5;36;40m8\033[0;34;40mt \033[0;32;40m \033[0;34;40m \033[0m\n\r" "\033[0;5;34;40m8\033[0;1;30;45m8\033[0;5;35;44m:\033[0;5;37;44m8\033[0;37;46m@\033[0;5;36;40m8\033[0;32;40m;;\033[0;30;44m8\033[0;1;34;45m8\033[0;5;1;35;44m8\033[0;5;37;46m8\033[0;1;36;46m%%\033[0;1;30;40m8\033[0;31;40m \033[0;34;40m \033[0;32;40m.\033[0;34;40m.\033[0;31;40mt\033[0;34;46m8\033[0;5;37;46m@\033[0;5;37;47m.\033[0;5;37;46m%%\033[0;5;36;46m @\033[0;5;36;40m8\033[0;34;40mt \033[0;32;40m \033[0;34;40m \033[0m\n\r"
"\033[0;32;40m \033[0;1;30;44mX\033[0;37;45m8\033[0;5;35;44m.\033[0;5;35;45m;\033[0;5;35;44m \033[0;5;37;44m8\033[0;36;47m@\033[0;1;30;46m88\033[0;1;30;45m8\033[0;5;35;44m \033[0;5;37;45m8\033[0;1;34;47m8\033[0;1;30;46m@\033[0;5;36;40m8\033[0;34;40m:\033[0;32;40m \033[0;31;40m \033[0;1;30;44m8\033[0;5;36;46mt.\033[0;5;37;46mX8\033[0;1;30;46mS8\033[0;5;37;46m@\033[0;1;37;47mt\033[0;1;34;45m8\033[0;1;30;45m8\033[0;34;45m8\033[0;1;30;45m8\033[0;35;44m8\033[0;1;30;45m@\033[0;35;44m8\033[0;5;35;40m8\033[0;1;30;44m8\033[0;5;35;40m8\033[0;34;40m@\033[0m\n\r" "\033[0;32;40m \033[0;1;30;44mX\033[0;37;45m8\033[0;5;35;44m.\033[0;5;35;45m;\033[0;5;35;44m \033[0;5;37;44m8\033[0;36;47m@\033[0;1;30;46m88\033[0;1;30;45m8\033[0;5;35;44m \033[0;5;37;45m8\033[0;1;34;47m8\033[0;1;30;46m@\033[0;5;36;40m8\033[0;34;40m:\033[0;32;40m \033[0;31;40m \033[0;1;30;44m8\033[0;5;36;46mt.\033[0;5;37;46mX8\033[0;1;30;46mS8\033[0;5;37;46m@\033[0;1;37;47mt\033[0;1;34;45m8\033[0;1;30;45m8\033[0;34;45m8\033[0;1;30;45m8\033[0;35;44m8\033[0;1;30;45m@\033[0;35;44m8\033[0;5;35;40m8\033[0;1;30;44m8\033[0;5;35;40m8\033[0;34;40m@\033[0m\n\r"
"\033[0;31;40m :\033[0;5;34;40m8\033[0;1;30;45m8\033[0;1;34;47m8\033[0;1;35;45m:\033[0;5;1;34;45m8\033[0;5;37;44m8\033[0;5;1;35;44m8\033[0;1;36;47mX\033[0;1;34;47m@\033[0;37;46m8\033[0;5;36;44m.\033[0;5;35;45m.\033[0;5;36;46m%%\033[0;5;37;46mX\033[0;1;30;46m8%%\033[0;5;34;40m8\033[0;1;36;46m%%\033[0;5;36;46m \033[0;36;47m8\033[0;1;33;43mt\033[0;5;33;43m \033[0;1;33;47m8\033[0;5;33;43m \033[0;1;33;43m;\033[0;33;41m8\033[0;5;30;40m8\033[0;34;40m@S;\033[0;32;40m.\033[0;34;40m.\033[0;32;40m \033[0;31;40m \033[0;34;40m \033[0m\n\r" "\033[0;31;40m :\033[0;5;34;40m8\033[0;1;30;45m8\033[0;1;34;47m8\033[0;1;35;45m:\033[0;5;1;34;45m8\033[0;5;37;44m8\033[0;5;1;35;44m8\033[0;1;36;47mX\033[0;1;34;47m@\033[0;37;46m8\033[0;5;36;44m.\033[0;5;35;45m.\033[0;5;36;46m%%\033[0;5;37;46mX\033[0;1;30;46m8%%\033[0;5;34;40m8\033[0;1;36;46m%%\033[0;5;36;46m \033[0;36;47m8\033[0;1;33;43mt\033[0;5;33;43m \033[0;1;33;47m8\033[0;5;33;43m \033[0;1;33;43m;\033[0;33;41m8\033[0;5;30;40m8\033[0;34;40m@S;\033[0;32;40m.\033[0;34;40m.\033[0;32;40m \033[0;31;40m \033[0;34;40m \033[0m\n\r"
"\033[0;31;40m \033[0;34;40m .;\033[0;35;44m%%\033[0;35;47m8\033[0;5;35;44m \033[0;5;1;35;44m8\033[0;1;35;47m8\033[0;5;1;34;45m8\033[0;5;37;45m8\033[0;5;1;34;45m8\033[0;1;37;47m.\033[0;1;34;46m8\033[0;1;34;45m88\033[0;5;36;46m@;\033[0;1;36;46m.S\033[0;5;36;46m:8\033[0;5;37;43mX\033[0;5;33;41m \033[0;5;33;43m \033[0;5;1;33;41m8\033[0;1;30;43m8\033[0;31;40m;\033[0;34;40m.\033[0;32;40m::.\033[0;34;40m \033[0;32;40m \033[0;31;40m \033[0;34;40m \033[0m %s%s\n\r" "\033[0;31;40m \033[0;34;40m .;\033[0;35;44m%%\033[0;35;47m8\033[0;5;35;44m \033[0;5;1;35;44m8\033[0;1;35;47m8\033[0;5;1;34;45m8\033[0;5;37;45m8\033[0;5;1;34;45m8\033[0;1;37;47m.\033[0;1;34;46m8\033[0;1;34;45m88\033[0;5;36;46m@;\033[0;1;36;46m.S\033[0;5;36;46m:8\033[0;5;37;43mX\033[0;5;33;41m \033[0;5;33;43m \033[0;5;1;33;41m8\033[0;1;30;43m8\033[0;31;40m;\033[0;34;40m.\033[0;32;40m::.\033[0;34;40m \033[0;32;40m \033[0;31;40m \033[0;34;40m \033[0m %s\n\r"
"\033[0;31;40m \033[0;34;40m \033[0;32;40m \033[0;34;40m%%\033[0;5;35;40m8\033[0;1;30;45m8\033[0;5;1;35;44m8\033[0;35;47m8\033[0;5;35;44m;\033[0;1;34;45m8\033[0;5;35;44m;\033[0;5;1;34;45m8\033[0;5;37;44m8\033[0;1;35;47m@\033[0;1;34;47m@\033[0;1;36;46mS\033[0;1;36;47m@\033[0;5;37;46mX\033[0;5;36;46m88\033[0;1;30;43m8\033[0;5;1;31;43m8\033[0;5;33;41m \033[0;5;31;41mS\033[0;1;30;41m@\033[0;31;40m;\033[0;34;40m. \033[0;32;40m \033[0;31;40m \033[0;34;40m \033[0m %s%s\n\r" "\033[0;31;40m \033[0;34;40m \033[0;32;40m \033[0;34;40m%%\033[0;5;35;40m8\033[0;1;30;45m8\033[0;5;1;35;44m8\033[0;35;47m8\033[0;5;35;44m;\033[0;1;34;45m8\033[0;5;35;44m;\033[0;5;1;34;45m8\033[0;5;37;44m8\033[0;1;35;47m@\033[0;1;34;47m@\033[0;1;36;46mS\033[0;1;36;47m@\033[0;5;37;46mX\033[0;5;36;46m88\033[0;1;30;43m8\033[0;5;1;31;43m8\033[0;5;33;41m \033[0;5;31;41mS\033[0;1;30;41m@\033[0;31;40m;\033[0;34;40m. \033[0;32;40m \033[0;31;40m \033[0;34;40m \033[0m %s%s\n\r"
"\033[0;31;40m \033[0;34;40m \033[0;32;40m \033[0;34;40m ;\033[0;32;40m%%\033[0;34;40m8\033[0;1;30;44m@\033[0;1;30;45m8\033[0;1;34;45m8\033[0;37;45m@\033[0;1;30;45m8\033[0;1;34;45m88\033[0;5;35;44mX\033[0;1;30;46m8\033[0;36;47m8\033[0;5;36;46mX\033[0;5;37;42m8\033[0;37;46mS\033[0;1;32;47m8\033[0;37;43mS\033[0;1;32;46m8\033[0;5;33;40mS\033[0;32;40m:\033[0;34;40m \033[0;32;40m \033[0;34;40m \033[0;32;40m \033[0;31;40m \033[0;34;40m \033[0m\n\r" "\033[0;31;40m \033[0;34;40m \033[0;32;40m \033[0;34;40m ;\033[0;32;40m%%\033[0;34;40m8\033[0;1;30;44m@\033[0;1;30;45m8\033[0;1;34;45m8\033[0;37;45m@\033[0;1;30;45m8\033[0;1;34;45m88\033[0;5;35;44mX\033[0;1;30;46m8\033[0;36;47m8\033[0;5;36;46mX\033[0;5;37;42m8\033[0;37;46mS\033[0;1;32;47m8\033[0;37;43mS\033[0;1;32;46m8\033[0;5;33;40mS\033[0;32;40m:\033[0;34;40m \033[0;32;40m \033[0;34;40m \033[0;32;40m \033[0;31;40m \033[0;34;40m \033[0m\n\r"
"\033[0;32;40m \033[0;34;40m :\033[0;32;40m;\033[0;34;40m:S\033[0;5;34;40m@\033[0;1;30;45m8\033[0;5;34;44m.\033[0;1;30;45m8\033[0;34;45m8\033[0;1;30;45m8\033[0;1;34;46m8\033[0;5;36;46m8\033[0;5;33;43m \033[0;5;37;42m8\033[0;5;37;46m8\033[0;1;33;47mX\033[0;5;36;42m;\033[0;1;36;46m%%\033[0;32;40m@.\033[0;34;40m. \033[0;32;40m \033[0;34;40m \033[0m %s%s\n\r" "\033[0;32;40m \033[0;34;40m :\033[0;32;40m;\033[0;34;40m:S\033[0;5;34;40m@\033[0;1;30;45m8\033[0;5;34;44m.\033[0;1;30;45m8\033[0;34;45m8\033[0;1;30;45m8\033[0;1;34;46m8\033[0;5;36;46m8\033[0;5;33;43m \033[0;5;37;42m8\033[0;5;37;46m8\033[0;1;33;47mX\033[0;5;36;42m;\033[0;1;36;46m%%\033[0;32;40m@.\033[0;34;40m. \033[0;32;40m \033[0;34;40m \033[0m %s%s\n\r"
@@ -54,8 +41,13 @@ int cmd_kfetch(char param[]) {
"\033[0;34;40m \033[0;31;40m \033[0;32;40m \033[0;31;40m.\033[0;32;40m;\033[0;34;40m;8\033[0;32;40m%%\033[0;5;34;40m8\033[0;34;40m8\033[0;1;30;44m8\033[0;1;30;40m8\033[0;34;40m;.\033[0;31;40m \033[0;34;40m \033[0;31;40m \033[0;34;40m \033[0m\n\r" "\033[0;34;40m \033[0;31;40m \033[0;32;40m \033[0;31;40m.\033[0;32;40m;\033[0;34;40m;8\033[0;32;40m%%\033[0;5;34;40m8\033[0;34;40m8\033[0;1;30;44m8\033[0;1;30;40m8\033[0;34;40m;.\033[0;31;40m \033[0;34;40m \033[0;31;40m \033[0;34;40m \033[0m\n\r"
"\033[0;34;40m \033[0;32;40m \033[0;31;40m \033[0;32;40m.\033[0;31;40m.\033[0;32;40m.\033[0;31;40m.\033[0;32;40m.\033[0;31;40m:. \033[0;32;40m. \033[0;34;40m \033[0;31;40m \033[0;34;40m \033[0m\n\r", "\033[0;34;40m \033[0;32;40m \033[0;31;40m \033[0;32;40m.\033[0;31;40m.\033[0;32;40m.\033[0;31;40m.\033[0;32;40m.\033[0;31;40m:. \033[0;32;40m. \033[0;34;40m \033[0;31;40m \033[0;34;40m \033[0m\n\r",
"\033[0;36mOS\033[0m: KolibriOS ", str_os_rel_offset_dbgtag, "\033[0;36mKernel\033[0m: ", str_krn_abi_cmtid, "\033[0;36mUptime\033[0m: ", str_uptime, "\033[0;36mResolution\033[0m: ", str_resolution, "\033[0;36mCPU\033[0m: ", str_cpu_info, "\033[0;36mMemory\033[0m: ", str_meminfo "\033[0;36mOS\033[0m: KolibriOS", "\033[0;36mKernel\033[0m: ", str_krnl_ver, "\033[0;36mUptime\033[0m: ", str_uptime, "\033[0;36mResolution\033[0m: ", str_resolution, "\033[0;36mCPU\033[0m: ", str_cpu_info, "\033[0;36mMemory\033[0m: ", str_meminfo
); );
free(str_krnl_ver);
free(str_uptime);
free(str_resolution);
free(str_cpu_info);
free(str_meminfo);
return TRUE; return TRUE;
} }

View File

@@ -1,21 +1,20 @@
#include "../system/kolibri.h"
void get_str_kernel_version(char *str, const char *fmt) { void get_str_kernel_version(char *str, const char *fmt) {
struct kernel_version kv; char *kvbuf;
char *vA, *vB, *vC, *vD;
unsigned *Rev;
kol_get_kernel_ver(&kv); kvbuf = malloc(16);
char str_offset[8] = {'\0'}; kol_get_kernel_ver(kvbuf);
if (kv.offset) vA = kvbuf+0;
sprintf(str_offset, "+%u", kv.offset); vB = kvbuf+1;
char str_dbgtag[4] = {'\0'}; vC = kvbuf+2;
if (kv.dbgtag) vD = kvbuf+3;
sprintf(str_dbgtag, "-%c", kv.dbgtag); Rev = (unsigned*)(kvbuf + 5);
char str_cmtid[16] = {'\0'};
if (kv.cmtid)
sprintf(str_cmtid, " (%08x)", kv.cmtid);
sprintf(str, fmt, kv.osrel[0], kv.osrel[1], kv.osrel[2], kv.osrel[3], sprintf (str, fmt, *vA, *vB, *vC, *vD, *Rev);
str_offset, str_dbgtag, str_cmtid, kv.abimaj, kv.abimin);
free(kvbuf);
} }
void get_str_cpu_info(char *str) { void get_str_cpu_info(char *str) {

View File

@@ -59,7 +59,7 @@ const command_t COMMANDS[]=
#define CMD_SLEEP_USAGE " sleep <time in the 1/100 of second>\n\r" #define CMD_SLEEP_USAGE " sleep <time in the 1/100 of second>\n\r"
#define CMD_TOUCH_USAGE " touch <filename>\n\r" #define CMD_TOUCH_USAGE " touch <filename>\n\r"
#define CMD_UPTIME_FMT " Uptime: %d day(s), %d:%d:%d.%d\n\r" #define CMD_UPTIME_FMT " Uptime: %d day(s), %d:%d:%d.%d\n\r"
#define CMD_VER_FMT1 " KolibriOS v%u.%u.%u.%u%s%s%s, kernel ABI %u.%u\n\r" #define CMD_VER_FMT1 " KolibriOS v%d.%d.%d.%d. Kernel SVN-rev.: %d\n\r"
#define CMD_WAITFOR_FMT " Awaing finish PID %d\n\r" #define CMD_WAITFOR_FMT " Awaing finish PID %d\n\r"
#define EXEC_STARTED_FMT " '%s' started. PID = %d\n\r" #define EXEC_STARTED_FMT " '%s' started. PID = %d\n\r"
#define EXEC_SCRIPT_ERROR_FMT "Error in '%s' : script must start with #SHS line\n\r" #define EXEC_SCRIPT_ERROR_FMT "Error in '%s' : script must start with #SHS line\n\r"

View File

@@ -59,10 +59,10 @@ const command_t COMMANDS[]=
#define CMD_SLEEP_USAGE " sleep <<3C><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>x ᥪ㭤<E1A5AA>>\n\r" #define CMD_SLEEP_USAGE " sleep <<3C><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>x ᥪ㭤<E1A5AA>>\n\r"
#define CMD_TOUCH_USAGE " touch <<3C><><EFBFBD><><E4A0A9>>\n\r" #define CMD_TOUCH_USAGE " touch <<3C><><EFBFBD><><E4A0A9>>\n\r"
#define CMD_UPTIME_FMT " Uptime: %d <20><><EFBFBD><EFBFBD>, %d:%d:%d.%d\n\r" #define CMD_UPTIME_FMT " Uptime: %d <20><><EFBFBD><EFBFBD>, %d:%d:%d.%d\n\r"
#define CMD_VER_FMT1 " KolibriOS v%u.%u.%u.%u%s%s%s, ABI <20><><EFBFBD><EFBFBD>: %u.%u\n\r" #define CMD_VER_FMT1 " KolibriOS v%d.%d.%d.%d. SVN-ॢ. <20><><EFBFBD><EFBFBD>: %d\n\r"
#define CMD_WAITFOR_FMT " <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E8A5AD> PID %d\n\r" #define CMD_WAITFOR_FMT " <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E8A5AD> PID %d\n\r"
#define EXEC_STARTED_FMT " '%s' <20><><EFBFBD><EFBFBD>饭. PID = %d\n\r" #define EXEC_STARTED_FMT " '%s' <20><><EFBFBD><EFBFBD>饭. PID = %d\n\r"
#define EXEC_SCRIPT_ERROR_FMT "<22><EFBFBD><E8A8A1> <20> '%s' : <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><E7A8AD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>窨 #SHS\n\r" #define EXEC_SCRIPT_ERROR_FMT "<22><EFBFBD><E8A8A1> <20> '%s' : <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><E7A8AD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>窨 #SHS\n\r"
#define UNKNOWN_CMD_ERROR " <20><EFBFBD><E8A8A1>!\n\r" #define UNKNOWN_CMD_ERROR " <20><EFBFBD><E8A8A1>!\n\r"
#define CON_APP_ERROR " <20><EFBFBD><E8A8A1> <20> <20><><EFBFBD>᮫쭮<E1AEAB> <20><EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\n\r" #define CON_APP_ERROR " <20><EFBFBD><E8A8A1> <20> <20><><EFBFBD>᮫쭮<E1AEAB> <20><EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\n\r"
#define FILE_NOT_FOUND_ERROR " <20><><EFBFBD><EFBFBD> '%s' <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\n\r" #define FILE_NOT_FOUND_ERROR " <20><><EFBFBD><EFBFBD> '%s' <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\n\r"

View File

@@ -405,9 +405,9 @@ int kol_kill_process(unsigned process)
asm volatile ("int $0x40"::"a"(18), "b"(2), "c"(process)); asm volatile ("int $0x40"::"a"(18), "b"(2), "c"(process));
} }
void kol_get_kernel_ver(struct kernel_version *kv) void kol_get_kernel_ver(char buff16b[])
{ {
asm volatile ("int $0x40"::"a"(18), "b"(13), "c"(kv):"memory"); asm volatile ("int $0x40"::"a"(18), "b"(13), "c"(buff16b));
} }
int kol_buffer_open(char name[], int mode, int size, char **buf) int kol_buffer_open(char name[], int mode, int size, char **buf)

View File

@@ -1,7 +1,3 @@
#ifndef KOLIBRI_H_INCLUDED
#define KOLIBRI_H_INCLUDED
#include <stdint.h>
#define NULL ((void*)0) #define NULL ((void*)0)
@@ -58,15 +54,6 @@ void *data;
} kol_struct_import; } kol_struct_import;
#pragma pack(pop) #pragma pack(pop)
struct kernel_version {
unsigned char osrel[4];
char dbgtag;
uint8_t abimin;
uint16_t abimaj;
uint32_t cmtid;
uint16_t reserved;
uint16_t offset;
};
void kol_exit(); void kol_exit();
void kol_sleep(unsigned d); void kol_sleep(unsigned d);
@@ -121,7 +108,7 @@ unsigned kol_time_tick();
unsigned kol_sound_speaker(char data[]); unsigned kol_sound_speaker(char data[]);
unsigned kol_process_info(unsigned slot, char buf1k[]); unsigned kol_process_info(unsigned slot, char buf1k[]);
int kol_process_kill_pid(unsigned process); int kol_process_kill_pid(unsigned process);
void kol_get_kernel_ver(struct kernel_version *kv); void kol_get_kernel_ver(char buff16b[]);
int kol_kill_process(unsigned process); int kol_kill_process(unsigned process);
int kol_buffer_open(char name[], int mode, int size, char **buf); int kol_buffer_open(char name[], int mode, int size, char **buf);
void kol_buffer_close(char name[]); void kol_buffer_close(char name[]);
@@ -131,4 +118,3 @@ void kol_buffer_close(char name[]);
void set_cwd(const char* cwd); void set_cwd(const char* cwd);
int getcwd(char *buf, unsigned size); int getcwd(char *buf, unsigned size);
#endif // KOLIBRI_H_INCLUDED