Compare commits
8 Commits
webview-3.
...
a5e72d7ea4
| Author | SHA1 | Date | |
|---|---|---|---|
| a5e72d7ea4 | |||
| 2509dec262 | |||
| e335765afa | |||
| b9d5a827b0 | |||
| c6b957e002 | |||
| 4550e15838 | |||
| cc867a0bb8 | |||
| 16a0ef9543 |
@@ -195,8 +195,8 @@ extra_files = {
|
||||
{"kolibrios/develop/utils/SPEDump", SRC_PROGS .. "/develop/SPEDump/SPEDump.kex"},
|
||||
{"kolibrios/emul/", "common/emul/*"},
|
||||
{"kolibrios/emul/dosbox/", "common/emul/DosBox/*"},
|
||||
{"kolibrios/emul/e80/readme.txt", SRC_PROGS .. "/emulator/e80/trunk/readme.txt"},
|
||||
{"kolibrios/emul/e80/keyboard.png", SRC_PROGS .. "/emulator/e80/trunk/keyboard.png"},
|
||||
{"kolibrios/emul/e80/readme.txt", SRC_PROGS .. "/emulator/e80/readme.txt"},
|
||||
{"kolibrios/emul/e80/keyboard.png", SRC_PROGS .. "/emulator/e80/keyboard.png"},
|
||||
{"kolibrios/emul/fceu/fceu", SRC_PROGS .. "/emulator/fceu/fceu"},
|
||||
{"kolibrios/emul/fceu/FCEU ReadMe.txt", SRC_PROGS .. "/emulator/fceu/FCEU ReadMe.txt"},
|
||||
{"kolibrios/emul/chip8/chip8", VAR_PROGS .. "/emulator/chip8/chip8"},
|
||||
@@ -284,7 +284,7 @@ extra_files = {
|
||||
{"kolibrios/netsurf/res/", "common/network/netsurf/res/*"},
|
||||
{"kolibrios/res/skins/", "../skins/authors.txt"},
|
||||
{"kolibrios/res/templates/", "common/templates/*"},
|
||||
{"kolibrios/res/templates/", SRC_PROGS .. "/emulator/e80/trunk/games/*"},
|
||||
{"kolibrios/res/templates/", SRC_PROGS .. "/emulator/e80/games/*"},
|
||||
{"kolibrios/res/templates/NES/", "common/templates/NES/*"},
|
||||
{"kolibrios/res/wallpapers/", "common/wallpapers/*"},
|
||||
{"kolibrios/res/system/", build_type .. "/settings/kolibri.lbl"},
|
||||
@@ -409,7 +409,7 @@ tup.append_table(img_files, {
|
||||
{"HACONFIG", VAR_PROGS .. "/other/ha/HACONFIG"},
|
||||
{"ACLOCK", VAR_PROGS .. "/demos/aclock/aclock"},
|
||||
{"APM", VAR_PROGS .. "/system/apm/apm"},
|
||||
{"CALC", VAR_PROGS .. "/other/calc/trunk/calc"},
|
||||
{"CALC", VAR_PROGS .. "/other/calc/calc"},
|
||||
{"CALCPLUS", VAR_PROGS .. "/other/calcplus/calcplus"},
|
||||
{"CALENDAR", VAR_PROGS .. "/system/calendar/trunk/calendar"},
|
||||
{"COLRDIAL", VAR_PROGS .. "/system/colrdial/color_dialog"},
|
||||
@@ -428,14 +428,14 @@ tup.append_table(img_files, {
|
||||
{"KPACK", VAR_PROGS .. "/other/kpack/trunk/kpack"},
|
||||
{"LAUNCHER", VAR_PROGS .. "/system/launcher/trunk/launcher"},
|
||||
{"LOADDRV", VAR_PROGS .. "/system/loaddrv/loaddrv"},
|
||||
{"MAGNIFY", VAR_PROGS .. "/demos/magnify/trunk/magnify"},
|
||||
{"MAGNIFY", VAR_PROGS .. "/system/magnify/magnify"},
|
||||
{"MGB", VAR_PROGS .. "/testing/mgb/trunk/mgb"},
|
||||
{"MOUSEMUL", VAR_PROGS .. "/system/mousemul/trunk/mousemul"},
|
||||
{"MADMOUSE", VAR_PROGS .. "/other/madmouse/madmouse"},
|
||||
{"MYKEY", VAR_PROGS .. "/system/MyKey/trunk/MyKey"},
|
||||
{"PCIDEV", VAR_PROGS .. "/testing/pcidev/trunk/PCIDEV"},
|
||||
{"RDSAVE", VAR_PROGS .. "/system/rdsave/trunk/rdsave"},
|
||||
{"RTFREAD", VAR_PROGS .. "/other/rtfread/trunk/rtfread"},
|
||||
{"RTFREAD", VAR_PROGS .. "/other/rtfread/rtfread"},
|
||||
{"SEARCHAP", VAR_PROGS .. "/system/searchap/searchap"},
|
||||
{"SCRSHOOT", VAR_PROGS .. "/media/scrshoot/scrshoot"},
|
||||
{"SETUP", VAR_PROGS .. "/system/setup/trunk/setup"},
|
||||
@@ -641,7 +641,7 @@ if build_type == "ru_RU" then tup.append_table(img_files, {
|
||||
}) end
|
||||
|
||||
if build_type == "ru_RU" then tup.append_table(extra_files, {
|
||||
{"kolibrios/utils/period", VAR_PROGS .. "/other/period/trunk/period"},
|
||||
{"kolibrios/utils/period", VAR_PROGS .. "/other/period/period"},
|
||||
{"kolibrios/games/Dungeons/Dungeons", VAR_PROGS .. "/games/Dungeons/Dungeons"},
|
||||
}) end
|
||||
|
||||
@@ -752,7 +752,7 @@ tup.append_table(img_files, {
|
||||
tup.append_table(extra_files, {
|
||||
-- {"kolibrios/3D/cubeline", VAR_PROGS .. "/demos/cubeline/trunk/cubeline"},
|
||||
{"kolibrios/3D/gears", VAR_PROGS .. "/demos/gears/gears"},
|
||||
{"kolibrios/emul/e80/e80", VAR_PROGS .. "/emulator/e80/trunk/e80"},
|
||||
{"kolibrios/emul/e80/e80", VAR_PROGS .. "/emulator/e80/e80"},
|
||||
{"kolibrios/emul/uarm/", VAR_CONTRIB .. "/other/uarm/uARM"},
|
||||
{"kolibrios/games/2048", VAR_PROGS .. "/games/2048/2048"},
|
||||
{"kolibrios/games/checkers", VAR_PROGS .. "/games/checkers/checkers"},
|
||||
|
||||
@@ -13,12 +13,12 @@ rem
|
||||
set __value=
|
||||
set __res=
|
||||
shift
|
||||
|
||||
|
||||
:__allowed
|
||||
set __values=%1 %__values%
|
||||
shift
|
||||
if not "%1"=="" goto __allowed
|
||||
|
||||
|
||||
set /P __res=">
|
||||
:Check_Value
|
||||
for %%a in (%__values%) do if %%a==%__res% set __value=%__res%
|
||||
@@ -59,7 +59,7 @@ echo *
|
||||
fasm system\calendar\trunk\calendar.asm %BIN%\calendar
|
||||
fasm system\board\trunk\board.asm %BIN%\develop\board
|
||||
fasm system\commouse\trunk\commouse.asm %BIN%\commouse
|
||||
fasm system\cpu\trunk\cpu.asm %BIN%\cpu
|
||||
fasm system\cpu\trunk\cpu.asm %BIN%\cpu
|
||||
fasm system\cpuid\trunk\cpuid.asm %BIN%\cpuid
|
||||
fasm system\skincfg\trunk\skincfg.asm %BIN%\skincfg
|
||||
fasm system\docpack\trunk\docpack.asm %BIN%\docpack
|
||||
@@ -154,10 +154,10 @@ echo *
|
||||
echo Building other
|
||||
echo *
|
||||
rem fasm other\archer\trunk\@rcher.asm %BIN%\@rcher
|
||||
fasm other\calc\trunk\calc.asm %BIN%\calc
|
||||
fasm other\calc\calc.asm %BIN%\calc
|
||||
fasm other\mhc\trunk\mhc.asm %BIN%\mhc
|
||||
fasm other\period\trunk\period.asm %BIN%\period
|
||||
fasm other\rtfread\trunk\rtfread.asm %BIN%\rtfread
|
||||
fasm other\period\period.asm %BIN%\period
|
||||
fasm other\rtfread\rtfread.asm %BIN%\rtfread
|
||||
|
||||
echo *
|
||||
echo Building media
|
||||
@@ -242,27 +242,27 @@ fasm system\hdd_info\trunk\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 other\kpack\trunk\kpack.asm %BIN%\nightbuild\kpack
|
||||
fasm other\rtfread\trunk\rtfread.asm %BIN%\nightbuild\rtfread
|
||||
fasm other\rtfread\rtfread.asm %BIN%\nightbuild\rtfread
|
||||
;restore
|
||||
echo __CPU_type fix %res% > config.inc
|
||||
erase lang.inc
|
||||
|
||||
echo *
|
||||
echo Finished building
|
||||
echo Finished building
|
||||
echo *
|
||||
|
||||
|
||||
kpack /nologo 2> nul
|
||||
if "%errorlevel%"=="9009" (
|
||||
echo *** NOTICE ***
|
||||
echo If you want to pack all applications you may
|
||||
echo If you want to pack all applications you may
|
||||
echo place "kpack" in accessible directory.
|
||||
echo You can download that tool from http://diamondz.land.ru/
|
||||
goto END
|
||||
)
|
||||
|
||||
echo Kpack KolibriOS apps?
|
||||
echo
|
||||
echo
|
||||
|
||||
set /P res=[y/n]?
|
||||
|
||||
@@ -273,7 +273,7 @@ echo Compressing system
|
||||
echo *
|
||||
kpack %BIN%\calendar
|
||||
kpack %BIN%\develop\board
|
||||
kpack %BIN%\cpu
|
||||
kpack %BIN%\cpu
|
||||
kpack %BIN%\cpuid
|
||||
kpack %BIN%\skincfg
|
||||
kpack %BIN%\docpack
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
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({"magnify.asm", extra_inputs = {"lang.inc"}}, FASM .. " %f %o " .. tup.getconfig("KPACK_CMD"), "magnify")
|
||||
@@ -1,6 +0,0 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix en_US >lang.inc
|
||||
@fasm magnify.asm magnify
|
||||
@kpack magnify
|
||||
@erase lang.inc
|
||||
@pause
|
||||
@@ -1,6 +0,0 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix ru_RU >lang.inc
|
||||
@fasm magnify.asm magnify
|
||||
@kpack magnify
|
||||
@erase lang.inc
|
||||
@pause
|
||||
@@ -1,156 +0,0 @@
|
||||
;---------------------------------------------------------------------
|
||||
; MAGNIFY SCREEN v1.0
|
||||
;
|
||||
; Version for KolibriOS 2005-2011
|
||||
;
|
||||
; Version for Menuet to 2005
|
||||
;---------------------------------------------------------------------
|
||||
; last update: 08/18/2011
|
||||
; changed by: Marat Zakiyanov aka Mario79, aka Mario
|
||||
; changes: Checking for "rolled up" window
|
||||
;---------------------------------------------------------------------
|
||||
use32
|
||||
org 0x0
|
||||
db 'MENUET01' ; 8 byte id
|
||||
dd 1 ; header version
|
||||
dd START ; program start
|
||||
dd I_END ; program image size
|
||||
dd 0x1000 ; required amount of memory
|
||||
dd 0x1000 ; esp
|
||||
dd 0, 0 ; no parameters, no path
|
||||
;---------------------------------------------------------------------
|
||||
include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US.
|
||||
include '..\..\..\macros.inc'
|
||||
delay equ 20
|
||||
|
||||
magnify_width = 40
|
||||
magnify_height = 30
|
||||
;---------------------------------------------------------------------
|
||||
START: ; start of execution
|
||||
redraw:
|
||||
call draw_window
|
||||
still:
|
||||
call draw_magnify
|
||||
wtevent:
|
||||
mcall 23,delay ; wait here for event with timeout
|
||||
dec eax
|
||||
js still
|
||||
jz redraw
|
||||
dec eax
|
||||
jnz button
|
||||
; key in buffer
|
||||
mov al, 2
|
||||
mcall
|
||||
jmp wtevent
|
||||
;---------------------------------------------------------------------
|
||||
button:
|
||||
; we have only one button, close
|
||||
or eax, -1
|
||||
mcall
|
||||
;---------------------------------------------------------------------
|
||||
; ******* WINDOW DEFINITIONS AND DRAW ********
|
||||
;---------------------------------------------------------------------
|
||||
draw_window:
|
||||
mcall 12,1
|
||||
|
||||
mov al, 48 ; function 48 : graphics parameters
|
||||
mov bl, 4 ; subfunction 4 : get skin height
|
||||
mcall
|
||||
; DRAW WINDOW
|
||||
mov ebx, 100*65536 + 8*magnify_width + 8
|
||||
lea ecx, [eax + 100*65536 + 8*magnify_height + 3]
|
||||
mov edx, 0x34000000 ; color of work area RRGGBB
|
||||
mov edi, labelt ; header
|
||||
xor eax, eax ; function 0 : define and draw window
|
||||
mcall
|
||||
|
||||
mcall 12,2
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
draw_magnify:
|
||||
mcall 9,procinfo,-1
|
||||
mov eax,[procinfo+70] ;status of window
|
||||
test eax,100b
|
||||
jne .end
|
||||
|
||||
mcall 14 ; get screen size
|
||||
movzx ecx, ax
|
||||
inc ecx
|
||||
mov [size_y], ecx
|
||||
shr eax, 16
|
||||
inc eax
|
||||
mov [size_x], eax
|
||||
|
||||
xor ebx, ebx
|
||||
mcall 37 ; get mouse coordinates
|
||||
mov ecx, eax
|
||||
shr ecx, 16 ; ecx = x
|
||||
movzx edx, ax ; edx = y
|
||||
inc ecx
|
||||
mov [m_xe], ecx
|
||||
inc edx
|
||||
mov [m_ye], edx
|
||||
sub ecx, magnify_width
|
||||
sub edx, magnify_height
|
||||
mov [m_x], ecx
|
||||
mov [m_y], edx
|
||||
.loop_y:
|
||||
.loop_x:
|
||||
xor eax, eax ; assume black color for invalid pixels
|
||||
test ecx, ecx
|
||||
js .nopix
|
||||
cmp ecx, [size_x]
|
||||
jge .nopix
|
||||
test edx, edx
|
||||
js .nopix
|
||||
cmp edx, [size_y]
|
||||
jge .nopix
|
||||
mov ebx, edx
|
||||
imul ebx, [size_x]
|
||||
add ebx, ecx
|
||||
mcall 35 ; read pixel
|
||||
.nopix:
|
||||
push ecx edx
|
||||
sub ecx, [m_x]
|
||||
sub edx, [m_y]
|
||||
mov ebx, ecx
|
||||
shl ebx, 3+16
|
||||
mov bl, 8
|
||||
mov ecx, edx
|
||||
shl ecx, 3+16
|
||||
mov cl, 8
|
||||
mov edx, eax
|
||||
mcall 13
|
||||
pop edx ecx
|
||||
inc ecx
|
||||
cmp ecx, [m_xe]
|
||||
jnz .loop_x
|
||||
mov ecx, [m_x]
|
||||
inc edx
|
||||
cmp edx, [m_ye]
|
||||
jnz .loop_y
|
||||
.end:
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
; DATA AREA
|
||||
;---------------------------------------------------------------------
|
||||
if lang eq ru_RU
|
||||
labelt:
|
||||
db 'Magnifier - <20>ªà ï «ã¯ ', 0
|
||||
else ; Default to en_US
|
||||
labelt:
|
||||
db 'Magnifier', 0
|
||||
end if
|
||||
|
||||
I_END:
|
||||
align 4
|
||||
m_x dd ?
|
||||
m_y dd ?
|
||||
m_xe dd ?
|
||||
m_ye dd ?
|
||||
size_x dd ?
|
||||
size_y dd ?
|
||||
;---------------------------------------------------------------------
|
||||
procinfo:
|
||||
rb 1024
|
||||
;---------------------------------------------------------------------
|
||||
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 103 KiB |
@@ -1,5 +1,5 @@
|
||||
if tup.getconfig("NO_FASM") ~= "" or tup.getconfig("NO_GCC") ~= "" 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_gcc.lua")
|
||||
INCLUDES = INCLUDES .. "-I" .. tup.getvariantdir()
|
||||
LDFLAGS = LDFLAGS .. " -T kolibri.ld"
|
||||
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
4
programs/system/magnify/Tupfile.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
if tup.getconfig("NO_FASM") ~= "" then return end
|
||||
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR")
|
||||
tup.include(HELPERDIR .. "/use_fasm.lua")
|
||||
tup.rule("magnify.asm", FASM .. " -dlang=" .. tup.getconfig("LANG") .. " %f %o" .. tup.getconfig("KPACK_CMD"), "%B")
|
||||
229
programs/system/magnify/magnify.asm
Normal file
@@ -0,0 +1,229 @@
|
||||
; SPDX-License-Identifier: GPL-2.0-only
|
||||
;
|
||||
; Magnify - Screen Magnifier
|
||||
; Copyright (C) 2005 MenuetOS
|
||||
; Copyright (C) 2005-2025 KolibriOS team
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
use32
|
||||
org 0x0
|
||||
|
||||
db 'MENUET01'
|
||||
dd 1
|
||||
dd START
|
||||
dd I_END
|
||||
dd MEM
|
||||
dd STACKTOP
|
||||
dd 0, 0
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
include '../../macros.inc'
|
||||
include "../../KOSfuncs.inc"
|
||||
include "../../encoding.inc"
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
START:
|
||||
mcall SF_SET_EVENTS_MASK, EVM_REDRAW or EVM_BUTTON or EVM_MOUSE
|
||||
|
||||
mcall SF_SYS_MISC, SSF_HEAP_INIT
|
||||
|
||||
; initializing MAG_H * MAG_W rect of pixels from screen
|
||||
mcall SF_SYS_MISC, SSF_MEM_ALLOC, MAG_H * MAG_W * 3
|
||||
mov [screen_rect], eax
|
||||
|
||||
call logic_read_screen
|
||||
|
||||
still:
|
||||
mcall SF_WAIT_EVENT_TIMEOUT, DELAY
|
||||
|
||||
cmp eax, EV_REDRAW
|
||||
je redraw
|
||||
|
||||
cmp eax, EV_BUTTON
|
||||
je button
|
||||
|
||||
cmp eax, EV_MOUSE
|
||||
je mouse
|
||||
|
||||
jmp redraw
|
||||
|
||||
redraw:
|
||||
call draw_window
|
||||
call draw_magnify
|
||||
|
||||
jmp still
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
button:
|
||||
; we have only one button, close
|
||||
or eax, SF_TERMINATE_PROCESS
|
||||
mcall
|
||||
|
||||
mouse:
|
||||
mcall SF_MOUSE_GET, SSF_BUTTON
|
||||
|
||||
test ax, 0x0001
|
||||
jnz still
|
||||
|
||||
call logic_read_screen
|
||||
call draw_magnify
|
||||
|
||||
jmp still
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
; ******* WINDOW DEFINITIONS AND DRAW ********
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
draw_window:
|
||||
|
||||
mcall SF_REDRAW, SSF_BEGIN_DRAW
|
||||
|
||||
mcall SF_STYLE_SETTINGS, SSF_GET_SKIN_HEIGHT
|
||||
|
||||
mov ecx, eax
|
||||
add ecx, WIN.Y shl 16 + WIN.H
|
||||
|
||||
mcall SF_CREATE_WINDOW, <WIN.X, WIN.W>, , 0x34181818, , labelt
|
||||
|
||||
mcall SF_REDRAW, SSF_END_DRAW
|
||||
|
||||
ret
|
||||
|
||||
|
||||
; MAG_H * MAG_W pixels grid
|
||||
draw_magnify:
|
||||
|
||||
mcall SF_THREAD_INFO, procinfo, -1
|
||||
mov al, byte [procinfo.wnd_state]
|
||||
test al, 0x04
|
||||
jne .du_loop_end
|
||||
|
||||
mov eax, SF_DRAW_RECT
|
||||
mov ebx, MAG_S - 1
|
||||
mov ecx, MAG_S - 1
|
||||
mov esi, [screen_rect]
|
||||
mov edi, MAG_W * MAG_H
|
||||
|
||||
.du_loop_rect:
|
||||
mcall , , , dword [esi]
|
||||
add ebx, MAG_S shl 16
|
||||
cmp ebx, MAG_S * MAG_W shl 16
|
||||
jle .du_loop_rect_row
|
||||
mov ebx, MAG_S - 1
|
||||
add ecx, MAG_S shl 16
|
||||
|
||||
.du_loop_rect_row:
|
||||
add esi, 3
|
||||
dec edi
|
||||
jne .du_loop_rect
|
||||
|
||||
.du_loop_end:
|
||||
ret
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
; LOGIC AREA
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
; read array of pixels from screen by mouse coords
|
||||
logic_read_screen:
|
||||
|
||||
mcall SF_MOUSE_GET, SSF_SCREEN_POSITION
|
||||
mov edx, eax
|
||||
|
||||
; clamping mouse coords to stay within the screen
|
||||
mcall SF_GET_SCREEN_SIZE
|
||||
mov ebx, eax
|
||||
call logic_clamp_pixels
|
||||
|
||||
sub edx, (MAG_W / 2) shl 16 + (MAG_H / 2)
|
||||
mcall SF_GET_IMAGE, [screen_rect], <MAG_W, MAG_H>,
|
||||
|
||||
ret
|
||||
|
||||
|
||||
; clamping mouse coords to stay within the screen
|
||||
logic_clamp_pixels:
|
||||
|
||||
mov eax, edx
|
||||
shr eax, 16
|
||||
mov cx, ax
|
||||
mov ax, dx
|
||||
|
||||
push ax
|
||||
push cx
|
||||
mov ax, bx
|
||||
mov di, ax
|
||||
mov eax, ebx
|
||||
shr eax, 16
|
||||
mov si, ax
|
||||
|
||||
pop cx
|
||||
pop ax
|
||||
|
||||
.check_min_x:
|
||||
cmp cx, MAG_W / 2
|
||||
jge .check_min_y
|
||||
mov cx, MAG_W / 2
|
||||
.check_min_y:
|
||||
cmp ax, MAG_H / 2
|
||||
jge .check_max_x
|
||||
mov ax, MAG_H / 2
|
||||
.check_max_x:
|
||||
mov dx, si
|
||||
sub dx, MAG_W / 2 - 1
|
||||
cmp cx, dx
|
||||
jle .check_max_y
|
||||
mov cx, dx
|
||||
.check_max_y:
|
||||
mov dx, di
|
||||
sub dx, MAG_H / 2 - 1
|
||||
cmp ax, dx
|
||||
jle .combine_coords
|
||||
mov ax, dx
|
||||
|
||||
.combine_coords:
|
||||
mov dx, cx
|
||||
shl edx, 16
|
||||
or dx, ax
|
||||
|
||||
ret
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
; DATA AREA
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
DELAY = 5
|
||||
|
||||
MAG_W = 40
|
||||
MAG_H = 30
|
||||
MAG_S = 8
|
||||
|
||||
WIN RECT 100, 100, MAG_W * MAG_S + 8, MAG_H * MAG_S + 3
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
if lang eq ru_RU
|
||||
labelt cp866 'Magnify - Экранная лупа', 0
|
||||
else if lang eq es_ES
|
||||
labelt db 'Magnify - Lupa de Pantalla', 0
|
||||
else
|
||||
labelt db 'Magnify - Screen Magnifier', 0
|
||||
endf
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
screen_rect dd 0x00000000
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
I_END:
|
||||
rb 512
|
||||
align 512
|
||||
|
||||
STACKTOP:
|
||||
procinfo process_information
|
||||
MEM:
|
||||