forked from KolibriOS/kolibrios
Compare commits
36 Commits
add-readme
...
update-dem
Author | SHA1 | Date | |
---|---|---|---|
8d5a695ee4 | |||
bd3ce6c50c | |||
0f98b9c0e4 | |||
da1237a6d6 | |||
908e9eaa12 | |||
2c496cfd05 | |||
81b15607dc | |||
30d8d45326 | |||
9a23c001e1 | |||
64b7372624 | |||
d04420295a | |||
2935b29fd8 | |||
505f741fbd | |||
5a852ebdfb | |||
026d2aba40 | |||
|
9b08b20cc3 | ||
38fdd13e0c | |||
d9679f5f81 | |||
92ea2a97eb | |||
98cccc438c | |||
79d9f42085 | |||
b39150ecea | |||
1a40899780 | |||
25b79ca6d1 | |||
2e3548d92a | |||
ed8e4ecf33 | |||
6a9608c7a4 | |||
d8c6274d19 | |||
1df7b2fd4c | |||
9001dbc1b4 | |||
c11c7922bd | |||
739facfeca | |||
8c9a971e2c | |||
5aa17d5823 | |||
4d6ef342e1 | |||
8e5b315fd4 |
213
.gitea/workflows/build.yaml
Normal file
213
.gitea/workflows/build.yaml
Normal file
@@ -0,0 +1,213 @@
|
|||||||
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
|
# SPDX-FileCopyrightText: 2025 KolibriOS team
|
||||||
|
|
||||||
|
name: 'Build system'
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- 'main'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
codestyle:
|
||||||
|
name: "Check kernel codestyle"
|
||||||
|
runs-on: kolibri-toolchain
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Check codestyle
|
||||||
|
run: |
|
||||||
|
find kernel/trunk -iname '*.asm' -or -iname '*.inc' -exec bash -c "echo {}; cat {} | perl .gitea/workflows/checker.pl" \;
|
||||||
|
|
||||||
|
build:
|
||||||
|
name: 'Build'
|
||||||
|
runs-on: kolibri-toolchain
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Get describe
|
||||||
|
id: vars
|
||||||
|
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITEA_OUTPUT
|
||||||
|
|
||||||
|
- name: Get toolchain hash
|
||||||
|
id: toolchain-hash
|
||||||
|
run: |
|
||||||
|
a=$(find ${{ gitea.workspace }}/programs/develop/cmm/ -type f -print0 | sort -z | xargs -0 sha1sum)
|
||||||
|
b=$(sha1sum ${{ gitea.workspace }}/programs/develop/ktcc/trunk/bin/kos32-tcc)
|
||||||
|
c=$(find ${{ gitea.workspace }}/programs/develop/objconv/ -type f -print0 | sort -z | xargs -0 sha1sum)
|
||||||
|
d=$(find ${{ gitea.workspace }}/programs/other/kpack/kerpack_linux/ -type f -print0 | sort -z | xargs -0 sha1sum)
|
||||||
|
e=$(find ${{ gitea.workspace }}/programs/other/kpack/linux/ -type f -print0 | sort -z | xargs -0 sha1sum)
|
||||||
|
f=$(find ${{ gitea.workspace }}/programs/develop/clink/ -type f -print0 | sort -z | xargs -0 sha1sum)
|
||||||
|
echo hash=$(echo $a $b $c $d $e $f | sha1sum | awk '{print $1}') >> $GITEA_OUTPUT
|
||||||
|
|
||||||
|
- name: Restore toolchain
|
||||||
|
id: cache-toolchain
|
||||||
|
uses: actions/cache/restore@v4
|
||||||
|
with:
|
||||||
|
path: /home/autobuild
|
||||||
|
key: kolibri-toolchain-${{ steps.toolchain-hash.outputs.hash }}
|
||||||
|
|
||||||
|
- name: Build and install C--
|
||||||
|
if: steps.cache-toolchain.outputs.cache-hit != 'true'
|
||||||
|
run: |
|
||||||
|
cd ${{ gitea.workspace }}/programs/develop/cmm/
|
||||||
|
make -f Makefile.lin32
|
||||||
|
chmod +x c--
|
||||||
|
mv c-- /home/autobuild/tools/win32/bin/c--
|
||||||
|
cp ${{ gitea.workspace }}/programs/cmm/c--/c--.ini /home/autobuild/tools/win32/bin/c--.ini
|
||||||
|
make -f Makefile.lin32 clean
|
||||||
|
|
||||||
|
- name: Install TCC
|
||||||
|
if: steps.cache-toolchain.outputs.cache-hit != 'true'
|
||||||
|
run: |
|
||||||
|
cp ${{ gitea.workspace }}/programs/develop/ktcc/trunk/bin/kos32-tcc /home/autobuild/tools/win32/bin/kos32-tcc
|
||||||
|
chmod +x /home/autobuild/tools/win32/bin/kos32-tcc
|
||||||
|
|
||||||
|
- name: Build and install objconv
|
||||||
|
if: steps.cache-toolchain.outputs.cache-hit != 'true'
|
||||||
|
run: |
|
||||||
|
cd ${{ gitea.workspace }}/programs/develop/objconv/
|
||||||
|
g++ -o /home/autobuild/tools/win32/bin/objconv -O2 *.cpp
|
||||||
|
chmod +x /home/autobuild/tools/win32/bin/objconv
|
||||||
|
|
||||||
|
- name: Build and install kerpack
|
||||||
|
if: steps.cache-toolchain.outputs.cache-hit != 'true'
|
||||||
|
run: |
|
||||||
|
cd ${{ gitea.workspace }}/programs/other/kpack/kerpack_linux/
|
||||||
|
make
|
||||||
|
chmod +x kerpack
|
||||||
|
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/.
|
||||||
|
|
||||||
|
- name: Build and install clink
|
||||||
|
if: steps.cache-toolchain.outputs.cache-hit != 'true'
|
||||||
|
run: |
|
||||||
|
cd ${{ gitea.workspace }}/programs/develop/clink
|
||||||
|
gcc main.c -o clink
|
||||||
|
chmod a+x clink
|
||||||
|
mv clink /home/autobuild/tools/win32/bin/clink
|
||||||
|
|
||||||
|
- name: Prepare cache folder
|
||||||
|
run: |
|
||||||
|
rm /home/autobuild
|
||||||
|
mv /root/autobuild /home/autobuild
|
||||||
|
if: steps.cache-toolchain.outputs.cache-hit != 'true'
|
||||||
|
|
||||||
|
- name: Save toolchain
|
||||||
|
if: steps.cache-toolchain.outputs.cache-hit != 'true'
|
||||||
|
uses: actions/cache/save@v4
|
||||||
|
with:
|
||||||
|
path: /home/autobuild
|
||||||
|
key: kolibri-toolchain-${{ steps.toolchain-hash.outputs.hash }}
|
||||||
|
|
||||||
|
- name: Configure tup
|
||||||
|
run: |
|
||||||
|
cd ${{ gitea.workspace }}
|
||||||
|
|
||||||
|
export ROOT=${{ gitea.workspace }}
|
||||||
|
echo "CONFIG_KPACK_CMD= && kpack --nologo %o" | tee en_US.config ru_RU.config es_ES.config
|
||||||
|
echo "CONFIG_KERPACK_CMD= && kerpack %o" | tee -a en_US.config ru_RU.config es_ES.config
|
||||||
|
echo "CONFIG_PESTRIP_CMD= && EXENAME=%o fasm $ROOT/data/common/pestrip.asm %o" | tee -a en_US.config ru_RU.config es_ES.config
|
||||||
|
echo "CONFIG_NO_MSVC=full" | tee -a en_US.config ru_RU.config es_ES.config
|
||||||
|
echo "CONFIG_INSERT_REVISION_ID=1" | tee -a en_US.config ru_RU.config es_ES.config
|
||||||
|
|
||||||
|
tup -v
|
||||||
|
tup init
|
||||||
|
|
||||||
|
# Configure en_US
|
||||||
|
echo "CONFIG_LANG=en_US" >> en_US.config
|
||||||
|
echo "CONFIG_BUILD_TYPE=en_US" >> en_US.config
|
||||||
|
tup variant en_US.config
|
||||||
|
|
||||||
|
# Configure ru_RU
|
||||||
|
echo "CONFIG_LANG=ru_RU" >> ru_RU.config
|
||||||
|
echo "CONFIG_BUILD_TYPE=ru_RU" >> ru_RU.config
|
||||||
|
tup variant ru_RU.config
|
||||||
|
|
||||||
|
# Configure es_ES
|
||||||
|
echo "CONFIG_LANG=es_ES" >> es_ES.config
|
||||||
|
echo "CONFIG_BUILD_TYPE=es_ES" >> es_ES.config
|
||||||
|
tup variant es_ES.config
|
||||||
|
|
||||||
|
# -------------------------- Build en_US ------------------------- #
|
||||||
|
- name: (en_US) Build KolibriOS
|
||||||
|
run: |
|
||||||
|
export PATH=/home/autobuild/tools/win32/bin:$PATH
|
||||||
|
tup build-en_US
|
||||||
|
|
||||||
|
- name: (en_US) Upload floppy image
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: kolibrios-en_US-${{ steps.vars.outputs.sha_short }}.img
|
||||||
|
path: build-en_US/data/kolibri.img
|
||||||
|
|
||||||
|
- name: (en_US) Upload CD image
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: kolibrios-en_US-${{ steps.vars.outputs.sha_short }}.iso
|
||||||
|
path: build-en_US/data/kolibri.iso
|
||||||
|
|
||||||
|
- name: (en_US) Upload raw image
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: kolibrios-en_US-${{ steps.vars.outputs.sha_short }}.raw
|
||||||
|
path: build-en_US/data/kolibri.raw
|
||||||
|
|
||||||
|
# -------------------------- Build ru_RU ------------------------- #
|
||||||
|
- name: (ru_RU) Build KolibriOS
|
||||||
|
run: |
|
||||||
|
export PATH=/home/autobuild/tools/win32/bin:$PATH
|
||||||
|
tup build-ru_RU
|
||||||
|
|
||||||
|
- name: (ru_RU) Upload floppy image
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: kolibrios-ru_RU-${{ steps.vars.outputs.sha_short }}.img
|
||||||
|
path: build-ru_RU/data/kolibri.img
|
||||||
|
|
||||||
|
- name: (ru_RU) Upload CD image
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: kolibrios-ru_RU-${{ steps.vars.outputs.sha_short }}.iso
|
||||||
|
path: build-ru_RU/data/kolibri.iso
|
||||||
|
|
||||||
|
- name: (ru_RU) Upload raw image
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: kolibrios-ru_RU-${{ steps.vars.outputs.sha_short }}.raw
|
||||||
|
path: build-ru_RU/data/kolibri.raw
|
||||||
|
|
||||||
|
# -------------------------- Build es_ES ------------------------- #
|
||||||
|
- name: (es_ES) Build KolibriOS
|
||||||
|
run: |
|
||||||
|
export PATH=/home/autobuild/tools/win32/bin:$PATH
|
||||||
|
tup build-es_ES
|
||||||
|
|
||||||
|
- name: (es_ES) Upload floppy image
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: kolibrios-es_ES-${{ steps.vars.outputs.sha_short }}.img
|
||||||
|
path: build-es_ES/data/kolibri.img
|
||||||
|
|
||||||
|
- name: (es_ES) Upload CD image
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: kolibrios-es_ES-${{ steps.vars.outputs.sha_short }}.iso
|
||||||
|
path: build-es_ES/data/kolibri.iso
|
||||||
|
|
||||||
|
- name: (es_ES) Upload raw image
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: kolibrios-es_ES-${{ steps.vars.outputs.sha_short }}.raw
|
||||||
|
path: build-es_ES/data/kolibri.raw
|
54
.gitea/workflows/checker.pl
Normal file
54
.gitea/workflows/checker.pl
Normal file
File diff suppressed because one or more lines are too long
82
.gitea/workflows/install_kgcc
Normal file
82
.gitea/workflows/install_kgcc
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
|
# SPDX-FileCopyrightText: 2025 KolibriOS Team
|
||||||
|
|
||||||
|
# Written by mxlgv (Maxim Logaev)
|
||||||
|
# Installation steps described by maxcodehack (Maxim Kuzmitsky)
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
print_msg(){
|
||||||
|
echo -e "\e[34m$1\e[0m"
|
||||||
|
}
|
||||||
|
|
||||||
|
print_ok(){
|
||||||
|
echo -e "\e[32m$1\e[0m"
|
||||||
|
}
|
||||||
|
|
||||||
|
print_err(){
|
||||||
|
echo -e "\e[31m$1\e[0m"
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
|
||||||
|
check_utils(){
|
||||||
|
printf "%s: " $1
|
||||||
|
if command -v $1 &> /dev/null
|
||||||
|
then
|
||||||
|
print_ok "ok\r"
|
||||||
|
else
|
||||||
|
print_err "no\r"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
print_msg "Checking utilities..."
|
||||||
|
|
||||||
|
check_utils wget
|
||||||
|
check_utils 7z
|
||||||
|
|
||||||
|
print_msg "Create the /home/autobuild folder..."
|
||||||
|
sudo rm -rf ~/autobuild /home/autobuild
|
||||||
|
mkdir -p ~/autobuild/tools
|
||||||
|
sudo ln -sf ~/autobuild /home/autobuild
|
||||||
|
print_ok "Successfully!"
|
||||||
|
|
||||||
|
print_msg "Download the kos32-gcc toolchain..."
|
||||||
|
wget http://ftp.kolibrios.org/users/Serge/new/Toolchain/x86_64-linux-kos32-5.4.0.7z -O ~/autobuild/tools/kos32-toolchain.7z
|
||||||
|
print_ok "Successfully!"
|
||||||
|
|
||||||
|
print_msg "Extracting files ..."
|
||||||
|
cd ~/autobuild/tools/
|
||||||
|
7z x -y kos32-toolchain.7z
|
||||||
|
rm -rf kos32-toolchain.7z
|
||||||
|
print_ok "Successfully!"
|
||||||
|
|
||||||
|
print_msg "Downloading libisl..."
|
||||||
|
cd /tmp
|
||||||
|
sudo wget http://board.kolibrios.org/download/file.php?id=8301libisl.so.10.2.2.7z -O /tmp/libisl.so.10.2.2.7z
|
||||||
|
sudo 7z x -y libisl.so.10.2.2.7z
|
||||||
|
|
||||||
|
if ! [ -d /usr/lib/x86_64-linux-gnu/ ]; then
|
||||||
|
sudo mkdir -p /usr/lib/x86_64-linux-gnu/
|
||||||
|
fi
|
||||||
|
|
||||||
|
print_msg "Fixing libisl..."
|
||||||
|
sudo mv /tmp/libisl.so.10.2.2 /usr/lib/x86_64-linux-gnu/libisl.so.10.2.2
|
||||||
|
sudo ln -sf /usr/lib/x86_64-linux-gnu/libisl.so.10.2.2 /usr/lib/x86_64-linux-gnu/libisl.so.10
|
||||||
|
sudo ln -sf /usr/lib/x86_64-linux-gnu/libisl.so.10.2.2 /usr/lib/libisl.so.10
|
||||||
|
sudo chmod go-w /usr/lib/x86_64-linux-gnu/libisl.so.10
|
||||||
|
sudo chmod go-w /usr/lib/x86_64-linux-gnu/libisl.so.10.2.2
|
||||||
|
print_ok "Successfully!"
|
||||||
|
|
||||||
|
print_msg "Fixing libmpfr..."
|
||||||
|
sudo ln -sf /usr/lib/x86_64-linux-gnu/libmpfr.so.6 /usr/lib/x86_64-linux-gnu/libmpfr.so.4
|
||||||
|
sudo ln -sf /usr/lib/libmpfr.so.6 /usr/lib/libmpfr.so.4
|
||||||
|
print_ok "Successfully!"
|
||||||
|
|
||||||
|
if ! grep -q 'export PATH=$PATH:/home/autobuild/tools/win32/bin' ~/.bashrc; then
|
||||||
|
export PATH=$PATH:/home/autobuild/tools/win32/bin
|
||||||
|
print_msg "Adding '/home/autobuild/tools/win32/bin' to '~/.bashrc'"
|
||||||
|
echo 'export PATH=$PATH:/home/autobuild/tools/win32/bin' >> ~/.bashrc
|
||||||
|
fi
|
||||||
|
print_ok "Installation was successful!"
|
@@ -407,6 +407,7 @@ tup.append_table(img_files, {
|
|||||||
{"@SS", VAR_PROGS .. "/system/scrsaver/scrsaver"},
|
{"@SS", VAR_PROGS .. "/system/scrsaver/scrsaver"},
|
||||||
{"@VOLUME", VAR_PROGS .. "/media/volume/volume"},
|
{"@VOLUME", VAR_PROGS .. "/media/volume/volume"},
|
||||||
{"HACONFIG", VAR_PROGS .. "/other/ha/HACONFIG"},
|
{"HACONFIG", VAR_PROGS .. "/other/ha/HACONFIG"},
|
||||||
|
{"ACLOCK", VAR_PROGS .. "/demos/aclock/aclock"},
|
||||||
{"APM", VAR_PROGS .. "/system/apm/apm"},
|
{"APM", VAR_PROGS .. "/system/apm/apm"},
|
||||||
{"CALC", VAR_PROGS .. "/other/calc/trunk/calc"},
|
{"CALC", VAR_PROGS .. "/other/calc/trunk/calc"},
|
||||||
{"CALENDAR", VAR_PROGS .. "/system/calendar/trunk/calendar"},
|
{"CALENDAR", VAR_PROGS .. "/system/calendar/trunk/calendar"},
|
||||||
@@ -441,6 +442,8 @@ tup.append_table(img_files, {
|
|||||||
{"TERMINAL", VAR_PROGS .. "/system/terminal/terminal"},
|
{"TERMINAL", VAR_PROGS .. "/system/terminal/terminal"},
|
||||||
{"TEST", VAR_PROGS .. "/testing/protection/trunk/test"},
|
{"TEST", VAR_PROGS .. "/testing/protection/trunk/test"},
|
||||||
{"TINYPAD", VAR_PROGS .. "/develop/tinypad/trunk/tinypad"},
|
{"TINYPAD", VAR_PROGS .. "/develop/tinypad/trunk/tinypad"},
|
||||||
|
{"TINFO", VAR_PROGS .. "/system/tinfo/tinfo"},
|
||||||
|
{"TIMER", VAR_PROGS .. "/other/Timer/Timer"},
|
||||||
{"UNZ", VAR_PROGS .. "/fs/unz/unz"},
|
{"UNZ", VAR_PROGS .. "/fs/unz/unz"},
|
||||||
{"ZKEY", VAR_PROGS .. "/system/zkey/trunk/ZKEY"},
|
{"ZKEY", VAR_PROGS .. "/system/zkey/trunk/ZKEY"},
|
||||||
{"3D/3DWAV", VAR_PROGS .. "/demos/3dwav/trunk/3dwav"},
|
{"3D/3DWAV", VAR_PROGS .. "/demos/3dwav/trunk/3dwav"},
|
||||||
@@ -453,37 +456,38 @@ tup.append_table(img_files, {
|
|||||||
{"DEMOS/BCDCLK", VAR_PROGS .. "/demos/bcdclk/trunk/bcdclk"},
|
{"DEMOS/BCDCLK", VAR_PROGS .. "/demos/bcdclk/trunk/bcdclk"},
|
||||||
{"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/trunk/firework"},
|
{"DEMOS/FIREWORK", VAR_PROGS .. "/demos/firework/firework"},
|
||||||
{"DEMOS/MOVBACK", VAR_PROGS .. "/demos/movback/trunk/movback"},
|
{"DEMOS/MOVBACK", VAR_PROGS .. "/demos/movback/trunk/movback"},
|
||||||
{"DEMOS/PLASMA", VAR_PROGS .. "/demos/plasma/trunk/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"},
|
||||||
{"DEMOS/TRANTEST", VAR_PROGS .. "/demos/trantest/trunk/trantest"},
|
{"DEMOS/TRANTEST", VAR_PROGS .. "/demos/trantest/trunk/trantest"},
|
||||||
{"DEMOS/TUBE", VAR_PROGS .. "/demos/tube/trunk/tube"},
|
{"DEMOS/TUBE", VAR_PROGS .. "/demos/tube/tube"},
|
||||||
{"DEMOS/UNVWATER", VAR_PROGS .. "/demos/unvwater/trunk/unvwater"},
|
{"DEMOS/UNVWATER", VAR_PROGS .. "/demos/unvwater/trunk/unvwater"},
|
||||||
{"DEMOS/WEB", VAR_PROGS .. "/demos/web/trunk/web"},
|
{"DEMOS/WEB", VAR_PROGS .. "/demos/web/trunk/web"},
|
||||||
{"DEMOS/ZEROLINE", VAR_PROGS .. "/demos/zeroline/trunk/zeroline"},
|
{"DEMOS/ZEROLINE", VAR_PROGS .. "/demos/zeroline/trunk/zeroline"},
|
||||||
{"DEVELOP/ASCIIVJU", VAR_PROGS .. "/develop/asciivju/trunk/asciivju"},
|
|
||||||
{"DEVELOP/BOARD", VAR_PROGS .. "/system/board/trunk/board"},
|
{"DEVELOP/BOARD", VAR_PROGS .. "/system/board/trunk/board"},
|
||||||
|
{"DEVELOP/DBGBOARD", VAR_PROGS .. "/system/dbgboard/dbgboard"},
|
||||||
{"DEVELOP/CEDIT", SRC_PROGS .. "/develop/cedit/CEDIT"},
|
{"DEVELOP/CEDIT", SRC_PROGS .. "/develop/cedit/CEDIT"},
|
||||||
|
{"DEVELOP/CHARSETS", VAR_PROGS .. "/develop/charsets/charsets"},
|
||||||
{"DEVELOP/COBJ", VAR_PROGS .. "/develop/cObj/trunk/cObj"},
|
{"DEVELOP/COBJ", VAR_PROGS .. "/develop/cObj/trunk/cObj"},
|
||||||
{"DEVELOP/ENTROPYV", VAR_PROGS .. "/develop/entropyview/entropyview"},
|
{"DEVELOP/ENTROPYV", VAR_PROGS .. "/develop/entropyview/entropyview"},
|
||||||
{"DEVELOP/FASM", VAR_PROGS .. "/develop/fasm/1.73/fasm"},
|
{"DEVELOP/FASM", VAR_PROGS .. "/develop/fasm/1.73/fasm"},
|
||||||
|
{"DEVELOP/GENFILES", VAR_PROGS .. "/testing/genfiles/GenFiles"},
|
||||||
{"DEVELOP/H2D2B", VAR_PROGS .. "/develop/h2d2b/trunk/h2d2b"},
|
{"DEVELOP/H2D2B", VAR_PROGS .. "/develop/h2d2b/trunk/h2d2b"},
|
||||||
{"DEVELOP/HEED", VAR_PROGS .. "/develop/heed/trunk/heed"},
|
{"DEVELOP/HEED", VAR_PROGS .. "/develop/heed/trunk/heed"},
|
||||||
{"DEVELOP/KEYASCII", VAR_PROGS .. "/develop/keyascii/trunk/keyascii"},
|
|
||||||
{"DEVELOP/MTDBG", VAR_PROGS .. "/develop/mtdbg/mtdbg"},
|
{"DEVELOP/MTDBG", VAR_PROGS .. "/develop/mtdbg/mtdbg"},
|
||||||
|
{"DEVELOP/MSTATE", VAR_PROGS .. "/develop/mstate/mstate"},
|
||||||
{"DEVELOP/SCANCODE", VAR_PROGS .. "/develop/scancode/trunk/scancode"},
|
{"DEVELOP/SCANCODE", VAR_PROGS .. "/develop/scancode/trunk/scancode"},
|
||||||
{"DEVELOP/EXAMPLES/CIRCLE", VAR_PROGS .. "/develop/examples/circle/trunk/circle"},
|
{"DEVELOP/EXAMPLES/CIRCLE", VAR_PROGS .. "/develop/examples/circle/trunk/circle"},
|
||||||
{"DEVELOP/EXAMPLES/COLORREF", VAR_PROGS .. "/demos/colorref/trunk/colorref"},
|
{"DEVELOP/EXAMPLES/COLORREF", VAR_PROGS .. "/demos/colorref/trunk/colorref"},
|
||||||
{"DEVELOP/EXAMPLES/CONGET", VAR_PROGS .. "/develop/libraries/console_coff/examples/test_gets"},
|
{"DEVELOP/EXAMPLES/CONGET", VAR_PROGS .. "/develop/libraries/console_coff/examples/test_gets"},
|
||||||
{"DEVELOP/EXAMPLES/CSLIDE", VAR_PROGS .. "/demos/cslide/trunk/cslide"},
|
{"DEVELOP/EXAMPLES/CSLIDE", VAR_PROGS .. "/demos/cslide/trunk/cslide"},
|
||||||
{"DEVELOP/EXAMPLES/THREAD", VAR_PROGS .. "/develop/examples/thread/trunk/thread"},
|
{"DEVELOP/EXAMPLES/THREAD", VAR_PROGS .. "/develop/examples/thread/trunk/thread"},
|
||||||
{"DEVELOP/EXAMPLES/USE_MB", VAR_PROGS .. "/demos/use_mb/use_mb"},
|
|
||||||
{"File Managers/KFAR", VAR_PROGS .. "/fs/kfar/trunk/kfar"},
|
{"File Managers/KFAR", VAR_PROGS .. "/fs/kfar/trunk/kfar"},
|
||||||
{"File Managers/OPENDIAL", VAR_PROGS .. "/fs/opendial/opendial"},
|
{"File Managers/OPENDIAL", VAR_PROGS .. "/fs/opendial/opendial"},
|
||||||
|
{"LOD", VAR_PROGS .. "/fs/lod/lod"},
|
||||||
{"GAMES/15", VAR_PROGS .. "/games/15/15"},
|
{"GAMES/15", VAR_PROGS .. "/games/15/15"},
|
||||||
{"GAMES/DINO", VAR_PROGS .. "/games/dino/dino"},
|
|
||||||
{"GAMES/FREECELL", VAR_PROGS .. "/games/freecell/freecell"},
|
{"GAMES/FREECELL", VAR_PROGS .. "/games/freecell/freecell"},
|
||||||
{"GAMES/GOMOKU", VAR_PROGS .. "/games/gomoku/gomoku"},
|
{"GAMES/GOMOKU", VAR_PROGS .. "/games/gomoku/gomoku"},
|
||||||
{"GAMES/LIGHTS", VAR_PROGS .. "/games/sq_game/SQ_GAME"},
|
{"GAMES/LIGHTS", VAR_PROGS .. "/games/sq_game/SQ_GAME"},
|
||||||
@@ -498,6 +502,7 @@ tup.append_table(img_files, {
|
|||||||
{"GAMES/SW", VAR_PROGS .. "/games/sw/sw"},
|
{"GAMES/SW", VAR_PROGS .. "/games/sw/sw"},
|
||||||
{"GAMES/TANKS", VAR_PROGS .. "/games/tanks/tanks"},
|
{"GAMES/TANKS", VAR_PROGS .. "/games/tanks/tanks"},
|
||||||
{"GAMES/TETRIS", VAR_PROGS .. "/games/tetris/tetris"},
|
{"GAMES/TETRIS", VAR_PROGS .. "/games/tetris/tetris"},
|
||||||
|
{"GAMES/C4", VAR_PROGS .. "/games/c4/c4"},
|
||||||
{"LIB/ARCHIVER.OBJ", VAR_PROGS .. "/fs/kfar/trunk/kfar_arc/kfar_arc.obj"},
|
{"LIB/ARCHIVER.OBJ", VAR_PROGS .. "/fs/kfar/trunk/kfar_arc/kfar_arc.obj"},
|
||||||
{"LIB/BOX_LIB.OBJ", VAR_PROGS .. "/develop/libraries/box_lib/trunk/box_lib.obj"},
|
{"LIB/BOX_LIB.OBJ", VAR_PROGS .. "/develop/libraries/box_lib/trunk/box_lib.obj"},
|
||||||
{"LIB/BUF2D.OBJ", VAR_PROGS .. "/develop/libraries/buf2d/trunk/buf2d.obj"},
|
{"LIB/BUF2D.OBJ", VAR_PROGS .. "/develop/libraries/buf2d/trunk/buf2d.obj"},
|
||||||
@@ -517,6 +522,7 @@ tup.append_table(img_files, {
|
|||||||
{"LIB/SORT.OBJ", VAR_PROGS .. "/develop/libraries/sorter/sort.obj"},
|
{"LIB/SORT.OBJ", VAR_PROGS .. "/develop/libraries/sorter/sort.obj"},
|
||||||
{"LIB/TINYGL.OBJ", VAR_PROGS .. "/develop/libraries/TinyGL/asm_fork/tinygl.obj"},
|
{"LIB/TINYGL.OBJ", VAR_PROGS .. "/develop/libraries/TinyGL/asm_fork/tinygl.obj"},
|
||||||
{"MEDIA/ANIMAGE", VAR_PROGS .. "/media/animage/trunk/animage"},
|
{"MEDIA/ANIMAGE", VAR_PROGS .. "/media/animage/trunk/animage"},
|
||||||
|
{"MEDIA/FILLSCR", VAR_PROGS .. "/media/FillScr/fillscr"},
|
||||||
{"MEDIA/KIV", VAR_PROGS .. "/media/kiv/trunk/kiv"},
|
{"MEDIA/KIV", VAR_PROGS .. "/media/kiv/trunk/kiv"},
|
||||||
{"MEDIA/LISTPLAY", VAR_PROGS .. "/media/listplay/trunk/listplay"},
|
{"MEDIA/LISTPLAY", VAR_PROGS .. "/media/listplay/trunk/listplay"},
|
||||||
{"MEDIA/MIDAMP", VAR_PROGS .. "/media/midamp/trunk/midamp"},
|
{"MEDIA/MIDAMP", VAR_PROGS .. "/media/midamp/trunk/midamp"},
|
||||||
@@ -599,7 +605,6 @@ tup.append_table(extra_files, {
|
|||||||
{"kolibrios/demos/life3", VAR_PROGS .. "/games/life3/life3"},
|
{"kolibrios/demos/life3", VAR_PROGS .. "/games/life3/life3"},
|
||||||
{"kolibrios/demos/qjulia", VAR_PROGS .. "/demos/qjulia/trunk/qjulia"},
|
{"kolibrios/demos/qjulia", VAR_PROGS .. "/demos/qjulia/trunk/qjulia"},
|
||||||
{"kolibrios/develop/koldbg", VAR_PROGS .. "/develop/koldbg/koldbg"},
|
{"kolibrios/develop/koldbg", VAR_PROGS .. "/develop/koldbg/koldbg"},
|
||||||
{"kolibrios/develop/utils/charset_checker", VAR_PROGS .. "/other/charset_checker/charchck"},
|
|
||||||
{"kolibrios/games/Almaz", VAR_PROGS .. "/games/almaz/almaz"},
|
{"kolibrios/games/Almaz", VAR_PROGS .. "/games/almaz/almaz"},
|
||||||
{"kolibrios/games/arcanii", VAR_PROGS .. "/games/arcanii/arcanii"},
|
{"kolibrios/games/arcanii", VAR_PROGS .. "/games/arcanii/arcanii"},
|
||||||
{"kolibrios/games/bomber/bomber", VAR_PROGS .. "/games/bomber/bomber"},
|
{"kolibrios/games/bomber/bomber", VAR_PROGS .. "/games/bomber/bomber"},
|
||||||
@@ -630,7 +635,7 @@ if build_type == "ru_RU" then tup.append_table(img_files, {
|
|||||||
{"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, {
|
||||||
{"DEVELOP/TESTCON2", VAR_PROGS .. "/develop/libraries/console_coff/examples/testcon2_eng"},
|
{"DEVELOP/EXAMPLES/TESTCON2", VAR_PROGS .. "/develop/libraries/console_coff/examples/testcon2_eng"},
|
||||||
}) end
|
}) end
|
||||||
|
|
||||||
if build_type == "ru_RU" then tup.append_table(extra_files, {
|
if build_type == "ru_RU" then tup.append_table(extra_files, {
|
||||||
@@ -639,22 +644,6 @@ if build_type == "ru_RU" then tup.append_table(extra_files, {
|
|||||||
|
|
||||||
end -- tup.getconfig('NO_FASM') ~= 'full'
|
end -- tup.getconfig('NO_FASM') ~= 'full'
|
||||||
|
|
||||||
-- Programs that require NASM to compile.
|
|
||||||
if tup.getconfig('NO_NASM') ~= 'full' then
|
|
||||||
tup.append_table(img_files, {
|
|
||||||
{"ACLOCK", VAR_PROGS .. "/demos/aclock/trunk/aclock"},
|
|
||||||
{"LOD", VAR_PROGS .. "/fs/lod/lod"},
|
|
||||||
{"TIMER", VAR_PROGS .. "/other/Timer/timer"},
|
|
||||||
{"TINFO", VAR_PROGS .. "/system/tinfo/tinfo"},
|
|
||||||
{"DEVELOP/MSTATE", VAR_PROGS .. "/develop/mstate/mstate"},
|
|
||||||
{"DEVELOP/GENFILES", VAR_PROGS .. "/testing/genfiles/GenFiles"},
|
|
||||||
{"GAMES/C4", VAR_PROGS .. "/games/c4/c4"},
|
|
||||||
{"MEDIA/FILLSCR", VAR_PROGS .. "/media/FillScr/fillscr"},
|
|
||||||
})
|
|
||||||
tup.append_table(extra_files, {
|
|
||||||
})
|
|
||||||
end -- tup.getconfig('NO_NASM') ~= 'full'
|
|
||||||
|
|
||||||
-- Programs that require JWASM to compile.
|
-- Programs that require JWASM to compile.
|
||||||
if tup.getconfig('NO_JWASM') ~= 'full' then
|
if tup.getconfig('NO_JWASM') ~= 'full' then
|
||||||
tup.append_table(img_files, {
|
tup.append_table(img_files, {
|
||||||
@@ -683,7 +672,6 @@ tup.append_table(img_files, {
|
|||||||
{"DEVELOP/PIPET", VAR_PROGS .. "/cmm/misc/pipet.com"},
|
{"DEVELOP/PIPET", VAR_PROGS .. "/cmm/misc/pipet.com"},
|
||||||
{"File Managers/EOLITE", VAR_PROGS .. "/cmm/eolite/Eolite.com"},
|
{"File Managers/EOLITE", VAR_PROGS .. "/cmm/eolite/Eolite.com"},
|
||||||
{"File Managers/KFM2", VAR_PROGS .. "/cmm/misc/kfm2.com"},
|
{"File Managers/KFM2", VAR_PROGS .. "/cmm/misc/kfm2.com"},
|
||||||
{"KF_VIEW", VAR_PROGS .. "/cmm/kf_font_viewer/font_viewer.com"},
|
|
||||||
{"DEVELOP/DIFF", VAR_PROGS .. "/cmm/diff/diff.com"},
|
{"DEVELOP/DIFF", VAR_PROGS .. "/cmm/diff/diff.com"},
|
||||||
{"GAMES/CLICKS", VAR_PROGS .. "/games/clicks/clicks.com"},
|
{"GAMES/CLICKS", VAR_PROGS .. "/games/clicks/clicks.com"},
|
||||||
{"GAMES/MBLOCKS", VAR_PROGS .. "/cmm/misc/mblocks.com"},
|
{"GAMES/MBLOCKS", VAR_PROGS .. "/cmm/misc/mblocks.com"},
|
||||||
@@ -706,6 +694,7 @@ tup.append_table(extra_files, {
|
|||||||
{"kolibrios/utils/notes", VAR_PROGS .. "/cmm/notes/notes.com"},
|
{"kolibrios/utils/notes", VAR_PROGS .. "/cmm/notes/notes.com"},
|
||||||
{"kolibrios/utils/osupdate", VAR_PROGS .. "/cmm/misc/osupdate.com"},
|
{"kolibrios/utils/osupdate", VAR_PROGS .. "/cmm/misc/osupdate.com"},
|
||||||
{"kolibrios/utils/quark", VAR_PROGS .. "/cmm/quark/quark.com"},
|
{"kolibrios/utils/quark", VAR_PROGS .. "/cmm/quark/quark.com"},
|
||||||
|
{"kolibrios/utils/kf_view", VAR_PROGS .. "/cmm/kf_font_viewer/font_viewer.com"},
|
||||||
})
|
})
|
||||||
end -- tup.getconfig('NO_CMM') ~= 'full'
|
end -- tup.getconfig('NO_CMM') ~= 'full'
|
||||||
|
|
||||||
@@ -730,6 +719,7 @@ if tup.getconfig('NO_TCC') ~= 'full' then
|
|||||||
tup.append_table(img_files, {
|
tup.append_table(img_files, {
|
||||||
{"NETWORK/WHOIS", VAR_PROGS .. "/network/whois/whois"},
|
{"NETWORK/WHOIS", VAR_PROGS .. "/network/whois/whois"},
|
||||||
{"SHELL", VAR_PROGS .. "/system/shell/shell"},
|
{"SHELL", VAR_PROGS .. "/system/shell/shell"},
|
||||||
|
{"GAMES/DINO", VAR_PROGS .. "/games/dino/dino"},
|
||||||
})
|
})
|
||||||
tup.append_table(extra_files, {
|
tup.append_table(extra_files, {
|
||||||
{"kolibrios/utils/thashview", VAR_PROGS .. "/other/TinyHashView/thashview"},
|
{"kolibrios/utils/thashview", VAR_PROGS .. "/other/TinyHashView/thashview"},
|
||||||
|
@@ -79,7 +79,7 @@ next=$TextEditor
|
|||||||
[Assoc]
|
[Assoc]
|
||||||
/=/sys/file managers/eolite
|
/=/sys/file managers/eolite
|
||||||
|
|
||||||
kf=/sys/KF_VIEW
|
kf=/kolibrios/utils/kf_view
|
||||||
|
|
||||||
txt=$CodeEdit
|
txt=$CodeEdit
|
||||||
log=$CodeEdit
|
log=$CodeEdit
|
||||||
|
@@ -1,14 +1,16 @@
|
|||||||
The following "hot" shortcut keys are used in the system:
|
The following "hot" shortcut keys are used in the system:
|
||||||
(Indexing on time of appearance in the system)
|
(Indexing on time of appearance in the system)
|
||||||
1) Ctrl + Alt + Del start of the application CPU (the manager of processes), is a sole combination maintained on a level of a kernel, all rest "hot" key is realized at the expense of the application @TASKBAR.
|
1) Ctrl + Alt + Del start of the application CPU (the manager of processes), is a sole combination maintained on a level of a kernel, all rest "hot" key is realized at the expense of the application @TASKBAR.
|
||||||
2) Ctrl + Shift - switching of keyboard layout.
|
2) Ctrl + Shift - switching of keyboard layout
|
||||||
3) Win - start of the application MENU.
|
3) Win - start of the application MENU
|
||||||
4) Alt + Ctrl + F12 - start of the application END.
|
4) Alt + Ctrl + F12 - start of the application END
|
||||||
5) Alt + F4 - terminate the active application.
|
5) Alt + F4 - terminate the active application
|
||||||
6) Alt + Tab - switch to the next (in the window stack) window
|
6) Alt + Tab - switch to the next window
|
||||||
7) Alt + Shift + Tab - switch to the previous (in the window stack) window
|
7) Alt + Shift + Tab - switch to the previous window
|
||||||
8) Alt + Shift + NumLock - start of the application MOUSEMUL, which emulates mouse with numpad, when NumLock is on.
|
8) Alt + Shift + NumLock - start of the application MOUSEMUL, which emulates mouse with numpad, when NumLock is on.
|
||||||
9) Alt + 1...7 - fast switching to the selected keyboard layout (even if absent for Ctrl + Shift)
|
9) Alt + 1...7 - fast switching to the selected keyboard layout (even if absent for Ctrl + Shift)
|
||||||
10) Win + D - minimize/restore all windows (cleaning of desktop)
|
10) Win + D - minimize/restore all windows
|
||||||
11) Win + R - start of the application RUN
|
11) Win + R - start of the application RUN
|
||||||
12) Ctrl + PrintScreen - start of the application SCRSHOOT. Just do a screen shot and the user is offered to specify (with OpenDialog) where to save the BMP image.
|
12) Ctrl + PrintScreen - start of the application SCRSHOOT
|
||||||
|
13) Ctrl + Alt + Left / Right - change sound volume
|
||||||
|
Ctrl + Alt + Up / Down - mute and unmute sound
|
||||||
|
@@ -116,8 +116,8 @@ ico=8
|
|||||||
x=-67
|
x=-67
|
||||||
y=68
|
y=68
|
||||||
[10]
|
[10]
|
||||||
name=BOARD
|
name=DBGBOARD
|
||||||
path=/SYS/DEVELOP/BOARD
|
path=/SYS/DEVELOP/DBGBOARD
|
||||||
param=
|
param=
|
||||||
ico=19
|
ico=19
|
||||||
x=-135
|
x=-135
|
||||||
|
@@ -57,8 +57,7 @@
|
|||||||
20 Diff Tool |develop/diff
|
20 Diff Tool |develop/diff
|
||||||
52 Shared resources |/sys/@reshare
|
52 Shared resources |/sys/@reshare
|
||||||
34 Base Converter |develop/h2d2b
|
34 Base Converter |develop/h2d2b
|
||||||
59 Character table |develop/ASCIIVju
|
59 Charsets Viewer |develop/CHARSETS
|
||||||
59 Key ASCII-codes |develop/keyascii
|
|
||||||
59 Key SCAN-codes |develop/scancode
|
59 Key SCAN-codes |develop/scancode
|
||||||
#6 **** EMUL
|
#6 **** EMUL
|
||||||
24 DOSBox * |/kolibrios/emul/DosBox/dosbox
|
24 DOSBox * |/kolibrios/emul/DosBox/dosbox
|
||||||
|
@@ -1,14 +1,16 @@
|
|||||||
The following "hot" shortcut keys are used in the system:
|
The following "hot" shortcut keys are used in the system:
|
||||||
(Indexing on time of appearance in the system)
|
(Indexing on time of appearance in the system)
|
||||||
1) Ctrl + Alt + Del start of the application CPU (the manager of processes), is a sole combination maintained on a level of a kernel, all rest "hot" key is realized at the expense of the application @TASKBAR.
|
1) Ctrl + Alt + Del start of the application CPU (the manager of processes), is a sole combination maintained on a level of a kernel, all rest "hot" key is realized at the expense of the application @TASKBAR.
|
||||||
2) Ctrl + Shift - switching of keyboard layout.
|
2) Ctrl + Shift - switching of keyboard layout
|
||||||
3) Win - start of the application MENU.
|
3) Win - start of the application MENU
|
||||||
4) Alt + Ctrl + F12 - start of the application END.
|
4) Alt + Ctrl + F12 - start of the application END
|
||||||
5) Alt + F4 - terminate the active application.
|
5) Alt + F4 - terminate the active application
|
||||||
6) Alt + Tab - switch to the next (in the window stack) window
|
6) Alt + Tab - switch to the next window
|
||||||
7) Alt + Shift + Tab - switch to the previous (in the window stack) window
|
7) Alt + Shift + Tab - switch to the previous window
|
||||||
8) Alt + Shift + NumLock - start of the application MOUSEMUL, which emulates mouse with numpad, when NumLock is on.
|
8) Alt + Shift + NumLock - start of the application MOUSEMUL, which emulates mouse with numpad, when NumLock is on.
|
||||||
9) Alt + 1...7 - fast switching to the selected keyboard layout (even if absent for Ctrl + Shift)
|
9) Alt + 1...7 - fast switching to the selected keyboard layout (even if absent for Ctrl + Shift)
|
||||||
10) Win + D - minimize/restore all windows (cleaning of desktop)
|
10) Win + D - minimize/restore all windows
|
||||||
11) Win + R - start of the application RUN
|
11) Win + R - start of the application RUN
|
||||||
12) Ctrl + PrintScreen - start of the application SCRSHOOT. Just do a screen shot and the user is offered to specify (with OpenDialog) where to save the BMP image.
|
12) Ctrl + PrintScreen - start of the application SCRSHOOT
|
||||||
|
13) Ctrl + Alt + Left / Right - change sound volume
|
||||||
|
Ctrl + Alt + Up / Down - mute and unmute sound
|
@@ -116,8 +116,8 @@ ico=8
|
|||||||
x=-67
|
x=-67
|
||||||
y=68
|
y=68
|
||||||
[10]
|
[10]
|
||||||
name=BOARD
|
name=DBGBOARD
|
||||||
path=/SYS/DEVELOP/BOARD
|
path=/SYS/DEVELOP/DBGBOARD
|
||||||
param=
|
param=
|
||||||
ico=19
|
ico=19
|
||||||
x=-135
|
x=-135
|
||||||
|
@@ -56,8 +56,7 @@
|
|||||||
49 Debugger mtdbg |develop/mtdbg
|
49 Debugger mtdbg |develop/mtdbg
|
||||||
49 Debugger koldbg * |/kolibrios/develop/koldbg
|
49 Debugger koldbg * |/kolibrios/develop/koldbg
|
||||||
16 Hex2Dec2Bin |develop/h2d2b
|
16 Hex2Dec2Bin |develop/h2d2b
|
||||||
16 Tabla de caracteres |ASCIIVju
|
16 Tabla de caracteres |develop/CHARSETS
|
||||||
16 C<>digos ASCII |develop/keyascii
|
|
||||||
16 C<>digos SCAN |develop/scancode
|
16 C<>digos SCAN |develop/scancode
|
||||||
#6 **** EMULATORS
|
#6 **** EMULATORS
|
||||||
24 DOSBox * |/kolibrios/emul/DosBox/dosbox
|
24 DOSBox * |/kolibrios/emul/DosBox/dosbox
|
||||||
|
@@ -116,8 +116,8 @@ ico=8
|
|||||||
x=-67
|
x=-67
|
||||||
y=68
|
y=68
|
||||||
[10]
|
[10]
|
||||||
name=BOARD
|
name=DBGBOARD
|
||||||
path=/SYS/DEVELOP/BOARD
|
path=/SYS/DEVELOP/DBGBOARD
|
||||||
param=
|
param=
|
||||||
ico=19
|
ico=19
|
||||||
x=-135
|
x=-135
|
||||||
|
@@ -116,8 +116,8 @@ ico=8
|
|||||||
x=-67
|
x=-67
|
||||||
y=68
|
y=68
|
||||||
[10]
|
[10]
|
||||||
name=BOARD
|
name=DBGBOARD
|
||||||
path=/SYS/DEVELOP/BOARD
|
path=/SYS/DEVELOP/DBGBOARD
|
||||||
param=
|
param=
|
||||||
ico=19
|
ico=19
|
||||||
x=-135
|
x=-135
|
||||||
|
@@ -1,14 +1,16 @@
|
|||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>騥 "<22><><EFBFBD><EFBFBD>稥" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>樨 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD>⥬<EFBFBD>:
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>騥 "<22><><EFBFBD><EFBFBD>稥" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>樨 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD>⥬<EFBFBD>:
|
||||||
(<28>㬥<EFBFBD><E3ACA5><EFBFBD><EFBFBD><EFBFBD> <20><> <20>६<EFBFBD><E0A5AC><EFBFBD> <20><><EFBFBD><EFA2AB><EFBFBD><EFBFBD> <20> <20><><EFBFBD>⥬<EFBFBD>)
|
(<28>㬥<EFBFBD><E3ACA5><EFBFBD><EFBFBD><EFBFBD> <20><> <20>६<EFBFBD><E0A5AC><EFBFBD> <20><><EFBFBD><EFA2AB><EFBFBD><EFBFBD> <20> <20><><EFBFBD>⥬<EFBFBD>)
|
||||||
1) Ctrl + Alt + Del <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> CPU (<28><>ᯥ<EFBFBD><E1AFA5><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᮢ), <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>⢥<EFBFBD><E2A2A5><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ঠ<EFBFBD><E0A6A0><EFBFBD><EFBFBD> <20><> <20><EFBFBD><E0AEA2> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><>⠫쭮<E2A0AB> ॠ<><E0A5A0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> @TASKBAR.
|
1) Ctrl + Alt + Del <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> CPU (<28><>ᯥ<EFBFBD><E1AFA5><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᮢ), <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>⢥<EFBFBD><E2A2A5><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ঠ<EFBFBD><E0A6A0><EFBFBD><EFBFBD> <20><> <20><EFBFBD><E0AEA2> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><>⠫쭮<E2A0AB> ॠ<><E0A5A0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> @TASKBAR.
|
||||||
2) Ctrl + Shift - <20><>४<EFBFBD><E0A5AA>祭<EFBFBD><E7A5AD> <20><>᪫<EFBFBD><E1AAAB><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
2) Ctrl + Shift - <20><>४<EFBFBD><E0A5AA>祭<EFBFBD><E7A5AD> <20><>᪫<EFBFBD><E1AAAB><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
3) Win - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> MENU.
|
3) Win - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> MENU
|
||||||
4) Alt + Ctrl + F12 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> END.
|
4) Alt + Ctrl + F12 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> END
|
||||||
5) Alt + F4 - <20><><EFBFBD><EFBFBD><EFBFBD>襭<EFBFBD><E8A5AD> <20><>⨢<EFBFBD><E2A8A2><EFBFBD><EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
5) Alt + F4 - <20><><EFBFBD><EFBFBD><EFBFBD>襭<EFBFBD><E8A5AD> <20><>⨢<EFBFBD><E2A8A2><EFBFBD><EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
6) Alt + Tab - <20><>४<EFBFBD><E0A5AA>祭<EFBFBD><E7A5AD> <20><> <><E1ABA5><EFBFBD>饥 (<28> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>⥪<EFBFBD>) <20><><EFBFBD><EFBFBD>
|
6) Alt + Tab - <20><>४<EFBFBD><E0A5AA>祭<EFBFBD><E7A5AD> <20><> <><E1ABA5><EFBFBD>饥 <20><><EFBFBD><EFBFBD>
|
||||||
7) Alt + Shift + Tab - <20><>४<EFBFBD><E0A5AA>祭<EFBFBD><E7A5AD> <20><> <20>।<EFBFBD><E0A5A4><EFBFBD>饥 (<28> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>⥪<EFBFBD>) <20><><EFBFBD><EFBFBD>
|
7) Alt + Shift + Tab - <20><>४<EFBFBD><E0A5AA>祭<EFBFBD><E7A5AD> <20><> <20>।<EFBFBD><E0A5A4><EFBFBD>饥 <20><><EFBFBD><EFBFBD>
|
||||||
8) Alt + Shift + NumLock - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> MOUSEMUL, <20><>㫨<EFBFBD><E3ABA8><EFBFBD>饣<EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> NumLock <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>蠬<EFBFBD> <20>㬯<EFBFBD><E3ACAF><EFBFBD>
|
8) Alt + Shift + NumLock - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> MOUSEMUL, <20><>㫨<EFBFBD><E3ABA8><EFBFBD>饣<EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> NumLock <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>蠬<EFBFBD> <20>㬯<EFBFBD><E3ACAF><EFBFBD>
|
||||||
9) Alt + 1...7 - <20><><EFBFBD><EFBFBD> <20><>४<EFBFBD><E0A5AA>祭<EFBFBD><E7A5AD> <20><> <20><><EFBFBD>࠭<EFBFBD><E0A0AD><EFBFBD> <20><>᪫<EFBFBD><E1AAAB><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> Ctrl + Shift)
|
9) Alt + 1...7 - <20><><EFBFBD><EFBFBD> <20><>४<EFBFBD><E0A5AA>祭<EFBFBD><E7A5AD> <20><> <20><><EFBFBD>࠭<EFBFBD><E0A0AD><EFBFBD> <20><>᪫<EFBFBD><E1AAAB><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> Ctrl + Shift)
|
||||||
10) Win + D - ᢥ<><E1A2A5><EFBFBD><EFBFBD><EFBFBD>/ࠧ<><E0A0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD>⪠ ࠡ<>祣<EFBFBD> <20>⮫<EFBFBD>)
|
10) Win + D - ᢥ<><E1A2A5><EFBFBD><EFBFBD><EFBFBD>/ࠧ<><E0A0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||||
11) Win + R - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> RUN
|
11) Win + R - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> RUN
|
||||||
12) Ctrl + PrintScreen - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SCRSHOOT. <20>ࠧ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᭨<><E1ADA8><EFBFBD> <20><>࠭<EFBFBD> <20> <20><><EFBFBD>짮<EFBFBD><ECA7AE>⥫<EFBFBD> <20>।<EFBFBD><E0A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㪠<><E3AAA0><EFBFBD><EFBFBD>, <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> OpenDialog, <20>㤠 <20><><EFBFBD>࠭<EFBFBD><E0A0AD><EFBFBD> ᭨<><E1ADA8><EFBFBD> <20> <20><>ଠ<EFBFBD><E0ACA0> BMP.
|
12) Ctrl + PrintScreen - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SCRSHOOT
|
||||||
|
13) Ctrl + Alt + Left / Right - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E0AEAC><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
Ctrl + Alt + Up / Down - <20>몫<EFBFBD><EBAAAB><EFBFBD><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||||
|
@@ -116,8 +116,8 @@ ico=8
|
|||||||
x=-67
|
x=-67
|
||||||
y=68
|
y=68
|
||||||
[10]
|
[10]
|
||||||
name=BOARD
|
name=DBGBOARD
|
||||||
path=/SYS/DEVELOP/BOARD
|
path=/SYS/DEVELOP/DBGBOARD
|
||||||
param=
|
param=
|
||||||
ico=19
|
ico=19
|
||||||
x=-135
|
x=-135
|
||||||
|
@@ -58,8 +58,7 @@
|
|||||||
20 Diff tool |develop/diff
|
20 Diff tool |develop/diff
|
||||||
52 Shared resources |/sys/@reshare
|
52 Shared resources |/sys/@reshare
|
||||||
34 Hex2Dec2Bin |develop/h2d2b
|
34 Hex2Dec2Bin |develop/h2d2b
|
||||||
59 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD><EFBFBD> |develop/ASCIIVju
|
59 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD><EFBFBD> |develop/CHARSETS
|
||||||
59 ASCII-<2D><><EFBFBD><EFBFBD> |develop/keyascii
|
|
||||||
59 SCAN-<2D><><EFBFBD><EFBFBD> |develop/scancode
|
59 SCAN-<2D><><EFBFBD><EFBFBD> |develop/scancode
|
||||||
#6 **** <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
#6 **** <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
24 DOSBox * |/kolibrios/emul/DosBox/dosbox
|
24 DOSBox * |/kolibrios/emul/DosBox/dosbox
|
||||||
|
BIN
programs/cmm/barscfg/bars_8b.raw
Normal file
BIN
programs/cmm/barscfg/bars_8b.raw
Normal file
Binary file not shown.
@@ -55,9 +55,15 @@ _ini taskbar_vars_ini = { #taskbar_ini_path, "Variables" };
|
|||||||
|
|
||||||
_ini docky_ini = { "/sys/settings/docky.ini", "@" };
|
_ini docky_ini = { "/sys/settings/docky.ini", "@" };
|
||||||
|
|
||||||
unsigned char panels_img_data[] = FROM "bars.raw";
|
|
||||||
#define PIMG_W 37
|
#define PIMG_W 37
|
||||||
#define PIMG_H 27 //27*5
|
#define PIMG_H 27 //27*5
|
||||||
|
unsigned char panels_img_data[] = FROM "bars_8b.raw";
|
||||||
|
dword panels_img_pal[] = {
|
||||||
|
0x00405D74,0x0084FC84,0x00FAFAFA,0x0000B400,
|
||||||
|
0x00E4E4E4,0x008C9B9C,0x000212FD,0x00D8DEDF,
|
||||||
|
0x00585C5D,0x0085B7E0,0x009EC6E7,0x0094C0E5,
|
||||||
|
0x00CB8800,0x00CE3D9E,0x00D20404,0x00485966
|
||||||
|
};
|
||||||
|
|
||||||
proc_info Form;
|
proc_info Form;
|
||||||
|
|
||||||
@@ -137,7 +143,7 @@ void main()
|
|||||||
|
|
||||||
void DrawPanelsImage(dword y, n)
|
void DrawPanelsImage(dword y, n)
|
||||||
{
|
{
|
||||||
PutImage(22, y, PIMG_W, PIMG_H, n * PIMG_W * PIMG_H * 3 + #panels_img_data);
|
PutPaletteImage(n * PIMG_W * PIMG_H + #panels_img_data, PIMG_W, PIMG_H, 22, y, 8, #panels_img_pal);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetDisabledMode()
|
void SetDisabledMode()
|
||||||
|
@@ -101,13 +101,16 @@ void TWebBrowser::SetPageDefaults()
|
|||||||
img_url.drop();
|
img_url.drop();
|
||||||
text_colors.drop();
|
text_colors.drop();
|
||||||
text_colors.add(0);
|
text_colors.add(0);
|
||||||
|
if (secondrun) {
|
||||||
|
canvas.Init(list.x, list.y, list.w, math.max(list.visible, list.count));
|
||||||
|
canvas.Fill(0, bg_colors.get(0));
|
||||||
|
}
|
||||||
bg_colors.drop();
|
bg_colors.drop();
|
||||||
bg_colors.add(DEFAULT_BG_COL);
|
bg_colors.add(DEFAULT_BG_COL);
|
||||||
canvas.Fill(0, DEFAULT_BG_COL);
|
|
||||||
header = NULL;
|
header = NULL;
|
||||||
draw_y = BODY_MARGIN;
|
draw_y = BODY_MARGIN;
|
||||||
draw_x = left_gap = BODY_MARGIN;
|
draw_x = left_gap = BODY_MARGIN;
|
||||||
draw_w = list.w - BODY_MARGIN;
|
draw_w = list.w - BODY_MARGIN - BODY_MARGIN;
|
||||||
linebuf = 0;
|
linebuf = 0;
|
||||||
redirect = '\0';
|
redirect = '\0';
|
||||||
list.SetFont(8, 14, 10011000b);
|
list.SetFont(8, 14, 10011000b);
|
||||||
@@ -133,8 +136,6 @@ void TWebBrowser::ParseHtml(dword _bufpointer, _bufsize){
|
|||||||
dword bufpos;
|
dword bufpos;
|
||||||
bufsize = _bufsize;
|
bufsize = _bufsize;
|
||||||
|
|
||||||
if (list.w!=canvas.bufw) canvas.Init(list.x, list.y, list.w, 400*20);
|
|
||||||
|
|
||||||
if (bufpointer == _bufpointer) {
|
if (bufpointer == _bufpointer) {
|
||||||
custom_encoding = cur_encoding;
|
custom_encoding = cur_encoding;
|
||||||
} else {
|
} else {
|
||||||
@@ -153,7 +154,6 @@ void TWebBrowser::ParseHtml(dword _bufpointer, _bufsize){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
table.cols.drop();
|
table.cols.drop();
|
||||||
secondrun = false;
|
secondrun = false;
|
||||||
|
|
||||||
@@ -216,19 +216,15 @@ void TWebBrowser::ParseHtml(dword _bufpointer, _bufsize){
|
|||||||
AddCharToTheLine(ESBYTE[bufpos]);
|
AddCharToTheLine(ESBYTE[bufpos]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RenderTextbuf();
|
||||||
|
list.count = draw_y + style.cur_line_h;
|
||||||
|
list.CheckDoesValuesOkey();
|
||||||
|
anchors.current = NULL;
|
||||||
|
|
||||||
if (!secondrun) {
|
if (!secondrun) {
|
||||||
secondrun = true;
|
secondrun = true;
|
||||||
goto _PARSE_START_;
|
goto _PARSE_START_;
|
||||||
}
|
}
|
||||||
|
|
||||||
RenderTextbuf();
|
|
||||||
list.count = draw_y + style.cur_line_h;
|
|
||||||
|
|
||||||
canvas.bufh = math.max(list.visible, list.count);
|
|
||||||
buf_data = realloc(buf_data, canvas.bufh * canvas.bufw * 4 + 8);
|
|
||||||
|
|
||||||
list.CheckDoesValuesOkey();
|
|
||||||
anchors.current = NULL;
|
|
||||||
if (!header) {
|
if (!header) {
|
||||||
strncpy(#header, #version, sizeof(TWebBrowser.header)-1);
|
strncpy(#header, #version, sizeof(TWebBrowser.header)-1);
|
||||||
DrawTitle(#header);
|
DrawTitle(#header);
|
||||||
|
@@ -45,9 +45,10 @@ void PAGE_LINKS::clear()
|
|||||||
w.drop();
|
w.drop();
|
||||||
h.drop();
|
h.drop();
|
||||||
underline_h.drop();
|
underline_h.drop();
|
||||||
|
id.drop();
|
||||||
|
|
||||||
element_links.drop();
|
element_links.drop();
|
||||||
unic_links.drop();
|
unic_links.drop();
|
||||||
id.drop();
|
|
||||||
|
|
||||||
active = -1;
|
active = -1;
|
||||||
active_url = 0;
|
active_url = 0;
|
||||||
|
@@ -112,6 +112,7 @@ dword _tag::get_next_param(dword ps, pe)
|
|||||||
// "pe" - param end
|
// "pe" - param end
|
||||||
// "q" - quote char
|
// "q" - quote char
|
||||||
char q = NULL;
|
char q = NULL;
|
||||||
|
dword initial_pe = pe;
|
||||||
dword fixeq;
|
dword fixeq;
|
||||||
dword val;
|
dword val;
|
||||||
dword attr;
|
dword attr;
|
||||||
@@ -145,6 +146,14 @@ dword _tag::get_next_param(dword ps, pe)
|
|||||||
//already have ATTR end
|
//already have ATTR end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pe > ps) pe--;
|
||||||
|
|
||||||
|
//Fix case: "src ="
|
||||||
|
while (pe>ps) && (__isWhite(ESBYTE[pe])) {
|
||||||
|
ESBYTE[pe] = '\0';
|
||||||
|
pe--;
|
||||||
|
}
|
||||||
|
|
||||||
//find ATTR start and copy
|
//find ATTR start and copy
|
||||||
while (pe>ps) && (!__isWhite(ESBYTE[pe])) pe--;
|
while (pe>ps) && (!__isWhite(ESBYTE[pe])) pe--;
|
||||||
attr = pe + 1;
|
attr = pe + 1;
|
||||||
@@ -161,6 +170,8 @@ dword _tag::get_next_param(dword ps, pe)
|
|||||||
}
|
}
|
||||||
strlwr(attr);
|
strlwr(attr);
|
||||||
strrtrim(val);
|
strrtrim(val);
|
||||||
|
//Fix case: " img.png"
|
||||||
|
while(__isWhite(ESBYTE[val])) && (val<initial_pe) val++;
|
||||||
|
|
||||||
attributes.add(attr);
|
attributes.add(attr);
|
||||||
values.add(val);
|
values.add(val);
|
||||||
|
@@ -10,10 +10,8 @@ void TWebBrowser::RenderLine(dword _line)
|
|||||||
if (style.title)
|
if (style.title)
|
||||||
{
|
{
|
||||||
strncpy(#header, _line, sizeof(TWebBrowser.header)-1);
|
strncpy(#header, _line, sizeof(TWebBrowser.header)-1);
|
||||||
if (!application_mode) {
|
strncat(#header, " - ", sizeof(TWebBrowser.header)-1);
|
||||||
strncat(#header, " - ", sizeof(TWebBrowser.header)-1);
|
strncat(#header, #version, sizeof(TWebBrowser.header)-1);
|
||||||
strncat(#header, #version, sizeof(TWebBrowser.header)-1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (t_html) && (!t_body) {
|
else if (t_html) && (!t_body) {
|
||||||
//
|
//
|
||||||
@@ -24,11 +22,10 @@ void TWebBrowser::RenderLine(dword _line)
|
|||||||
zoom = list.font_w / BASIC_CHAR_W;
|
zoom = list.font_w / BASIC_CHAR_W;
|
||||||
|
|
||||||
//there is some shit happens!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
//there is some shit happens!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
if (pw > draw_w) {
|
if (pw > draw_w + BODY_MARGIN) {
|
||||||
//draw_w = pw;
|
//debugln("shit");
|
||||||
NewLine();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debug_mode) {
|
if (debug_mode) {
|
||||||
canvas.DrawBar(draw_x, draw_y, pw, list.item_h, 0xCCCccc);
|
canvas.DrawBar(draw_x, draw_y, pw, list.item_h, 0xCCCccc);
|
||||||
debugln(_line);
|
debugln(_line);
|
||||||
@@ -85,12 +82,13 @@ void TWebBrowser::RenderTextbuf()
|
|||||||
|
|
||||||
//debugln(" \\n");
|
//debugln(" \\n");
|
||||||
|
|
||||||
//Is a new line fits in the current line?
|
//Is a new line fits in the maximum line width?
|
||||||
if (br * list.font_w + draw_x - left_gap >= draw_w) {
|
if (br * list.font_w + draw_x - left_gap >= draw_w) {
|
||||||
br = draw_w - draw_x + left_gap /list.font_w;
|
br = draw_w - draw_x + left_gap /list.font_w;
|
||||||
|
if (br < 0) br = 0;
|
||||||
while(br) {
|
while(br) {
|
||||||
if (ESBYTE[lbp + br]==' ') {
|
if (ESBYTE[lbp + br]==' ') {
|
||||||
br++;
|
if (br < len) br++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
br--;
|
br--;
|
||||||
@@ -98,7 +96,16 @@ void TWebBrowser::RenderTextbuf()
|
|||||||
}
|
}
|
||||||
//Maybe a new line is too big for the whole new line? Then we have to split it
|
//Maybe a new line is too big for the whole new line? Then we have to split it
|
||||||
if (!br) && (len * list.font_w >= draw_w) {
|
if (!br) && (len * list.font_w >= draw_w) {
|
||||||
|
//debugln("bigbr");
|
||||||
|
//debugval("draw_x", draw_x);
|
||||||
|
//debugval("draw_w", draw_w);
|
||||||
br = draw_w - draw_x / list.font_w;
|
br = draw_w - draw_x / list.font_w;
|
||||||
|
//debugval("cut into 1", br * list.font_w);
|
||||||
|
if (br < 0) {
|
||||||
|
NewLine();
|
||||||
|
br = draw_w - draw_x / list.font_w;
|
||||||
|
//debugval("cut into 2", br * list.font_w);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (br) {
|
if (br) {
|
||||||
@@ -122,9 +129,13 @@ void TWebBrowser::NewLine()
|
|||||||
|
|
||||||
if (draw_x==left_gap) && (draw_y==BODY_MARGIN) return;
|
if (draw_x==left_gap) && (draw_y==BODY_MARGIN) return;
|
||||||
if (t_html) && (!t_body) return;
|
if (t_html) && (!t_body) return;
|
||||||
|
|
||||||
if (draw_x == style.tag_list.level * 5 * list.font_w + left_gap) {
|
if (draw_x == style.tag_list.level * 5 * list.font_w + left_gap) {
|
||||||
if (!empty_line) empty_line=true; else return;
|
if (!empty_line) {
|
||||||
|
empty_line=true;
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
empty_line = false;
|
empty_line = false;
|
||||||
}
|
}
|
||||||
|
@@ -56,15 +56,12 @@ void TWebBrowser::SetStyle()
|
|||||||
if (tag.is("tr")) { tag_table(); return; }
|
if (tag.is("tr")) { tag_table(); return; }
|
||||||
if (tag.is("th")) { tag_table(); return; }
|
if (tag.is("th")) { tag_table(); return; }
|
||||||
if (tag.is("td")) { tag_table(); return; }
|
if (tag.is("td")) { tag_table(); return; }
|
||||||
|
|
||||||
if (application_mode) {
|
|
||||||
if (tag.is("exit")) { ExitProcess(); return; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TWebBrowser::tag_p()
|
void TWebBrowser::tag_p()
|
||||||
{
|
{
|
||||||
IF (tag.prior[0] == 'h') || (streq(#tag.prior,"td")) || (streq(#tag.prior,"p")) return;
|
IF (tag.prior[0] == 'h') || (streq(#tag.prior,"td")) return;
|
||||||
|
IF (!tag.opened) && (streq(#tag.prior,"p")) return;
|
||||||
NewLine();
|
NewLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,6 +119,7 @@ void TWebBrowser::tag_iframe()
|
|||||||
|
|
||||||
void TWebBrowser::tag_a()
|
void TWebBrowser::tag_a()
|
||||||
{
|
{
|
||||||
|
if (!secondrun) return;
|
||||||
if (tag.opened)
|
if (tag.opened)
|
||||||
{
|
{
|
||||||
if (tag.get_value_of("href")) && (!strstr(tag.value,"javascript:"))
|
if (tag.get_value_of("href")) && (!strstr(tag.value,"javascript:"))
|
||||||
@@ -136,6 +134,7 @@ void TWebBrowser::tag_a()
|
|||||||
|
|
||||||
void TWebBrowser::tag_meta_xml()
|
void TWebBrowser::tag_meta_xml()
|
||||||
{
|
{
|
||||||
|
if (secondrun) return;
|
||||||
if (custom_encoding == -1) if (tag.get_value_of("charset"))
|
if (custom_encoding == -1) if (tag.get_value_of("charset"))
|
||||||
|| (tag.get_value_of("content")) || (tag.get_value_of("encoding"))
|
|| (tag.get_value_of("content")) || (tag.get_value_of("encoding"))
|
||||||
{
|
{
|
||||||
@@ -148,22 +147,6 @@ void TWebBrowser::tag_meta_xml()
|
|||||||
if (streq(tag.get_value_of("http-equiv"), "refresh")) && (tag.get_value_of("content")) {
|
if (streq(tag.get_value_of("http-equiv"), "refresh")) && (tag.get_value_of("content")) {
|
||||||
if (tag.value = strstri(tag.value, "url")) strcpy(#redirect, tag.value);
|
if (tag.value = strstri(tag.value, "url")) strcpy(#redirect, tag.value);
|
||||||
}
|
}
|
||||||
if (streq(tag.get_value_of("name"), "application")) {
|
|
||||||
if (application_mode) {
|
|
||||||
if (tag.get_number_of("left")) {
|
|
||||||
MoveSize(tag.number,-1,-1,-1);
|
|
||||||
}
|
|
||||||
if (tag.get_number_of("top")) {
|
|
||||||
MoveSize(-1,tag.number,-1,-1);
|
|
||||||
}
|
|
||||||
if (tag.get_number_of("width")) {
|
|
||||||
MoveSize(-1,-1,tag.number,-1);
|
|
||||||
}
|
|
||||||
if (tag.get_number_of("height")) {
|
|
||||||
MoveSize(-1,-1,-1,tag.number);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
signed int get_encoding_type_by_name(dword name)
|
signed int get_encoding_type_by_name(dword name)
|
||||||
@@ -206,7 +189,7 @@ void TWebBrowser::tag_ol_ul_dt()
|
|||||||
|
|
||||||
void TWebBrowser::tag_li()
|
void TWebBrowser::tag_li()
|
||||||
{
|
{
|
||||||
if (style.nav) return;
|
//if (style.nav) return;
|
||||||
if (tag.opened) {
|
if (tag.opened) {
|
||||||
if (!style.tag_list.level) style.tag_list.upd_level(1, 'u');
|
if (!style.tag_list.level) style.tag_list.upd_level(1, 'u');
|
||||||
if (!style.pre) NewLine();
|
if (!style.pre) NewLine();
|
||||||
@@ -235,13 +218,10 @@ void TWebBrowser::tag_hr()
|
|||||||
void TWebBrowser::tag_body()
|
void TWebBrowser::tag_body()
|
||||||
{
|
{
|
||||||
t_body = tag.opened;
|
t_body = tag.opened;
|
||||||
if (tag.get_value_of("link")) link_color_default = GetColor(tag.value);
|
if (tag.get_value_of("link")) link_color_default = GetColor(tag.value);
|
||||||
if (tag.get_value_of("alink")) link_color_active = GetColor(tag.value);
|
if (tag.get_value_of("alink")) link_color_active = GetColor(tag.value);
|
||||||
if (tag.get_value_of("text")) text_colors.set(0, GetColor(tag.value));
|
if (tag.get_value_of("text")) text_colors.set(0, GetColor(tag.value));
|
||||||
if (tag.get_value_of("bgcolor")) {
|
if (tag.get_value_of("bgcolor")) bg_colors.set(0, GetColor(tag.value));
|
||||||
bg_colors.set(0, GetColor(tag.value));
|
|
||||||
canvas.Fill(0, bg_colors.get(0));
|
|
||||||
}
|
|
||||||
// Autodetecting encoding if no encoding was set
|
// Autodetecting encoding if no encoding was set
|
||||||
if (tag.opened) && (custom_encoding==-1) && (cur_encoding == CH_CP866) {
|
if (tag.opened) && (custom_encoding==-1) && (cur_encoding == CH_CP866) {
|
||||||
if (strstr(bufpointer, "\208\190")) ChangeEncoding(CH_UTF8);
|
if (strstr(bufpointer, "\208\190")) ChangeEncoding(CH_UTF8);
|
||||||
@@ -264,11 +244,19 @@ void TWebBrowser::tag_h1234_caption()
|
|||||||
} else {
|
} else {
|
||||||
style.h = tag.opened;
|
style.h = tag.opened;
|
||||||
if (tag.opened) {
|
if (tag.opened) {
|
||||||
if (!style.pre) NewLine();
|
if (!style.pre) {
|
||||||
draw_y += 10;
|
NewLine();
|
||||||
list.SetFont(BASIC_CHAR_W*2, 14*2, 10011001b);
|
NewLine();
|
||||||
list.item_h = BASIC_LINE_H * 2 - 2;
|
}
|
||||||
if (tag.is("h1")) style.b = true;
|
if (tag.is("h1")) {
|
||||||
|
list.SetFont(BASIC_CHAR_W*2, 14+14, 10011001b);
|
||||||
|
style.b = true;
|
||||||
|
} else if (tag.is("h2")) {
|
||||||
|
list.SetFont(BASIC_CHAR_W*2, 14+14, 10011001b);
|
||||||
|
} else {
|
||||||
|
list.SetFont(6*2, 9+7, 10001001b);
|
||||||
|
}
|
||||||
|
style.cur_line_h = list.item_h = list.font_h + 2;
|
||||||
} else {
|
} else {
|
||||||
if (tag.is("h1")) style.b = false;
|
if (tag.is("h1")) style.b = false;
|
||||||
NewLine();
|
NewLine();
|
||||||
@@ -305,7 +293,7 @@ void TWebBrowser::tag_img()
|
|||||||
if (!strcmp(tag.value + strrchr(tag.value, '.'), "webp")) goto NOIMG;
|
if (!strcmp(tag.value + strrchr(tag.value, '.'), "webp")) goto NOIMG;
|
||||||
|
|
||||||
strlcpy(#img_path, tag.value, sizeof(img_path)-1);
|
strlcpy(#img_path, tag.value, sizeof(img_path)-1);
|
||||||
replace_char(#img_path, ' ', '\0', sizeof(img_path));
|
replace_char(#img_path, ' ', '\0', sizeof(img_path)-1);
|
||||||
get_absolute_url(#img_path, history.current());
|
get_absolute_url(#img_path, history.current());
|
||||||
|
|
||||||
if (check_is_the_adress_local(#img_path)) {
|
if (check_is_the_adress_local(#img_path)) {
|
||||||
@@ -342,31 +330,28 @@ NOIMG:
|
|||||||
text_colors.pop();
|
text_colors.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct TABLE {
|
struct TABLE {
|
||||||
int count;
|
|
||||||
int depth;
|
int depth;
|
||||||
int margin;
|
int margin;
|
||||||
collection_int cols;
|
collection_int cols;
|
||||||
collection_int width;
|
|
||||||
} table;
|
} table;
|
||||||
|
|
||||||
|
unsigned table_id;
|
||||||
int tr_pos, td_pos;
|
unsigned colcount;
|
||||||
int row_start_y;
|
unsigned tr_pos;
|
||||||
int colcount;
|
unsigned td_pos;
|
||||||
dword tallest_cell_in_row;
|
unsigned row_start_y;
|
||||||
|
unsigned tallest_cell_in_row;
|
||||||
|
unsigned cur_cell_w;
|
||||||
|
|
||||||
void TWebBrowser::tag_table_reset()
|
void TWebBrowser::tag_table_reset()
|
||||||
{
|
{
|
||||||
table.depth = 0;
|
table_id = 0;
|
||||||
table.count = 0;
|
|
||||||
colcount = 0;
|
colcount = 0;
|
||||||
tr_pos = 0;
|
tr_pos = 0;
|
||||||
td_pos = 0;
|
td_pos = 0;
|
||||||
|
table.depth = 0;
|
||||||
|
cur_cell_w = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TWebBrowser::tag_table()
|
void TWebBrowser::tag_table()
|
||||||
@@ -380,15 +365,15 @@ void TWebBrowser::tag_table()
|
|||||||
if(tag.opened) {
|
if(tag.opened) {
|
||||||
table.depth++;
|
table.depth++;
|
||||||
if (table.depth==1) {
|
if (table.depth==1) {
|
||||||
table.count++;
|
table_id++;
|
||||||
colcount = 0;
|
colcount = 0;
|
||||||
td_pos = 0;
|
td_pos = 0;
|
||||||
row_start_y = draw_y;
|
row_start_y = draw_y;
|
||||||
if (tag.get_number_of("width")) {
|
if (tag.get_number_of("width")) {
|
||||||
if (strchr(tag.value, '%')) tag.number = list.w * tag.number / 100;
|
if (strchr(tag.value, '%')) tag.number = list.w * tag.number / 100;
|
||||||
table.width.set(table.count, math.min(tag.number,list.w));
|
cur_cell_w = math.min(tag.number,list.w);
|
||||||
} else {
|
} else {
|
||||||
table.width.set(table.count, list.w);
|
cur_cell_w = list.w;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -447,26 +432,17 @@ void TWebBrowser::tag_table()
|
|||||||
|
|
||||||
if (!tr_pos) goto _TR_FIX;
|
if (!tr_pos) goto _TR_FIX;
|
||||||
|
|
||||||
/*
|
tallest_cell_in_row = math.max(draw_y+style.cur_line_h-list.item_h+1, tallest_cell_in_row);
|
||||||
if (tag.opened) {
|
|
||||||
if (tag.get_value_of("bgcolor")) {
|
|
||||||
bg_colors.add(GetColor(tag.value));
|
|
||||||
} else {
|
|
||||||
bg_colors.add(bg_colors.get(0));
|
|
||||||
}
|
|
||||||
} */
|
|
||||||
|
|
||||||
tallest_cell_in_row = math.max(draw_y+style.cur_line_h-list.item_h, tallest_cell_in_row);
|
|
||||||
style.cur_line_h = list.item_h;
|
style.cur_line_h = list.item_h;
|
||||||
if (tag.opened) {
|
if (tag.opened)
|
||||||
|
{
|
||||||
if (!td_pos) {
|
if (!td_pos) {
|
||||||
table.margin = list.w - table.width.get(table.count) / 2 + BODY_MARGIN;
|
table.margin = list.w - cur_cell_w / 2 + BODY_MARGIN;
|
||||||
draw_x = left_gap = table.margin;
|
draw_x = left_gap = table.margin;
|
||||||
draw_w = table.width.get(table.count) - BODY_MARGIN;
|
draw_w = cur_cell_w - BODY_MARGIN;
|
||||||
} else {
|
} else {
|
||||||
draw_x = left_gap = left_gap + draw_w;
|
draw_x = left_gap = left_gap + draw_w;
|
||||||
draw_w = table.width.get(table.count) - left_gap + table.margin - BODY_MARGIN;
|
draw_w = cur_cell_w - left_gap + table.margin - BODY_MARGIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EAX = table.cols.get(tr_pos-1)-td_pos) {
|
if (EAX = table.cols.get(tr_pos-1)-td_pos) {
|
||||||
@@ -477,20 +453,18 @@ void TWebBrowser::tag_table()
|
|||||||
}
|
}
|
||||||
if (table.cols.get(tr_pos-1)-td_pos>1) && (tag.get_number_of("width")) {
|
if (table.cols.get(tr_pos-1)-td_pos>1) && (tag.get_number_of("width")) {
|
||||||
if (strchr(tag.value, '%')) {
|
if (strchr(tag.value, '%')) {
|
||||||
tag.number = table.width.get(table.count) - table.margin - 23 - left_gap * tag.number / 100;
|
tag.number = cur_cell_w - table.margin - 23 - left_gap * tag.number / 100;
|
||||||
}
|
}
|
||||||
if (tag.number < draw_w) draw_w = tag.number;
|
if (tag.number < draw_w) draw_w = tag.number;
|
||||||
}
|
}
|
||||||
draw_y = row_start_y;
|
draw_y = row_start_y;
|
||||||
//canvas.WriteText(draw_x, draw_y, 10001001b, 0x0000FE, itoa(draw_x), NULL);
|
|
||||||
//canvas.WriteText(draw_x, draw_y+20, 10001001b, 0xFF0000, itoa(draw_w), NULL);
|
|
||||||
td_pos++;
|
td_pos++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (draw_x > table.width.get(table.count)) {
|
if (draw_x > cur_cell_w) {
|
||||||
draw_x = left_gap = table.margin;
|
draw_x = left_gap = table.margin;
|
||||||
draw_w = table.width.get(table.count) - table.margin - 23 - left_gap;
|
draw_w = cur_cell_w - table.margin - 23 - left_gap;
|
||||||
table.depth = 0;
|
table.depth = 0;
|
||||||
NewLine();
|
NewLine();
|
||||||
if (debug_mode) {
|
if (debug_mode) {
|
||||||
@@ -498,11 +472,8 @@ void TWebBrowser::tag_table()
|
|||||||
canvas.DrawBar(0, draw_y, 20, 20, 0xFF0000);
|
canvas.DrawBar(0, draw_y, 20, 20, 0xFF0000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
//if (left_gap + draw_w > list.w) {
|
||||||
if (left_gap + draw_w > list.w) {
|
// draw_w = list.w - left_gap;
|
||||||
draw_w = list.w - left_gap;
|
// if (debug_mode) debugln("anomaly draw_W");
|
||||||
if (debug_mode) debugln("anomaly draw_W");
|
//}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
@@ -65,6 +65,8 @@ char *unicode_symbols[]={
|
|||||||
"times", "x",
|
"times", "x",
|
||||||
"lowast","*",
|
"lowast","*",
|
||||||
|
|
||||||
|
"#128154","<3",
|
||||||
|
|
||||||
0};
|
0};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
//Copyright 2007-2021 by Veliant & Leency
|
//Copyright 2007-2025 by Veliant & Leency
|
||||||
//Asper, lev, Lrz, Barsuk, Nable, hidnplayr...
|
//Asper, lev, Lrz, Barsuk, Nable, hidnplayr...
|
||||||
|
|
||||||
//BUGS
|
//BUGS
|
||||||
@@ -45,7 +45,6 @@
|
|||||||
bool debug_mode = false;
|
bool debug_mode = false;
|
||||||
bool show_images = true;
|
bool show_images = true;
|
||||||
bool source_mode = false;
|
bool source_mode = false;
|
||||||
bool application_mode = false;
|
|
||||||
|
|
||||||
_history history;
|
_history history;
|
||||||
|
|
||||||
@@ -110,9 +109,6 @@ void HandleParam()
|
|||||||
history.add(#param + 8);
|
history.add(#param + 8);
|
||||||
} else if (!strncmp(#param, "-new ", 5)) {
|
} else if (!strncmp(#param, "-new ", 5)) {
|
||||||
history.add(#param + 5);
|
history.add(#param + 5);
|
||||||
} else if (!strncmp(#param, "-app ", 5)) {
|
|
||||||
history.add(#param + 5);
|
|
||||||
application_mode = true;
|
|
||||||
} else {
|
} else {
|
||||||
if (GetProcessesCount("WEBVIEW") == 1) {
|
if (GetProcessesCount("WEBVIEW") == 1) {
|
||||||
history.add(#param);
|
history.add(#param);
|
||||||
@@ -136,14 +132,6 @@ void main()
|
|||||||
LoadLibraries();
|
LoadLibraries();
|
||||||
HandleParam();
|
HandleParam();
|
||||||
|
|
||||||
if (application_mode) {
|
|
||||||
TOOLBAR_H = 0;
|
|
||||||
PADDING = 0;
|
|
||||||
TSZE = 0;
|
|
||||||
STATUSBAR_H = 0;
|
|
||||||
TAB_H = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
omnibox_edit.left = PADDING+TSZE*2+PADDING+6;
|
omnibox_edit.left = PADDING+TSZE*2+PADDING+6;
|
||||||
omnibox_edit.top = PADDING+3;
|
omnibox_edit.top = PADDING+3;
|
||||||
|
|
||||||
@@ -221,15 +209,6 @@ void main()
|
|||||||
if (http.transfer <= 0) break;
|
if (http.transfer <= 0) break;
|
||||||
http.receive();
|
http.receive();
|
||||||
|
|
||||||
if (http_get_type==PAGE) {
|
|
||||||
CheckContentType();
|
|
||||||
prbar.max = http.content_length;
|
|
||||||
if (prbar.value != http.content_received) {
|
|
||||||
prbar.value = http.content_received;
|
|
||||||
DrawProgress();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (http.receive_result != 0) break;
|
if (http.receive_result != 0) break;
|
||||||
if (debug_mode) {
|
if (debug_mode) {
|
||||||
EAX = http.transfer;
|
EAX = http.transfer;
|
||||||
@@ -248,6 +227,15 @@ void main()
|
|||||||
notify("'Too many redirects.' -E");
|
notify("'Too many redirects.' -E");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (http_get_type==PAGE) {
|
||||||
|
CheckContentType();
|
||||||
|
prbar.max = http.content_length;
|
||||||
|
if (prbar.value != http.content_received) {
|
||||||
|
prbar.value = http.content_received;
|
||||||
|
DrawProgress();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Loading the page is complete, free resources
|
// Loading the page is complete, free resources
|
||||||
redirect_count = 0;
|
redirect_count = 0;
|
||||||
if (http_get_type==PAGE) {
|
if (http_get_type==PAGE) {
|
||||||
@@ -324,7 +312,7 @@ void ProcessKeyEvent()
|
|||||||
if (key_modifier&KEY_LSHIFT) || (key_modifier&KEY_RSHIFT)
|
if (key_modifier&KEY_LSHIFT) || (key_modifier&KEY_RSHIFT)
|
||||||
{
|
{
|
||||||
if (key_scancode == SCAN_CODE_TAB) {EventActivatePreviousTab();return;}
|
if (key_scancode == SCAN_CODE_TAB) {EventActivatePreviousTab();return;}
|
||||||
if (key_scancode == SCAN_CODE_KEY_T) {EventOpenNewTab(URL_SERVICE_TEST);return;}
|
if (key_scancode == SCAN_CODE_BS) {EventOpenNewTab(URL_SERVICE_TEST);return;}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (key_modifier&KEY_LCTRL) || (key_modifier&KEY_RCTRL) switch(key_scancode)
|
if (key_modifier&KEY_LCTRL) || (key_modifier&KEY_RCTRL) switch(key_scancode)
|
||||||
@@ -349,6 +337,7 @@ void ProcessKeyEvent()
|
|||||||
{
|
{
|
||||||
case SCAN_CODE_UP: EventScrollUpAndDown(SCAN_CODE_UP); return;
|
case SCAN_CODE_UP: EventScrollUpAndDown(SCAN_CODE_UP); return;
|
||||||
case SCAN_CODE_DOWN: EventScrollUpAndDown(SCAN_CODE_DOWN); return;
|
case SCAN_CODE_DOWN: EventScrollUpAndDown(SCAN_CODE_DOWN); return;
|
||||||
|
case SCAN_CODE_F2: EventEditSource(); return;
|
||||||
case SCAN_CODE_F6: {omnibox_edit.flags=ed_focus; DrawOmnibox();} return;
|
case SCAN_CODE_F6: {omnibox_edit.flags=ed_focus; DrawOmnibox();} return;
|
||||||
case SCAN_CODE_F5: EventRefreshPage(); return;
|
case SCAN_CODE_F5: EventRefreshPage(); return;
|
||||||
case SCAN_CODE_ENTER: if (omnibox_edit.flags & ed_focus) EventSubmitOmnibox(); return;
|
case SCAN_CODE_ENTER: if (omnibox_edit.flags & ed_focus) EventSubmitOmnibox(); return;
|
||||||
@@ -382,23 +371,21 @@ void draw_window()
|
|||||||
|
|
||||||
SetElementSizes();
|
SetElementSizes();
|
||||||
|
|
||||||
if (!application_mode) {
|
DrawBar(0,0, Form.cwidth,PADDING, sc.work);
|
||||||
DrawBar(0,0, Form.cwidth,PADDING, sc.work);
|
DrawBar(0,PADDING+TSZE+1, Form.cwidth,PADDING-1, sc.work);
|
||||||
DrawBar(0,PADDING+TSZE+1, Form.cwidth,PADDING-1, sc.work);
|
DrawBar(0,TOOLBAR_H-2, Form.cwidth,1, MixColors(sc.dark, sc.work, 180));
|
||||||
DrawBar(0,TOOLBAR_H-2, Form.cwidth,1, MixColors(sc.dark, sc.work, 180));
|
DrawBar(0,TOOLBAR_H-1, Form.cwidth,1, sc.line);
|
||||||
DrawBar(0,TOOLBAR_H-1, Form.cwidth,1, sc.line);
|
DrawBar(0, PADDING, omnibox_edit.left-2, TSZE+1, sc.work);
|
||||||
DrawBar(0, PADDING, omnibox_edit.left-2, TSZE+1, sc.work);
|
DrawBar(omnibox_edit.left+omnibox_edit.width+18, PADDING, Form.cwidth-omnibox_edit.left-omnibox_edit.width-18, TSZE+1, sc.work);
|
||||||
DrawBar(omnibox_edit.left+omnibox_edit.width+18, PADDING, Form.cwidth-omnibox_edit.left-omnibox_edit.width-18, TSZE+1, sc.work);
|
|
||||||
|
|
||||||
DrawTopPanelButton(BACK_BUTTON, PADDING-1, PADDING, 30, false);
|
DrawTopPanelButton(BACK_BUTTON, PADDING-1, PADDING, 30, false);
|
||||||
DrawTopPanelButton(FORWARD_BUTTON, PADDING+TSZE+PADDING-2, PADDING, 31, false);
|
DrawTopPanelButton(FORWARD_BUTTON, PADDING+TSZE+PADDING-2, PADDING, 31, false);
|
||||||
DrawTopPanelButton(SANDWICH_BUTTON, Form.cwidth-PADDING-TSZE-3, PADDING, -1, burger_active); //burger menu
|
DrawTopPanelButton(SANDWICH_BUTTON, Form.cwidth-PADDING-TSZE-3, PADDING, -1, burger_active); //burger menu
|
||||||
|
|
||||||
DrawBar(0,Form.cheight - STATUSBAR_H, Form.cwidth,1, sc.line);
|
DrawBar(0,Form.cheight - STATUSBAR_H, Form.cwidth,1, sc.line);
|
||||||
|
|
||||||
DrawRectangle(WB1.list.x + WB1.list.w, WB1.list.y, scroll_wv.size_x,
|
DrawRectangle(WB1.list.x + WB1.list.w, WB1.list.y, scroll_wv.size_x,
|
||||||
WB1.list.h-1, scroll_wv.bckg_col);
|
WB1.list.h-1, scroll_wv.bckg_col);
|
||||||
}
|
|
||||||
|
|
||||||
if (!canvas.bufw) {
|
if (!canvas.bufw) {
|
||||||
EventOpenFirstPage();
|
EventOpenFirstPage();
|
||||||
@@ -406,12 +393,9 @@ void draw_window()
|
|||||||
WB1.DrawPage();
|
WB1.DrawPage();
|
||||||
DrawOmnibox();
|
DrawOmnibox();
|
||||||
}
|
}
|
||||||
if (!application_mode) {
|
DrawProgress();
|
||||||
DrawProgress();
|
DrawStatusBar(NULL);
|
||||||
DrawStatusBar(NULL);
|
DrawTabsBar();
|
||||||
DrawTabsBar();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void EventOpenFirstPage()
|
void EventOpenFirstPage()
|
||||||
@@ -588,7 +572,6 @@ void OpenPage(dword _open_URL)
|
|||||||
history.add(#new_url);
|
history.add(#new_url);
|
||||||
WB1.custom_encoding = -1;
|
WB1.custom_encoding = -1;
|
||||||
if (streq(#new_url, URL_SERVICE_HOMEPAGE)) LoadInternalPage(#buildin_page_home, sizeof(buildin_page_home));
|
if (streq(#new_url, URL_SERVICE_HOMEPAGE)) LoadInternalPage(#buildin_page_home, sizeof(buildin_page_home));
|
||||||
else if (streq(#new_url, URL_SERVICE_HELP)) LoadInternalPage(#buildin_page_help, sizeof(buildin_page_help));
|
|
||||||
else if (streq(#new_url, URL_SERVICE_TEST)) LoadInternalPage(#buildin_page_test, sizeof(buildin_page_test));
|
else if (streq(#new_url, URL_SERVICE_TEST)) LoadInternalPage(#buildin_page_test, sizeof(buildin_page_test));
|
||||||
else if (streq(#new_url, URL_SERVICE_HISTORY)) ShowHistory();
|
else if (streq(#new_url, URL_SERVICE_HISTORY)) ShowHistory();
|
||||||
else LoadInternalPage(#buildin_page_error, sizeof(buildin_page_error));
|
else LoadInternalPage(#buildin_page_error, sizeof(buildin_page_error));
|
||||||
@@ -757,7 +740,12 @@ void LoadInternalPage(dword _bufdata, _in_bufsize){
|
|||||||
WB1.DrawPage();
|
WB1.DrawPage();
|
||||||
}
|
}
|
||||||
http.hfree();
|
http.hfree();
|
||||||
if (WB1.img_url.count) { GetImg(true); DrawOmnibox(); }
|
if (WB1.img_url.count) {
|
||||||
|
GetImg(true);
|
||||||
|
DrawOmnibox();
|
||||||
|
} else {
|
||||||
|
PageLoaded();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -770,7 +758,6 @@ bool UrlExtIs(dword base, ext)
|
|||||||
void DrawProgress()
|
void DrawProgress()
|
||||||
{
|
{
|
||||||
dword pct;
|
dword pct;
|
||||||
if (application_mode) return;
|
|
||||||
if (!http.transfer) return;
|
if (!http.transfer) return;
|
||||||
if (http_get_type==PAGE) && (prbar.max) pct = prbar.value*30/prbar.max; else pct = 10;
|
if (http_get_type==PAGE) && (prbar.max) pct = prbar.value*30/prbar.max; else pct = 10;
|
||||||
if (http_get_type==IMG) pct = prbar.value * 70 / prbar.max + 30;
|
if (http_get_type==IMG) pct = prbar.value * 70 / prbar.max + 30;
|
||||||
@@ -779,21 +766,18 @@ void DrawProgress()
|
|||||||
|
|
||||||
void EventShowPageMenu()
|
void EventShowPageMenu()
|
||||||
{
|
{
|
||||||
if (application_mode) return;
|
|
||||||
open_lmenu(mouse.x, mouse.y, MENU_TOP_LEFT, NULL, #rmb_menu);
|
open_lmenu(mouse.x, mouse.y, MENU_TOP_LEFT, NULL, #rmb_menu);
|
||||||
menu_id = VIEW_SOURCE;
|
menu_id = BACK_BUTTON;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EventShowLinkMenu()
|
void EventShowLinkMenu()
|
||||||
{
|
{
|
||||||
if (application_mode) return;
|
|
||||||
open_lmenu(mouse.x, mouse.y, MENU_TOP_LEFT, NULL, #link_menu);
|
open_lmenu(mouse.x, mouse.y, MENU_TOP_LEFT, NULL, #link_menu);
|
||||||
menu_id = IN_NEW_TAB;
|
menu_id = IN_NEW_TAB;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EventShowMainMenu()
|
void EventShowMainMenu()
|
||||||
{
|
{
|
||||||
if (application_mode) return;
|
|
||||||
open_lmenu(Form.cwidth - PADDING -4, PADDING + TSZE + 3,
|
open_lmenu(Form.cwidth - PADDING -4, PADDING + TSZE + 3,
|
||||||
MENU_TOP_RIGHT, NULL, #main_menu);
|
MENU_TOP_RIGHT, NULL, #main_menu);
|
||||||
menu_id = OPEN_FILE;
|
menu_id = OPEN_FILE;
|
||||||
@@ -801,7 +785,6 @@ void EventShowMainMenu()
|
|||||||
|
|
||||||
void EventShowEncodingsList()
|
void EventShowEncodingsList()
|
||||||
{
|
{
|
||||||
if (application_mode) return;
|
|
||||||
open_lmenu(Form.cwidth-4, Form.cheight - STATUSBAR_H + 12,
|
open_lmenu(Form.cwidth-4, Form.cheight - STATUSBAR_H + 12,
|
||||||
MENU_BOT_RIGHT, WB1.cur_encoding + 1,
|
MENU_BOT_RIGHT, WB1.cur_encoding + 1,
|
||||||
"UTF-8\nKOI8-RU\nCP1251\nCP1252\nISO8859-5\nCP866");
|
"UTF-8\nKOI8-RU\nCP1251\nCP1252\nISO8859-5\nCP866");
|
||||||
@@ -824,7 +807,8 @@ void EventSeachWeb()
|
|||||||
{
|
{
|
||||||
char new_url[URL_SIZE+1];
|
char new_url[URL_SIZE+1];
|
||||||
replace_char(#editURL, ' ', '+', URL_SIZE);
|
replace_char(#editURL, ' ', '+', URL_SIZE);
|
||||||
strcpy(#new_url, "https://www.google.com/search?q=");
|
//strcpy(#new_url, "https://html.duckduckgo.com/html/?q=");
|
||||||
|
strcpy(#new_url, "http://bing.com/search?q=");
|
||||||
strncat(#new_url, #editURL, URL_SIZE);
|
strncat(#new_url, #editURL, URL_SIZE);
|
||||||
OpenPage(#new_url);
|
OpenPage(#new_url);
|
||||||
}
|
}
|
||||||
@@ -886,7 +870,6 @@ void DrawStatusBar(dword _msg)
|
|||||||
{
|
{
|
||||||
dword status_y = Form.cheight - STATUSBAR_H + 4;
|
dword status_y = Form.cheight - STATUSBAR_H + 4;
|
||||||
dword status_w = Form.cwidth - 90;
|
dword status_w = Form.cwidth - 90;
|
||||||
if (application_mode) return;
|
|
||||||
if (Form.status_window>2) return;
|
if (Form.status_window>2) return;
|
||||||
DrawBar(0,Form.cheight - STATUSBAR_H+1, Form.cwidth,STATUSBAR_H-1, sc.work);
|
DrawBar(0,Form.cheight - STATUSBAR_H+1, Form.cwidth,STATUSBAR_H-1, sc.work);
|
||||||
if (_msg) {
|
if (_msg) {
|
||||||
@@ -900,7 +883,6 @@ void DrawStatusBar(dword _msg)
|
|||||||
void DrawOmnibox()
|
void DrawOmnibox()
|
||||||
{
|
{
|
||||||
int imgxoff;
|
int imgxoff;
|
||||||
if (application_mode) return;
|
|
||||||
DrawOvalBorder(omnibox_edit.left-2, omnibox_edit.top-3, omnibox_edit.width+18, 24, sc.line,
|
DrawOvalBorder(omnibox_edit.left-2, omnibox_edit.top-3, omnibox_edit.width+18, 24, sc.line,
|
||||||
sc.line, sc.line, sc.dark);
|
sc.line, sc.line, sc.dark);
|
||||||
DrawBar(omnibox_edit.left-1, omnibox_edit.top-2, omnibox_edit.width+18, 1, 0xD8DCD8);
|
DrawBar(omnibox_edit.left-1, omnibox_edit.top-2, omnibox_edit.width+18, 1, 0xD8DCD8);
|
||||||
@@ -919,7 +901,6 @@ void DrawOmnibox()
|
|||||||
|
|
||||||
void SetOmniboxText(dword _text)
|
void SetOmniboxText(dword _text)
|
||||||
{
|
{
|
||||||
if (application_mode) return;
|
|
||||||
edit_box_set_text stdcall (#omnibox_edit, _text);
|
edit_box_set_text stdcall (#omnibox_edit, _text);
|
||||||
omnibox_edit.pos = omnibox_edit.flags = 0;
|
omnibox_edit.pos = omnibox_edit.flags = 0;
|
||||||
DrawOmnibox();
|
DrawOmnibox();
|
||||||
@@ -1000,8 +981,13 @@ dword GetImg(bool _new)
|
|||||||
DrawStatusBar(T_RENDERING);
|
DrawStatusBar(T_RENDERING);
|
||||||
WB1.Reparse();
|
WB1.Reparse();
|
||||||
WB1.DrawPage();
|
WB1.DrawPage();
|
||||||
debugln(sprintf(#param, T_DONE_IN_SEC, GetStartTime()-render_start_time/100));
|
PageLoaded();
|
||||||
DrawStatusBar(NULL);
|
}
|
||||||
|
|
||||||
|
void PageLoaded()
|
||||||
|
{
|
||||||
|
DrawStatusBar(sprintf(#param, T_DONE_IN_SEC, GetStartTime()-render_start_time/100,
|
||||||
|
GetStartTime()-render_start_time*10));
|
||||||
}
|
}
|
||||||
|
|
||||||
stop:
|
stop:
|
||||||
|
@@ -16,7 +16,7 @@ struct _cache
|
|||||||
void add();
|
void add();
|
||||||
bool has();
|
bool has();
|
||||||
void clear();
|
void clear();
|
||||||
} cache=0;
|
} cache;
|
||||||
|
|
||||||
void _cache::add(dword _url, _data, _size, _type, _charset)
|
void _cache::add(dword _url, _data, _size, _type, _charset)
|
||||||
{
|
{
|
||||||
@@ -37,6 +37,7 @@ void _cache::add(dword _url, _data, _size, _type, _charset)
|
|||||||
bool _cache::has(dword _link)
|
bool _cache::has(dword _link)
|
||||||
{
|
{
|
||||||
int pos;
|
int pos;
|
||||||
|
if (!url.count) return false;
|
||||||
pos = url.get_pos_by_name(_link);
|
pos = url.get_pos_by_name(_link);
|
||||||
if (pos != -1) {
|
if (pos != -1) {
|
||||||
current_buf = data.get(pos);
|
current_buf = data.get(pos);
|
||||||
|
@@ -9,8 +9,11 @@ char buildin_page_home[] = FROM "res/homepage_ru.htm";
|
|||||||
char buildin_page_help[] = FROM "res/help_ru.htm";
|
char buildin_page_help[] = FROM "res/help_ru.htm";
|
||||||
char accept_language[]= "Accept-Language: ru\n";
|
char accept_language[]= "Accept-Language: ru\n";
|
||||||
char rmb_menu[] =
|
char rmb_menu[] =
|
||||||
"<EFBFBD><EFBFBD>ᬮ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>室<EFBFBD><E5AEA4><EFBFBD>|Ctrl+U
|
"Back|Ctrl+<
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>室<EFBFBD><EFBFBD><EFBFBD>";
|
Forward|Ctrl+>
|
||||||
|
-
|
||||||
|
<EFBFBD><EFBFBD>ᬮ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>室<EFBFBD><EFBFBD><EFBFBD>|Ctrl+U
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>室<EFBFBD><EFBFBD><EFBFBD>|F2";
|
||||||
char main_menu[] =
|
char main_menu[] =
|
||||||
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<>...|Ctrl+O
|
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<>...|Ctrl+O
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>|Ctrl+N
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>|Ctrl+N
|
||||||
@@ -27,14 +30,14 @@ char link_menu[] =
|
|||||||
<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>";
|
||||||
char loading_text[] = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>㧪<EFBFBD>...";
|
char loading_text[] = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>㧪<EFBFBD>...";
|
||||||
|
|
||||||
char update_param[] = "-e http://builds.kolibrios.org/rus/data/programs/cmm/browser/WebView.com";
|
char update_param[] = "-e http://builds.kolibrios.org/ru_RU/data/programs/cmm/browser/WebView.com";
|
||||||
char update_download_error[] = "'WebView\n<EFBFBD>訡<EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>祭<EFBFBD><E7A5AD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!' -tE";
|
char update_download_error[] = "'WebView\n<EFBFBD>訡<EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>祭<EFBFBD><E7A5AD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!' -tE";
|
||||||
char update_ok[] = "'WebView\n<EFBFBD><EFBFBD><EFBFBD>㧥<EFBFBD> <20><><EFBFBD> <20>ᯥ譮 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!' -tO";
|
char update_ok[] = "'WebView\n<EFBFBD><EFBFBD><EFBFBD>㧥<EFBFBD> <20><><EFBFBD> <20>ᯥ譮 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!' -tO";
|
||||||
char update_is_current[] = "'WebView\n<EFBFBD><EFBFBD> 㦥 <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><E1ABA5><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.' -tI";
|
char update_is_current[] = "'WebView\n<EFBFBD><EFBFBD> 㦥 <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><E1ABA5><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.' -tI";
|
||||||
char update_can_not_copy[] = "'WebView\n<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> Downloads <20><> Ramdisk. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>筮 <20><><EFBFBD><EFBFBD><EFBFBD>.' -tE";
|
char update_can_not_copy[] = "'WebView\n<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> Downloads <20><> Ramdisk. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>筮 <20><><EFBFBD><EFBFBD><EFBFBD>.' -tE";
|
||||||
char clear_cache_ok[] = "'WebView\n<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>饭.' -tI";
|
char clear_cache_ok[] = "'WebView\n<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>饭.' -tI";
|
||||||
#define T_RENDERING "<22><><EFBFBD><EFBFBD><EFBFBD>ਭ<EFBFBD> <20><>࠭<EFBFBD><E0A0AD><EFBFBD>..."
|
#define T_RENDERING "<22><><EFBFBD><EFBFBD><EFBFBD>ਭ<EFBFBD> <20><>࠭<EFBFBD><E0A0AD><EFBFBD>..."
|
||||||
#define T_DONE_IN_SEC "<22><>⮢<EFBFBD>: %i ᥪ"
|
#define T_DONE_IN_SEC "<22><>⮢<EFBFBD>: %i ᥪ (%i <20><><EFBFBD><EFBFBD>ᥪ)"
|
||||||
#else
|
#else
|
||||||
//===================================================//
|
//===================================================//
|
||||||
// //
|
// //
|
||||||
@@ -46,8 +49,11 @@ char buildin_page_home[] = FROM "res/homepage_en.htm";
|
|||||||
char buildin_page_help[] = FROM "res/help_en.htm";
|
char buildin_page_help[] = FROM "res/help_en.htm";
|
||||||
char accept_language[]= "Accept-Language: en\n";
|
char accept_language[]= "Accept-Language: en\n";
|
||||||
char rmb_menu[] =
|
char rmb_menu[] =
|
||||||
"View source|Ctrl+U
|
"Back|Ctrl+<
|
||||||
Edit source";
|
Forward|Ctrl+>
|
||||||
|
-
|
||||||
|
View source|Ctrl+U
|
||||||
|
Edit source|F2";
|
||||||
char main_menu[] =
|
char main_menu[] =
|
||||||
"Open local file...|Ctrl+O
|
"Open local file...|Ctrl+O
|
||||||
New window|Ctrl+N
|
New window|Ctrl+N
|
||||||
@@ -63,14 +69,14 @@ Open in new window
|
|||||||
Copy link
|
Copy link
|
||||||
Download link contents";
|
Download link contents";
|
||||||
char loading_text[] = "Loading...";
|
char loading_text[] = "Loading...";
|
||||||
char update_param[] = "-e http://builds.kolibrios.org/eng/data/programs/cmm/browser/WebView.com";
|
char update_param[] = "-e http://builds.kolibrios.org/en_US/data/programs/cmm/browser/WebView.com";
|
||||||
char update_download_error[] = "'WebView\nError receiving an up to date information!' -tE";
|
char update_download_error[] = "'WebView\nError receiving an up to date information!' -tE";
|
||||||
char update_ok[] = "'WebView\nThe browser has been updated!' -tO";
|
char update_ok[] = "'WebView\nThe browser has been updated!' -tO";
|
||||||
char update_is_current[] = "'WebView\nThe browser is up to date.' -tI";
|
char update_is_current[] = "'WebView\nThe browser is up to date.' -tI";
|
||||||
char update_can_not_copy[] = "'WebView\nError copying a new version from Downloads folder!\nProbably too litle space on Ramdisk.' -tE";
|
char update_can_not_copy[] = "'WebView\nError copying a new version from Downloads folder!\nProbably too litle space on Ramdisk.' -tE";
|
||||||
char clear_cache_ok[] = "'WebView\nThe cache has been cleared.' -tI";
|
char clear_cache_ok[] = "'WebView\nThe cache has been cleared.' -tI";
|
||||||
#define T_RENDERING "Rendering..."
|
#define T_RENDERING "Rendering..."
|
||||||
#define T_DONE_IN_SEC "Done in %i sec"
|
#define T_DONE_IN_SEC "Done in %i sec (%i milisec)"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//===================================================//
|
//===================================================//
|
||||||
@@ -83,7 +89,6 @@ char buildin_page_test[] = FROM "res/test.htm";
|
|||||||
|
|
||||||
#define URL_SERVICE_HISTORY "WebView:history"
|
#define URL_SERVICE_HISTORY "WebView:history"
|
||||||
#define URL_SERVICE_HOMEPAGE "WebView:home"
|
#define URL_SERVICE_HOMEPAGE "WebView:home"
|
||||||
#define URL_SERVICE_HELP "WebView:help"
|
|
||||||
#define URL_SERVICE_TEST "WebView:test"
|
#define URL_SERVICE_TEST "WebView:test"
|
||||||
|
|
||||||
char webview_shared[] = "WEBVIEW";
|
char webview_shared[] = "WEBVIEW";
|
||||||
@@ -91,12 +96,12 @@ char webview_shared[] = "WEBVIEW";
|
|||||||
enum {
|
enum {
|
||||||
NEW_TAB=600,
|
NEW_TAB=600,
|
||||||
ENCODINGS=700,
|
ENCODINGS=700,
|
||||||
BACK_BUTTON=800,
|
BACK_BUTTON=800, FORWARD_BUTTON, VIEW_SOURCE, EDIT_SOURCE,
|
||||||
FORWARD_BUTTON, REFRESH_BUTTON, GOTOURL_BUTTON, CHANGE_ENCODING,
|
REFRESH_BUTTON, GOTOURL_BUTTON, CHANGE_ENCODING,
|
||||||
SANDWICH_BUTTON, VIEW_SOURCE, EDIT_SOURCE, OPEN_FILE,
|
SANDWICH_BUTTON,
|
||||||
NEW_WINDOW, VIEW_HISTORY, DOWNLOAD_MANAGER, CLEAR_CACHE,
|
OPEN_FILE, NEW_WINDOW, VIEW_HISTORY, DOWNLOAD_MANAGER,
|
||||||
UPDATE_BROWSER, IN_NEW_TAB, IN_NEW_WINDOW, COPY_LINK_URL,
|
CLEAR_CACHE, UPDATE_BROWSER, IN_NEW_TAB, IN_NEW_WINDOW,
|
||||||
DOWNLOAD_LINK_CT, TAB_ID,
|
COPY_LINK_URL, DOWNLOAD_LINK_CT, TAB_ID,
|
||||||
TAB_CLOSE_ID = 900
|
TAB_CLOSE_ID = 900
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -107,4 +112,4 @@ char editbox_icons[] = FROM "res/editbox_icons.raw";
|
|||||||
|
|
||||||
#define DEFAULT_URL URL_SERVICE_HOMEPAGE
|
#define DEFAULT_URL URL_SERVICE_HOMEPAGE
|
||||||
|
|
||||||
char version[]="WebView 3.66-3";
|
char version[]="WebView 3.82";
|
@@ -2,15 +2,16 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>Homepage</title>
|
<title>Homepage</title>
|
||||||
</head>
|
</head>
|
||||||
<body><pre>Bookmarks:
|
<body><pre>Welcome to WebView a Text-Based Browser.
|
||||||
1. <a href=//kolibrios.org>KolibriOS homepage</a>
|
|
||||||
2. <a href=//kolibri-n.org>KolibriN homepage</a>
|
KolibriOS Bookmarks:
|
||||||
3. <a href="//builds.kolibrios.org">Night-builds</a>
|
1. <a href=//kolibrios.org>Homepage</a>
|
||||||
4. <a href="//store.kolibri-n.org">Kolibri Stuff</a>
|
2. <a href="//builds.kolibrios.org">Night-builds</a>
|
||||||
|
3. <a href="//ftp.kolibrios.org">FTP Server</a>
|
||||||
|
|
||||||
<font bg=#F8F15B>By the way,</font>
|
<font bg=#F8F15B>By the way,</font>
|
||||||
<font color="#555555">• You can check for browser updates from the main menu.
|
<font color="#555555">• You can check for browser updates from the main menu.
|
||||||
• To run a web search, type a text in the adress box and press Ctrl+Enter.
|
• To run a web search, type a text in the adress box and press Ctrl+Enter.
|
||||||
• You can also use other <a href=WebView:help><font color=555555>Hotkeys</font></a>.
|
• Pressing F6 moves a text cursor to the omnibox.
|
||||||
• Click on a label in the bottom right corner to change the encoding of a page.
|
• Click on a label in the bottom right corner to change the encoding of a page.
|
||||||
</font>
|
</font>
|
||||||
|
@@ -1,17 +1,15 @@
|
|||||||
<html>
|
<html><head><meta charset="cp-866">
|
||||||
<head>
|
<title><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>࠭<EFBFBD><E0A0AD><EFBFBD></title></head>
|
||||||
<meta charset="cp-866">
|
<body><pre><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥪<>⮢<EFBFBD><E2AEA2> <20><><EFBFBD>㧥<EFBFBD> WebView!
|
||||||
<title><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>࠭<EFBFBD><E0A0AD><EFBFBD></title>
|
|
||||||
</head>
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> KolibriOS:<ol>
|
||||||
<body><pre><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
<li><a href=//kolibrios.org><EFBFBD><EFBFBD><EFBFBD>樠<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᠩ<></a>
|
||||||
1. <a href=//kolibrios.org><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>࠭<EFBFBD><E0A0AD><EFBFBD> KolibriOS</a>
|
<li><a href="//builds.kolibrios.org"><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᡮન</a>
|
||||||
2. <a href=//kolibri-n.org>KolibriN10</a>
|
<li><a href="//ftp.kolibrios.org">FTP <20><>ࢥ<EFBFBD></a></ol>
|
||||||
3. <a href="//builds.kolibrios.org"><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᡮન</a>
|
|
||||||
4. <a href="//store.kolibri-n.org">Kolibri Store</a>
|
|
||||||
|
|
||||||
<font bg=#F8F15B><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,</font>
|
<font bg=#F8F15B><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,</font>
|
||||||
<font color="#555555">• <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E0AEA2><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>稥 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
<font color="#555555">• <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E0AEA2><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>稥 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
• <20><><EFBFBD> <20><><EFBFBD>᪠ <20> Google <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>᭮<EFBFBD> <20><>ப<EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ctrl+Enter
|
• <20><><EFBFBD> <20><><EFBFBD>᪠ <20> Google <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>᭮<EFBFBD> <20><>ப<EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ctrl+Enter
|
||||||
• <20><><EFBFBD><EFBFBD> ⠪<><E2A0AA> <20><>㣨<EFBFBD> <a href=WebView:help><font color=555555><EFBFBD><EFBFBD><EFBFBD><EFBFBD>稥 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></font></a>.
|
• <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> F6 <20><>६<EFBFBD>頥<EFBFBD> ⥪<>⮢<EFBFBD><E2AEA2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||||
• <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E0AEA2> <20><>࠭<EFBFBD><E0A0AD><EFBFBD>, <20><><EFBFBD> <20>⮣<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20>ࠢ<EFBFBD><E0A0A2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㣫<> <20><><EFBFBD><EFBFBD>.
|
• <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E0AEA2> <20><>࠭<EFBFBD><E0A0AD><EFBFBD>, <20><><EFBFBD> <20>⮣<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20>ࠢ<EFBFBD><E0A0A2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㣫<> <20><><EFBFBD><EFBFBD>.
|
||||||
</font>
|
|
||||||
|
@@ -2,23 +2,22 @@
|
|||||||
<title>TEST</title>
|
<title>TEST</title>
|
||||||
<style>a {display:block;font-size:130%;margin:5px 40px 5px 0;}</style>
|
<style>a {display:block;font-size:130%;margin:5px 40px 5px 0;}</style>
|
||||||
<body>
|
<body>
|
||||||
<pre>
|
<pre><a href=//wiby.org>wiby.org</a>
|
||||||
<a href=//kolibrios.org>KolibriOS</a>
|
<a href=//www.xlr8yourmac.com/OSX/os_x_network_cards.html>OSX network cards</a>
|
||||||
<a href=//kolibri-n.org>KolibriN10</a>
|
<a href=//macintoshgarden.org/>Macintosh Garden</a>
|
||||||
<a href=//store.kolibri-n.org>Kolibri Store</a>
|
|
||||||
|
|
||||||
<table><tr><td>Simplest:
|
<table><tr><td>Simplest:
|
||||||
<a href=//nostalgy.net.ru/>nostalgy.net.ru</a>
|
<a href=//nostalgy.net.ru/>nostalgy.net.ru</a>
|
||||||
<a href=//pci-ids.ucw.cz>pci.ids</a>
|
<a href=//pci-ids.ucw.cz>pci.ids</a>
|
||||||
<a href=//dgmag.in>dgmag.in</a>
|
<a href=//dgmag.in>dgmag.in</a>
|
||||||
<a href=//bash.im>bash.im</a>
|
<a href=//web.archive.org/web/https://bash.im>bash.im</a>
|
||||||
<a href=//opennet.ru>opennet</a>
|
<a href=//web.archive.org/web/https://opennet.ru>opennet</a>
|
||||||
<a href=//linux.org.ru>LOR</a>
|
<a href=//linux.org.ru>LOR</a>
|
||||||
<a href=//baravy.by/me/b.html>baravy.by/me/b.html</a>
|
<a href=//web.archive.org/web/https://samlib.ru/b>samlib.ru/b</a>
|
||||||
<a href=//samlib.ru/b>samlib.ru/b</a>
|
<a href=//web.archive.org/web/https://mirrors.pdp-11.ru>mirrors.pdp-11.ru</a>
|
||||||
<a href=//mirrors.pdp-11.ru>mirrors.pdp-11.ru</a>
|
<a href=//web.archive.org/web/http://gona.mactar.hu/ATI_Mac/>ATI drivers for Mac</a>
|
||||||
<td>Simple:
|
<td>Simple:
|
||||||
<a href=//lionovsky.us>lionovsky.us</a>
|
<a href=//web.archive.org/web/http://lionovsky.us>lionovsky.us</a>
|
||||||
<a href=//os-menuet.narod.ru>os-menuet.narod.ru</a>
|
<a href=//os-menuet.narod.ru>os-menuet.narod.ru</a>
|
||||||
<a href=//mestack.narod.ru/index.html>mestack.narod.ru</a>
|
<a href=//mestack.narod.ru/index.html>mestack.narod.ru</a>
|
||||||
<a href=//coolthemes.narod.ru/indexold.html>coolthemes.narod.ru</a>
|
<a href=//coolthemes.narod.ru/indexold.html>coolthemes.narod.ru</a>
|
||||||
@@ -34,8 +33,7 @@ Moderate:
|
|||||||
<a href=//www.weitek.com/textual/support/driver.html>weitek</a>
|
<a href=//www.weitek.com/textual/support/driver.html>weitek</a>
|
||||||
<a href=//www.abandonwarering.com/?Page=Listing>abandonware</a>
|
<a href=//www.abandonwarering.com/?Page=Listing>abandonware</a>
|
||||||
<td>Complex:
|
<td>Complex:
|
||||||
<a href=//artcon.ru>artcon.ru</a>
|
<a href=//web.archive.org/web/https://artcon.ru>artcon.ru</a>
|
||||||
<a href=//nubo.ru>nubo.ru</a>
|
<a href=//nubo.ru>nubo.ru</a>
|
||||||
<a href=//salinc.ru>salinc.ru</a>
|
|
||||||
<a href=//electromyne.de>electromyne.de</a>
|
<a href=//electromyne.de>electromyne.de</a>
|
||||||
<a href=//www.thg.ru/graphic/25year_ati_history>tom's hardware</a>
|
<a href=//web.archive.org/web/20190403215447//www.thg.ru/>thg</a>
|
@@ -7,8 +7,8 @@
|
|||||||
|
|
||||||
#define TABS_MAX 5
|
#define TABS_MAX 5
|
||||||
|
|
||||||
TWebBrowser tabdata[TABS_MAX+1]=0;
|
TWebBrowser tabdata[TABS_MAX+1];
|
||||||
_history tabstory[TABS_MAX+1]=0;
|
_history tabstory[TABS_MAX+1];
|
||||||
|
|
||||||
struct TAB
|
struct TAB
|
||||||
{
|
{
|
||||||
|
@@ -17,8 +17,10 @@
|
|||||||
#define T_STATUS_DL_P2 " M<> <20><><EFBFBD><EFBFBD>祭<EFBFBD> ("
|
#define T_STATUS_DL_P2 " M<> <20><><EFBFBD><EFBFBD>祭<EFBFBD> ("
|
||||||
#define T_STATUS_DL_P3 " K<>/<EFBFBD>) "
|
#define T_STATUS_DL_P3 " K<>/<EFBFBD>) "
|
||||||
|
|
||||||
#define FILE_SAVED_AS "'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>㧮<EFBFBD>\n<><6E><EFBFBD><EFBFBD> <20><><EFBFBD>࠭<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> %s' -Dt"
|
#define T_ERROR_TOO_MANY_REDIRECTS "'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>㧮<EFBFBD>\n<><6E><EFBFBD>誮<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> ।<EFBFBD>४⮢ (HTTP 3XX)' -Et"
|
||||||
#define FILE_NOT_SAVED "'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>㧮<EFBFBD>\n<>訡<EFBFBD><E8A8A1>! <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>࠭<EFBFBD><E0A0AD> <20><><EFBFBD>\n%s' -Et"
|
|
||||||
|
#define T_FILE_SAVED_AS "'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>㧮<EFBFBD>\n<><6E><EFBFBD><EFBFBD> <20><><EFBFBD>࠭<EFBFBD><E0A0AD> <20><><EFBFBD> %s' -Dt"
|
||||||
|
#define T_FILE_NOT_SAVED "'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>㧮<EFBFBD>\n<>訡<EFBFBD><E8A8A1>! <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>࠭<EFBFBD><E0A0AD> <20><><EFBFBD>\n%s' -Et"
|
||||||
#define T_ERROR_STARTING_DOWNLOAD "'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᪠稢<E1AAA0><E7A8A2><EFBFBD><EFBFBD>.\n<><EFBFBD><E0AEA2><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> ᮥ<><E1AEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>⮬.' -E"
|
#define T_ERROR_STARTING_DOWNLOAD "'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᪠稢<E1AAA0><E7A8A2><EFBFBD><EFBFBD>.\n<><EFBFBD><E0AEA2><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> ᮥ<><E1AEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>⮬.' -E"
|
||||||
char accept_language[]= "Accept-Language: ru\n";
|
char accept_language[]= "Accept-Language: ru\n";
|
||||||
#else
|
#else
|
||||||
@@ -38,8 +40,10 @@
|
|||||||
#define T_STATUS_DL_P2 " MB received ("
|
#define T_STATUS_DL_P2 " MB received ("
|
||||||
#define T_STATUS_DL_P3 " KB/s) "
|
#define T_STATUS_DL_P3 " KB/s) "
|
||||||
|
|
||||||
#define FILE_SAVED_AS "'Download manager\nFile saved as %s' -Dt"
|
#define T_ERROR_TOO_MANY_REDIRECTS "'Download manager\nToo many redirects' -Et"
|
||||||
#define FILE_NOT_SAVED "'Download manager\nError! Can\96t save file as %s' -Et"
|
|
||||||
|
#define T_FILE_SAVED_AS "'Download manager\nFile saved as %s' -Dt"
|
||||||
|
#define T_FILE_NOT_SAVED "'Download manager\nError! Can\96t save file as %s' -Et"
|
||||||
#define T_ERROR_STARTING_DOWNLOAD "'Error while starting download process.\nCheck entered path and Internet connection.' -E"
|
#define T_ERROR_STARTING_DOWNLOAD "'Error while starting download process.\nCheck entered path and Internet connection.' -E"
|
||||||
char accept_language[]= "Accept-Language: en\n";
|
char accept_language[]= "Accept-Language: en\n";
|
||||||
#endif
|
#endif
|
||||||
|
@@ -11,6 +11,8 @@ bool open_file = false;
|
|||||||
|
|
||||||
dword speed;
|
dword speed;
|
||||||
|
|
||||||
|
int redirect_count;
|
||||||
|
|
||||||
_http http;
|
_http http;
|
||||||
|
|
||||||
checkbox autoclose = { T_AUTOCLOSE, false };
|
checkbox autoclose = { T_AUTOCLOSE, false };
|
||||||
@@ -228,6 +230,7 @@ void InitDownload()
|
|||||||
pb.progress_color = PB_COL_PROGRESS;
|
pb.progress_color = PB_COL_PROGRESS;
|
||||||
filepath = '\0';
|
filepath = '\0';
|
||||||
active_status = T_STATUS_READY;
|
active_status = T_STATUS_READY;
|
||||||
|
redirect_count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MonitorProgress()
|
void MonitorProgress()
|
||||||
@@ -241,6 +244,13 @@ void MonitorProgress()
|
|||||||
DrawDownloadingProgress();
|
DrawDownloadingProgress();
|
||||||
} else {
|
} else {
|
||||||
if (http.status_code >= 300) && (http.status_code < 400) {
|
if (http.status_code >= 300) && (http.status_code < 400) {
|
||||||
|
redirect_count++;
|
||||||
|
if (redirect_count >= 5) {
|
||||||
|
notify(T_ERROR_TOO_MANY_REDIRECTS);
|
||||||
|
ProcessButtonClick(BTN_STOP);
|
||||||
|
EditBox_UpdateText(#ed, ed_focus + ed_always_focus);
|
||||||
|
return;
|
||||||
|
}
|
||||||
http.header_field("location", #redirect_url, URL_SIZE);
|
http.header_field("location", #redirect_url, URL_SIZE);
|
||||||
get_absolute_url(#redirect_url, #uEdit);
|
get_absolute_url(#redirect_url, #uEdit);
|
||||||
edit_box_set_text stdcall (#ed, #redirect_url);
|
edit_box_set_text stdcall (#ed, #redirect_url);
|
||||||
@@ -307,9 +317,9 @@ void SaveFile(int attempt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (CreateFile(http.content_received, http.content_pointer, #filepath)==0) {
|
if (CreateFile(http.content_received, http.content_pointer, #filepath)==0) {
|
||||||
miniprintf(#notify_message, FILE_SAVED_AS, #filepath);
|
miniprintf(#notify_message, T_FILE_SAVED_AS, #filepath);
|
||||||
} else {
|
} else {
|
||||||
miniprintf(#notify_message, FILE_NOT_SAVED, #filepath);
|
miniprintf(#notify_message, T_FILE_NOT_SAVED, #filepath);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!autoclose.checked) notify(#notify_message);
|
if (!autoclose.checked) notify(#notify_message);
|
||||||
|
@@ -11,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.26a"
|
#define ABOUT_TITLE "EOLITE 5.27"
|
||||||
#define TITLE_EOLITE "Eolite File Manager 5.26a"
|
#define TITLE_EOLITE "Eolite File Manager 5.27"
|
||||||
#define TITLE_KFM "Kolibri File Manager 2.26a";
|
#define TITLE_KFM "Kolibri File Manager 2.27";
|
||||||
|
|
||||||
#define MEMSIZE 1024 * 250
|
#define MEMSIZE 1024 * 250
|
||||||
#include "../lib/clipboard.h"
|
#include "../lib/clipboard.h"
|
||||||
@@ -239,6 +239,7 @@ void main()
|
|||||||
if (key_modifier&KEY_LSHIFT) || (key_modifier&KEY_RSHIFT) {
|
if (key_modifier&KEY_LSHIFT) || (key_modifier&KEY_RSHIFT) {
|
||||||
EventChooseFilesRange(old_cur_y, files.cur_y);
|
EventChooseFilesRange(old_cur_y, files.cur_y);
|
||||||
} else if (key_modifier&KEY_LCTRL) || (key_modifier&KEY_RCTRL) {
|
} else if (key_modifier&KEY_LCTRL) || (key_modifier&KEY_RCTRL) {
|
||||||
|
if (!getSelectedCount()) EventChooseFile(old_cur_y);
|
||||||
EventChooseFile(files.cur_y);
|
EventChooseFile(files.cur_y);
|
||||||
DrawStatusBar();
|
DrawStatusBar();
|
||||||
List_ReDraw();
|
List_ReDraw();
|
||||||
@@ -539,7 +540,7 @@ void draw_window()
|
|||||||
incn x;
|
incn x;
|
||||||
dword title;
|
dword title;
|
||||||
static int rand_n;
|
static int rand_n;
|
||||||
if (!rand_n) rand_n = random(80);
|
if (!rand_n) && (Form.width + 1 != screen.w) rand_n = random(80);
|
||||||
|
|
||||||
if (show_status_bar.checked) {
|
if (show_status_bar.checked) {
|
||||||
#define STBAR_EOLITE_H 16
|
#define STBAR_EOLITE_H 16
|
||||||
|
@@ -13,7 +13,6 @@ struct collection_int
|
|||||||
dword buf;
|
dword buf;
|
||||||
dword buf_size;
|
dword buf_size;
|
||||||
unsigned count;
|
unsigned count;
|
||||||
void alloc();
|
|
||||||
void add();
|
void add();
|
||||||
dword get();
|
dword get();
|
||||||
dword set();
|
dword set();
|
||||||
@@ -22,34 +21,35 @@ struct collection_int
|
|||||||
dword get_last();
|
dword get_last();
|
||||||
void pop();
|
void pop();
|
||||||
void drop();
|
void drop();
|
||||||
|
#define DWSIZE4 4
|
||||||
};
|
};
|
||||||
|
|
||||||
:void collection_int::alloc() {
|
|
||||||
if (!buf) {
|
|
||||||
buf_size = 4096;
|
|
||||||
buf = malloc(4096);
|
|
||||||
} else {
|
|
||||||
buf_size += 4096;
|
|
||||||
buf = realloc(buf, buf_size);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
:void collection_int::add(dword _in) {
|
:void collection_int::add(dword _in) {
|
||||||
if (!buf) || (count * sizeof(dword) >= buf_size) alloc();
|
unsigned i;
|
||||||
EAX = count * sizeof(dword) + buf;
|
if (!buf) {
|
||||||
ESDWORD[EAX] = _in;
|
//if (buf_size) notify("'buf_size on empty buf' -A");
|
||||||
|
buf_size = 4096 * 5;
|
||||||
|
buf = malloc(4096 * 5);
|
||||||
|
//if (!buf) notify("'malloc error' -E");
|
||||||
|
} else if (count + 1 * DWSIZE4 >= buf_size) {
|
||||||
|
buf_size += 4096 * 5;
|
||||||
|
buf = realloc(buf, buf_size);
|
||||||
|
//if (!buf) notify("'realloc error' -E");
|
||||||
|
}
|
||||||
|
i = count * DWSIZE4 + buf;
|
||||||
|
ESDWORD[i] = _in;
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
:dword collection_int::get(dword pos) {
|
:dword collection_int::get(dword pos) {
|
||||||
if (pos<0) || (pos>=count) return 0;
|
if (!buf) || (pos<0) || (pos>=count) return 0;
|
||||||
return ESDWORD[pos * sizeof(dword) + buf];
|
return ESDWORD[pos * DWSIZE4 + buf];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
:dword collection_int::set(dword pos, _in) {
|
:dword collection_int::set(dword pos, _in) {
|
||||||
while (pos >= count) add(0);
|
while (pos >= count) add(0);
|
||||||
EAX = pos * sizeof(dword) + buf;
|
EAX = pos * DWSIZE4 + buf;
|
||||||
ESDWORD[EAX] = _in;
|
ESDWORD[EAX] = _in;
|
||||||
return ESDWORD[EAX];
|
return ESDWORD[EAX];
|
||||||
}
|
}
|
||||||
@@ -57,8 +57,8 @@ struct collection_int
|
|||||||
:void collection_int::swap(dword pos1, pos2) {
|
:void collection_int::swap(dword pos1, pos2) {
|
||||||
while (pos1 >= count) add(0);
|
while (pos1 >= count) add(0);
|
||||||
while (pos2 >= count) add(0);
|
while (pos2 >= count) add(0);
|
||||||
EAX = pos1 * sizeof(dword) + buf;
|
EAX = pos1 * DWSIZE4 + buf;
|
||||||
EBX = pos2 * sizeof(dword) + buf;
|
EBX = pos2 * DWSIZE4 + buf;
|
||||||
ESDWORD[EAX] >< ESDWORD[EBX];
|
ESDWORD[EAX] >< ESDWORD[EBX];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,6 +77,8 @@ struct collection_int
|
|||||||
|
|
||||||
:void collection_int::drop() {
|
:void collection_int::drop() {
|
||||||
count = 0;
|
count = 0;
|
||||||
|
if (buf) buf = free(buf);
|
||||||
|
buf_size = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*========================================================
|
/*========================================================
|
||||||
@@ -87,12 +89,11 @@ struct collection_int
|
|||||||
|
|
||||||
struct collection
|
struct collection
|
||||||
{
|
{
|
||||||
int realloc_size, count;
|
unsigned int realloc_size, count;
|
||||||
dword data_start;
|
dword data_start;
|
||||||
dword data_size;
|
dword data_size;
|
||||||
collection_int offset;
|
collection_int offset;
|
||||||
int add();
|
dword add();
|
||||||
int addn();
|
|
||||||
dword get(); //get_name_by_pos
|
dword get(); //get_name_by_pos
|
||||||
dword get_pos_by_name();
|
dword get_pos_by_name();
|
||||||
void drop();
|
void drop();
|
||||||
@@ -105,28 +106,22 @@ struct collection
|
|||||||
if (realloc_size<4096) realloc_size = 4096;
|
if (realloc_size<4096) realloc_size = 4096;
|
||||||
if (!data_size) {
|
if (!data_size) {
|
||||||
data_size = realloc_size;
|
data_size = realloc_size;
|
||||||
data_start = malloc(realloc_size);
|
data_start = malloc(data_size);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
data_size = data_size + realloc_size;
|
data_size = data_size + realloc_size;
|
||||||
data_start = realloc(data_start, data_size);
|
data_start = realloc(data_start, data_size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
:int collection::add(dword in) {
|
:dword collection::add(dword in) {
|
||||||
return addn(in, strlen(in));
|
dword len = strlen(in);
|
||||||
}
|
while (offset.get(count) + len + 4 > data_size) {
|
||||||
|
|
||||||
:int collection::addn(dword in, len) {
|
|
||||||
if (offset.get(count)+len+2 > data_size) {
|
|
||||||
increase_data_size();
|
increase_data_size();
|
||||||
addn(in, len);
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
strncpy(data_start+offset.get(count), in, len);
|
strncpy(data_start+offset.get(count), in, len);
|
||||||
count++;
|
count++;
|
||||||
offset.set(count, offset.get(count-1) + len + 1);
|
offset.set(count, offset.get(count-1) + len + 1);
|
||||||
return 1;
|
return data_start+offset.get(count-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
:dword collection::get(dword pos) {
|
:dword collection::get(dword pos) {
|
||||||
@@ -141,7 +136,9 @@ struct collection
|
|||||||
:dword collection::get_pos_by_name(dword name) {
|
:dword collection::get_pos_by_name(dword name) {
|
||||||
dword i;
|
dword i;
|
||||||
for (i=0; i<count; i++) {
|
for (i=0; i<count; i++) {
|
||||||
if (strcmp(data_start + offset.get(i), name)==0) return i;
|
if (streq(data_start + offset.get(i), name)) {
|
||||||
|
return i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@@ -57,8 +57,8 @@ inline fastcall void utf8rutodos( ESI)
|
|||||||
while (BL=ESBYTE[ESI])
|
while (BL=ESBYTE[ESI])
|
||||||
{
|
{
|
||||||
if (BL == 0xD0) || (BL == 0xD1) EDI--;
|
if (BL == 0xD0) || (BL == 0xD1) EDI--;
|
||||||
else if (BL == 0x81) && (ESBYTE[ESI-1]==0xD0) ESBYTE[EDI] = 0xF0; //<EFBFBD>
|
else if (BL == 0x81) && (ESBYTE[ESI-1]==0xD0) ESBYTE[EDI] = 0xF0; //I urk
|
||||||
else if (BL == 0x91) && (ESBYTE[ESI-1]==0xD1) ESBYTE[EDI] = 0xF1; //<EFBFBD>
|
else if (BL == 0x91) && (ESBYTE[ESI-1]==0xD1) ESBYTE[EDI] = 0xF1; //i urk
|
||||||
//0xE2 0x80 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
//0xE2 0x80 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
else if (BL == 0xE2) && (ESBYTE[ESI+1]==0x80)
|
else if (BL == 0xE2) && (ESBYTE[ESI+1]==0x80)
|
||||||
switch (ESBYTE[ESI+2])
|
switch (ESBYTE[ESI+2])
|
||||||
|
@@ -202,7 +202,7 @@ struct proc_info
|
|||||||
byte reserved[1024-71];
|
byte reserved[1024-71];
|
||||||
};
|
};
|
||||||
|
|
||||||
:void GetProcessInfo(dword _process_struct_pointer, _process_id)
|
:int GetProcessInfo(dword _process_struct_pointer, _process_id)
|
||||||
{
|
{
|
||||||
EAX = 9;
|
EAX = 9;
|
||||||
EBX = _process_struct_pointer;
|
EBX = _process_struct_pointer;
|
||||||
|
@@ -70,17 +70,17 @@ char aURIunescape[] = "unescape";
|
|||||||
#define FLAG_TRANSFER_FAILED 1 << 20
|
#define FLAG_TRANSFER_FAILED 1 << 20
|
||||||
|
|
||||||
struct http_msg{
|
struct http_msg{
|
||||||
dword socket;
|
dword socket; //socket on which the actual transfer happens
|
||||||
dword flags;
|
dword flags; //flags, reflects status of the transfer using bitflags
|
||||||
dword write_ptr;
|
dword write_ptr; //internal use only (where to write new data in buffer)
|
||||||
dword buffer_length;
|
dword buffer_length; //internal use only (number of available bytes in buffer)
|
||||||
dword chunk_ptr;
|
dword chunk_ptr; //internal use only (where the next chunk begins)
|
||||||
dword timestamp;
|
dword timestamp; //internal use only (when last data was received)
|
||||||
dword status;
|
dword status; //HTTP status
|
||||||
dword header_length;
|
dword header_length; //length of HTTP header
|
||||||
dword content_ptr;
|
dword content_ptr; //ptr to content
|
||||||
dword content_length;
|
dword content_length; //total length of HTTP content
|
||||||
dword content_received;
|
dword content_received; //number of currently received content bytes
|
||||||
char http_header;
|
char http_header;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -30,8 +30,7 @@ enum {
|
|||||||
proc_info Process;
|
proc_info Process;
|
||||||
for (i=0; i<MAX_PROCESS_COUNT; i++)
|
for (i=0; i<MAX_PROCESS_COUNT; i++)
|
||||||
{
|
{
|
||||||
GetProcessInfo(#Process, i);
|
if (i > GetProcessInfo(#Process, i)) break;
|
||||||
if (EAX+1 >= i) break;
|
|
||||||
if (Process.status_slot != TSTATE_FREE)
|
if (Process.status_slot != TSTATE_FREE)
|
||||||
&& (strcmpi(#Process.name, proc_name)==0)
|
&& (strcmpi(#Process.name, proc_name)==0)
|
||||||
{
|
{
|
||||||
@@ -46,8 +45,7 @@ enum {
|
|||||||
proc_info Process;
|
proc_info Process;
|
||||||
for (i=0; i<MAX_PROCESS_COUNT; i++)
|
for (i=0; i<MAX_PROCESS_COUNT; i++)
|
||||||
{
|
{
|
||||||
GetProcessInfo(#Process, i);
|
if (i > GetProcessInfo(#Process, i)) break;
|
||||||
if (EAX+1 >= i) break;
|
|
||||||
if (Process.status_slot != TSTATE_FREE)
|
if (Process.status_slot != TSTATE_FREE)
|
||||||
&& (strcmpi(#Process.name, proc_name)==0)
|
&& (strcmpi(#Process.name, proc_name)==0)
|
||||||
count++;
|
count++;
|
||||||
@@ -66,8 +64,7 @@ enum {
|
|||||||
GetProcessInfo(#Self, -1);
|
GetProcessInfo(#Self, -1);
|
||||||
for (i=0; i<MAX_PROCESS_COUNT; i++)
|
for (i=0; i<MAX_PROCESS_COUNT; i++)
|
||||||
{
|
{
|
||||||
GetProcessInfo(#Process, i);
|
if (i > GetProcessInfo(#Process, i)) break;
|
||||||
if (EAX+1 >= i) break;
|
|
||||||
if (Process.name)
|
if (Process.name)
|
||||||
&& (Process.ID != Self.ID)
|
&& (Process.ID != Self.ID)
|
||||||
KillProcess(Process.ID);
|
KillProcess(Process.ID);
|
||||||
|
2
programs/demos/aclock/Tupfile.lua
Normal file
2
programs/demos/aclock/Tupfile.lua
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
if tup.getconfig("NO_FASM") ~= "" then return end
|
||||||
|
tup.rule("aclock.asm", "fasm %f %o " .. tup.getconfig("KPACK_CMD"), "aclock")
|
@@ -16,44 +16,42 @@
|
|||||||
; along with this program; if not, write to the Free Software
|
; along with this program; if not, write to the Free Software
|
||||||
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
bits 32
|
use32
|
||||||
%include 'mos.inc'
|
org 0
|
||||||
section .text
|
db 'MENUET01'
|
||||||
|
dd 1,main,image_end,memory_end,stacktop,cmdLine,0
|
||||||
|
|
||||||
|
include '../../macros.inc'
|
||||||
|
include '../../proc32.inc'
|
||||||
|
include '../../KOSfuncs.inc'
|
||||||
|
|
||||||
|
|
||||||
;********************************************************************
|
;********************************************************************
|
||||||
; configuration stuff
|
; configuration stuff
|
||||||
;********************************************************************
|
;********************************************************************
|
||||||
|
; skinned window borders
|
||||||
%define APPNAME "Clock"
|
MOS_WND_SKIN_BORDER_LEFT = 5
|
||||||
%define STACKSIZE 1024
|
MOS_WND_SKIN_BORDER_RIGHT = 5
|
||||||
|
MOS_WND_SKIN_BORDER_BOTTOM = 5
|
||||||
|
|
||||||
; default window position/dimensions (work area)
|
; default window position/dimensions (work area)
|
||||||
%define DEFAULT_XPOS -20
|
DEFAULT_XPOS =-20
|
||||||
%define DEFAULT_YPOS 20
|
DEFAULT_YPOS =20
|
||||||
%define DEFAULT_WIDTH 110
|
DEFAULT_WIDTH =110
|
||||||
%define DEFAULT_HEIGHT 110
|
DEFAULT_HEIGHT =110
|
||||||
|
|
||||||
; minimal size (horizontal and vertical) of work area
|
; minimal size (horizontal and vertical) of work area
|
||||||
%define MIN_WIDTH 100
|
MIN_WIDTH =100
|
||||||
%define MIN_HEIGHT 100
|
MIN_HEIGHT =100
|
||||||
|
|
||||||
|
|
||||||
;********************************************************************
|
|
||||||
; header
|
|
||||||
;********************************************************************
|
|
||||||
|
|
||||||
MOS_HEADER01 main,image_end,memory_end,stacktop-4,cmdLine,0
|
|
||||||
|
|
||||||
; these includes introduce code and thus mustn't stand
|
; these includes introduce code and thus mustn't stand
|
||||||
; before the menuet header =)
|
; before the menuet header =)
|
||||||
%include 'dbgboard.inc'
|
include 'dbgboard.inc'
|
||||||
%include 'strlen.inc'
|
include 'strfunct.inc'
|
||||||
%include 'str2dwrd.inc'
|
include 'cmdline.inc'
|
||||||
%include 'strtok.inc'
|
include 'adjstwnd.inc'
|
||||||
%include 'cmdline.inc'
|
include 'draw.inc'
|
||||||
%include 'adjstwnd.inc'
|
|
||||||
%include 'draw.inc'
|
|
||||||
|
|
||||||
;********************************************************************
|
;********************************************************************
|
||||||
; main program
|
; main program
|
||||||
@@ -89,20 +87,18 @@ main:
|
|||||||
; call drawClock
|
; call drawClock
|
||||||
|
|
||||||
; wait up to a second for next event
|
; wait up to a second for next event
|
||||||
mov eax,MOS_SC_WAITEVENTTIMEOUT
|
mcall SF_WAIT_EVENT_TIMEOUT,100
|
||||||
mov ebx,100
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
test eax,eax
|
test eax,eax
|
||||||
jne .event_occured
|
jne .event_occured
|
||||||
call drawClock
|
call drawClock
|
||||||
|
|
||||||
.event_occured:
|
.event_occured:
|
||||||
cmp eax,MOS_EVT_REDRAW
|
cmp eax,EV_REDRAW
|
||||||
je .redraw
|
je .redraw
|
||||||
cmp eax,MOS_EVT_KEY
|
cmp eax,EV_KEY
|
||||||
je .key
|
je .key
|
||||||
cmp eax,MOS_EVT_BUTTON
|
cmp eax,EV_BUTTON
|
||||||
je .button
|
je .button
|
||||||
jmp .msgpump
|
jmp .msgpump
|
||||||
|
|
||||||
@@ -110,12 +106,10 @@ main:
|
|||||||
call drawWindow
|
call drawWindow
|
||||||
jmp .msgpump
|
jmp .msgpump
|
||||||
.key:
|
.key:
|
||||||
mov eax,MOS_SC_GETKEY
|
mcall SF_GET_KEY
|
||||||
int 0x40
|
|
||||||
jmp .msgpump
|
jmp .msgpump
|
||||||
.button:
|
.button:
|
||||||
mov eax,MOS_SC_EXIT
|
mcall SF_TERMINATE_PROCESS
|
||||||
int 0x40
|
|
||||||
jmp .msgpump
|
jmp .msgpump
|
||||||
|
|
||||||
|
|
||||||
@@ -128,11 +122,7 @@ main:
|
|||||||
getDefaultWindowColors:
|
getDefaultWindowColors:
|
||||||
pushad
|
pushad
|
||||||
pushfd
|
pushfd
|
||||||
mov eax,MOS_SC_WINDOWPROPERTIES
|
mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,wndColors,sizeof.system_colors
|
||||||
mov ebx,3
|
|
||||||
mov ecx,wndColors
|
|
||||||
mov edx,MOS_WNDCOLORS_size
|
|
||||||
int 0x40
|
|
||||||
popfd
|
popfd
|
||||||
popad
|
popad
|
||||||
ret
|
ret
|
||||||
@@ -149,29 +139,24 @@ drawWindow:
|
|||||||
pusha
|
pusha
|
||||||
|
|
||||||
; start window redraw
|
; start window redraw
|
||||||
mov eax,MOS_SC_REDRAWSTATUS
|
mcall SF_REDRAW,SSF_BEGIN_DRAW
|
||||||
mov ebx,1
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
; create window
|
; create window
|
||||||
mov eax,MOS_SC_DEFINEWINDOW
|
|
||||||
mov ebx,[wndXPos]
|
mov ebx,[wndXPos]
|
||||||
shl ebx,16
|
shl ebx,16
|
||||||
or ebx,[wndWidth]
|
or ebx,[wndWidth]
|
||||||
mov ecx,[wndYPos]
|
mov ecx,[wndYPos]
|
||||||
shl ecx,16
|
shl ecx,16
|
||||||
or ecx,[wndHeight]
|
or ecx,[wndHeight]
|
||||||
mov edx,[wndColors+MOS_WNDCOLORS.work]
|
mov edx,[wndColors.work]
|
||||||
or edx,0x53000000
|
or edx,0x53000000
|
||||||
mov edi,label
|
mov edi,w_label
|
||||||
int 0x40
|
mcall SF_CREATE_WINDOW
|
||||||
|
|
||||||
call drawClock
|
call drawClock
|
||||||
|
|
||||||
; end window redraw
|
; end window redraw
|
||||||
mov eax,MOS_SC_REDRAWSTATUS
|
mcall SF_REDRAW,SSF_END_DRAW
|
||||||
mov ebx,2
|
|
||||||
int 0x40
|
|
||||||
popa
|
popa
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@@ -188,32 +173,29 @@ wndWidth dd DEFAULT_WIDTH
|
|||||||
wndHeight dd DEFAULT_HEIGHT
|
wndHeight dd DEFAULT_HEIGHT
|
||||||
|
|
||||||
; window label
|
; window label
|
||||||
label db APPNAME,0
|
w_label: db "Clock",0
|
||||||
LABEL_LEN equ ($-label-1)
|
.end:
|
||||||
|
LABEL_LEN equ (w_label.end-w_label-1)
|
||||||
|
|
||||||
; token delimiter list for command line
|
; token delimiter list for command line
|
||||||
delimiters db 9,10,11,12,13,32,0
|
delimiters db 9,10,11,12,13,32,0
|
||||||
|
|
||||||
; don't insert anything after this label
|
|
||||||
image_end:
|
image_end:
|
||||||
|
|
||||||
|
|
||||||
;********************************************************************
|
;********************************************************************
|
||||||
; uninitialized data
|
; uninitialized data
|
||||||
;********************************************************************
|
;********************************************************************
|
||||||
section .bss align=4
|
align 4
|
||||||
|
wndColors system_colors
|
||||||
wndColors resb MOS_WNDCOLORS_size
|
procInfo process_information
|
||||||
procInfo resb MOS_PROCESSINFO_size
|
|
||||||
|
|
||||||
; space for command line. at the end we have an additional
|
; space for command line. at the end we have an additional
|
||||||
; byte for a terminating zero, just to be sure...
|
; byte for a terminating zero, just to be sure...
|
||||||
cmdLine resb 257
|
cmdLine rb 257
|
||||||
|
|
||||||
alignb 4
|
align 4
|
||||||
stack resb STACKSIZE
|
rb 1024
|
||||||
stacktop:
|
stacktop:
|
||||||
|
|
||||||
; don't insert anything after this label
|
|
||||||
memory_end:
|
memory_end:
|
||||||
|
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
@@ -20,8 +20,6 @@
|
|||||||
; along with this program; if not, write to the Free Software
|
; along with this program; if not, write to the Free Software
|
||||||
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
;
|
;
|
||||||
%ifndef _ADJSTWND_INC
|
|
||||||
%define _ADJSTWND_INC
|
|
||||||
|
|
||||||
|
|
||||||
;window types
|
;window types
|
||||||
@@ -72,8 +70,7 @@ adjustWindowDimensions:
|
|||||||
|
|
||||||
; clamp window dimensions
|
; clamp window dimensions
|
||||||
.clamp:
|
.clamp:
|
||||||
mov eax,MOS_SC_GETSCREENMAX ; get screen dimensions
|
mcall SF_GET_SCREEN_SIZE ; get screen dimensions
|
||||||
int 0x40
|
|
||||||
mov edi,eax ; edi = screen width
|
mov edi,eax ; edi = screen width
|
||||||
shr edi,16
|
shr edi,16
|
||||||
mov ebp,eax ; ebp = screen height
|
mov ebp,eax ; ebp = screen height
|
||||||
@@ -136,12 +133,10 @@ adjustWindowDimensions:
|
|||||||
add edx,MOS_WND_SKIN_BORDER_LEFT+MOS_WND_SKIN_BORDER_RIGHT
|
add edx,MOS_WND_SKIN_BORDER_LEFT+MOS_WND_SKIN_BORDER_RIGHT
|
||||||
; adjust height (esi). we need the skin height to do this.
|
; adjust height (esi). we need the skin height to do this.
|
||||||
push ebx
|
push ebx
|
||||||
mov eax,MOS_SC_WINDOWPROPERTIES
|
mcall SF_STYLE_SETTINGS,SSF_GET_SKIN_HEIGHT
|
||||||
mov ebx,4
|
|
||||||
int 0x40
|
|
||||||
lea esi,[esi+eax+MOS_WND_SKIN_BORDER_BOTTOM]
|
lea esi,[esi+eax+MOS_WND_SKIN_BORDER_BOTTOM]
|
||||||
pop ebx
|
pop ebx
|
||||||
jmp .clamp
|
jmp .clamp
|
||||||
|
|
||||||
%endif
|
|
||||||
|
|
3
programs/demos/aclock/build.bat
Normal file
3
programs/demos/aclock/build.bat
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
@fasm.exe -m 16384 aclock.asm aclock.kex
|
||||||
|
@kpack aclock.kex
|
||||||
|
pause
|
@@ -17,8 +17,6 @@
|
|||||||
; along with this program; if not, write to the Free Software
|
; along with this program; if not, write to the Free Software
|
||||||
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
;
|
;
|
||||||
%ifndef _CMDLINE_INC
|
|
||||||
%define _CMDLINE_INC
|
|
||||||
|
|
||||||
|
|
||||||
;********************************************************************
|
;********************************************************************
|
||||||
@@ -105,8 +103,7 @@ parseCommandLine:
|
|||||||
; output : eax contains position
|
; output : eax contains position
|
||||||
; destroys : nothing
|
; destroys : nothing
|
||||||
parsePositionParam:
|
parsePositionParam:
|
||||||
push ebx
|
push ebx esi
|
||||||
push esi
|
|
||||||
pushfd
|
pushfd
|
||||||
|
|
||||||
; is the second char of the parameter a '-' ?
|
; is the second char of the parameter a '-' ?
|
||||||
@@ -129,8 +126,7 @@ parsePositionParam:
|
|||||||
.rotationshyperboloid:
|
.rotationshyperboloid:
|
||||||
|
|
||||||
popfd
|
popfd
|
||||||
pop esi
|
pop esi ebx
|
||||||
pop ebx
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
; parse dimension parameter
|
; parse dimension parameter
|
||||||
@@ -147,5 +143,4 @@ parseSizeParam:
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
%endif
|
|
||||||
|
|
@@ -19,20 +19,34 @@
|
|||||||
; along with this program; if not, write to the Free Software
|
; along with this program; if not, write to the Free Software
|
||||||
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
;
|
;
|
||||||
%ifndef _DBGBOARD_INC
|
|
||||||
%define _DBGBOARD_INC
|
|
||||||
|
|
||||||
|
|
||||||
%ifdef DEBUG
|
if DEBUG eq
|
||||||
|
|
||||||
|
macro DBG_BOARD_PRINTNEWLINE {
|
||||||
|
}
|
||||||
|
|
||||||
|
macro DBG_BOARD_PRINTCHAR c1 {
|
||||||
|
}
|
||||||
|
|
||||||
|
macro DBG_BOARD_PRINTDWORD w1 {
|
||||||
|
}
|
||||||
|
|
||||||
|
macro DBG_BOARD_PRINTSTRINGLITERAL p1 {
|
||||||
|
}
|
||||||
|
|
||||||
|
macro DBG_BOARD_PRINTSTRING s1 {
|
||||||
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
;********************************************************************
|
;********************************************************************
|
||||||
; print newline
|
; print newline
|
||||||
; no input
|
; no input
|
||||||
;********************************************************************
|
;********************************************************************
|
||||||
%macro DBG_BOARD_PRINTNEWLINE 0
|
macro DBG_BOARD_PRINTNEWLINE {
|
||||||
call dbg_board_printnewline
|
call dbg_board_printnewline
|
||||||
%endm
|
}
|
||||||
|
|
||||||
|
|
||||||
;********************************************************************
|
;********************************************************************
|
||||||
@@ -44,12 +58,12 @@
|
|||||||
; DBG_BOARD_PRINTCHAR [esi]
|
; DBG_BOARD_PRINTCHAR [esi]
|
||||||
; DBG_BOARD_PRINTCHAR [somevariable]
|
; DBG_BOARD_PRINTCHAR [somevariable]
|
||||||
;********************************************************************
|
;********************************************************************
|
||||||
%macro DBG_BOARD_PRINTCHAR 1
|
macro DBG_BOARD_PRINTCHAR c1 {
|
||||||
push ecx
|
push ecx
|
||||||
mov cl,byte %1
|
mov cl,byte c1
|
||||||
call dbg_board_printchar
|
call dbg_board_printchar
|
||||||
pop ecx
|
pop ecx
|
||||||
%endm
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -60,10 +74,10 @@
|
|||||||
; DBG_BOARD_PRINTDWORD 0xdeadbeef
|
; DBG_BOARD_PRINTDWORD 0xdeadbeef
|
||||||
; DBG_BOARD_PRINTDWORD [somevariable]
|
; DBG_BOARD_PRINTDWORD [somevariable]
|
||||||
;********************************************************************
|
;********************************************************************
|
||||||
%macro DBG_BOARD_PRINTDWORD 1
|
macro DBG_BOARD_PRINTDWORD w1 {
|
||||||
push dword %1
|
push dword w1
|
||||||
call dbg_board_printdword
|
call dbg_board_printdword
|
||||||
%endm
|
}
|
||||||
|
|
||||||
|
|
||||||
;********************************************************************
|
;********************************************************************
|
||||||
@@ -73,13 +87,14 @@
|
|||||||
; examples DBG_BOARD_PRINTSTRINGLITERAL "foo",0
|
; examples DBG_BOARD_PRINTSTRINGLITERAL "foo",0
|
||||||
; DBG_BOARD_PRINTSTRINGLITERAL "bar",10,13,0
|
; DBG_BOARD_PRINTSTRINGLITERAL "bar",10,13,0
|
||||||
;********************************************************************
|
;********************************************************************
|
||||||
%macro DBG_BOARD_PRINTSTRINGLITERAL 1+
|
macro DBG_BOARD_PRINTSTRINGLITERAL p1 {
|
||||||
jmp %%bar
|
local .foo
|
||||||
%%foo db %1, 0 ; terminate string, just to be sure
|
jmp @f
|
||||||
%%bar:
|
.foo db p1, 0 ; terminate string, just to be sure
|
||||||
push dword %%foo
|
@@:
|
||||||
|
push dword .foo
|
||||||
call dbg_board_printstring
|
call dbg_board_printstring
|
||||||
%endm
|
}
|
||||||
|
|
||||||
|
|
||||||
;********************************************************************
|
;********************************************************************
|
||||||
@@ -89,22 +104,18 @@
|
|||||||
; DBG_BOARD_PRINTSTRING esi
|
; DBG_BOARD_PRINTSTRING esi
|
||||||
; DBG_BOARD_PRINTSTRING [ebx]
|
; DBG_BOARD_PRINTSTRING [ebx]
|
||||||
;********************************************************************
|
;********************************************************************
|
||||||
%macro DBG_BOARD_PRINTSTRING 1
|
macro DBG_BOARD_PRINTSTRING s1 {
|
||||||
push dword %1
|
push dword s1
|
||||||
call dbg_board_printstring
|
call dbg_board_printstring
|
||||||
%endm
|
}
|
||||||
|
|
||||||
|
|
||||||
; no input
|
; no input
|
||||||
dbg_board_printnewline:
|
dbg_board_printnewline:
|
||||||
pushad
|
pushad
|
||||||
pushfd
|
pushfd
|
||||||
mov eax,MOS_SC_DEBUGBOARD
|
mcall SF_BOARD,SSF_DEBUG_WRITE,10
|
||||||
mov ebx,1
|
mcall ,,13
|
||||||
mov ecx,10
|
|
||||||
int 0x40
|
|
||||||
mov ecx,13
|
|
||||||
int 0x40
|
|
||||||
popfd
|
popfd
|
||||||
popad
|
popad
|
||||||
ret
|
ret
|
||||||
@@ -114,10 +125,8 @@ dbg_board_printnewline:
|
|||||||
dbg_board_printchar:
|
dbg_board_printchar:
|
||||||
pushad
|
pushad
|
||||||
pushfd
|
pushfd
|
||||||
mov eax,MOS_SC_DEBUGBOARD
|
|
||||||
mov ebx,1
|
|
||||||
and ecx,0xff
|
and ecx,0xff
|
||||||
int 0x40
|
mcall SF_BOARD,SSF_DEBUG_WRITE
|
||||||
popfd
|
popfd
|
||||||
popad
|
popad
|
||||||
ret
|
ret
|
||||||
@@ -127,20 +136,17 @@ dbg_board_printchar:
|
|||||||
dbg_board_printdword:
|
dbg_board_printdword:
|
||||||
enter 0,0
|
enter 0,0
|
||||||
pushad
|
pushad
|
||||||
pushfd
|
pushfd
|
||||||
mov eax,MOS_SC_DEBUGBOARD
|
; print 0x prefix
|
||||||
mov ebx,1
|
mcall SF_BOARD,SSF_DEBUG_WRITE,'0'
|
||||||
mov ecx,'0' ; print 0x prefix
|
mcall ,,'x'
|
||||||
int 0x40
|
|
||||||
mov ecx,'x'
|
|
||||||
int 0x40
|
|
||||||
mov edx,[ebp + 8] ; get dword to print
|
mov edx,[ebp + 8] ; get dword to print
|
||||||
mov esi,8 ; iterate through all nibbles
|
mov esi,8 ; iterate through all nibbles
|
||||||
.loop:
|
.loop:
|
||||||
mov ecx,edx ; display hex digit
|
mov ecx,edx ; display hex digit
|
||||||
shr ecx,28
|
shr ecx,28
|
||||||
movzx ecx,byte [dbg_board_printdword_digits + ecx]
|
movzx ecx,byte [dbg_board_printdword_digits + ecx]
|
||||||
int 0x40
|
mcall
|
||||||
shl edx,4 ; next nibble
|
shl edx,4 ; next nibble
|
||||||
dec esi
|
dec esi
|
||||||
jnz .loop
|
jnz .loop
|
||||||
@@ -166,35 +172,13 @@ dbg_board_printstring:
|
|||||||
or al,al ; zero ?
|
or al,al ; zero ?
|
||||||
je .done ; yeah -> get outta here
|
je .done ; yeah -> get outta here
|
||||||
movzx ecx,al ; nope -> display character
|
movzx ecx,al ; nope -> display character
|
||||||
mov eax,MOS_SC_DEBUGBOARD
|
mcall SF_BOARD
|
||||||
int 0x40
|
|
||||||
jmp .loop
|
jmp .loop
|
||||||
.done:
|
.done:
|
||||||
popfd
|
popfd
|
||||||
popad
|
popad
|
||||||
leave
|
leave
|
||||||
ret 4
|
ret 4
|
||||||
|
|
||||||
%else
|
|
||||||
|
|
||||||
|
end if
|
||||||
%macro DBG_BOARD_PRINTNEWLINE 0
|
|
||||||
%endm
|
|
||||||
|
|
||||||
%macro DBG_BOARD_PRINTCHAR 1
|
|
||||||
%endm
|
|
||||||
|
|
||||||
%macro DBG_BOARD_PRINTDWORD 1
|
|
||||||
%endm
|
|
||||||
|
|
||||||
%macro DBG_BOARD_PRINTSTRINGLITERAL 1+
|
|
||||||
%endm
|
|
||||||
|
|
||||||
%macro DBG_BOARD_PRINTSTRING 1
|
|
||||||
%endm
|
|
||||||
|
|
||||||
%endif
|
|
||||||
|
|
||||||
|
|
||||||
%endif
|
|
||||||
|
|
@@ -17,8 +17,6 @@
|
|||||||
; along with this program; if not, write to the Free Software
|
; along with this program; if not, write to the Free Software
|
||||||
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
;
|
;
|
||||||
%ifndef _DRAW_INC
|
|
||||||
%define _DRAW_INC
|
|
||||||
|
|
||||||
|
|
||||||
TMR1_FACTOR dd 0.45
|
TMR1_FACTOR dd 0.45
|
||||||
@@ -50,45 +48,36 @@ monthNames:
|
|||||||
; output : nothing
|
; output : nothing
|
||||||
; destroys : nothing
|
; destroys : nothing
|
||||||
;********************************************************************
|
;********************************************************************
|
||||||
drawClock:
|
proc drawClock
|
||||||
%push drawClock_context
|
locals
|
||||||
%stacksize flat
|
i dd ?
|
||||||
%assign %$localsize 0
|
TMR1X dd ?
|
||||||
|
TMR1Y dd ?
|
||||||
%local i:dword, \
|
TMR2X dd ?
|
||||||
TMR1X:dword, \
|
TMR2Y dd ?
|
||||||
TMR1Y:dword, \
|
SECRX dd ?
|
||||||
TMR2X:dword, \
|
SECRY dd ?
|
||||||
TMR2Y:dword, \
|
MINRX dd ?
|
||||||
SECRX:dword, \
|
MINRY dd ?
|
||||||
SECRY:dword, \
|
HOURRX dd ?
|
||||||
MINRX:dword, \
|
HOURRY dd ?
|
||||||
MINRY:dword, \
|
workwidth dd ?
|
||||||
HOURRX:dword, \
|
workheight dd ?
|
||||||
HOURRY:dword, \
|
foo dd ?
|
||||||
workwidth:dword, \
|
endl
|
||||||
workheight:dword, \
|
|
||||||
foo:dword
|
|
||||||
|
|
||||||
enter %$localsize,0
|
|
||||||
pushad
|
pushad
|
||||||
pushfd
|
pushfd
|
||||||
|
|
||||||
; get window dimensions
|
; get window dimensions
|
||||||
mov eax,MOS_SC_GETPROCESSINFO
|
mcall SF_THREAD_INFO,procInfo,-1
|
||||||
mov ebx,procInfo
|
|
||||||
mov ecx,-1
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
; calculate work area size (width/height = ecx/edx)
|
; calculate work area size (width/height = ecx/edx)
|
||||||
; if the work area is too small (maybe the window is shaded)
|
; if the work area is too small (maybe the window is shaded)
|
||||||
; we don't draw anything.
|
; we don't draw anything.
|
||||||
mov eax,MOS_SC_WINDOWPROPERTIES
|
mcall SF_STYLE_SETTINGS,SSF_GET_SKIN_HEIGHT ; get skin height (eax)
|
||||||
mov ebx,4 ; get skin height (eax)
|
mov ecx,[procInfo.box.width]
|
||||||
int 0x40
|
|
||||||
mov ecx,[procInfo + MOS_PROCESSINFO.wndWidth]
|
|
||||||
sub ecx,MOS_WND_SKIN_BORDER_LEFT+MOS_WND_SKIN_BORDER_RIGHT
|
sub ecx,MOS_WND_SKIN_BORDER_LEFT+MOS_WND_SKIN_BORDER_RIGHT
|
||||||
mov edx,[procInfo + MOS_PROCESSINFO.wndHeight]
|
mov edx,[procInfo.box.height]
|
||||||
sub edx,eax
|
sub edx,eax
|
||||||
sub edx,MOS_WND_SKIN_BORDER_BOTTOM
|
sub edx,MOS_WND_SKIN_BORDER_BOTTOM
|
||||||
cmp ecx,0 ; width too small ?
|
cmp ecx,0 ; width too small ?
|
||||||
@@ -102,9 +91,9 @@ drawClock:
|
|||||||
mov [workheight],edx
|
mov [workheight],edx
|
||||||
|
|
||||||
; calculate center of clock (x/y = esi/edi)
|
; calculate center of clock (x/y = esi/edi)
|
||||||
mov esi,[procInfo + MOS_PROCESSINFO.wndWidth]
|
mov esi,[procInfo.box.width]
|
||||||
shr esi,1
|
shr esi,1
|
||||||
mov edi,[procInfo + MOS_PROCESSINFO.wndHeight]
|
mov edi,[procInfo.box.height]
|
||||||
sub edi,MOS_WND_SKIN_BORDER_BOTTOM
|
sub edi,MOS_WND_SKIN_BORDER_BOTTOM
|
||||||
sub edi,eax
|
sub edi,eax
|
||||||
shr edi,1
|
shr edi,1
|
||||||
@@ -119,9 +108,8 @@ drawClock:
|
|||||||
shl ecx,16 ; (=skin height)
|
shl ecx,16 ; (=skin height)
|
||||||
or ecx,edx ; height
|
or ecx,edx ; height
|
||||||
inc ecx
|
inc ecx
|
||||||
mov edx,[wndColors + MOS_WNDCOLORS.work]
|
mov edx,[wndColors.work]
|
||||||
mov eax,MOS_SC_DRAWBAR
|
mcall SF_DRAW_RECT
|
||||||
int 0x40
|
|
||||||
popad
|
popad
|
||||||
|
|
||||||
; calculate second hand radii
|
; calculate second hand radii
|
||||||
@@ -163,8 +151,7 @@ drawClock:
|
|||||||
fstp dword [TMR2Y]
|
fstp dword [TMR2Y]
|
||||||
|
|
||||||
; get system clock (edx)
|
; get system clock (edx)
|
||||||
mov eax,MOS_SC_GETSYSCLOCK
|
mcall SF_GET_SYS_TIME
|
||||||
int 0x40
|
|
||||||
mov edx,eax
|
mov edx,eax
|
||||||
|
|
||||||
; draw second hand
|
; draw second hand
|
||||||
@@ -173,21 +160,14 @@ drawClock:
|
|||||||
shr eax,16
|
shr eax,16
|
||||||
call bcdbin
|
call bcdbin
|
||||||
mov ecx,eax ; save seconds for later
|
mov ecx,eax ; save seconds for later
|
||||||
push ecx
|
; 2*pi/60
|
||||||
push eax
|
stdcall getHandCoords,edi,esi,[SECRY],[SECRX],0.104719755,eax,ecx
|
||||||
fpush32 0.104719755 ; 2*pi/60
|
|
||||||
push dword [SECRX]
|
|
||||||
push dword [SECRY]
|
|
||||||
push esi
|
|
||||||
push edi
|
|
||||||
call getHandCoords
|
|
||||||
mov eax,MOS_SC_DRAWLINE
|
|
||||||
shl ebx,16
|
shl ebx,16
|
||||||
or ebx,esi
|
or ebx,esi
|
||||||
shl ecx,16
|
shl ecx,16
|
||||||
or ecx,edi
|
or ecx,edi
|
||||||
mov edx,[wndColors + MOS_WNDCOLORS.workText]
|
mov edx,[wndColors.work_text]
|
||||||
int 0x40
|
mcall SF_DRAW_LINE
|
||||||
pop ecx
|
pop ecx
|
||||||
pop edx
|
pop edx
|
||||||
|
|
||||||
@@ -200,21 +180,14 @@ drawClock:
|
|||||||
mul edx
|
mul edx
|
||||||
add eax,ecx
|
add eax,ecx
|
||||||
mov ecx,eax ; save for later
|
mov ecx,eax ; save for later
|
||||||
push ecx
|
; 2*pi/60/60
|
||||||
push eax
|
stdcall getHandCoords,edi,esi,[MINRY],[MINRX],0.001745329,eax,ecx
|
||||||
fpush32 0.001745329 ; 2*pi/60/60
|
|
||||||
push dword [MINRX]
|
|
||||||
push dword [MINRY]
|
|
||||||
push esi
|
|
||||||
push edi
|
|
||||||
call getHandCoords
|
|
||||||
mov eax,MOS_SC_DRAWLINE
|
|
||||||
shl ebx,16
|
shl ebx,16
|
||||||
or ebx,esi
|
or ebx,esi
|
||||||
shl ecx,16
|
shl ecx,16
|
||||||
or ecx,edi
|
or ecx,edi
|
||||||
mov edx,[wndColors + MOS_WNDCOLORS.workText]
|
mov edx,[wndColors.work_text]
|
||||||
int 0x40
|
mcall SF_DRAW_LINE
|
||||||
pop ecx
|
pop ecx
|
||||||
pop edx
|
pop edx
|
||||||
|
|
||||||
@@ -229,55 +202,39 @@ drawClock:
|
|||||||
mov edx,60*60
|
mov edx,60*60
|
||||||
mul edx
|
mul edx
|
||||||
add eax,ecx
|
add eax,ecx
|
||||||
push eax
|
; 2*pi/60/60/12
|
||||||
fpush32 0.000145444 ; 2*pi/60/60/12
|
stdcall getHandCoords,edi,esi,[HOURRY],[HOURRX],0.000145444,eax
|
||||||
push dword [HOURRX]
|
|
||||||
push dword [HOURRY]
|
|
||||||
push esi
|
|
||||||
push edi
|
|
||||||
call getHandCoords
|
|
||||||
mov eax,MOS_SC_DRAWLINE
|
|
||||||
shl ebx,16
|
shl ebx,16
|
||||||
or ebx,esi
|
or ebx,esi
|
||||||
shl ecx,16
|
shl ecx,16
|
||||||
or ecx,edi
|
or ecx,edi
|
||||||
mov edx,[wndColors + MOS_WNDCOLORS.workText]
|
mov edx,[wndColors.work_text]
|
||||||
int 0x40
|
mcall SF_DRAW_LINE
|
||||||
pop edx
|
pop edx
|
||||||
|
|
||||||
; draw tick marks
|
; draw tick marks
|
||||||
mov dword [i],11 ; draw 12 marks
|
mov dword [i],11 ; draw 12 marks
|
||||||
.drawtickmarks:
|
.drawtickmarks:
|
||||||
push dword [i] ; calculate start point
|
; calculate start point
|
||||||
fpush32 0.523598776 ; 2*pi/12
|
; 2*pi/12
|
||||||
push dword [TMR1X]
|
stdcall getHandCoords,edi,esi,[TMR1Y],[TMR1X],0.523598776,[i]
|
||||||
push dword [TMR1Y]
|
|
||||||
push esi
|
|
||||||
push edi
|
|
||||||
call getHandCoords
|
|
||||||
mov eax,ebx ; save in eax and edx
|
mov eax,ebx ; save in eax and edx
|
||||||
mov edx,ecx
|
mov edx,ecx
|
||||||
push dword [i]
|
; 2*pi/12
|
||||||
fpush32 0.523598776 ; 2*pi/12
|
stdcall getHandCoords,edi,esi,[TMR2Y],[TMR2X],0.523598776,[i]
|
||||||
push dword [TMR2X]
|
|
||||||
push dword [TMR2Y]
|
|
||||||
push esi
|
|
||||||
push edi
|
|
||||||
call getHandCoords
|
|
||||||
shl eax,16
|
shl eax,16
|
||||||
shl edx,16
|
shl edx,16
|
||||||
or ebx,eax ; ebx = x start and end
|
or ebx,eax ; ebx = x start and end
|
||||||
or ecx,edx ; ecx = y start and end
|
or ecx,edx ; ecx = y start and end
|
||||||
mov edx,[wndColors + MOS_WNDCOLORS.workText]
|
mov edx,[wndColors.work_text]
|
||||||
mov eax,MOS_SC_DRAWLINE
|
mcall SF_DRAW_LINE
|
||||||
int 0x40
|
|
||||||
dec dword [i]
|
dec dword [i]
|
||||||
jns .drawtickmarks
|
jns .drawtickmarks
|
||||||
|
|
||||||
%define DATE_WIDTH 48
|
DATE_WIDTH =48
|
||||||
|
|
||||||
; calculate text start position
|
; calculate text start position
|
||||||
mov eax,[procInfo+MOS_PROCESSINFO.wndWidth]
|
mov eax,[procInfo.box.width]
|
||||||
sub eax,DATE_WIDTH ; x = (wndwidth-textwidth)/2
|
sub eax,DATE_WIDTH ; x = (wndwidth-textwidth)/2
|
||||||
shr eax,1 ; eax = x
|
shr eax,1 ; eax = x
|
||||||
fild dword [workheight] ; y = DATE_FACTOR*workheight...
|
fild dword [workheight] ; y = DATE_FACTOR*workheight...
|
||||||
@@ -292,7 +249,7 @@ drawClock:
|
|||||||
jb .goodbye
|
jb .goodbye
|
||||||
mov ecx,ebx ; text too high ?
|
mov ecx,ebx ; text too high ?
|
||||||
add ecx,10-1
|
add ecx,10-1
|
||||||
mov edx,[procInfo+MOS_PROCESSINFO.wndHeight]
|
mov edx,[procInfo.box.height]
|
||||||
sub edx,MOS_WND_SKIN_BORDER_BOTTOM
|
sub edx,MOS_WND_SKIN_BORDER_BOTTOM
|
||||||
cmp ecx,edx
|
cmp ecx,edx
|
||||||
jnae .yousuck
|
jnae .yousuck
|
||||||
@@ -306,8 +263,7 @@ drawClock:
|
|||||||
or ebx,eax
|
or ebx,eax
|
||||||
|
|
||||||
; get date (edi)
|
; get date (edi)
|
||||||
mov eax,MOS_SC_GETDATE
|
mcall SF_GET_SYS_DATE
|
||||||
int 0x40
|
|
||||||
mov edi,eax
|
mov edi,eax
|
||||||
|
|
||||||
; display month
|
; display month
|
||||||
@@ -315,44 +271,41 @@ drawClock:
|
|||||||
shr eax,8
|
shr eax,8
|
||||||
call bcdbin
|
call bcdbin
|
||||||
; ebx contains already position
|
; ebx contains already position
|
||||||
mov ecx,[wndColors+MOS_WNDCOLORS.workText]
|
mov ecx,[wndColors.work_text]
|
||||||
lea edx,[monthNames-3+eax*2+eax]; -3 because eax = 1..12 =]
|
lea edx,[monthNames-3+eax*2+eax]; -3 because eax = 1..12 =]
|
||||||
mov esi,3 ; text length
|
mov esi,3 ; text length
|
||||||
mov eax,MOS_SC_WRITETEXT
|
mcall SF_DRAW_TEXT
|
||||||
int 0x40
|
|
||||||
|
|
||||||
; display date
|
; display date
|
||||||
add ebx,MOS_DWORD(3*6+3,0)
|
add ebx,(3*6+3) shl 16
|
||||||
mov eax,edi ; get date
|
mov eax,edi ; get date
|
||||||
shr eax,16
|
shr eax,16
|
||||||
call bcdbin
|
call bcdbin
|
||||||
mov edx,ebx ; position must be in edx
|
mov edx,ebx ; position must be in edx
|
||||||
mov ebx,0x00020000 ; number, display two digits
|
mov ebx,0x00020000 ; number, display two digits
|
||||||
mov ecx,eax ; number to display
|
mov ecx,eax ; number to display
|
||||||
mov esi,[wndColors+MOS_WNDCOLORS.workText]
|
mov esi,[wndColors.work_text]
|
||||||
mov eax,MOS_SC_WRITENUMBER
|
mcall SF_DRAW_NUMBER
|
||||||
int 0x40
|
|
||||||
|
|
||||||
; display year. the way we avoid the y2k bug is even
|
; display year. the way we avoid the y2k bug is even
|
||||||
; simpler, yet much better than in the last version:
|
; simpler, yet much better than in the last version:
|
||||||
; now we simply display the last two digits and let the
|
; now we simply display the last two digits and let the
|
||||||
; user decide wether it's the year 1903 or 2003 =]
|
; user decide wether it's the year 1903 or 2003 =]
|
||||||
add edx,MOS_DWORD(2*6+3,0)
|
add edx,(2*6+3) shl 16
|
||||||
mov eax,edi ; get year
|
mov eax,edi ; get year
|
||||||
call bcdbin
|
call bcdbin
|
||||||
mov ebx,0x00020000 ; number, display two digits
|
mov ebx,0x00020000 ; number, display two digits
|
||||||
mov ecx,eax ; number to display
|
mov ecx,eax ; number to display
|
||||||
; edx contains already position
|
; edx contains already position
|
||||||
mov esi,[wndColors+MOS_WNDCOLORS.workText]
|
mov esi,[wndColors.work_text]
|
||||||
mov eax,MOS_SC_WRITENUMBER
|
mcall SF_DRAW_NUMBER
|
||||||
int 0x40
|
|
||||||
|
|
||||||
.byebye:
|
.byebye:
|
||||||
popfd
|
popfd
|
||||||
popad
|
popad
|
||||||
leave
|
;leave
|
||||||
ret
|
ret
|
||||||
%pop
|
endp
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
;**********************************************************
|
||||||
@@ -397,36 +350,26 @@ bcdbin:
|
|||||||
; destroys:
|
; destroys:
|
||||||
; nothing
|
; nothing
|
||||||
;********************************************************************
|
;********************************************************************
|
||||||
getHandCoords:
|
proc getHandCoords CENTERY:dword, CENTERX:dword, RADIUSY:dword, RADIUSX:dword, DEG2RAD:dword, ANGLE:dword
|
||||||
|
|
||||||
ANGLE equ 28
|
|
||||||
DEG2RAD equ 24
|
|
||||||
RADIUSX equ 20
|
|
||||||
RADIUSY equ 16
|
|
||||||
CENTERX equ 12
|
|
||||||
CENTERY equ 8
|
|
||||||
|
|
||||||
enter 0,0
|
|
||||||
pushfd
|
pushfd
|
||||||
|
|
||||||
fild dword [ebp+ANGLE] ; get angle
|
fild dword [ANGLE] ; get angle
|
||||||
fmul dword [ebp+DEG2RAD] ; convert to radians
|
fmul dword [DEG2RAD] ; convert to radians
|
||||||
fsincos
|
fsincos
|
||||||
fmul dword [ebp+RADIUSY] ; -y * radius + clockcy
|
fmul dword [RADIUSY] ; -y * radius + clockcy
|
||||||
fchs
|
fchs
|
||||||
fiadd dword [ebp+CENTERY]
|
fiadd dword [CENTERY]
|
||||||
fistp dword [ebp+CENTERY]
|
fistp dword [CENTERY]
|
||||||
fmul dword [ebp+RADIUSX] ; x * radius + clockcx
|
fmul dword [RADIUSX] ; x * radius + clockcx
|
||||||
fiadd dword [ebp+CENTERX]
|
fiadd dword [CENTERX]
|
||||||
fistp dword [ebp+CENTERX]
|
fistp dword [CENTERX]
|
||||||
|
|
||||||
mov ebx,[ebp+CENTERX]
|
mov ebx,[CENTERX]
|
||||||
mov ecx,[ebp+CENTERY]
|
mov ecx,[CENTERY]
|
||||||
|
|
||||||
popfd
|
popfd
|
||||||
leave
|
;leave
|
||||||
ret 4*6
|
ret
|
||||||
|
endp
|
||||||
|
|
||||||
|
|
||||||
%endif
|
|
||||||
|
|
@@ -1,5 +1,3 @@
|
|||||||
; some strtok-like function
|
|
||||||
;
|
|
||||||
; Copyright (c) 2003 Thomas Mathys
|
; Copyright (c) 2003 Thomas Mathys
|
||||||
; killer@vantage.ch
|
; killer@vantage.ch
|
||||||
;
|
;
|
||||||
@@ -17,8 +15,94 @@
|
|||||||
; along with this program; if not, write to the Free Software
|
; along with this program; if not, write to the Free Software
|
||||||
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
;
|
;
|
||||||
%ifndef _STRTOK_INC
|
|
||||||
%define _STRTOK_INC
|
|
||||||
|
;********************************************************************
|
||||||
|
; returns the length of an asciiz string
|
||||||
|
; input : esi = pointer to string
|
||||||
|
; output : eax = string length
|
||||||
|
; destroys : nothing
|
||||||
|
;********************************************************************
|
||||||
|
strlen:
|
||||||
|
push ecx edi
|
||||||
|
pushfd
|
||||||
|
cld ; !
|
||||||
|
mov ecx,-1
|
||||||
|
mov edi,esi ; find terminating zero
|
||||||
|
xor al,al
|
||||||
|
repne scasb
|
||||||
|
mov eax,edi ; calculate string length
|
||||||
|
sub eax,esi
|
||||||
|
dec eax
|
||||||
|
popfd
|
||||||
|
pop edi ecx
|
||||||
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
;********************************************************************
|
||||||
|
; converts an asciiz string into an unsigned doubleword.
|
||||||
|
; (base 10 is assumed)
|
||||||
|
;
|
||||||
|
; - first, leading whitespaces are skipped
|
||||||
|
; - then the function converts the string, until it
|
||||||
|
; finds the terminating zero, another character it
|
||||||
|
; cannot convert or the number becomes too large.
|
||||||
|
;
|
||||||
|
; input : esi = pointer to string
|
||||||
|
; output : eax = unsigned doubleword
|
||||||
|
; the function tries to convert as
|
||||||
|
; many digits as possible, before it
|
||||||
|
; stops. if the value of the dword
|
||||||
|
; becomes too large, 0xffffffff is
|
||||||
|
; returned.
|
||||||
|
; destroys : nothing
|
||||||
|
;********************************************************************
|
||||||
|
string2dword:
|
||||||
|
push ebx ecx edx esi
|
||||||
|
pushfd
|
||||||
|
|
||||||
|
xor ebx,ebx ; ebx : dword
|
||||||
|
|
||||||
|
; skip leading whitespaces
|
||||||
|
.skipspaces:
|
||||||
|
lodsb
|
||||||
|
cmp al,32 ; space
|
||||||
|
je .skipspaces
|
||||||
|
cmp al,12 ; ff
|
||||||
|
je .skipspaces
|
||||||
|
cmp al,10 ; lf
|
||||||
|
je .skipspaces
|
||||||
|
cmp al,13 ; cr
|
||||||
|
je .skipspaces
|
||||||
|
cmp al,9 ; ht
|
||||||
|
je .skipspaces
|
||||||
|
cmp al,11 ; vt
|
||||||
|
je .skipspaces
|
||||||
|
|
||||||
|
; convert string
|
||||||
|
dec esi ; esi -> 1st non-whitespace
|
||||||
|
.convert:
|
||||||
|
xor eax,eax ; get character
|
||||||
|
lodsb
|
||||||
|
sub al,'0' ; convert to digit
|
||||||
|
cmp al,9 ; is digit in range [0,9] ?
|
||||||
|
ja .done ; nope -> stop conversion
|
||||||
|
mov ecx,eax ; save new digit
|
||||||
|
mov eax,10 ; dword = dword * 10
|
||||||
|
mul ebx
|
||||||
|
jc .overflow
|
||||||
|
add eax,ecx ; + new digit
|
||||||
|
jc .overflow
|
||||||
|
mov ebx,eax
|
||||||
|
jmp .convert
|
||||||
|
|
||||||
|
.overflow:
|
||||||
|
mov ebx,0xffffffff
|
||||||
|
.done:
|
||||||
|
mov eax,ebx
|
||||||
|
popfd
|
||||||
|
pop esi edx ecx ebx
|
||||||
|
ret
|
||||||
|
|
||||||
|
|
||||||
;********************************************************************
|
;********************************************************************
|
||||||
@@ -121,5 +205,3 @@ strtok:
|
|||||||
ret
|
ret
|
||||||
.adx dd 0
|
.adx dd 0
|
||||||
|
|
||||||
%endif
|
|
||||||
|
|
@@ -1,2 +0,0 @@
|
|||||||
if tup.getconfig("NO_NASM") ~= "" then return end
|
|
||||||
tup.rule("aclock.asm", "nasm -f bin -o %o %f " .. tup.getconfig("KPACK_CMD"), "aclock")
|
|
@@ -1,3 +0,0 @@
|
|||||||
@rem nasm -t -f bin -o aclock -l aclock.lst aclock.asm -DDEBUG
|
|
||||||
nasmw -t -f bin -o aclock aclock.asm
|
|
||||||
@pause
|
|
@@ -1,334 +0,0 @@
|
|||||||
; mos.inc 0.03
|
|
||||||
; Copyright (c) 2002 Thomas Mathys
|
|
||||||
; killer@vantage.ch
|
|
||||||
;
|
|
||||||
; 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, write to the Free Software
|
|
||||||
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
;
|
|
||||||
%ifndef _MOS_INC
|
|
||||||
%define _MOS_INC
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
|
||||||
; generates a menuetos 01 header
|
|
||||||
; takes 6 parameters:
|
|
||||||
;
|
|
||||||
; MOS_HEADER01 start, end, appmem, esp, i_param, i_icon
|
|
||||||
;**********************************************************
|
|
||||||
|
|
||||||
%macro MOS_HEADER01 6
|
|
||||||
org 0x0
|
|
||||||
db 'MENUET01' ; 8 byte id
|
|
||||||
dd 0x01 ; header version
|
|
||||||
dd %1 ; start of code
|
|
||||||
dd %2 ; image size
|
|
||||||
dd %3 ; application memory
|
|
||||||
dd %4 ; esp
|
|
||||||
dd %5 ; i_param
|
|
||||||
dd %6 ; i_icon
|
|
||||||
%endmacro
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
|
||||||
; MOS_DWORD
|
|
||||||
; packs 2 words into a double word
|
|
||||||
;**********************************************************
|
|
||||||
|
|
||||||
%define MOS_DWORD(hi,lo) ((((hi) & 0xffff) << 16) + ((lo) & 0xffff))
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
|
||||||
; MOS_RGB
|
|
||||||
; creates a menuet os compatible color (0x00RRGGBB)
|
|
||||||
;**********************************************************
|
|
||||||
|
|
||||||
%define MOS_RGB(r,g,b) ((((r) & 255) << 16) + (((g) & 255) << 8) + ((b) & 255))
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
|
||||||
; window stuff
|
|
||||||
;**********************************************************
|
|
||||||
|
|
||||||
; default window colors
|
|
||||||
struc MOS_WNDCOLORS
|
|
||||||
.frame: resd 1
|
|
||||||
.grab: resd 1
|
|
||||||
.grabButton: resd 1
|
|
||||||
.grabButtonText: resd 1
|
|
||||||
.grabText: resd 1
|
|
||||||
.work: resd 1
|
|
||||||
.workButton: resd 1
|
|
||||||
.workButtonText: resd 1
|
|
||||||
.workText: resd 1
|
|
||||||
.workGraphics: resd 1
|
|
||||||
endstruc
|
|
||||||
|
|
||||||
; skinned window borders
|
|
||||||
MOS_WND_SKIN_BORDER_LEFT equ 5
|
|
||||||
MOS_WND_SKIN_BORDER_RIGHT equ 5
|
|
||||||
MOS_WND_SKIN_BORDER_BOTTOM equ 5
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
|
||||||
; process info structure
|
|
||||||
;**********************************************************
|
|
||||||
|
|
||||||
struc MOS_PROCESSINFO
|
|
||||||
.CPUUsage: resd 1
|
|
||||||
.windowStackPos: resw 1
|
|
||||||
.windowStackVal: resw 1
|
|
||||||
.reserved1: resw 1
|
|
||||||
.processName: resb 12
|
|
||||||
.memStart: resd 1
|
|
||||||
.memUsed: resd 1
|
|
||||||
.pid: resd 1
|
|
||||||
.wndXPos resd 1
|
|
||||||
.wndYPos resd 1
|
|
||||||
.wndWidth resd 1
|
|
||||||
.wndHeight resd 1
|
|
||||||
.reserved2: resb (1024 - 50)
|
|
||||||
endstruc
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
|
||||||
; system call numbers
|
|
||||||
;**********************************************************
|
|
||||||
|
|
||||||
MOS_SC_EXIT equ -1
|
|
||||||
MOS_SC_DEFINEWINDOW equ 0
|
|
||||||
MOS_SC_PUTPIXEL equ 1
|
|
||||||
MOS_SC_GETKEY equ 2
|
|
||||||
MOS_SC_GETSYSCLOCK equ 3
|
|
||||||
MOS_SC_WRITETEXT equ 4
|
|
||||||
MOS_SC_DELAY equ 5
|
|
||||||
MOS_SC_OPENFILEFLOPPY equ 6 ; obsolete
|
|
||||||
MOS_SC_PUTIMAGE equ 7
|
|
||||||
MOS_SC_DEFINEBUTTON equ 8
|
|
||||||
MOS_SC_GETPROCESSINFO equ 9
|
|
||||||
MOS_SC_WAITEVENT equ 10
|
|
||||||
MOS_SC_CHECKEVENT equ 11
|
|
||||||
MOS_SC_REDRAWSTATUS equ 12
|
|
||||||
MOS_SC_DRAWBAR equ 13
|
|
||||||
MOS_SC_GETSCREENMAX equ 14
|
|
||||||
MOS_SC_SETBACKGROUND equ 15
|
|
||||||
MOS_SC_GETPRESSEDBUTTON equ 17
|
|
||||||
MOS_SC_SYSTEMSERVICE equ 18
|
|
||||||
MOS_SC_STARTPROGRAM equ 19 ; obsolete
|
|
||||||
MOS_SC_MIDIINTERFACE equ 20
|
|
||||||
MOS_SC_DEVICESETUP equ 21
|
|
||||||
MOS_SC_WAITEVENTTIMEOUT equ 23
|
|
||||||
MOS_SC_CDAUDIO equ 24
|
|
||||||
MOS_SC_SB16MIXER1 equ 25
|
|
||||||
MOS_SC_GETDEVICESETUP equ 26
|
|
||||||
MOS_SC_WSS equ 27
|
|
||||||
MOS_SC_SB16MIXER2 equ 28
|
|
||||||
MOS_SC_GETDATE equ 29
|
|
||||||
MOS_SC_READHD equ 30 ; obsolete
|
|
||||||
MOS_SC_STARTPROGRAMHD equ 31 ; obsolete
|
|
||||||
MOS_SC_DELETEFILEFLOPPY equ 32
|
|
||||||
MOS_SC_SAVEFILERAMDISK equ 33 ; obsolete
|
|
||||||
MOS_SC_READDIRRAMDISK equ 34 ; obsolete
|
|
||||||
MOS_SC_GETSCREENPIXEL equ 35
|
|
||||||
MOS_SC_GETMOUSEPOSITION equ 37
|
|
||||||
MOS_SC_DRAWLINE equ 38
|
|
||||||
MOS_SC_GETBACKGROUND equ 39
|
|
||||||
MOS_SC_SETEVENTMASK equ 40
|
|
||||||
MOS_SC_GETIRQOWNER equ 41
|
|
||||||
MOS_SC_GETDATAREADBYIRQ equ 42
|
|
||||||
MOS_SC_SENDDATATODEVICE equ 43
|
|
||||||
MOS_SC_PROGRAMIRQS equ 44
|
|
||||||
MOS_SC_RESERVEFREEIRQ equ 45
|
|
||||||
MOS_SC_RESERVEFREEPORTS equ 46
|
|
||||||
MOS_SC_WRITENUMBER equ 47
|
|
||||||
MOS_SC_WINDOWPROPERTIES equ 48
|
|
||||||
MOS_SC_SHAPEDWINDOWS equ 50
|
|
||||||
MOS_SC_CREATETHREAD equ 51
|
|
||||||
MOS_SC_STACKDRIVERSTATE equ 52
|
|
||||||
MOS_SC_SOCKETINTERFACE equ 53
|
|
||||||
MOS_SC_SOUNDINTERFACE equ 55
|
|
||||||
MOS_SC_WRITEFILEHD equ 56 ; obsolete
|
|
||||||
MOS_SC_DELETEFILEHD equ 57
|
|
||||||
MOS_SC_SYSTREEACCESS equ 58
|
|
||||||
MOS_SC_SYSCALLTRACE equ 59
|
|
||||||
MOS_SC_IPC equ 60
|
|
||||||
MOS_SC_DIRECTGRAPHICS equ 61
|
|
||||||
MOS_SC_PCI equ 62
|
|
||||||
MOS_SC_DEBUGBOARD equ 63
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
|
||||||
; event numbers
|
|
||||||
;**********************************************************
|
|
||||||
|
|
||||||
MOS_EVT_NONE equ 0
|
|
||||||
MOS_EVT_REDRAW equ 1
|
|
||||||
MOS_EVT_KEY equ 2
|
|
||||||
MOS_EVT_BUTTON equ 3
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
|
||||||
; event bits
|
|
||||||
;**********************************************************
|
|
||||||
|
|
||||||
MOS_EVTBIT_REDRAW equ (1 << 0)
|
|
||||||
MOS_EVTBIT_KEY equ (1 << 1)
|
|
||||||
MOS_EVTBIT_BUTTON equ (1 << 2)
|
|
||||||
MOS_EVTBIT_ENDREQUEST equ (1 << 3)
|
|
||||||
MOS_EVTBIT_BGDRAW equ (1 << 4)
|
|
||||||
MOS_EVTBIT_MOUSECHANGE equ (1 << 5)
|
|
||||||
MOS_EVTBIT_IPCEVENT equ (1 << 6)
|
|
||||||
MOS_EVTBIT_IRQ0 equ (1 << 16)
|
|
||||||
MOS_EVTBIT_IRQ1 equ (1 << 17)
|
|
||||||
MOS_EVTBIT_IRQ2 equ (1 << 18)
|
|
||||||
MOS_EVTBIT_IRQ3 equ (1 << 19)
|
|
||||||
MOS_EVTBIT_IRQ4 equ (1 << 20)
|
|
||||||
MOS_EVTBIT_IRQ5 equ (1 << 21)
|
|
||||||
MOS_EVTBIT_IRQ6 equ (1 << 22)
|
|
||||||
MOS_EVTBIT_IRQ7 equ (1 << 23)
|
|
||||||
MOS_EVTBIT_IRQ8 equ (1 << 24)
|
|
||||||
MOS_EVTBIT_IRQ9 equ (1 << 25)
|
|
||||||
MOS_EVTBIT_IRQ10 equ (1 << 26)
|
|
||||||
MOS_EVTBIT_IRQ11 equ (1 << 27)
|
|
||||||
MOS_EVTBIT_IRQ12 equ (1 << 28)
|
|
||||||
MOS_EVTBIT_IRQ13 equ (1 << 29)
|
|
||||||
MOS_EVTBIT_IRQ14 equ (1 << 30)
|
|
||||||
MOS_EVTBIT_IRQ15 equ (1 << 31)
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
|
||||||
; exit application (syscall -1)
|
|
||||||
;**********************************************************
|
|
||||||
|
|
||||||
; exit application
|
|
||||||
%macro MOS_EXIT 0
|
|
||||||
mov eax,MOS_SC_EXIT
|
|
||||||
int 0x40
|
|
||||||
%endmacro
|
|
||||||
|
|
||||||
; exit application, smaller version
|
|
||||||
%macro MOS_EXIT_S 0
|
|
||||||
xor eax,eax
|
|
||||||
dec eax
|
|
||||||
int 0x40
|
|
||||||
%endmacro
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
|
||||||
; wait event stuff
|
|
||||||
; (MOS_SC_WAITEVENT, syscall 10)
|
|
||||||
;**********************************************************
|
|
||||||
|
|
||||||
; wait for event
|
|
||||||
; destroys : nothing
|
|
||||||
; returns : eax = event type
|
|
||||||
%macro MOS_WAITEVENT 0
|
|
||||||
mov eax,MOS_SC_WAITEVENT
|
|
||||||
int 0x40
|
|
||||||
%endmacro
|
|
||||||
|
|
||||||
; wait for event, smaller version
|
|
||||||
; destroys : flags
|
|
||||||
; returns : eax = event type
|
|
||||||
%macro MOS_WAITEVENT_S 0
|
|
||||||
xor eax,eax
|
|
||||||
mov al,MOS_SC_WAITEVENT
|
|
||||||
int 0x40
|
|
||||||
%endmacro
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
|
||||||
; window redraw status stuff
|
|
||||||
; (MOS_SC_REDRAWSTATUS, syscall 12)
|
|
||||||
;**********************************************************
|
|
||||||
|
|
||||||
MOS_RS_STARTREDRAW equ 1
|
|
||||||
MOS_RS_ENDREDRAW equ 2
|
|
||||||
|
|
||||||
; start window redraw
|
|
||||||
; destroys: eax,ebx
|
|
||||||
%macro MOS_STARTREDRAW 0
|
|
||||||
mov ebx,MOS_RS_STARTREDRAW
|
|
||||||
mov eax,MOS_SC_REDRAWSTATUS
|
|
||||||
int 0x40
|
|
||||||
%endmacro
|
|
||||||
|
|
||||||
; start window redraw, smaller version
|
|
||||||
; destroys: eax,ebx,flags
|
|
||||||
%macro MOS_STARTREDRAW_S 0
|
|
||||||
xor ebx,ebx
|
|
||||||
inc ebx
|
|
||||||
xor eax,eax
|
|
||||||
mov al,MOS_SC_REDRAWSTATUS
|
|
||||||
int 0x40
|
|
||||||
%endmacro
|
|
||||||
|
|
||||||
; end window redraw
|
|
||||||
; destroys: eax,ebx
|
|
||||||
%macro MOS_ENDREDRAW 0
|
|
||||||
mov ebx,MOS_RS_ENDREDRAW
|
|
||||||
mov eax,MOS_SC_REDRAWSTATUS
|
|
||||||
int 0x40
|
|
||||||
%endmacro
|
|
||||||
|
|
||||||
; end window redraw, smaller version
|
|
||||||
; destroys: eax,ebx,flags
|
|
||||||
%macro MOS_ENDREDRAW_S 0
|
|
||||||
xor ebx,ebx
|
|
||||||
mov bl,MOS_RS_ENDREDRAW
|
|
||||||
xor eax,eax
|
|
||||||
mov al,MOS_SC_REDRAWSTATUS
|
|
||||||
int 0x40
|
|
||||||
%endmacro
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
|
||||||
; get screen max stuff (syscall 14)
|
|
||||||
;**********************************************************
|
|
||||||
|
|
||||||
; get screen dimensions in eax
|
|
||||||
; destroys: nothing
|
|
||||||
%macro MOS_GETSCREENMAX 0
|
|
||||||
mov eax,MOS_SC_GETSCREENMAX
|
|
||||||
int 0x40
|
|
||||||
%endmacro
|
|
||||||
|
|
||||||
; get screen dimensions in eax, smaller version
|
|
||||||
; destroys: flags
|
|
||||||
%macro MOS_GETSCREENMAX_S 0
|
|
||||||
xor eax,eax
|
|
||||||
mov al,MOS_SC_GETSCREENMAX
|
|
||||||
int 0x40
|
|
||||||
%endmacro
|
|
||||||
|
|
||||||
|
|
||||||
;********************************************************************
|
|
||||||
; opcode hacks
|
|
||||||
;********************************************************************
|
|
||||||
|
|
||||||
; nasm refuses to assemble stuff like
|
|
||||||
; push dword 4.44
|
|
||||||
; with the following macro this becomes possible:
|
|
||||||
; fpush32 9.81
|
|
||||||
; don't forget to use a decimal point. things like
|
|
||||||
; fpush32 1
|
|
||||||
; will probably not do what you expect. instead, write:
|
|
||||||
; fpush32 1.0
|
|
||||||
%macro fpush32 1
|
|
||||||
db 0x68 ; push imm32
|
|
||||||
dd %1
|
|
||||||
%endm
|
|
||||||
|
|
||||||
%endif
|
|
||||||
|
|
@@ -1,92 +0,0 @@
|
|||||||
; string2dword - a useless string to double word conversion routine
|
|
||||||
;
|
|
||||||
; Copyright (c) 2003 Thomas Mathys
|
|
||||||
; killer@vantage.ch
|
|
||||||
;
|
|
||||||
; 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, write to the Free Software
|
|
||||||
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
;
|
|
||||||
|
|
||||||
|
|
||||||
;********************************************************************
|
|
||||||
; converts an asciiz string into an unsigned doubleword.
|
|
||||||
; (base 10 is assumed)
|
|
||||||
;
|
|
||||||
; - first, leading whitespaces are skipped
|
|
||||||
; - then the function converts the string, until it
|
|
||||||
; finds the terminating zero, another character it
|
|
||||||
; cannot convert or the number becomes too large.
|
|
||||||
;
|
|
||||||
; input : esi = pointer to string
|
|
||||||
; output : eax = unsigned doubleword
|
|
||||||
; the function tries to convert as
|
|
||||||
; many digits as possible, before it
|
|
||||||
; stops. if the value of the dword
|
|
||||||
; becomes too large, 0xffffffff is
|
|
||||||
; returned.
|
|
||||||
; destroys : nothing
|
|
||||||
;********************************************************************
|
|
||||||
string2dword:
|
|
||||||
push ebx
|
|
||||||
push ecx
|
|
||||||
push edx
|
|
||||||
push esi
|
|
||||||
pushfd
|
|
||||||
|
|
||||||
xor ebx,ebx ; ebx : dword
|
|
||||||
|
|
||||||
; skip leading whitespaces
|
|
||||||
.skipspaces:
|
|
||||||
lodsb
|
|
||||||
cmp al,32 ; space
|
|
||||||
je .skipspaces
|
|
||||||
cmp al,12 ; ff
|
|
||||||
je .skipspaces
|
|
||||||
cmp al,10 ; lf
|
|
||||||
je .skipspaces
|
|
||||||
cmp al,13 ; cr
|
|
||||||
je .skipspaces
|
|
||||||
cmp al,9 ; ht
|
|
||||||
je .skipspaces
|
|
||||||
cmp al,11 ; vt
|
|
||||||
je .skipspaces
|
|
||||||
|
|
||||||
; convert string
|
|
||||||
dec esi ; esi -> 1st non-whitespace
|
|
||||||
.convert:
|
|
||||||
xor eax,eax ; get character
|
|
||||||
lodsb
|
|
||||||
sub al,'0' ; convert to digit
|
|
||||||
cmp al,9 ; is digit in range [0,9] ?
|
|
||||||
ja .done ; nope -> stop conversion
|
|
||||||
mov ecx,eax ; save new digit
|
|
||||||
mov eax,10 ; dword = dword * 10
|
|
||||||
mul ebx
|
|
||||||
jc .overflow
|
|
||||||
add eax,ecx ; + new digit
|
|
||||||
jc .overflow
|
|
||||||
mov ebx,eax
|
|
||||||
jmp .convert
|
|
||||||
|
|
||||||
.overflow:
|
|
||||||
mov ebx,0xffffffff
|
|
||||||
.done:
|
|
||||||
mov eax,ebx
|
|
||||||
popfd
|
|
||||||
pop esi
|
|
||||||
pop edx
|
|
||||||
pop ecx
|
|
||||||
pop ebx
|
|
||||||
ret
|
|
||||||
|
|
@@ -1,49 +0,0 @@
|
|||||||
; strlen function
|
|
||||||
;
|
|
||||||
; Copyright (c) 2003 Thomas Mathys
|
|
||||||
; killer@vantage.ch
|
|
||||||
;
|
|
||||||
; 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, write to the Free Software
|
|
||||||
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
;
|
|
||||||
%ifndef _STRLEN_INC
|
|
||||||
%define _STRLEN_INC
|
|
||||||
|
|
||||||
|
|
||||||
;********************************************************************
|
|
||||||
; returns the length of an asciiz string
|
|
||||||
; input : esi = pointer to string
|
|
||||||
; output : eax = string length
|
|
||||||
; destroys : nothing
|
|
||||||
;********************************************************************
|
|
||||||
strlen:
|
|
||||||
push ecx
|
|
||||||
push edi
|
|
||||||
pushfd
|
|
||||||
cld ; !
|
|
||||||
mov ecx,-1
|
|
||||||
mov edi,esi ; find terminating zero
|
|
||||||
xor al,al
|
|
||||||
repne scasb
|
|
||||||
mov eax,edi ; calculate string length
|
|
||||||
sub eax,esi
|
|
||||||
dec eax
|
|
||||||
popfd
|
|
||||||
pop edi
|
|
||||||
pop ecx
|
|
||||||
ret
|
|
||||||
|
|
||||||
|
|
||||||
%endif
|
|
||||||
|
|
@@ -1,2 +1,2 @@
|
|||||||
@fasm fire.asm fire
|
@fasm fire.asm fire
|
||||||
@pause
|
@pause
|
@@ -1,82 +1,60 @@
|
|||||||
;
|
;
|
||||||
; FIRE for MENUET - Compile with FASM
|
; Fire for Kolibri - Compile with FASM
|
||||||
;
|
;
|
||||||
|
|
||||||
use32
|
use32
|
||||||
|
org 0
|
||||||
|
db 'MENUET01' ; 8 byte id
|
||||||
|
dd 1 ; header version
|
||||||
|
dd START ; program start
|
||||||
|
dd image_end ; image size
|
||||||
|
dd mem_end ; reguired amount of memory
|
||||||
|
dd stacktop
|
||||||
|
dd 0,0 ; no parameters, no path
|
||||||
|
|
||||||
org 0x0
|
include '..\..\macros.inc'
|
||||||
db 'MENUET01' ; 8 byte id
|
include '..\..\KOSfuncs.inc'
|
||||||
dd 1 ; header version
|
|
||||||
dd START ; program start
|
Screen_W equ 480
|
||||||
dd I_END ; image size
|
|
||||||
dd mem_end ; reguired amount of memory
|
|
||||||
dd mem_end
|
|
||||||
dd 0,0 ; no parameters, no path
|
|
||||||
|
|
||||||
include '..\..\..\macros.inc'
|
|
||||||
|
|
||||||
START:
|
START:
|
||||||
|
|
||||||
red:
|
|
||||||
|
|
||||||
; ************************************************
|
; ************************************************
|
||||||
; ********* WINDOW DEFINITIONS AND DRAW **********
|
; ********* WINDOW DEFINITIONS AND DRAW **********
|
||||||
; ************************************************
|
; ************************************************
|
||||||
|
|
||||||
draw_window:
|
draw_window:
|
||||||
|
|
||||||
mov eax,12 ; tell os about redraw
|
mcall SF_REDRAW, SSF_BEGIN_DRAW
|
||||||
mov ebx,1
|
|
||||||
mcall
|
|
||||||
|
|
||||||
xor eax,eax ; define and draw window
|
mcall SF_CREATE_WINDOW,<100,Screen_W+1>,<70,222>,0x01000000,0,0
|
||||||
mov ebx,100*65536+321
|
|
||||||
mov ecx,70*65536+222
|
|
||||||
mov edx,0x01000000
|
|
||||||
mov esi,0x00000000
|
|
||||||
mov edi,0x00000000
|
|
||||||
mcall
|
|
||||||
|
|
||||||
mcall 13,0*65536+321,0*65536+30,0
|
mcall SF_DRAW_RECT,<0,Screen_W+1>,<0,30>,0
|
||||||
mcall ,0*65536+1 ,0*65536+222
|
mcall ,<0,1>,<0,222>
|
||||||
mcall ,321*65536+1,0*65536+223
|
mcall ,<Screen_W+1,1>,<0,223>
|
||||||
mcall ,0*65536+321,222*65536+1
|
mcall ,<0,Screen_W+1>,<222,1>
|
||||||
|
|
||||||
|
mcall SF_DRAW_TEXT,<(Screen_W-108)/2,8>,dword 0x00FFFFFF,text,textlen-text
|
||||||
|
|
||||||
mov al,4 ; 'FIRE FOR KOLIBRI'
|
mcall SF_DEFINE_BUTTON,<(Screen_W+1-19),12>,<5,12>,1,0x009a0000
|
||||||
mov ebx,106*65536+8
|
|
||||||
mov ecx,dword 0x00FFFFFF
|
|
||||||
mov edx,text
|
|
||||||
mov esi,textlen-text
|
|
||||||
mcall
|
|
||||||
|
|
||||||
mov al,8
|
mov ebx,ecx ;5*65536+12
|
||||||
mov ebx,(321-19)*65536+12 ; button start x & size
|
inc edx
|
||||||
mov ecx,5*65536+12 ; button start y & size
|
mcall
|
||||||
mov edx,1 ; button number
|
|
||||||
mov esi,0x009a0000
|
|
||||||
mcall
|
|
||||||
|
|
||||||
mov ebx,ecx ;5*65536+12
|
|
||||||
inc edx
|
inc edx
|
||||||
mcall
|
mcall ,<18,12>
|
||||||
|
|
||||||
mov ebx,18*65536+12
|
|
||||||
inc edx
|
inc edx
|
||||||
mcall
|
mcall ,<31,12>
|
||||||
|
|
||||||
mov ebx,31*65536+12
|
mcall SF_REDRAW, SSF_END_DRAW
|
||||||
inc edx
|
|
||||||
mcall
|
|
||||||
|
|
||||||
mov al,12 ; tell os about redraw end
|
|
||||||
mov ebx,2
|
|
||||||
mcall
|
|
||||||
|
|
||||||
sta: ; calculate fire image
|
sta: ; calculate fire image
|
||||||
|
|
||||||
mov esi, FireScreen+0x2300-80
|
mov esi, FireScreen.end+Screen_W*3-Screen_W/4
|
||||||
mov ecx, 80
|
mov ecx, Screen_W/4
|
||||||
mov eax, [FireSeed]
|
mov eax, [FireSeed]
|
||||||
|
|
||||||
NEWLINE:
|
NEWLINE:
|
||||||
@@ -89,7 +67,7 @@ sta: ; calculate fire image
|
|||||||
|
|
||||||
mov [FireSeed], eax
|
mov [FireSeed], eax
|
||||||
|
|
||||||
mov ecx, 0x2300-80
|
mov ecx, (Screen_W*200)/8+Screen_W*3-Screen_W/4
|
||||||
sub esi, ecx
|
sub esi, ecx
|
||||||
xor edx, edx
|
xor edx, edx
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
@@ -103,7 +81,7 @@ sta: ; calculate fire image
|
|||||||
add eax, edx
|
add eax, edx
|
||||||
mov dl, [esi]
|
mov dl, [esi]
|
||||||
add eax, edx
|
add eax, edx
|
||||||
mov dl, [esi + 80]
|
mov dl, [esi + Screen_W/4]
|
||||||
jmp typedone
|
jmp typedone
|
||||||
notype1:
|
notype1:
|
||||||
|
|
||||||
@@ -114,7 +92,7 @@ sta: ; calculate fire image
|
|||||||
; mov dl, [esi - 2]
|
; mov dl, [esi - 2]
|
||||||
; add eax, edx
|
; add eax, edx
|
||||||
lea eax, [eax + edx*2]
|
lea eax, [eax + edx*2]
|
||||||
mov dl, [esi + 78]
|
mov dl, [esi + Screen_W/4-2]
|
||||||
; notype2:
|
; notype2:
|
||||||
|
|
||||||
; type 2 is never used
|
; type 2 is never used
|
||||||
@@ -124,7 +102,7 @@ sta: ; calculate fire image
|
|||||||
; add eax, edx
|
; add eax, edx
|
||||||
; mov dl, [esi]
|
; mov dl, [esi]
|
||||||
; add eax, edx
|
; add eax, edx
|
||||||
; mov dl, [esi + 80]
|
; mov dl, [esi + Screen_W/4]
|
||||||
; notype3:
|
; notype3:
|
||||||
|
|
||||||
typedone:
|
typedone:
|
||||||
@@ -135,12 +113,10 @@ typedone:
|
|||||||
|
|
||||||
ZERO:
|
ZERO:
|
||||||
|
|
||||||
mov [esi - 81], al
|
mov [esi - Screen_W/4-1], al
|
||||||
loop FIRELOOP
|
loop FIRELOOP
|
||||||
|
|
||||||
mov al, 5 ; in this moment always high 24 bits of eax are zero!
|
mcall SF_SLEEP,[delay]
|
||||||
mov ebx,[delay]
|
|
||||||
mcall
|
|
||||||
|
|
||||||
inc [calc]
|
inc [calc]
|
||||||
cmp [calc], byte 2
|
cmp [calc], byte 2
|
||||||
@@ -169,7 +145,7 @@ typedone:
|
|||||||
mov [edi+3],ecx
|
mov [edi+3],ecx
|
||||||
mov [edi+6],ecx
|
mov [edi+6],ecx
|
||||||
mov [edi+9],cx
|
mov [edi+9],cx
|
||||||
lea ebx, [edi+320*3]
|
lea ebx, [edi+Screen_W*3]
|
||||||
mov [ebx+0],ecx
|
mov [ebx+0],ecx
|
||||||
mov [ebx+3],ecx
|
mov [ebx+3],ecx
|
||||||
mov [ebx+6],ecx
|
mov [ebx+6],ecx
|
||||||
@@ -177,50 +153,43 @@ typedone:
|
|||||||
|
|
||||||
add edi,12
|
add edi,12
|
||||||
inc edx
|
inc edx
|
||||||
cmp edx,80
|
cmp edx,Screen_W/4
|
||||||
jnz nnl
|
jnz nnl
|
||||||
xor edx,edx
|
xor edx,edx
|
||||||
add edi,320*3
|
add edi,Screen_W*3
|
||||||
nnl:
|
nnl:
|
||||||
cmp esi,FireScreen+8000; 0x2000
|
cmp esi,FireScreen.end
|
||||||
jnz newc
|
jnz newc
|
||||||
|
|
||||||
mov al,7 ; display image
|
|
||||||
; high 24 bits of eax are zero!
|
|
||||||
pop ebx
|
pop ebx
|
||||||
mov ecx,4*80*65536+200
|
mcall SF_PUT_IMAGE,,<Screen_W,200>,<1,22>
|
||||||
mov edx,1*65536+22
|
|
||||||
mcall
|
|
||||||
|
|
||||||
nodrw:
|
nodrw:
|
||||||
|
|
||||||
mov eax,11 ; check if os wants to talk to us
|
mcall SF_CHECK_EVENT ; check if os wants to talk to us
|
||||||
mcall
|
|
||||||
dec eax
|
dec eax
|
||||||
jz red
|
jz draw_window
|
||||||
cmp al, 3-1
|
cmp al, 3-1
|
||||||
jnz nob4
|
jnz nob4
|
||||||
|
|
||||||
button: ; get button id
|
button: ; get button id
|
||||||
mov al,17
|
mcall SF_GET_BUTTON
|
||||||
mcall
|
|
||||||
shr eax, 8
|
shr eax, 8
|
||||||
|
|
||||||
dec eax
|
dec eax
|
||||||
jnz noclose
|
jnz @f
|
||||||
or eax,-1 ; close this program
|
mcall SF_TERMINATE_PROCESS ; close this program
|
||||||
mcall
|
@@:
|
||||||
noclose:
|
|
||||||
|
|
||||||
dec eax ; change fire type
|
dec eax ; change fire type
|
||||||
jnz nob2
|
jnz @f
|
||||||
xor [type], 1
|
xor [type], 1
|
||||||
nob2:
|
@@:
|
||||||
|
|
||||||
dec eax ; change delay
|
dec eax ; change delay
|
||||||
jnz nob3
|
jnz @f
|
||||||
xor [delay], 1
|
xor [delay], 1
|
||||||
nob3:
|
@@:
|
||||||
|
|
||||||
dec eax ; change color
|
dec eax ; change color
|
||||||
jnz nob4
|
jnz nob4
|
||||||
@@ -233,7 +202,7 @@ typedone:
|
|||||||
fcok:
|
fcok:
|
||||||
mov [fcolor],eax
|
mov [fcolor],eax
|
||||||
mov edi,ImageData
|
mov edi,ImageData
|
||||||
mov ecx,(320*600)/4
|
mov ecx,(Screen_W*200*3)/4
|
||||||
xor eax,eax
|
xor eax,eax
|
||||||
rep stosd
|
rep stosd
|
||||||
|
|
||||||
@@ -246,19 +215,23 @@ fcolor dd 2
|
|||||||
xx db 'x'
|
xx db 'x'
|
||||||
type db 0
|
type db 0
|
||||||
calc db 0
|
calc db 0
|
||||||
delay dd 0
|
delay dd 1
|
||||||
FireSeed dd 0x1234
|
FireSeed dd 0x1234
|
||||||
text: db 'FIRE FOR KOLIBRI'
|
text: db 'Fire for Kolibri'
|
||||||
textlen:
|
textlen:
|
||||||
|
|
||||||
I_END:
|
align 4
|
||||||
|
image_end:
|
||||||
|
|
||||||
FireScreen:
|
FireScreen:
|
||||||
rb 0x2300
|
rb (Screen_W*200)/8 ;wisible fire
|
||||||
|
.end:
|
||||||
|
rb Screen_W*3 ;hidden fire (need for generation)
|
||||||
ImageData:
|
ImageData:
|
||||||
rb 320*200*3
|
rb Screen_W*200*3
|
||||||
|
|
||||||
; stack
|
; stack
|
||||||
align 512
|
align 512
|
||||||
rb 512
|
rb 512
|
||||||
|
stacktop:
|
||||||
mem_end:
|
mem_end:
|
2
programs/demos/firework/build.bat
Normal file
2
programs/demos/firework/build.bat
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
@fasm firework.asm firework
|
||||||
|
@pause
|
@@ -21,9 +21,14 @@ use32
|
|||||||
dd stacktop ; reserved=no extended header
|
dd stacktop ; reserved=no extended header
|
||||||
dd 0, 0
|
dd 0, 0
|
||||||
|
|
||||||
include '../../../macros.inc'
|
include '../../macros.inc'
|
||||||
SCREEN_WIDTH = 320
|
include '../../KOSfuncs.inc'
|
||||||
SCREEN_HEIGHT = 200
|
|
||||||
|
SCREEN_WIDTH = 600 ;.. mod 8 == 0
|
||||||
|
Screen_W dd SCREEN_WIDTH
|
||||||
|
Screen_H dd 400
|
||||||
|
lost_bytes dd 0
|
||||||
|
|
||||||
SIMD equ SSE
|
SIMD equ SSE
|
||||||
SIMD_BYTES = 8
|
SIMD_BYTES = 8
|
||||||
; SSE 8
|
; SSE 8
|
||||||
@@ -46,41 +51,37 @@ PART_SIZE = 20
|
|||||||
macro shade
|
macro shade
|
||||||
{
|
{
|
||||||
local .lop
|
local .lop
|
||||||
|
mov ecx, [Screen_H]
|
||||||
|
imul ecx, [Screen_W]
|
||||||
|
shr ecx, 3 ;ecx = Screen_W * Screen_H / SIMD_BYTES
|
||||||
|
mov edi, [buffer]
|
||||||
if SIMD eq SSE
|
if SIMD eq SSE
|
||||||
mov ecx, SCREEN_WIDTH * SCREEN_HEIGHT / SIMD_BYTES
|
|
||||||
mov edi, buffer
|
|
||||||
movq mm1, qword [sub_mask]
|
movq mm1, qword [sub_mask]
|
||||||
.lop:
|
.lop:
|
||||||
movq mm0, [edi]
|
movq mm0, [edi]
|
||||||
psubusb mm0, mm1
|
psubusb mm0, mm1
|
||||||
movq [edi], mm0
|
movq [edi], mm0
|
||||||
add edi, SIMD_BYTES
|
add edi, SIMD_BYTES
|
||||||
loop .lop
|
loop .lop
|
||||||
else if SIMD eq AVX
|
else if SIMD eq AVX
|
||||||
mov ecx, SCREEN_WIDTH * SCREEN_HEIGHT / SIMD_BYTES
|
|
||||||
mov edi, buffer
|
|
||||||
vmovdqa xmm1, xword [sub_mask]
|
vmovdqa xmm1, xword [sub_mask]
|
||||||
.lop:
|
.lop:
|
||||||
vmovdqa xmm0, [edi]
|
vmovdqa xmm0, [edi]
|
||||||
vpsubusb xmm0, xmm0, xmm1
|
vpsubusb xmm0, xmm0, xmm1
|
||||||
vmovdqa [edi], xmm0
|
vmovdqa [edi], xmm0
|
||||||
add edi, SIMD_BYTES
|
add edi, SIMD_BYTES
|
||||||
loop .lop
|
loop .lop
|
||||||
else if SIMD eq AVX2
|
else if SIMD eq AVX2
|
||||||
mov ecx, SCREEN_WIDTH * SCREEN_HEIGHT / SIMD_BYTES
|
|
||||||
mov edi, buffer
|
|
||||||
vmovdqa ymm1, yword [sub_mask]
|
vmovdqa ymm1, yword [sub_mask]
|
||||||
.lop:
|
.lop:
|
||||||
vmovdqa ymm0, [edi]
|
vmovdqa ymm0, [edi]
|
||||||
vpsubusb ymm0, ymm0, ymm1
|
vpsubusb ymm0, ymm0, ymm1
|
||||||
vmovdqa [edi], ymm0
|
vmovdqa [edi], ymm0
|
||||||
add edi, SIMD_BYTES
|
add edi, SIMD_BYTES
|
||||||
loop .lop
|
loop .lop
|
||||||
else if SIMD eq AVX512
|
else if SIMD eq AVX512
|
||||||
mov ecx, SCREEN_WIDTH * SCREEN_HEIGHT / SIMD_BYTES
|
|
||||||
mov edi, buffer
|
|
||||||
vmovdqa64 zmm1, zword [sub_mask]
|
vmovdqa64 zmm1, zword [sub_mask]
|
||||||
.lop:
|
.lop:
|
||||||
vmovdqa64 zmm0, [edi]
|
vmovdqa64 zmm0, [edi]
|
||||||
vpsubusb zmm0, zmm0, zmm1
|
vpsubusb zmm0, zmm0, zmm1
|
||||||
vmovdqa64 [edi], zmm0
|
vmovdqa64 [edi], zmm0
|
||||||
@@ -91,10 +92,18 @@ end if
|
|||||||
|
|
||||||
macro blur_prepare
|
macro blur_prepare
|
||||||
{
|
{
|
||||||
mov ecx, (SCREEN_WIDTH * SCREEN_HEIGHT - SCREEN_WIDTH * 2 - SIMD_BYTES*2) / SIMD_BYTES
|
mov ecx, [Screen_H]
|
||||||
mov edi, buffer + SCREEN_WIDTH + SIMD_BYTES
|
dec ecx
|
||||||
|
dec ecx
|
||||||
|
imul ecx, [Screen_W]
|
||||||
|
sub ecx, SIMD_BYTES*2
|
||||||
|
shr ecx, 3 ;ecx = (Screen_W * (Screen_H - 2) - SIMD_BYTES*2) / SIMD_BYTES
|
||||||
|
mov edi, SIMD_BYTES
|
||||||
|
add edi, [buffer]
|
||||||
|
add edi, [Screen_W]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
; eax = [Screen_W]
|
||||||
macro blur
|
macro blur
|
||||||
{
|
{
|
||||||
local .lop
|
local .lop
|
||||||
@@ -104,8 +113,10 @@ if SIMD eq SSE
|
|||||||
movq mm1, [edi + 1]
|
movq mm1, [edi + 1]
|
||||||
movq mm2, [edi - 1]
|
movq mm2, [edi - 1]
|
||||||
movq mm3, mm0
|
movq mm3, mm0
|
||||||
movq mm4, [edi - SCREEN_WIDTH]
|
neg eax
|
||||||
movq mm5, [edi + SCREEN_WIDTH]
|
movq mm4, [edi + eax]
|
||||||
|
neg eax
|
||||||
|
movq mm5, [edi + eax]
|
||||||
|
|
||||||
pavgb mm0, mm1 ; mm0 = avg(cur,cur+1)
|
pavgb mm0, mm1 ; mm0 = avg(cur,cur+1)
|
||||||
pavgb mm3, mm2 ; mm3 = avg(cur,cur-1)
|
pavgb mm3, mm2 ; mm3 = avg(cur,cur-1)
|
||||||
@@ -120,11 +131,13 @@ else if SIMD eq AVX
|
|||||||
.lop:
|
.lop:
|
||||||
vmovdqa xmm0, [edi]
|
vmovdqa xmm0, [edi]
|
||||||
vmovdqa xmm1, xmm0
|
vmovdqa xmm1, xmm0
|
||||||
vmovdqa xmm2, [edi - SCREEN_WIDTH]
|
neg eax
|
||||||
|
vmovdqa xmm2, [edi + eax]
|
||||||
|
neg eax
|
||||||
|
|
||||||
vpavgb xmm0, xmm0, [edi + 1]
|
vpavgb xmm0, xmm0, [edi + 1]
|
||||||
vpavgb xmm1, xmm1, [edi - 1]
|
vpavgb xmm1, xmm1, [edi - 1]
|
||||||
vpavgb xmm2, xmm2, [edi + SCREEN_WIDTH]
|
vpavgb xmm2, xmm2, [edi + eax]
|
||||||
vpavgb xmm1, xmm1, xmm2
|
vpavgb xmm1, xmm1, xmm2
|
||||||
vpavgb xmm0, xmm0, xmm1
|
vpavgb xmm0, xmm0, xmm1
|
||||||
|
|
||||||
@@ -135,11 +148,13 @@ else if SIMD eq AVX2
|
|||||||
.lop:
|
.lop:
|
||||||
vmovdqa ymm0, [edi]
|
vmovdqa ymm0, [edi]
|
||||||
vmovdqa ymm1, ymm0
|
vmovdqa ymm1, ymm0
|
||||||
vmovdqa ymm2, [edi - SCREEN_WIDTH]
|
neg eax
|
||||||
|
vmovdqa ymm2, [edi + eax]
|
||||||
|
neg eax
|
||||||
|
|
||||||
vpavgb ymm0, ymm0, [edi + 1]
|
vpavgb ymm0, ymm0, [edi + 1]
|
||||||
vpavgb ymm1, ymm1, [edi - 1]
|
vpavgb ymm1, ymm1, [edi - 1]
|
||||||
vpavgb ymm2, ymm2, [edi + SCREEN_WIDTH]
|
vpavgb ymm2, ymm2, [edi + eax]
|
||||||
vpavgb ymm1, ymm1, ymm2
|
vpavgb ymm1, ymm1, ymm2
|
||||||
vpavgb ymm0, ymm0, ymm1
|
vpavgb ymm0, ymm0, ymm1
|
||||||
|
|
||||||
@@ -150,11 +165,13 @@ else if SIMD eq AVX512
|
|||||||
.lop:
|
.lop:
|
||||||
vmovdqa64 zmm0, [edi]
|
vmovdqa64 zmm0, [edi]
|
||||||
vmovdqa64 zmm1, zmm0
|
vmovdqa64 zmm1, zmm0
|
||||||
vmovdqa64 zmm2, [edi - SCREEN_WIDTH]
|
neg eax
|
||||||
|
vmovdqa64 zmm2, [edi + eax]
|
||||||
|
neg eax
|
||||||
|
|
||||||
vpavgb zmm0, zmm0, [edi + 1]
|
vpavgb zmm0, zmm0, [edi + 1]
|
||||||
vpavgb zmm1, zmm1, [edi - 1]
|
vpavgb zmm1, zmm1, [edi - 1]
|
||||||
vpavgb zmm2, zmm2, [edi + SCREEN_WIDTH]
|
vpavgb zmm2, zmm2, [edi + eax]
|
||||||
vpavgb zmm1, zmm1, zmm2
|
vpavgb zmm1, zmm1, zmm2
|
||||||
vpavgb zmm0, zmm0, zmm1
|
vpavgb zmm0, zmm0, zmm1
|
||||||
|
|
||||||
@@ -164,6 +181,7 @@ else if SIMD eq AVX512
|
|||||||
end if
|
end if
|
||||||
}
|
}
|
||||||
|
|
||||||
|
; eax = [Screen_W]
|
||||||
macro blur_right
|
macro blur_right
|
||||||
{
|
{
|
||||||
local .lop
|
local .lop
|
||||||
@@ -171,8 +189,8 @@ if SIMD eq SSE
|
|||||||
.lop:
|
.lop:
|
||||||
movq mm0, [edi]
|
movq mm0, [edi]
|
||||||
movq mm1, [edi + 1]
|
movq mm1, [edi + 1]
|
||||||
movq mm2, [edi + SCREEN_WIDTH]
|
movq mm2, [edi + eax]
|
||||||
movq mm3, [edi + SCREEN_WIDTH + 1]
|
movq mm3, [edi + eax + 1]
|
||||||
pavgb mm0, mm1
|
pavgb mm0, mm1
|
||||||
pavgb mm3, mm2
|
pavgb mm3, mm2
|
||||||
pavgb mm0, mm3
|
pavgb mm0, mm3
|
||||||
@@ -182,30 +200,30 @@ if SIMD eq SSE
|
|||||||
else if SIMD eq AVX
|
else if SIMD eq AVX
|
||||||
.lop:
|
.lop:
|
||||||
vmovdqa xmm0, [edi]
|
vmovdqa xmm0, [edi]
|
||||||
vmovdqu xmm1, [edi + SCREEN_WIDTH + 1]
|
vmovdqu xmm1, [edi + eax + 1]
|
||||||
vpavgb xmm2, xmm0, [edi + 1]
|
vpavgb xmm2, xmm0, [edi + 1]
|
||||||
vpavgb xmm3, xmm1, [edi + SCREEN_WIDTH]
|
vpavgb xmm3, xmm1, [edi + eax]
|
||||||
vpavgb xmm4, xmm2, xmm3
|
vpavgb xmm4, xmm2, xmm3
|
||||||
vmovdqa [edi], xmm4
|
vmovdqa [edi], xmm4
|
||||||
add edi, SIMD_BYTES
|
add edi, SIMD_BYTES
|
||||||
loop .lop
|
loop .lop
|
||||||
else if SIMD eq AVX2
|
else if SIMD eq AVX2
|
||||||
.lop:
|
.lop:
|
||||||
vmovdqa ymm0, [edi]
|
vmovdqa ymm0, [edi]
|
||||||
vmovdqu ymm1, [edi + SCREEN_WIDTH + 1]
|
vmovdqu ymm1, [edi + eax + 1]
|
||||||
vpavgb ymm2, ymm0, [edi + 1]
|
vpavgb ymm2, ymm0, [edi + 1]
|
||||||
vpavgb ymm3, ymm1, [edi + SCREEN_WIDTH]
|
vpavgb ymm3, ymm1, [edi + eax]
|
||||||
vpavgb ymm4, ymm2, ymm3
|
vpavgb ymm4, ymm2, ymm3
|
||||||
vmovdqa [edi], ymm4
|
vmovdqa [edi], ymm4
|
||||||
add edi, SIMD_BYTES
|
add edi, SIMD_BYTES
|
||||||
loop .lop
|
loop .lop
|
||||||
else if SIMD eq AVX512
|
else if SIMD eq AVX512
|
||||||
.lop:
|
.lop:
|
||||||
vmovdqa64 zmm0, [edi]
|
vmovdqa64 zmm0, [edi]
|
||||||
vmovdqu64 zmm1, [edi + SCREEN_WIDTH + 1]
|
vmovdqu64 zmm1, [edi + eax + 1]
|
||||||
vpavgb zmm2, zmm0, [edi + 1]
|
vpavgb zmm2, zmm0, [edi + 1]
|
||||||
vpavgb zmm3, zmm1, [edi + SCREEN_WIDTH]
|
vpavgb zmm3, zmm1, [edi + eax]
|
||||||
vpavgb zmm4, zmm2, zmm3
|
vpavgb zmm4, zmm2, zmm3
|
||||||
vmovdqa64 [edi], zmm4
|
vmovdqa64 [edi], zmm4
|
||||||
add edi, SIMD_BYTES
|
add edi, SIMD_BYTES
|
||||||
loop .lop
|
loop .lop
|
||||||
@@ -217,12 +235,12 @@ STARTAPP:
|
|||||||
init_palette:
|
init_palette:
|
||||||
mov edi, pal
|
mov edi, pal
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
red_loop:
|
@@:
|
||||||
stosd
|
stosd
|
||||||
stosd
|
stosd
|
||||||
add eax, 0x040000
|
add eax, 0x040000
|
||||||
and eax, 0xFFFFFF
|
and eax, 0xFFFFFF
|
||||||
jnz red_loop
|
jnz @b
|
||||||
|
|
||||||
mov eax, 63*4 SHL 16
|
mov eax, 63*4 SHL 16
|
||||||
@@:
|
@@:
|
||||||
@@ -231,11 +249,12 @@ red_loop:
|
|||||||
add ax, 0x0404
|
add ax, 0x0404
|
||||||
jnc @b
|
jnc @b
|
||||||
|
|
||||||
;zero_buffer:
|
;init buffer
|
||||||
mov ecx, SCREEN_WIDTH * SCREEN_HEIGHT / 4
|
mcall SF_SYS_MISC,SSF_HEAP_INIT
|
||||||
; mov edi, buffer
|
mov ecx,[Screen_W]
|
||||||
xor eax, eax
|
imul ecx,[Screen_H]
|
||||||
rep stosd
|
mcall SF_SYS_MISC,SSF_MEM_ALLOC
|
||||||
|
mov [buffer],eax
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
; Main Functions
|
; Main Functions
|
||||||
@@ -253,30 +272,63 @@ end virtual
|
|||||||
|
|
||||||
jmp MAIN
|
jmp MAIN
|
||||||
|
|
||||||
|
align 4
|
||||||
|
OnResize:
|
||||||
|
mov ecx,[Screen_W]
|
||||||
|
imul ecx,[Screen_H]
|
||||||
|
;ecx = SCREEN_W*SCREEN_H
|
||||||
|
mcall SF_SYS_MISC,SSF_MEM_REALLOC,,[buffer]
|
||||||
|
ret
|
||||||
|
|
||||||
|
align 4
|
||||||
red:
|
red:
|
||||||
mcall 9, proc_info, -1
|
mcall SF_THREAD_INFO, proc_info, -1
|
||||||
x = 100
|
areacolor = 0x53224466
|
||||||
y = 70
|
mcall SF_REDRAW, SSF_BEGIN_DRAW
|
||||||
xsize = SCREEN_WIDTH+9
|
mcall SF_STYLE_SETTINGS, SSF_GET_SKIN_HEIGHT
|
||||||
ysize = SCREEN_HEIGHT+4
|
add eax, 4
|
||||||
areacolor = 0x54224466
|
push eax ;for test resize
|
||||||
mov eax, 12 ; function 12:tell os about windowdraw
|
add eax, [Screen_H]
|
||||||
mov ebx, 1 ; 1, start of draw
|
lea ecx, [(70 shl 16) + eax]
|
||||||
int 0x40
|
mov ebx, [Screen_W]
|
||||||
mov eax, 48
|
lea ebx, [(100 shl 16) + 9 + ebx]
|
||||||
mov ebx, 4
|
mcall SF_CREATE_WINDOW,,, areacolor,, window_title
|
||||||
int 0x40
|
|
||||||
lea ecx, [(y SHL 16) + ysize + eax]
|
;test resize
|
||||||
xor eax, eax ; function 0 : define and draw window
|
pop eax
|
||||||
mov ebx, (x SHL 16) + xsize ; [x start] *65536 + [x size]
|
cmp dword[proc_info.box.height],0
|
||||||
mov edx, areacolor ; color of work area RRGGBB
|
je .resize_end
|
||||||
mov edi, window_title
|
sub eax,[proc_info.box.height]
|
||||||
int 0x40
|
neg eax
|
||||||
mov eax, 12 ; end of redraw
|
cmp eax,[Screen_H]
|
||||||
mov ebx, 2
|
je .end_h
|
||||||
int 0x40
|
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
|
||||||
|
mov [lost_bytes],eax
|
||||||
|
and eax,0xffff-(SIMD_BYTES-1)
|
||||||
|
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_END_DRAW ; end of redraw
|
||||||
|
|
||||||
|
align 4
|
||||||
MAIN:
|
MAIN:
|
||||||
test [proc_info.wnd_state], 0x04
|
test [proc_info.wnd_state], 0x04
|
||||||
jnz still
|
jnz still
|
||||||
@@ -291,11 +343,15 @@ MAIN:
|
|||||||
|
|
||||||
cmp eax, 5
|
cmp eax, 5
|
||||||
jb .new_particle
|
jb .new_particle
|
||||||
cmp eax, SCREEN_WIDTH - 5
|
mov edx, [Screen_W]
|
||||||
|
sub edx, 5
|
||||||
|
cmp eax, edx
|
||||||
jge .new_particle
|
jge .new_particle
|
||||||
cmp ebx, 5
|
cmp ebx, 5
|
||||||
jb .new_particle
|
jb .new_particle
|
||||||
cmp ebx, SCREEN_HEIGHT - 5
|
mov edx, [Screen_H]
|
||||||
|
sub edx, 5
|
||||||
|
cmp ebx, edx
|
||||||
jl .part_ok
|
jl .part_ok
|
||||||
|
|
||||||
.new_particle:
|
.new_particle:
|
||||||
@@ -303,9 +359,11 @@ MAIN:
|
|||||||
jmp .advance_particles
|
jmp .advance_particles
|
||||||
|
|
||||||
.part_ok:
|
.part_ok:
|
||||||
imul edi, ebx, SCREEN_WIDTH
|
mov edi, ebx
|
||||||
|
imul edi, [Screen_W]
|
||||||
mov dl, [ebp+COLOR_OFFSET]
|
mov dl, [ebp+COLOR_OFFSET]
|
||||||
mov [buffer+eax+edi], dl
|
add eax,[buffer]
|
||||||
|
mov [eax+edi], dl
|
||||||
|
|
||||||
mov eax, [ebp+X_SPEED_OFFSET]
|
mov eax, [ebp+X_SPEED_OFFSET]
|
||||||
add [ebp+X_OFFSET], eax
|
add [ebp+X_OFFSET], eax
|
||||||
@@ -324,6 +382,7 @@ MAIN:
|
|||||||
shade
|
shade
|
||||||
; jmp .copy_buffer_to_video
|
; jmp .copy_buffer_to_video
|
||||||
blur_prepare
|
blur_prepare
|
||||||
|
mov eax, [Screen_W]
|
||||||
test dword [blur_right_flag] , 0x800000
|
test dword [blur_right_flag] , 0x800000
|
||||||
jnz .do_blur_right
|
jnz .do_blur_right
|
||||||
blur
|
blur
|
||||||
@@ -339,36 +398,45 @@ MAIN:
|
|||||||
|
|
||||||
.copy_buffer_to_video:
|
.copy_buffer_to_video:
|
||||||
|
|
||||||
mcall 48, 4
|
mcall SF_STYLE_SETTINGS, SSF_GET_SKIN_HEIGHT
|
||||||
lea edx, [(5 SHL 16) + eax]
|
lea edx, [(5 shl 16) + eax]
|
||||||
|
push 8
|
||||||
|
pop esi
|
||||||
|
xor ebp, ebp
|
||||||
|
mov ecx, [Screen_W]
|
||||||
|
shl ecx, 16
|
||||||
|
add ecx, [Screen_H]
|
||||||
|
mcall SF_PUT_IMAGE_EXT, [buffer],,,, pal
|
||||||
|
|
||||||
mov eax, 65
|
and [lost_bytes], SIMD_BYTES-1
|
||||||
mov ebx, buffer
|
jz still
|
||||||
mov ecx, (SCREEN_WIDTH SHL 16) + SCREEN_HEIGHT
|
mcall SF_STYLE_SETTINGS, SSF_GET_SKIN_HEIGHT
|
||||||
push 8
|
mov ecx, eax
|
||||||
pop esi
|
shl ecx, 16
|
||||||
mov edi, pal
|
add ecx, [Screen_H]
|
||||||
xor ebp, ebp
|
mov ebx, [Screen_W]
|
||||||
int 0x40
|
add ebx, 5 ;left border
|
||||||
|
shl ebx, 16
|
||||||
|
add ebx, [lost_bytes]
|
||||||
|
xor edx, edx
|
||||||
|
mcall SF_DRAW_RECT
|
||||||
|
|
||||||
|
align 4
|
||||||
|
still:
|
||||||
|
mcall SF_WAIT_EVENT_TIMEOUT, 1
|
||||||
|
|
||||||
still:
|
dec eax ; redraw request ?
|
||||||
mov eax, 11 ; Test if there is an event in the queue.
|
jz red
|
||||||
int 0x40
|
dec eax ; key in buffer ?
|
||||||
|
jz key
|
||||||
dec eax ; redraw request ?
|
dec eax ; button in buffer ?
|
||||||
jz red
|
jz button
|
||||||
dec eax ; key in buffer ?
|
|
||||||
jz key
|
|
||||||
dec eax ; button in buffer ?
|
|
||||||
jz button
|
|
||||||
|
|
||||||
jmp MAIN
|
|
||||||
|
|
||||||
|
jmp MAIN
|
||||||
|
|
||||||
|
align 4
|
||||||
key:
|
key:
|
||||||
mov eax, 2
|
mcall SF_GET_KEY
|
||||||
int 0x40
|
|
||||||
; cmp ah, 1 ; Test Esc in Scan
|
; cmp ah, 1 ; Test Esc in Scan
|
||||||
; je close_app
|
; je close_app
|
||||||
cmp ah, 27 ; Test Esc in ASCII
|
cmp ah, 27 ; Test Esc in ASCII
|
||||||
@@ -378,8 +446,7 @@ key:
|
|||||||
button:
|
button:
|
||||||
; we have only one button, close
|
; we have only one button, close
|
||||||
close_app:
|
close_app:
|
||||||
mov eax, -1 ; close this program
|
mcall SF_TERMINATE_PROCESS
|
||||||
int 0x40
|
|
||||||
|
|
||||||
init_particle:
|
init_particle:
|
||||||
rdtsc
|
rdtsc
|
||||||
@@ -389,7 +456,7 @@ init_particle:
|
|||||||
call rand
|
call rand
|
||||||
cdq
|
cdq
|
||||||
;xor dx, dx
|
;xor dx, dx
|
||||||
mov ebx, SCREEN_WIDTH
|
mov ebx, [Screen_W]
|
||||||
div ebx
|
div ebx
|
||||||
shl edx, 6
|
shl edx, 6
|
||||||
mov [4 + global_x], edx
|
mov [4 + global_x], edx
|
||||||
@@ -397,7 +464,7 @@ init_particle:
|
|||||||
call rand
|
call rand
|
||||||
cdq
|
cdq
|
||||||
;xor dx, dx
|
;xor dx, dx
|
||||||
mov ebx, SCREEN_HEIGHT
|
mov ebx, [Screen_H]
|
||||||
div ebx
|
div ebx
|
||||||
shl edx, 6
|
shl edx, 6
|
||||||
mov [4 + global_y], edx
|
mov [4 + global_y], edx
|
||||||
@@ -444,7 +511,8 @@ proc_info process_information
|
|||||||
align 16
|
align 16
|
||||||
pal rb 256 * 4
|
pal rb 256 * 4
|
||||||
align SIMD_BYTES
|
align SIMD_BYTES
|
||||||
buffer rb SCREEN_WIDTH * SCREEN_HEIGHT
|
buffer dd 0
|
||||||
E_END:
|
align 4
|
||||||
rd 0x200
|
rd 1024
|
||||||
stacktop:
|
stacktop:
|
||||||
|
E_END:
|
@@ -1,5 +1,5 @@
|
|||||||
if tup.getconfig("NO_FASM") ~= "" then return end
|
if tup.getconfig("NO_FASM") ~= "" then return end
|
||||||
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../.." or tup.getconfig("HELPERDIR")
|
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR")
|
||||||
tup.include(HELPERDIR .. "/use_fasm.lua")
|
tup.include(HELPERDIR .. "/use_fasm.lua")
|
||||||
add_include(tup.getvariantdir())
|
add_include(tup.getvariantdir())
|
||||||
|
|
@@ -1,5 +1,5 @@
|
|||||||
@erase lang.inc
|
@erase lang.inc
|
||||||
@echo lang fix en_US >lang.inc
|
@echo lang fix en_US >lang.inc
|
||||||
@fasm plasma.asm plasma
|
@fasm plasma.asm plasma
|
||||||
@erase lang.inc
|
@erase lang.inc
|
||||||
@pause
|
@pause
|
@@ -1,5 +1,5 @@
|
|||||||
@erase lang.inc
|
@erase lang.inc
|
||||||
@echo lang fix ru_RU >lang.inc
|
@echo lang fix ru_RU >lang.inc
|
||||||
@fasm plasma.asm plasma
|
@fasm plasma.asm plasma
|
||||||
@erase lang.inc
|
@erase lang.inc
|
||||||
@pause
|
@pause
|
@@ -1,48 +1,112 @@
|
|||||||
; Originally written by Jarek Pelczar
|
; Originally written by Jarek Pelczar
|
||||||
include "lang.inc"
|
include "lang.inc"
|
||||||
include "..\..\..\macros.inc"
|
include "..\..\macros.inc"
|
||||||
|
include "..\..\KOSfuncs.inc"
|
||||||
|
|
||||||
WND_SIZE_X = 320
|
KOS_APP_START
|
||||||
WND_SIZE_Y = 200
|
|
||||||
|
WND_SIZE_X dd 640
|
||||||
|
WND_SIZE_Y dd 400
|
||||||
|
|
||||||
|
if lang eq ru_RU
|
||||||
|
title db '<27>« §¬ ',0
|
||||||
|
else
|
||||||
|
title db 'Plasma',0
|
||||||
|
end if
|
||||||
|
|
||||||
MEOS_APP_START
|
|
||||||
CODE
|
CODE
|
||||||
|
mcall SF_SYS_MISC,SSF_HEAP_INIT
|
||||||
|
mov ecx,[WND_SIZE_X]
|
||||||
|
imul ecx,[WND_SIZE_Y]
|
||||||
|
mcall SF_SYS_MISC,SSF_MEM_ALLOC
|
||||||
|
mov [virtual_screen_8],eax
|
||||||
|
|
||||||
fninit
|
fninit
|
||||||
mcall 40,101b
|
mcall SF_SET_EVENTS_MASK, 101b
|
||||||
call init_palette
|
call init_palette
|
||||||
call init_texture
|
call init_texture
|
||||||
jmp .paint_window
|
jmp .paint_window
|
||||||
.event_loop:
|
.event_loop:
|
||||||
mcall 23,1
|
mcall SF_WAIT_EVENT_TIMEOUT, 1
|
||||||
test eax,eax
|
test eax,eax
|
||||||
je .draw_screen
|
je .draw_screen
|
||||||
dec eax
|
dec eax
|
||||||
je .paint_window
|
je .paint_window
|
||||||
|
|
||||||
or eax,-1
|
mcall SF_TERMINATE_PROCESS
|
||||||
mcall
|
|
||||||
|
|
||||||
.draw_screen:
|
.draw_screen:
|
||||||
xor ebp,ebp
|
xor ebp,ebp
|
||||||
mcall 65,virtual_screen_8,<WND_SIZE_X,WND_SIZE_Y>,0,8,_palette
|
mov ecx,[WND_SIZE_X]
|
||||||
|
shl ecx,16
|
||||||
|
add ecx,[WND_SIZE_Y]
|
||||||
|
mcall SF_PUT_IMAGE_EXT, [virtual_screen_8],,0,8,_palette
|
||||||
call rotate_pal
|
call rotate_pal
|
||||||
jmp .event_loop
|
jmp .event_loop
|
||||||
|
|
||||||
.paint_window:
|
.paint_window:
|
||||||
mcall 12,1
|
mcall SF_REDRAW, SSF_BEGIN_DRAW
|
||||||
|
|
||||||
mcall 48,4 ; get skin height
|
;if window resize
|
||||||
lea ecx,[eax + (110 shl 16) + WND_SIZE_Y + 4]
|
mcall SF_THREAD_INFO,procinfo,-1
|
||||||
|
cmp dword[procinfo.box.height],0
|
||||||
|
je .resize_end
|
||||||
|
mcall SF_STYLE_SETTINGS, SSF_GET_SKIN_HEIGHT
|
||||||
|
add eax,4
|
||||||
|
sub eax,[procinfo.box.height]
|
||||||
|
neg eax
|
||||||
|
cmp eax,[WND_SIZE_Y]
|
||||||
|
je .end_h
|
||||||
|
cmp eax,32 ;min height
|
||||||
|
jge @f
|
||||||
|
mov eax,32
|
||||||
|
@@:
|
||||||
|
mov [WND_SIZE_Y],eax
|
||||||
|
xor eax,eax
|
||||||
|
mov [WND_SIZE_X],eax
|
||||||
|
.end_h:
|
||||||
|
|
||||||
|
mov eax,[procinfo.box.width]
|
||||||
|
sub eax,9
|
||||||
|
cmp eax,[WND_SIZE_X]
|
||||||
|
je .resize_end
|
||||||
|
cmp eax,64 ;min width
|
||||||
|
jge @f
|
||||||
|
mov eax,64
|
||||||
|
@@:
|
||||||
|
mov [WND_SIZE_X],eax
|
||||||
|
|
||||||
|
call OnResize
|
||||||
|
call init_texture
|
||||||
|
.resize_end:
|
||||||
|
|
||||||
|
mcall SF_STYLE_SETTINGS, SSF_GET_SKIN_HEIGHT
|
||||||
|
lea ecx,[eax + (110 shl 16) + 4]
|
||||||
|
add ecx,[WND_SIZE_Y]
|
||||||
mov edi,title
|
mov edi,title
|
||||||
mcall 0,<110,WND_SIZE_X+9>,,0x74000000
|
mov ebx,[WND_SIZE_X]
|
||||||
|
add ebx,(110 shl 16)+9
|
||||||
|
mcall SF_CREATE_WINDOW,,,0x73000000
|
||||||
|
|
||||||
xor ebp,ebp
|
xor ebp,ebp
|
||||||
mcall 65,virtual_screen_8,<WND_SIZE_X,WND_SIZE_Y>,0,8,_palette
|
mov ecx,[WND_SIZE_X]
|
||||||
|
shl ecx,16
|
||||||
|
add ecx,[WND_SIZE_Y]
|
||||||
|
mcall SF_PUT_IMAGE_EXT, [virtual_screen_8],,0,8,_palette
|
||||||
|
|
||||||
mcall 12,2
|
mcall SF_REDRAW, SSF_END_DRAW
|
||||||
|
|
||||||
jmp .event_loop
|
jmp .event_loop
|
||||||
|
|
||||||
|
align 4
|
||||||
|
OnResize:
|
||||||
|
mov ecx,[WND_SIZE_X]
|
||||||
|
imul ecx,[WND_SIZE_Y]
|
||||||
|
mcall SF_SYS_MISC,SSF_MEM_ALLOC
|
||||||
|
mov [virtual_screen_8],eax
|
||||||
|
ret
|
||||||
|
|
||||||
|
align 4
|
||||||
init_palette:
|
init_palette:
|
||||||
mov edi,_palette
|
mov edi,_palette
|
||||||
mov ecx,64
|
mov ecx,64
|
||||||
@@ -92,7 +156,7 @@ init_texture:
|
|||||||
mov [_fpom16],180
|
mov [_fpom16],180
|
||||||
fidiv [_fpom16]
|
fidiv [_fpom16]
|
||||||
fstp [_st_rad]
|
fstp [_st_rad]
|
||||||
mov edi,virtual_screen_8
|
mov edi,[virtual_screen_8]
|
||||||
cdq
|
cdq
|
||||||
.itex_vertical:
|
.itex_vertical:
|
||||||
xor ecx,ecx
|
xor ecx,ecx
|
||||||
@@ -120,10 +184,10 @@ init_texture:
|
|||||||
inc eax
|
inc eax
|
||||||
stosb
|
stosb
|
||||||
inc ecx
|
inc ecx
|
||||||
cmp ecx,WND_SIZE_X
|
cmp ecx,[WND_SIZE_X]
|
||||||
jne .itex_horizontal
|
jne .itex_horizontal
|
||||||
inc edx
|
inc edx
|
||||||
cmp edx,WND_SIZE_Y
|
cmp edx,[WND_SIZE_Y]
|
||||||
jne .itex_vertical
|
jne .itex_vertical
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@@ -141,7 +205,6 @@ rotate_pal:
|
|||||||
DATA
|
DATA
|
||||||
_multiplier dd 63.5
|
_multiplier dd 63.5
|
||||||
|
|
||||||
title db 'Plasma',0
|
|
||||||
|
|
||||||
UDATA
|
UDATA
|
||||||
_fpom32 rd 1
|
_fpom32 rd 1
|
||||||
@@ -149,7 +212,7 @@ UDATA
|
|||||||
_st_rad rd 1
|
_st_rad rd 1
|
||||||
_palette: rd 256
|
_palette: rd 256
|
||||||
|
|
||||||
virtual_screen_8:
|
virtual_screen_8 rd 1
|
||||||
rb WND_SIZE_X*WND_SIZE_Y
|
procinfo process_information
|
||||||
|
|
||||||
MEOS_APP_END
|
KOS_APP_END
|
7
programs/demos/tube/Tupfile.lua
Normal file
7
programs/demos/tube/Tupfile.lua
Normal 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({"tube.asm", extra_inputs = {"lang.inc"}}, FASM .. " %f %o " .. tup.getconfig("KPACK_CMD"), "tube")
|
@@ -1,5 +1,5 @@
|
|||||||
@erase lang.inc
|
@erase lang.inc
|
||||||
@echo lang fix en_US >lang.inc
|
@echo lang fix en_US >lang.inc
|
||||||
@fasm tube.asm tube
|
@fasm tube.asm tube
|
||||||
@erase lang.inc
|
@erase lang.inc
|
||||||
@pause
|
@pause
|
@@ -1,5 +1,5 @@
|
|||||||
@erase lang.inc
|
@erase lang.inc
|
||||||
@echo lang fix ru_RU >lang.inc
|
@echo lang fix ru_RU >lang.inc
|
||||||
@fasm tube.asm tube
|
@fasm tube.asm tube
|
||||||
@erase lang.inc
|
@erase lang.inc
|
||||||
@pause
|
@pause
|
@@ -1,2 +0,0 @@
|
|||||||
if tup.getconfig("NO_FASM") ~= "" then return end
|
|
||||||
tup.rule("tube.asm", "fasm %f %o " .. tup.getconfig("KPACK_CMD"), "tube")
|
|
@@ -1,264 +0,0 @@
|
|||||||
|
|
||||||
; (<28>) ( ) <20> ) ( ) 256b intro by baze/3SC for Syndeecate 2001
|
|
||||||
; <20><><EFBFBD> <20><><EFBFBD> <20><><EFBFBD> <20><><EFBFBD> loveC: thanks, Serzh: eat my socks dude ;]
|
|
||||||
; ( ) ( ) ( ) ( ) e-mail: baze@stonline.sk, web: www.3SC.sk
|
|
||||||
|
|
||||||
; Menuet port by VT
|
|
||||||
|
|
||||||
appname equ 'TUBE - FPU'
|
|
||||||
|
|
||||||
use32
|
|
||||||
org 0x0
|
|
||||||
|
|
||||||
db 'MENUET01'
|
|
||||||
dd 0x01
|
|
||||||
dd START
|
|
||||||
dd I_END
|
|
||||||
dd 0x40000
|
|
||||||
dd 0x40000
|
|
||||||
dd 0,0
|
|
||||||
|
|
||||||
include '..\..\..\macros.inc'
|
|
||||||
|
|
||||||
START:
|
|
||||||
|
|
||||||
call draw_window
|
|
||||||
|
|
||||||
call init_tube
|
|
||||||
|
|
||||||
push ebx
|
|
||||||
|
|
||||||
still:
|
|
||||||
|
|
||||||
pop ebx
|
|
||||||
|
|
||||||
call MAIN
|
|
||||||
|
|
||||||
push ebx
|
|
||||||
|
|
||||||
mov eax,23
|
|
||||||
mov ebx,1
|
|
||||||
mcall
|
|
||||||
|
|
||||||
cmp eax,1
|
|
||||||
jne no_red
|
|
||||||
call draw_window
|
|
||||||
jmp still
|
|
||||||
no_red:
|
|
||||||
|
|
||||||
cmp eax,0
|
|
||||||
je still
|
|
||||||
|
|
||||||
or eax,-1
|
|
||||||
mcall
|
|
||||||
|
|
||||||
SCREEN equ 160
|
|
||||||
PIXBUF equ 200h
|
|
||||||
EYE equ EYE_P-2
|
|
||||||
|
|
||||||
|
|
||||||
MAIN:
|
|
||||||
|
|
||||||
add bh,10;8
|
|
||||||
mov edi,PIXBUF
|
|
||||||
fadd dword [di-PIXBUF+TEXUV-4]
|
|
||||||
push di
|
|
||||||
mov dx,-80
|
|
||||||
|
|
||||||
TUBEY:
|
|
||||||
|
|
||||||
mov bp,-160
|
|
||||||
|
|
||||||
TUBEX:
|
|
||||||
|
|
||||||
mov si,TEXUV
|
|
||||||
fild word [si-TEXUV+EYE]
|
|
||||||
mov [si],bp
|
|
||||||
fild word [si]
|
|
||||||
mov [si],dx
|
|
||||||
fild word [si]
|
|
||||||
mov cl,2
|
|
||||||
|
|
||||||
ROTATE:
|
|
||||||
|
|
||||||
fld st3
|
|
||||||
fsincos
|
|
||||||
fld st2
|
|
||||||
fmul st0,st1
|
|
||||||
fld st4
|
|
||||||
fmul st0,st3
|
|
||||||
db 0xde,0xe9 ; fsubp st1,st0
|
|
||||||
db 0xd9,0xcb ; fxch st3
|
|
||||||
fmulp st2,st0
|
|
||||||
fmulp st3,st0
|
|
||||||
faddp st2,st0
|
|
||||||
db 0xd9,0xca ; fxch st2
|
|
||||||
|
|
||||||
loop ROTATE
|
|
||||||
|
|
||||||
fld st1
|
|
||||||
db 0xdc,0xc8 ; fmul st0,st
|
|
||||||
fld st1
|
|
||||||
db 0xdc,0xc8 ; fmul st0,st
|
|
||||||
faddp st1,st0
|
|
||||||
fsqrt
|
|
||||||
db 0xde,0xfb ; fdivp st3,st0
|
|
||||||
fpatan
|
|
||||||
fimul word [si-4]
|
|
||||||
fistp word [si]
|
|
||||||
fimul word [si-4]
|
|
||||||
fistp word [si+1]
|
|
||||||
mov si,[si]
|
|
||||||
|
|
||||||
lea ax,[bx+si]
|
|
||||||
add al,ah
|
|
||||||
and al,64
|
|
||||||
mov al,-5
|
|
||||||
jz STORE_1
|
|
||||||
|
|
||||||
shl si,2
|
|
||||||
lea ax,[bx+si]
|
|
||||||
sub al,ah
|
|
||||||
mov al,-16
|
|
||||||
jns STORE_1
|
|
||||||
|
|
||||||
shl si,1
|
|
||||||
mov al,-48
|
|
||||||
|
|
||||||
STORE_1:
|
|
||||||
|
|
||||||
; add al,[ebx+esi+0x80000]
|
|
||||||
add [di],al
|
|
||||||
inc di
|
|
||||||
|
|
||||||
inc bp
|
|
||||||
cmp bp,160
|
|
||||||
|
|
||||||
EYE_P:
|
|
||||||
|
|
||||||
jnz TUBEX
|
|
||||||
inc dx
|
|
||||||
cmp dx,80
|
|
||||||
jnz TUBEY
|
|
||||||
|
|
||||||
call display_image
|
|
||||||
|
|
||||||
pop si
|
|
||||||
mov ch,SCREEN*320/256
|
|
||||||
|
|
||||||
BLUR:
|
|
||||||
|
|
||||||
inc si
|
|
||||||
sar byte [si],2
|
|
||||||
loop BLUR
|
|
||||||
|
|
||||||
ret
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
display_image:
|
|
||||||
|
|
||||||
pusha
|
|
||||||
|
|
||||||
mov esi,PIXBUF
|
|
||||||
mov edi,0x10000
|
|
||||||
newp:
|
|
||||||
movzx edx,byte [esi]
|
|
||||||
shl edx,4
|
|
||||||
; mov dh,dl
|
|
||||||
mov [edi],edx
|
|
||||||
|
|
||||||
add edi,3
|
|
||||||
inc esi
|
|
||||||
|
|
||||||
cmp esi,320*160+PIXBUF
|
|
||||||
jbe newp
|
|
||||||
|
|
||||||
mov eax,7
|
|
||||||
mov ecx,320*65536+160
|
|
||||||
xor edx,edx
|
|
||||||
mov ebx,0x10000
|
|
||||||
mcall
|
|
||||||
|
|
||||||
popa
|
|
||||||
ret
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
draw_window:
|
|
||||||
|
|
||||||
pusha
|
|
||||||
|
|
||||||
mcall 12, 1
|
|
||||||
mcall 48, 4 ;get skin width
|
|
||||||
lea ecx,[100*65536+164+eax]
|
|
||||||
xor eax,eax
|
|
||||||
mov ebx,100*65536+329
|
|
||||||
mov edx,0x74000000
|
|
||||||
mov edi,title
|
|
||||||
mcall
|
|
||||||
mcall 12, 2
|
|
||||||
popa
|
|
||||||
ret
|
|
||||||
|
|
||||||
title db appname,0
|
|
||||||
|
|
||||||
db 41,0,0xC3,0x3C
|
|
||||||
|
|
||||||
TEXUV:
|
|
||||||
|
|
||||||
init_tube:
|
|
||||||
|
|
||||||
mov ecx,256
|
|
||||||
|
|
||||||
PAL1:
|
|
||||||
|
|
||||||
mov dx,3C8h
|
|
||||||
mov ax,cx
|
|
||||||
inc dx
|
|
||||||
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 bx,cx
|
|
||||||
mov [ebx+0x1000],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+0x1000]
|
|
||||||
shr dl,1
|
|
||||||
mov [ebx+0x1000],dl
|
|
||||||
not bh
|
|
||||||
mov [ebx+0x1000],dl
|
|
||||||
loop TEX
|
|
||||||
|
|
||||||
fninit
|
|
||||||
fldz
|
|
||||||
|
|
||||||
ret
|
|
||||||
|
|
||||||
|
|
||||||
I_END:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
321
programs/demos/tube/tube.asm
Normal file
321
programs/demos/tube/tube.asm
Normal file
@@ -0,0 +1,321 @@
|
|||||||
|
; 256b intro by baze/3SC for Syndeecate 2001
|
||||||
|
; loveC: thanks, Serzh: eat my socks dude ;]
|
||||||
|
; e-mail: baze@stonline.sk, web: www.3SC.sk
|
||||||
|
|
||||||
|
; Menuet port by VT
|
||||||
|
|
||||||
|
|
||||||
|
use32
|
||||||
|
org 0
|
||||||
|
db 'MENUET01'
|
||||||
|
dd 1,START,image_end,memory_end,stacktop,0,0
|
||||||
|
|
||||||
|
include '../../macros.inc'
|
||||||
|
include '../../KOSfuncs.inc'
|
||||||
|
include 'lang.inc'
|
||||||
|
|
||||||
|
if lang eq ru_RU
|
||||||
|
title db '<27><>㡠 - FPU',0
|
||||||
|
else
|
||||||
|
title db 'Tube - FPU',0
|
||||||
|
end if
|
||||||
|
|
||||||
|
SCREEN_W dd 640-10 ;10 px for borders
|
||||||
|
SCREEN_H dd 400-10
|
||||||
|
|
||||||
|
align 4
|
||||||
|
START:
|
||||||
|
mcall SF_SYS_MISC,SSF_HEAP_INIT
|
||||||
|
mov ecx,[SCREEN_W]
|
||||||
|
imul ecx,[SCREEN_H]
|
||||||
|
;ecx = SCREEN_W*SCREEN_H
|
||||||
|
mcall SF_SYS_MISC,SSF_MEM_ALLOC
|
||||||
|
mov [PIXBUF],eax
|
||||||
|
mcall SF_SYS_MISC,SSF_MEM_ALLOC
|
||||||
|
mov [buf1],eax
|
||||||
|
lea ecx,[ecx+2*ecx]
|
||||||
|
mcall SF_SYS_MISC,SSF_MEM_ALLOC
|
||||||
|
mov [buf2],eax
|
||||||
|
|
||||||
|
call draw_window
|
||||||
|
call init_tube
|
||||||
|
push ebx
|
||||||
|
|
||||||
|
still:
|
||||||
|
pop ebx
|
||||||
|
call MAIN
|
||||||
|
push ebx
|
||||||
|
|
||||||
|
mcall SF_WAIT_EVENT_TIMEOUT,1
|
||||||
|
|
||||||
|
cmp eax,EV_REDRAW
|
||||||
|
jne no_red
|
||||||
|
call draw_window
|
||||||
|
jmp still
|
||||||
|
no_red:
|
||||||
|
|
||||||
|
or eax,eax
|
||||||
|
jz still
|
||||||
|
|
||||||
|
mcall SF_TERMINATE_PROCESS
|
||||||
|
|
||||||
|
align 4
|
||||||
|
OnResize:
|
||||||
|
mov ecx,[SCREEN_W]
|
||||||
|
imul ecx,[SCREEN_H]
|
||||||
|
;ecx = SCREEN_W*SCREEN_H
|
||||||
|
mcall SF_SYS_MISC,SSF_MEM_REALLOC,,[PIXBUF]
|
||||||
|
mov [PIXBUF],eax
|
||||||
|
mcall SF_SYS_MISC,SSF_MEM_REALLOC,,[buf1]
|
||||||
|
mov [buf1],eax
|
||||||
|
lea ecx,[ecx+2*ecx]
|
||||||
|
mcall SF_SYS_MISC,SSF_MEM_REALLOC,,[buf2]
|
||||||
|
mov [buf2],eax
|
||||||
|
ret
|
||||||
|
|
||||||
|
align 4
|
||||||
|
MAIN:
|
||||||
|
;edx - coord y
|
||||||
|
;ebp - coord x
|
||||||
|
;edi - pixel buffer
|
||||||
|
add ebx,10 shl 8
|
||||||
|
mov edi,[PIXBUF]
|
||||||
|
fadd dword [TEXUV-4]
|
||||||
|
push edi
|
||||||
|
mov edx,[SCREEN_H]
|
||||||
|
inc edx ;fix (height%2)==1
|
||||||
|
shr edx,1
|
||||||
|
neg edx ;edx=-SCREEN_H/2
|
||||||
|
align 4
|
||||||
|
TUBEY:
|
||||||
|
mov ebp,[SCREEN_W]
|
||||||
|
inc ebp ;fix (width%2)==1
|
||||||
|
shr ebp,1
|
||||||
|
neg ebp ;ebp=-SCREEN_W/2
|
||||||
|
align 4
|
||||||
|
TUBEX:
|
||||||
|
mov esi,TEXUV
|
||||||
|
fild dword [SCREEN_W]
|
||||||
|
fld1
|
||||||
|
fld1
|
||||||
|
faddp
|
||||||
|
fdivp ;st0=SCREEN_W/2
|
||||||
|
mov [esi],ebp
|
||||||
|
fild word [esi]
|
||||||
|
mov [esi],edx
|
||||||
|
fild word [esi]
|
||||||
|
mov cl,2
|
||||||
|
|
||||||
|
ROTATE:
|
||||||
|
fld st3
|
||||||
|
fsincos
|
||||||
|
fld st2
|
||||||
|
fmul st0,st1
|
||||||
|
fld st4
|
||||||
|
fmul st0,st3
|
||||||
|
fsubp st1,st0
|
||||||
|
fxch st3
|
||||||
|
fmulp st2,st0
|
||||||
|
fmulp st3,st0
|
||||||
|
faddp st2,st0
|
||||||
|
fxch st2
|
||||||
|
loop ROTATE
|
||||||
|
|
||||||
|
fld st1
|
||||||
|
db 0xdc,0xc8 ;fmul st0,st ?
|
||||||
|
fld st1
|
||||||
|
db 0xdc,0xc8 ;fmul st0,st ?
|
||||||
|
faddp st1,st0
|
||||||
|
fsqrt
|
||||||
|
|
||||||
|
fdivp st3,st0
|
||||||
|
fpatan
|
||||||
|
fimul word [esi-4]
|
||||||
|
fistp word [esi]
|
||||||
|
fimul word [esi-4]
|
||||||
|
fistp word [esi+1]
|
||||||
|
mov esi,[esi]
|
||||||
|
|
||||||
|
lea eax,[ebx+esi]
|
||||||
|
add al,ah
|
||||||
|
and al,64
|
||||||
|
mov al,-5
|
||||||
|
jz STORE_1
|
||||||
|
|
||||||
|
shl esi,2
|
||||||
|
lea eax,[ebx+esi]
|
||||||
|
sub al,ah
|
||||||
|
mov al,-16
|
||||||
|
jns STORE_1
|
||||||
|
|
||||||
|
shl esi,1
|
||||||
|
mov al,-48
|
||||||
|
|
||||||
|
STORE_1:
|
||||||
|
; add al,[ebx+esi+0x80000]
|
||||||
|
add [edi],al
|
||||||
|
inc edi
|
||||||
|
inc ebp
|
||||||
|
mov eax,[SCREEN_W]
|
||||||
|
shr eax,1 ;eax=SCREEN_W/2
|
||||||
|
cmp ebp,eax
|
||||||
|
|
||||||
|
jnz TUBEX
|
||||||
|
inc edx
|
||||||
|
mov eax,[SCREEN_H]
|
||||||
|
shr eax,1 ;eax=SCREEN_H/2
|
||||||
|
cmp edx,eax
|
||||||
|
jnz TUBEY
|
||||||
|
|
||||||
|
call display_image
|
||||||
|
|
||||||
|
pop esi
|
||||||
|
mov ecx,[SCREEN_W]
|
||||||
|
imul ecx,[SCREEN_H]
|
||||||
|
|
||||||
|
align 4
|
||||||
|
BLUR:
|
||||||
|
inc esi
|
||||||
|
sar byte [esi],2
|
||||||
|
loop BLUR
|
||||||
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
align 4
|
||||||
|
display_image:
|
||||||
|
pusha
|
||||||
|
|
||||||
|
mov esi,[PIXBUF]
|
||||||
|
mov edi,[buf2]
|
||||||
|
mov eax,[SCREEN_W]
|
||||||
|
imul eax,[SCREEN_H]
|
||||||
|
add eax,esi
|
||||||
|
align 4
|
||||||
|
newp:
|
||||||
|
movzx edx,byte [esi]
|
||||||
|
shl edx,4
|
||||||
|
|
||||||
|
mov [edi],edx
|
||||||
|
|
||||||
|
add edi,3
|
||||||
|
inc esi
|
||||||
|
|
||||||
|
cmp esi,eax
|
||||||
|
jbe newp
|
||||||
|
|
||||||
|
xor edx,edx
|
||||||
|
mov ecx,[SCREEN_W]
|
||||||
|
shl ecx,16
|
||||||
|
add ecx,[SCREEN_H]
|
||||||
|
mcall SF_PUT_IMAGE,[buf2]
|
||||||
|
|
||||||
|
popa
|
||||||
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
align 4
|
||||||
|
draw_window:
|
||||||
|
pusha
|
||||||
|
|
||||||
|
mcall SF_REDRAW, SSF_BEGIN_DRAW
|
||||||
|
mcall SF_STYLE_SETTINGS, SSF_GET_SKIN_HEIGHT
|
||||||
|
add eax,[SCREEN_H]
|
||||||
|
lea ecx,[100*65536+4+eax]
|
||||||
|
mov ebx,[SCREEN_W]
|
||||||
|
add ebx,(100 shl 16)+9
|
||||||
|
mcall SF_CREATE_WINDOW,,, 0x73000000,,title
|
||||||
|
|
||||||
|
mcall SF_THREAD_INFO,procinfo,-1
|
||||||
|
mcall SF_STYLE_SETTINGS, SSF_GET_SKIN_HEIGHT
|
||||||
|
add eax,4
|
||||||
|
sub eax,[procinfo.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,[procinfo.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_END_DRAW
|
||||||
|
popa
|
||||||
|
ret
|
||||||
|
|
||||||
|
align 4
|
||||||
|
db 41,0,0xC3,0x3C
|
||||||
|
TEXUV:
|
||||||
|
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
|
||||||
|
image_end:
|
||||||
|
PIXBUF rd 1
|
||||||
|
buf1 rd 1
|
||||||
|
buf2 rd 1
|
||||||
|
procinfo process_information
|
||||||
|
rb 1024
|
||||||
|
align 4
|
||||||
|
stacktop:
|
||||||
|
memory_end:
|
2
programs/develop/charsets/Tupfile.lua
Normal file
2
programs/develop/charsets/Tupfile.lua
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
if tup.getconfig("NO_FASM") ~= "" then return end
|
||||||
|
tup.rule("charsets.asm", "fasm %f %o " .. tup.getconfig("KPACK_CMD"), "charsets")
|
33
programs/develop/charsets/changelog.txt
Normal file
33
programs/develop/charsets/changelog.txt
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
Development history
|
||||||
|
|
||||||
|
22.10.2024 - 0.1.0
|
||||||
|
- First version, display of charpages in all KOS charsets
|
||||||
|
|
||||||
|
23.10.2024 - 0.2.0
|
||||||
|
- Fixed UTF-8 display by Doczom
|
||||||
|
- Interface adaptation for skins
|
||||||
|
- Reduced redraw
|
||||||
|
- Refactored code
|
||||||
|
|
||||||
|
27.10.2024 - 0.2.5
|
||||||
|
- Fixed version in app header
|
||||||
|
- Tweaked UI colors
|
||||||
|
- Something else???
|
||||||
|
|
||||||
|
17.01.2025 - 0.3.0
|
||||||
|
- Added button to reset charpage to 00
|
||||||
|
- Functionality to pick and preview single character
|
||||||
|
- Functionality to input characters from keyboard
|
||||||
|
- Display of ASCII and SCAN codes of characters in dec and hex format
|
||||||
|
- Tweaked UI colors
|
||||||
|
|
||||||
|
17.01.2025 - 0.3.1
|
||||||
|
- Small UI fixes
|
||||||
|
- Code refactoring
|
||||||
|
- Reformatted sources, fixed indentation
|
||||||
|
and removed non-Unicode characters
|
||||||
|
|
||||||
|
07.03.2025 - 0.3.2
|
||||||
|
- Renamed to Charsets Viewer/Charsets
|
||||||
|
- Symbol highlight UI tweaks
|
||||||
|
- Fixed rolled up bug
|
@@ -1,3 +1,8 @@
|
|||||||
|
; SPDX-License-Identifier: GPL-2.0-only
|
||||||
|
; SPDX-FileCopyrightText: 2024-2025 KolibriOS Team
|
||||||
|
|
||||||
|
; ================================================================
|
||||||
|
|
||||||
format binary as ""
|
format binary as ""
|
||||||
use32
|
use32
|
||||||
org 0
|
org 0
|
||||||
@@ -170,7 +175,8 @@ draw_window:
|
|||||||
mcall 48, 3, window_colors, 40
|
mcall 48, 3, window_colors, 40
|
||||||
|
|
||||||
mcall , 4
|
mcall , 4
|
||||||
push eax
|
add eax, 3
|
||||||
|
mov [win_head], eax
|
||||||
|
|
||||||
mov eax, 0
|
mov eax, 0
|
||||||
mov ebx, 100 * 65536 + 685
|
mov ebx, 100 * 65536 + 685
|
||||||
@@ -180,15 +186,24 @@ draw_window:
|
|||||||
mov edi, title
|
mov edi, title
|
||||||
mcall
|
mcall
|
||||||
|
|
||||||
pop esi
|
; Don't draw rolled up or rolled down window
|
||||||
add esi, 495
|
mcall 9, proc_info, -1
|
||||||
mcall 67, -1, -1, -1,
|
mov eax, [proc_info + 70]
|
||||||
|
mov [win_stat], eax
|
||||||
|
test [win_stat], 100b
|
||||||
|
jnz .draw_end
|
||||||
|
|
||||||
|
; Draw all app content
|
||||||
|
add [win_head], 492
|
||||||
|
|
||||||
call draw_base
|
call draw_base
|
||||||
call draw_update
|
call draw_update
|
||||||
call draw_toggle
|
call draw_toggle
|
||||||
|
|
||||||
mcall 12, 2
|
.draw_end:
|
||||||
|
mov esi, [win_head]
|
||||||
|
mcall 67, -1, -1, -1,
|
||||||
|
mcall 12, 2
|
||||||
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@@ -399,9 +414,21 @@ draw_update:
|
|||||||
mov al, 0x01
|
mov al, 0x01
|
||||||
mov ecx, eax
|
mov ecx, eax
|
||||||
push ecx
|
push ecx
|
||||||
mcall 13, 65536 * 34 + 384, , [window_colors.work_button]
|
|
||||||
add ecx, 65536 * 23
|
mov eax, 13
|
||||||
|
mov ebx, 65536 * 34 + 384
|
||||||
|
mov edx, [window_colors.work_button]
|
||||||
|
|
||||||
|
;skip lines aligned to table borders
|
||||||
|
cmp ecx, 65536 * 34 + 65536
|
||||||
|
jle .hl_next_hr
|
||||||
mcall
|
mcall
|
||||||
|
.hl_next_hr:
|
||||||
|
add ecx, 65536 * 23
|
||||||
|
cmp ecx, 65536 * 417
|
||||||
|
jge .hl_end_hr
|
||||||
|
mcall
|
||||||
|
.hl_end_hr:
|
||||||
|
|
||||||
mov al, [char]
|
mov al, [char]
|
||||||
and al, 0x0F
|
and al, 0x0F
|
||||||
@@ -411,15 +438,28 @@ draw_update:
|
|||||||
shl eax, 16
|
shl eax, 16
|
||||||
mov al, 0x01
|
mov al, 0x01
|
||||||
mov ebx, eax
|
mov ebx, eax
|
||||||
mcall 13, , 65536 * 34 + 384, [window_colors.work_button]
|
|
||||||
add ebx, 65536 * 23
|
mov eax, 13
|
||||||
|
mov ecx, 65536 * 34 + 384
|
||||||
|
mov edx, [window_colors.work_button]
|
||||||
|
|
||||||
|
;skip lines aligned to table borders
|
||||||
|
cmp ebx, 65536 * 34 + 65536
|
||||||
|
jle .hl_next_vr
|
||||||
mcall
|
mcall
|
||||||
|
.hl_next_vr:
|
||||||
|
add ebx, 65536 * 23
|
||||||
|
cmp ebx, 65536 * 417
|
||||||
|
jge .hl_end_vr
|
||||||
|
mcall
|
||||||
|
.hl_end_vr:
|
||||||
|
|
||||||
pop ecx
|
pop ecx
|
||||||
add ecx, 23
|
add ecx, 23
|
||||||
sub ebx, 65535 * 23
|
sub ebx, 65535 * 23
|
||||||
mcall
|
mcall
|
||||||
|
|
||||||
|
; redraw active symbol
|
||||||
shr ecx, 16
|
shr ecx, 16
|
||||||
mov bx, cx
|
mov bx, cx
|
||||||
add ebx, 65536 * 8 + 5
|
add ebx, 65536 * 8 + 5
|
||||||
@@ -574,7 +614,7 @@ logic_utf16to8:
|
|||||||
|
|
||||||
; ================================================================
|
; ================================================================
|
||||||
|
|
||||||
title db "Charset Checker 0.3.1", 0
|
title db "Charsets Viewer 0.3.2", 0
|
||||||
|
|
||||||
lb_cp6x9 db "CP866 6x9 ", 0
|
lb_cp6x9 db "CP866 6x9 ", 0
|
||||||
lb_cp8x16 db "CP866 8x16 ", 0
|
lb_cp8x16 db "CP866 8x16 ", 0
|
||||||
@@ -609,7 +649,11 @@ char_ascii dw 0x0000, 0
|
|||||||
char_scan dw 0x0000, 0
|
char_scan dw 0x0000, 0
|
||||||
char_utf dd 0x00000000, 0
|
char_utf dd 0x00000000, 0
|
||||||
|
|
||||||
window_colors system_colors
|
win_stat rd 1
|
||||||
|
win_head rd 1
|
||||||
|
|
||||||
|
window_colors system_colors
|
||||||
|
proc_info process_information
|
||||||
|
|
||||||
; ================================================================
|
; ================================================================
|
||||||
|
|
@@ -1,5 +1,5 @@
|
|||||||
; <EFBFBD>ᯮ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥫<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<EFBFBD> <EFBFBD><EFBFBD><EFBFBD> console.inc - <EFBFBD><EFBFBD><EFBFBD>ᠭ<EFBFBD><EFBFBD> scrollbar
|
; Helper file for console.inc - scrollbar definition
|
||||||
; <EFBFBD><EFBFBD><EFBFBD>⨪<EFBFBD><EFBFBD>쭠<EFBFBD> <EFBFBD>ப<EFBFBD><EFBFBD>⪠
|
; Vertical scrolling
|
||||||
virtual at 0
|
virtual at 0
|
||||||
file 'conscrlv.bmp', 36h
|
file 'conscrlv.bmp', 36h
|
||||||
; sanity check
|
; sanity check
|
||||||
@@ -28,7 +28,7 @@ if con.vscroll_btn_height*4 + con.vscroll_bgr_height*2 \
|
|||||||
error 'conscrlv.bmp: invalid dimensions!'
|
error 'conscrlv.bmp: invalid dimensions!'
|
||||||
end if
|
end if
|
||||||
|
|
||||||
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD>㦠<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> BMP, <EFBFBD><EFBFBD> 室<EFBFBD> <EFBFBD>८<EFBFBD>ࠧ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> 7-<EFBFBD> <EFBFBD>㭪樨
|
; Load BMP data, converting it into data for sysfn 7 on the fly
|
||||||
con.vscroll:
|
con.vscroll:
|
||||||
repeat con.vscroll_height
|
repeat con.vscroll_height
|
||||||
file 'conscrlv.bmp':36h + ((con.vscroll_width*3+3) and not 3)*(con.vscroll_height - %),\
|
file 'conscrlv.bmp':36h + ((con.vscroll_width*3+3) and not 3)*(con.vscroll_height - %),\
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
; <EFBFBD>㭪樨 ࠡ<><E0A0A1><EFBFBD> <20> <20><><EFBFBD>᮫<EFBFBD><E1AEAB> <20><><EFBFBD> <20>ணࠬ<E0AEA3> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
; SPDX-License-Identifier: GPL-2.0
|
||||||
|
; Functions for interaction with the console for KolibriOS programs
|
||||||
; diamond, 2006-2008
|
; diamond, 2006-2008
|
||||||
|
; Copyright (C) 2006-2025 KolibriOS team
|
||||||
|
|
||||||
format MS COFF
|
format MS COFF
|
||||||
|
|
||||||
@@ -56,7 +57,7 @@ START:
|
|||||||
or eax, -1
|
or eax, -1
|
||||||
ret 4
|
ret 4
|
||||||
|
|
||||||
; <EFBFBD><EFBFBD><EFBFBD>樠<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>᮫<EFBFBD>
|
; Console initialization
|
||||||
; void __stdcall con_init(dword wnd_width, dword wnd_height,
|
; void __stdcall con_init(dword wnd_width, dword wnd_height,
|
||||||
; dword scr_width, dword scr_height, const char* title);
|
; dword scr_width, dword scr_height, const char* title);
|
||||||
|
|
||||||
@@ -271,13 +272,13 @@ con_write_length:
|
|||||||
pop esi ebx
|
pop esi ebx
|
||||||
ret 8
|
ret 8
|
||||||
|
|
||||||
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᨬ<><E1A8AC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>
|
; Each character is classified as one of the following
|
||||||
con.printfc.normal = 0 ; <EFBFBD><EFBFBD>ଠ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᨬ<><E1A8AC><EFBFBD>
|
con.printfc.normal = 0 ; normal character
|
||||||
con.printfc.percent = 1 ; '%'
|
con.printfc.percent = 1 ; '%'
|
||||||
con.printfc.dot = 2 ; '.'
|
con.printfc.dot = 2 ; '.'
|
||||||
con.printfc.asterisk = 3 ; '*'
|
con.printfc.asterisk = 3 ; '*'
|
||||||
con.printfc.zero = 4 ; '0'
|
con.printfc.zero = 4 ; '0'
|
||||||
con.printfc.digit = 5 ; <EFBFBD><EFBFBD><EFBFBD>㫥<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
con.printfc.digit = 5 ; non-null digit
|
||||||
con.printfc.plus = 6 ; '+'
|
con.printfc.plus = 6 ; '+'
|
||||||
con.printfc.minus = 7 ; '-'
|
con.printfc.minus = 7 ; '-'
|
||||||
con.printfc.sharp = 8 ; '#'
|
con.printfc.sharp = 8 ; '#'
|
||||||
@@ -376,24 +377,24 @@ con_printf:
|
|||||||
jmp .normal
|
jmp .normal
|
||||||
.spec_begin:
|
.spec_begin:
|
||||||
xor ebx, ebx
|
xor ebx, ebx
|
||||||
; bl = ⨯ <20><><EFBFBD><EFBFBD>樨:
|
; bl = position type:
|
||||||
; 0 = <EFBFBD><EFBFBD>砫<EFBFBD>
|
; 0 = start
|
||||||
; 1 = <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⠭ <20><><EFBFBD><EFBFBD>騩 0 <20> ᯥ<><E1AFA5>䨪<EFBFBD>樨 <20><>ଠ<EFBFBD><E0ACA0>
|
; 1 = read leading 0 in format specification
|
||||||
; 2 = <EFBFBD><EFBFBD>⠥<EFBFBD> <20><><EFBFBD><EFBFBD> <20><>ਭ<EFBFBD>
|
; 2 = read width field
|
||||||
; 3 = <EFBFBD><EFBFBD>⠥<EFBFBD> <20><><EFBFBD><EFBFBD> <20><>筮<EFBFBD><E7ADAE><EFBFBD>
|
; 3 = read precision field
|
||||||
; 4 = <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⠭<EFBFBD> <20><><EFBFBD><EFBFBD> ࠧ<><E0A0A7><EFBFBD><EFBFBD> <20><><EFBFBD>㬥<EFBFBD><E3ACA5><EFBFBD>
|
; 4 = read argument size field
|
||||||
; 5 = <EFBFBD><EFBFBD>⠥<EFBFBD> <20><><EFBFBD><EFBFBD> ⨯<>
|
; 5 = read type field
|
||||||
; bh = 䫠<EFBFBD><EFBFBD>:
|
; bh = flags:
|
||||||
; 1 = 䫠<EFBFBD> '#', <EFBFBD>뢮<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0/0x/0X
|
; 1 = flag '#', output 0/0x/0X
|
||||||
; 2 = 䫠<EFBFBD> '-', <EFBFBD><EFBFBD>ࠢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
; 2 = flag '-', align left
|
||||||
; 4 = 䫠<EFBFBD> '0', <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ﬨ
|
; 4 = flag '0', zero padding
|
||||||
; 8 = 䫠<EFBFBD> 'h', <EFBFBD><EFBFBD><EFBFBD><EFBFBD>⪨<EFBFBD> <20><><EFBFBD>㬥<EFBFBD><E3ACA5>
|
; 8 = flag 'h', short argument
|
||||||
push -1
|
push -1
|
||||||
; dword [esp+8] = precision
|
; dword [esp+8] = precision
|
||||||
push -1
|
push -1
|
||||||
; dword [esp+4] = width
|
; dword [esp+4] = width
|
||||||
push 0
|
push 0
|
||||||
; byte [esp] = 䫠<EFBFBD> 0/'+'/' '
|
; byte [esp] = flag 0/'+'/' '
|
||||||
.spec:
|
.spec:
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
lodsb
|
lodsb
|
||||||
@@ -529,7 +530,7 @@ con_printf:
|
|||||||
@@:
|
@@:
|
||||||
push edx
|
push edx
|
||||||
xor edx, edx
|
xor edx, edx
|
||||||
; <EFBFBD><EFBFBD> <20> eax, <20>᭮<EFBFBD><E1ADAE><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>⥬<EFBFBD> <20><><EFBFBD><EFBFBD><E1ABA5><EFBFBD> <20> ecx
|
; number in eax, radix in ecx
|
||||||
@@:
|
@@:
|
||||||
cmp dword [esp+16+8], 0
|
cmp dword [esp+16+8], 0
|
||||||
jnz .print_num
|
jnz .print_num
|
||||||
@@ -1777,10 +1778,10 @@ con.data2image:
|
|||||||
mov al, [esi+1]
|
mov al, [esi+1]
|
||||||
push eax
|
push eax
|
||||||
and al, 0xF
|
and al, 0xF
|
||||||
mov ebx, eax ; 梥<EFBFBD> ⥪<><E2A5AA><EFBFBD>
|
mov ebx, eax ; text color
|
||||||
pop eax
|
pop eax
|
||||||
shr al, 4
|
shr al, 4
|
||||||
mov ebp, eax ; 梥<EFBFBD> 䮭<>
|
mov ebp, eax ; background color
|
||||||
sub ebx, ebp
|
sub ebx, ebp
|
||||||
lodsb
|
lodsb
|
||||||
inc esi
|
inc esi
|
||||||
@@ -2188,7 +2189,7 @@ con_gets2:
|
|||||||
sub ebx, 1
|
sub ebx, 1
|
||||||
jle .ret
|
jle .ret
|
||||||
mov byte [esi], 0
|
mov byte [esi], 0
|
||||||
xor ecx, ecx ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㦥 <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD>
|
xor ecx, ecx ; length of the already entered string
|
||||||
call con.get_data_ptr
|
call con.get_data_ptr
|
||||||
.loop:
|
.loop:
|
||||||
call con_getch2
|
call con_getch2
|
||||||
@@ -2596,15 +2597,15 @@ con.wake:
|
|||||||
popad
|
popad
|
||||||
ret
|
ret
|
||||||
|
|
||||||
; <EFBFBD><EFBFBD>⮪ <20><><EFBFBD><EFBFBD> <20><><EFBFBD>᮫<EFBFBD>. <20><>ࠡ<EFBFBD><E0A0A1>뢠<EFBFBD><EBA2A0> <20><><EFBFBD><EFBFBD> <20> <20>뢮<EFBFBD>.
|
; Console window thread. Handles input and output.
|
||||||
con.thread:
|
con.thread:
|
||||||
; <EFBFBD><EFBFBD>⮪ ॠ<><E0A5A0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> IPC, <20><><EFBFBD><EFBFBD> <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⮫쪮 <20><><EFBFBD> ⮣<>, <20>⮡<EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20>뫮 "ࠧ<>㤨<EFBFBD><E3A4A8>"
|
; The thread responds to IPC, which is used only so that it can be "waken up"
|
||||||
push 40
|
push 40
|
||||||
pop eax
|
pop eax
|
||||||
push 0x80000067 ; program dont getting events mouse, when it dont active
|
push 0x80000067 ; program dont getting events mouse, when it dont active
|
||||||
pop ebx
|
pop ebx
|
||||||
int 0x40
|
int 0x40
|
||||||
xor ebx,ebx ;clear ebx
|
xor ebx,ebx ; clear ebx
|
||||||
mov al, 60
|
mov al, 60
|
||||||
mov bl, 1
|
mov bl, 1
|
||||||
mov ecx, con.ipc_buf
|
mov ecx, con.ipc_buf
|
||||||
@@ -3212,7 +3213,7 @@ con.draw_image:
|
|||||||
@@:
|
@@:
|
||||||
int 0x40
|
int 0x40
|
||||||
push edx
|
push edx
|
||||||
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塞 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>㭪<EFBFBD>
|
; Calculate the height of the slider
|
||||||
mov ax, dx
|
mov ax, dx
|
||||||
sub eax, con.vscroll_btn_height
|
sub eax, con.vscroll_btn_height
|
||||||
mov ecx, eax
|
mov ecx, eax
|
||||||
@@ -3222,7 +3223,7 @@ con.draw_image:
|
|||||||
jae @f
|
jae @f
|
||||||
mov al, 5
|
mov al, 5
|
||||||
@@:
|
@@:
|
||||||
; eax = <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>㭪<EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塞 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>㭪<EFBFBD>
|
; eax = slider height. Calculate the slider position
|
||||||
mov [con.vscrollbar_size], eax
|
mov [con.vscrollbar_size], eax
|
||||||
xchg eax, ecx
|
xchg eax, ecx
|
||||||
sub eax, ecx
|
sub eax, ecx
|
||||||
@@ -3232,7 +3233,7 @@ con.draw_image:
|
|||||||
div ebx
|
div ebx
|
||||||
pop edx
|
pop edx
|
||||||
push edx
|
push edx
|
||||||
; ecx = <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>㭪<EFBFBD>, eax = <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
; ecx = slider height, eax = position
|
||||||
add eax, con.vscroll_btn_height
|
add eax, con.vscroll_btn_height
|
||||||
mov [con.vscrollbar_pos], eax
|
mov [con.vscrollbar_pos], eax
|
||||||
mov ebx, con.vscroll_bgr2
|
mov ebx, con.vscroll_bgr2
|
||||||
@@ -3331,8 +3332,8 @@ con.extended_numlock:
|
|||||||
|
|
||||||
cursor_esc dd 27 + ('[' shl 8)
|
cursor_esc dd 27 + ('[' shl 8)
|
||||||
|
|
||||||
; <EFBFBD> ⥪<>饩 ॠ<><E0A5A0><EFBFBD><EFBFBD>樨 <20><><EFBFBD>祭<EFBFBD><E7A5AD> <20><> 㬮<>砭<EFBFBD><E7A0AD> ⠪<><E2A0AA><EFBFBD>.
|
; In the current implementation, the default values are:
|
||||||
; <EFBFBD> <20><><EFBFBD><EFBFBD>饬 <20><><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>뢠<EFBFBD><EBA2A0><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>ࠬ<EFBFBD><E0A0AC><EFBFBD><EFBFBD> <20><> ini-䠩<><E4A0A9> console.ini.
|
; In the future, they may be read as parameters from the console.ini ini file.
|
||||||
con.def_wnd_width dd 80
|
con.def_wnd_width dd 80
|
||||||
con.def_wnd_height dd 25
|
con.def_wnd_height dd 25
|
||||||
con.def_scr_width dd 80
|
con.def_scr_width dd 80
|
||||||
|
@@ -1,91 +1,91 @@
|
|||||||
console.obj <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
console.obj экспортирует следующие функции:
|
||||||
|
|
||||||
typedef unsigned long dword; /* 32-<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> */
|
typedef unsigned long dword; /* 32-битное беззнаковое целое */
|
||||||
typedef unsigned short word; /* 16-<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> */
|
typedef unsigned short word; /* 16-битное беззнаковое целое */
|
||||||
|
|
||||||
void __stdcall con_init(dword wnd_width, dword wnd_height,
|
void __stdcall con_init(dword wnd_width, dword wnd_height,
|
||||||
dword scr_width, dword scr_height, const char* title);
|
dword scr_width, dword scr_height, const char* title);
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
Инициализация консоли. Вызывается один раз в начале программы.
|
||||||
wnd_width, wnd_height - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
wnd_width, wnd_height - высота и ширина (в символах) видимой в окне консоли
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
области;
|
||||||
scr_width, scr_height - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
scr_width, scr_height - высота и ширина (в символах) всей консоли;
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 4 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> -1 (=0xFFFFFFFF)
|
любые из первых 4 параметров могут быть установлены в -1 (=0xFFFFFFFF)
|
||||||
- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
- использовать значения по умолчанию;
|
||||||
title - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
title - заголовок окна консоли.
|
||||||
|
|
||||||
void __stdcall con_exit(bool bCloseWindow);
|
void __stdcall con_exit(bool bCloseWindow);
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> bCloseWindow
|
Вызывается при завершении программы. Если (байтовый) параметр bCloseWindow
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20><><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> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>, <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> " [Finished]".
|
пожелает закрыть его, при этом к заголовку добавляется строка " [Finished]".
|
||||||
|
|
||||||
void __stdcall con_set_title(const char* title);
|
void __stdcall con_set_title(const char* title);
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
Устанавливает новый заголовок окна консоли.
|
||||||
|
|
||||||
void __stdcall con_write_asciiz(const char* string);
|
void __stdcall con_write_asciiz(const char* string);
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ASCIIZ-<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
Выводит ASCIIZ-строку в консоль в текущую позицию, продвигает текущую позицию.
|
||||||
|
|
||||||
void __stdcall con_write_string(const char* string, dword length);
|
void __stdcall con_write_string(const char* string, dword length);
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> con_write_asciiz, <EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> length <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
Аналогично con_write_asciiz, но выводит ровно length символов.
|
||||||
|
|
||||||
int __cdecl con_printf(const char* format, ...)
|
int __cdecl con_printf(const char* format, ...)
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> printf <EFBFBD><EFBFBD> ANSI C.
|
Стандартная printf из ANSI C.
|
||||||
|
|
||||||
dword __stdcall con_get_flags(void);
|
dword __stdcall con_get_flags(void);
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
Получает значение флагов вывода.
|
||||||
dword __stdcall con_set_flags(dword new_flags);
|
dword __stdcall con_set_flags(dword new_flags);
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
Устанавливает значение флагов вывода. Возвращает старое значение.
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>):
|
Флаги (битовая маска):
|
||||||
/* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* цвет текста */
|
||||||
#define CON_COLOR_BLUE 1
|
#define CON_COLOR_BLUE 1
|
||||||
#define CON_COLOR_GREEN 2
|
#define CON_COLOR_GREEN 2
|
||||||
#define CON_COLOR_RED 4
|
#define CON_COLOR_RED 4
|
||||||
#define CON_COLOR_BRIGHT 8
|
#define CON_COLOR_BRIGHT 8
|
||||||
/* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> */
|
/* цвет фона */
|
||||||
#define CON_BGR_BLUE 0x10
|
#define CON_BGR_BLUE 0x10
|
||||||
#define CON_BGR_GREEN 0x20
|
#define CON_BGR_GREEN 0x20
|
||||||
#define CON_BGR_RED 0x40
|
#define CON_BGR_RED 0x40
|
||||||
#define CON_BGR_BRIGHT 0x80
|
#define CON_BGR_BRIGHT 0x80
|
||||||
/* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* управление выводом */
|
||||||
#define CON_IGNORE_SPECIALS 0x100
|
#define CON_IGNORE_SPECIALS 0x100
|
||||||
/* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
/* Если флаг сброшен, функция интерпретирует специальные символы:
|
||||||
10 ('\n') - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
10 ('\n') - перевод в начало следующей строки
|
||||||
13 ('\r') - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
13 ('\r') - перевод в начало текущей строки
|
||||||
8 ('\b') - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>)
|
8 ('\b') - забой (на символ назад)
|
||||||
9 ('\t') - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
9 ('\t') - табуляция
|
||||||
27 ('\033'='\x1B') - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Esc-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
27 ('\033'='\x1B') - начало Esc-последовательности;
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. */
|
иначе выводит их как обычные символы. */
|
||||||
/* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Esc-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
/* Поддерживаемые Esc-последовательности:
|
||||||
Esc[<number1>;<number2>;<number3>m - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
Esc[<number1>;<number2>;<number3>m - выбор атрибутов символов:
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
можно указывать один, два или три кода в любом порядке;
|
||||||
0 = <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>)
|
0 = нормальное изображение (белые символы на чёрном фоне)
|
||||||
1 = <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
1 = выделение яркостью
|
||||||
5 = <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
|
5 = яркий фон
|
||||||
7 = <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>)
|
7 = реверсное изображение (чёрные символы на белом фоне)
|
||||||
30 = <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
30 = чёрные символы
|
||||||
31 = <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
31 = красные символы
|
||||||
32 = <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
32 = зелёные символы
|
||||||
33 = <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
33 = жёлтые символы
|
||||||
34 = <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
34 = синие символы
|
||||||
35 = <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
35 = фиолетовые символы
|
||||||
36 = <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
36 = бирюзовые символы
|
||||||
37 = <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
37 = белые символы
|
||||||
40 = <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
|
40 = чёрный фон
|
||||||
41 = <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
|
41 = красный фон
|
||||||
42 = <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
|
42 = зелёный фон
|
||||||
43 = <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
|
43 = жёлтый фон
|
||||||
44 = <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
|
44 = синий фон
|
||||||
45 = <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
|
45 = фиолетовый фон
|
||||||
46 = <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
|
46 = бирюзовый фон
|
||||||
47 = <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
|
47 = белый фон
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 5 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
Следующие последовательности появились в версии 5 библиотеки:
|
||||||
Esc[<number>A - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <number> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
Esc[<number>A - переместить курсор на <number> строк вверх
|
||||||
Esc[<number>B - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <number> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
Esc[<number>B - переместить курсор на <number> строк вниз
|
||||||
Esc[<number>C - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <number> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
Esc[<number>C - переместить курсор на <number> позиций вправо
|
||||||
Esc[<number>D - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <number> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
Esc[<number>D - переместить курсор на <number> позиций влево
|
||||||
Esc[<number1>;<number2>H = Esc[<number1>;<number2>f -
|
Esc[<number1>;<number2>H = Esc[<number1>;<number2>f -
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <number1>,<number2>
|
установить курсор в позицию с координатами <number1>,<number2>
|
||||||
Esc[2J - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
Esc[2J - очистить экран, переместить курсор в левый верхний угол
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 9 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
Следующие последовательности появились в версии 9 библиотеки:
|
||||||
Esc[J or Esc[0J - Erase everything below cursor
|
Esc[J or Esc[0J - Erase everything below cursor
|
||||||
Esc[1J - Erase everything above cursor
|
Esc[1J - Erase everything above cursor
|
||||||
Esc[K - Erase in line
|
Esc[K - Erase in line
|
||||||
@@ -107,83 +107,83 @@ dword __stdcall con_set_flags(dword new_flags);
|
|||||||
Esc]2<string>ST/BEL - Implemented identical as Esc]0.
|
Esc]2<string>ST/BEL - Implemented identical as Esc]0.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
/* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 6 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
/* сигнал о закрытии окна консоли; появился в версии 6 библиотеки;
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> con_set_flags */
|
флаг игнорируется функцией con_set_flags */
|
||||||
#define CON_WINDOW_CLOSED 0x200
|
#define CON_WINDOW_CLOSED 0x200
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> = 7.
|
Значение по умолчанию для флагов = 7.
|
||||||
|
|
||||||
int __stdcall con_get_font_height(void);
|
int __stdcall con_get_font_height(void);
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
Возвращает значение высоты шрифта.
|
||||||
|
|
||||||
int __stdcall con_get_cursor_height(void);
|
int __stdcall con_get_cursor_height(void);
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
Получает значение высоты курсора.
|
||||||
int __stdcall con_set_cursor_height(int new_height);
|
int __stdcall con_set_cursor_height(int new_height);
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
Устанавливает значение высоты курсора. Возвращает старое значение.
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><> 0 <EFBFBD><EFBFBD> font_height-1)
|
Попытка установить значение вне корректного интервала (от 0 до font_height-1)
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
игнорируется.
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0 <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
Курсор высоты 0 не отображается на экране.
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - 15% <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
Значение высоты по умолчанию - 15% от высоты шрифта.
|
||||||
|
|
||||||
int __stdcall con_getch(void);
|
int __stdcall con_getch(void);
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
Считывает один символ с клавиатуры.
|
||||||
<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ASCII-<2D><><EFBFBD>. <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
Для обычных символов возвращается ASCII-код. Для расширенных символов
|
||||||
(<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, Fx <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0,
|
(например, Fx и стрелочек) первый вызов функции возвращает 0,
|
||||||
<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> DOS-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>).
|
а повторный вызов возвращает расширенный код (подобно DOS-функциям ввода).
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 7 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
Начиная с версии 7 библиотеки, после закрытия окна консоли возвращается
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0.
|
значение 0.
|
||||||
|
|
||||||
word __stdcall con_getch2(void);
|
word __stdcall con_getch2(void);
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ASCII-<2D><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
Считывает один символ с клавиатуры. Младший байт содержит ASCII-код клавиши
|
||||||
(0 <EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>), <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
|
(0 для расширенных символов), старший - расширенный код
|
||||||
(<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> BIOS-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>).
|
(подобно BIOS-функциям ввода).
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 7 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
Начиная с версии 7 библиотеки, после закрытия окна консоли возвращается
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0.
|
значение 0.
|
||||||
|
|
||||||
int __stdcall con_kbhit(void);
|
int __stdcall con_kbhit(void);
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1, <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>-<2D><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, 0 <20><><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
Возвращает 1, если какая-то клавиша была нажата, 0 иначе. Для считывания
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> con_getch <EFBFBD> con_getch2.
|
нажатой клавиши предназначены функции con_getch и con_getch2.
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 6 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1.
|
Начиная с версии 6 библиотеки, после закрытия окна консоли всегда возвращает 1.
|
||||||
|
|
||||||
char* __stdcall con_gets(char* str, int n);
|
char* __stdcall con_gets(char* str, int n);
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
Считывает строку с клавиатуры. Ввод прерывается при поступлении символа
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> n-1 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD>
|
новой строки, а также по прочтении n-1 символа (в зависимости от того, что
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>). <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>
|
произойдёт раньше). В первом случае символ новой строки также записывается в
|
||||||
str. <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
str. Считанная строка дополняется нулевым символом.
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 6 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
Начиная с версии 6 библиотеки, функция возвращает указатель на введённую
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> NULL, <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
строку при успешном чтении и NULL, если окно консоли было закрыто. До версии
|
||||||
6 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
6 возвращаемое значение было неопределено.
|
||||||
|
|
||||||
typedef int (__stdcall * con_gets2_callback)(int keycode, char** pstr, int* pn, int* ppos);
|
typedef int (__stdcall * con_gets2_callback)(int keycode, char** pstr, int* pn, int* ppos);
|
||||||
char* __stdcall con_gets2(con_gets2_callback callback, char* str, int n);
|
char* __stdcall con_gets2(con_gets2_callback callback, char* str, int n);
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 4 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
Функция появилась в версии 4 библиотеки.
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> con_gets <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
Полностью аналогична con_gets за исключением того, что когда пользователь
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> callback-<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
нажимает нераспознанную клавишу, вызывается указанная callback-процедура
|
||||||
(<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> up/down <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> tab <EFBFBD><EFBFBD><EFBFBD>
|
(которая может, например, обрабатывать up/down для истории ввода и tab для
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>). <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
|
автодополнения). Процедуре передаётся код клавиши и три указателя - на строку,
|
||||||
<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
на лимит и на текущую позицию в строке. Процедура может менять содержимое
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
|
строки и может менять саму строку (например, перераспределить память для
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>), <20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><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><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: 0=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>; 1=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
Возвращаемое значение: 0=строка не менялась; 1=строка изменилась, необходимо
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>; 2=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
удалить старую и вывести новую; 2=строка изменилась, необходимо её вывести;
|
||||||
3=<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
3=немедленно выйти из функции.
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 6 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
Начиная с версии 6 библиотеки, функция возвращает указатель на введённую
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> NULL, <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
строку при успешном чтении и NULL, если окно консоли было закрыто. До версии
|
||||||
6 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
6 возвращаемое значение было неопределено.
|
||||||
|
|
||||||
void __stdcall con_cls();
|
void __stdcall con_cls();
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 5 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
Функция появилась в версии 5 библиотеки.
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.
|
Очищает экран и переводит курсор в левый верхний угол.
|
||||||
|
|
||||||
void __stdcall con_get_cursor_pos(int* px, int* py);
|
void __stdcall con_get_cursor_pos(int* px, int* py);
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 5 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
Функция появилась в версии 5 библиотеки.
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> *px <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> x, <EFBFBD> *py - <EFBFBD><EFBFBD> <20><><EFBFBD> y.
|
Записывает в *px текущую координату курсора по оси x, в *py - по оси y.
|
||||||
|
|
||||||
void __stdcall con_set_cursor_pos(int x, int y);
|
void __stdcall con_set_cursor_pos(int x, int y);
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 5 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
Функция появилась в версии 5 библиотеки.
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>-<2D><> <20><>
|
Устанавливает курсор в позицию с указанными координатами. Если какой-то из
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><> 0 <EFBFBD><EFBFBD> scr_width-1
|
параметров выходит за пределы соответствующего диапазона (от 0 до scr_width-1
|
||||||
<EFBFBD><EFBFBD><EFBFBD> x, <EFBFBD><EFBFBD> 0 <EFBFBD><EFBFBD> scr_height-1 <EFBFBD><EFBFBD><EFBFBD> y, scr_width <EFBFBD> scr_height <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
|
для x, от 0 до scr_height-1 для y, scr_width и scr_height были заданы при
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> con_init), <EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
вызове con_init), то соответствующая координата курсора не меняется.
|
||||||
|
|
||||||
int __stdcall con_get_input(char* buf, int buflen);
|
int __stdcall con_get_input(char* buf, int buflen);
|
||||||
Read as many input events as are available and fit in the receive buffer.
|
Read as many input events as are available and fit in the receive buffer.
|
||||||
|
@@ -59,7 +59,7 @@ static const unsigned char cp866_page00[24] = {
|
|||||||
0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, /* 0xb0-0xb7 */
|
0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, /* 0xb0-0xb7 */
|
||||||
};
|
};
|
||||||
static const unsigned char cp866_page04[96] = {
|
static const unsigned char cp866_page04[96] = {
|
||||||
0x00, 0xf0, 0x00, 0x00, 0xf2, 0x00, 0x00, 0xf4, /* 0x00-0x07 */
|
0x00, 0xf0, 0x00, 0x00, 0xf2, 0x00, /*0x00*/ 0x49, 0xf4, /* 0x00-0x07 */ // Fix BE and UK 'I'
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x00, /* 0x08-0x0f */
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x00, /* 0x08-0x0f */
|
||||||
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x10-0x17 */
|
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x10-0x17 */
|
||||||
0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x18-0x1f */
|
0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x18-0x1f */
|
||||||
@@ -69,7 +69,7 @@ static const unsigned char cp866_page04[96] = {
|
|||||||
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0x38-0x3f */
|
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0x38-0x3f */
|
||||||
0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0x40-0x47 */
|
0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0x40-0x47 */
|
||||||
0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0x48-0x4f */
|
0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0x48-0x4f */
|
||||||
0x00, 0xf1, 0x00, 0x00, 0xf3, 0x00, 0x00, 0xf5, /* 0x50-0x57 */
|
0x00, 0xf1, 0x00, 0x00, 0xf3, 0x00, /*0x00*/ 0x69, 0xf5, /* 0x50-0x57 */ // Fix BE and UK 'i'
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, 0x00, /* 0x58-0x5f */
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, 0x00, /* 0x58-0x5f */
|
||||||
};
|
};
|
||||||
static const unsigned char cp866_page22[8] = {
|
static const unsigned char cp866_page22[8] = {
|
||||||
|
@@ -100,5 +100,4 @@ compile_gcc(MBEDTLS_SRC);
|
|||||||
table.insert(OBJS,"mbedtls_export.o");
|
table.insert(OBJS,"mbedtls_export.o");
|
||||||
table.insert(OBJS,"mbedtls_init.o");
|
table.insert(OBJS,"mbedtls_init.o");
|
||||||
|
|
||||||
tup.rule(OBJS, "clink -o %o %f" .. " && kos32-strip %o --strip-unneeded " .. tup.getconfig("KPACK_CMD"), "mbedtls.obj");
|
tup.rule(OBJS, "clink -o %o %f" .. " && strip %o --strip-unneeded " .. tup.getconfig("KPACK_CMD"), "mbedtls.obj");
|
||||||
|
|
||||||
|
@@ -1,2 +1,4 @@
|
|||||||
if tup.getconfig("NO_NASM") ~= "" then return end
|
if tup.getconfig("NO_FASM") ~= "" then return end
|
||||||
tup.rule("mstate.asm", "nasm -t -f bin -o %o %f " .. tup.getconfig("KPACK_CMD"), "mstate")
|
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR")
|
||||||
|
tup.include(HELPERDIR .. "/use_fasm.lua")
|
||||||
|
tup.rule("mstate.asm", FASM .. " -dlang=" .. tup.getconfig("LANG") .. " %f %o " .. tup.getconfig("KPACK_CMD"), "mstate")
|
||||||
|
3
programs/develop/mstate/build.bat
Normal file
3
programs/develop/mstate/build.bat
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
@fasm.exe -m 16384 mstate.asm mstate.kex
|
||||||
|
@kpack mstate.kex
|
||||||
|
pause
|
@@ -1 +0,0 @@
|
|||||||
nasm -f bin mstate.asm -o mstate
|
|
@@ -1,246 +1,227 @@
|
|||||||
; This program shows state of mouse buttons ;
|
; SPDX-License-Identifier: GPL-2.0-only
|
||||||
; to compile: nasm -f bin mstate.asm -o mstate ;
|
; SPDX-FileCopyrightText: 2024 KolibriOS-NG Team
|
||||||
ORG 0
|
|
||||||
BITS 32
|
format binary as ""
|
||||||
; ---------------------------------------------------------------------------- ;
|
use32
|
||||||
PATH_SIZE equ 256
|
org 0
|
||||||
PARAMS_SIZE equ 256
|
db 'MENUET01' ; signature
|
||||||
STACK_SIZE equ 256
|
dd 1 ; header version
|
||||||
; ---------------------------------------------------------------------------- ;
|
dd start ; entry point
|
||||||
TEXT_WIDTH equ 6
|
dd _image_end ; end of image
|
||||||
TEXT_HEIGHT equ 9
|
dd _memory ; required memory size
|
||||||
; ---------------------------------------------------------------------------- ;
|
dd _stacktop ; address of stack top
|
||||||
MOUSE_LEFT_BUTTON_MASK equ 1b
|
dd 0 ; buffer for command line arguments
|
||||||
MOUSE_RIGHT_BUTTON_MASK equ 10b
|
dd 0 ; buffer for path
|
||||||
MOUSE_MIDDLE_BUTTON_MASK equ 100b
|
|
||||||
; ---------------------------------------------------------------------------- ;
|
include '../../macros.inc'
|
||||||
EM_REDRAW equ 1b
|
include '../../KOSfuncs.inc'
|
||||||
EM_KEY equ 10b
|
|
||||||
EM_BUTTON equ 100b
|
TEXT_WIDTH = 8
|
||||||
EM_RESERVED0 equ 1000b
|
TEXT_HEIGHT = 16
|
||||||
EM_REDRAW_BACKGROUND equ 10000b
|
|
||||||
EM_MOUSE equ 100000b
|
MOUSE_LEFT_BUTTON_MASK = 1b
|
||||||
EM_IPC equ 1000000b
|
MOUSE_RIGHT_BUTTON_MASK = 10b
|
||||||
EM_NETWORK equ 10000000b
|
MOUSE_MIDDLE_BUTTON_MASK = 100b
|
||||||
EM_DEBUG equ 100000000b
|
|
||||||
; ---------------------------------------------------------------------------- ;
|
WINDOW_STYLE_SKINNED_FIXED = 0x4000000
|
||||||
WINDOW_STYLE_SKINNED_FIXED equ 0x4000000
|
WINDOW_STYLE_COORD_CLIENT = 0x20000000
|
||||||
WINDOW_STYLE_COORD_CLIENT equ 0x20000000
|
WINDOW_STYLE_CAPTION = 0x10000000
|
||||||
WINDOW_STYLE_CAPTION equ 0x10000000
|
|
||||||
; ---------------------------------------------------------------------------- ;
|
WINDOW_BORDER_SIZE = 5
|
||||||
WINDOW_BORDER_SIZE equ 5
|
WINDOW_STYLE = (WINDOW_STYLE_SKINNED_FIXED or WINDOW_STYLE_COORD_CLIENT or WINDOW_STYLE_CAPTION)
|
||||||
; ---------------------------------------------------------------------------- ;
|
|
||||||
WINDOW_STYLE equ WINDOW_STYLE_SKINNED_FIXED | WINDOW_STYLE_COORD_CLIENT | WINDOW_STYLE_CAPTION
|
MOUSE_BODY_COLOR = 0x007C7C96
|
||||||
; ---------------------------------------------------------------------------- ;
|
MOUSE_LEFT_BUTTON_COLOR = 0x008293A4
|
||||||
MOUSE_BODY_COLOR equ 0x007C7C96
|
MOUSE_RIGHT_BUTTON_COLOR = 0x008293A4
|
||||||
MOUSE_LEFT_BUTTON_COLOR equ 0x008293A4
|
MOUSE_MIDDLE_BUTTON_COLOR = 0x00A48293
|
||||||
MOUSE_RIGHT_BUTTON_COLOR equ 0x008293A4
|
MOUSE_LEFT_BUTTON_PRESSED_COLOR = 0x00568EC7
|
||||||
MOUSE_MIDDLE_BUTTON_COLOR equ 0x00A48293
|
MOUSE_RIGHT_BUTTON_PRESSED_COLOR = 0x00568EC7
|
||||||
MOUSE_LEFT_BUTTON_PRESSED_COLOR equ 0x00568EC7
|
MOUSE_MIDDLE_BUTTON_PRESSED_COLOR = 0x00C7568E
|
||||||
MOUSE_RIGHT_BUTTON_PRESSED_COLOR equ 0x00568EC7
|
WINDOW_BACK_COLOR = 0x00EFEFEF
|
||||||
MOUSE_MIDDLE_BUTTON_PRESSED_COLOR equ 0x00C7568E
|
|
||||||
WINDOW_BACK_COLOR equ 0x00EFEFEF
|
MOUSE_WIDTH = 180
|
||||||
; ---------------------------------------------------------------------------- ;
|
MOUSE_HEIGHT = 240
|
||||||
MOUSE_WIDTH equ 120
|
MOUSE_MARGIN = 4
|
||||||
MOUSE_HEIGHT equ 240
|
BUTTONS_MARGIN = 2
|
||||||
MOUSE_MARGIN equ 4
|
|
||||||
BUTTONS_MARGIN equ 2
|
MOUSE_LEFT = MOUSE_MARGIN
|
||||||
; ---------------------------------------------------------------------------- ;
|
MOUSE_TOP = MOUSE_MARGIN
|
||||||
MOUSE_LEFT equ MOUSE_MARGIN
|
WINDOW_WIDTH = MOUSE_WIDTH + WINDOW_BORDER_SIZE * 2 + MOUSE_MARGIN * 2
|
||||||
MOUSE_TOP equ MOUSE_MARGIN
|
MOUSE_BODY_HEIGHT = (MOUSE_HEIGHT - BUTTONS_MARGIN) / 2
|
||||||
WINDOW_WIDTH equ MOUSE_WIDTH + WINDOW_BORDER_SIZE * 2 + MOUSE_MARGIN * 2
|
MOUSE_BODY_TOP = MOUSE_HEIGHT - MOUSE_BODY_HEIGHT + MOUSE_TOP
|
||||||
MOUSE_BODY_HEIGHT equ (MOUSE_HEIGHT - BUTTONS_MARGIN) / 2
|
LEFT_BUTTON_HEIGHT = MOUSE_HEIGHT - MOUSE_BODY_HEIGHT - BUTTONS_MARGIN
|
||||||
MOUSE_BODY_TOP equ MOUSE_HEIGHT - MOUSE_BODY_HEIGHT + MOUSE_TOP
|
RIGHT_BUTTON_HEIGHT = MOUSE_HEIGHT - MOUSE_BODY_HEIGHT - BUTTONS_MARGIN
|
||||||
LEFT_BUTTON_HEIGHT equ MOUSE_HEIGHT - MOUSE_BODY_HEIGHT - BUTTONS_MARGIN
|
LEFT_BUTTON_WIDTH = (MOUSE_WIDTH - BUTTONS_MARGIN) / 2
|
||||||
RIGHT_BUTTON_HEIGHT equ MOUSE_HEIGHT - MOUSE_BODY_HEIGHT - BUTTONS_MARGIN
|
RIGHT_BUTTON_WIDTH = MOUSE_WIDTH - LEFT_BUTTON_WIDTH - BUTTONS_MARGIN
|
||||||
LEFT_BUTTON_WIDTH equ (MOUSE_WIDTH - BUTTONS_MARGIN) / 2
|
LEFT_BUTTON_LEFT = MOUSE_LEFT
|
||||||
RIGHT_BUTTON_WIDTH equ MOUSE_WIDTH - LEFT_BUTTON_WIDTH - BUTTONS_MARGIN
|
RIGHT_BUTTON_LEFT = LEFT_BUTTON_LEFT + LEFT_BUTTON_WIDTH + BUTTONS_MARGIN
|
||||||
LEFT_BUTTON_LEFT equ MOUSE_LEFT
|
MIDDLE_BUTTON_WIDTH = MOUSE_WIDTH / 10
|
||||||
RIGHT_BUTTON_LEFT equ LEFT_BUTTON_LEFT + LEFT_BUTTON_WIDTH + BUTTONS_MARGIN
|
MIDDLE_BUTTON_HEIGHT = MOUSE_HEIGHT / 6
|
||||||
MIDDLE_BUTTON_WIDTH equ MOUSE_WIDTH / 10
|
MIDDLE_BUTTON_LEFT = (MOUSE_WIDTH - MIDDLE_BUTTON_WIDTH) / 2 + MOUSE_LEFT
|
||||||
MIDDLE_BUTTON_HEIGHT equ MOUSE_HEIGHT / 6
|
MIDDLE_BUTTON_TOP = (MOUSE_WIDTH / 2 - MIDDLE_BUTTON_WIDTH) / 2 + MOUSE_TOP
|
||||||
MIDDLE_BUTTON_LEFT equ (MOUSE_WIDTH - MIDDLE_BUTTON_WIDTH) / 2 + MOUSE_LEFT
|
|
||||||
MIDDLE_BUTTON_TOP equ (MOUSE_WIDTH / 2 - MIDDLE_BUTTON_WIDTH) / 2 + MOUSE_TOP
|
; data:
|
||||||
; ---------------------------------------------------------------------------- ;
|
mouse_left_button_color dd MOUSE_LEFT_BUTTON_COLOR
|
||||||
%define SZ_BUTTONS_STATE "Buttons state:"
|
mouse_right_button_color dd MOUSE_RIGHT_BUTTON_COLOR
|
||||||
%define SZ_BIN "bin:"
|
mouse_middle_button_color dd MOUSE_MIDDLE_BUTTON_COLOR
|
||||||
%define SZ_HEX "hex:0x"
|
|
||||||
%strlen LEN_SZ_BUTTONS_STATE SZ_BUTTONS_STATE
|
mouse_button dd 0
|
||||||
%strlen LEN_SZ_BIN SZ_BIN
|
sz_caption db "MouseState", 0
|
||||||
%strlen LEN_SZ_HEX SZ_HEX
|
|
||||||
; ---------------------------------------------------------------------------- ;
|
sz_button_state db "Buttons state:", 0
|
||||||
STATE_VALUES_HEIGHT equ 3 * TEXT_HEIGHT ; we have three lines of text
|
STATE_VALUES_WIDTH = ($ - sz_button_state - 1)*TEXT_WIDTH
|
||||||
STATE_VALUES_WIDTH equ LEN_SZ_BUTTONS_STATE * TEXT_WIDTH
|
sz_bin db "bin: ", 0
|
||||||
STATE_VALUES_TOP equ (MOUSE_BODY_HEIGHT - STATE_VALUES_HEIGHT) / 2 + MOUSE_BODY_TOP
|
LEN_SZ_BIN = $ - sz_bin - 1
|
||||||
STATE_VALUES_LEFT equ (MOUSE_WIDTH - STATE_VALUES_WIDTH) / 2 + MOUSE_LEFT
|
sz_hex db "hex: 0x", 0
|
||||||
; ---------------------------------------------------------------------------- ;
|
LEN_SZ_HEX = $ - sz_hex - 1
|
||||||
MENUET01 db 'MENUET01'
|
|
||||||
version dd 1
|
STATE_VALUES_HEIGHT = 3*TEXT_HEIGHT ; we have three lines of text
|
||||||
program.start dd START
|
STATE_VALUES_TOP = ((MOUSE_BODY_HEIGHT - STATE_VALUES_HEIGHT) / 2 + MOUSE_BODY_TOP)
|
||||||
program.end dd _END
|
STATE_VALUES_LEFT = ((MOUSE_WIDTH - STATE_VALUES_WIDTH) / 2 + MOUSE_LEFT)
|
||||||
program.memory dd _END + PATH_SIZE + PARAMS_SIZE + STACK_SIZE
|
|
||||||
program.stack dd _END + PATH_SIZE + PARAMS_SIZE + STACK_SIZE
|
|
||||||
program.params dd _END + PATH_SIZE
|
|
||||||
program.path dd _END
|
align 4
|
||||||
; ---------------------------------------------------------------------------- ;
|
draw_mouse_buttons:
|
||||||
mouse_body_color dd MOUSE_BODY_COLOR
|
mov eax, SF_DRAW_RECT
|
||||||
mouse_left_button_color dd MOUSE_LEFT_BUTTON_COLOR
|
|
||||||
mouse_right_button_color dd MOUSE_RIGHT_BUTTON_COLOR
|
mov ebx, (LEFT_BUTTON_LEFT shl 16) or LEFT_BUTTON_WIDTH
|
||||||
mouse_middle_button_color dd MOUSE_MIDDLE_BUTTON_COLOR
|
mov ecx, (MOUSE_TOP shl 16) or LEFT_BUTTON_HEIGHT
|
||||||
; ---------------------------------------------------------------------------- ;
|
mov edx, [mouse_left_button_color]
|
||||||
mouse.button dd 0
|
mcall
|
||||||
; ---------------------------------------------------------------------------- ;
|
|
||||||
sz_caption db "MouseState",0
|
mov ebx, (RIGHT_BUTTON_LEFT shl 16) or RIGHT_BUTTON_WIDTH
|
||||||
; ---------------------------------------------------------------------------- ;
|
mov ecx, (MOUSE_TOP shl 16) or RIGHT_BUTTON_HEIGHT
|
||||||
sz_button_state db SZ_BUTTONS_STATE,0
|
mov edx, [mouse_right_button_color]
|
||||||
sz_bin db SZ_BIN,0
|
mcall
|
||||||
sz_hex db SZ_HEX,0
|
|
||||||
; ---------------------------------------------------------------------------- ;
|
mov ebx, (MIDDLE_BUTTON_LEFT shl 16) or MIDDLE_BUTTON_WIDTH
|
||||||
%macro DrawMouseBody 0
|
mov ecx, (MIDDLE_BUTTON_TOP shl 16) or MIDDLE_BUTTON_HEIGHT
|
||||||
; draw.rectangle
|
mov edx, [mouse_middle_button_color]
|
||||||
mov eax, 13
|
mcall
|
||||||
mov ebx, MOUSE_LEFT << 16 | MOUSE_WIDTH
|
; draw state values
|
||||||
mov ecx, MOUSE_BODY_TOP << 16 | MOUSE_BODY_HEIGHT
|
mov eax, SF_DRAW_NUMBER
|
||||||
mov edx, [mouse_body_color]
|
mov esi, (0101b shl 28) or WINDOW_BACK_COLOR
|
||||||
int 64
|
mov ecx, [mouse_button]
|
||||||
; texts
|
mov edi, MOUSE_BODY_COLOR
|
||||||
mov eax, 4
|
|
||||||
mov ecx, 1100b << 28 | WINDOW_BACK_COLOR
|
mov ebx, (10 shl 16) or (2 shl 8) ; 10 digits, base2
|
||||||
mov edi, [mouse_body_color]
|
mov edx, ((LEN_SZ_BIN * TEXT_WIDTH + STATE_VALUES_LEFT) shl 16) or (STATE_VALUES_TOP + TEXT_HEIGHT)
|
||||||
; draw.text
|
mcall
|
||||||
mov ebx, (STATE_VALUES_LEFT << 16) | STATE_VALUES_TOP
|
|
||||||
mov edx, sz_button_state
|
mov ebx, (8 shl 16) or (1 shl 8) ; 8 digits, base16
|
||||||
int 64
|
mov edx, ((LEN_SZ_HEX * TEXT_WIDTH + STATE_VALUES_LEFT) shl 16) or (STATE_VALUES_TOP + TEXT_HEIGHT * 2)
|
||||||
; draw.text
|
mcall
|
||||||
add ebx, TEXT_HEIGHT
|
ret
|
||||||
mov edx, sz_bin
|
|
||||||
int 64
|
|
||||||
; draw.text
|
align 4
|
||||||
add ebx, TEXT_HEIGHT
|
start:
|
||||||
mov edx, sz_hex
|
mcall SF_GET_GRAPHICAL_PARAMS, SSF_SCREEN_SIZE
|
||||||
int 64
|
mov edx, eax
|
||||||
%endmacro
|
movzx ecx, ax
|
||||||
; ---------------------------------------------------------------------------- ;
|
shr edx, 16
|
||||||
align 4
|
|
||||||
DrawMouseButtons:
|
mcall SF_STYLE_SETTINGS, SSF_GET_SKIN_HEIGHT
|
||||||
mov eax, 13
|
add eax, MOUSE_HEIGHT + WINDOW_BORDER_SIZE + MOUSE_MARGIN * 2 - 1
|
||||||
; draw.rectangle
|
mov esi, eax
|
||||||
mov ebx, LEFT_BUTTON_LEFT << 16 | LEFT_BUTTON_WIDTH
|
sub edx, (WINDOW_WIDTH - 1)
|
||||||
mov ecx, MOUSE_TOP << 16 | LEFT_BUTTON_HEIGHT
|
sub ecx, eax
|
||||||
mov edx, [mouse_left_button_color]
|
shr edx, 1
|
||||||
int 64
|
shr ecx, 1
|
||||||
; draw.rectangle
|
|
||||||
mov ebx, RIGHT_BUTTON_LEFT << 16 | RIGHT_BUTTON_WIDTH
|
mov eax, SF_SET_EVENTS_MASK
|
||||||
mov ecx, MOUSE_TOP << 16 | RIGHT_BUTTON_HEIGHT
|
mov ebx, EVM_REDRAW or EVM_BUTTON or EVM_MOUSE
|
||||||
mov edx, [mouse_right_button_color]
|
mcall
|
||||||
int 64
|
|
||||||
; draw.rectangle
|
|
||||||
mov ebx, MIDDLE_BUTTON_LEFT << 16 | MIDDLE_BUTTON_WIDTH
|
align 4
|
||||||
mov ecx, MIDDLE_BUTTON_TOP << 16 | MIDDLE_BUTTON_HEIGHT
|
on_redraw:
|
||||||
mov edx, [mouse_middle_button_color]
|
mcall SF_REDRAW, SSF_BEGIN_DRAW
|
||||||
int 64
|
xor eax, eax ; SF_CREATE_WINDOW
|
||||||
; Draw State Values
|
mov ebx, edx ; window.left
|
||||||
mov eax, 47
|
; ecx = window.top
|
||||||
mov esi, 0100b << 28 | WINDOW_BACK_COLOR
|
shl ebx, 16
|
||||||
mov ecx, [mouse.button]
|
shl ecx, 16
|
||||||
mov edi, [mouse_body_color]
|
or ebx, (WINDOW_WIDTH - 1)
|
||||||
; draw.number
|
or ecx, esi ; window.height
|
||||||
mov ebx, (10 << 16) | (2 << 8) ; 10 digits, base2
|
mov edx, WINDOW_STYLE or WINDOW_BACK_COLOR
|
||||||
mov edx, (LEN_SZ_BIN * TEXT_WIDTH + STATE_VALUES_LEFT) << 16 | (STATE_VALUES_TOP + TEXT_HEIGHT)
|
mov edi, sz_caption
|
||||||
int 64
|
xor esi, esi
|
||||||
; draw.number
|
mcall
|
||||||
mov ebx, (8 << 16) | (1 << 8) ; 8 digits, base16
|
|
||||||
mov edx, (LEN_SZ_HEX * TEXT_WIDTH + STATE_VALUES_LEFT) << 16 | (STATE_VALUES_TOP + TEXT_HEIGHT * 2)
|
mcall SF_REDRAW, SSF_END_DRAW
|
||||||
int 64
|
; draw mouse body:
|
||||||
ret
|
mov eax, SF_DRAW_RECT
|
||||||
; ---------------------------------------------------------------------------- ;
|
mov ebx, (MOUSE_LEFT shl 16) or MOUSE_WIDTH
|
||||||
align 4
|
mov ecx, (MOUSE_BODY_TOP shl 16) or MOUSE_BODY_HEIGHT
|
||||||
START:
|
mov edx, MOUSE_BODY_COLOR
|
||||||
; get.screen.size
|
mcall
|
||||||
mov eax, 61
|
|
||||||
mov ebx, 1
|
mov eax, SF_DRAW_TEXT
|
||||||
int 64
|
mov ecx, (1101b shl 28) or WINDOW_BACK_COLOR
|
||||||
mov edx, eax
|
mov edi, MOUSE_BODY_COLOR
|
||||||
movzx ecx, ax
|
|
||||||
shr edx, 16
|
mov ebx, (STATE_VALUES_LEFT shl 16) or STATE_VALUES_TOP
|
||||||
; skin.height
|
mov edx, sz_button_state
|
||||||
mov eax, 48
|
mcall
|
||||||
mov ebx, 4
|
|
||||||
int 64
|
add ebx, TEXT_HEIGHT
|
||||||
add eax, MOUSE_HEIGHT + WINDOW_BORDER_SIZE + MOUSE_MARGIN * 2 - 1
|
mov edx, sz_bin
|
||||||
mov esi, eax
|
mcall
|
||||||
sub edx, (WINDOW_WIDTH - 1)
|
|
||||||
sub ecx, eax
|
add ebx, TEXT_HEIGHT
|
||||||
shr edx, 1
|
mov edx, sz_hex
|
||||||
shr ecx, 1
|
mcall
|
||||||
; set.event
|
call draw_mouse_buttons
|
||||||
mov eax, 40
|
|
||||||
mov ebx, EM_REDRAW | EM_BUTTON | EM_MOUSE
|
|
||||||
int 64
|
align 4
|
||||||
; ---------------------------------------------------------------------------- ;
|
wait_event:
|
||||||
align 4
|
mcall SF_WAIT_EVENT
|
||||||
on_redraw:
|
cmp eax, EV_REDRAW
|
||||||
; redraw.start
|
je on_redraw
|
||||||
mov eax, 12
|
cmp eax, EV_BUTTON
|
||||||
mov ebx, 1
|
je on_button
|
||||||
int 64
|
; otherwise mouse:
|
||||||
; draw.window
|
|
||||||
xor eax, eax
|
mcall SF_MOUSE_GET, SSF_BUTTON
|
||||||
mov ebx, edx ; window.left
|
cmp [mouse_button], eax ; if equal, then no need update
|
||||||
; ecx = window.top
|
je wait_event
|
||||||
shl ebx, 16
|
mov ebx, dword MOUSE_LEFT_BUTTON_COLOR
|
||||||
shl ecx, 16
|
mov ecx, dword MOUSE_RIGHT_BUTTON_COLOR
|
||||||
or ebx, (WINDOW_WIDTH - 1)
|
mov edx, dword MOUSE_MIDDLE_BUTTON_COLOR
|
||||||
or ecx, esi ; window.height
|
.left:
|
||||||
mov edx, WINDOW_STYLE | WINDOW_BACK_COLOR
|
test eax, MOUSE_LEFT_BUTTON_MASK
|
||||||
mov edi, sz_caption
|
jz .right
|
||||||
xor esi, esi
|
mov ebx, dword MOUSE_LEFT_BUTTON_PRESSED_COLOR
|
||||||
int 64
|
.right:
|
||||||
; redraw.finish
|
test eax, MOUSE_RIGHT_BUTTON_MASK
|
||||||
mov eax, 12
|
jz .middle
|
||||||
mov ebx, 2
|
mov ecx, dword MOUSE_RIGHT_BUTTON_PRESSED_COLOR
|
||||||
int 64
|
.middle:
|
||||||
DrawMouseBody
|
test eax, MOUSE_MIDDLE_BUTTON_MASK
|
||||||
call DrawMouseButtons
|
jz .other
|
||||||
align 4
|
mov edx, dword MOUSE_MIDDLE_BUTTON_PRESSED_COLOR
|
||||||
wait.event:
|
.other:
|
||||||
mov eax, 10 ; redraw = 001b; 001b & 110b = 000b
|
mov [mouse_left_button_color], ebx
|
||||||
int 64 ; button = 011b; 011b & 110b = 010b
|
mov [mouse_right_button_color], ecx
|
||||||
test eax, 110b ; mouse = 110b; 110b & 110b = 110b
|
mov [mouse_middle_button_color], edx
|
||||||
jz on_redraw
|
mov [mouse_button], eax
|
||||||
jnp on_button
|
call draw_mouse_buttons
|
||||||
; get.mouse.button
|
jmp wait_event
|
||||||
mov eax, 37
|
|
||||||
mov ebx, 2
|
align 4
|
||||||
int 64
|
on_button:
|
||||||
cmp [mouse.button], eax ; if equal
|
; terminate because we have only one button (close)
|
||||||
je wait.event ; then no need update
|
mcall SF_TERMINATE_PROCESS
|
||||||
mov ebx, dword MOUSE_LEFT_BUTTON_COLOR
|
|
||||||
mov ecx, dword MOUSE_RIGHT_BUTTON_COLOR
|
align 16
|
||||||
mov edx, dword MOUSE_MIDDLE_BUTTON_COLOR
|
_image_end:
|
||||||
.left:
|
|
||||||
test eax, MOUSE_LEFT_BUTTON_MASK
|
; reserve for stack:
|
||||||
jz .right
|
rb 256
|
||||||
mov ebx, dword MOUSE_LEFT_BUTTON_PRESSED_COLOR
|
align 16
|
||||||
.right:
|
_stacktop:
|
||||||
test eax, MOUSE_RIGHT_BUTTON_MASK
|
_memory:
|
||||||
jz .middle
|
|
||||||
mov ecx, dword MOUSE_RIGHT_BUTTON_PRESSED_COLOR
|
|
||||||
.middle:
|
|
||||||
test eax, MOUSE_MIDDLE_BUTTON_MASK
|
|
||||||
jz .other
|
|
||||||
mov edx, dword MOUSE_MIDDLE_BUTTON_PRESSED_COLOR
|
|
||||||
.other:
|
|
||||||
mov [mouse_left_button_color], ebx
|
|
||||||
mov [mouse_right_button_color], ecx
|
|
||||||
mov [mouse_middle_button_color], edx
|
|
||||||
mov [mouse.button], eax
|
|
||||||
call DrawMouseButtons
|
|
||||||
jmp wait.event
|
|
||||||
align 4
|
|
||||||
on_button: ; terminate because we have only one button(close button)
|
|
||||||
or eax, -1
|
|
||||||
int 64
|
|
||||||
; ---------------------------------------------------------------------------- ;
|
|
||||||
align 4
|
|
||||||
_END:
|
|
||||||
|
@@ -1,2 +1,2 @@
|
|||||||
if tup.getconfig("NO_NASM") ~= "" then return end
|
if tup.getconfig("NO_FASM") ~= "" then return end
|
||||||
tup.rule("lod.asm", "nasm -f bin -o %o %f " .. tup.getconfig("KPACK_CMD"), "lod")
|
tup.rule("lod.asm", "fasm %f %o " .. tup.getconfig("KPACK_CMD"), "lod")
|
||||||
|
3
programs/fs/lod/build.bat
Normal file
3
programs/fs/lod/build.bat
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
@fasm.exe -m 16384 lod.asm lod.kex
|
||||||
|
@kpack lod.kex
|
||||||
|
pause
|
@@ -8,11 +8,20 @@
|
|||||||
; Author 0CodErr
|
; Author 0CodErr
|
||||||
; http://board.kolibrios.org/viewtopic.php?f=9&t=2486
|
; http://board.kolibrios.org/viewtopic.php?f=9&t=2486
|
||||||
|
|
||||||
ORG 0
|
use32
|
||||||
BITS 32
|
org 0
|
||||||
; ---------------------------------------------------------------------------- ;
|
db 'MENUET01'
|
||||||
PARAMS_SIZE equ 256
|
version dd 1
|
||||||
STACK_SIZE equ 256
|
dd program.start
|
||||||
|
dd program.end
|
||||||
|
dd program.memory
|
||||||
|
dd program.stack
|
||||||
|
dd program.params
|
||||||
|
dd 0
|
||||||
|
; ---------------------------- ;
|
||||||
|
|
||||||
|
include '../../macros.inc'
|
||||||
|
include '../../KOSfuncs.inc'
|
||||||
; ---------------------------------------------------------------------------- ;
|
; ---------------------------------------------------------------------------- ;
|
||||||
PROCINFO_SIZE equ 1024
|
PROCINFO_SIZE equ 1024
|
||||||
FILENAME_AREA_SIZE equ 256
|
FILENAME_AREA_SIZE equ 256
|
||||||
@@ -21,18 +30,10 @@ OPENFILE_PATH_SIZE equ 4096
|
|||||||
FILTER_AREA_SIZE equ 256
|
FILTER_AREA_SIZE equ 256
|
||||||
FILTER_BRACKET equ "*" ; and for example: LOD *bmp,png,jpeg*/sys/media/kiv
|
FILTER_BRACKET equ "*" ; and for example: LOD *bmp,png,jpeg*/sys/media/kiv
|
||||||
; ---------------------------------------------------------------------------- ;
|
; ---------------------------------------------------------------------------- ;
|
||||||
MENUET01 db 'MENUET01'
|
align 4
|
||||||
version dd 1
|
program.start:
|
||||||
program.start dd START
|
mov edi, program.params
|
||||||
program.end dd END
|
cmp [edi], dword 0
|
||||||
program.memory dd END + PARAMS_SIZE + STACK_SIZE
|
|
||||||
program.stack dd END + PARAMS_SIZE + STACK_SIZE
|
|
||||||
program.params dd END
|
|
||||||
program.path dd 0
|
|
||||||
; ---------------------------------------------------------------------------- ;
|
|
||||||
START:
|
|
||||||
mov edi,[program.params]
|
|
||||||
cmp [edi],dword 0
|
|
||||||
je terminate
|
je terminate
|
||||||
|
|
||||||
call FakeDrawWindow
|
call FakeDrawWindow
|
||||||
@@ -43,19 +44,13 @@ START:
|
|||||||
je terminate
|
je terminate
|
||||||
mov [file_info.params], eax
|
mov [file_info.params], eax
|
||||||
launch_program:
|
launch_program:
|
||||||
mov eax, 70
|
mcall SF_FILE, file_info
|
||||||
mov ebx, file_info
|
|
||||||
int 64
|
|
||||||
terminate:
|
terminate:
|
||||||
or eax, -1
|
mcall SF_TERMINATE_PROCESS
|
||||||
int 64
|
|
||||||
; ---------------------------------------------------------------------------- ;
|
; ---------------------------------------------------------------------------- ;
|
||||||
OpenDialogInit:
|
OpenDialogInit:
|
||||||
; load.library
|
; load.library
|
||||||
mov eax, 68
|
mcall SF_SYS_MISC,SSF_LOAD_DLL, sz_proc_lib
|
||||||
mov ebx, 19
|
|
||||||
mov ecx, sz_proc_lib
|
|
||||||
int 64
|
|
||||||
mov [proclib], eax
|
mov [proclib], eax
|
||||||
|
|
||||||
push dword[proclib]
|
push dword[proclib]
|
||||||
@@ -68,10 +63,7 @@ OpenDialogInit:
|
|||||||
call GetProcAddress
|
call GetProcAddress
|
||||||
mov [opendialog_start], eax
|
mov [opendialog_start], eax
|
||||||
; memory.allocate
|
; memory.allocate
|
||||||
mov eax, 68
|
mcall SF_SYS_MISC,SSF_MEM_ALLOC, PROCINFO_SIZE + FILENAME_AREA_SIZE + OPENDIR_PATH_SIZE + OPENFILE_PATH_SIZE
|
||||||
mov ebx, 12
|
|
||||||
mov ecx, PROCINFO_SIZE + FILENAME_AREA_SIZE + OPENDIR_PATH_SIZE + OPENFILE_PATH_SIZE
|
|
||||||
int 64
|
|
||||||
|
|
||||||
mov [od.procinfo], eax
|
mov [od.procinfo], eax
|
||||||
add eax, PROCINFO_SIZE
|
add eax, PROCINFO_SIZE
|
||||||
@@ -121,13 +113,9 @@ GetProcAddress:
|
|||||||
; ---------------------------------------------------------------------------- ;
|
; ---------------------------------------------------------------------------- ;
|
||||||
FakeDrawWindow:
|
FakeDrawWindow:
|
||||||
; redraw.start
|
; redraw.start
|
||||||
mov eax, 12
|
mcall SF_REDRAW,SSF_BEGIN_DRAW
|
||||||
mov ebx, 1
|
|
||||||
int 64
|
|
||||||
; get.screen.size
|
; get.screen.size
|
||||||
mov eax, 61
|
mcall SF_GET_GRAPHICAL_PARAMS,SSF_SCREEN_SIZE
|
||||||
mov ebx, 1
|
|
||||||
int 64
|
|
||||||
shr eax, 1
|
shr eax, 1
|
||||||
and eax, 0x7FFF7FFF
|
and eax, 0x7FFF7FFF
|
||||||
; draw.window
|
; draw.window
|
||||||
@@ -136,17 +124,13 @@ FakeDrawWindow:
|
|||||||
shr eax, 16
|
shr eax, 16
|
||||||
movzx ebx, ax
|
movzx ebx, ax
|
||||||
shl ebx, 16
|
shl ebx, 16
|
||||||
mov edx, 0x01000000
|
mcall SF_CREATE_WINDOW,,, 0x01000000
|
||||||
xor eax, eax
|
|
||||||
int 64
|
|
||||||
; redraw.finish
|
; redraw.finish
|
||||||
mov eax, 12
|
mcall SF_REDRAW,SSF_END_DRAW
|
||||||
mov ebx, 2
|
|
||||||
int 64
|
|
||||||
ret
|
ret
|
||||||
; ---------------------------------------------------------------------------- ;
|
; ---------------------------------------------------------------------------- ;
|
||||||
OpenDialogSetFilter:
|
OpenDialogSetFilter:
|
||||||
mov edi, [program.params]
|
mov edi, program.params
|
||||||
mov esi, filefilter + 4
|
mov esi, filefilter + 4
|
||||||
; skip spaces
|
; skip spaces
|
||||||
or ecx, -1
|
or ecx, -1
|
||||||
@@ -195,22 +179,17 @@ OpenDialogSetFilter:
|
|||||||
LaunchProgram:
|
LaunchProgram:
|
||||||
mov eax, [od.openfile_path]
|
mov eax, [od.openfile_path]
|
||||||
mov [file_info.params], eax
|
mov [file_info.params], eax
|
||||||
mov eax, 70
|
mcall SF_FILE, file_info
|
||||||
mov ebx, file_info
|
|
||||||
int 64
|
|
||||||
ret
|
ret
|
||||||
; ---------------------------------------------------------------------------- ;
|
; ---------------------------------------------------------------------------- ;
|
||||||
file_info:
|
file_info:
|
||||||
dd 7
|
dd SSF_START_APP,0
|
||||||
dd 0
|
.params dd 0,0,0
|
||||||
.params dd 0
|
|
||||||
dd 0
|
|
||||||
dd 0
|
|
||||||
db 0
|
db 0
|
||||||
.file_path dd 0
|
.file_path dd 0
|
||||||
; ---------------------------------------------------------------------------- ;
|
; ---------------------------------------------------------------------------- ;
|
||||||
filefilter dd 0
|
filefilter dd 0
|
||||||
resb FILTER_AREA_SIZE
|
rb FILTER_AREA_SIZE
|
||||||
.end db 0
|
.end db 0
|
||||||
; ---------------------------------------------------------------------------- ;
|
; ---------------------------------------------------------------------------- ;
|
||||||
od:
|
od:
|
||||||
@@ -242,4 +221,10 @@ proclib dd 0
|
|||||||
opendialog_init dd 0
|
opendialog_init dd 0
|
||||||
opendialog_start dd 0
|
opendialog_start dd 0
|
||||||
; ---------------------------------------------------------------------------- ;
|
; ---------------------------------------------------------------------------- ;
|
||||||
END:
|
align 4
|
||||||
|
program.end:
|
||||||
|
program.params rb 256
|
||||||
|
rb 256
|
||||||
|
align 16
|
||||||
|
program.stack:
|
||||||
|
program.memory:
|
@@ -1,2 +0,0 @@
|
|||||||
nasm -f bin LOD.asm -o LOD
|
|
||||||
pause
|
|
@@ -1,7 +1,7 @@
|
|||||||
if tup.getconfig("NO_NASM") ~= "" then return end
|
if tup.getconfig("NO_FASM") ~= "" then return end
|
||||||
-- tup.rule is too unmannerly to %define
|
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR")
|
||||||
tup.definerule{
|
tup.include(HELPERDIR .. "/use_fasm.lua")
|
||||||
command = "echo %%define lang '" .. ((tup.getconfig("LANG") == "") and "en_US" or tup.getconfig("LANG")) .. "'> %o",
|
add_include(tup.getvariantdir())
|
||||||
outputs = {"lang_nasm.inc"}
|
|
||||||
}
|
tup.rule("echo lang fix " .. ((tup.getconfig("LANG") == "") and "en_US" or tup.getconfig("LANG")) .. " > %o", {"lang.inc"})
|
||||||
tup.rule({"c4.asm", extra_inputs = {"lang_nasm.inc"}}, "nasm -I" .. tup.getvariantdir() .. "/ -f bin -o %o %f " .. tup.getconfig("KPACK_CMD"), "c4")
|
tup.rule({"c4.asm", extra_inputs = {"lang.inc"}}, FASM .. " %f %o " .. tup.getconfig("KPACK_CMD"), "c4")
|
||||||
|
@@ -18,16 +18,11 @@
|
|||||||
; along with C4; if not, write to the Free Software
|
; along with C4; if not, write to the Free Software
|
||||||
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
%ifndef _AI_INC
|
|
||||||
%define _AI_INC
|
|
||||||
|
|
||||||
|
|
||||||
INFTY equ 1000000000
|
INFTY equ 1000000000
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
section .data
|
|
||||||
|
|
||||||
; table used to perform some primitive move "ordering":
|
; table used to perform some primitive move "ordering":
|
||||||
; middle columns which are usually more important are
|
; middle columns which are usually more important are
|
||||||
; searched first.
|
; searched first.
|
||||||
@@ -46,18 +41,10 @@ evaltable: dd 0, 0, 0, 0, 0, 0, 0, 0, 0
|
|||||||
dd 0, 0, 0, 0, 0, 0, 0, 0, 0
|
dd 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||||
|
|
||||||
|
|
||||||
|
cpulevel rd 1 ; level of current cpu player
|
||||||
section .bss
|
bestval rd 1 ; value of best move found so far
|
||||||
|
nbestmoves rd 1 ; # of best moves found so far
|
||||||
cpulevel resd 1 ; level of current cpu player
|
bestmoves rd 7 ; array to hold all best moves
|
||||||
bestval resd 1 ; value of best move found so far
|
|
||||||
nbestmoves resd 1 ; # of best moves found so far
|
|
||||||
bestmoves resd 7 ; array to hold all best moves
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
section .text
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
;**********************************************************
|
||||||
@@ -148,15 +135,16 @@ aiGetMove:
|
|||||||
; output : eax = move value
|
; output : eax = move value
|
||||||
; destroys : everything
|
; destroys : everything
|
||||||
;**********************************************************
|
;**********************************************************
|
||||||
|
align 4
|
||||||
alphabeta:
|
alphabeta:
|
||||||
|
|
||||||
%define ply (ebp+20)
|
ply equ (ebp+20)
|
||||||
%define player (ebp+16)
|
player equ (ebp+16)
|
||||||
%define alpha (ebp+12)
|
alpha equ (ebp+12)
|
||||||
%define beta (ebp+ 8)
|
beta equ (ebp+ 8)
|
||||||
|
|
||||||
enter 0,0
|
|
||||||
|
|
||||||
|
push ebp
|
||||||
|
mov ebp,esp
|
||||||
; win for other player -> end search
|
; win for other player -> end search
|
||||||
mov eax,[player]
|
mov eax,[player]
|
||||||
BOARDGETOTHERPLAYER eax
|
BOARDGETOTHERPLAYER eax
|
||||||
@@ -262,9 +250,8 @@ alphabeta:
|
|||||||
leave ; eax contains static value
|
leave ; eax contains static value
|
||||||
ret 4*4
|
ret 4*4
|
||||||
|
|
||||||
%undef ply
|
purge ply
|
||||||
%undef player
|
purge player
|
||||||
%undef alpha
|
purge alpha
|
||||||
%undef beta
|
purge beta
|
||||||
|
|
||||||
%endif
|
|
||||||
|
@@ -18,9 +18,6 @@
|
|||||||
; along with C4; if not, write to the Free Software
|
; along with C4; if not, write to the Free Software
|
||||||
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
%ifndef _BOARD_INC
|
|
||||||
%define _BOARD_INC
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
;**********************************************************
|
||||||
; magic numbers
|
; magic numbers
|
||||||
@@ -36,27 +33,15 @@ BHEIGHT equ 8
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
board rd BHEIGHT*BWIDTH ; the board
|
||||||
; uninitialized data
|
free rd BWIDTH ; # of free fields for each column
|
||||||
;**********************************************************
|
totalfree rd 1 ; total # of free fields
|
||||||
|
currentplayer rd 1 ; player to make next move
|
||||||
section .bss
|
lastmove rd 1 ; last move done on the board
|
||||||
|
|
||||||
board resd BHEIGHT*BWIDTH ; the board
|
|
||||||
free resd BWIDTH ; # of free fields for each column
|
|
||||||
totalfree resd 1 ; total # of free fields
|
|
||||||
currentplayer resd 1 ; player to make next move
|
|
||||||
lastmove resd 1 ; last move done on the board
|
|
||||||
; (0 if no last move available)
|
; (0 if no last move available)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
|
||||||
; code
|
|
||||||
;**********************************************************
|
|
||||||
|
|
||||||
section .text
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
;**********************************************************
|
||||||
; boardReset
|
; boardReset
|
||||||
@@ -102,9 +87,9 @@ boardReset:
|
|||||||
; zero flag clear -> move is valid
|
; zero flag clear -> move is valid
|
||||||
; destroys : nothing
|
; destroys : nothing
|
||||||
;**********************************************************
|
;**********************************************************
|
||||||
%macro BOARDISVALIDMOVE 1
|
macro BOARDISVALIDMOVE p1 {
|
||||||
cmp dword [free+%1*4],0
|
cmp dword [free+p1*4],0
|
||||||
%endmacro
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -160,9 +145,9 @@ boardUndoMove:
|
|||||||
; output : current player is switched
|
; output : current player is switched
|
||||||
; destroys : flags
|
; destroys : flags
|
||||||
;**********************************************************
|
;**********************************************************
|
||||||
%macro BOARDSWITCHPLAYERS 0
|
macro BOARDSWITCHPLAYERS {
|
||||||
xor dword [currentplayer],(PLAYER1 ^ PLAYER2)
|
xor dword [currentplayer],(PLAYER1 xor PLAYER2)
|
||||||
%endmacro
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -174,9 +159,9 @@ boardUndoMove:
|
|||||||
; output : player changed
|
; output : player changed
|
||||||
; destroys : flags
|
; destroys : flags
|
||||||
;**********************************************************
|
;**********************************************************
|
||||||
%macro BOARDGETOTHERPLAYER 1
|
macro BOARDGETOTHERPLAYER r1 {
|
||||||
xor %1,(PLAYER1 ^ PLAYER2)
|
xor r1,(PLAYER1 xor PLAYER2)
|
||||||
%endmacro
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -188,9 +173,9 @@ boardUndoMove:
|
|||||||
; output : zero flag set -> board is full
|
; output : zero flag set -> board is full
|
||||||
; zero flag clear -> board isn't full
|
; zero flag clear -> board isn't full
|
||||||
;**********************************************************
|
;**********************************************************
|
||||||
%macro BOARDISFULL 0
|
macro BOARDISFULL {
|
||||||
cmp dword [totalfree],0
|
cmp dword [totalfree],0
|
||||||
%endmacro
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -313,6 +298,3 @@ boardIsWin:
|
|||||||
; no win for this player
|
; no win for this player
|
||||||
xor eax,eax
|
xor eax,eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
%endif
|
|
@@ -1,2 +0,0 @@
|
|||||||
@nasmw -f bin -o c4 c4.asm
|
|
||||||
@pause
|
|
4
programs/games/c4/build_en.bat
Normal file
4
programs/games/c4/build_en.bat
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
@echo lang fix en_EN >lang.inc
|
||||||
|
@fasm.exe -m 16384 c4.asm c4.kex
|
||||||
|
@kpack c4.kex
|
||||||
|
pause
|
4
programs/games/c4/build_ru.bat
Normal file
4
programs/games/c4/build_ru.bat
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
@echo lang fix ru_RU >lang.inc
|
||||||
|
@fasm.exe -m 16384 c4.asm c4.kex
|
||||||
|
@kpack c4.kex
|
||||||
|
pause
|
@@ -18,14 +18,15 @@
|
|||||||
; along with C4; if not, write to the Free Software
|
; along with C4; if not, write to the Free Software
|
||||||
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
bits 32
|
use32
|
||||||
%include 'mos.inc'
|
org 0
|
||||||
section .text
|
db 'MENUET01'
|
||||||
%include 'lang_nasm.inc' ;fedesco
|
dd 1,start,i_end,mem,stacktop,0,0
|
||||||
|
|
||||||
|
|
||||||
MOS_HEADER01 start,end
|
|
||||||
|
|
||||||
|
include '../../macros.inc'
|
||||||
|
include '../../proc32.inc'
|
||||||
|
include '../../KOSfuncs.inc'
|
||||||
|
include 'lang.inc' ;fedesco
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
;**********************************************************
|
||||||
@@ -46,11 +47,20 @@ BUTTON_HEIGHT equ 12
|
|||||||
|
|
||||||
BUTTON_NEW_X equ 14
|
BUTTON_NEW_X equ 14
|
||||||
BUTTON_NEW_Y equ 30
|
BUTTON_NEW_Y equ 30
|
||||||
%ifidn lang, 'it_IT'
|
BUTTON_NEW_HEIGHT equ 32
|
||||||
BUTTON_NEW_WIDTH equ 56 + 28
|
if lang eq it_IT
|
||||||
%else
|
BUTTON_NEW_WIDTH = 56 + 28
|
||||||
BUTTON_NEW_WIDTH equ 56
|
LABEL_PL1_X = 90 + 10
|
||||||
%endif
|
LABEL_PL1TYPE_X = (LABEL_PL1_X + 10*6 - 4)
|
||||||
|
else if lang eq ru_RU
|
||||||
|
BUTTON_NEW_WIDTH = 56 + 12
|
||||||
|
LABEL_PL1_X = 90
|
||||||
|
LABEL_PL1TYPE_X = (LABEL_PL1_X + 10*6)
|
||||||
|
else
|
||||||
|
BUTTON_NEW_WIDTH = 56
|
||||||
|
LABEL_PL1_X = 90
|
||||||
|
LABEL_PL1TYPE_X = (LABEL_PL1_X + 10*6)
|
||||||
|
end if
|
||||||
|
|
||||||
BUTTON_SPIN_WIDTH equ 8
|
BUTTON_SPIN_WIDTH equ 8
|
||||||
BUTTON_PL1DN_X equ 228
|
BUTTON_PL1DN_X equ 228
|
||||||
@@ -64,19 +74,9 @@ BUTTON_PL2UP_X equ (BUTTON_PL2DN_X + BUTTON_SPIN_WIDTH + 1)
|
|||||||
BUTTON_PL2UP_Y equ BUTTON_PL2DN_Y
|
BUTTON_PL2UP_Y equ BUTTON_PL2DN_Y
|
||||||
|
|
||||||
; label dimensions
|
; label dimensions
|
||||||
%ifidn lang, 'it_IT'
|
|
||||||
LABEL_PL1_X equ 90 + 10
|
|
||||||
%else
|
|
||||||
LABEL_PL1_X equ 90
|
|
||||||
%endif
|
|
||||||
LABEL_PL1_Y equ (1 + BUTTON_PL1DN_Y + (BUTTON_HEIGHT-8)/2)
|
LABEL_PL1_Y equ (1 + BUTTON_PL1DN_Y + (BUTTON_HEIGHT-8)/2)
|
||||||
LABEL_PL2_X equ LABEL_PL1_X
|
LABEL_PL2_X equ LABEL_PL1_X
|
||||||
LABEL_PL2_Y equ (1 + BUTTON_PL2DN_Y + (BUTTON_HEIGHT-8)/2)
|
LABEL_PL2_Y equ (1 + BUTTON_PL2DN_Y + (BUTTON_HEIGHT-8)/2)
|
||||||
%ifidn lang, 'it_IT'
|
|
||||||
LABEL_PL1TYPE_X equ (LABEL_PL1_X + 10*6 - 4)
|
|
||||||
%else
|
|
||||||
LABEL_PL1TYPE_X equ (LABEL_PL1_X + 10*6)
|
|
||||||
%endif
|
|
||||||
LABEL_PL1TYPE_Y equ LABEL_PL1_Y
|
LABEL_PL1TYPE_Y equ LABEL_PL1_Y
|
||||||
LABEL_PL2TYPE_X equ LABEL_PL1TYPE_X
|
LABEL_PL2TYPE_X equ LABEL_PL1TYPE_X
|
||||||
LABEL_PL2TYPE_Y equ LABEL_PL2_Y
|
LABEL_PL2TYPE_Y equ LABEL_PL2_Y
|
||||||
@@ -94,9 +94,7 @@ GRIDY equ 70
|
|||||||
GRIDSPACING equ (STONESIZE + 1) ; space between lines
|
GRIDSPACING equ (STONESIZE + 1) ; space between lines
|
||||||
GRIDHEIGHT equ (6*GRIDSPACING+1) ; total grid width and height
|
GRIDHEIGHT equ (6*GRIDSPACING+1) ; total grid width and height
|
||||||
GRIDWIDTH equ (7*GRIDSPACING+1)
|
GRIDWIDTH equ (7*GRIDSPACING+1)
|
||||||
GRIDCOLOR equ MOS_RGB(128,128,128)
|
GRIDCOLOR equ 0x808080
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; button id's
|
; button id's
|
||||||
BT_QUIT equ 1
|
BT_QUIT equ 1
|
||||||
@@ -106,55 +104,170 @@ BT_PLAYER1UP equ 4
|
|||||||
BT_PLAYER2DN equ 5
|
BT_PLAYER2DN equ 5
|
||||||
BT_PLAYER2UP equ 6
|
BT_PLAYER2UP equ 6
|
||||||
|
|
||||||
|
include "pcx.inc"
|
||||||
|
include "windows.inc"
|
||||||
|
include "board.inc"
|
||||||
|
include "rng.inc"
|
||||||
|
;include "randomai.inc"
|
||||||
|
include "ai.inc"
|
||||||
|
|
||||||
|
;
|
||||||
|
; label table
|
||||||
|
;
|
||||||
|
|
||||||
|
if lang eq it_IT
|
||||||
|
newgame db "Nuova partita",0
|
||||||
|
down db "<",0
|
||||||
|
up db ">",0
|
||||||
|
pl1 db "Giocatore 1:",0
|
||||||
|
pl2 db "Giocatore 2:",0
|
||||||
|
|
||||||
|
playertypes:
|
||||||
|
db "Umano ",0
|
||||||
|
.e1:
|
||||||
|
db "CPU 1 ",0
|
||||||
|
db "CPU 2 ",0
|
||||||
|
db "CPU 3 ",0
|
||||||
|
db "CPU 4 ",0
|
||||||
|
db "CPU 5 ",0
|
||||||
|
db "CPU 6 ",0
|
||||||
|
db "CPU 7 ",0
|
||||||
|
db "CPU 8 ",0
|
||||||
|
else if lang eq ru_RU
|
||||||
|
newgame db "<22><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>",0
|
||||||
|
down db "<",0
|
||||||
|
up db ">",0
|
||||||
|
pl1 db "<22><>ப 1:",0
|
||||||
|
pl2 db "<22><>ப 2:",0
|
||||||
|
|
||||||
|
playertypes:
|
||||||
|
db "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ",0
|
||||||
|
.e1:
|
||||||
|
db "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1 ",0
|
||||||
|
db "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2 ",0
|
||||||
|
db "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 3 ",0
|
||||||
|
db "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 4 ",0
|
||||||
|
db "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 5 ",0
|
||||||
|
db "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 6 ",0
|
||||||
|
db "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 7 ",0
|
||||||
|
db "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 8 ",0
|
||||||
|
else
|
||||||
|
newgame db "New game",0
|
||||||
|
down db "<",0
|
||||||
|
up db ">",0
|
||||||
|
pl1 db "Player 1:",0
|
||||||
|
pl2 db "Player 2:",0
|
||||||
|
|
||||||
|
playertypes:
|
||||||
|
db "Human ",0
|
||||||
|
.e1:
|
||||||
|
db "CPU level 1 ",0
|
||||||
|
db "CPU level 2 ",0
|
||||||
|
db "CPU level 3 ",0
|
||||||
|
db "CPU level 4 ",0
|
||||||
|
db "CPU level 5 ",0
|
||||||
|
db "CPU level 6 ",0
|
||||||
|
db "CPU level 7 ",0
|
||||||
|
db "CPU level 8 ",0
|
||||||
|
end if
|
||||||
|
playertypes_end:
|
||||||
|
|
||||||
|
PLAYERTYPELEN equ (playertypes.e1 - playertypes)
|
||||||
|
NPLAYERTYPES equ ((playertypes_end-playertypes)/PLAYERTYPELEN)
|
||||||
|
|
||||||
|
;
|
||||||
|
; button table
|
||||||
|
;
|
||||||
|
align 4
|
||||||
|
buttons:
|
||||||
|
; new
|
||||||
|
BUTTON (BUTTON_NEW_X shl 16) + BUTTON_NEW_WIDTH, (BUTTON_NEW_Y shl 16) + BUTTON_NEW_HEIGHT, BT_NEW, BUTTON_COLOR_WORK
|
||||||
|
; player 1 down
|
||||||
|
BUTTON (BUTTON_PL1DN_X shl 16) + BUTTON_SPIN_WIDTH, (BUTTON_PL1DN_Y shl 16) + BUTTON_HEIGHT, BT_PLAYER1DN, BUTTON_COLOR_WORK
|
||||||
|
; player 1 up
|
||||||
|
BUTTON (BUTTON_PL1UP_X shl 16) + BUTTON_SPIN_WIDTH, (BUTTON_PL1UP_Y shl 16) + BUTTON_HEIGHT, BT_PLAYER1UP, BUTTON_COLOR_WORK
|
||||||
|
; player 2 down
|
||||||
|
BUTTON (BUTTON_PL2DN_X shl 16) + BUTTON_SPIN_WIDTH, (BUTTON_PL2DN_Y shl 16) + BUTTON_HEIGHT, BT_PLAYER2DN, BUTTON_COLOR_WORK
|
||||||
|
; player 2 up
|
||||||
|
BUTTON (BUTTON_PL2UP_X shl 16) + BUTTON_SPIN_WIDTH, (BUTTON_PL2UP_Y shl 16) + BUTTON_HEIGHT, BT_PLAYER2UP, BUTTON_COLOR_WORK
|
||||||
|
buttons_end:
|
||||||
|
|
||||||
|
NBUTTONS equ ((buttons_end-buttons)/sizeof.BUTTON)
|
||||||
|
|
||||||
|
align 4
|
||||||
|
labels:
|
||||||
|
; new
|
||||||
|
LABEL ((BUTTON_NEW_X+4) shl 16) + (1+BUTTON_NEW_Y+(BUTTON_NEW_HEIGHT-8)/2), newgame,LABEL_COLOR_WORKBUTTON,LABEL_BGCOLOR_TRANSPARENT
|
||||||
|
; player 1 down
|
||||||
|
LABEL ((BUTTON_PL1DN_X+(BUTTON_SPIN_WIDTH-4)/2) shl 16) + (1+BUTTON_PL1DN_Y+(BUTTON_HEIGHT-8)/2), down,LABEL_COLOR_WORKBUTTON,LABEL_BGCOLOR_TRANSPARENT
|
||||||
|
; player 1 up
|
||||||
|
LABEL ((1+BUTTON_PL1UP_X+(BUTTON_SPIN_WIDTH-4)/2) shl 16) + (1+BUTTON_PL1UP_Y+(BUTTON_HEIGHT-8)/2), up,LABEL_COLOR_WORKBUTTON,LABEL_BGCOLOR_TRANSPARENT
|
||||||
|
; player 2 down
|
||||||
|
LABEL ((BUTTON_PL2DN_X+(BUTTON_SPIN_WIDTH-4)/2) shl 16) + (1+BUTTON_PL2DN_Y+(BUTTON_HEIGHT-8)/2), down,LABEL_COLOR_WORKBUTTON,LABEL_BGCOLOR_TRANSPARENT
|
||||||
|
; player 2 up
|
||||||
|
LABEL ((1+BUTTON_PL2UP_X+(BUTTON_SPIN_WIDTH-4)/2) shl 16) + (1+BUTTON_PL2UP_Y+(BUTTON_HEIGHT-8)/2), up,LABEL_COLOR_WORKBUTTON,LABEL_BGCOLOR_TRANSPARENT
|
||||||
|
; player 1
|
||||||
|
LABEL (LABEL_PL1_X shl 16) + LABEL_PL1_Y, pl1,0xffffff,LABEL_BGCOLOR_TRANSPARENT
|
||||||
|
; player 2
|
||||||
|
LABEL (LABEL_PL2_X shl 16) + LABEL_PL2_Y, pl2,0xffffff,LABEL_BGCOLOR_TRANSPARENT
|
||||||
|
; status bar
|
||||||
|
statusbar LABEL (LABEL_STATUS_X shl 16) + LABEL_STATUS_Y, 0,0xffffff,LABEL_BGCOLOR_TRANSPARENT
|
||||||
|
|
||||||
|
if lang eq it_IT
|
||||||
|
label_pl1type LABEL ((LABEL_PL1TYPE_X + 18) shl 16) + LABEL_PL1TYPE_Y, playertypes+PL1TYPE_INIT*PLAYERTYPELEN,0xffffff,0
|
||||||
|
label_pl2type LABEL ((LABEL_PL2TYPE_X + 18) shl 16) + LABEL_PL2TYPE_Y, playertypes+PL2TYPE_INIT*PLAYERTYPELEN,0xffffff,0
|
||||||
|
else
|
||||||
|
label_pl1type LABEL (LABEL_PL1TYPE_X shl 16) + LABEL_PL1TYPE_Y, playertypes+PL1TYPE_INIT*PLAYERTYPELEN,0xffffff,0
|
||||||
|
label_pl2type LABEL (LABEL_PL2TYPE_X shl 16) + LABEL_PL2TYPE_Y, playertypes+PL2TYPE_INIT*PLAYERTYPELEN,0xffffff,0
|
||||||
|
end if
|
||||||
|
labels_end:
|
||||||
|
|
||||||
|
NLABELS equ ((labels_end-labels)/sizeof.LABEL)
|
||||||
|
|
||||||
|
|
||||||
|
; button images
|
||||||
|
redpcx:
|
||||||
|
file "red.pcx"
|
||||||
|
REDPCXSIZE equ (bluepcx - redpcx)
|
||||||
|
bluepcx:
|
||||||
|
file "blue.pcx"
|
||||||
|
pcx_end:
|
||||||
|
BLUEPCXSIZE equ (pcx_end - bluepcx)
|
||||||
|
|
||||||
|
|
||||||
|
align 4
|
||||||
start:
|
start:
|
||||||
jmp main
|
|
||||||
|
|
||||||
%include "pcx.inc"
|
|
||||||
%include "windows.inc"
|
|
||||||
%include "board.inc"
|
|
||||||
%include "rng.inc"
|
|
||||||
; %include "randomai.inc"
|
|
||||||
%include "ai.inc"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
|
||||||
; main program
|
|
||||||
;**********************************************************
|
|
||||||
main:
|
|
||||||
call randomize
|
call randomize
|
||||||
call defineWindow
|
call defineWindow
|
||||||
call decrunchImages
|
call decrunchImages
|
||||||
call newGame
|
call newGame
|
||||||
|
|
||||||
|
align 16
|
||||||
.msgpump:
|
.msgpump:
|
||||||
; wait for event
|
; wait for event
|
||||||
mov ebx,1
|
mcall SF_WAIT_EVENT_TIMEOUT,1
|
||||||
mov eax,MOS_SC_WAITEVENTTIMEOUT
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
; process events
|
; process events
|
||||||
cmp eax,MOS_EVT_REDRAW
|
cmp eax,EV_REDRAW
|
||||||
je short .redraw
|
je .redraw
|
||||||
cmp eax,MOS_EVT_KEY
|
cmp eax,EV_KEY
|
||||||
je short .key
|
je .key
|
||||||
cmp eax,MOS_EVT_BUTTON
|
cmp eax,EV_BUTTON
|
||||||
je short .button
|
je .button
|
||||||
|
|
||||||
call pollMouse
|
call pollMouse
|
||||||
call gameLoop
|
call gameLoop
|
||||||
jmp short .msgpump
|
jmp .msgpump
|
||||||
|
|
||||||
.redraw:
|
.redraw:
|
||||||
call defineWindow
|
call defineWindow
|
||||||
jmp short .msgpump
|
jmp .msgpump
|
||||||
.key:
|
.key:
|
||||||
call keyboardInput
|
call keyboardInput
|
||||||
jmp short .msgpump
|
jmp .msgpump
|
||||||
.button:
|
.button:
|
||||||
call handleButton
|
call handleButton
|
||||||
jmp short .msgpump
|
jmp .msgpump
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -162,28 +275,27 @@ main:
|
|||||||
; button handling function
|
; button handling function
|
||||||
;**********************************************************
|
;**********************************************************
|
||||||
handleButton:
|
handleButton:
|
||||||
mov eax,MOS_SC_GETPRESSEDBUTTON ; get button id
|
mcall SF_GET_BUTTON ; get button id
|
||||||
int 0x40
|
|
||||||
|
|
||||||
cmp al,1 ; button pressed ?
|
cmp al,1 ; button pressed ?
|
||||||
je short .bye ; nope -> nothing to do
|
je .bye ; nope -> nothing to do
|
||||||
|
|
||||||
cmp ah,BT_QUIT ; which button has been pressed ?
|
cmp ah,BT_QUIT ; which button has been pressed ?
|
||||||
je short .quit
|
je .quit
|
||||||
cmp ah,BT_NEW
|
cmp ah,BT_NEW
|
||||||
je short .new
|
je .new
|
||||||
cmp ah,BT_PLAYER1DN
|
cmp ah,BT_PLAYER1DN
|
||||||
je short .player1dn
|
je .player1dn
|
||||||
cmp ah,BT_PLAYER1UP
|
cmp ah,BT_PLAYER1UP
|
||||||
je short .player1up
|
je .player1up
|
||||||
cmp ah,BT_PLAYER2DN
|
cmp ah,BT_PLAYER2DN
|
||||||
je short .player2dn
|
je .player2dn
|
||||||
cmp ah,BT_PLAYER2UP
|
cmp ah,BT_PLAYER2UP
|
||||||
je short .player2up
|
je .player2up
|
||||||
.bye:
|
.bye:
|
||||||
ret
|
ret
|
||||||
.quit:
|
.quit:
|
||||||
MOS_EXIT
|
mcall SF_TERMINATE_PROCESS
|
||||||
.new:
|
.new:
|
||||||
call newGame
|
call newGame
|
||||||
ret
|
ret
|
||||||
@@ -234,7 +346,7 @@ handleButton:
|
|||||||
; window definition function
|
; window definition function
|
||||||
;**********************************************************
|
;**********************************************************
|
||||||
defineWindow:
|
defineWindow:
|
||||||
MOS_STARTREDRAW
|
mcall SF_REDRAW,SSF_BEGIN_DRAW
|
||||||
|
|
||||||
mov edi,window
|
mov edi,window
|
||||||
call drawWindow
|
call drawWindow
|
||||||
@@ -250,7 +362,7 @@ defineWindow:
|
|||||||
xor eax,eax
|
xor eax,eax
|
||||||
call drawBoard
|
call drawBoard
|
||||||
|
|
||||||
MOS_ENDREDRAW
|
mcall SF_REDRAW,SSF_END_DRAW
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
@@ -270,11 +382,10 @@ updateStatusText:
|
|||||||
mov dword [statusbar + LABEL.caption],esi ; yeah -> save & redraw
|
mov dword [statusbar + LABEL.caption],esi ; yeah -> save & redraw
|
||||||
|
|
||||||
; clear background
|
; clear background
|
||||||
mov ebx,MOS_DWORD(LABEL_STATUS_X,LABEL_STATUS_WIDTH)
|
mov ebx, LABEL_STATUS_X shl 16 + LABEL_STATUS_WIDTH
|
||||||
mov ecx,MOS_DWORD(LABEL_STATUS_Y,LABEL_STATUS_HEIGHT)
|
mov ecx, LABEL_STATUS_Y shl 16 + LABEL_STATUS_HEIGHT
|
||||||
xor edx,edx
|
xor edx,edx
|
||||||
mov eax,MOS_SC_DRAWBAR
|
mcall SF_DRAW_RECT
|
||||||
int 0x40
|
|
||||||
|
|
||||||
; redraw label
|
; redraw label
|
||||||
mov edi,statusbar
|
mov edi,statusbar
|
||||||
@@ -310,50 +421,50 @@ updatePlayerType:
|
|||||||
; draw whole board
|
; draw whole board
|
||||||
;
|
;
|
||||||
; input : eax nonzero = clear board background
|
; input : eax nonzero = clear board background
|
||||||
|
align 4
|
||||||
drawBoard:
|
drawBoard:
|
||||||
|
|
||||||
; clear background ?
|
; clear background ?
|
||||||
or eax,eax
|
or eax,eax
|
||||||
jz .noclear
|
jz .noclear
|
||||||
mov ebx,MOS_DWORD(GRIDX,GRIDWIDTH)
|
mov ebx, GRIDX shl 16 + GRIDWIDTH
|
||||||
mov ecx,MOS_DWORD(GRIDY,GRIDHEIGHT)
|
mov ecx, GRIDY shl 16 + GRIDHEIGHT
|
||||||
mov edx,WND_WORKCOLOR
|
mov edx,WND_WORKCOLOR
|
||||||
mov eax,MOS_SC_DRAWBAR
|
mcall SF_DRAW_RECT
|
||||||
int 0x40
|
|
||||||
.noclear:
|
.noclear:
|
||||||
call drawGrid
|
call drawGrid
|
||||||
call drawStones
|
call drawStones
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
align 4
|
||||||
drawGrid:
|
drawGrid:
|
||||||
|
|
||||||
; vertical lines
|
; vertical lines
|
||||||
mov ebx,MOS_DWORD(GRIDX,GRIDX)
|
mov ebx, GRIDX shl 16 + GRIDX
|
||||||
mov ecx,MOS_DWORD(GRIDY,GRIDY+GRIDHEIGHT-1)
|
mov ecx, GRIDY shl 16 + GRIDY+GRIDHEIGHT-1
|
||||||
mov edx,GRIDCOLOR
|
mov edx,GRIDCOLOR
|
||||||
mov eax,MOS_SC_DRAWLINE
|
mcall SF_DRAW_LINE
|
||||||
mov esi,8
|
mov esi,8
|
||||||
.vlines:
|
.vlines:
|
||||||
int 0x40
|
int 0x40
|
||||||
add ebx,MOS_DWORD(GRIDSPACING,GRIDSPACING)
|
add ebx, GRIDSPACING shl 16 + GRIDSPACING
|
||||||
dec esi
|
dec esi
|
||||||
jnz .vlines
|
jnz .vlines
|
||||||
|
|
||||||
; horizontal lines
|
; horizontal lines
|
||||||
mov ebx,MOS_DWORD(GRIDX,GRIDX+GRIDWIDTH-1)
|
mov ebx, GRIDX shl 16 + GRIDX+GRIDWIDTH-1
|
||||||
mov ecx,MOS_DWORD(GRIDY,GRIDY)
|
mov ecx, GRIDY shl 16 + GRIDY
|
||||||
mov esi,7
|
mov esi,7
|
||||||
.hlines:
|
.hlines:
|
||||||
int 0x40
|
int 0x40
|
||||||
add ecx,MOS_DWORD(GRIDSPACING,GRIDSPACING)
|
add ecx, GRIDSPACING shl 16 + GRIDSPACING
|
||||||
dec esi
|
dec esi
|
||||||
jnz .hlines
|
jnz .hlines
|
||||||
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
align 4
|
||||||
drawStones:
|
drawStones:
|
||||||
mov ebx,6
|
mov ebx,6
|
||||||
.col:
|
.col:
|
||||||
@@ -369,6 +480,7 @@ drawStones:
|
|||||||
|
|
||||||
; ecx = column (1..7)
|
; ecx = column (1..7)
|
||||||
; ebx = row (1..6)
|
; ebx = row (1..6)
|
||||||
|
align 4
|
||||||
drawStone:
|
drawStone:
|
||||||
pushad
|
pushad
|
||||||
|
|
||||||
@@ -402,9 +514,8 @@ drawStone:
|
|||||||
|
|
||||||
; put image (position is already in edx)
|
; put image (position is already in edx)
|
||||||
mov ebx,ebp ; image address
|
mov ebx,ebp ; image address
|
||||||
mov ecx,MOS_DWORD(STONESIZE,STONESIZE) ; image dimensions
|
mov ecx, (STONESIZE shl 16) + STONESIZE ; image dimensions
|
||||||
mov eax,MOS_SC_PUTIMAGE
|
mcall SF_PUT_IMAGE
|
||||||
int 0x40
|
|
||||||
|
|
||||||
.bye:
|
.bye:
|
||||||
popad
|
popad
|
||||||
@@ -461,9 +572,8 @@ newGame:
|
|||||||
; destroys : everything
|
; destroys : everything
|
||||||
;**********************************************************
|
;**********************************************************
|
||||||
pollMouse:
|
pollMouse:
|
||||||
mov ebx,2
|
mcall SF_MOUSE_GET,SSF_BUTTON
|
||||||
mov eax,MOS_SC_GETMOUSEPOSITION
|
|
||||||
int 0x40
|
|
||||||
and eax,1
|
and eax,1
|
||||||
jz .mousenotpressed
|
jz .mousenotpressed
|
||||||
.mousepressed:
|
.mousepressed:
|
||||||
@@ -502,10 +612,8 @@ pollMouse:
|
|||||||
; destroys : everything
|
; destroys : everything
|
||||||
;**********************************************************
|
;**********************************************************
|
||||||
getMouseCol:
|
getMouseCol:
|
||||||
|
|
||||||
mov ebx,1 ; get mouse position, window relative
|
mcall SF_MOUSE_GET,SSF_WINDOW_POSITION ; get mouse position, window relative
|
||||||
mov eax,MOS_SC_GETMOUSEPOSITION
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
movzx ebx,ax ; y clipping
|
movzx ebx,ax ; y clipping
|
||||||
cmp ebx,GRIDY
|
cmp ebx,GRIDY
|
||||||
@@ -539,24 +647,15 @@ getMouseCol:
|
|||||||
; destroys : everything
|
; destroys : everything
|
||||||
;**********************************************************
|
;**********************************************************
|
||||||
isActiveApp:
|
isActiveApp:
|
||||||
|
|
||||||
%define PROCINFO (ebp-MOS_PROCESSINFO_size)
|
|
||||||
|
|
||||||
enter MOS_PROCESSINFO_size,0
|
|
||||||
|
|
||||||
; get process information
|
; get process information
|
||||||
mov eax,MOS_SC_GETPROCESSINFO
|
mcall SF_THREAD_INFO,procinfo,-1
|
||||||
lea ebx,[ebp-MOS_PROCESSINFO_size]
|
|
||||||
mov ecx,-1
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
; set al to 1 if we are the active application
|
; set al to 1 if we are the active application
|
||||||
cmp ax,[PROCINFO+MOS_PROCESSINFO.windowStackPos]
|
cmp ax,[procinfo+process_information.window_stack_position]
|
||||||
sete al
|
sete al
|
||||||
|
|
||||||
leave
|
;;;leave
|
||||||
ret
|
ret
|
||||||
%undef PROCINFO
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -569,8 +668,7 @@ isActiveApp:
|
|||||||
; destroys : everything
|
; destroys : everything
|
||||||
;**********************************************************
|
;**********************************************************
|
||||||
keyboardInput:
|
keyboardInput:
|
||||||
mov eax,MOS_SC_GETKEY ; get key
|
mcall SF_GET_KEY ; get key
|
||||||
int 0x40
|
|
||||||
or al,al ; key available ?
|
or al,al ; key available ?
|
||||||
jnz .bye ; no -> bye
|
jnz .bye ; no -> bye
|
||||||
cmp dword [playerinput],0 ; unprocessed input available ?
|
cmp dword [playerinput],0 ; unprocessed input available ?
|
||||||
@@ -698,7 +796,7 @@ updatePlayerStatusText:
|
|||||||
cmp dword [player1_type],0
|
cmp dword [player1_type],0
|
||||||
je .statustextok
|
je .statustextok
|
||||||
mov esi,player1cpuprmpt
|
mov esi,player1cpuprmpt
|
||||||
jmp short .statustextok
|
jmp .statustextok
|
||||||
.player2:
|
.player2:
|
||||||
mov esi,player2hmnprmpt
|
mov esi,player2hmnprmpt
|
||||||
cmp dword [player2_type],0
|
cmp dword [player2_type],0
|
||||||
@@ -714,196 +812,11 @@ updatePlayerStatusText:
|
|||||||
; initialized data
|
; initialized data
|
||||||
;**********************************************************
|
;**********************************************************
|
||||||
|
|
||||||
section .data
|
|
||||||
|
|
||||||
;
|
;
|
||||||
; window definition
|
; window definition
|
||||||
;
|
;
|
||||||
windowtitle db "C4",0
|
windowtitle db "C4",0
|
||||||
window:
|
window WND WND_WIDTH, WND_HEIGHT, 0x14000000 or WND_WORKCOLOR, 0,0,windowtitle,0, WND_CENTER or WND_DEFAULT_GRABCOLOR or WND_DEFAULT_FRAMECOLOR or WND_DEFAULT_CAPTIONCOLOR
|
||||||
istruc WND
|
|
||||||
at WND.xposandsize, dd MOS_DWORD(0,WND_WIDTH)
|
|
||||||
at WND.yposandsize, dd MOS_DWORD(0,WND_HEIGHT)
|
|
||||||
at WND.workcolor, dd 0x14000000 | WND_WORKCOLOR
|
|
||||||
at WND.grabcolor, dd 0
|
|
||||||
at WND.framecolor, dd 0
|
|
||||||
at WND.caption, dd windowtitle
|
|
||||||
at WND.captioncolor, dd 0
|
|
||||||
at WND.flags, dd WND_CENTER | WND_DEFAULT_GRABCOLOR | WND_DEFAULT_FRAMECOLOR | WND_DEFAULT_CAPTIONCOLOR
|
|
||||||
iend
|
|
||||||
|
|
||||||
;
|
|
||||||
; button table
|
|
||||||
;
|
|
||||||
buttons:
|
|
||||||
istruc BUTTON ; new
|
|
||||||
at BUTTON.xposandsize
|
|
||||||
dd MOS_DWORD(BUTTON_NEW_X,BUTTON_NEW_WIDTH)
|
|
||||||
dd MOS_DWORD(BUTTON_NEW_Y,BUTTON_HEIGHT)
|
|
||||||
dd BT_NEW
|
|
||||||
dd BUTTON_COLOR_WORK
|
|
||||||
iend
|
|
||||||
istruc BUTTON ; player 1 down
|
|
||||||
at BUTTON.xposandsize
|
|
||||||
dd MOS_DWORD(BUTTON_PL1DN_X,BUTTON_SPIN_WIDTH)
|
|
||||||
dd MOS_DWORD(BUTTON_PL1DN_Y,BUTTON_HEIGHT)
|
|
||||||
dd BT_PLAYER1DN
|
|
||||||
dd BUTTON_COLOR_WORK
|
|
||||||
iend
|
|
||||||
istruc BUTTON ; player 1 up
|
|
||||||
at BUTTON.xposandsize
|
|
||||||
dd MOS_DWORD(BUTTON_PL1UP_X,BUTTON_SPIN_WIDTH)
|
|
||||||
dd MOS_DWORD(BUTTON_PL1UP_Y,BUTTON_HEIGHT)
|
|
||||||
dd BT_PLAYER1UP
|
|
||||||
dd BUTTON_COLOR_WORK
|
|
||||||
iend
|
|
||||||
istruc BUTTON ; player 2 down
|
|
||||||
at BUTTON.xposandsize
|
|
||||||
dd MOS_DWORD(BUTTON_PL2DN_X,BUTTON_SPIN_WIDTH)
|
|
||||||
dd MOS_DWORD(BUTTON_PL2DN_Y,BUTTON_HEIGHT)
|
|
||||||
dd BT_PLAYER2DN
|
|
||||||
dd BUTTON_COLOR_WORK
|
|
||||||
iend
|
|
||||||
istruc BUTTON ; player 2 up
|
|
||||||
at BUTTON.xposandsize
|
|
||||||
dd MOS_DWORD(BUTTON_PL2UP_X,BUTTON_SPIN_WIDTH)
|
|
||||||
dd MOS_DWORD(BUTTON_PL2UP_Y,BUTTON_HEIGHT)
|
|
||||||
dd BT_PLAYER2UP
|
|
||||||
dd BUTTON_COLOR_WORK
|
|
||||||
iend
|
|
||||||
NBUTTONS equ (($-buttons)/BUTTON_size)
|
|
||||||
|
|
||||||
|
|
||||||
;
|
|
||||||
; label table
|
|
||||||
;
|
|
||||||
%ifidn lang, 'it_IT'
|
|
||||||
newgame db "Nuova partita",0
|
|
||||||
%else
|
|
||||||
newgame db "New game",0
|
|
||||||
%endif
|
|
||||||
down db "<",0
|
|
||||||
up db ">",0
|
|
||||||
%ifidn lang, 'it_IT'
|
|
||||||
pl1 db "Giocatore 1:",0
|
|
||||||
pl2 db "Giocatore 2:",0
|
|
||||||
%else
|
|
||||||
pl1 db "Player 1:",0
|
|
||||||
pl2 db "Player 2:",0
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%ifidn lang, 'it_IT'
|
|
||||||
playertypes:
|
|
||||||
db "Umano",0
|
|
||||||
PLAYERTYPELEN equ ($ - playertypes)
|
|
||||||
db "CPU 1 ",0
|
|
||||||
db "CPU 2 ",0
|
|
||||||
db "CPU 3 ",0
|
|
||||||
db "CPU 4 ",0
|
|
||||||
db "CPU 5 ",0
|
|
||||||
db "CPU 6 ",0
|
|
||||||
db "CPU 7 ",0
|
|
||||||
db "CPU 8 ",0
|
|
||||||
%else
|
|
||||||
playertypes:
|
|
||||||
db "Human ",0
|
|
||||||
PLAYERTYPELEN equ ($ - playertypes)
|
|
||||||
db "CPU level 1 ",0
|
|
||||||
db "CPU level 2 ",0
|
|
||||||
db "CPU level 3 ",0
|
|
||||||
db "CPU level 4 ",0
|
|
||||||
db "CPU level 5 ",0
|
|
||||||
db "CPU level 6 ",0
|
|
||||||
db "CPU level 7 ",0
|
|
||||||
db "CPU level 8 ",0
|
|
||||||
%endif
|
|
||||||
|
|
||||||
NPLAYERTYPES equ (($-playertypes)/PLAYERTYPELEN)
|
|
||||||
|
|
||||||
|
|
||||||
labels:
|
|
||||||
istruc LABEL ; new
|
|
||||||
at LABEL.position
|
|
||||||
dd MOS_DWORD(BUTTON_NEW_X+4,1+BUTTON_NEW_Y+(BUTTON_HEIGHT-8)/2)
|
|
||||||
dd newgame
|
|
||||||
dd LABEL_COLOR_WORKBUTTON
|
|
||||||
dd LABEL_BGCOLOR_TRANSPARENT
|
|
||||||
iend
|
|
||||||
istruc LABEL ; player 1 down
|
|
||||||
at LABEL.position
|
|
||||||
dd MOS_DWORD(BUTTON_PL1DN_X+(BUTTON_SPIN_WIDTH-4)/2,1+BUTTON_PL1DN_Y+(BUTTON_HEIGHT-8)/2)
|
|
||||||
dd down
|
|
||||||
dd LABEL_COLOR_WORKBUTTON
|
|
||||||
dd LABEL_BGCOLOR_TRANSPARENT
|
|
||||||
iend
|
|
||||||
istruc LABEL ; player 1 up
|
|
||||||
at LABEL.position
|
|
||||||
dd MOS_DWORD(1+BUTTON_PL1UP_X+(BUTTON_SPIN_WIDTH-4)/2,1+BUTTON_PL1UP_Y+(BUTTON_HEIGHT-8)/2)
|
|
||||||
dd up
|
|
||||||
dd LABEL_COLOR_WORKBUTTON
|
|
||||||
dd LABEL_BGCOLOR_TRANSPARENT
|
|
||||||
iend
|
|
||||||
istruc LABEL ; player 2 down
|
|
||||||
at LABEL.position
|
|
||||||
dd MOS_DWORD(BUTTON_PL2DN_X+(BUTTON_SPIN_WIDTH-4)/2,1+BUTTON_PL2DN_Y+(BUTTON_HEIGHT-8)/2)
|
|
||||||
dd down
|
|
||||||
dd LABEL_COLOR_WORKBUTTON
|
|
||||||
dd LABEL_BGCOLOR_TRANSPARENT
|
|
||||||
iend
|
|
||||||
istruc LABEL ; player 2 up
|
|
||||||
at LABEL.position
|
|
||||||
dd MOS_DWORD(1+BUTTON_PL2UP_X+(BUTTON_SPIN_WIDTH-4)/2,1+BUTTON_PL2UP_Y+(BUTTON_HEIGHT-8)/2)
|
|
||||||
dd up
|
|
||||||
dd LABEL_COLOR_WORKBUTTON
|
|
||||||
dd LABEL_BGCOLOR_TRANSPARENT
|
|
||||||
iend
|
|
||||||
istruc LABEL ; player 1
|
|
||||||
at LABEL.position
|
|
||||||
dd MOS_DWORD(LABEL_PL1_X,LABEL_PL1_Y)
|
|
||||||
dd pl1
|
|
||||||
dd MOS_RGB(255,255,255)
|
|
||||||
dd LABEL_BGCOLOR_TRANSPARENT
|
|
||||||
iend
|
|
||||||
istruc LABEL ; player 2
|
|
||||||
at LABEL.position
|
|
||||||
dd MOS_DWORD(LABEL_PL2_X,LABEL_PL2_Y)
|
|
||||||
dd pl2
|
|
||||||
dd MOS_RGB(255,255,255)
|
|
||||||
dd LABEL_BGCOLOR_TRANSPARENT
|
|
||||||
iend
|
|
||||||
statusbar: ; status bar
|
|
||||||
istruc LABEL
|
|
||||||
at LABEL.position
|
|
||||||
dd MOS_DWORD(LABEL_STATUS_X,LABEL_STATUS_Y)
|
|
||||||
dd 0
|
|
||||||
dd MOS_RGB(255,255,255)
|
|
||||||
dd LABEL_BGCOLOR_TRANSPARENT
|
|
||||||
iend
|
|
||||||
label_pl1type:
|
|
||||||
istruc LABEL
|
|
||||||
at LABEL.position
|
|
||||||
%ifidn lang, 'it_IT'
|
|
||||||
dd MOS_DWORD(LABEL_PL1TYPE_X + 18,LABEL_PL1TYPE_Y)
|
|
||||||
%else
|
|
||||||
dd MOS_DWORD(LABEL_PL1TYPE_X,LABEL_PL1TYPE_Y)
|
|
||||||
%endif
|
|
||||||
dd playertypes+PL1TYPE_INIT*PLAYERTYPELEN
|
|
||||||
dd MOS_RGB(255,255,255)
|
|
||||||
dd MOS_RGB(0,0,0)
|
|
||||||
iend
|
|
||||||
label_pl2type:
|
|
||||||
istruc LABEL
|
|
||||||
at LABEL.position
|
|
||||||
%ifidn lang, 'it_IT'
|
|
||||||
dd MOS_DWORD(LABEL_PL2TYPE_X + 18,LABEL_PL2TYPE_Y)
|
|
||||||
%else
|
|
||||||
dd MOS_DWORD(LABEL_PL2TYPE_X,LABEL_PL2TYPE_Y)
|
|
||||||
%endif
|
|
||||||
dd playertypes+PL2TYPE_INIT*PLAYERTYPELEN
|
|
||||||
dd MOS_RGB(255,255,255)
|
|
||||||
dd MOS_RGB(0,0,0)
|
|
||||||
iend
|
|
||||||
NLABELS equ (($-labels)/LABEL_size)
|
|
||||||
|
|
||||||
|
|
||||||
; player types
|
; player types
|
||||||
@@ -912,23 +825,31 @@ player2_type dd PL2TYPE_INIT
|
|||||||
|
|
||||||
|
|
||||||
; status messages
|
; status messages
|
||||||
%ifidn lang, 'it_IT'
|
if lang eq it_IT
|
||||||
player1hmnprmpt db "Turno del giocatore 1",0
|
player1hmnprmpt db "Turno del giocatore 1",0
|
||||||
player2hmnprmpt db "Turno del giocatore 2",0
|
player2hmnprmpt db "Turno del giocatore 2",0
|
||||||
player1cpuprmpt db "Attendi, giocatore 1 sta pensando...",0
|
player1cpuprmpt db "Attendi, giocatore 1 sta pensando...",0
|
||||||
player2cpuprmpt db "Attendi, giocatore 2 sta pensando...",0
|
player2cpuprmpt db "Attendi, giocatore 2 sta pensando...",0
|
||||||
itisadraw db "Pareggio",0
|
itisadraw db "Pareggio",0
|
||||||
player1wins db "Vince giocatore 1",0
|
player1wins db "Vince giocatore 1",0
|
||||||
player2wins db "Vince Giocatore 2",0
|
player2wins db "Vince giocatore 2",0
|
||||||
%else
|
else if lang eq ru_RU
|
||||||
player1hmnprmpt db "Make your move, player 1.",0
|
player1hmnprmpt db "<EFBFBD><EFBFBD>ப 1 ᤥ<><E1A4A5><EFBFBD><EFBFBD><EFBFBD> 室",0
|
||||||
player2hmnprmpt db "Make your move, player 2.",0
|
player2hmnprmpt db "<EFBFBD><EFBFBD>ப 2 ᤥ<><E1A4A5><EFBFBD><EFBFBD><EFBFBD> 室",0
|
||||||
|
player1cpuprmpt db "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><>ப 1 <20>㬠<EFBFBD><E3ACA0>......",0
|
||||||
|
player2cpuprmpt db "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><>ப 2 <20>㬠<EFBFBD><E3ACA0>......",0
|
||||||
|
itisadraw db "<22><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>",0
|
||||||
|
player1wins db "<22><>ப 1 <20>먣ࠫ",0
|
||||||
|
player2wins db "<22><>ப 2 <20>먣ࠫ",0
|
||||||
|
else
|
||||||
|
player1hmnprmpt db "Make your move, player 1",0
|
||||||
|
player2hmnprmpt db "Make your move, player 2",0
|
||||||
player1cpuprmpt db "Player 1 is thinking, please wait...",0
|
player1cpuprmpt db "Player 1 is thinking, please wait...",0
|
||||||
player2cpuprmpt db "Player 2 is thinking, please wait...",0
|
player2cpuprmpt db "Player 2 is thinking, please wait...",0
|
||||||
itisadraw db "It's a draw.",0
|
itisadraw db "It's a draw",0
|
||||||
player1wins db "Player 1 wins.",0
|
player1wins db "Player 1 wins",0
|
||||||
player2wins db "Player 2 wins.",0
|
player2wins db "Player 2 wins",0
|
||||||
%endif
|
end if
|
||||||
|
|
||||||
|
|
||||||
; pointer to ai player. future releases C4 might
|
; pointer to ai player. future releases C4 might
|
||||||
@@ -936,29 +857,22 @@ player2_type dd PL2TYPE_INIT
|
|||||||
aicode dd aiGetMove
|
aicode dd aiGetMove
|
||||||
|
|
||||||
|
|
||||||
; button images
|
align 16
|
||||||
redpcx: incbin "red.pcx"
|
i_end:
|
||||||
REDPCXSIZE equ ($ - redpcx)
|
sc system_colors
|
||||||
bluepcx: incbin "blue.pcx"
|
procinfo process_information
|
||||||
BLUEPCXSIZE equ ($ - bluepcx)
|
rb 1024
|
||||||
|
align 16
|
||||||
|
stacktop:
|
||||||
|
; player input
|
||||||
|
; 0 : no input available
|
||||||
|
; 1..7 : column to drop stone into
|
||||||
|
playerinput rd 1
|
||||||
|
|
||||||
|
mouseinput rd 1
|
||||||
|
gameover rd 1
|
||||||
|
|
||||||
|
redstone rb STONESIZE*STONESIZE*3
|
||||||
|
bluestone rb STONESIZE*STONESIZE*3
|
||||||
|
mem:
|
||||||
|
|
||||||
;**********************************************************
|
|
||||||
; uninitialized data
|
|
||||||
;**********************************************************
|
|
||||||
|
|
||||||
section .bss
|
|
||||||
|
|
||||||
; player input
|
|
||||||
; 0 : no input available
|
|
||||||
; 1..7 : column to drop stone into
|
|
||||||
playerinput resd 1
|
|
||||||
|
|
||||||
mouseinput resd 1
|
|
||||||
gameover resd 1
|
|
||||||
|
|
||||||
redstone resb STONESIZE*STONESIZE*3
|
|
||||||
bluestone resb STONESIZE*STONESIZE*3
|
|
||||||
|
|
||||||
end:
|
|
||||||
|
@@ -1,305 +0,0 @@
|
|||||||
; mos.inc 0.0.2
|
|
||||||
; Copyright (c) 2002 Thomas Mathys
|
|
||||||
; killer@vantage.ch
|
|
||||||
;
|
|
||||||
; 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, write to the Free Software
|
|
||||||
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
;
|
|
||||||
;
|
|
||||||
;
|
|
||||||
; revision history
|
|
||||||
; ----------------
|
|
||||||
;
|
|
||||||
; 10-04-2002 version 0.0.2
|
|
||||||
; - removed MOS_WNDCOLORS_SIZE and similar constants.
|
|
||||||
; while reading the docs i realized that NASM creates
|
|
||||||
; such symbols already itself...
|
|
||||||
; + macros: MOS_WAITEVENT, MOS_WAITEVENT_S, MOS_STARTREDRAW,
|
|
||||||
; MOS_STARTREDRAW_S, MOS_ENDREDRAW, MOS_ENDREDRAW_S,
|
|
||||||
; MOS_GETSCREENMAX, MOS_GETSCREENMAX_S, MOS_EXIT, MOS_EXIT_S
|
|
||||||
; + event bit masks
|
|
||||||
; + some syscall numbers
|
|
||||||
; + process info structure
|
|
||||||
;
|
|
||||||
; 08-??-2002 version 0.0.1
|
|
||||||
; first release
|
|
||||||
;
|
|
||||||
%ifndef _MOS_INC
|
|
||||||
%define _MOS_INC
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
|
||||||
; generates a menuetos 01 header
|
|
||||||
; takes 2-6 parameters:
|
|
||||||
;
|
|
||||||
; MOS_HEADER01 start,end[,appmem,esp,i_param,i_icon]
|
|
||||||
;**********************************************************
|
|
||||||
|
|
||||||
%macro MOS_HEADER01 2-6 0x100000,0x7fff0,0,0
|
|
||||||
org 0x0
|
|
||||||
db 'MENUET01' ; 8 byte id
|
|
||||||
dd 0x01 ; header version
|
|
||||||
dd %1 ; start of code
|
|
||||||
dd %2 ; image size
|
|
||||||
dd %3 ; application memory
|
|
||||||
dd %4 ; esp
|
|
||||||
dd %5 ; i_param
|
|
||||||
dd %6 ; i_icon
|
|
||||||
%endmacro
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
|
||||||
; MOS_DWORD
|
|
||||||
; packs 2 words into a double word
|
|
||||||
;**********************************************************
|
|
||||||
|
|
||||||
%define MOS_DWORD(hi,lo) ((((hi) & 0xffff) << 16) + ((lo) & 0xffff))
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
|
||||||
; MOS_RGB
|
|
||||||
; creates a menuet os compatible color (0x00RRGGBB)
|
|
||||||
;**********************************************************
|
|
||||||
|
|
||||||
%define MOS_RGB(r,g,b) ((((r) & 255) << 16) + (((g) & 255) << 8) + ((b) & 255))
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
|
||||||
; window color structure
|
|
||||||
;**********************************************************
|
|
||||||
|
|
||||||
struc MOS_WNDCOLORS
|
|
||||||
.frame: resd 1
|
|
||||||
.grab: resd 1
|
|
||||||
.grabButton: resd 1
|
|
||||||
.grabButtonText: resd 1
|
|
||||||
.grabText: resd 1
|
|
||||||
.work: resd 1
|
|
||||||
.workButton: resd 1
|
|
||||||
.workButtonText: resd 1
|
|
||||||
.workText: resd 1
|
|
||||||
.workGraphics: resd 1
|
|
||||||
endstruc
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
|
||||||
; process info structure
|
|
||||||
;**********************************************************
|
|
||||||
|
|
||||||
struc MOS_PROCESSINFO
|
|
||||||
.CPUUsage: resd 1 ; cpu usage
|
|
||||||
.windowStackPos: resw 1 ; process' position in windowing stack
|
|
||||||
.windowStackVal: resw 1 ; window stack value at ecx
|
|
||||||
.reserved1: resw 1
|
|
||||||
.processName: resb 12 ; process name
|
|
||||||
.memStart: resd 1 ; start of process memory
|
|
||||||
.memUsed: resd 1 ; memory used by the process
|
|
||||||
.pid: resd 1 ; process id
|
|
||||||
.reserved2: resb (1024-34)
|
|
||||||
endstruc
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
|
||||||
; system call numbers
|
|
||||||
;**********************************************************
|
|
||||||
|
|
||||||
MOS_SC_EXIT equ -1
|
|
||||||
MOS_SC_DEFINEWINDOW equ 0
|
|
||||||
MOS_SC_PUTPIXEL equ 1
|
|
||||||
MOS_SC_GETKEY equ 2
|
|
||||||
MOS_SC_GETSYSCLOCK equ 3
|
|
||||||
MOS_SC_WRITETEXT equ 4
|
|
||||||
MOS_SC_DELAY equ 5
|
|
||||||
MOS_SC_OPENFILEFLOPPY equ 6
|
|
||||||
MOS_SC_PUTIMAGE equ 7
|
|
||||||
MOS_SC_DEFINEBUTTON equ 8
|
|
||||||
MOS_SC_GETPROCESSINFO equ 9
|
|
||||||
MOS_SC_WAITEVENT equ 10
|
|
||||||
MOS_SC_CHECKEVENT equ 11
|
|
||||||
MOS_SC_REDRAWSTATUS equ 12
|
|
||||||
MOS_SC_DRAWBAR equ 13
|
|
||||||
MOS_SC_GETSCREENMAX equ 14
|
|
||||||
MOS_SC_SETBACKGROUND equ 15
|
|
||||||
MOS_SC_GETPRESSEDBUTTON equ 17
|
|
||||||
MOS_SC_SYSTEMSERVICE equ 18
|
|
||||||
MOS_SC_STARTPROGRAM equ 19
|
|
||||||
MOS_SC_MIDIINTERFACE equ 20
|
|
||||||
MOS_SC_DEVICESETUP equ 21
|
|
||||||
MOS_SC_WAITEVENTTIMEOUT equ 23
|
|
||||||
MOS_SC_CDAUDIO equ 24
|
|
||||||
MOS_SC_SB16MIXER1 equ 25
|
|
||||||
MOS_SC_GETDEVICESETUP equ 26
|
|
||||||
MOS_SC_WSS equ 27
|
|
||||||
MOS_SC_SB16MIXER2 equ 28
|
|
||||||
MOS_SC_GETDATE equ 29
|
|
||||||
MOS_SC_READHD equ 30
|
|
||||||
MOS_SC_STARTPROGRAMHD equ 31
|
|
||||||
MOS_SC_GETSCREENPIXEL equ 35
|
|
||||||
MOS_SC_GETMOUSEPOSITION equ 37
|
|
||||||
MOS_SC_DRAWLINE equ 38
|
|
||||||
MOS_SC_GETBACKGROUND equ 39
|
|
||||||
MOS_SC_SETEVENTMASK equ 40
|
|
||||||
MOS_SC_WRITENUMBER equ 47
|
|
||||||
MOS_SC_WINDOWPROPERTIES equ 48
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
|
||||||
; event numbers
|
|
||||||
;**********************************************************
|
|
||||||
|
|
||||||
MOS_EVT_NONE equ 0
|
|
||||||
MOS_EVT_REDRAW equ 1
|
|
||||||
MOS_EVT_KEY equ 2
|
|
||||||
MOS_EVT_BUTTON equ 3
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
|
||||||
; event bits
|
|
||||||
;**********************************************************
|
|
||||||
|
|
||||||
MOS_EVTBIT_REDRAW equ (1 << 0)
|
|
||||||
MOS_EVTBIT_KEY equ (1 << 1)
|
|
||||||
MOS_EVTBIT_BUTTON equ (1 << 2)
|
|
||||||
MOS_EVTBIT_ENDREQUEST equ (1 << 3)
|
|
||||||
MOS_EVTBIT_BGDRAW equ (1 << 4)
|
|
||||||
MOS_EVTBIT_MOUSECHANGE equ (1 << 5)
|
|
||||||
MOS_EVTBIT_IPCEVENT equ (1 << 6)
|
|
||||||
MOS_EVTBIT_IRQ0 equ (1 << 16)
|
|
||||||
MOS_EVTBIT_IRQ1 equ (1 << 17)
|
|
||||||
MOS_EVTBIT_IRQ2 equ (1 << 18)
|
|
||||||
MOS_EVTBIT_IRQ3 equ (1 << 19)
|
|
||||||
MOS_EVTBIT_IRQ4 equ (1 << 20)
|
|
||||||
MOS_EVTBIT_IRQ5 equ (1 << 21)
|
|
||||||
MOS_EVTBIT_IRQ6 equ (1 << 22)
|
|
||||||
MOS_EVTBIT_IRQ7 equ (1 << 23)
|
|
||||||
MOS_EVTBIT_IRQ8 equ (1 << 24)
|
|
||||||
MOS_EVTBIT_IRQ9 equ (1 << 25)
|
|
||||||
MOS_EVTBIT_IRQ10 equ (1 << 26)
|
|
||||||
MOS_EVTBIT_IRQ11 equ (1 << 27)
|
|
||||||
MOS_EVTBIT_IRQ12 equ (1 << 28)
|
|
||||||
MOS_EVTBIT_IRQ13 equ (1 << 29)
|
|
||||||
MOS_EVTBIT_IRQ14 equ (1 << 30)
|
|
||||||
MOS_EVTBIT_IRQ15 equ (1 << 31)
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
|
||||||
; exit application (syscall -1)
|
|
||||||
;**********************************************************
|
|
||||||
|
|
||||||
; exit application
|
|
||||||
%macro MOS_EXIT 0
|
|
||||||
mov eax,MOS_SC_EXIT
|
|
||||||
int 0x40
|
|
||||||
%endmacro
|
|
||||||
|
|
||||||
; exit application, smaller version
|
|
||||||
%macro MOS_EXIT_S 0
|
|
||||||
xor eax,eax
|
|
||||||
dec eax
|
|
||||||
int 0x40
|
|
||||||
%endmacro
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
|
||||||
; wait event stuff
|
|
||||||
; (MOS_SC_WAITEVENT, syscall 10)
|
|
||||||
;**********************************************************
|
|
||||||
|
|
||||||
; wait for event
|
|
||||||
; destroys : nothing
|
|
||||||
; returns : eax = event type
|
|
||||||
%macro MOS_WAITEVENT 0
|
|
||||||
mov eax,MOS_SC_WAITEVENT
|
|
||||||
int 0x40
|
|
||||||
%endmacro
|
|
||||||
|
|
||||||
; wait for event, smaller version
|
|
||||||
; destroys : flags
|
|
||||||
; returns : eax = event type
|
|
||||||
%macro MOS_WAITEVENT_S 0
|
|
||||||
xor eax,eax
|
|
||||||
mov al,MOS_SC_WAITEVENT
|
|
||||||
int 0x40
|
|
||||||
%endmacro
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
|
||||||
; window redraw status stuff
|
|
||||||
; (MOS_SC_REDRAWSTATUS, syscall 12)
|
|
||||||
;**********************************************************
|
|
||||||
|
|
||||||
MOS_RS_STARTREDRAW equ 1
|
|
||||||
MOS_RS_ENDREDRAW equ 2
|
|
||||||
|
|
||||||
; start window redraw
|
|
||||||
; destroys: eax,ebx
|
|
||||||
%macro MOS_STARTREDRAW 0
|
|
||||||
mov ebx,MOS_RS_STARTREDRAW
|
|
||||||
mov eax,MOS_SC_REDRAWSTATUS
|
|
||||||
int 0x40
|
|
||||||
%endmacro
|
|
||||||
|
|
||||||
; start window redraw, smaller version
|
|
||||||
; destroys: eax,ebx,flags
|
|
||||||
%macro MOS_STARTREDRAW_S 0
|
|
||||||
xor ebx,ebx
|
|
||||||
inc ebx
|
|
||||||
xor eax,eax
|
|
||||||
mov al,MOS_SC_REDRAWSTATUS
|
|
||||||
int 0x40
|
|
||||||
%endmacro
|
|
||||||
|
|
||||||
; end window redraw
|
|
||||||
; destroys: eax,ebx
|
|
||||||
%macro MOS_ENDREDRAW 0
|
|
||||||
mov ebx,MOS_RS_ENDREDRAW
|
|
||||||
mov eax,MOS_SC_REDRAWSTATUS
|
|
||||||
int 0x40
|
|
||||||
%endmacro
|
|
||||||
|
|
||||||
; end window redraw, smaller version
|
|
||||||
; destroys: eax,ebx,flags
|
|
||||||
%macro MOS_ENDREDRAW_S 0
|
|
||||||
xor ebx,ebx
|
|
||||||
mov bl,MOS_RS_ENDREDRAW
|
|
||||||
xor eax,eax
|
|
||||||
mov al,MOS_SC_REDRAWSTATUS
|
|
||||||
int 0x40
|
|
||||||
%endmacro
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
|
||||||
; get screen max stuff (syscall 14)
|
|
||||||
;**********************************************************
|
|
||||||
|
|
||||||
; get screen dimensions in eax
|
|
||||||
; destroys: nothing
|
|
||||||
%macro MOS_GETSCREENMAX 0
|
|
||||||
mov eax,MOS_SC_GETSCREENMAX
|
|
||||||
int 0x40
|
|
||||||
%endmacro
|
|
||||||
|
|
||||||
; get screen dimensions in eax, smaller version
|
|
||||||
; destroys: flags
|
|
||||||
%macro MOS_GETSCREENMAX_S 0
|
|
||||||
xor eax,eax
|
|
||||||
mov al,MOS_SC_GETSCREENMAX
|
|
||||||
int 0x40
|
|
||||||
%endmacro
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%endif
|
|
@@ -16,38 +16,32 @@
|
|||||||
; along with this program; if not, write to the Free Software
|
; along with this program; if not, write to the Free Software
|
||||||
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
%ifndef _PCX_INC
|
|
||||||
%define _PCX_INC
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
;**********************************************************
|
||||||
; pcx header
|
; pcx header
|
||||||
;**********************************************************
|
;**********************************************************
|
||||||
|
|
||||||
PCXHEADER_SIZE equ 128
|
PCXHEADER_SIZE equ 128
|
||||||
struc PCXHEADER
|
struct PCXHEADER
|
||||||
.id: resb 1 ; id, should be 10
|
id rb 1 ; id, should be 10
|
||||||
.version: resb 1 ; pcx version
|
version rb 1 ; pcx version
|
||||||
.encoding: resb 1 ; 1 = rle
|
encoding rb 1 ; 1 = rle
|
||||||
.bpp: resb 1 ; bits per pixel
|
bpp rb 1 ; bits per pixel
|
||||||
.xmin: resw 1 ; image dimensions
|
xmin rw 1 ; image dimensions
|
||||||
.ymin: resw 1
|
ymin rw 1
|
||||||
.xmax: resw 1
|
xmax rw 1
|
||||||
.ymax: resw 1
|
ymax rw 1
|
||||||
.hdpi: resw 1 ; horizontal resolution in dpi
|
hdpi rw 1 ; horizontal resolution in dpi
|
||||||
.vdpi: resw 1 ; verttical resolution in dpi
|
vdpi rw 1 ; verttical resolution in dpi
|
||||||
.colormap: resb 48 ; 16 color palette
|
colormap rb 48 ; 16 color palette
|
||||||
.reserved1: resb 1
|
reserved1 rb 1
|
||||||
.nplanes: resb 1 ; # of color planes
|
nplanes rb 1 ; # of color planes
|
||||||
.bytesperline: resw 1 ; # of bytes per scanline. always even
|
bytesperline rw 1 ; # of bytes per scanline. always even
|
||||||
.palinfo: resw 1 ; 1 = color/bw, 2 = grayscale
|
palinfo rw 1 ; 1 = color/bw, 2 = grayscale
|
||||||
.hscreensize: resw 1 ; horizontal screen size
|
hscreensize rw 1 ; horizontal screen size
|
||||||
.vscreensize: resw 1 ; vertical screen size
|
vscreensize rw 1 ; vertical screen size
|
||||||
.reserved2: resb 54
|
reserved2 rb 54
|
||||||
endstruc
|
ends
|
||||||
|
|
||||||
|
|
||||||
section .text
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -98,7 +92,7 @@ loadPCX:
|
|||||||
.decode:
|
.decode:
|
||||||
lodsb ; read byte from input stream
|
lodsb ; read byte from input stream
|
||||||
cmp al,192 ; encoded/unencoded byte ?
|
cmp al,192 ; encoded/unencoded byte ?
|
||||||
jae short .encoded
|
jae .encoded
|
||||||
lea edx,[eax*2+eax] ; read color values from
|
lea edx,[eax*2+eax] ; read color values from
|
||||||
mov al,[ebx+edx+2] ; palette and store them
|
mov al,[ebx+edx+2] ; palette and store them
|
||||||
stosb ; in the destination image
|
stosb ; in the destination image
|
||||||
@@ -107,7 +101,7 @@ loadPCX:
|
|||||||
mov al,[ebx+edx+0]
|
mov al,[ebx+edx+0]
|
||||||
stosb
|
stosb
|
||||||
dec ebp ; one less to go...
|
dec ebp ; one less to go...
|
||||||
jmp short .continue
|
jmp .continue
|
||||||
.encoded:
|
.encoded:
|
||||||
and al,00111111b ; calc # of times to repeat
|
and al,00111111b ; calc # of times to repeat
|
||||||
mov cl,al
|
mov cl,al
|
||||||
@@ -127,11 +121,8 @@ loadPCX:
|
|||||||
xor ah,ah ; reset ah to 0 !
|
xor ah,ah ; reset ah to 0 !
|
||||||
.continue:
|
.continue:
|
||||||
or ebp,ebp ; all pixels decoded ?
|
or ebp,ebp ; all pixels decoded ?
|
||||||
jnz short .decode
|
jnz .decode
|
||||||
|
|
||||||
popfd
|
popfd
|
||||||
popad
|
popad
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
%endif
|
|
@@ -18,12 +18,6 @@
|
|||||||
; along with C4; if not, write to the Free Software
|
; along with C4; if not, write to the Free Software
|
||||||
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
%infdef _RANDOMAI_INC
|
|
||||||
%define _RANDOMAI_INC
|
|
||||||
|
|
||||||
section .text
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
;**********************************************************
|
||||||
; randomaiGetMove
|
; randomaiGetMove
|
||||||
@@ -47,4 +41,3 @@ randomaiGetMove
|
|||||||
mov eax,edx ; return move
|
mov eax,edx ; return move
|
||||||
ret
|
ret
|
||||||
|
|
||||||
%endif
|
|
@@ -18,10 +18,6 @@
|
|||||||
; along with C4; if not, write to the Free Software
|
; along with C4; if not, write to the Free Software
|
||||||
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
%ifndef _RNG_INC
|
|
||||||
%define _RNG_INC
|
|
||||||
|
|
||||||
section .data
|
|
||||||
|
|
||||||
|
|
||||||
; random seed
|
; random seed
|
||||||
@@ -29,9 +25,6 @@ seed dd 0
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
section .text
|
|
||||||
|
|
||||||
|
|
||||||
;**********************************************************
|
;**********************************************************
|
||||||
; randomize
|
; randomize
|
||||||
; initialize random number generator.
|
; initialize random number generator.
|
||||||
@@ -43,8 +36,7 @@ seed dd 0
|
|||||||
;**********************************************************
|
;**********************************************************
|
||||||
randomize:
|
randomize:
|
||||||
push eax
|
push eax
|
||||||
mov eax,MOS_SC_GETSYSCLOCK
|
mcall SF_GET_SYS_TIME
|
||||||
int 0x40
|
|
||||||
mov [seed],eax
|
mov [seed],eax
|
||||||
pop eax
|
pop eax
|
||||||
ret
|
ret
|
||||||
@@ -72,5 +64,3 @@ rand:
|
|||||||
pop edx
|
pop edx
|
||||||
popfd
|
popfd
|
||||||
ret
|
ret
|
||||||
|
|
||||||
%endif
|
|
@@ -16,63 +16,52 @@
|
|||||||
; along with this program; if not, write to the Free Software
|
; along with this program; if not, write to the Free Software
|
||||||
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
%ifndef _WINDOWS_INC
|
|
||||||
%define _WINDOWS_INC
|
|
||||||
|
|
||||||
|
WND_CENTER equ (1 shl 0)
|
||||||
WND_CENTER equ (1 << 0)
|
WND_DEFAULT_WORKCOLOR equ (1 shl 1)
|
||||||
WND_DEFAULT_WORKCOLOR equ (1 << 1)
|
WND_DEFAULT_GRABCOLOR equ (1 shl 2)
|
||||||
WND_DEFAULT_GRABCOLOR equ (1 << 2)
|
WND_DEFAULT_FRAMECOLOR equ (1 shl 3)
|
||||||
WND_DEFAULT_FRAMECOLOR equ (1 << 3)
|
WND_DEFAULT_CAPTIONCOLOR equ (1 shl 4)
|
||||||
WND_DEFAULT_CAPTIONCOLOR equ (1 << 4)
|
|
||||||
WND_DEFAULT_COLORS equ (WND_DEFAULT_WORKCOLOR | WND_DEFAULT_GRABCOLOR | WND_DEFAULT_FRAMECOLOR | WND_DEFAULT_CAPTIONCOLOR)
|
WND_DEFAULT_COLORS equ (WND_DEFAULT_WORKCOLOR | WND_DEFAULT_GRABCOLOR | WND_DEFAULT_FRAMECOLOR | WND_DEFAULT_CAPTIONCOLOR)
|
||||||
|
|
||||||
|
|
||||||
struc WND
|
struct WND
|
||||||
.xposandsize resd 1 ; x position and size (like syscall)
|
xposandsize rd 1 ; x position and size (like syscall)
|
||||||
.yposandsize resd 1 ; y position and size (like syscall)
|
yposandsize rd 1 ; y position and size (like syscall)
|
||||||
.workcolor resd 1 ; work area color (like syscall)
|
workcolor rd 1 ; work area color (like syscall)
|
||||||
.grabcolor resd 1 ; grab bar color (like syscall)
|
grabcolor rd 1 ; grab bar color (like syscall)
|
||||||
.framecolor resd 1 ; frame color (like syscall)
|
framecolor rd 1 ; frame color (like syscall)
|
||||||
.caption resd 1 ; pointer to caption (zero terminated)
|
caption rd 1 ; pointer to caption (zero terminated)
|
||||||
; can be zero, if no caption is desired.
|
; can be zero, if no caption is desired.
|
||||||
.captioncolor resd 1 ; caption color
|
captioncolor rd 1 ; caption color
|
||||||
.flags resd 1 ; combination of WND_xxx flags, or zero.
|
flags rd 1 ; combination of WND_xxx flags, or zero.
|
||||||
endstruc
|
ends
|
||||||
|
|
||||||
|
USE_SYSTEM_COLORS equ 0 ;0 or 1
|
||||||
|
BUTTON_COLOR_WORK equ 0x505050
|
||||||
|
|
||||||
|
|
||||||
BUTTON_COLOR_GRAB equ 0x01000000
|
struct BUTTON
|
||||||
BUTTON_COLOR_WORK equ 0x02000000
|
xposandsize rd 1 ; x position and size (like syscall)
|
||||||
|
yposandsize rd 1 ; y position and size (like syscall)
|
||||||
|
id rd 1 ; button id
|
||||||
struc BUTTON
|
color rd 1 ; button color. can be a real color
|
||||||
.xposandsize resd 1 ; x position and size (like syscall)
|
|
||||||
.yposandsize resd 1 ; y position and size (like syscall)
|
|
||||||
.id resd 1 ; button id
|
|
||||||
.color resd 1 ; button color. can be a real color
|
|
||||||
; or one of the BUTTON_COLOR_xxx constants
|
; or one of the BUTTON_COLOR_xxx constants
|
||||||
endstruc
|
ends
|
||||||
|
|
||||||
|
|
||||||
LABEL_COLOR_GRABBUTTON equ 0x01000000 ; use grab button text default color
|
LABEL_COLOR_WORKBUTTON equ 0xffffff ; use work button text default color
|
||||||
LABEL_COLOR_GRAB equ 0x02000000 ; use grab text default color
|
|
||||||
LABEL_COLOR_WORKBUTTON equ 0x03000000 ; use work button text default color
|
|
||||||
LABEL_COLOR_WORK equ 0x04000000 ; use work text default color
|
|
||||||
LABEL_BGCOLOR_TRANSPARENT equ 0x01000000 ; transparent
|
LABEL_BGCOLOR_TRANSPARENT equ 0x01000000 ; transparent
|
||||||
LABEL_BGCOLOR_WORK equ 0x02000000 ; use work area color
|
|
||||||
|
|
||||||
|
|
||||||
struc LABEL
|
struct LABEL
|
||||||
.position resd 1 ; position, x in upper word, y in lower word
|
position rd 1 ; position, x in upper word, y in lower word
|
||||||
.caption resd 1 ; pointer to caption (zero terminated)
|
caption rd 1 ; pointer to caption (zero terminated)
|
||||||
; if this is field is zero, the label will
|
; if this is field is zero, the label will
|
||||||
; not be drawn.
|
; not be drawn.
|
||||||
.color resd 1 ; text color, or a LABEL_COLOR_xxx constant
|
color rd 1 ; text color, or a LABEL_COLOR_xxx constant
|
||||||
.bgcolor resd 1 ; background color, or a LABEL_BGCOLOR_xxx constant
|
bgcolor rd 1 ; background color, or a LABEL_BGCOLOR_xxx constant
|
||||||
endstruc
|
ends
|
||||||
|
|
||||||
|
|
||||||
section .text
|
|
||||||
|
|
||||||
|
|
||||||
;***********************************************************
|
;***********************************************************
|
||||||
@@ -87,61 +76,47 @@ endstruc
|
|||||||
;***********************************************************
|
;***********************************************************
|
||||||
|
|
||||||
drawWindow:
|
drawWindow:
|
||||||
|
|
||||||
%define WNDCOLORS ebp-MOS_WNDCOLORS_size
|
|
||||||
|
|
||||||
enter MOS_WNDCOLORS_size,0
|
|
||||||
pushfd
|
pushfd
|
||||||
pushad
|
pushad
|
||||||
|
|
||||||
; get default window colors
|
; get default window colors
|
||||||
mov ebx,3
|
mcall SF_STYLE_SETTINGS,3,sc,sizeof.system_colors
|
||||||
lea ecx,[WNDCOLORS]
|
|
||||||
mov edx,MOS_WNDCOLORS_size
|
|
||||||
mov eax,MOS_SC_WINDOWPROPERTIES
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
;
|
;
|
||||||
; window position
|
; window position
|
||||||
;
|
;
|
||||||
test dword [edi + WND.flags],WND_CENTER ; center window ?
|
test dword [edi + WND.flags],WND_CENTER ; center window ?
|
||||||
jnz short .center
|
jnz .center
|
||||||
mov ebx,[edi + WND.xposandsize] ; nope -> just load dimensions
|
mov ebx,[edi + WND.xposandsize] ; nope -> just load dimensions
|
||||||
mov ecx,[edi + WND.yposandsize]
|
mov ecx,[edi + WND.yposandsize]
|
||||||
jmp short .positionok
|
jmp .positionok
|
||||||
.center: ; so let's center this window...
|
.center: ; so let's center this window...
|
||||||
MOS_GETSCREENMAX ; get screen dimensions
|
mcall SF_GET_SCREEN_SIZE ; get screen dimensions
|
||||||
mov ebx,eax ; xpos = (screenx-width)/2
|
mov ebx,eax ; xpos = (screenx-width)/2
|
||||||
shr ebx,16
|
shr ebx,16
|
||||||
sub bx,[edi + WND.xposandsize]
|
sub bx,word[edi + WND.xposandsize]
|
||||||
jns short .xok
|
jns .xok
|
||||||
xor ebx,ebx
|
xor ebx,ebx
|
||||||
.xok:
|
.xok:
|
||||||
shl ebx,15 ; / 2, move result to hi-word
|
shl ebx,15 ; / 2, move result to hi-word
|
||||||
mov bx,[edi + WND.xposandsize]
|
mov bx,word[edi + WND.xposandsize]
|
||||||
movzx ecx,ax ; same for ypos
|
movzx ecx,ax ; same for ypos
|
||||||
sub cx,[edi + WND.yposandsize]
|
sub cx,word[edi + WND.yposandsize]
|
||||||
jns short .yok
|
jns .yok
|
||||||
xor ecx,ecx
|
xor ecx,ecx
|
||||||
.yok:
|
.yok:
|
||||||
shl ecx,15
|
shl ecx,15
|
||||||
mov cx,[edi + WND.yposandsize]
|
mov cx,word[edi + WND.yposandsize]
|
||||||
.positionok: ; ebx/ecx contain dimensions
|
.positionok: ; ebx/ecx contain dimensions
|
||||||
|
|
||||||
push edi
|
|
||||||
|
|
||||||
; define window
|
; define window
|
||||||
mov eax,MOS_SC_DEFINEWINDOW
|
|
||||||
mov edx,[edi + WND.workcolor]
|
mov edx,[edi + WND.workcolor]
|
||||||
mov edi,windowtitle
|
mov edi,windowtitle
|
||||||
int 0x40
|
mcall SF_CREATE_WINDOW
|
||||||
pop edi
|
|
||||||
|
|
||||||
popad
|
popad
|
||||||
popfd
|
popfd
|
||||||
leave
|
|
||||||
ret
|
ret
|
||||||
%undef WNDCOLORS
|
|
||||||
|
|
||||||
|
|
||||||
;***********************************************************
|
;***********************************************************
|
||||||
@@ -153,53 +128,40 @@ drawWindow:
|
|||||||
; destroys: nothing
|
; destroys: nothing
|
||||||
; notes: you must call begin redraw/end redraw yourself
|
; notes: you must call begin redraw/end redraw yourself
|
||||||
;***********************************************************
|
;***********************************************************
|
||||||
|
align 4
|
||||||
drawButtons:
|
drawButtons:
|
||||||
|
|
||||||
%define WNDCOLORS ebp-MOS_WNDCOLORS_size
|
|
||||||
|
|
||||||
or ecx,ecx
|
or ecx,ecx
|
||||||
jnz short .ok
|
jnz .ok
|
||||||
ret
|
ret
|
||||||
.ok:
|
.ok:
|
||||||
enter MOS_WNDCOLORS_size,0
|
|
||||||
pushfd
|
pushfd
|
||||||
pushad
|
pushad
|
||||||
|
|
||||||
; get default window colors
|
; get default window colors
|
||||||
|
if USE_SYSTEM_COLORS eq 1
|
||||||
push ecx
|
push ecx
|
||||||
mov ebx,3
|
mcall SF_STYLE_SETTINGS,3,sc,sizeof.system_colors
|
||||||
lea ecx,[WNDCOLORS]
|
|
||||||
mov edx,MOS_WNDCOLORS_size
|
|
||||||
mov eax,MOS_SC_WINDOWPROPERTIES
|
|
||||||
int 0x40
|
|
||||||
pop ecx
|
pop ecx
|
||||||
|
end if
|
||||||
|
align 4
|
||||||
.drawall:
|
.drawall:
|
||||||
push ecx
|
push ecx
|
||||||
mov ebx,[edi + BUTTON.xposandsize]
|
mov ebx,[edi + BUTTON.xposandsize]
|
||||||
mov ecx,[edi + BUTTON.yposandsize]
|
mov ecx,[edi + BUTTON.yposandsize]
|
||||||
mov edx,[edi + BUTTON.id]
|
mov edx,[edi + BUTTON.id]
|
||||||
mov esi,[edi + BUTTON.color]
|
if USE_SYSTEM_COLORS eq 1
|
||||||
cmp esi,BUTTON_COLOR_GRAB ; use a default color ?
|
mov esi,[sc.work_button] ; use a system color
|
||||||
jne .ok1
|
else
|
||||||
mov esi,[WNDCOLORS + MOS_WNDCOLORS.grabButton]
|
mov esi,[edi + BUTTON.color] ; use a default color
|
||||||
.ok1:
|
end if
|
||||||
cmp esi,BUTTON_COLOR_WORK
|
mcall SF_DEFINE_BUTTON
|
||||||
jne .ok2
|
add edi,sizeof.BUTTON
|
||||||
mov esi,[WNDCOLORS + MOS_WNDCOLORS.workButton]
|
|
||||||
.ok2:
|
|
||||||
mov eax,MOS_SC_DEFINEBUTTON
|
|
||||||
int 0x40
|
|
||||||
add edi,BUTTON_size
|
|
||||||
pop ecx
|
pop ecx
|
||||||
loop .drawall
|
loop .drawall
|
||||||
|
|
||||||
popad
|
popad
|
||||||
popfd
|
popfd
|
||||||
leave
|
|
||||||
ret
|
ret
|
||||||
%undef WNDCOLORS
|
|
||||||
|
|
||||||
|
|
||||||
;***********************************************************
|
;***********************************************************
|
||||||
@@ -210,33 +172,27 @@ drawButtons:
|
|||||||
; output: nothing
|
; output: nothing
|
||||||
; destroys: nothing
|
; destroys: nothing
|
||||||
;***********************************************************
|
;***********************************************************
|
||||||
|
align 4
|
||||||
drawLabels:
|
drawLabels:
|
||||||
|
|
||||||
%define WNDCOLORS ebp-MOS_WNDCOLORS_size
|
|
||||||
|
|
||||||
or ecx,ecx
|
or ecx,ecx
|
||||||
jnz short .ok
|
jnz .ok
|
||||||
ret
|
ret
|
||||||
.ok:
|
.ok:
|
||||||
enter MOS_WNDCOLORS_size,0
|
|
||||||
pushfd
|
pushfd
|
||||||
pushad
|
pushad
|
||||||
|
|
||||||
; get default window colors
|
; get default window colors
|
||||||
|
if USE_SYSTEM_COLORS eq 1
|
||||||
push ecx
|
push ecx
|
||||||
mov ebx,3
|
mcall SF_STYLE_SETTINGS,3,sc,sizeof.system_colors
|
||||||
lea ecx,[WNDCOLORS]
|
|
||||||
mov edx,MOS_WNDCOLORS_size
|
|
||||||
mov eax,MOS_SC_WINDOWPROPERTIES
|
|
||||||
int 0x40
|
|
||||||
pop ecx
|
pop ecx
|
||||||
|
end if
|
||||||
|
|
||||||
.drawall:
|
.drawall:
|
||||||
push ecx
|
push ecx
|
||||||
|
|
||||||
cmp dword [edi + LABEL.caption],0
|
cmp dword [edi + LABEL.caption],0
|
||||||
jne short .notnull
|
jne .notnull
|
||||||
jmp .next
|
jmp .next
|
||||||
.notnull:
|
.notnull:
|
||||||
|
|
||||||
@@ -261,41 +217,28 @@ drawLabels:
|
|||||||
mov bx,ax
|
mov bx,ax
|
||||||
mov ecx,[edi + LABEL.position] ; ecx = ystart/height
|
mov ecx,[edi + LABEL.position] ; ecx = ystart/height
|
||||||
shl ecx,16
|
shl ecx,16
|
||||||
mov cx,8
|
mov cx,8
|
||||||
|
if USE_SYSTEM_COLORS eq 1
|
||||||
|
mov edx,[sc.work]
|
||||||
|
else
|
||||||
mov edx,[edi + LABEL.bgcolor]
|
mov edx,[edi + LABEL.bgcolor]
|
||||||
cmp edx,LABEL_BGCOLOR_WORK
|
end if
|
||||||
jne short .bgcolorok
|
mcall SF_DRAW_RECT
|
||||||
mov edx,[WNDCOLORS + MOS_WNDCOLORS.work]
|
|
||||||
.bgcolorok:
|
|
||||||
mov eax,MOS_SC_DRAWBAR
|
|
||||||
int 0x40
|
|
||||||
.clearok:
|
.clearok:
|
||||||
|
|
||||||
; draw label
|
; draw label
|
||||||
mov ebx,[edi + LABEL.position] ; ebx = label position
|
mov ebx,[edi + LABEL.position] ; ebx = label position
|
||||||
mov edx,[edi + LABEL.caption] ; edx -> caption
|
mov edx,[edi + LABEL.caption] ; edx -> caption
|
||||||
|
|
||||||
|
if USE_SYSTEM_COLORS eq 1
|
||||||
|
mov ecx,[sc.work_button_text]
|
||||||
|
else
|
||||||
mov ecx,[edi + LABEL.color] ; ecx = color
|
mov ecx,[edi + LABEL.color] ; ecx = color
|
||||||
cmp ecx,LABEL_COLOR_GRABBUTTON
|
end if
|
||||||
jne short .ok1
|
mcall SF_DRAW_TEXT
|
||||||
mov ecx,[WNDCOLORS + MOS_WNDCOLORS.grabButtonText]
|
|
||||||
.ok1:
|
|
||||||
cmp ecx,LABEL_COLOR_GRAB
|
|
||||||
jne short .ok2
|
|
||||||
mov ecx,[WNDCOLORS + MOS_WNDCOLORS.grabText]
|
|
||||||
.ok2:
|
|
||||||
cmp ecx,LABEL_COLOR_WORKBUTTON
|
|
||||||
jne short .ok3
|
|
||||||
mov ecx,[WNDCOLORS + MOS_WNDCOLORS.workButtonText]
|
|
||||||
.ok3:
|
|
||||||
cmp ecx,LABEL_COLOR_WORK
|
|
||||||
jne short .ok4
|
|
||||||
mov ecx,[WNDCOLORS + MOS_WNDCOLORS.workText]
|
|
||||||
.ok4:
|
|
||||||
mov eax,MOS_SC_WRITETEXT
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
.next:
|
.next:
|
||||||
add edi,LABEL_size ; next label
|
add edi,sizeof.LABEL ; next label
|
||||||
pop ecx
|
pop ecx
|
||||||
dec ecx
|
dec ecx
|
||||||
jz .done
|
jz .done
|
||||||
@@ -304,9 +247,5 @@ drawLabels:
|
|||||||
|
|
||||||
popad
|
popad
|
||||||
popfd
|
popfd
|
||||||
leave
|
|
||||||
ret
|
ret
|
||||||
%undef WNDCOLORS
|
|
||||||
|
|
||||||
|
|
||||||
%endif
|
|
510
programs/if.inc
Normal file
510
programs/if.inc
Normal file
@@ -0,0 +1,510 @@
|
|||||||
|
; flat assembler version 1.73
|
||||||
|
; Copyright (c) 1999-2024, Tomasz Grysztar.
|
||||||
|
; All rights reserved.
|
||||||
|
|
||||||
|
; Macroinstructions for HLL-style conditional operations
|
||||||
|
|
||||||
|
macro .if [arg]
|
||||||
|
{
|
||||||
|
common
|
||||||
|
__IF equ
|
||||||
|
local ..endif
|
||||||
|
__ENDIF equ ..endif
|
||||||
|
local ..else
|
||||||
|
__ELSE equ ..else
|
||||||
|
JNCOND __ELSE,arg
|
||||||
|
}
|
||||||
|
|
||||||
|
macro .else
|
||||||
|
{
|
||||||
|
jmp __ENDIF
|
||||||
|
__ELSE:
|
||||||
|
restore __IF
|
||||||
|
__IF equ ,
|
||||||
|
}
|
||||||
|
|
||||||
|
macro .elseif [arg]
|
||||||
|
{
|
||||||
|
common
|
||||||
|
jmp __ENDIF
|
||||||
|
__ELSE:
|
||||||
|
restore __ELSE
|
||||||
|
local ..else
|
||||||
|
__ELSE equ ..else
|
||||||
|
JNCOND __ELSE,arg
|
||||||
|
}
|
||||||
|
|
||||||
|
macro .endif
|
||||||
|
{
|
||||||
|
if __IF eq
|
||||||
|
__ELSE:
|
||||||
|
end if
|
||||||
|
__ENDIF:
|
||||||
|
restore __ELSE
|
||||||
|
restore __ENDIF
|
||||||
|
restore __IF
|
||||||
|
}
|
||||||
|
|
||||||
|
macro .while [arg]
|
||||||
|
{
|
||||||
|
common
|
||||||
|
local ..while
|
||||||
|
__WHILE equ ..while
|
||||||
|
local ..endw
|
||||||
|
__ENDW equ ..endw
|
||||||
|
__WHILE:
|
||||||
|
JNCOND __ENDW,arg
|
||||||
|
}
|
||||||
|
|
||||||
|
macro .endw
|
||||||
|
{
|
||||||
|
jmp __WHILE
|
||||||
|
__ENDW:
|
||||||
|
restore __ENDW
|
||||||
|
restore __WHILE
|
||||||
|
}
|
||||||
|
|
||||||
|
macro .repeat
|
||||||
|
{
|
||||||
|
local ..repeat
|
||||||
|
__REPEAT equ ..repeat
|
||||||
|
__REPEAT:
|
||||||
|
}
|
||||||
|
|
||||||
|
macro .until [arg]
|
||||||
|
{
|
||||||
|
common
|
||||||
|
JNCOND __REPEAT,arg
|
||||||
|
restore __REPEAT
|
||||||
|
}
|
||||||
|
|
||||||
|
jnne equ je
|
||||||
|
jnna equ ja
|
||||||
|
jnnb equ jb
|
||||||
|
jnng equ jg
|
||||||
|
jnnl equ jl
|
||||||
|
jnnae equ jae
|
||||||
|
jnnbe equ jbe
|
||||||
|
jnnge equ jge
|
||||||
|
jnnle equ jle
|
||||||
|
|
||||||
|
macro JNCOND label,v1,c,v2
|
||||||
|
{
|
||||||
|
match any,c
|
||||||
|
\{
|
||||||
|
cmp v1,v2
|
||||||
|
jn\#c label
|
||||||
|
\}
|
||||||
|
match ,c
|
||||||
|
\{
|
||||||
|
PARSECOND parsed@cond,v1
|
||||||
|
match cond,parsed@cond \\{ JNCONDEXPR label,cond \\}
|
||||||
|
\}
|
||||||
|
}
|
||||||
|
|
||||||
|
gt equ >
|
||||||
|
lt equ <
|
||||||
|
|
||||||
|
macro PARSECOND parsed,cond
|
||||||
|
{
|
||||||
|
define parsed
|
||||||
|
define neg@cond
|
||||||
|
define status@cond
|
||||||
|
define nest@cond
|
||||||
|
irps symb,cond
|
||||||
|
\{
|
||||||
|
define symb@cond symb
|
||||||
|
match >,symb
|
||||||
|
\\{
|
||||||
|
define symb@cond gt
|
||||||
|
\\}
|
||||||
|
match <,symb
|
||||||
|
\\{
|
||||||
|
define symb@cond lt
|
||||||
|
\\}
|
||||||
|
current@cond equ status@cond
|
||||||
|
match ,current@cond
|
||||||
|
\\{
|
||||||
|
match ~,symb
|
||||||
|
\\\{
|
||||||
|
neg@cond equ neg@cond ~
|
||||||
|
match ~~,neg@cond
|
||||||
|
\\\\{
|
||||||
|
define neg@cond
|
||||||
|
\\\\}
|
||||||
|
define symb@cond
|
||||||
|
\\\}
|
||||||
|
match (,symb
|
||||||
|
\\\{
|
||||||
|
parsed equ parsed neg@cond,<
|
||||||
|
define nest@cond +
|
||||||
|
define symb@cond
|
||||||
|
define neg@cond
|
||||||
|
\\\}
|
||||||
|
match any,symb@cond
|
||||||
|
\\\{
|
||||||
|
parsed equ parsed neg@cond,symb@cond
|
||||||
|
define status@cond +
|
||||||
|
\\\}
|
||||||
|
\\}
|
||||||
|
match status,current@cond
|
||||||
|
\\{
|
||||||
|
match &,symb
|
||||||
|
\\\{
|
||||||
|
parsed equ parsed,&,
|
||||||
|
define status@cond
|
||||||
|
define symb@cond
|
||||||
|
define neg@cond
|
||||||
|
\\\}
|
||||||
|
match |,symb
|
||||||
|
\\\{
|
||||||
|
parsed equ parsed,|,
|
||||||
|
define status@cond
|
||||||
|
define symb@cond
|
||||||
|
define neg@cond
|
||||||
|
\\\}
|
||||||
|
match (,symb
|
||||||
|
\\\{
|
||||||
|
define nest@cond (
|
||||||
|
\\\}
|
||||||
|
match ),symb
|
||||||
|
\\\{
|
||||||
|
match +,nest@cond
|
||||||
|
\\\\{
|
||||||
|
parsed equ parsed>
|
||||||
|
define symb@cond
|
||||||
|
\\\\}
|
||||||
|
restore nest@cond
|
||||||
|
\\\}
|
||||||
|
match any,symb@cond
|
||||||
|
\\\{
|
||||||
|
parsed equ parsed symb@cond
|
||||||
|
\\\}
|
||||||
|
\\}
|
||||||
|
\}
|
||||||
|
}
|
||||||
|
|
||||||
|
macro define_JNCONDEXPR
|
||||||
|
{
|
||||||
|
macro JNCONDEXPR elabel,[mod,cond,op]
|
||||||
|
\{
|
||||||
|
\common
|
||||||
|
\local ..t,..f
|
||||||
|
define t@cond ..t
|
||||||
|
define f@cond ..f
|
||||||
|
\forward
|
||||||
|
match ,op
|
||||||
|
\\{
|
||||||
|
match ,mod \\\{ JNCONDEL elabel,<cond> \\\}
|
||||||
|
match ~,mod \\\{ JCONDEL elabel,<cond> \\\}
|
||||||
|
\\}
|
||||||
|
match &:flabel:tlabel, op:f@cond:t@cond
|
||||||
|
\\{
|
||||||
|
match ,mod \\\{ JNCONDEL flabel,<cond> \\\}
|
||||||
|
match ~,mod \\\{ JCONDEL flabel,<cond> \\\}
|
||||||
|
tlabel:
|
||||||
|
\\local ..tnew
|
||||||
|
restore t@cond
|
||||||
|
define t@cond ..tnew
|
||||||
|
\\}
|
||||||
|
match |:flabel:tlabel, op:f@cond:t@cond
|
||||||
|
\\{
|
||||||
|
match ,mod \\\{ JCONDEL tlabel,<cond> \\\}
|
||||||
|
match ~,mod \\\{ JNCONDEL tlabel,<cond> \\\}
|
||||||
|
flabel:
|
||||||
|
\\local ..fnew
|
||||||
|
restore f@cond
|
||||||
|
define f@cond ..fnew
|
||||||
|
\\}
|
||||||
|
\common
|
||||||
|
label f@cond at elabel
|
||||||
|
t@cond:
|
||||||
|
restore t@cond
|
||||||
|
restore f@cond
|
||||||
|
\}
|
||||||
|
}
|
||||||
|
|
||||||
|
macro define_JCONDEXPR
|
||||||
|
{
|
||||||
|
macro JCONDEXPR elabel,[mod,cond,op]
|
||||||
|
\{
|
||||||
|
\common
|
||||||
|
\local ..t,..f
|
||||||
|
define t@cond ..t
|
||||||
|
define f@cond ..f
|
||||||
|
\forward
|
||||||
|
match ,op
|
||||||
|
\\{
|
||||||
|
match ,mod \\\{ JCONDEL elabel,<cond> \\\}
|
||||||
|
match ~,mod \\\{ JNCONDEL elabel,<cond> \\\}
|
||||||
|
\\}
|
||||||
|
match |:flabel:tlabel, op:f@cond:t@cond
|
||||||
|
\\{
|
||||||
|
match ,mod \\\{ JCONDEL flabel,<cond> \\\}
|
||||||
|
match ~,mod \\\{ JNCONDEL flabel,<cond> \\\}
|
||||||
|
tlabel:
|
||||||
|
\\local ..tnew
|
||||||
|
restore t@cond
|
||||||
|
define t@cond ..tnew
|
||||||
|
\\}
|
||||||
|
match &:flabel:tlabel, op:f@cond:t@cond
|
||||||
|
\\{
|
||||||
|
match ,mod \\\{ JNCONDEL tlabel,<cond> \\\}
|
||||||
|
match ~,mod \\\{ JCONDEL tlabel,<cond> \\\}
|
||||||
|
flabel:
|
||||||
|
\\local ..fnew
|
||||||
|
restore f@cond
|
||||||
|
define f@cond ..fnew
|
||||||
|
\\}
|
||||||
|
\common
|
||||||
|
label f@cond at elabel
|
||||||
|
t@cond:
|
||||||
|
restore t@cond
|
||||||
|
restore f@cond
|
||||||
|
\}
|
||||||
|
}
|
||||||
|
|
||||||
|
macro define_JNCONDEL
|
||||||
|
{
|
||||||
|
macro JNCONDEL label,cond
|
||||||
|
\{
|
||||||
|
\local COND
|
||||||
|
match car=,cdr,:cond
|
||||||
|
\\{
|
||||||
|
define_JNCONDEXPR
|
||||||
|
define_JCONDEXPR
|
||||||
|
define_JCONDEL
|
||||||
|
define_JNCONDEL
|
||||||
|
JNCONDEXPR label,cond
|
||||||
|
purge JNCONDEXPR,JCONDEXPR,JCONDEL,JNCONDEL
|
||||||
|
define COND
|
||||||
|
\\}
|
||||||
|
match c,cond ; replace gt and lt
|
||||||
|
\\{
|
||||||
|
match =COND =signed v1>==v2, COND c
|
||||||
|
\\\{
|
||||||
|
cmp v1,v2
|
||||||
|
jl label
|
||||||
|
define COND
|
||||||
|
\\\}
|
||||||
|
match =COND =signed v1<==v2, COND c
|
||||||
|
\\\{
|
||||||
|
cmp v1,v2
|
||||||
|
jg label
|
||||||
|
define COND
|
||||||
|
\\\}
|
||||||
|
match =COND v1>==v2, COND c
|
||||||
|
\\\{
|
||||||
|
cmp v1,v2
|
||||||
|
jb label
|
||||||
|
define COND
|
||||||
|
\\\}
|
||||||
|
match =COND v1<==v2, COND c
|
||||||
|
\\\{
|
||||||
|
cmp v1,v2
|
||||||
|
ja label
|
||||||
|
define COND
|
||||||
|
\\\}
|
||||||
|
match =COND v1==v2, COND c
|
||||||
|
\\\{
|
||||||
|
cmp v1,v2
|
||||||
|
jne label
|
||||||
|
define COND
|
||||||
|
\\\}
|
||||||
|
match =COND v1<>v2, COND c
|
||||||
|
\\\{
|
||||||
|
cmp v1,v2
|
||||||
|
je label
|
||||||
|
define COND
|
||||||
|
\\\}
|
||||||
|
match =COND =signed v1>v2, COND c
|
||||||
|
\\\{
|
||||||
|
cmp v1,v2
|
||||||
|
jle label
|
||||||
|
define COND
|
||||||
|
\\\}
|
||||||
|
match =COND =signed v1<v2, COND c
|
||||||
|
\\\{
|
||||||
|
cmp v1,v2
|
||||||
|
jge label
|
||||||
|
define COND
|
||||||
|
\\\}
|
||||||
|
match =COND v1>v2, COND c
|
||||||
|
\\\{
|
||||||
|
cmp v1,v2
|
||||||
|
jbe label
|
||||||
|
define COND
|
||||||
|
\\\}
|
||||||
|
match =COND v1<v2, COND c
|
||||||
|
\\\{
|
||||||
|
cmp v1,v2
|
||||||
|
jae label
|
||||||
|
define COND
|
||||||
|
\\\}
|
||||||
|
match =COND =ZERO?, COND c
|
||||||
|
\\\{
|
||||||
|
jnz label
|
||||||
|
define COND
|
||||||
|
\\\}
|
||||||
|
match =COND =CARRY?, COND c
|
||||||
|
\\\{
|
||||||
|
jnc label
|
||||||
|
define COND
|
||||||
|
\\\}
|
||||||
|
match =COND =OVERFLOW?, COND c
|
||||||
|
\\\{
|
||||||
|
jno label
|
||||||
|
define COND
|
||||||
|
\\\}
|
||||||
|
match =COND =SIGN?, COND c
|
||||||
|
\\\{
|
||||||
|
jns label
|
||||||
|
define COND
|
||||||
|
\\\}
|
||||||
|
match =COND =PARITY?, COND c
|
||||||
|
\\\{
|
||||||
|
jnp label
|
||||||
|
define COND
|
||||||
|
\\\}
|
||||||
|
match =COND v, COND c
|
||||||
|
\\\{
|
||||||
|
if v eqtype 0
|
||||||
|
if ~ v
|
||||||
|
jmp label
|
||||||
|
end if
|
||||||
|
else if v eqtype eax
|
||||||
|
test v,v
|
||||||
|
jz label
|
||||||
|
else
|
||||||
|
cmp v,0
|
||||||
|
je label
|
||||||
|
end if
|
||||||
|
\\\}
|
||||||
|
\\}
|
||||||
|
\}
|
||||||
|
}
|
||||||
|
|
||||||
|
macro define_JCONDEL
|
||||||
|
{
|
||||||
|
macro JCONDEL label,cond
|
||||||
|
\{
|
||||||
|
\local COND
|
||||||
|
match car=,cdr,:cond
|
||||||
|
\\{
|
||||||
|
define_JNCONDEXPR
|
||||||
|
define_JCONDEXPR
|
||||||
|
define_JCONDEL
|
||||||
|
define_JNCONDEL
|
||||||
|
JCONDEXPR label,cond
|
||||||
|
purge JNCONDEXPR,JCONDEXPR,JCONDEL,JNCONDEL
|
||||||
|
define COND
|
||||||
|
\\}
|
||||||
|
match c,cond ; replace gt and lt
|
||||||
|
\\{
|
||||||
|
match =COND =signed v1>==v2, COND c
|
||||||
|
\\\{
|
||||||
|
cmp v1,v2
|
||||||
|
jge label
|
||||||
|
define COND
|
||||||
|
\\\}
|
||||||
|
match =COND =signed v1<==v2, COND c
|
||||||
|
\\\{
|
||||||
|
cmp v1,v2
|
||||||
|
jle label
|
||||||
|
define COND
|
||||||
|
\\\}
|
||||||
|
match =COND v1>==v2, COND c
|
||||||
|
\\\{
|
||||||
|
cmp v1,v2
|
||||||
|
jae label
|
||||||
|
define COND
|
||||||
|
\\\}
|
||||||
|
match =COND v1<==v2, COND c
|
||||||
|
\\\{
|
||||||
|
cmp v1,v2
|
||||||
|
jbe label
|
||||||
|
define COND
|
||||||
|
\\\}
|
||||||
|
match =COND v1==v2, COND c
|
||||||
|
\\\{
|
||||||
|
cmp v1,v2
|
||||||
|
je label
|
||||||
|
define COND
|
||||||
|
\\\}
|
||||||
|
match =COND v1<>v2, COND c
|
||||||
|
\\\{
|
||||||
|
cmp v1,v2
|
||||||
|
jne label
|
||||||
|
define COND
|
||||||
|
\\\}
|
||||||
|
match =COND =signed v1>v2, COND c
|
||||||
|
\\\{
|
||||||
|
cmp v1,v2
|
||||||
|
jg label
|
||||||
|
define COND
|
||||||
|
\\\}
|
||||||
|
match =COND =signed v1<v2, COND c
|
||||||
|
\\\{
|
||||||
|
cmp v1,v2
|
||||||
|
jl label
|
||||||
|
define COND
|
||||||
|
\\\}
|
||||||
|
match =COND v1>v2, COND c
|
||||||
|
\\\{
|
||||||
|
cmp v1,v2
|
||||||
|
ja label
|
||||||
|
define COND
|
||||||
|
\\\}
|
||||||
|
match =COND v1<v2, COND c
|
||||||
|
\\\{
|
||||||
|
cmp v1,v2
|
||||||
|
jb label
|
||||||
|
define COND
|
||||||
|
\\\}
|
||||||
|
match =COND =ZERO?, COND c
|
||||||
|
\\\{
|
||||||
|
jz label
|
||||||
|
define COND
|
||||||
|
\\\}
|
||||||
|
match =COND =CARRY?, COND c
|
||||||
|
\\\{
|
||||||
|
jc label
|
||||||
|
define COND
|
||||||
|
\\\}
|
||||||
|
match =COND =OVERFLOW?, COND c
|
||||||
|
\\\{
|
||||||
|
jo label
|
||||||
|
define COND
|
||||||
|
\\\}
|
||||||
|
match =COND =SIGN?, COND c
|
||||||
|
\\\{
|
||||||
|
js label
|
||||||
|
define COND
|
||||||
|
\\\}
|
||||||
|
match =COND =PARITY?, COND c
|
||||||
|
\\\{
|
||||||
|
jp label
|
||||||
|
define COND
|
||||||
|
\\\}
|
||||||
|
match =COND v, COND c
|
||||||
|
\\\{
|
||||||
|
if v eqtype 0
|
||||||
|
if v
|
||||||
|
jmp label
|
||||||
|
end if
|
||||||
|
else if v eqtype eax
|
||||||
|
test v,v
|
||||||
|
jnz label
|
||||||
|
else
|
||||||
|
cmp v,0
|
||||||
|
jne label
|
||||||
|
end if
|
||||||
|
\\\}
|
||||||
|
\\}
|
||||||
|
\}
|
||||||
|
}
|
||||||
|
|
||||||
|
define_JNCONDEXPR
|
||||||
|
define_JCONDEXPR
|
||||||
|
define_JNCONDEL
|
||||||
|
define_JCONDEL
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user