programs/system: Post-SVN tidy (part 2) (#410)

- Move source code from `trunk` into root directory for each program.
- Update build files and ASM include paths. Add SPDX license header where appropriate.
- Note: Line endings standardised from `CRLF` > `LF`, so best to view diffs with whitespace changes hidden.

(Work towards #75, point 3)

Reviewed-on: #410
Reviewed-by: Ivan B <dunkaist@gmail.com>
Reviewed-by: Burer <burer@kolibrios.org>
Co-authored-by: Andrew <dent.ace@gmail.com>
Co-committed-by: Andrew <dent.ace@gmail.com>
This commit was merged in pull request #410.
This commit is contained in:
2026-04-09 18:57:52 +00:00
committed by Burer
parent 31880f3ebe
commit 9ca506ed15
71 changed files with 3685 additions and 3654 deletions
+11 -11
View File
@@ -79,7 +79,7 @@ if build_type == "ru_RU" then tup.append_table(img_files, {
{"GAMES/DESCENT", build_type .. "/games/descent"},
{"SETTINGS/.shell", SRC_PROGS .. "/system/shell/bin/rus/.shell"},
{"SETTINGS/GAMES.INI", "ru_RU/settings/games.ini"},
{"SETTINGS/MYKEY.INI", SRC_PROGS .. "/system/MyKey/trunk/mykey.ini"},
{"SETTINGS/MYKEY.INI", SRC_PROGS .. "/system/MyKey/mykey.ini"},
{"SETTINGS/SYSPANEL.INI", "ru_RU/settings/syspanel.ini"},
}) elseif build_type == "en_US" then tup.append_table(img_files, {
{"WELCOME.HTM", VAR_DATA .. "/" .. build_type .. "/welcome.htm.kpack"},
@@ -89,7 +89,7 @@ if build_type == "ru_RU" then tup.append_table(img_files, {
{"GAMES/DESCENT", "common/games/descent"},
{"SETTINGS/.shell", SRC_PROGS .. "/system/shell/bin/eng/.shell"},
{"SETTINGS/GAMES.INI", "common/settings/games.ini"},
{"SETTINGS/MYKEY.INI", SRC_PROGS .. "/system/MyKey/trunk/mykey.ini"},
{"SETTINGS/MYKEY.INI", SRC_PROGS .. "/system/MyKey/mykey.ini"},
{"SETTINGS/SYSPANEL.INI", "common/settings/syspanel.ini"},
}) elseif build_type == "es_ES" then tup.append_table(img_files, {
{"EXAMPLE.ASM", SRC_PROGS .. "/develop/examples/example/trunk/example.asm"},
@@ -98,7 +98,7 @@ if build_type == "ru_RU" then tup.append_table(img_files, {
{"GAMES/DESCENT", "common/games/descent"},
{"SETTINGS/.shell", SRC_PROGS .. "/system/shell/bin/eng/.shell"},
{"SETTINGS/GAMES.INI", "common/settings/games.ini"},
{"SETTINGS/MYKEY.INI", SRC_PROGS .. "/system/MyKey/trunk/mykey.ini"},
{"SETTINGS/MYKEY.INI", SRC_PROGS .. "/system/MyKey/mykey.ini"},
{"SETTINGS/SYSPANEL.INI", "common/settings/syspanel.ini"},
}) elseif build_type == "it_IT" then tup.append_table(img_files, {
{"EXAMPLE.ASM", SRC_PROGS .. "/develop/examples/example/trunk/example.asm"},
@@ -106,7 +106,7 @@ if build_type == "ru_RU" then tup.append_table(img_files, {
{"File Managers/KFAR.INI", "common/File Managers/kfar.ini"},
{"GAMES/DESCENT", "common/games/descent"},
{"SETTINGS/.shell", SRC_PROGS .. "/system/shell/bin/eng/.shell"},
{"SETTINGS/MYKEY.INI", SRC_PROGS .. "/system/MyKey/trunk/mykey_it.ini"},
{"SETTINGS/MYKEY.INI", SRC_PROGS .. "/system/MyKey/mykey_it.ini"},
{"SETTINGS/GAMES.INI", "common/settings/games.ini"},
{"SETTINGS/SYSPANEL.INI", "common/settings/syspanel.ini"},
}) else tup.append_table(img_files, {
@@ -116,7 +116,7 @@ if build_type == "ru_RU" then tup.append_table(img_files, {
{"GAMES/DESCENT", "common/games/descent"},
{"SETTINGS/.shell", SRC_PROGS .. "/system/shell/bin/eng/.shell"},
{"SETTINGS/GAMES.INI", "common/settings/games.ini"},
{"SETTINGS/MYKEY.INI", SRC_PROGS .. "/system/MyKey/trunk/mykey.ini"},
{"SETTINGS/MYKEY.INI", SRC_PROGS .. "/system/MyKey/mykey.ini"},
{"SETTINGS/SYSPANEL.INI", "common/settings/syspanel.ini"},
}) end
@@ -402,7 +402,7 @@ tup.append_table(img_files, {
{"@DOCKY", VAR_PROGS .. "/system/docky/docky"},
{"@HA", VAR_PROGS .. "/other/ha/HA"},
{"@ICON", VAR_PROGS .. "/system/icon_new/icon"},
{"@MENU", VAR_PROGS .. "/system/menu/trunk/menu"},
{"@MENU", VAR_PROGS .. "/system/menu/menu"},
{"@NOTIFY", VAR_PROGS .. "/system/notify3/notify"},
{"@OPEN", VAR_PROGS .. "/system/open/open"},
{"@RESHARE", VAR_PROGS .. "/system/reshare/reshare"},
@@ -426,18 +426,18 @@ tup.append_table(img_files, {
{"ESKIN", VAR_PROGS .. "/system/eskin/trunk/eskin"},
{"FSPEED", VAR_PROGS .. "/testing/fspeed/fspeed"},
{"GMON", VAR_PROGS .. "/system/gmon/gmon"},
{"HDD_INFO", VAR_PROGS .. "/system/hdd_info/trunk/hdd_info"},
{"HDD_INFO", VAR_PROGS .. "/system/hdd_info/hdd_info"},
{"KBD", VAR_PROGS .. "/testing/kbd/trunk/kbd"},
{"KPACK", VAR_PROGS .. "/other/kpack/trunk/kpack"},
{"LAUNCHER", VAR_PROGS .. "/system/launcher/trunk/launcher"},
{"LAUNCHER", VAR_PROGS .. "/system/launcher/launcher"},
{"LOADDRV", VAR_PROGS .. "/system/loaddrv/loaddrv"},
{"MAGNIFY", VAR_PROGS .. "/system/magnify/magnify"},
{"MGB", VAR_PROGS .. "/testing/mgb/trunk/mgb"},
{"MOUSEMUL", VAR_PROGS .. "/system/mousemul/trunk/mousemul"},
{"MOUSEMUL", VAR_PROGS .. "/system/mousemul/mousemul"},
{"MADMOUSE", VAR_PROGS .. "/other/madmouse/madmouse"},
{"MYKEY", VAR_PROGS .. "/system/MyKey/trunk/MyKey"},
{"MYKEY", VAR_PROGS .. "/system/MyKey/MyKey"},
{"PCIDEV", VAR_PROGS .. "/testing/pcidev/trunk/PCIDEV"},
{"RDSAVE", VAR_PROGS .. "/system/rdsave/trunk/rdsave"},
{"RDSAVE", VAR_PROGS .. "/system/rdsave/rdsave"},
{"RTFREAD", VAR_PROGS .. "/other/rtfread/rtfread"},
{"SEARCHAP", VAR_PROGS .. "/system/searchap/searchap"},
{"SCRSHOOT", VAR_PROGS .. "/media/scrshoot/scrshoot"},
+7 -7
View File
@@ -65,16 +65,16 @@ fasm system\skincfg\trunk\skincfg.asm %BIN%\skincfg
fasm system\docpack\docpack.asm %BIN%\docpack
fasm system\end\trunk\end.asm %BIN%\end
fasm system\gmon\gmon.asm %BIN%\gmon
fasm system\icon\trunk\icon.asm %BIN%\icon
fasm system\icon\icon.asm %BIN%\icon
fasm system\kbd\trunk\kbd.ASM %BIN%\kbd
fasm system\launcher\trunk\launcher.asm %BIN%\launcher
fasm system\menu\trunk\menu.asm %BIN%\@menu
fasm system\launcher\launcher.asm %BIN%\launcher
fasm system\menu\menu.asm %BIN%\@menu
fasm system\mgb\trunk\mgb.asm %BIN%\mgb
fasm system\mousemul\trunk\mousemul.asm %BIN%\mousemul
fasm system\mousemul\mousemul.asm %BIN%\mousemul
fasm system\PANEL\trunk\@TASKBAR.ASM %BIN%\@TASKBAR
fasm system\pcidev\trunk\pcidev.asm %BIN%\pcidev
fasm system\RB\trunk\@RB.ASM %BIN%\@RB
fasm system\rdsave\trunk\rdsave.asm %BIN%\rdsave
fasm system\rdsave\rdsave.asm %BIN%\rdsave
fasm system\run\trunk\run.asm %BIN%\run
fasm system\setup\trunk\setup.asm %BIN%\setup
fasm system\skinsel\skinsel.asm %BIN%\skinsel
@@ -238,9 +238,9 @@ fasm media\midamp\trunk\midamp.asm %BIN%\nightbuild\midamp
fasm develop\heed\trunk\heed.asm %BIN%\nightbuild\heed
fasm develop\tinypad\trunk\tinypad.asm %BIN%\nightbuild\tinypad
fasm system\skincfg\trunk\skincfg.asm %BIN%\nightbuild\skincfg
fasm system\hdd_info\trunk\hdd_info.asm %BIN%\nightbuild\hdd_info
fasm system\hdd_info\hdd_info.asm %BIN%\nightbuild\hdd_info
fasm system\mgb\trunk\mgb.asm %BIN%\nightbuild\mgb
fasm system\rdsave\trunk\rdsave.asm %BIN%\nightbuild\rdsave
fasm system\rdsave\rdsave.asm %BIN%\nightbuild\rdsave
fasm other\kpack\trunk\kpack.asm %BIN%\nightbuild\kpack
fasm other\rtfread\rtfread.asm %BIN%\nightbuild\rtfread
;restore
@@ -1,163 +1,165 @@
include '../../../proc32.inc'
macro start_draw_window x,y,xsize,ysize,areacolor,caption,capsize
{
;pusha
mov eax, 12 ; function 12:tell os about windowdraw
mov ebx, 1 ; 1, start of draw
int 0x40
; DRAW WINDOW
mov eax, 0 ; function 0 : define and draw window
mov ebx, x*65536+xsize ; [x start] *65536 + [x size]
mov ecx, y*65536+ysize ; [y start] *65536 + [y size]
mov edx, areacolor ; color of work area RRGGBB
mov esi, 0x00334455 ; color of grab bar RRGGBB
mov edi, 0x00ddeeff ; color of frames RRGGBB
int 0x40
; WINDOW LABEL
mov eax, 4 ; function 4 : write text to window
mov ebx, 8*65536+8 ; [x start] *65536 + [y start]
mov ecx, 0x0;0ffffff ; color of text RRGGBB
mov edx, caption ; pointer to text beginning
mov esi, capsize ; text length
int 0x40
;popa
}
macro end_draw_window
{
mov eax, 12 ; end of redraw
mov ebx, 2
int 0x40
}
macro change_window_place_size x,y,xsize,ysize
{
mov eax, 67 ; function 67 : replace and/or resize window
mov ebx, x
mov ecx, y
mov edx, xsize
mov esi, ysize
int 0x40
}
proc draw_button stdcall, x:dword, y:dword, xsize:dword, ysize:dword, \
id:dword, butcolor:dword, text:dword, textlen:byte, textcolor:dword
pusha
mov ebx, dword [x]
shl ebx, 16
add ebx, dword [xsize] ; [x start] *65536 + [x size]
mov ecx, dword [y]
shl ecx, 16
add ecx, dword [ysize] ; [y start] *65536 + [y size]
mov edx, dword [id] ; button id
mov esi, dword [butcolor] ; button color RRGGBB
mov eax, 8 ; function 8 : define and draw button
int 0x40
mov ebx, dword [x]
add ebx, 5
shl ebx, 16
mov eax, dword [ysize]
sub eax, 5
shr eax, 1
add ebx, eax
add ebx, dword [y] ;mov ebx, (x+5)*65536+y+(ysize-5)/2 ; Draw button text
mov ecx, dword [textcolor]
mov edx, dword [text]
xor eax, eax
mov al, byte [textlen]
mov esi, eax
mov eax, 4
int 0x40
popa
ret
endp
;macro outtextxy x,y,prompt,prompt_len,color
;{
proc outtextxy stdcall, x:dword, y:dword, prompt:dword, prompt_len:dword, color:dword
pusha
mov eax, 4
mov ebx, dword [x] ; draw info text with function 4
shl ebx, 16
or ebx, dword [y]
mov ecx, dword [color]
mov edx, dword [prompt]
mov esi, dword [prompt_len]
test esi, esi
jnz @f
or ecx, 0x80000000
@@:
int 0x40
popa
ret
endp
;}
;proc bar x:dword, y:dword, xsize:dword, ysize:dword, color:dword
macro bar x, y, xsize, ysize, color
{
pusha
mov eax, 13
;mov ebx, [x]
;shl ebx, 16
;add ebx, [xsize]
;mov ecx, [y]
;shl ecx, 16
;add ecx, [ysize]
;mov edx, [color]
mov ebx, x*65536+xsize
mov ecx, y*65536+ysize
mov edx, color
int 0x40
popa
;ret
;endp
}
macro line x1,y1,x2,y2,color
{
pusha
mov eax, 38
mov ebx, x1*65536+x2
mov ecx, y1*65536+y2
mov edx, color
int 0x40
popa
}
macro rectangle x,y,xsize,ysize,color
{
x2=x+xsize
y2=y+ysize
line x,y,x2,y,color
line x,y,x,y2,color
line x,y2,x2,y2,color
line x2,y,x2,y2,color
}
macro rectangle2 x,y,xsize,ysize,color1,color2
{
x2=x+xsize
y2=y+ysize
line x,y,x2,y,color1
line x,y,x,y2,color1
line x,y2,x2,y2,color2
line x2,y,x2,y2,color2
}
macro putpixel x,y,color
{
mov eax, 1
mov ebx, x
mov ecx, y
mov edx, color
int 0x40
}
; SPDX-License-Identifier: NOASSERTION
;
include '../../proc32.inc'
macro start_draw_window x,y,xsize,ysize,areacolor,caption,capsize
{
;pusha
mov eax, 12 ; function 12:tell os about windowdraw
mov ebx, 1 ; 1, start of draw
int 0x40
; DRAW WINDOW
mov eax, 0 ; function 0 : define and draw window
mov ebx, x*65536+xsize ; [x start] *65536 + [x size]
mov ecx, y*65536+ysize ; [y start] *65536 + [y size]
mov edx, areacolor ; color of work area RRGGBB
mov esi, 0x00334455 ; color of grab bar RRGGBB
mov edi, 0x00ddeeff ; color of frames RRGGBB
int 0x40
; WINDOW LABEL
mov eax, 4 ; function 4 : write text to window
mov ebx, 8*65536+8 ; [x start] *65536 + [y start]
mov ecx, 0x0;0ffffff ; color of text RRGGBB
mov edx, caption ; pointer to text beginning
mov esi, capsize ; text length
int 0x40
;popa
}
macro end_draw_window
{
mov eax, 12 ; end of redraw
mov ebx, 2
int 0x40
}
macro change_window_place_size x,y,xsize,ysize
{
mov eax, 67 ; function 67 : replace and/or resize window
mov ebx, x
mov ecx, y
mov edx, xsize
mov esi, ysize
int 0x40
}
proc draw_button stdcall, x:dword, y:dword, xsize:dword, ysize:dword, \
id:dword, butcolor:dword, text:dword, textlen:byte, textcolor:dword
pusha
mov ebx, dword [x]
shl ebx, 16
add ebx, dword [xsize] ; [x start] *65536 + [x size]
mov ecx, dword [y]
shl ecx, 16
add ecx, dword [ysize] ; [y start] *65536 + [y size]
mov edx, dword [id] ; button id
mov esi, dword [butcolor] ; button color RRGGBB
mov eax, 8 ; function 8 : define and draw button
int 0x40
mov ebx, dword [x]
add ebx, 5
shl ebx, 16
mov eax, dword [ysize]
sub eax, 5
shr eax, 1
add ebx, eax
add ebx, dword [y] ;mov ebx, (x+5)*65536+y+(ysize-5)/2 ; Draw button text
mov ecx, dword [textcolor]
mov edx, dword [text]
xor eax, eax
mov al, byte [textlen]
mov esi, eax
mov eax, 4
int 0x40
popa
ret
endp
;macro outtextxy x,y,prompt,prompt_len,color
;{
proc outtextxy stdcall, x:dword, y:dword, prompt:dword, prompt_len:dword, color:dword
pusha
mov eax, 4
mov ebx, dword [x] ; draw info text with function 4
shl ebx, 16
or ebx, dword [y]
mov ecx, dword [color]
mov edx, dword [prompt]
mov esi, dword [prompt_len]
test esi, esi
jnz @f
or ecx, 0x80000000
@@:
int 0x40
popa
ret
endp
;}
;proc bar x:dword, y:dword, xsize:dword, ysize:dword, color:dword
macro bar x, y, xsize, ysize, color
{
pusha
mov eax, 13
;mov ebx, [x]
;shl ebx, 16
;add ebx, [xsize]
;mov ecx, [y]
;shl ecx, 16
;add ecx, [ysize]
;mov edx, [color]
mov ebx, x*65536+xsize
mov ecx, y*65536+ysize
mov edx, color
int 0x40
popa
;ret
;endp
}
macro line x1,y1,x2,y2,color
{
pusha
mov eax, 38
mov ebx, x1*65536+x2
mov ecx, y1*65536+y2
mov edx, color
int 0x40
popa
}
macro rectangle x,y,xsize,ysize,color
{
x2=x+xsize
y2=y+ysize
line x,y,x2,y,color
line x,y,x,y2,color
line x,y2,x2,y2,color
line x2,y,x2,y2,color
}
macro rectangle2 x,y,xsize,ysize,color1,color2
{
x2=x+xsize
y2=y+ysize
line x,y,x2,y,color1
line x,y,x,y2,color1
line x,y2,x2,y2,color2
line x2,y,x2,y2,color2
}
macro putpixel x,y,color
{
mov eax, 1
mov ebx, x
mov ecx, y
mov edx, color
int 0x40
}
@@ -1,4 +1,6 @@
; SPDX-License-Identifier: NOASSERTION
;
; MyKey. Version 0.2.
;
; Author: Asper
@@ -23,13 +25,13 @@ include 'lang.inc' ; Language support for locales: it_IT, en_US.
include 'string.inc'
;include 'macros.inc'
include '../../../macros.inc'
include '../../macros.inc'
include 'ASPAPI.INC'
;include 'editbox_ex.mac'
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
;include 'load_lib.mac'
include '../../../develop/libraries/box_lib/load_lib.mac'
include '../../../dll.inc'
include '../../develop/libraries/box_lib/load_lib.mac'
include '../../dll.inc'
include 'debug.inc'
DEBUG equ 0;1
@@ -1,5 +1,5 @@
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")
add_include(tup.getvariantdir())
@@ -1,5 +1,5 @@
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")
add_include(tup.getvariantdir())
File diff suppressed because it is too large Load Diff
@@ -1,5 +1,5 @@
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")
add_include(tup.getvariantdir())
File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

@@ -1,12 +1,12 @@
ROOT=../../../develop/libraries/framework/trunk
ROOT=../../develop/libraries/framework/trunk
include ../../../develop/libraries/framework/trunk/config.mk
include ../../develop/libraries/framework/trunk/config.mk
# Note that kobra_st.o MUST be first and kobra.o last.
OBJECTS=kobra_st.o $(ROOT)/stdlib/heap.o $(ROOT)/stdlib/malloc.o $(ROOT)/stdlib/stdlib.o $(ROOT)/kolibri/kolibri.o $(ROOT)/libIPC/ipc.o kobra.o
# Set real path to kolibri.img if you want to use install option
KOLIBRI_IMG=../../../../../../0.7.x-night/kolibri.img
KOLIBRI_IMG=../../../../../0.7.x-night/kolibri.img
# Path to kobra.kex on floppy (directory should be created before installing)
DESTDIR=kobra/
@@ -1,5 +1,5 @@
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")
add_include(HELPERDIR .. "/develop/libraries/libs-dev/libio")
@@ -1,3 +1,6 @@
; SPDX-License-Identifier: NOASSERTION
;
;-----------------------------------------------------------------------------
;
; LAUNCHER - startup of programs
@@ -28,11 +31,11 @@
dd 0x0 ; I_Param
dd 0x0 ; I_Icon
;-----------------------------------------------------------------------------
include "../../../macros.inc"
include "../../macros.inc"
define __DEBUG__ 1
define __DEBUG_LEVEL__ 1
include "../../../debug-fdo.inc"
include "../../debug-fdo.inc"
;-----------------------------------------------------------------------------
START: ; start of execution
mcall 68,11
@@ -43,7 +46,7 @@ START: ; start of execution
mov ecx,[processinfo+32]
test ecx,ecx
jnz @f
inc ecx ; if file size zero
;--------------------------------------
@@:
@@ -1,5 +1,5 @@
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")
add_include(tup.getvariantdir())
@@ -1,3 +1,6 @@
; SPDX-License-Identifier: NOASSERTION
;
;******************************************************************************
; MAIN MENU
;******************************************************************************
@@ -41,11 +44,11 @@
dd bootparam ; boot parameters
dd 0x0 ; path
;------------------------------------------------------------------------------
include "..\..\..\macros.inc"
include "..\..\..\struct.inc"
include "..\..\..\gui_patterns.inc"
include "..\..\macros.inc"
include "..\..\struct.inc"
include "..\..\gui_patterns.inc"
; Formatted debug output:
include "..\..\..\debug-fdo.inc"
include "..\..\debug-fdo.inc"
__DEBUG__ = 1 ; 0 - disable debug output / 1 - enable debug output
__DEBUG_LEVEL__ = DBG_ERR ; set the debug level
DBG_ALL = 0 ; all messages
@@ -1,5 +1,5 @@
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")
add_include(tup.getvariantdir())
@@ -1,306 +1,312 @@
; <--- description --->
; compiler: FASM 1.67.23
; name: Mouse Emulation For KolibriOS
;-----------------------------------------------------------------------------
; version: 1.2
; last update: 01/06/2012
; written by: Marat Zakiyanov aka Mario79, aka Mario
; changes: using new functions 66.6 and 66.7
;-----------------------------------------------------------------------------
; version: 1.1
; last update: 26/05/2012
; written by: Lipatov Kirill aka Leency
; changes: shows notify with instructions, while opening program
;-----------------------------------------------------------------------------
; version: 1.0
; last update: 04/09/2010
; written by: Marat Zakiyanov aka Mario79, aka Mario
; changes: total optimization of code,
; different events for Up and Down of key Num 5
; advansed acceleration mode
;-----------------------------------------------------------------------------
; version: 0.8
; last update: 03/10/2007
; written by: Zlobny_Gluk
; e-mail: umbrosia@land.ru
;-----------------------------------------------------------------------------
; <--- include all KolibriOS stuff --->
include "lang.inc"
include '../../../macros.inc'
; <--- start of KolibriOS application --->
MEOS_APP_START
; <--- start of code --->
CODE
;-----------------------------------------------------------------------------
start:
mcall 70,notifyapp
start1:
xor ebx,ebx
mcall 40
@@:
mcall 23,10
mcall 66,3
test eax,0x80 ;NumLock status
jz @r
mov ebx,4
call hotkeys_common
mcall 40,10b
still:
mcall 10
cmp eax,2 ; if event == 2
jne still
;-----------------------------------------------------------------------------
key: ; key event handler
call mouse_acceleration
mcall 2 ; get key code
push eax
mcall 66,3
test eax,0x80 ;NumLock status
pop eax
jnz @f
mov ebx,5
call hotkeys_common
jmp start1
@@:
cmp al,2
jne still
xor edx,edx
cmp ah,80 ; Down Num 2
je keytwo
cmp ah,81 ; Down Num 3
je keythree
cmp ah,75 ; Down Num 4
je keyfour
cmp ah,77 ; Down Num 6
je keysix
cmp ah,71 ; Down Num 7
je keyseven
cmp ah,72 ; Down Num 8
je keyeight
cmp ah,73 ; Down Num 9
je keynine
cmp ah,76 ; Down Num 5
je keyfive
cmp ah,204 ; Up Num 5
je keyfive_1
cmp ah,79 ; Down Num 1
jne still
;-----------------------------------------------------------------------------
keyone:
call down
keyfour:
call left
jmp mouseread
;-----------------------------------------------------------------------------
keythree:
call right
keytwo:
call down
jmp mouseread
;-----------------------------------------------------------------------------
keyseven:
call left
keyeight:
call up
jmp mouseread
;-----------------------------------------------------------------------------
keynine:
call up
keysix:
call right
jmp mouseread
;-----------------------------------------------------------------------------
keyfive:
inc edx
keyfive_1:
mcall 18,19,5
jmp still
;-----------------------------------------------------------------------------
left:
mov eax,esi
shl eax,16
sub edx,eax
ret
;-----------------------------------------------------------------------------
right:
mov eax,esi
shl eax,16
add edx,eax
ret
;-----------------------------------------------------------------------------
down:
add edx,esi
ret
;-----------------------------------------------------------------------------
up:
sub edx,esi
ret
;-----------------------------------------------------------------------------
mouseread:
xor ebx,ebx
mcall 37
add edx,eax
sravn:
xor ebx,ebx
xor edi,edi
real:
mov ebx,edx
mov edi,ebx
shr ebx,16 ; get x1
; shl edi,16 ; get y1
; shr edi,16
and edi,0xffff
nullli:
add ebx,16
cmp ebx,65535
jg xmin
sub ebx,15
add edi,16
cmp edi,65535
jg ymin
sub edi,15
razr:
mcall 14
mov ecx,eax
shr eax,16 ; get x2
; shl ecx,16 ; get y2
; shr ecx,16
and ecx,0xffff
rightdownli:
cmp eax,ebx
jl xmax
cmp ecx,edi
jl ymax
mousewrite:
mcall 18,19,4
mcall 26,9
mov [mouse_timer_ticks],eax
jmp still
;-----------------------------------------------------------------------------
mouse_acceleration:
xor esi,esi
inc esi
mcall 18,19,2
mov ecx,eax
mcall 26,9
sub eax,[mouse_timer_ticks]
cmp eax,ecx ; mouse_delay
ja @f
xor ecx,ecx
mcall 18,19 ; checkspeed
mov esi,eax
shl esi,2
@@:
ret
;-----------------------------------------------------------------------------
xmax:
dec eax
dec ebx
dec edi
shl eax,16
add edi,eax
mov edx,edi
jmp sravn
;-----------------------------------------------------------------------------
xmin:
mov edx,edi
jmp sravn
;-----------------------------------------------------------------------------
ymax:
dec ecx
dec ebx
shl ebx,16
mov edi,ebx
add edi,ecx
mov edx,edi
jmp sravn
;-----------------------------------------------------------------------------
ymin:
shl ebx,16
mov edx,ebx
shr ebx,16
jmp sravn
;-----------------------------------------------------------------------------
hotkeys_common:
xor ecx,ecx
xor edx,edx
mov cl,79 ; Down Num 1
mcall 66
mov cl,80 ; Down Num 2
mcall 66
mov cl,81 ; Down Num 3
mcall 66
mov cl,75 ; Down Num 4
mcall 66
mov cl,76 ; Down Num 5
mcall 66
mov cl,204 ; Up Num 5
mcall 66
mov cl,77 ; Down Num 6
mcall 66
mov cl,71 ; Down Num 7
mcall 66
mov cl,72 ; Down Num 8
mcall 66
mov cl,73 ; Down Num 9
mcall 66
; disable/enable input, work only hotkeys (f.66.6,66.7)
add ebx,2
mcall 66
ret
;-----------------------------------------------------------------------------
; <--- initialised data --->
DATA
;-----------------------------------------------------------------------------
; <--- uninitialised data --->
UDATA
mouse_timer_ticks dd 0
;-----------------------------------------------------------------------------
if lang eq ru_RU
ud_user_message db '"NumLock включает и выключает эмулятор мыши.\nУправление через Numpad." -I',0
else if lang eq it_IT
ud_user_message db '"NumLock - on/off - usa Numpad per muovere il cursore." -I',0
else
ud_user_message db '"NumLock - on/off mouse emul. Numpad - move cursor." -I',0
end if
notifyapp:
dd 7
dd 0
dd ud_user_message
dd 0
dd 0
db '@notify',0
;-----------------------------------------------------------------------------
MEOS_APP_END
; <--- end of KolibriOS application --->
; ZG
; SPDX-License-Identifier: NOASSERTION
;
; Text encoded with Code Page 866 - Cyrillic
; <--- description --->
; compiler: FASM 1.67.23
; name: Mouse Emulation For KolibriOS
;-----------------------------------------------------------------------------
; version: 1.2
; last update: 01/06/2012
; written by: Marat Zakiyanov aka Mario79, aka Mario
; changes: using new functions 66.6 and 66.7
;-----------------------------------------------------------------------------
; version: 1.1
; last update: 26/05/2012
; written by: Lipatov Kirill aka Leency
; changes: shows notify with instructions, while opening program
;-----------------------------------------------------------------------------
; version: 1.0
; last update: 04/09/2010
; written by: Marat Zakiyanov aka Mario79, aka Mario
; changes: total optimization of code,
; different events for Up and Down of key Num 5
; advansed acceleration mode
;-----------------------------------------------------------------------------
; version: 0.8
; last update: 03/10/2007
; written by: Zlobny_Gluk
; e-mail: umbrosia@land.ru
;-----------------------------------------------------------------------------
; <--- include all KolibriOS stuff --->
include "lang.inc"
include '../../macros.inc'
; <--- start of KolibriOS application --->
MEOS_APP_START
; <--- start of code --->
CODE
;-----------------------------------------------------------------------------
start:
mcall 70,notifyapp
start1:
xor ebx,ebx
mcall 40
@@:
mcall 23,10
mcall 66,3
test eax,0x80 ;NumLock status
jz @r
mov ebx,4
call hotkeys_common
mcall 40,10b
still:
mcall 10
cmp eax,2 ; if event == 2
jne still
;-----------------------------------------------------------------------------
key: ; key event handler
call mouse_acceleration
mcall 2 ; get key code
push eax
mcall 66,3
test eax,0x80 ;NumLock status
pop eax
jnz @f
mov ebx,5
call hotkeys_common
jmp start1
@@:
cmp al,2
jne still
xor edx,edx
cmp ah,80 ; Down Num 2
je keytwo
cmp ah,81 ; Down Num 3
je keythree
cmp ah,75 ; Down Num 4
je keyfour
cmp ah,77 ; Down Num 6
je keysix
cmp ah,71 ; Down Num 7
je keyseven
cmp ah,72 ; Down Num 8
je keyeight
cmp ah,73 ; Down Num 9
je keynine
cmp ah,76 ; Down Num 5
je keyfive
cmp ah,204 ; Up Num 5
je keyfive_1
cmp ah,79 ; Down Num 1
jne still
;-----------------------------------------------------------------------------
keyone:
call down
keyfour:
call left
jmp mouseread
;-----------------------------------------------------------------------------
keythree:
call right
keytwo:
call down
jmp mouseread
;-----------------------------------------------------------------------------
keyseven:
call left
keyeight:
call up
jmp mouseread
;-----------------------------------------------------------------------------
keynine:
call up
keysix:
call right
jmp mouseread
;-----------------------------------------------------------------------------
keyfive:
inc edx
keyfive_1:
mcall 18,19,5
jmp still
;-----------------------------------------------------------------------------
left:
mov eax,esi
shl eax,16
sub edx,eax
ret
;-----------------------------------------------------------------------------
right:
mov eax,esi
shl eax,16
add edx,eax
ret
;-----------------------------------------------------------------------------
down:
add edx,esi
ret
;-----------------------------------------------------------------------------
up:
sub edx,esi
ret
;-----------------------------------------------------------------------------
mouseread:
xor ebx,ebx
mcall 37
add edx,eax
sravn:
xor ebx,ebx
xor edi,edi
real:
mov ebx,edx
mov edi,ebx
shr ebx,16 ; get x1
; shl edi,16 ; get y1
; shr edi,16
and edi,0xffff
nullli:
add ebx,16
cmp ebx,65535
jg xmin
sub ebx,15
add edi,16
cmp edi,65535
jg ymin
sub edi,15
razr:
mcall 14
mov ecx,eax
shr eax,16 ; get x2
; shl ecx,16 ; get y2
; shr ecx,16
and ecx,0xffff
rightdownli:
cmp eax,ebx
jl xmax
cmp ecx,edi
jl ymax
mousewrite:
mcall 18,19,4
mcall 26,9
mov [mouse_timer_ticks],eax
jmp still
;-----------------------------------------------------------------------------
mouse_acceleration:
xor esi,esi
inc esi
mcall 18,19,2
mov ecx,eax
mcall 26,9
sub eax,[mouse_timer_ticks]
cmp eax,ecx ; mouse_delay
ja @f
xor ecx,ecx
mcall 18,19 ; checkspeed
mov esi,eax
shl esi,2
@@:
ret
;-----------------------------------------------------------------------------
xmax:
dec eax
dec ebx
dec edi
shl eax,16
add edi,eax
mov edx,edi
jmp sravn
;-----------------------------------------------------------------------------
xmin:
mov edx,edi
jmp sravn
;-----------------------------------------------------------------------------
ymax:
dec ecx
dec ebx
shl ebx,16
mov edi,ebx
add edi,ecx
mov edx,edi
jmp sravn
;-----------------------------------------------------------------------------
ymin:
shl ebx,16
mov edx,ebx
shr ebx,16
jmp sravn
;-----------------------------------------------------------------------------
hotkeys_common:
xor ecx,ecx
xor edx,edx
mov cl,79 ; Down Num 1
mcall 66
mov cl,80 ; Down Num 2
mcall 66
mov cl,81 ; Down Num 3
mcall 66
mov cl,75 ; Down Num 4
mcall 66
mov cl,76 ; Down Num 5
mcall 66
mov cl,204 ; Up Num 5
mcall 66
mov cl,77 ; Down Num 6
mcall 66
mov cl,71 ; Down Num 7
mcall 66
mov cl,72 ; Down Num 8
mcall 66
mov cl,73 ; Down Num 9
mcall 66
; disable/enable input, work only hotkeys (f.66.6,66.7)
add ebx,2
mcall 66
ret
;-----------------------------------------------------------------------------
; <--- initialised data --->
DATA
;-----------------------------------------------------------------------------
; <--- uninitialised data --->
UDATA
mouse_timer_ticks dd 0
;-----------------------------------------------------------------------------
if lang eq ru_RU
ud_user_message db '"NumLock включает и выключает эмулятор мыши.\nУправление через Numpad." -I',0
else if lang eq it_IT
ud_user_message db '"NumLock - on/off - usa Numpad per muovere il cursore." -I',0
else
ud_user_message db '"NumLock - on/off mouse emul. Numpad - move cursor." -I',0
end if
notifyapp:
dd 7
dd 0
dd ud_user_message
dd 0
dd 0
db '@notify',0
;-----------------------------------------------------------------------------
MEOS_APP_END
; <--- end of KolibriOS application --->
; ZG
@@ -1,5 +1,5 @@
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")
add_include(tup.getvariantdir())
@@ -1,3 +1,9 @@
; SPDX-License-Identifier: NOASSERTION
;
; Text encoded with Code Page 866 - Cyrillic
; RDsave для Kolibri (0.6.5.0 и старше)
; Save RAM-disk to hard or floppy drive
;---------------------------------------------------------------------
@@ -25,15 +31,15 @@ dd cur_dir_path
include 'lang.inc' ; Language support for locales: ru_RU (CP866), et_EE, it_IT, en_US.
include '../../../macros.inc'
include '../../macros.inc'
if debug eq yes
include '../../../debug.inc'
include '../../debug.inc'
end if
include '../../../proc32.inc'
include '../../../dll.inc'
include '../../../KOSfuncs.inc'
include '../../../load_lib.mac'
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
include '../../proc32.inc'
include '../../dll.inc'
include '../../KOSfuncs.inc'
include '../../load_lib.mac'
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
include 'str.inc'
@use_library