WIP: programs/media: Post-SVN tidy #260
@@ -159,10 +159,10 @@ extra_files = {
|
||||
{"kolibrios/3D/blocks/models/", "../programs/bcc32/games/blocks/models/*"},
|
||||
{"kolibrios/3D/md2view/", "common/3d/md2view/*"},
|
||||
{"kolibrios/3D/md2view/md2_model/", "common/3d/md2view/md2_model/*"},
|
||||
{"kolibrios/3D/voxel_editor/VOX_EDITOR.INI", SRC_PROGS .. "/media/voxel_editor/trunk/vox_editor.ini"},
|
||||
{"kolibrios/3D/voxel_editor/HOUSE1.VOX", SRC_PROGS .. "/media/voxel_editor/trunk/house1.vox"},
|
||||
{"kolibrios/3D/voxel_editor/HOUSE2.VOX", SRC_PROGS .. "/media/voxel_editor/trunk/house2.vox"},
|
||||
{"kolibrios/3D/voxel_editor/SQUIRREL.VOX", SRC_PROGS .. "/media/voxel_editor/trunk/squirrel.vox"},
|
||||
{"kolibrios/3D/voxel_editor/VOX_EDITOR.INI", SRC_PROGS .. "/media/voxel_editor/vox_editor.ini"},
|
||||
{"kolibrios/3D/voxel_editor/HOUSE1.VOX", SRC_PROGS .. "/media/voxel_editor/house1.vox"},
|
||||
{"kolibrios/3D/voxel_editor/HOUSE2.VOX", SRC_PROGS .. "/media/voxel_editor/house2.vox"},
|
||||
{"kolibrios/3D/voxel_editor/SQUIRREL.VOX", SRC_PROGS .. "/media/voxel_editor/squirrel.vox"},
|
||||
{"kolibrios/3D/voxel_utilites/VOX_MOVER.INI" , SRC_PROGS .. "/media/voxel_editor/utilites/vox_mover.ini"},
|
||||
{"kolibrios/3D/FONT8X9.BMP", SRC_PROGS .. "/fs/kfar/trunk/font8x9.bmp"},
|
||||
{"kolibrios/3D/TOOLB_1.PNG", SRC_PROGS .. "/develop/libraries/TinyGL/asm_fork/examples/toolb_1.png"},
|
||||
@@ -527,11 +527,11 @@ tup.append_table(img_files, {
|
||||
{"MEDIA/FILLSCR", VAR_PROGS .. "/media/FillScr/fillscr"},
|
||||
{"MEDIA/KIV", VAR_PROGS .. "/media/kiv/kiv"},
|
||||
{"MEDIA/LISTPLAY", VAR_PROGS .. "/media/listplay/listplay"},
|
||||
{"MEDIA/MIDAMP", VAR_PROGS .. "/media/midamp/trunk/midamp"},
|
||||
{"MEDIA/MIDAMP", VAR_PROGS .. "/media/midamp/midamp"},
|
||||
{"MEDIA/MP3INFO", VAR_PROGS .. "/media/mp3info/mp3info"},
|
||||
{"MEDIA/PALITRA", VAR_PROGS .. "/media/palitra/trunk/palitra"},
|
||||
{"MEDIA/PALITRA", VAR_PROGS .. "/media/palitra/palitra"},
|
||||
{"MEDIA/PIANO", VAR_PROGS .. "/media/piano/piano"},
|
||||
{"MEDIA/STARTMUS", VAR_PROGS .. "/media/startmus/trunk/STARTMUS"},
|
||||
{"MEDIA/STARTMUS", VAR_PROGS .. "/media/startmus/STARTMUS"},
|
||||
{"NETWORK/PING", VAR_PROGS .. "/network/ping/ping"},
|
||||
{"NETWORK/NETCFG", VAR_PROGS .. "/network/netcfg/netcfg"},
|
||||
{"NETWORK/NETSTAT", VAR_PROGS .. "/network/netstat/netstat"},
|
||||
@@ -600,7 +600,7 @@ tup.append_table(extra_files, {
|
||||
{"kolibrios/3D/info3ds/INFO3DS", VAR_PROGS .. "/develop/info3ds/info3ds"},
|
||||
{"kolibrios/3D/textures1", VAR_PROGS .. "/develop/libraries/TinyGL/asm_fork/examples/textures1"},
|
||||
{"kolibrios/3D/info3ds/INFO3DS_U", VAR_PROGS .. "/develop/info3ds/info3ds_u"},
|
||||
{"kolibrios/3D/voxel_editor/VOXEL_EDITOR", VAR_PROGS .. "/media/voxel_editor/trunk/voxel_editor"},
|
||||
{"kolibrios/3D/voxel_editor/VOXEL_EDITOR", VAR_PROGS .. "/media/voxel_editor/voxel_editor"},
|
||||
{"kolibrios/3D/voxel_utilites/VOX_CREATOR" , VAR_PROGS .. "/media/voxel_editor/utilites/vox_creator"},
|
||||
{"kolibrios/3D/voxel_utilites/VOX_MOVER" , VAR_PROGS .. "/media/voxel_editor/utilites/vox_mover"},
|
||||
{"kolibrios/3D/voxel_utilites/VOX_TGL" , VAR_PROGS .. "/media/voxel_editor/utilites/vox_tgl"},
|
||||
|
@@ -164,17 +164,16 @@ echo Building media
|
||||
echo *
|
||||
rem media\ac97snd\trunk\ac97snd.asm ac97snd
|
||||
fasm media\animage\animage.asm %BIN%\animage
|
||||
fasm media\cdp\trunk\cdp.asm %BIN%\cdp
|
||||
fasm media\gifview\trunk\gifview.asm %BIN%\gifview
|
||||
fasm media\iconedit\trunk\iconedit.asm %BIN%\iconedit
|
||||
fasm media\jpegview\trunk\jpegview.asm %BIN%\jpegview
|
||||
fasm media\midamp\trunk\midamp.asm %BIN%\midamp
|
||||
fasm media\midiplay\trunk\midiplay.asm %BIN%\midiplay
|
||||
fasm media\mixer\trunk\mixer.asm %BIN%\mixer
|
||||
|
||||
fasm media\mv\trunk\mv.asm %BIN%\mv
|
||||
fasm media\pic4\trunk\pic4.asm %BIN%\pic4
|
||||
fasm media\sb\trunk\sb.asm %BIN%\sb
|
||||
rem fasm media\cdp\trunk\cdp.asm %BIN%\cdp
|
||||
rem fasm media\gifview\trunk\gifview.asm %BIN%\gifview
|
||||
rem fasm media\iconedit\trunk\iconedit.asm %BIN%\iconedit
|
||||
rem fasm media\jpegview\trunk\jpegview.asm %BIN%\jpegview
|
||||
fasm media\midamp\midamp.asm %BIN%\midamp
|
||||
fasm media\midiplay\midiplay.asm %BIN%\midiplay
|
||||
rem fasm media\mixer\trunk\mixer.asm %BIN%\mixer
|
||||
rem fasm media\mv\trunk\mv.asm %BIN%\mv
|
||||
fasm media\pic4\pic4.asm %BIN%\pic4
|
||||
rem fasm media\sb\trunk\sb.asm %BIN%\sb
|
||||
fasm media\scrshoot\scrshoot.asm %BIN%\scrshoot
|
||||
|
||||
echo *
|
||||
@@ -234,7 +233,7 @@ echo __nightbuild fix yes >> config.inc
|
||||
fasm media\kiv\kiv.asm %BIN%\nightbuild\kiv
|
||||
fasm media\scrshoot\scrshoot.asm %BIN%\nightbuild\scrshoot
|
||||
fasm media\animage\animage.asm %BIN%\nightbuild\animage
|
||||
fasm media\midamp\trunk\midamp.asm %BIN%\nightbuild\midamp
|
||||
fasm media\midamp\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
|
||||
|
@@ -1,5 +1,5 @@
|
||||
if not exist bin mkdir bin
|
||||
if not exist bin\font6x9.bmp @copy ..\..\..\fs\kfar\trunk\font6x9.bmp bin\font6x9.bmp
|
||||
if not exist bin\font6x9.bmp @copy ..\..\fs\kfar\trunk\font6x9.bmp bin\font6x9.bmp
|
||||
@copy *.png bin\*.png
|
||||
@copy *.txt bin\*.txt
|
||||
@fasm.exe -m 16384 log_el.asm bin\log_el.kex
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 192 B After Width: | Height: | Size: 192 B |
Before Width: | Height: | Size: 670 B After Width: | Height: | Size: 670 B |
Before Width: | Height: | Size: 960 B After Width: | Height: | Size: 960 B |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
@@ -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())
|
||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 673 B After Width: | Height: | Size: 673 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -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,9 +1,12 @@
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
;
|
||||
; Ok, this is the sceleton that MENUET 0.01 understands.
|
||||
; Do not change the header bits for now. Compile with nasm.
|
||||
;
|
||||
|
||||
include '..\..\..\macros.inc'
|
||||
include '..\..\macros.inc'
|
||||
|
||||
use32
|
||||
org 0x0
|
||||
@@ -295,6 +298,3 @@ errorlen2:
|
||||
base db 0x0
|
||||
|
||||
I_END:
|
||||
|
||||
|
||||
|
@@ -1,331 +1,337 @@
|
||||
;*********************************
|
||||
;* *
|
||||
;* PAINT 0.02 ¤«ï MenuetOS *
|
||||
;* *
|
||||
;* Š®¬¯¨«¨à®¢ âì FASM'®¬ *
|
||||
;* *
|
||||
;*********************************
|
||||
|
||||
;******************************************************************************
|
||||
; <20>âã ¯à®£à ¬¬ã ¥ 㦮 á¥à쥧® à áᬠâਢ âì - íâ® ¢á¥£® «¨èì ¯à¨¬¥à,
|
||||
; ¢ ª®â®à®¬ ¯®ª § ®, ª ª à ¡®â âì á ¥ª®â®à묨 á¨á⥬묨 äãªæ¨ï¬¨ Œ¥Ž‘,
|
||||
; ® ¨ª ª ¥ ®à¬ «ìë© £à ä¨ç¥áª¨© । ªâ®à. Š®¤ ¯à®£à ¬¬ë Ž—…<E28094>œ ¯à®á⮩,
|
||||
; ¨ ® ¯à¥¤ § ç¥ ¤«ï â¥å, ªâ® ⮫쪮 ç¨ ¥â ¨§ãç âì áᥬ¡«¥à,
|
||||
; ¯®í⮬ã ï áâ६¨«áï ᤥ« âì ¥£® ª ª ¬®¦® ¡®«¥¥ ¯®ïâë¬.
|
||||
; ’¥¬ ¥ ¬¥¥¥, ª®¤ ¤®¢®«ì® ¥¯«®å® ®¯â¨¬¨§¨à®¢ , å®âï íâ® ¥¬®£®
|
||||
; ¬®¦¥â § âà㤨âì ¥£® ¯®¨¬ ¨¥. Ÿ ¯®áâ à «áï âé â¥«ì® ¯à®ª®¬¬¥â¨à®¢ âì
|
||||
; á«®¦ë¥ ¬¥áâ . Šáâ â¨, ¨¤¥ï ¯à®£à ¬¬ë ¯à¨ ¤«¥¦¨â ¥ ¬¥, Sniper'ã, ¤«ï
|
||||
; ª®â®à®£® ¢®¡é¥¬-â® ¢á¥ ¨ ¯¨á «®áì.
|
||||
; “¤ ç¨ ¢ ¨§ã票¨ ᬠ!
|
||||
; ˆ¢ <20>®¤¤ã¡ë©, ivan-yar@bk.ru
|
||||
;******************************************************************************
|
||||
|
||||
; <EFBFBD>®¤ª«îç ¥¬ ¥®¡å®¤¨¬ë¥ ¬ ªà®áë
|
||||
include '../../../macros.inc'
|
||||
|
||||
;******************************************************************************
|
||||
|
||||
; <20>€—€‹Ž <20><>Žƒ<C5BD>€ŒŒ›
|
||||
use32
|
||||
org 0x0
|
||||
db 'MENUET01' ; 8 byte id
|
||||
dd 0x01 ; title version
|
||||
dd START ; start of code
|
||||
dd I_END ; size of image
|
||||
dd E_END ; memory for app
|
||||
dd E_END ; esp
|
||||
dd 0x0,0x0 ; I_Param , I_Icon
|
||||
|
||||
; Ž<>‹€‘’œ ŠŽ„€
|
||||
START:
|
||||
mov eax,40 ; á®®¡é¨¬ á¨á⥬¥, ª ª¨¥ ᮡëâ¨ï ¡ã¤¥¬ ®¡à ¡ âë¢ âì
|
||||
mov ebx,0100101b ; ¬ ᪠ᮡë⨩ - ¯¥à¥à¨á®¢ª (1) + ª®¯ª (3) + ¬ëèì (6
|
||||
int 0x40 ; íâ ª®¬ ¤ ¢ë§ë¢ ¥â á¨á⥬ãî äãªæ¨î
|
||||
|
||||
mov [workarea.cx],5 ; ª®®à¤¨ âë à ¡®ç¥© (ª«¨¥â᪮©) ®¡« áâ¨
|
||||
mov [workarea.cy],30 ; ¤«ï à¨á®¢ ¨ï
|
||||
|
||||
red:
|
||||
call draw_window ; ¢ë§ë¢ ¥¬ ¯à®æ¥¤ãàã ®âà¨á®¢ª¨ ®ª
|
||||
|
||||
still: ; ƒ‹€‚<EFBFBD>›‰ –ˆŠ‹ <20><>Žƒ<C5BD>€ŒŒ› - –ˆŠ‹ Ž<><C5BD>€<EFBFBD>Ž’Šˆ ‘ŽŽ<C5BD>™…<E284A2>ˆ‰
|
||||
|
||||
mov eax,10 ; äãªæ¨ï 10 - ¦¤ âì ᮡëâ¨ï; ¯à®£à ¬¬ ®áâ ¢«¨¢ ¥âáï
|
||||
int 0x40 ; á«¥¤ãîé ï ª®¬ ¤ ¥ ¡ã¤¥â ¢ë¯®«¥ ¤® â¥å ¯®à, ¯®ª
|
||||
; ¥ ¯à®¨§®©¤ñâ ᮡë⨥
|
||||
|
||||
; ⥯¥àì ॣ¨áâà eax ᮤ¥à¦¨â ®¬¥à ᮡëâ¨ï
|
||||
; ¯®®ç¥à¥¤® áà ¢¨¬ ¥£® á® ¢á¥¬¨ ¢®§¬®¦ë¬¨ § 票ﬨ, çâ®¡ë ¢ë§¢ âì
|
||||
; ã¦ë© ®¡à ¡®â稪
|
||||
|
||||
cmp eax,1 ; ¯¥à¥à¨á®¢ âì ®ª® ?
|
||||
je red ; ¥á«¨ ॣ¨áâà eax à ¢¥ ¥¤¨¨æ¥, â® ¯¥à¥å®¤¨¬ ¬¥âªã red
|
||||
cmp eax,3 ; ¦ â ª®¯ª ?
|
||||
je button
|
||||
cmp eax,6 ; ¬ëèì?
|
||||
je mouse
|
||||
|
||||
jmp still ; ¥á«¨ ¯à®¨§®è«® ᮡë⨥, ª®â®à®¥ ¬ë ¥ ®¡à ¡ âë¢ ¥¬,
|
||||
; ¯à®áâ® ¢®§¢à é ¥¬áï ª ç «ã æ¨ª« , å®âï â ª®£® ¡ëâì
|
||||
; ¥ ¤®«¦®! ’.¥. ¥á«¨ íâã ª®¬ ¤ã ®âáî¤ ã¡à âì, â®
|
||||
; ¨ç¥£® áâà 讣® ¥ á«ãç¨âáï.
|
||||
|
||||
;******************************************************************************
|
||||
|
||||
button: ; ®¡à ¡®â稪 ¦ â¨ï ª®¯ª¨ ¢ ®ª¥ ¯à®£à ¬¬ë
|
||||
mov eax,17 ; äãªæ¨ï N17 - ¯®«ãç¨âì ¨¤¥â¨ä¨ª â®à ¦ ⮩ ª®¯ª¨
|
||||
int 0x40
|
||||
|
||||
; ⥯¥àì ¢ ॣ¨áâॠah ᮤ¥à¦¨âáï ¨¤¥â¨ä¨ª â®à.
|
||||
|
||||
shr eax,8 ; ah -> al (ᤢ¨£ 8 ¡¨â ¢¯à ¢®)
|
||||
|
||||
dec al ; ¨¤¥â¨ä¨ª â®à_ª®¯ª¨--;
|
||||
jnz .noclose ; ¥á«¨ १ã«ìâ ⠯।ë¤ã饩 ª®¬ ¤ë à ¢¥ ã«î, § ªàë¢ ¥¬áï
|
||||
; ¨ ç¥ - ¨¤ñ¬ ¬¥âªã noclose
|
||||
|
||||
or eax,-1 ; ¢ë室 ¨§ ¯à®£à ¬¬ë
|
||||
int 0x40
|
||||
|
||||
.noclose:
|
||||
; ¥á«¨ ¬ë áî¤ ¯®¯ «¨, § ç¨â ¨¤¥â¨ä¨ª â®à ª®¯ª¨ ¥ ¡ë« à ¢¥ ã«î...
|
||||
; ⥯¥àì ã á ¢ eax ᮤ¥à¦¨âáï (®¬¥à 梥⮩ ª®¯ª¨ - 1),
|
||||
; â.¥ ¨«¨ 1, ¨«¨ 2, ... ,¨«¨ 5
|
||||
|
||||
; 㬥ì訬 1:
|
||||
dec eax
|
||||
|
||||
; ¢®â íâ ¢®â ª®¬ ¤ ¨§¢«¥ª ¥â ¢ eax ¤¢®©®¥ á«®¢® ¯® ¤à¥áã colors+eax*4
|
||||
; £¤¥ colors - ᬥ饨¥ ¬¥âª¨ colors, ¯®á«¥ ª®â®à®© ¨¤¥â ¯®á«¥¤®¢ ⥫ì®áâì
|
||||
; 梥⮢, eax*4 - ®¬¥à 梥â , 㬮¦¥ë© 4, â.ª. ®¤¨ 梥â 㦮
|
||||
; ç¥âëॠ¡ ©â .
|
||||
mov eax,[colors+eax*4]
|
||||
|
||||
; ⥯¥àì ¬ë ãáâ ®¢¨¬ 梥â, ᮤ¥à¦ 騩áï ¢ ॣ¨áâॠeax ª ª ®á®¢®©:
|
||||
mov [active_color],eax
|
||||
|
||||
; ã ¢®â, ᮡá⢥®, ¨ ¢áñ, çâ® ®â á âॡ®¢ «®áì ;)
|
||||
; ¢¥àñ¬áï ª ç «ã æ¨ª« ®¡à ¡®âª¨ ᮡë⨩
|
||||
jmp still
|
||||
|
||||
;******************************************************************************
|
||||
|
||||
mouse: ; ®¡à ¡®â稪 ¬ëè¨
|
||||
mov eax,37 ; á ç « ¯®«ã稬 ⥪ã騥 ª®®à¤¨ âë ¬ëè¨
|
||||
mov ebx,1
|
||||
int 0x40
|
||||
|
||||
mov ebx,eax ; ¯à¥®¡à §ã¥¬ ¨å
|
||||
shr eax,16 ; eax=x;
|
||||
and ebx,0xffff ; ebx=y;
|
||||
|
||||
cmp ebx,22
|
||||
jb save_canvas
|
||||
|
||||
sub eax,[workarea.cx] ; x-=[workarea.cx]
|
||||
cmp eax,0 ; ¥á«¨ ¬ëèì «¥¢¥¥ ª«¨¥â᪮© ®¡« áâ¨,
|
||||
jle .not_pressed ; ¨ç¥£® ¥ à¨á㥬
|
||||
cmp eax,[workarea.sx] ; ¥á«¨ ¬ëèì ¯à ¢¥¥...
|
||||
jae .not_pressed
|
||||
|
||||
sub ebx,[workarea.cy]
|
||||
cmp ebx,0 ; ...¢ëè¥...
|
||||
jle .not_pressed
|
||||
cmp ebx,[workarea.sy] ; ...¨¦¥...
|
||||
jae .not_pressed
|
||||
|
||||
; ª ª¨¥ ª®¯ª¨ ¦ âë?
|
||||
mov eax,37
|
||||
mov ebx,2
|
||||
int 0x40
|
||||
|
||||
; ¥á«¨ «¥¢ ï ª®¯ª (â.¥. eax = 1), ⥠¯®©¤ñ¬ ¤ «ìè¥
|
||||
cmp eax,1
|
||||
je .leftbtn
|
||||
|
||||
.not_pressed:
|
||||
; ‹¥¢ ï ª®¯ª ¥ ¦ â , § ¯®¬¨¬ ⥪ã騥 ª®®à¤¨ âë ¨ ¡ã¤¥¬ ¦¤ âì ᮡëâ¨ï
|
||||
mov [mouse_pressed],0 ; ¬ëèì ¥ ¦ â
|
||||
mov eax,37 ; ¯®«ã稬 ª®®à¤¨ âë
|
||||
mov ebx,1
|
||||
int 0x40
|
||||
mov ebx,eax
|
||||
shr eax,16
|
||||
and ebx,0xffff
|
||||
mov [old_x],eax ; § ¯®¬¨¬ ¨å
|
||||
mov [old_y],ebx
|
||||
jmp still
|
||||
|
||||
.leftbtn:
|
||||
; ‹¥¢ ï ª®¯ª ¦ â , ¤® íâ® § ¯¨á âì!
|
||||
mov [mouse_pressed],1
|
||||
|
||||
; <20>®«ã稬 ª®®à¤¨ âë ªãàá®à ¬ëè¨ (®â®á¨â¥«ì® ®ª )
|
||||
mcall 37,1 ; ¯®«ãç¨âì á®áâ®ï¨¥ ¬ëè¨
|
||||
|
||||
; <EFBFBD>¥à¥¤¥« ¥¬ ¨å â ª, çâ®¡ë ®¨ ¡ë«¨ ¢ à §ëå ॣ¨áâà å, â.¥. eax ¨ ebx
|
||||
mov ebx,eax
|
||||
shr eax,16
|
||||
and ebx,0xffff
|
||||
|
||||
; <20>®¤£®â®¢¨¬ ¯ à ¬¥âàë ¤«ï äãªæ¨¨ à¨á®¢ ¨ï «¨¨¨
|
||||
mov ecx,[old_x] ; ¤«ï ç « § £à㧨¬ áâ àë¥ ª®®à¤¨ âë
|
||||
mov edx,[old_y]
|
||||
mov [old_x],eax ; ⥯¥àì á®åà ¨¬ ⥪ã騥 ¢ áâ àë¥
|
||||
mov [old_y],ebx
|
||||
shl ecx,16 ; ¢ ¢¥à奥 á«®¢® ç «ìë¥ (⥪ã騥) ª®®à¤¨ âë
|
||||
shl edx,16
|
||||
add eax,ecx ; ¢ ¨¦¥¥ á«®¢® ª®¥çë¥, â.¥. áâ àë¥
|
||||
add ebx,edx
|
||||
|
||||
mov ecx,ebx ; ¯®¬¥ï¥¬ ॣ¨áâàë â ª, ª ª íâã 㦮 38 äãªæ¨¨
|
||||
mov ebx,eax
|
||||
mov eax,38 ; ®¬¥à äãªæ¨¨ ¢ eax
|
||||
mov edx,[active_color] ; ¢ edx 梥â
|
||||
int 0x40
|
||||
|
||||
; - ¯®¯à®¡ã©â¥ ¯®áâ ¢¨âì ¤à㣨¥ § 票ï (00090001)
|
||||
mov edi,0x00010001 ; çâ®¡ë «¨¨ï ¥ ¡ë« ᫨誮¬ ⮪®©,
|
||||
add ebx,edi ; à¨á㥬 à冷¬ ¥é¥ 3!
|
||||
int 0x40
|
||||
add ecx,edi
|
||||
int 0x40
|
||||
sub ebx,edi
|
||||
int 0x40
|
||||
|
||||
sub ebx,edi ; ã ç⮡ë ᬮâ५®áì ᮢᥬ ªàãâ®,
|
||||
int 0x40 ; ¤®à¨á㥬 ¥é¥ 5!
|
||||
sub ecx,edi
|
||||
int 0x40
|
||||
sub ecx,edi
|
||||
int 0x40
|
||||
add ebx,edi
|
||||
int 0x40
|
||||
add ebx,edi
|
||||
int 0x40
|
||||
|
||||
jmp still
|
||||
|
||||
;******************************************************************************
|
||||
|
||||
save_canvas:
|
||||
mov eax,[proc_info.box.width]
|
||||
add eax,[workarea.cx]
|
||||
mov ebx,[proc_info.box.height]
|
||||
add ebx,[workarea.cy]
|
||||
|
||||
jmp still
|
||||
|
||||
;******************************************************************************
|
||||
|
||||
; *********************************************
|
||||
; ******* Ž<><C5BD>…„…‹…<E280B9>ˆ… ˆ Ž’<C5BD>ˆ‘ނЀ ŽŠ<C5BD>€ *******
|
||||
; *********************************************
|
||||
|
||||
draw_window:
|
||||
|
||||
mcall 48,3,sc,sizeof.system_colors ; <20>Ž„ƒ<E2809E>“†€…Œ ‘ˆ‘’…Œ<E280A6>›… –‚…’€
|
||||
mcall 12, 1 ; ç «® ®âà¨á®¢ª¨ ®ª
|
||||
mov edx, [sc.work]
|
||||
or edx, 0x33000000
|
||||
mcall 0, (100 shl 16)+400, (100 shl 16)+300, , , title ; à¨á㥬 ®ª®
|
||||
mcall 12, 1
|
||||
|
||||
mcall 9,proc_info,-1 ; ¯®«ã稬 ¨ä®à¬ æ¨î ® ᢮¥¬ ¯®â®ª¥
|
||||
|
||||
mov eax,[proc_info.box.width] ; áâந¬ à §¬¥à à ¡®ç¥© ®¡« áâ¨
|
||||
sub eax,20 ; (å à §¬¥à ®ª - 20)
|
||||
mov [workarea.sx],eax
|
||||
mov eax,[proc_info.box.height]
|
||||
sub eax,63 ; (ã à §¬¥à - 63)
|
||||
mov [workarea.sy],eax
|
||||
|
||||
cmp [proc_info.box.height],80
|
||||
jb .finish
|
||||
|
||||
mov eax, 8
|
||||
mov edx, 1
|
||||
; á®§¤ ñ¬ ª®¯ª¨ ¢ë¡®à 梥â :
|
||||
mov ebx,10*65536+15 ; ç «ì ï x ª®®à¤¨ â ¨ à §¬¥à
|
||||
mov ecx, 7*65536+15 ; ç «ì ï y ª®®à¤¨ â & size
|
||||
.new_button:
|
||||
inc edx ; ¨¤¥â¨ä¨ª â®à++;
|
||||
mov esi,[btn_colors-8+edx*4] ; 梥⠪®¯ª¨
|
||||
int 0x40 ; áâ ¢¨¬ ª®¯ªã
|
||||
add ebx,18*65536 ; á«¥¤ãîé ï ª®¯ª ¯à ¢¥¥ 12
|
||||
cmp edx,9 ; áà ¢¨¢ ¥¬ edx (¨¤¥â¨ä¨ª â®à) á 9
|
||||
jbe .new_button ; ¥á«¨ ¬¥ìè¥ ¨«¨ à ¢® -> ¥éñ ®¤ã ª¯®ªã
|
||||
|
||||
mov eax,13 ; ç¨á⨬ "宫áâ" - ª«¨¥âáªãî ®¡« áâì
|
||||
mov ebx,[workarea.cx]
|
||||
mov ecx,[workarea.cy]
|
||||
shl ebx,16
|
||||
shl ecx,16
|
||||
add ebx,[workarea.sx]
|
||||
add ecx,[workarea.sy]
|
||||
mov edx,0xffffff
|
||||
mcall 13
|
||||
|
||||
.finish:
|
||||
ret
|
||||
|
||||
;******************************************************************************
|
||||
; ç «® ®¡« á⨠¨¨æ¨ «¨§¨à®¢ ëå ¤ ëå
|
||||
; ¥á«¨ ªâ® ¥éñ ¥ § ¥â, çâ® § ç¨â "¨¨æ¨ «¨§¨à®¢ ë¥", â® ¯®ïáïî:
|
||||
; í⮠⥠¤ ë¥, ª®â®àë¬ ¯à¨á¢®¥® ç «ì®¥ § 票¥
|
||||
|
||||
;data
|
||||
|
||||
title db 'Simple Paint v0.3',0
|
||||
|
||||
mouse_pressed db 0 ; ¯®ª §ë¢ ¥â, ¦ â «¨ ¡ë« ¬ëèì ¢ ¯à¥¤ë¤ã騩 ¬®¬¥â
|
||||
|
||||
; 梥⠪®¯®ª
|
||||
btn_colors:
|
||||
dd 0xdddddd ; white
|
||||
dd 0x444444 ; black
|
||||
dd 0x00dd00 ; green
|
||||
dd 0x0000dd ; blue
|
||||
dd 0xdd0000 ; red
|
||||
dd 0xdd00dd ; magenta
|
||||
dd 0xdddd00 ; yellow
|
||||
dd 0x00dddd ; cyan
|
||||
dd 0x559955 ; warm green
|
||||
|
||||
; 梥⠪¨á⨠(¢ ⮬ ¦¥ ¯®à浪¥, çâ® ¨ 梥⠪®¯®ª)
|
||||
colors:
|
||||
dd 0xffffff ; ¡¥«ë©
|
||||
dd 0x000000 ; ç¥àë©
|
||||
dd 0x00ff00 ; §¥«¥ë©
|
||||
dd 0x0000ff ; ᨨ©
|
||||
dd 0xff0000 ; ªà áë©
|
||||
dd 0xff00ff ; ¯ãà¯ãàë©
|
||||
dd 0xffff00 ; ¦¥«âë©
|
||||
dd 0x00ffff ; £®«ã¡®©
|
||||
dd 0x77bb77 ; ⥯«ë© §¥«¥ë©
|
||||
|
||||
;******************************************************************************
|
||||
; ¢®â âãâ ç¨ ¥âáï ®¡« áâì <20>…¨¨æ¨ «¨§¨à®¢ ëå ¤ ëå, â.¥.
|
||||
; §¤¥áì ¤ ë¬ § ç¥¨ï ¥ ¯à¨á¢®¥ë. ‚ ®â«¨ç¨¥ ®â ¨¨æ., ¥ 㢥«¨ç¨¢ îâ à §¬¥à
|
||||
; ä ©«
|
||||
|
||||
I_END:
|
||||
|
||||
active_color dd ? ; ªâ¨¢ë© 梥â
|
||||
|
||||
old_x dd ? ; áâ àë¥ ª®®à¤¨ âë ¬ëè¨
|
||||
old_y dd ?
|
||||
|
||||
workarea: ; ª®®à¤¨ âë ¨ à §¬¥àë ª«¨¥â᪮© ®¡« áâ¨
|
||||
.cx dd ? ; c - ª®®¤¨ âë
|
||||
.cy dd ?
|
||||
.sx dd ? ; s - à §¬¥àë
|
||||
.sy dd ?
|
||||
|
||||
sc system_colors ; á¨áâ¥¬ë¥ æ¢¥â
|
||||
proc_info process_information ; ¨ä®à¬ æ¨ï ® ¯à®æ¥áá¥
|
||||
|
||||
restflag dd ?
|
||||
canvas rb 800*600*3
|
||||
|
||||
E_END:
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
; Text encoded with Code Page 866 - Cyrillic
|
||||
|
||||
|
||||
;*********************************
|
||||
;* *
|
||||
;* PAINT 0.02 ¤«ï MenuetOS *
|
||||
;* *
|
||||
;* Š®¬¯¨«¨à®¢ âì FASM'®¬ *
|
||||
;* *
|
||||
;*********************************
|
||||
|
||||
;******************************************************************************
|
||||
; <EFBFBD>âã ¯à®£à ¬¬ã ¥ 㦮 á¥à쥧® à áᬠâਢ âì - íâ® ¢á¥£® «¨èì ¯à¨¬¥à,
|
||||
; ¢ ª®â®à®¬ ¯®ª § ®, ª ª à ¡®â âì á ¥ª®â®à묨 á¨á⥬묨 äãªæ¨ï¬¨ Œ¥Ž‘,
|
||||
; ® ¨ª ª ¥ ®à¬ «ìë© £à ä¨ç¥áª¨© । ªâ®à. Š®¤ ¯à®£à ¬¬ë Ž—…<E28094>œ ¯à®á⮩,
|
||||
; ¨ ® ¯à¥¤ § ç¥ ¤«ï â¥å, ªâ® ⮫쪮 ç¨ ¥â ¨§ãç âì áᥬ¡«¥à,
|
||||
; ¯®í⮬ã ï áâ६¨«áï ᤥ« âì ¥£® ª ª ¬®¦® ¡®«¥¥ ¯®ïâë¬.
|
||||
; ’¥¬ ¥ ¬¥¥¥, ª®¤ ¤®¢®«ì® ¥¯«®å® ®¯â¨¬¨§¨à®¢ , å®âï íâ® ¥¬®£®
|
||||
; ¬®¦¥â § âà㤨âì ¥£® ¯®¨¬ ¨¥. Ÿ ¯®áâ à «áï âé â¥«ì® ¯à®ª®¬¬¥â¨à®¢ âì
|
||||
; á«®¦ë¥ ¬¥áâ . Šáâ â¨, ¨¤¥ï ¯à®£à ¬¬ë ¯à¨ ¤«¥¦¨â ¥ ¬¥, Sniper'ã, ¤«ï
|
||||
; ª®â®à®£® ¢®¡é¥¬-â® ¢á¥ ¨ ¯¨á «®áì.
|
||||
; “¤ ç¨ ¢ ¨§ã票¨ ᬠ!
|
||||
; ˆ¢ <20>®¤¤ã¡ë©, ivan-yar@bk.ru
|
||||
;******************************************************************************
|
||||
|
||||
; <20>®¤ª«îç ¥¬ ¥®¡å®¤¨¬ë¥ ¬ ªà®áë
|
||||
include '../../macros.inc'
|
||||
|
||||
;******************************************************************************
|
||||
|
||||
; <20>€—€‹Ž <20><>Žƒ<C5BD>€ŒŒ›
|
||||
use32
|
||||
org 0x0
|
||||
db 'MENUET01' ; 8 byte id
|
||||
dd 0x01 ; title version
|
||||
dd START ; start of code
|
||||
dd I_END ; size of image
|
||||
dd E_END ; memory for app
|
||||
dd E_END ; esp
|
||||
dd 0x0,0x0 ; I_Param , I_Icon
|
||||
|
||||
; Ž<>‹€‘’œ ŠŽ„€
|
||||
START:
|
||||
mov eax,40 ; á®®¡é¨¬ á¨á⥬¥, ª ª¨¥ ᮡëâ¨ï ¡ã¤¥¬ ®¡à ¡ âë¢ âì
|
||||
mov ebx,0100101b ; ¬ ᪠ᮡë⨩ - ¯¥à¥à¨á®¢ª (1) + ª®¯ª (3) + ¬ëèì (6
|
||||
int 0x40 ; íâ ª®¬ ¤ ¢ë§ë¢ ¥â á¨á⥬ãî äãªæ¨î
|
||||
|
||||
mov [workarea.cx],5 ; ª®®à¤¨ âë à ¡®ç¥© (ª«¨¥â᪮©) ®¡« áâ¨
|
||||
mov [workarea.cy],30 ; ¤«ï à¨á®¢ ¨ï
|
||||
|
||||
red:
|
||||
call draw_window ; ¢ë§ë¢ ¥¬ ¯à®æ¥¤ãàã ®âà¨á®¢ª¨ ®ª
|
||||
|
||||
still: ; ƒ‹€‚<E282AC>›‰ –ˆŠ‹ <20><>Žƒ<C5BD>€ŒŒ› - –ˆŠ‹ Ž<><C5BD>€<EFBFBD>Ž’Šˆ ‘ŽŽ<C5BD>™…<E284A2>ˆ‰
|
||||
|
||||
mov eax,10 ; äãªæ¨ï 10 - ¦¤ âì ᮡëâ¨ï; ¯à®£à ¬¬ ®áâ ¢«¨¢ ¥âáï
|
||||
int 0x40 ; á«¥¤ãîé ï ª®¬ ¤ ¥ ¡ã¤¥â ¢ë¯®«¥ ¤® â¥å ¯®à, ¯®ª
|
||||
; ¥ ¯à®¨§®©¤ñâ ᮡë⨥
|
||||
|
||||
; ⥯¥àì ॣ¨áâà eax ᮤ¥à¦¨â ®¬¥à ᮡëâ¨ï
|
||||
; ¯®®ç¥à¥¤® áà ¢¨¬ ¥£® á® ¢á¥¬¨ ¢®§¬®¦ë¬¨ § 票ﬨ, çâ®¡ë ¢ë§¢ âì
|
||||
; ã¦ë© ®¡à ¡®â稪
|
||||
|
||||
cmp eax,1 ; ¯¥à¥à¨á®¢ âì ®ª® ?
|
||||
je red ; ¥á«¨ ॣ¨áâà eax à ¢¥ ¥¤¨¨æ¥, â® ¯¥à¥å®¤¨¬ ¬¥âªã red
|
||||
cmp eax,3 ; ¦ â ª®¯ª ?
|
||||
je button
|
||||
cmp eax,6 ; ¬ëèì?
|
||||
je mouse
|
||||
|
||||
jmp still ; ¥á«¨ ¯à®¨§®è«® ᮡë⨥, ª®â®à®¥ ¬ë ¥ ®¡à ¡ âë¢ ¥¬,
|
||||
; ¯à®áâ® ¢®§¢à é ¥¬áï ª ç «ã æ¨ª« , å®âï â ª®£® ¡ëâì
|
||||
; ¥ ¤®«¦®! ’.¥. ¥á«¨ íâã ª®¬ ¤ã ®âáî¤ ã¡à âì, â®
|
||||
; ¨ç¥£® áâà 讣® ¥ á«ãç¨âáï.
|
||||
|
||||
;******************************************************************************
|
||||
|
||||
button: ; ®¡à ¡®â稪 ¦ â¨ï ª®¯ª¨ ¢ ®ª¥ ¯à®£à ¬¬ë
|
||||
mov eax,17 ; äãªæ¨ï N17 - ¯®«ãç¨âì ¨¤¥â¨ä¨ª â®à ¦ ⮩ ª®¯ª¨
|
||||
int 0x40
|
||||
|
||||
; ⥯¥àì ¢ ॣ¨áâॠah ᮤ¥à¦¨âáï ¨¤¥â¨ä¨ª â®à.
|
||||
|
||||
shr eax,8 ; ah -> al (ᤢ¨£ 8 ¡¨â ¢¯à ¢®)
|
||||
|
||||
dec al ; ¨¤¥â¨ä¨ª â®à_ª®¯ª¨--;
|
||||
jnz .noclose ; ¥á«¨ १ã«ìâ ⠯।ë¤ã饩 ª®¬ ¤ë à ¢¥ ã«î, § ªàë¢ ¥¬áï
|
||||
; ¨ ç¥ - ¨¤ñ¬ ¬¥âªã noclose
|
||||
|
||||
or eax,-1 ; ¢ë室 ¨§ ¯à®£à ¬¬ë
|
||||
int 0x40
|
||||
|
||||
.noclose:
|
||||
; ¥á«¨ ¬ë áî¤ ¯®¯ «¨, § ç¨â ¨¤¥â¨ä¨ª â®à ª®¯ª¨ ¥ ¡ë« à ¢¥ ã«î...
|
||||
; ⥯¥àì ã á ¢ eax ᮤ¥à¦¨âáï (®¬¥à 梥⮩ ª®¯ª¨ - 1),
|
||||
; â.¥ ¨«¨ 1, ¨«¨ 2, ... ,¨«¨ 5
|
||||
|
||||
; 㬥ì訬 1:
|
||||
dec eax
|
||||
|
||||
; ¢®â íâ ¢®â ª®¬ ¤ ¨§¢«¥ª ¥â ¢ eax ¤¢®©®¥ á«®¢® ¯® ¤à¥áã colors+eax*4
|
||||
; £¤¥ colors - ᬥ饨¥ ¬¥âª¨ colors, ¯®á«¥ ª®â®à®© ¨¤¥â ¯®á«¥¤®¢ ⥫ì®áâì
|
||||
; 梥⮢, eax*4 - ®¬¥à 梥â , 㬮¦¥ë© 4, â.ª. ®¤¨ 梥â 㦮
|
||||
; ç¥âëॠ¡ ©â .
|
||||
mov eax,[colors+eax*4]
|
||||
|
||||
; ⥯¥àì ¬ë ãáâ ®¢¨¬ 梥â, ᮤ¥à¦ 騩áï ¢ ॣ¨áâॠeax ª ª ®á®¢®©:
|
||||
mov [active_color],eax
|
||||
|
||||
; ã ¢®â, ᮡá⢥®, ¨ ¢áñ, çâ® ®â á âॡ®¢ «®áì ;)
|
||||
; ¢¥àñ¬áï ª ç «ã æ¨ª« ®¡à ¡®âª¨ ᮡë⨩
|
||||
jmp still
|
||||
|
||||
;******************************************************************************
|
||||
|
||||
mouse: ; ®¡à ¡®â稪 ¬ëè¨
|
||||
mov eax,37 ; á ç « ¯®«ã稬 ⥪ã騥 ª®®à¤¨ âë ¬ëè¨
|
||||
mov ebx,1
|
||||
int 0x40
|
||||
|
||||
mov ebx,eax ; ¯à¥®¡à §ã¥¬ ¨å
|
||||
shr eax,16 ; eax=x;
|
||||
and ebx,0xffff ; ebx=y;
|
||||
|
||||
cmp ebx,22
|
||||
jb save_canvas
|
||||
|
||||
sub eax,[workarea.cx] ; x-=[workarea.cx]
|
||||
cmp eax,0 ; ¥á«¨ ¬ëèì «¥¢¥¥ ª«¨¥â᪮© ®¡« áâ¨,
|
||||
jle .not_pressed ; ¨ç¥£® ¥ à¨á㥬
|
||||
cmp eax,[workarea.sx] ; ¥á«¨ ¬ëèì ¯à ¢¥¥...
|
||||
jae .not_pressed
|
||||
|
||||
sub ebx,[workarea.cy]
|
||||
cmp ebx,0 ; ...¢ëè¥...
|
||||
jle .not_pressed
|
||||
cmp ebx,[workarea.sy] ; ...¨¦¥...
|
||||
jae .not_pressed
|
||||
|
||||
; ª ª¨¥ ª®¯ª¨ ¦ âë?
|
||||
mov eax,37
|
||||
mov ebx,2
|
||||
int 0x40
|
||||
|
||||
; ¥á«¨ «¥¢ ï ª®¯ª (â.¥. eax = 1), ⥠¯®©¤ñ¬ ¤ «ìè¥
|
||||
cmp eax,1
|
||||
je .leftbtn
|
||||
|
||||
.not_pressed:
|
||||
; ‹¥¢ ï ª®¯ª ¥ ¦ â , § ¯®¬¨¬ ⥪ã騥 ª®®à¤¨ âë ¨ ¡ã¤¥¬ ¦¤ âì ᮡëâ¨ï
|
||||
mov [mouse_pressed],0 ; ¬ëèì ¥ ¦ â
|
||||
mov eax,37 ; ¯®«ã稬 ª®®à¤¨ âë
|
||||
mov ebx,1
|
||||
int 0x40
|
||||
mov ebx,eax
|
||||
shr eax,16
|
||||
and ebx,0xffff
|
||||
mov [old_x],eax ; § ¯®¬¨¬ ¨å
|
||||
mov [old_y],ebx
|
||||
jmp still
|
||||
|
||||
.leftbtn:
|
||||
; ‹¥¢ ï ª®¯ª ¦ â , ¤® íâ® § ¯¨á âì!
|
||||
mov [mouse_pressed],1
|
||||
|
||||
; <20>®«ã稬 ª®®à¤¨ âë ªãàá®à ¬ëè¨ (®â®á¨â¥«ì® ®ª )
|
||||
mcall 37,1 ; ¯®«ãç¨âì á®áâ®ï¨¥ ¬ëè¨
|
||||
|
||||
; <20>¥à¥¤¥« ¥¬ ¨å â ª, çâ®¡ë ®¨ ¡ë«¨ ¢ à §ëå ॣ¨áâà å, â.¥. eax ¨ ebx
|
||||
mov ebx,eax
|
||||
shr eax,16
|
||||
and ebx,0xffff
|
||||
|
||||
; <20>®¤£®â®¢¨¬ ¯ à ¬¥âàë ¤«ï äãªæ¨¨ à¨á®¢ ¨ï «¨¨¨
|
||||
mov ecx,[old_x] ; ¤«ï ç « § £à㧨¬ áâ àë¥ ª®®à¤¨ âë
|
||||
mov edx,[old_y]
|
||||
mov [old_x],eax ; ⥯¥àì á®åà ¨¬ ⥪ã騥 ¢ áâ àë¥
|
||||
mov [old_y],ebx
|
||||
shl ecx,16 ; ¢ ¢¥à奥 á«®¢® ç «ìë¥ (⥪ã騥) ª®®à¤¨ âë
|
||||
shl edx,16
|
||||
add eax,ecx ; ¢ ¨¦¥¥ á«®¢® ª®¥çë¥, â.¥. áâ àë¥
|
||||
add ebx,edx
|
||||
|
||||
mov ecx,ebx ; ¯®¬¥ï¥¬ ॣ¨áâàë â ª, ª ª íâã 㦮 38 äãªæ¨¨
|
||||
mov ebx,eax
|
||||
mov eax,38 ; ®¬¥à äãªæ¨¨ ¢ eax
|
||||
mov edx,[active_color] ; ¢ edx 梥â
|
||||
int 0x40
|
||||
|
||||
; - ¯®¯à®¡ã©â¥ ¯®áâ ¢¨âì ¤à㣨¥ § 票ï (00090001)
|
||||
mov edi,0x00010001 ; çâ®¡ë «¨¨ï ¥ ¡ë« ᫨誮¬ ⮪®©,
|
||||
add ebx,edi ; à¨á㥬 à冷¬ ¥é¥ 3!
|
||||
int 0x40
|
||||
add ecx,edi
|
||||
int 0x40
|
||||
sub ebx,edi
|
||||
int 0x40
|
||||
|
||||
sub ebx,edi ; ã ç⮡ë ᬮâ५®áì ᮢᥬ ªàãâ®,
|
||||
int 0x40 ; ¤®à¨á㥬 ¥é¥ 5!
|
||||
sub ecx,edi
|
||||
int 0x40
|
||||
sub ecx,edi
|
||||
int 0x40
|
||||
add ebx,edi
|
||||
int 0x40
|
||||
add ebx,edi
|
||||
int 0x40
|
||||
|
||||
jmp still
|
||||
|
||||
;******************************************************************************
|
||||
|
||||
save_canvas:
|
||||
mov eax,[proc_info.box.width]
|
||||
add eax,[workarea.cx]
|
||||
mov ebx,[proc_info.box.height]
|
||||
add ebx,[workarea.cy]
|
||||
|
||||
jmp still
|
||||
|
||||
;******************************************************************************
|
||||
|
||||
; *********************************************
|
||||
; ******* Ž<><C5BD>…„…‹…<E280B9>ˆ… ˆ Ž’<C5BD>ˆ‘ނЀ ŽŠ<C5BD>€ *******
|
||||
; *********************************************
|
||||
|
||||
draw_window:
|
||||
|
||||
mcall 48,3,sc,sizeof.system_colors ; <20>Ž„ƒ<E2809E>“†€…Œ ‘ˆ‘’…Œ<E280A6>›… –‚…’€
|
||||
mcall 12, 1 ; ç «® ®âà¨á®¢ª¨ ®ª
|
||||
mov edx, [sc.work]
|
||||
or edx, 0x33000000
|
||||
mcall 0, (100 shl 16)+400, (100 shl 16)+300, , , title ; à¨á㥬 ®ª®
|
||||
mcall 12, 1
|
||||
|
||||
mcall 9,proc_info,-1 ; ¯®«ã稬 ¨ä®à¬ æ¨î ® ᢮¥¬ ¯®â®ª¥
|
||||
|
||||
mov eax,[proc_info.box.width] ; áâந¬ à §¬¥à à ¡®ç¥© ®¡« áâ¨
|
||||
sub eax,20 ; (å à §¬¥à ®ª - 20)
|
||||
mov [workarea.sx],eax
|
||||
mov eax,[proc_info.box.height]
|
||||
sub eax,63 ; (ã à §¬¥à - 63)
|
||||
mov [workarea.sy],eax
|
||||
|
||||
cmp [proc_info.box.height],80
|
||||
jb .finish
|
||||
|
||||
mov eax, 8
|
||||
mov edx, 1
|
||||
; á®§¤ ñ¬ ª®¯ª¨ ¢ë¡®à 梥â :
|
||||
mov ebx,10*65536+15 ; ç «ì ï x ª®®à¤¨ â ¨ à §¬¥à
|
||||
mov ecx, 7*65536+15 ; ç «ì ï y ª®®à¤¨ â & size
|
||||
.new_button:
|
||||
inc edx ; ¨¤¥â¨ä¨ª â®à++;
|
||||
mov esi,[btn_colors-8+edx*4] ; 梥⠪®¯ª¨
|
||||
int 0x40 ; áâ ¢¨¬ ª®¯ªã
|
||||
add ebx,18*65536 ; á«¥¤ãîé ï ª®¯ª ¯à ¢¥¥ 12
|
||||
cmp edx,9 ; áà ¢¨¢ ¥¬ edx (¨¤¥â¨ä¨ª â®à) á 9
|
||||
jbe .new_button ; ¥á«¨ ¬¥ìè¥ ¨«¨ à ¢® -> ¥éñ ®¤ã ª¯®ªã
|
||||
|
||||
mov eax,13 ; ç¨á⨬ "宫áâ" - ª«¨¥âáªãî ®¡« áâì
|
||||
mov ebx,[workarea.cx]
|
||||
mov ecx,[workarea.cy]
|
||||
shl ebx,16
|
||||
shl ecx,16
|
||||
add ebx,[workarea.sx]
|
||||
add ecx,[workarea.sy]
|
||||
mov edx,0xffffff
|
||||
mcall 13
|
||||
|
||||
.finish:
|
||||
ret
|
||||
|
||||
;******************************************************************************
|
||||
; ç «® ®¡« á⨠¨¨æ¨ «¨§¨à®¢ ëå ¤ ëå
|
||||
; ¥á«¨ ªâ® ¥éñ ¥ § ¥â, çâ® § ç¨â "¨¨æ¨ «¨§¨à®¢ ë¥", â® ¯®ïáïî:
|
||||
; í⮠⥠¤ ë¥, ª®â®àë¬ ¯à¨á¢®¥® ç «ì®¥ § 票¥
|
||||
|
||||
;data
|
||||
|
||||
title db 'Simple Paint v0.3',0
|
||||
|
||||
mouse_pressed db 0 ; ¯®ª §ë¢ ¥â, ¦ â «¨ ¡ë« ¬ëèì ¢ ¯à¥¤ë¤ã騩 ¬®¬¥â
|
||||
|
||||
; 梥⠪®¯®ª
|
||||
btn_colors:
|
||||
dd 0xdddddd ; white
|
||||
dd 0x444444 ; black
|
||||
dd 0x00dd00 ; green
|
||||
dd 0x0000dd ; blue
|
||||
dd 0xdd0000 ; red
|
||||
dd 0xdd00dd ; magenta
|
||||
dd 0xdddd00 ; yellow
|
||||
dd 0x00dddd ; cyan
|
||||
dd 0x559955 ; warm green
|
||||
|
||||
; 梥⠪¨á⨠(¢ ⮬ ¦¥ ¯®à浪¥, çâ® ¨ 梥⠪®¯®ª)
|
||||
colors:
|
||||
dd 0xffffff ; ¡¥«ë©
|
||||
dd 0x000000 ; ç¥àë©
|
||||
dd 0x00ff00 ; §¥«¥ë©
|
||||
dd 0x0000ff ; ᨨ©
|
||||
dd 0xff0000 ; ªà áë©
|
||||
dd 0xff00ff ; ¯ãà¯ãàë©
|
||||
dd 0xffff00 ; ¦¥«âë©
|
||||
dd 0x00ffff ; £®«ã¡®©
|
||||
dd 0x77bb77 ; ⥯«ë© §¥«¥ë©
|
||||
|
||||
;******************************************************************************
|
||||
; ¢®â âãâ ç¨ ¥âáï ®¡« áâì <20>…¨¨æ¨ «¨§¨à®¢ ëå ¤ ëå, â.¥.
|
||||
; §¤¥áì ¤ ë¬ § ç¥¨ï ¥ ¯à¨á¢®¥ë. ‚ ®â«¨ç¨¥ ®â ¨¨æ., ¥ 㢥«¨ç¨¢ îâ à §¬¥à
|
||||
; ä ©«
|
||||
|
||||
I_END:
|
||||
|
||||
active_color dd ? ; ªâ¨¢ë© 梥â
|
||||
|
||||
old_x dd ? ; áâ àë¥ ª®®à¤¨ âë ¬ëè¨
|
||||
old_y dd ?
|
||||
|
||||
workarea: ; ª®®à¤¨ âë ¨ à §¬¥àë ª«¨¥â᪮© ®¡« áâ¨
|
||||
.cx dd ? ; c - ª®®¤¨ âë
|
||||
.cy dd ?
|
||||
.sx dd ? ; s - à §¬¥àë
|
||||
.sy dd ?
|
||||
|
||||
sc system_colors ; á¨áâ¥¬ë¥ æ¢¥â
|
||||
proc_info process_information ; ¨ä®à¬ æ¨ï ® ¯à®æ¥áá¥
|
||||
|
||||
restflag dd ?
|
||||
canvas rb 800*600*3
|
||||
|
||||
E_END:
|
@@ -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,73 +1,77 @@
|
||||
use32
|
||||
db 'MENUET01'
|
||||
dd 1
|
||||
dd start
|
||||
dd i_end
|
||||
dd 0x400
|
||||
dd 0x400
|
||||
dd 0,0
|
||||
|
||||
include '../../../macros.inc'
|
||||
|
||||
start:
|
||||
mov eax, 55
|
||||
mov ebx, eax
|
||||
mov esi, melody2
|
||||
int 0x40
|
||||
mov eax, 5
|
||||
mov ebx, 1000
|
||||
int 0x40
|
||||
mov eax, -1
|
||||
int 0x40
|
||||
|
||||
melody1:
|
||||
db 0xE4, 0x35, 0x99, 0x33, 0x99, 0x31, 0x99, 0x33
|
||||
db 0xE4, 0x35, 0x99, 0x35, 0x99, 0x36, 0x99, 0x38, 0x99, 0x3A
|
||||
db 0xE4, 0x36, 0xE4, 0x36
|
||||
db 0xB2, 0xFF
|
||||
db 0xE4, 0x33, 0x99, 0x31, 0x99, 0x2C, 0x99, 0x31
|
||||
db 0xE4, 0x33, 0xB2, 0x33, 0x99, 0x35, 0x99, 0x36
|
||||
db 0xE4, 0x35, 0xE4, 0x35
|
||||
db 0xB2, 0xFF
|
||||
db 0x99, 0x35, 0x99, 0x36
|
||||
db 0xE4, 0x33, 0x99, 0x35, 0x99, 0x36
|
||||
db 0xB2, 0x33, 0x99, 0x35, 0x99, 0x36
|
||||
db 0xB2, 0x33, 0x99, 0x35, 0x99, 0x36
|
||||
db 0xE4, 0x39, 0xE4, 0x39
|
||||
db 0xB2, 0xFF
|
||||
db 0x99, 0x35, 0x99, 0x36
|
||||
db 0xE4, 0x33, 0x99, 0x35, 0x99, 0x36
|
||||
db 0xB2, 0x33, 0x99, 0x35, 0x99, 0x36
|
||||
db 0xB2, 0x33, 0x99, 0x35, 0x99, 0x36
|
||||
db 0xE4, 0x35, 0xE4, 0x35
|
||||
db 0
|
||||
|
||||
melody2:
|
||||
db 0x90, 0x31, 0x90, 0x33, 0x90, 0x35, 0x90, 0x36
|
||||
db 0xA0, 0xFF
|
||||
db 0xA0, 0x06
|
||||
db 0x90, 0xFF
|
||||
db 0xA0, 0x06
|
||||
db 0x90, 0xFF
|
||||
db 0x90, 0x33, 0x90, 0x35, 0x90, 0x37, 0x90, 0x38
|
||||
db 0xA0, 0xFF
|
||||
db 0xA0, 0x18
|
||||
db 0x90, 0xFF
|
||||
db 0xA0, 0x18
|
||||
db 0x90, 0xFF
|
||||
db 0x90, 0x33, 0x90, 0x35, 0x90, 0x37, 0x90, 0x38
|
||||
db 0xA0, 0xFF
|
||||
db 0x90, 0x33, 0x90, 0x35, 0x90, 0x37, 0x90, 0x38
|
||||
db 0xA0, 0xFF
|
||||
db 0x90, 0x31, 0x90, 0x33, 0x90, 0x35, 0x90, 0x36
|
||||
db 0xA0, 0xFF
|
||||
db 0xA0, 0x16
|
||||
db 0x90, 0xFF
|
||||
db 0xA0, 0x16
|
||||
db 0
|
||||
|
||||
melody3:
|
||||
db 0x99, 0x31, 0xB2, 0x36, 0x99, 0x3A, 0xB2, 0x36
|
||||
db 0x99, 0x33, 0xB2, 0x28, 0xBC, 0x38
|
||||
db 0
|
||||
i_end:
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
|
||||
use32
|
||||
db 'MENUET01'
|
||||
dd 1
|
||||
dd start
|
||||
dd i_end
|
||||
dd 0x400
|
||||
dd 0x400
|
||||
dd 0,0
|
||||
|
||||
include '../../macros.inc'
|
||||
|
||||
start:
|
||||
mov eax, 55
|
||||
mov ebx, eax
|
||||
mov esi, melody2
|
||||
int 0x40
|
||||
mov eax, 5
|
||||
mov ebx, 1000
|
||||
int 0x40
|
||||
mov eax, -1
|
||||
int 0x40
|
||||
|
||||
melody1:
|
||||
db 0xE4, 0x35, 0x99, 0x33, 0x99, 0x31, 0x99, 0x33
|
||||
db 0xE4, 0x35, 0x99, 0x35, 0x99, 0x36, 0x99, 0x38, 0x99, 0x3A
|
||||
db 0xE4, 0x36, 0xE4, 0x36
|
||||
db 0xB2, 0xFF
|
||||
db 0xE4, 0x33, 0x99, 0x31, 0x99, 0x2C, 0x99, 0x31
|
||||
db 0xE4, 0x33, 0xB2, 0x33, 0x99, 0x35, 0x99, 0x36
|
||||
db 0xE4, 0x35, 0xE4, 0x35
|
||||
db 0xB2, 0xFF
|
||||
db 0x99, 0x35, 0x99, 0x36
|
||||
db 0xE4, 0x33, 0x99, 0x35, 0x99, 0x36
|
||||
db 0xB2, 0x33, 0x99, 0x35, 0x99, 0x36
|
||||
db 0xB2, 0x33, 0x99, 0x35, 0x99, 0x36
|
||||
db 0xE4, 0x39, 0xE4, 0x39
|
||||
db 0xB2, 0xFF
|
||||
db 0x99, 0x35, 0x99, 0x36
|
||||
db 0xE4, 0x33, 0x99, 0x35, 0x99, 0x36
|
||||
db 0xB2, 0x33, 0x99, 0x35, 0x99, 0x36
|
||||
db 0xB2, 0x33, 0x99, 0x35, 0x99, 0x36
|
||||
db 0xE4, 0x35, 0xE4, 0x35
|
||||
db 0
|
||||
|
||||
melody2:
|
||||
db 0x90, 0x31, 0x90, 0x33, 0x90, 0x35, 0x90, 0x36
|
||||
db 0xA0, 0xFF
|
||||
db 0xA0, 0x06
|
||||
db 0x90, 0xFF
|
||||
db 0xA0, 0x06
|
||||
db 0x90, 0xFF
|
||||
db 0x90, 0x33, 0x90, 0x35, 0x90, 0x37, 0x90, 0x38
|
||||
db 0xA0, 0xFF
|
||||
db 0xA0, 0x18
|
||||
db 0x90, 0xFF
|
||||
db 0xA0, 0x18
|
||||
db 0x90, 0xFF
|
||||
db 0x90, 0x33, 0x90, 0x35, 0x90, 0x37, 0x90, 0x38
|
||||
db 0xA0, 0xFF
|
||||
db 0x90, 0x33, 0x90, 0x35, 0x90, 0x37, 0x90, 0x38
|
||||
db 0xA0, 0xFF
|
||||
db 0x90, 0x31, 0x90, 0x33, 0x90, 0x35, 0x90, 0x36
|
||||
db 0xA0, 0xFF
|
||||
db 0xA0, 0x16
|
||||
db 0x90, 0xFF
|
||||
db 0xA0, 0x16
|
||||
db 0
|
||||
|
||||
melody3:
|
||||
db 0x99, 0x31, 0xB2, 0x36, 0x99, 0x3A, 0xB2, 0x36
|
||||
db 0x99, 0x33, 0xB2, 0x28, 0xBC, 0x38
|
||||
db 0
|
||||
i_end:
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 209 B After Width: | Height: | Size: 209 B |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
@@ -1,3 +1,9 @@
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
; Text encoded with Code Page 866 - Cyrillic
|
||||
|
||||
|
||||
use32
|
||||
org 0
|
||||
db 'MENUET01' ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20>ᯮ<EFBFBD><E1AFAE>塞<EFBFBD><EFA5AC><EFBFBD> 䠩<><E4A0A9> <20>ᥣ<EFBFBD><E1A5A3> 8 <20><><EFBFBD><EFBFBD>
|
||||
@@ -8,13 +14,13 @@ include '../../../proc32.inc'
|
||||
include '../../../KOSfuncs.inc'
|
||||
include '../../../load_img.inc'
|
||||
include '../../../load_lib.mac'
|
||||
include '../trunk/str.inc'
|
||||
include '../str.inc'
|
||||
include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US.
|
||||
|
||||
vox_offs_tree_table equ 4
|
||||
vox_offs_data equ 12
|
||||
txt_buf rb 8
|
||||
include '../trunk/vox_rotate.inc'
|
||||
include '../vox_rotate.inc'
|
||||
|
||||
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
if lang eq ru_RU
|
||||
|
@@ -1,3 +1,9 @@
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
; Text encoded with Code Page 866 - Cyrillic
|
||||
|
||||
|
||||
use32
|
||||
org 0
|
||||
db 'MENUET01' ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20>ᯮ<EFBFBD><E1AFAE>塞<EFBFBD><EFA5AC><EFBFBD> 䠩<><E4A0A9> <20>ᥣ<EFBFBD><E1A5A3> 8 <20><><EFBFBD><EFBFBD>
|
||||
@@ -8,9 +14,9 @@ include '../../../proc32.inc'
|
||||
include '../../../KOSfuncs.inc'
|
||||
include '../../../load_img.inc'
|
||||
include '../../../load_lib.mac'
|
||||
include '../trunk/vox_draw.inc'
|
||||
include '../trunk/vox_rotate.inc'
|
||||
include '../trunk/str.inc'
|
||||
include '../vox_draw.inc'
|
||||
include '../vox_rotate.inc'
|
||||
include '../str.inc'
|
||||
include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US.
|
||||
|
||||
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
|
@@ -1,3 +1,9 @@
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
; Text encoded with Code Page 866 - Cyrillic
|
||||
|
||||
|
||||
use32
|
||||
org 0
|
||||
db 'MENUET01' ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20>ᯮ<EFBFBD><E1AFAE>塞<EFBFBD><EFA5AC><EFBFBD> 䠩<><E4A0A9> <20>ᥣ<EFBFBD><E1A5A3> 8 <20><><EFBFBD><EFBFBD>
|
||||
@@ -11,7 +17,7 @@ include '../../../load_lib.mac'
|
||||
include '../../../develop/libraries/TinyGL/asm_fork/opengl_const.inc'
|
||||
include '../../../develop/libraries/TinyGL/asm_fork/zbuffer.inc'
|
||||
include 'vox_3d.inc'
|
||||
include '../trunk/str.inc'
|
||||
include '../str.inc'
|
||||
include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US.
|
||||
|
||||
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
|
@@ -1,429 +1,435 @@
|
||||
;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>୮<EFBFBD><E0ADAE><EFBFBD> <20>ᥬ, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD><EFBFBD>/ᮢ<>⮬/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ...
|
||||
|
||||
use32
|
||||
org 0
|
||||
db 'MENUET01' ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20>ᯮ<EFBFBD><E1AFAE>塞<EFBFBD><EFA5AC><EFBFBD> 䠩<><E4A0A9> <20>ᥣ<EFBFBD><E1A5A3> 8 <20><><EFBFBD><EFBFBD>
|
||||
dd 1, start, i_end, mem, stacktop, file_name, sys_path
|
||||
|
||||
MAX_COLOR_WORD_LEN equ 40
|
||||
maxChars equ 100002 ;(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⢮ ᨬ<><E1A8AC><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>㬥<EFBFBD><E3ACA5><EFBFBD> + 2)
|
||||
BUF_SIZE equ 4096 ;buffer for copy|paste
|
||||
maxSyntaxFileSize equ 410000
|
||||
TOOLBAR_ICONS_SIZE equ 1200*21
|
||||
|
||||
include '../../proc32.inc'
|
||||
include '../../macros.inc'
|
||||
include '../../KOSfuncs.inc'
|
||||
include '../../load_img.inc'
|
||||
include '../../load_lib.mac'
|
||||
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
include '../../system/skincfg/trunk/kglobals.inc'
|
||||
include '../../system/skincfg/trunk/unpacker.inc'
|
||||
include 'lang.inc'
|
||||
|
||||
include 't_data.inc'
|
||||
include 't_button.inc'
|
||||
include 't_menu.inc'
|
||||
include 'strlen.inc'
|
||||
include 't_draw.inc' ;draw main window functions
|
||||
include 'wnd_k_words.inc'
|
||||
|
||||
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
|
||||
align 4
|
||||
icon_tl_sys dd 0 ;㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20>࠭<EFBFBD><E0A0AD><EFBFBD><EFBFBD> <20><><EFBFBD>⥬<EFBFBD><E2A5AC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
run_file_70 FileInfoBlock
|
||||
|
||||
align 4
|
||||
start:
|
||||
mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
|
||||
|
||||
mcall SF_SYS_MISC,SSF_HEAP_INIT
|
||||
or eax,eax
|
||||
jnz @f
|
||||
call ted_Exit
|
||||
@@:
|
||||
|
||||
mcall SF_KEYBOARD,SSF_SET_INPUT_MODE,1 ;scan code
|
||||
mcall SF_SET_EVENTS_MASK,0xC0000027
|
||||
|
||||
mov esi,file_name
|
||||
stdcall str_len,esi
|
||||
mov ecx,eax
|
||||
mov edi,openfile_path
|
||||
cld
|
||||
rep movsb ;<3B><><EFBFBD><EFBFBD><EFBFBD>㥬 <20><><EFBFBD> 䠩<><E4A0A9> <20> <20><><EFBFBD><EFBFBD><EFBFBD> openfile_path
|
||||
|
||||
load_libraries l_libs_start,load_lib_end
|
||||
|
||||
;<3B><EFBFBD>ઠ <20><> <>쪮 㤠筮 <20><><EFBFBD>㧨<EFBFBD><E3A7A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD>
|
||||
mov ebp,lib0
|
||||
.test_lib_open:
|
||||
cmp dword [ebp+ll_struc_size-4],0
|
||||
jz @f
|
||||
mcall SF_TERMINATE_PROCESS ;exit not correct
|
||||
@@:
|
||||
add ebp,ll_struc_size
|
||||
cmp ebp,load_lib_end
|
||||
jl .test_lib_open
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
stdcall [ted_init], tedit0
|
||||
stdcall [tl_data_init], tree1
|
||||
option_boxes_set_sys_color sc,opt_grlist1
|
||||
init_checkboxes2 check_boxes,check_boxes_end
|
||||
check_boxes_set_sys_color2 check_boxes,check_boxes_end,sc
|
||||
|
||||
; OpenDialog initialisation
|
||||
stdcall [OpenDialog_Init],OpenDialog_data
|
||||
|
||||
; kmenu initialisation
|
||||
call tedit_menu_init
|
||||
|
||||
; init toolbar file
|
||||
include_image_file 'te_icon.png', bmp_icon,,,6 ;6 <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mov eax,[bmp_icon]
|
||||
add eax,TOOLBAR_ICONS_SIZE
|
||||
stdcall img_to_gray, [bmp_icon],eax,(TOOLBAR_ICONS_SIZE)/3
|
||||
;---------------------------------------------------------------------
|
||||
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塞 䠩<> <20> <20><><EFBFBD><EFBFBD><EFBFBD>ࠬ<EFBFBD> <20> <20><><EFBFBD><EFBFBD>ﬨ
|
||||
include_image_file '..\..\media\log_el\trunk\tl_sys_16.png', icon_tl_sys
|
||||
mov eax,dword[icon_tl_sys]
|
||||
mov dword[tree1.data_img_sys],eax
|
||||
; <20><><EFBFBD><EFBFBD><EFBFBD>塞 䠩<> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㧫<><E3A7AB>
|
||||
include_image_file 'tl_nod_16.png', icon_tl_sys
|
||||
mov eax,dword[icon_tl_sys]
|
||||
mov dword[tree1.data_img],eax
|
||||
;------------------------------------------------------------------------------
|
||||
copy_path fn_syntax_dir,sys_path,file_name,0 ;<3B><>६ <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20> 䠩<><E4A0A9><EFBFBD><EFBFBD> ᨭ⠪<E1A8AD><E2A0AA><EFBFBD><EFBFBD>
|
||||
xor eax,eax
|
||||
mov ecx,4096
|
||||
mov edi,file_name
|
||||
repnz scasb
|
||||
mov byte[edi-2],al ;㡨ࠥ<E3A1A8> '/' <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> (<28>㦭<EFBFBD> <20><><EFBFBD> <20>⥭<EFBFBD><E2A5AD> <20> CD)
|
||||
mcall SF_FILE,tree_file_struct
|
||||
|
||||
or ebx,ebx
|
||||
jz .end_dir_init
|
||||
mov eax,dir_mem+32+40
|
||||
mov ecx,ebx
|
||||
@@:
|
||||
cmp byte[eax],'.' ;䨫<><E4A8AB><EFBFBD>㥬 䠩<><E4A0A9> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '.' <20> '..'
|
||||
je .filter
|
||||
;0x10000 ;1*2^16 - <20><><EFBFBD> 1 <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
stdcall [tl_node_add], tree1,0x10000,eax
|
||||
stdcall [tl_cur_next], tree1
|
||||
.filter:
|
||||
add eax,304
|
||||
loop @b
|
||||
stdcall [tl_cur_beg],tree1 ;<3B>⠢<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD> <20><>砫<EFBFBD> ᯨ᪠
|
||||
or dword[tree1.style], tl_cursor_pos_limited ;<3B><>࠭<EFBFBD>稢<EFBFBD><E7A8A2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20>।<EFBFBD><E0A5A4><EFBFBD><EFBFBD> ᯨ᪠
|
||||
.end_dir_init:
|
||||
|
||||
;--- load ini file ---
|
||||
copy_path ini_name,sys_path,file_name,0
|
||||
;window startup pozition
|
||||
stdcall [ini_get_int],file_name,ini_sec_window,key_window_l,ini_def_window_l
|
||||
mov word[wnd_s_pos+2],ax
|
||||
stdcall [ini_get_int],file_name,ini_sec_window,key_window_w,ini_def_window_w
|
||||
mov word[wnd_s_pos],ax
|
||||
stdcall [ini_get_int],file_name,ini_sec_window,key_window_t,ini_def_window_t
|
||||
mov word[wnd_s_pos+6],ax
|
||||
stdcall [ini_get_int],file_name,ini_sec_window,key_window_h,ini_def_window_h
|
||||
mov word[wnd_s_pos+4],ax
|
||||
;scrool type
|
||||
stdcall [ini_get_int],file_name,ini_sec_window,key_scroll_type,ini_def_scroll_type
|
||||
mov [wScr.type],eax
|
||||
mov [hScr.type],eax
|
||||
mov [ws_dir_lbox.type],eax
|
||||
mov [w_scr_t3.type],eax
|
||||
;symbol size
|
||||
stdcall [ini_get_int],file_name,ini_sec_window,key_symbol_w,ini_def_symbol_w
|
||||
mov dword[tedit0.rec.width],eax
|
||||
stdcall [ini_get_int],file_name,ini_sec_window,key_symbol_h,ini_def_symbol_h
|
||||
mov dword[tedit0.rec.height],eax
|
||||
;lea eax,[eax+eax*2]
|
||||
;mov dword[tedit0.rec.top],eax
|
||||
;font size
|
||||
stdcall [ini_get_int],file_name,ini_sec_window,key_font_s,ini_def_font_s
|
||||
shl eax,24
|
||||
mov dword[tedit0.font_size],eax
|
||||
;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
ini_panel key_but_new, ID_BUT_NEW
|
||||
ini_panel key_but_open, ID_BUT_OPEN
|
||||
ini_panel key_but_save, ID_BUT_SAVE
|
||||
ini_panel key_but_save_as,ID_BUT_SAVE_AS
|
||||
ini_panel key_but_select, ID_BUT_SELECT
|
||||
ini_panel key_but_cut, ID_BUT_CUT
|
||||
ini_panel key_but_copy, ID_BUT_COPY
|
||||
ini_panel key_but_paste, ID_BUT_PASTE
|
||||
ini_panel key_but_find, ID_BUT_FIND
|
||||
ini_panel key_but_replace,ID_BUT_REPLACE
|
||||
ini_panel key_but_key_words,ID_BUT_KEY_WORDS
|
||||
ini_panel key_but_upper, ID_BUT_UPPER
|
||||
ini_panel key_but_lower, ID_BUT_LOWER
|
||||
ini_panel key_but_reverse,ID_BUT_REVERSE
|
||||
ini_panel key_but_undo, ID_BUT_UNDO
|
||||
ini_panel key_but_redo, ID_BUT_REDO
|
||||
ini_panel key_but_invisible,ID_BUT_INVISIBLE
|
||||
ini_panel key_but_syntax_list,ID_BUT_SYNTAX_LIST
|
||||
ini_panel key_but_syntax_mode,ID_BUT_SYNTAX_MODE
|
||||
ini_panel key_but_convert_1251_866,ID_BUT_CONVERT_1251_866
|
||||
ini_panel key_but_convert_866_1251,ID_BUT_CONVERT_866_1251
|
||||
;䠩<><E4A0A9><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>७<EFBFBD><E0A5AD>
|
||||
xor edx,edx
|
||||
mov ebx,synt_auto_open
|
||||
@@:
|
||||
;<3B><>६ <20><><EFBFBD> 䠩<><E4A0A9>
|
||||
stdcall [ini_get_str],file_name,ini_sec_options,key_synt_file,ebx,32,ini_def_synt_f
|
||||
cmp byte[ebx],0
|
||||
je @f
|
||||
inc byte[key_synt_file.numb]
|
||||
add ebx,32
|
||||
;<3B><>६ <20><><EFBFBD><EFBFBD><EFBFBD>७<EFBFBD><EFBFBD>
|
||||
stdcall [ini_get_str],file_name,ini_sec_options,key_synt_ext,ebx,32,ini_def_synt_f
|
||||
inc byte[key_synt_ext.numb]
|
||||
add ebx,32
|
||||
inc edx
|
||||
cmp edx,max_synt_auto_open
|
||||
jl @b
|
||||
@@:
|
||||
|
||||
;--- load color option file ---
|
||||
stdcall open_unpac_synt_file,[fn_col_option]
|
||||
|
||||
;--- get cmd line ---
|
||||
cmp byte[openfile_path+3],0 ;openfile_path
|
||||
je @f ;if file names exist
|
||||
mov esi,openfile_path
|
||||
stdcall auto_open_syntax,esi
|
||||
call but_no_msg_OpenFile
|
||||
@@:
|
||||
|
||||
|
||||
|
||||
align 16
|
||||
red_win:
|
||||
call draw_window
|
||||
|
||||
align 16
|
||||
still:
|
||||
mcall SF_WAIT_EVENT
|
||||
cmp dword[exit_code],1
|
||||
jne @f
|
||||
call ted_Exit
|
||||
jmp still
|
||||
@@:
|
||||
|
||||
cmp al,1 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
jz red_win
|
||||
cmp al,2
|
||||
jz key
|
||||
cmp al,3
|
||||
jz button
|
||||
cmp al,6 ;<3B><><EFBFBD><EFBFBD>
|
||||
jne @f
|
||||
call mouse
|
||||
@@:
|
||||
jmp still
|
||||
|
||||
align 16
|
||||
mouse:
|
||||
stdcall [kmainmenu_dispatch_cursorevent], [main_menu]
|
||||
|
||||
mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
|
||||
cmp word[tedit0.wnd.top],ax
|
||||
jg .no_edit
|
||||
shr eax,16
|
||||
cmp word[tedit0.wnd.left],ax
|
||||
jg .no_edit
|
||||
mcall SF_MOUSE_GET,SSF_BUTTON_EXT
|
||||
bt eax,24 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 饫<><E9A5AB><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
jnc @f
|
||||
stdcall [ted_but_select_word], tedit0
|
||||
ret
|
||||
@@:
|
||||
stdcall [ted_mouse], tedit0
|
||||
.no_edit:
|
||||
|
||||
;<3B><EFBFBD>ઠ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
cmp byte[tedit0.panel_id],TED_PANEL_FIND
|
||||
jne @f
|
||||
stdcall [edit_box_mouse], edit_find
|
||||
stdcall [option_box_mouse], opt_grlist1
|
||||
stdcall [check_box_mouse], ch1
|
||||
@@:
|
||||
cmp byte[tedit0.panel_id],TED_PANEL_REPLACE
|
||||
jne @f
|
||||
stdcall [edit_box_mouse], edit_find
|
||||
stdcall [edit_box_mouse], edit_replace
|
||||
stdcall [option_box_mouse], opt_grlist1
|
||||
@@:
|
||||
cmp byte[tedit0.panel_id],TED_PANEL_SYNTAX
|
||||
jne @f
|
||||
stdcall [tl_mouse], tree1
|
||||
@@:
|
||||
cmp byte[tedit0.panel_id],TED_PANEL_GOTO
|
||||
jne @f
|
||||
stdcall [edit_box_mouse], edit_goto
|
||||
@@:
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
;output:
|
||||
; ah = symbol
|
||||
align 16
|
||||
proc KeyConvertToASCII uses ebx, table:dword
|
||||
mov ebx,dword[table] ;convert scan to ascii
|
||||
shr ax,8
|
||||
add bx,ax
|
||||
mov ah,byte[ebx]
|
||||
ret
|
||||
endp
|
||||
|
||||
align 16
|
||||
key:
|
||||
mcall SF_KEYBOARD,SSF_GET_CONTROL_KEYS ;66.3 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ﭨ<EFBFBD> <20><>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
xor esi,esi
|
||||
mov ecx,1
|
||||
test al,3 ;[Shift]
|
||||
jz @f
|
||||
mov cl,2
|
||||
or esi,KM_SHIFT
|
||||
@@:
|
||||
test al,0x0c ;[Ctrl]
|
||||
jz @f
|
||||
or esi,KM_CTRL
|
||||
@@:
|
||||
test al,0x30 ;[Alt]
|
||||
jz @f
|
||||
mov cl,3
|
||||
or esi,KM_ALT
|
||||
@@:
|
||||
test al,0x80 ;[NumLock]
|
||||
jz @f
|
||||
or esi,KM_NUMLOCK
|
||||
@@:
|
||||
|
||||
mcall SF_SYSTEM_GET,SSF_KEYBOARD_LAYOUT,,conv_tabl ;26.2 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>᪫<EFBFBD><E1AAAB><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mcall SF_GET_KEY
|
||||
stdcall [tl_key], tree1
|
||||
|
||||
test word[edit_replace.flags],ed_focus ;<3B> <20><> <20> 䮪<><E4AEAA><EFBFBD>, <20><>室<EFBFBD><E5AEA4>
|
||||
je @f
|
||||
cmp ah,0x80 ;if key up
|
||||
ja still
|
||||
cmp ah,42 ;[Shift] (left)
|
||||
je still
|
||||
cmp ah,54 ;[Shift] (right)
|
||||
je still
|
||||
cmp ah,56 ;[Alt]
|
||||
je still
|
||||
cmp ah,29 ;[Ctrl]
|
||||
je still
|
||||
cmp ah,69 ;[Pause Break]
|
||||
je still
|
||||
|
||||
stdcall KeyConvertToASCII, conv_tabl
|
||||
stdcall [edit_box_key], edit_replace
|
||||
jmp still
|
||||
@@:
|
||||
test word[edit_find.flags],ed_focus ;<3B> <20><> <20> 䮪<><E4AEAA><EFBFBD>, <20><>室<EFBFBD><E5AEA4>
|
||||
je @f
|
||||
cmp ah,0x80 ;if key up
|
||||
ja still
|
||||
cmp ah,42 ;[Shift] (left)
|
||||
je still
|
||||
cmp ah,54 ;[Shift] (right)
|
||||
je still
|
||||
cmp ah,56 ;[Alt]
|
||||
je still
|
||||
cmp ah,29 ;[Ctrl]
|
||||
je still
|
||||
cmp ah,69 ;[Pause Break]
|
||||
je still
|
||||
|
||||
stdcall KeyConvertToASCII, conv_tabl
|
||||
stdcall [edit_box_key], edit_find
|
||||
jmp still
|
||||
@@:
|
||||
test word[edit_goto.flags],ed_focus ;<3B> <20><> <20> 䮪<><E4AEAA><EFBFBD>, <20><>室<EFBFBD><E5AEA4>
|
||||
je @f
|
||||
cmp ah,0x80 ;if key up
|
||||
ja still
|
||||
cmp ah,42 ;[Shift] (left)
|
||||
je still
|
||||
cmp ah,54 ;[Shift] (right)
|
||||
je still
|
||||
cmp ah,56 ;[Alt]
|
||||
je still
|
||||
cmp ah,29 ;[Ctrl]
|
||||
je still
|
||||
cmp ah,69 ;[Pause Break]
|
||||
je still
|
||||
|
||||
stdcall KeyConvertToASCII, conv_tabl
|
||||
stdcall [edit_box_key], edit_goto
|
||||
jmp still
|
||||
@@:
|
||||
|
||||
stdcall [ted_key], tedit0, conv_tabl,esi
|
||||
jmp still
|
||||
|
||||
align 4
|
||||
edit_replace edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 300, buf_replace, mouse_dd, 0
|
||||
edit_find edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 300, buf_find, mouse_dd, 0
|
||||
edit_goto edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 10, buf_goto, mouse_dd, 0
|
||||
|
||||
unpac_mem dd 0
|
||||
|
||||
;library structures
|
||||
l_libs_start:
|
||||
lib0 l_libs lib_name_0, file_name, system_dir_0, import_box_lib
|
||||
lib1 l_libs lib_name_1, file_name, system_dir_1, import_msgbox_lib
|
||||
lib2 l_libs lib_name_2, file_name, system_dir_2, import_proclib
|
||||
lib3 l_libs lib_name_3, file_name, system_dir_3, import_libimg
|
||||
lib4 l_libs lib_name_4, file_name, system_dir_4, import_libini
|
||||
lib5 l_libs lib_name_5, file_name, system_dir_5, import_libkmenu
|
||||
load_lib_end:
|
||||
|
||||
IncludeIGlobals
|
||||
hed db 'TextEdit '
|
||||
i_end:
|
||||
openfile_path: ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> 䠩<><E4A0A9> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ࠡ<><E0A0A1><EFBFBD>
|
||||
rb 4096
|
||||
dir_mem rb 32+304*count_of_dir_list_files
|
||||
wnd_s_pos: ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>⮢<EFBFBD><E2AEA2> <20><><EFBFBD><EFBFBD>樨 <20><><EFBFBD><EFBFBD>
|
||||
rq 1
|
||||
last_open_synt_file rb 32 ;<3B><><EFBFBD> <20><><EFBFBD><E1ABA5><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><E7A5AD><EFBFBD><EFBFBD> 䠩<><E4A0A9> ᨭ⠪<E1A8AD><E2A0AA><EFBFBD><EFBFBD>
|
||||
buf rb BUF_SIZE ;<3B><><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><>⠢<EFBFBD><EFBFBD>
|
||||
buf_find rb 302 ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD>᪠ ⥪<><E2A5AA><EFBFBD>
|
||||
buf_replace rb 302 ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥪<><E2A5AA><EFBFBD>
|
||||
buf_goto rb 12 ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD>室<EFBFBD> <20><> <20><>ப<EFBFBD>
|
||||
sc system_colors
|
||||
IncludeUGlobals
|
||||
align 16
|
||||
procinfo process_information
|
||||
rb 1024
|
||||
thread:
|
||||
rb 4096
|
||||
align 16
|
||||
thread_coords:
|
||||
rb 4096
|
||||
align 16
|
||||
stacktop:
|
||||
sys_path: ;<3B><><EFBFBD><EFBFBD> <20><><EFBFBD>㤠 <20><><EFBFBD><EFBFBD><EFBFBD>⨫<EFBFBD><E2A8AB> <20>ᯮ<EFBFBD><E1AFAE>塞<EFBFBD><EFA5AC> 䠩<>
|
||||
rb 4096
|
||||
file_name: ;<3B><>ࠬ<EFBFBD><E0A0AC><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>᪠
|
||||
rb 4096
|
||||
syntax_path: ;<3B><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>砥<EFBFBD><E7A0A5><EFBFBD><EFBFBD> 䠩<><E4A0A9> ᨭ⠪<E1A8AD><E2A0AA><EFBFBD><EFBFBD>
|
||||
rb 4096
|
||||
plugin_path:
|
||||
rb 4096
|
||||
text_work_area: ;<3B><><EFBFBD><EFBFBD> <20> 䠩<><E4A0A9>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>뢠<EFBFBD><EBA2A0><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>
|
||||
rb 4096
|
||||
filename_area: ;<3B><><EFBFBD> 䠩<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
rb 256
|
||||
file_info:
|
||||
rb 40
|
||||
mem:
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
; Text encoded with Code Page 866 - Cyrillic
|
||||
|
||||
|
||||
;<3B><><EFBFBD><E0AEAC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>୮<EFBFBD><E0ADAE><EFBFBD> <20>ᥬ, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD><EFBFBD>/ᮢ<>⮬/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ...
|
||||
|
||||
use32
|
||||
org 0
|
||||
db 'MENUET01' ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20>ᯮ<EFBFBD><E1AFAE>塞<EFBFBD><EFA5AC><EFBFBD> 䠩<><E4A0A9> <20>ᥣ<EFBFBD><E1A5A3> 8 <20><><EFBFBD><EFBFBD>
|
||||
dd 1, start, i_end, mem, stacktop, file_name, sys_path
|
||||
|
||||
MAX_COLOR_WORD_LEN equ 40
|
||||
maxChars equ 100002 ;(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⢮ ᨬ<><E1A8AC><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>㬥<EFBFBD><E3ACA5><EFBFBD> + 2)
|
||||
BUF_SIZE equ 4096 ;buffer for copy|paste
|
||||
maxSyntaxFileSize equ 410000
|
||||
TOOLBAR_ICONS_SIZE equ 1200*21
|
||||
|
||||
include '../../proc32.inc'
|
||||
include '../../macros.inc'
|
||||
include '../../KOSfuncs.inc'
|
||||
include '../../load_img.inc'
|
||||
include '../../load_lib.mac'
|
||||
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
include '../../system/skincfg/trunk/kglobals.inc'
|
||||
include '../../system/skincfg/trunk/unpacker.inc'
|
||||
include 'lang.inc'
|
||||
|
||||
include 't_data.inc'
|
||||
include 't_button.inc'
|
||||
include 't_menu.inc'
|
||||
include 'strlen.inc'
|
||||
include 't_draw.inc' ;draw main window functions
|
||||
include 'wnd_k_words.inc'
|
||||
|
||||
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
|
||||
align 4
|
||||
icon_tl_sys dd 0 ;㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20>࠭<EFBFBD><E0A0AD><EFBFBD><EFBFBD> <20><><EFBFBD>⥬<EFBFBD><E2A5AC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
run_file_70 FileInfoBlock
|
||||
|
||||
align 4
|
||||
start:
|
||||
mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
|
||||
|
||||
mcall SF_SYS_MISC,SSF_HEAP_INIT
|
||||
or eax,eax
|
||||
jnz @f
|
||||
call ted_Exit
|
||||
@@:
|
||||
|
||||
mcall SF_KEYBOARD,SSF_SET_INPUT_MODE,1 ;scan code
|
||||
mcall SF_SET_EVENTS_MASK,0xC0000027
|
||||
|
||||
mov esi,file_name
|
||||
stdcall str_len,esi
|
||||
mov ecx,eax
|
||||
mov edi,openfile_path
|
||||
cld
|
||||
rep movsb ;<3B><><EFBFBD><EFBFBD><EFBFBD>㥬 <20><><EFBFBD> 䠩<><E4A0A9> <20> <20><><EFBFBD><EFBFBD><EFBFBD> openfile_path
|
||||
|
||||
load_libraries l_libs_start,load_lib_end
|
||||
|
||||
;<3B><EFBFBD>ઠ <20><> <>쪮 㤠筮 <20><><EFBFBD>㧨<EFBFBD><E3A7A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD>
|
||||
mov ebp,lib0
|
||||
.test_lib_open:
|
||||
cmp dword [ebp+ll_struc_size-4],0
|
||||
jz @f
|
||||
mcall SF_TERMINATE_PROCESS ;exit not correct
|
||||
@@:
|
||||
add ebp,ll_struc_size
|
||||
cmp ebp,load_lib_end
|
||||
jl .test_lib_open
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
stdcall [ted_init], tedit0
|
||||
stdcall [tl_data_init], tree1
|
||||
option_boxes_set_sys_color sc,opt_grlist1
|
||||
init_checkboxes2 check_boxes,check_boxes_end
|
||||
check_boxes_set_sys_color2 check_boxes,check_boxes_end,sc
|
||||
|
||||
; OpenDialog initialisation
|
||||
stdcall [OpenDialog_Init],OpenDialog_data
|
||||
|
||||
; kmenu initialisation
|
||||
call tedit_menu_init
|
||||
|
||||
; init toolbar file
|
||||
include_image_file 'te_icon.png', bmp_icon,,,6 ;6 <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mov eax,[bmp_icon]
|
||||
add eax,TOOLBAR_ICONS_SIZE
|
||||
stdcall img_to_gray, [bmp_icon],eax,(TOOLBAR_ICONS_SIZE)/3
|
||||
;---------------------------------------------------------------------
|
||||
; <20><><EFBFBD><EFBFBD><EFBFBD>塞 䠩<> <20> <20><><EFBFBD><EFBFBD><EFBFBD>ࠬ<EFBFBD> <20> <20><><EFBFBD><EFBFBD>ﬨ
|
||||
include_image_file '..\..\media\log_el\tl_sys_16.png', icon_tl_sys
|
||||
mov eax,dword[icon_tl_sys]
|
||||
mov dword[tree1.data_img_sys],eax
|
||||
; <20><><EFBFBD><EFBFBD><EFBFBD>塞 䠩<> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㧫<><E3A7AB>
|
||||
include_image_file 'tl_nod_16.png', icon_tl_sys
|
||||
mov eax,dword[icon_tl_sys]
|
||||
mov dword[tree1.data_img],eax
|
||||
;------------------------------------------------------------------------------
|
||||
copy_path fn_syntax_dir,sys_path,file_name,0 ;<3B><>६ <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20> 䠩<><E4A0A9><EFBFBD><EFBFBD> ᨭ⠪<E1A8AD><E2A0AA><EFBFBD><EFBFBD>
|
||||
xor eax,eax
|
||||
mov ecx,4096
|
||||
mov edi,file_name
|
||||
repnz scasb
|
||||
mov byte[edi-2],al ;㡨ࠥ<E3A1A8> '/' <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> (<28>㦭<EFBFBD> <20><><EFBFBD> <20>⥭<EFBFBD><E2A5AD> <20> CD)
|
||||
mcall SF_FILE,tree_file_struct
|
||||
|
||||
or ebx,ebx
|
||||
jz .end_dir_init
|
||||
mov eax,dir_mem+32+40
|
||||
mov ecx,ebx
|
||||
@@:
|
||||
cmp byte[eax],'.' ;䨫<><E4A8AB><EFBFBD>㥬 䠩<><E4A0A9> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '.' <20> '..'
|
||||
je .filter
|
||||
;0x10000 ;1*2^16 - <20><><EFBFBD> 1 <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
stdcall [tl_node_add], tree1,0x10000,eax
|
||||
stdcall [tl_cur_next], tree1
|
||||
.filter:
|
||||
add eax,304
|
||||
loop @b
|
||||
stdcall [tl_cur_beg],tree1 ;<3B>⠢<EFBFBD><E2A0A2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><>砫<EFBFBD> ᯨ᪠
|
||||
or dword[tree1.style], tl_cursor_pos_limited ;<3B><>࠭<EFBFBD>稢<EFBFBD><E7A8A2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20>।<EFBFBD><E0A5A4><EFBFBD><EFBFBD> ᯨ᪠
|
||||
.end_dir_init:
|
||||
|
||||
;--- load ini file ---
|
||||
copy_path ini_name,sys_path,file_name,0
|
||||
;window startup pozition
|
||||
stdcall [ini_get_int],file_name,ini_sec_window,key_window_l,ini_def_window_l
|
||||
mov word[wnd_s_pos+2],ax
|
||||
stdcall [ini_get_int],file_name,ini_sec_window,key_window_w,ini_def_window_w
|
||||
mov word[wnd_s_pos],ax
|
||||
stdcall [ini_get_int],file_name,ini_sec_window,key_window_t,ini_def_window_t
|
||||
mov word[wnd_s_pos+6],ax
|
||||
stdcall [ini_get_int],file_name,ini_sec_window,key_window_h,ini_def_window_h
|
||||
mov word[wnd_s_pos+4],ax
|
||||
;scrool type
|
||||
stdcall [ini_get_int],file_name,ini_sec_window,key_scroll_type,ini_def_scroll_type
|
||||
mov [wScr.type],eax
|
||||
mov [hScr.type],eax
|
||||
mov [ws_dir_lbox.type],eax
|
||||
mov [w_scr_t3.type],eax
|
||||
;symbol size
|
||||
stdcall [ini_get_int],file_name,ini_sec_window,key_symbol_w,ini_def_symbol_w
|
||||
mov dword[tedit0.rec.width],eax
|
||||
stdcall [ini_get_int],file_name,ini_sec_window,key_symbol_h,ini_def_symbol_h
|
||||
mov dword[tedit0.rec.height],eax
|
||||
;lea eax,[eax+eax*2]
|
||||
;mov dword[tedit0.rec.top],eax
|
||||
;font size
|
||||
stdcall [ini_get_int],file_name,ini_sec_window,key_font_s,ini_def_font_s
|
||||
shl eax,24
|
||||
mov dword[tedit0.font_size],eax
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
ini_panel key_but_new, ID_BUT_NEW
|
||||
ini_panel key_but_open, ID_BUT_OPEN
|
||||
ini_panel key_but_save, ID_BUT_SAVE
|
||||
ini_panel key_but_save_as,ID_BUT_SAVE_AS
|
||||
ini_panel key_but_select, ID_BUT_SELECT
|
||||
ini_panel key_but_cut, ID_BUT_CUT
|
||||
ini_panel key_but_copy, ID_BUT_COPY
|
||||
ini_panel key_but_paste, ID_BUT_PASTE
|
||||
ini_panel key_but_find, ID_BUT_FIND
|
||||
ini_panel key_but_replace,ID_BUT_REPLACE
|
||||
ini_panel key_but_key_words,ID_BUT_KEY_WORDS
|
||||
ini_panel key_but_upper, ID_BUT_UPPER
|
||||
ini_panel key_but_lower, ID_BUT_LOWER
|
||||
ini_panel key_but_reverse,ID_BUT_REVERSE
|
||||
ini_panel key_but_undo, ID_BUT_UNDO
|
||||
ini_panel key_but_redo, ID_BUT_REDO
|
||||
ini_panel key_but_invisible,ID_BUT_INVISIBLE
|
||||
ini_panel key_but_syntax_list,ID_BUT_SYNTAX_LIST
|
||||
ini_panel key_but_syntax_mode,ID_BUT_SYNTAX_MODE
|
||||
ini_panel key_but_convert_1251_866,ID_BUT_CONVERT_1251_866
|
||||
ini_panel key_but_convert_866_1251,ID_BUT_CONVERT_866_1251
|
||||
;䠩<><E4A0A9><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>७<EFBFBD><E0A5AD>
|
||||
xor edx,edx
|
||||
mov ebx,synt_auto_open
|
||||
@@:
|
||||
;<3B><>६ <20><><EFBFBD> 䠩<EFBFBD><EFBFBD>
|
||||
stdcall [ini_get_str],file_name,ini_sec_options,key_synt_file,ebx,32,ini_def_synt_f
|
||||
cmp byte[ebx],0
|
||||
je @f
|
||||
inc byte[key_synt_file.numb]
|
||||
add ebx,32
|
||||
;<3B><>६ <20><><EFBFBD><EFBFBD><EFBFBD>७<EFBFBD><E0A5AD>
|
||||
stdcall [ini_get_str],file_name,ini_sec_options,key_synt_ext,ebx,32,ini_def_synt_f
|
||||
inc byte[key_synt_ext.numb]
|
||||
add ebx,32
|
||||
inc edx
|
||||
cmp edx,max_synt_auto_open
|
||||
jl @b
|
||||
@@:
|
||||
|
||||
;--- load color option file ---
|
||||
stdcall open_unpac_synt_file,[fn_col_option]
|
||||
|
||||
;--- get cmd line ---
|
||||
cmp byte[openfile_path+3],0 ;openfile_path
|
||||
je @f ;if file names exist
|
||||
mov esi,openfile_path
|
||||
stdcall auto_open_syntax,esi
|
||||
call but_no_msg_OpenFile
|
||||
@@:
|
||||
|
||||
|
||||
|
||||
align 16
|
||||
red_win:
|
||||
call draw_window
|
||||
|
||||
align 16
|
||||
still:
|
||||
mcall SF_WAIT_EVENT
|
||||
cmp dword[exit_code],1
|
||||
jne @f
|
||||
call ted_Exit
|
||||
jmp still
|
||||
@@:
|
||||
|
||||
cmp al,1 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
jz red_win
|
||||
cmp al,2
|
||||
jz key
|
||||
cmp al,3
|
||||
jz button
|
||||
cmp al,6 ;<3B><><EFBFBD><EFBFBD>
|
||||
jne @f
|
||||
call mouse
|
||||
@@:
|
||||
jmp still
|
||||
|
||||
align 16
|
||||
mouse:
|
||||
stdcall [kmainmenu_dispatch_cursorevent], [main_menu]
|
||||
|
||||
mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
|
||||
cmp word[tedit0.wnd.top],ax
|
||||
jg .no_edit
|
||||
shr eax,16
|
||||
cmp word[tedit0.wnd.left],ax
|
||||
jg .no_edit
|
||||
mcall SF_MOUSE_GET,SSF_BUTTON_EXT
|
||||
bt eax,24 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 饫<><E9A5AB><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
jnc @f
|
||||
stdcall [ted_but_select_word], tedit0
|
||||
ret
|
||||
@@:
|
||||
stdcall [ted_mouse], tedit0
|
||||
.no_edit:
|
||||
|
||||
;<3B><EFBFBD>ઠ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
cmp byte[tedit0.panel_id],TED_PANEL_FIND
|
||||
jne @f
|
||||
stdcall [edit_box_mouse], edit_find
|
||||
stdcall [option_box_mouse], opt_grlist1
|
||||
stdcall [check_box_mouse], ch1
|
||||
@@:
|
||||
cmp byte[tedit0.panel_id],TED_PANEL_REPLACE
|
||||
jne @f
|
||||
stdcall [edit_box_mouse], edit_find
|
||||
stdcall [edit_box_mouse], edit_replace
|
||||
stdcall [option_box_mouse], opt_grlist1
|
||||
@@:
|
||||
cmp byte[tedit0.panel_id],TED_PANEL_SYNTAX
|
||||
jne @f
|
||||
stdcall [tl_mouse], tree1
|
||||
@@:
|
||||
cmp byte[tedit0.panel_id],TED_PANEL_GOTO
|
||||
jne @f
|
||||
stdcall [edit_box_mouse], edit_goto
|
||||
@@:
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
;output:
|
||||
; ah = symbol
|
||||
align 16
|
||||
proc KeyConvertToASCII uses ebx, table:dword
|
||||
mov ebx,dword[table] ;convert scan to ascii
|
||||
shr ax,8
|
||||
add bx,ax
|
||||
mov ah,byte[ebx]
|
||||
ret
|
||||
endp
|
||||
|
||||
align 16
|
||||
key:
|
||||
mcall SF_KEYBOARD,SSF_GET_CONTROL_KEYS ;66.3 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ﭨ<EFBFBD> <20><>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
xor esi,esi
|
||||
mov ecx,1
|
||||
test al,3 ;[Shift]
|
||||
jz @f
|
||||
mov cl,2
|
||||
or esi,KM_SHIFT
|
||||
@@:
|
||||
test al,0x0c ;[Ctrl]
|
||||
jz @f
|
||||
or esi,KM_CTRL
|
||||
@@:
|
||||
test al,0x30 ;[Alt]
|
||||
jz @f
|
||||
mov cl,3
|
||||
or esi,KM_ALT
|
||||
@@:
|
||||
test al,0x80 ;[NumLock]
|
||||
jz @f
|
||||
or esi,KM_NUMLOCK
|
||||
@@:
|
||||
|
||||
mcall SF_SYSTEM_GET,SSF_KEYBOARD_LAYOUT,,conv_tabl ;26.2 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>᪫<EFBFBD><E1AAAB><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mcall SF_GET_KEY
|
||||
stdcall [tl_key], tree1
|
||||
|
||||
test word[edit_replace.flags],ed_focus ;<3B> <20><> <20> 䮪<><E4AEAA><EFBFBD>, <20><>室<EFBFBD><E5AEA4>
|
||||
je @f
|
||||
cmp ah,0x80 ;if key up
|
||||
ja still
|
||||
cmp ah,42 ;[Shift] (left)
|
||||
je still
|
||||
cmp ah,54 ;[Shift] (right)
|
||||
je still
|
||||
cmp ah,56 ;[Alt]
|
||||
je still
|
||||
cmp ah,29 ;[Ctrl]
|
||||
je still
|
||||
cmp ah,69 ;[Pause Break]
|
||||
je still
|
||||
|
||||
stdcall KeyConvertToASCII, conv_tabl
|
||||
stdcall [edit_box_key], edit_replace
|
||||
jmp still
|
||||
@@:
|
||||
test word[edit_find.flags],ed_focus ;<3B> <20><> <20> 䮪<><E4AEAA><EFBFBD>, <20><>室<EFBFBD><E5AEA4>
|
||||
je @f
|
||||
cmp ah,0x80 ;if key up
|
||||
ja still
|
||||
cmp ah,42 ;[Shift] (left)
|
||||
je still
|
||||
cmp ah,54 ;[Shift] (right)
|
||||
je still
|
||||
cmp ah,56 ;[Alt]
|
||||
je still
|
||||
cmp ah,29 ;[Ctrl]
|
||||
je still
|
||||
cmp ah,69 ;[Pause Break]
|
||||
je still
|
||||
|
||||
stdcall KeyConvertToASCII, conv_tabl
|
||||
stdcall [edit_box_key], edit_find
|
||||
jmp still
|
||||
@@:
|
||||
test word[edit_goto.flags],ed_focus ;<3B> <20><> <20> 䮪<><E4AEAA><EFBFBD>, <20><>室<EFBFBD><E5AEA4>
|
||||
je @f
|
||||
cmp ah,0x80 ;if key up
|
||||
ja still
|
||||
cmp ah,42 ;[Shift] (left)
|
||||
je still
|
||||
cmp ah,54 ;[Shift] (right)
|
||||
je still
|
||||
cmp ah,56 ;[Alt]
|
||||
je still
|
||||
cmp ah,29 ;[Ctrl]
|
||||
je still
|
||||
cmp ah,69 ;[Pause Break]
|
||||
je still
|
||||
|
||||
stdcall KeyConvertToASCII, conv_tabl
|
||||
stdcall [edit_box_key], edit_goto
|
||||
jmp still
|
||||
@@:
|
||||
|
||||
stdcall [ted_key], tedit0, conv_tabl,esi
|
||||
jmp still
|
||||
|
||||
align 4
|
||||
edit_replace edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 300, buf_replace, mouse_dd, 0
|
||||
edit_find edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 300, buf_find, mouse_dd, 0
|
||||
edit_goto edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 10, buf_goto, mouse_dd, 0
|
||||
|
||||
unpac_mem dd 0
|
||||
|
||||
;library structures
|
||||
l_libs_start:
|
||||
lib0 l_libs lib_name_0, file_name, system_dir_0, import_box_lib
|
||||
lib1 l_libs lib_name_1, file_name, system_dir_1, import_msgbox_lib
|
||||
lib2 l_libs lib_name_2, file_name, system_dir_2, import_proclib
|
||||
lib3 l_libs lib_name_3, file_name, system_dir_3, import_libimg
|
||||
lib4 l_libs lib_name_4, file_name, system_dir_4, import_libini
|
||||
lib5 l_libs lib_name_5, file_name, system_dir_5, import_libkmenu
|
||||
load_lib_end:
|
||||
|
||||
IncludeIGlobals
|
||||
hed db 'TextEdit '
|
||||
i_end:
|
||||
openfile_path: ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><EFBFBD><EFBFBD> <20> 䠩<><E4A0A9> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ࠡ<><EFBFBD><EFBFBD>
|
||||
rb 4096
|
||||
dir_mem rb 32+304*count_of_dir_list_files
|
||||
wnd_s_pos: ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>⮢<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>樨 <20><><EFBFBD><EFBFBD>
|
||||
rq 1
|
||||
last_open_synt_file rb 32 ;<3B><><EFBFBD> <20><><EFBFBD><E1ABA5><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><E7A5AD><EFBFBD><EFBFBD> 䠩<><E4A0A9> ᨭ⠪<E1A8AD><E2A0AA><EFBFBD><EFBFBD>
|
||||
buf rb BUF_SIZE ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD><EFBFBD> <20> <20><>⠢<EFBFBD><E2A0A2>
|
||||
buf_find rb 302 ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD>᪠ ⥪<><E2A5AA><EFBFBD>
|
||||
buf_replace rb 302 ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥪<><E2A5AA><EFBFBD>
|
||||
buf_goto rb 12 ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD>室<EFBFBD> <20><> <20><>ப<EFBFBD>
|
||||
sc system_colors
|
||||
IncludeUGlobals
|
||||
align 16
|
||||
procinfo process_information
|
||||
rb 1024
|
||||
thread:
|
||||
rb 4096
|
||||
align 16
|
||||
thread_coords:
|
||||
rb 4096
|
||||
align 16
|
||||
stacktop:
|
||||
sys_path: ;<3B><><EFBFBD><EFBFBD> <20><><EFBFBD>㤠 <20><><EFBFBD><EFBFBD><EFBFBD>⨫<EFBFBD><E2A8AB> <20>ᯮ<EFBFBD><E1AFAE>塞<EFBFBD><EFA5AC> 䠩<>
|
||||
rb 4096
|
||||
file_name: ;<3B><>ࠬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>᪠
|
||||
rb 4096
|
||||
syntax_path: ;<3B><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>砥<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<EFBFBD><EFBFBD> ᨭ⠪<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
rb 4096
|
||||
plugin_path:
|
||||
rb 4096
|
||||
text_work_area: ;<3B><><EFBFBD><EFBFBD> <20> 䠩<><E4A0A9>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>뢠<EFBFBD><EBA2A0><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>
|
||||
rb 4096
|
||||
filename_area: ;<3B><><EFBFBD> 䠩<><E4A0A9> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
rb 256
|
||||
file_info:
|
||||
rb 40
|
||||
mem:
|
||||
|
@@ -1,389 +1,395 @@
|
||||
use32
|
||||
org 0
|
||||
db 'MENUET01' ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20>ᯮ<EFBFBD><E1AFAE>塞<EFBFBD><EFA5AC><EFBFBD> 䠩<><E4A0A9> <20>ᥣ<EFBFBD><E1A5A3> 8 <20><><EFBFBD><EFBFBD>
|
||||
dd 1, start, i_end, mem, stacktop, file_name, sys_path
|
||||
|
||||
MAX_COLOR_WORD_LEN equ 40
|
||||
BUF_SIZE equ 4096 ;buffer for copy|paste
|
||||
CAPT_PATH_WIDTH equ 50 ;<3B><>ਭ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>। ⥪<>⮢<EFBFBD><E2AEA2> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
include '../../macros.inc'
|
||||
include '../../proc32.inc'
|
||||
include '../../KOSfuncs.inc'
|
||||
include '../../load_img.inc'
|
||||
include '../../load_lib.mac'
|
||||
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
include '../../system/skincfg/trunk/kglobals.inc'
|
||||
include '../../system/skincfg/trunk/unpacker.inc'
|
||||
include 'te_data.inc'
|
||||
include 'te_work.inc' ;text work functions
|
||||
|
||||
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
|
||||
icon_tl_sys dd 0 ;㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20>࠭<EFBFBD><E0A0AD><EFBFBD><EFBFBD> <20><><EFBFBD>⥬<EFBFBD><E2A5AC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
align 4
|
||||
start:
|
||||
mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
|
||||
|
||||
mcall SF_SYS_MISC,SSF_HEAP_INIT
|
||||
or eax,eax
|
||||
jz button.exit
|
||||
|
||||
mcall SF_KEYBOARD,SSF_SET_INPUT_MODE,1 ;scan code
|
||||
mcall SF_SET_EVENTS_MASK,0xC0000027
|
||||
|
||||
load_libraries l_libs_start,load_lib_end
|
||||
|
||||
;<3B><EFBFBD>ઠ <20><> <>쪮 㤠筮 <20><><EFBFBD>㧨<EFBFBD><E3A7A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD>
|
||||
cmp dword[lib0+ll_struc_size-4],0
|
||||
jz @f
|
||||
mcall -1 ;exit not correct
|
||||
@@:
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
stdcall [tl_data_init], tree1
|
||||
|
||||
; <20><>⠥<EFBFBD> 䠩<> <20> <20><><EFBFBD><EFBFBD><EFBFBD>ࠬ<EFBFBD> <20> <20><><EFBFBD><EFBFBD>ﬨ
|
||||
include_image_file '..\..\media\log_el\trunk\tl_sys_16.png', icon_tl_sys
|
||||
mov eax,[icon_tl_sys]
|
||||
mov [tree1.data_img_sys],eax
|
||||
;---------------------------------------------------------------------
|
||||
; <20><>⠥<EFBFBD> bmp 䠩<> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㧫<><E3A7AB>
|
||||
include_image_file '..\t_edit\tl_nod_16.png', icon_tl_sys
|
||||
mov eax,[icon_tl_sys]
|
||||
mov [tree1.data_img],eax
|
||||
;------------------------------------------------------------------------------
|
||||
copy_path fn_syntax_dir,sys_path,file_name,0 ;<3B><>६ <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20> 䠩<><E4A0A9><EFBFBD><EFBFBD> ᨭ⠪<E1A8AD><E2A0AA><EFBFBD><EFBFBD>
|
||||
mcall SF_FILE,tree_file_struct
|
||||
|
||||
cmp ebx,2
|
||||
jg @f
|
||||
notify_window_run file_name ;ᮮ<>饭<EFBFBD><E9A5AD> <20> <20><> 㤠<><E3A4A0><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9>
|
||||
jmp .end_dir_init
|
||||
@@:
|
||||
;cmp ebx,0
|
||||
;jle .end_dir_init
|
||||
mov eax,dir_mem+32+40
|
||||
mov ecx,ebx
|
||||
@@:
|
||||
cmp byte[eax],'.' ;䨫<><E4A8AB><EFBFBD>㥬 䠩<><E4A0A9> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '.' <20> '..'
|
||||
je .filter
|
||||
stdcall [tl_node_add],tree1,0x10000,eax ;1*2^16 - <20><><EFBFBD> 1 <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
stdcall [tl_cur_next],tree1
|
||||
.filter:
|
||||
add eax,304
|
||||
loop @b
|
||||
stdcall [tl_cur_beg],tree1 ;<3B>⠢<EFBFBD><E2A0A2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><>砫<EFBFBD> ᯨ᪠
|
||||
or dword[tree1.style], tl_cursor_pos_limited ;<3B><>࠭<EFBFBD>稢<EFBFBD><E7A8A2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20>।<EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᯨ᪠
|
||||
.end_dir_init:
|
||||
|
||||
xor eax,eax
|
||||
inc eax
|
||||
mov [scrol_w1.type],eax
|
||||
mov [scrol_h1.type],eax
|
||||
mov [ws_dir_lbox.type],eax
|
||||
|
||||
;--- load color option file ---
|
||||
stdcall [ted_init], tedit0
|
||||
mov byte[file_name],0
|
||||
|
||||
align 4
|
||||
red_win:
|
||||
call draw_window
|
||||
|
||||
align 4
|
||||
still:
|
||||
mcall SF_WAIT_EVENT
|
||||
|
||||
cmp al,1 ;<3B><><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
jz red_win
|
||||
cmp al,2
|
||||
jz key
|
||||
cmp al,3
|
||||
jz button
|
||||
cmp al,6
|
||||
jz mouse
|
||||
|
||||
jmp still
|
||||
|
||||
|
||||
align 4
|
||||
draw_window:
|
||||
pushad
|
||||
mcall SF_REDRAW,SSF_BEGIN_DRAW
|
||||
|
||||
mov edx,[sc.work]
|
||||
or edx,0x33000000
|
||||
mov edi,hed
|
||||
mcall SF_CREATE_WINDOW,<10,555>,<10,333>
|
||||
|
||||
mcall SF_THREAD_INFO,procinfo,-1
|
||||
mov edi,tedit0 ;<3B><><EFBFBD>祭<EFBFBD><E7A5AD> edi <20>㦭<EFBFBD> <20><><EFBFBD> EvSize <20> ted_wnd_t
|
||||
call EvSize
|
||||
|
||||
mov esi,[sc.work_button];0xd0
|
||||
mcall SF_DEFINE_BUTTON,5*65536+90,195*65536+20,200
|
||||
|
||||
mov ebx,100*65536+85
|
||||
mov ecx,195*65536+20
|
||||
mov edx,201
|
||||
mov esi,0xd00000
|
||||
mcall
|
||||
|
||||
mov ecx,[sc.work_button_text]
|
||||
or ecx,0x80000000
|
||||
mcall SF_DRAW_TEXT,10*65536+200,,txt_load_f
|
||||
|
||||
mov ecx,0xffff00
|
||||
or ecx,0x80000000
|
||||
mcall ,105*65536+200,,txt_save_f
|
||||
|
||||
mov ecx,[sc.work_text]
|
||||
or ecx,0x80000000
|
||||
mcall ,195*65536+10,,txt_inp_file
|
||||
|
||||
add ebx,20
|
||||
mov edx,txt_out_file
|
||||
int 0x40
|
||||
|
||||
stdcall [PathShow_draw], PathShow_data_1
|
||||
|
||||
stdcall [edit_box_draw], edit1
|
||||
stdcall [tl_draw], tree1
|
||||
|
||||
;scroll 1
|
||||
mov [ws_dir_lbox.all_redraw],1
|
||||
stdcall [scrollbar_ver_draw],ws_dir_lbox
|
||||
stdcall [ted_draw], tedit0
|
||||
|
||||
mcall SF_REDRAW,SSF_END_DRAW
|
||||
popad
|
||||
ret
|
||||
|
||||
MIN_M_WND_H equ 100 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>쭠<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
;input:
|
||||
; edi = pointer to tedit struct
|
||||
align 4
|
||||
EvSize:
|
||||
pushad
|
||||
mov ebx,ted_scr_h
|
||||
mov esi,ted_scr_w
|
||||
|
||||
m2m ted_wnd_w,[procinfo.client_box.width] ;<3B>⠢<EFBFBD><E2A0A2> <20><>ਭ<EFBFBD> <20><><EFBFBD><EFBFBD> ।<><E0A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠢ<><E0A0A2><EFBFBD> <20><>ਭ<EFBFBD> <20>ᥣ<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
mov eax,ted_wnd_l
|
||||
sub ted_wnd_w,eax ;<3B>⭨<EFBFBD><E2ADA8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <><E1ABA5>
|
||||
movzx eax,word[esi+sb_offs_size_x]
|
||||
sub ted_wnd_w,eax ;<3B>⭨<EFBFBD><E2ADA8><EFBFBD><EFBFBD> <20><>ਭ<EFBFBD> <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
m2m ted_wnd_h,[procinfo.client_box.height] ;<3B>⠢<EFBFBD><E2A0A2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ।<><E0A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠢ<><E0A0A2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ᥣ<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
cmp ted_wnd_h,MIN_M_WND_H
|
||||
jg @f
|
||||
mov ted_wnd_h,MIN_M_WND_H
|
||||
@@:
|
||||
|
||||
movzx eax,word[ebx+sb_offs_size_y]
|
||||
sub ted_wnd_h,eax ;<3B>⭨<EFBFBD><E2ADA8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ਧ. <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD>
|
||||
mov eax,ted_wnd_t
|
||||
sub ted_wnd_h,eax ;<3B>⭨<EFBFBD><E2ADA8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᢥ<><E1A2A5><EFBFBD>
|
||||
|
||||
stdcall [ted_init_scroll_bars], tedit0,2
|
||||
popad
|
||||
ret
|
||||
|
||||
align 4
|
||||
mouse:
|
||||
stdcall [tl_mouse],tree1
|
||||
stdcall [edit_box_mouse],edit1
|
||||
stdcall [ted_mouse], tedit0
|
||||
jmp still
|
||||
|
||||
;output:
|
||||
; ah = symbol
|
||||
align 4
|
||||
proc KeyConvertToASCII, table:dword
|
||||
push ebx
|
||||
mov ebx,dword[table] ;convert scan to ascii
|
||||
shr ax,8
|
||||
add bx,ax
|
||||
mov ah,byte[ebx]
|
||||
pop ebx
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
key:
|
||||
mcall SF_KEYBOARD,SSF_GET_CONTROL_KEYS ;66.3 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ﭨ<EFBFBD> <20><>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
xor esi,esi
|
||||
mov ecx,1
|
||||
test al,3 ;[Shift]
|
||||
jz @f
|
||||
mov cl,2
|
||||
or esi,KM_SHIFT
|
||||
@@:
|
||||
test al,0x0c ;[Ctrl]
|
||||
jz @f
|
||||
or esi,KM_CTRL
|
||||
@@:
|
||||
test al,0x30 ;[Alt]
|
||||
jz @f
|
||||
mov cl,3
|
||||
or esi,KM_ALT
|
||||
@@:
|
||||
test al,0x80 ;[NumLock]
|
||||
jz @f
|
||||
or esi,KM_NUMLOCK
|
||||
@@:
|
||||
|
||||
mcall SF_SYSTEM_GET,SSF_KEYBOARD_LAYOUT,,conv_tabl ;26.2 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>᪫<EFBFBD><E1AAAB><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mcall SF_GET_KEY
|
||||
stdcall [tl_key],tree1
|
||||
|
||||
test word [edit1.flags],10b;ed_focus ; <20> <20><> <20> 䮪<><E4AEAA><EFBFBD>, <20><>室<EFBFBD><E5AEA4>
|
||||
je @f
|
||||
cmp ah,0x80 ;if key up
|
||||
ja still
|
||||
cmp ah,42 ;[Shift] (left)
|
||||
je still
|
||||
cmp ah,54 ;[Shift] (right)
|
||||
je still
|
||||
cmp ah,56 ;[Alt]
|
||||
je still
|
||||
cmp ah,29 ;[Ctrl]
|
||||
je still
|
||||
cmp ah,69 ;[Pause Break]
|
||||
je still
|
||||
|
||||
stdcall KeyConvertToASCII, conv_tabl
|
||||
stdcall [edit_box_key],edit1
|
||||
jmp still
|
||||
@@:
|
||||
|
||||
stdcall [ted_key], tedit0, conv_tabl,esi
|
||||
jmp still
|
||||
|
||||
align 4
|
||||
button:
|
||||
mcall SF_GET_BUTTON
|
||||
|
||||
cmp ah,200
|
||||
jne @f
|
||||
call but_OpenSyntax
|
||||
@@:
|
||||
cmp ah,201
|
||||
jne @f
|
||||
call but_SaveSyntax
|
||||
@@:
|
||||
|
||||
cmp ah,1
|
||||
jne still
|
||||
.exit:
|
||||
stdcall mem.Free,[options_file]
|
||||
stdcall mem.Free,[unpac_mem]
|
||||
|
||||
stdcall [tl_data_clear], tree1
|
||||
stdcall [ted_delete], tedit0
|
||||
mcall SF_TERMINATE_PROCESS ;<3B><>室 <20><> <20>ணࠬ<E0AEA3><E0A0AC>
|
||||
|
||||
align 4
|
||||
but_OpenSyntax:
|
||||
push eax
|
||||
stdcall [tl_node_get_data],tree1
|
||||
mov [fn_col_option],eax
|
||||
call InitColText
|
||||
pop eax
|
||||
ret
|
||||
|
||||
align 4
|
||||
but_SaveSyntax:
|
||||
stdcall [ted_save_file], tedit0,run_file_70,[edit1.text]
|
||||
ret
|
||||
|
||||
;description:
|
||||
; <20>㭪<EFBFBD><E3ADAA><EFBFBD> <20><><EFBFBD>뢠<EFBFBD><EBA2A0><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>⨨ Ctrl+N,O,F,S,H,G
|
||||
align 4
|
||||
proc ted_but_ctrl_all uses eax, opt_key:dword
|
||||
mov eax,[opt_key]
|
||||
cmp al,'N' ;Ctrl+N
|
||||
jne @f
|
||||
call but_ctrl_n
|
||||
jmp .end0
|
||||
@@:
|
||||
cmp al,'O' ;Ctrl+O
|
||||
jne @f
|
||||
call but_ctrl_o
|
||||
@@:
|
||||
;cmp al,'S' ;Ctrl+S
|
||||
;cmp al,'F' ;Ctrl+F
|
||||
;cmp al,'G' ;Ctrl+G
|
||||
;cmp al,'H' ;Ctrl+H
|
||||
.end0:
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
but_ctrl_o:
|
||||
push eax
|
||||
call get_wnd_in_focus
|
||||
or eax,eax
|
||||
jz @f
|
||||
stdcall [ted_open_file], eax,str_file_70,[edit1.text]
|
||||
@@:
|
||||
pop eax
|
||||
ret
|
||||
|
||||
;ᮧ<><E1AEA7><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9>
|
||||
align 4
|
||||
but_ctrl_n:
|
||||
push eax
|
||||
call get_wnd_in_focus
|
||||
or eax,eax
|
||||
jz @f
|
||||
stdcall [ted_clear], eax,1
|
||||
stdcall [ted_draw], eax
|
||||
@@:
|
||||
pop eax
|
||||
ret
|
||||
|
||||
;<3B><>।<EFBFBD><E0A5A4>塞 <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> ।<><E0A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> 䮪<><E4AEAA><EFBFBD>
|
||||
align 4
|
||||
get_wnd_in_focus:
|
||||
xor eax,eax
|
||||
cmp dword[el_focus],tedit0
|
||||
jne @f
|
||||
mov eax,tedit0
|
||||
@@:
|
||||
;cmp dword[el_focus],tedit1
|
||||
;jne @f
|
||||
; mov eax,tedit1
|
||||
;@@:
|
||||
ret
|
||||
|
||||
hed db 'TextEditor syntax file converter 18.12.20',0 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
conv_tabl rb 128 ; ⠡<><E2A0A1><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD><EFBFBD> scan-<2D><><EFBFBD><EFBFBD> <20> ascii-<2D><><EFBFBD>
|
||||
|
||||
txt_load_f db '<27><><EFBFBD><EFBFBD>. 䠩<>',0
|
||||
txt_save_f db '<27><><EFBFBD><EFBFBD>. 䠩<>',0
|
||||
txt_inp_file db '<27><><EFBFBD>. 䠩<>:',0
|
||||
txt_out_file db '<27><><EFBFBD>. 䠩<>:',0
|
||||
|
||||
;library structures
|
||||
l_libs_start:
|
||||
lib0 l_libs lib_name_0, file_name, system_dir_0, import_box_lib
|
||||
lib1 l_libs lib_name_1, file_name, system_dir_1, import_libimg
|
||||
load_lib_end:
|
||||
|
||||
IncludeIGlobals
|
||||
|
||||
align 16
|
||||
i_end:
|
||||
IncludeUGlobals
|
||||
procinfo process_information
|
||||
rb 1024
|
||||
thread:
|
||||
rb 1024
|
||||
stacktop:
|
||||
sys_path rb 4096
|
||||
file_name rb 4096
|
||||
file_name_rez rb 4096
|
||||
mem:
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
; Text encoded with Code Page 866 - Cyrillic
|
||||
|
||||
|
||||
use32
|
||||
org 0
|
||||
db 'MENUET01' ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20>ᯮ<EFBFBD><E1AFAE>塞<EFBFBD><EFA5AC><EFBFBD> 䠩<><E4A0A9> <20>ᥣ<EFBFBD><E1A5A3> 8 <20><><EFBFBD><EFBFBD>
|
||||
dd 1, start, i_end, mem, stacktop, file_name, sys_path
|
||||
|
||||
MAX_COLOR_WORD_LEN equ 40
|
||||
BUF_SIZE equ 4096 ;buffer for copy|paste
|
||||
CAPT_PATH_WIDTH equ 50 ;<3B><>ਭ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>। ⥪<>⮢<EFBFBD><E2AEA2> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
include '../../macros.inc'
|
||||
include '../../proc32.inc'
|
||||
include '../../KOSfuncs.inc'
|
||||
include '../../load_img.inc'
|
||||
include '../../load_lib.mac'
|
||||
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
include '../../system/skincfg/trunk/kglobals.inc'
|
||||
include '../../system/skincfg/trunk/unpacker.inc'
|
||||
include 'te_data.inc'
|
||||
include 'te_work.inc' ;text work functions
|
||||
|
||||
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
|
||||
icon_tl_sys dd 0 ;㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20>࠭<EFBFBD><E0A0AD><EFBFBD><EFBFBD> <20><><EFBFBD>⥬<EFBFBD><E2A5AC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
align 4
|
||||
start:
|
||||
mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
|
||||
|
||||
mcall SF_SYS_MISC,SSF_HEAP_INIT
|
||||
or eax,eax
|
||||
jz button.exit
|
||||
|
||||
mcall SF_KEYBOARD,SSF_SET_INPUT_MODE,1 ;scan code
|
||||
mcall SF_SET_EVENTS_MASK,0xC0000027
|
||||
|
||||
load_libraries l_libs_start,load_lib_end
|
||||
|
||||
;<EFBFBD><EFBFBD>ઠ <20><> <>쪮 㤠筮 <20><><EFBFBD>㧨<EFBFBD><E3A7A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD>
|
||||
cmp dword[lib0+ll_struc_size-4],0
|
||||
jz @f
|
||||
mcall -1 ;exit not correct
|
||||
@@:
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
stdcall [tl_data_init], tree1
|
||||
|
||||
; <20><>⠥<EFBFBD> 䠩<> <20> <20><><EFBFBD><EFBFBD><EFBFBD>ࠬ<EFBFBD> <20> <20><><EFBFBD><EFBFBD>ﬨ
|
||||
include_image_file '..\..\media\log_el\tl_sys_16.png', icon_tl_sys
|
||||
mov eax,[icon_tl_sys]
|
||||
mov [tree1.data_img_sys],eax
|
||||
;---------------------------------------------------------------------
|
||||
; <20><>⠥<EFBFBD> bmp 䠩<> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㧫<><E3A7AB>
|
||||
include_image_file '..\t_edit\tl_nod_16.png', icon_tl_sys
|
||||
mov eax,[icon_tl_sys]
|
||||
mov [tree1.data_img],eax
|
||||
;------------------------------------------------------------------------------
|
||||
copy_path fn_syntax_dir,sys_path,file_name,0 ;<3B><>६ <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20> 䠩<><E4A0A9><EFBFBD><EFBFBD> ᨭ⠪<E1A8AD><E2A0AA><EFBFBD><EFBFBD>
|
||||
mcall SF_FILE,tree_file_struct
|
||||
|
||||
cmp ebx,2
|
||||
jg @f
|
||||
notify_window_run file_name ;ᮮ<>饭<EFBFBD><E9A5AD> <20> <20><> 㤠<><E3A4A0><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9>
|
||||
jmp .end_dir_init
|
||||
@@:
|
||||
;cmp ebx,0
|
||||
;jle .end_dir_init
|
||||
mov eax,dir_mem+32+40
|
||||
mov ecx,ebx
|
||||
@@:
|
||||
cmp byte[eax],'.' ;䨫<><E4A8AB><EFBFBD>㥬 䠩<><E4A0A9> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '.' <20> '..'
|
||||
je .filter
|
||||
stdcall [tl_node_add],tree1,0x10000,eax ;1*2^16 - <20><><EFBFBD> 1 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
stdcall [tl_cur_next],tree1
|
||||
.filter:
|
||||
add eax,304
|
||||
loop @b
|
||||
stdcall [tl_cur_beg],tree1 ;<3B>⠢<EFBFBD><E2A0A2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><>砫<EFBFBD> ᯨ᪠
|
||||
or dword[tree1.style], tl_cursor_pos_limited ;<3B><>࠭<EFBFBD>稢<EFBFBD><E7A8A2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20>।<EFBFBD><E0A5A4><EFBFBD><EFBFBD> ᯨ᪠
|
||||
.end_dir_init:
|
||||
|
||||
xor eax,eax
|
||||
inc eax
|
||||
mov [scrol_w1.type],eax
|
||||
mov [scrol_h1.type],eax
|
||||
mov [ws_dir_lbox.type],eax
|
||||
|
||||
;--- load color option file ---
|
||||
stdcall [ted_init], tedit0
|
||||
mov byte[file_name],0
|
||||
|
||||
align 4
|
||||
red_win:
|
||||
call draw_window
|
||||
|
||||
align 4
|
||||
still:
|
||||
mcall SF_WAIT_EVENT
|
||||
|
||||
cmp al,1 ;<3B><><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
jz red_win
|
||||
cmp al,2
|
||||
jz key
|
||||
cmp al,3
|
||||
jz button
|
||||
cmp al,6
|
||||
jz mouse
|
||||
|
||||
jmp still
|
||||
|
||||
|
||||
align 4
|
||||
draw_window:
|
||||
pushad
|
||||
mcall SF_REDRAW,SSF_BEGIN_DRAW
|
||||
|
||||
mov edx,[sc.work]
|
||||
or edx,0x33000000
|
||||
mov edi,hed
|
||||
mcall SF_CREATE_WINDOW,<10,555>,<10,333>
|
||||
|
||||
mcall SF_THREAD_INFO,procinfo,-1
|
||||
mov edi,tedit0 ;<3B><><EFBFBD>祭<EFBFBD><E7A5AD> edi <20>㦭<EFBFBD> <20><><EFBFBD> EvSize <20> ted_wnd_t
|
||||
call EvSize
|
||||
|
||||
mov esi,[sc.work_button];0xd0
|
||||
mcall SF_DEFINE_BUTTON,5*65536+90,195*65536+20,200
|
||||
|
||||
mov ebx,100*65536+85
|
||||
mov ecx,195*65536+20
|
||||
mov edx,201
|
||||
mov esi,0xd00000
|
||||
mcall
|
||||
|
||||
mov ecx,[sc.work_button_text]
|
||||
or ecx,0x80000000
|
||||
mcall SF_DRAW_TEXT,10*65536+200,,txt_load_f
|
||||
|
||||
mov ecx,0xffff00
|
||||
or ecx,0x80000000
|
||||
mcall ,105*65536+200,,txt_save_f
|
||||
|
||||
mov ecx,[sc.work_text]
|
||||
or ecx,0x80000000
|
||||
mcall ,195*65536+10,,txt_inp_file
|
||||
|
||||
add ebx,20
|
||||
mov edx,txt_out_file
|
||||
int 0x40
|
||||
|
||||
stdcall [PathShow_draw], PathShow_data_1
|
||||
|
||||
stdcall [edit_box_draw], edit1
|
||||
stdcall [tl_draw], tree1
|
||||
|
||||
;scroll 1
|
||||
mov [ws_dir_lbox.all_redraw],1
|
||||
stdcall [scrollbar_ver_draw],ws_dir_lbox
|
||||
stdcall [ted_draw], tedit0
|
||||
|
||||
mcall SF_REDRAW,SSF_END_DRAW
|
||||
popad
|
||||
ret
|
||||
|
||||
MIN_M_WND_H equ 100 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>쭠<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
;input:
|
||||
; edi = pointer to tedit struct
|
||||
align 4
|
||||
EvSize:
|
||||
pushad
|
||||
mov ebx,ted_scr_h
|
||||
mov esi,ted_scr_w
|
||||
|
||||
m2m ted_wnd_w,[procinfo.client_box.width] ;<3B>⠢<EFBFBD><E2A0A2> <20><>ਭ<EFBFBD> <20><><EFBFBD><EFBFBD> ।<><E0A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠢ<><E0A0A2><EFBFBD> <20><>ਭ<EFBFBD> <20>ᥣ<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
mov eax,ted_wnd_l
|
||||
sub ted_wnd_w,eax ;<3B>⭨<EFBFBD><E2ADA8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <><E1ABA5>
|
||||
movzx eax,word[esi+sb_offs_size_x]
|
||||
sub ted_wnd_w,eax ;<3B>⭨<EFBFBD><E2ADA8><EFBFBD><EFBFBD> <20><>ਭ<EFBFBD> <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
m2m ted_wnd_h,[procinfo.client_box.height] ;<3B>⠢<EFBFBD><E2A0A2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ।<><E0A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠢ<><E0A0A2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ᥣ<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
cmp ted_wnd_h,MIN_M_WND_H
|
||||
jg @f
|
||||
mov ted_wnd_h,MIN_M_WND_H
|
||||
@@:
|
||||
|
||||
movzx eax,word[ebx+sb_offs_size_y]
|
||||
sub ted_wnd_h,eax ;<3B>⭨<EFBFBD><E2ADA8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ਧ. <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD>
|
||||
mov eax,ted_wnd_t
|
||||
sub ted_wnd_h,eax ;<3B>⭨<EFBFBD><E2ADA8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᢥ<><E1A2A5><EFBFBD>
|
||||
|
||||
stdcall [ted_init_scroll_bars], tedit0,2
|
||||
popad
|
||||
ret
|
||||
|
||||
align 4
|
||||
mouse:
|
||||
stdcall [tl_mouse],tree1
|
||||
stdcall [edit_box_mouse],edit1
|
||||
stdcall [ted_mouse], tedit0
|
||||
jmp still
|
||||
|
||||
;output:
|
||||
; ah = symbol
|
||||
align 4
|
||||
proc KeyConvertToASCII, table:dword
|
||||
push ebx
|
||||
mov ebx,dword[table] ;convert scan to ascii
|
||||
shr ax,8
|
||||
add bx,ax
|
||||
mov ah,byte[ebx]
|
||||
pop ebx
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
key:
|
||||
mcall SF_KEYBOARD,SSF_GET_CONTROL_KEYS ;66.3 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ﭨ<EFBFBD> <20><>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
xor esi,esi
|
||||
mov ecx,1
|
||||
test al,3 ;[Shift]
|
||||
jz @f
|
||||
mov cl,2
|
||||
or esi,KM_SHIFT
|
||||
@@:
|
||||
test al,0x0c ;[Ctrl]
|
||||
jz @f
|
||||
or esi,KM_CTRL
|
||||
@@:
|
||||
test al,0x30 ;[Alt]
|
||||
jz @f
|
||||
mov cl,3
|
||||
or esi,KM_ALT
|
||||
@@:
|
||||
test al,0x80 ;[NumLock]
|
||||
jz @f
|
||||
or esi,KM_NUMLOCK
|
||||
@@:
|
||||
|
||||
mcall SF_SYSTEM_GET,SSF_KEYBOARD_LAYOUT,,conv_tabl ;26.2 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>᪫<EFBFBD><E1AAAB><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mcall SF_GET_KEY
|
||||
stdcall [tl_key],tree1
|
||||
|
||||
test word [edit1.flags],10b;ed_focus ; <20> <20><> <20> 䮪<><E4AEAA><EFBFBD>, <20><>室<EFBFBD><E5AEA4>
|
||||
je @f
|
||||
cmp ah,0x80 ;if key up
|
||||
ja still
|
||||
cmp ah,42 ;[Shift] (left)
|
||||
je still
|
||||
cmp ah,54 ;[Shift] (right)
|
||||
je still
|
||||
cmp ah,56 ;[Alt]
|
||||
je still
|
||||
cmp ah,29 ;[Ctrl]
|
||||
je still
|
||||
cmp ah,69 ;[Pause Break]
|
||||
je still
|
||||
|
||||
stdcall KeyConvertToASCII, conv_tabl
|
||||
stdcall [edit_box_key],edit1
|
||||
jmp still
|
||||
@@:
|
||||
|
||||
stdcall [ted_key], tedit0, conv_tabl,esi
|
||||
jmp still
|
||||
|
||||
align 4
|
||||
button:
|
||||
mcall SF_GET_BUTTON
|
||||
|
||||
cmp ah,200
|
||||
jne @f
|
||||
call but_OpenSyntax
|
||||
@@:
|
||||
cmp ah,201
|
||||
jne @f
|
||||
call but_SaveSyntax
|
||||
@@:
|
||||
|
||||
cmp ah,1
|
||||
jne still
|
||||
.exit:
|
||||
stdcall mem.Free,[options_file]
|
||||
stdcall mem.Free,[unpac_mem]
|
||||
|
||||
stdcall [tl_data_clear], tree1
|
||||
stdcall [ted_delete], tedit0
|
||||
mcall SF_TERMINATE_PROCESS ;<3B><>室 <20><> <20>ணࠬ<E0AEA3><E0A0AC>
|
||||
|
||||
align 4
|
||||
but_OpenSyntax:
|
||||
push eax
|
||||
stdcall [tl_node_get_data],tree1
|
||||
mov [fn_col_option],eax
|
||||
call InitColText
|
||||
pop eax
|
||||
ret
|
||||
|
||||
align 4
|
||||
but_SaveSyntax:
|
||||
stdcall [ted_save_file], tedit0,run_file_70,[edit1.text]
|
||||
ret
|
||||
|
||||
;description:
|
||||
; <20>㭪<EFBFBD><E3ADAA><EFBFBD> <20><><EFBFBD>뢠<EFBFBD><EBA2A0><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>⨨ Ctrl+N,O,F,S,H,G
|
||||
align 4
|
||||
proc ted_but_ctrl_all uses eax, opt_key:dword
|
||||
mov eax,[opt_key]
|
||||
cmp al,'N' ;Ctrl+N
|
||||
jne @f
|
||||
call but_ctrl_n
|
||||
jmp .end0
|
||||
@@:
|
||||
cmp al,'O' ;Ctrl+O
|
||||
jne @f
|
||||
call but_ctrl_o
|
||||
@@:
|
||||
;cmp al,'S' ;Ctrl+S
|
||||
;cmp al,'F' ;Ctrl+F
|
||||
;cmp al,'G' ;Ctrl+G
|
||||
;cmp al,'H' ;Ctrl+H
|
||||
.end0:
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
but_ctrl_o:
|
||||
push eax
|
||||
call get_wnd_in_focus
|
||||
or eax,eax
|
||||
jz @f
|
||||
stdcall [ted_open_file], eax,str_file_70,[edit1.text]
|
||||
@@:
|
||||
pop eax
|
||||
ret
|
||||
|
||||
;ᮧ<><E1AEA7><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9>
|
||||
align 4
|
||||
but_ctrl_n:
|
||||
push eax
|
||||
call get_wnd_in_focus
|
||||
or eax,eax
|
||||
jz @f
|
||||
stdcall [ted_clear], eax,1
|
||||
stdcall [ted_draw], eax
|
||||
@@:
|
||||
pop eax
|
||||
ret
|
||||
|
||||
;<3B><>।<EFBFBD><E0A5A4>塞 <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> ।<><E0A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> 䮪<><E4AEAA><EFBFBD>
|
||||
align 4
|
||||
get_wnd_in_focus:
|
||||
xor eax,eax
|
||||
cmp dword[el_focus],tedit0
|
||||
jne @f
|
||||
mov eax,tedit0
|
||||
@@:
|
||||
;cmp dword[el_focus],tedit1
|
||||
;jne @f
|
||||
; mov eax,tedit1
|
||||
;@@:
|
||||
ret
|
||||
|
||||
hed db 'TextEditor syntax file converter 18.12.20',0 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
conv_tabl rb 128 ; ⠡<><E2A0A1><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD><EFBFBD> scan-<2D><><EFBFBD><EFBFBD> <20> ascii-<2D><><EFBFBD>
|
||||
|
||||
txt_load_f db '<27><><EFBFBD><EFBFBD>. 䠩<>',0
|
||||
txt_save_f db '<27><><EFBFBD><EFBFBD>. 䠩<>',0
|
||||
txt_inp_file db '<27><><EFBFBD>. 䠩<>:',0
|
||||
txt_out_file db '<27><><EFBFBD>. 䠩<>:',0
|
||||
|
||||
;library structures
|
||||
l_libs_start:
|
||||
lib0 l_libs lib_name_0, file_name, system_dir_0, import_box_lib
|
||||
lib1 l_libs lib_name_1, file_name, system_dir_1, import_libimg
|
||||
load_lib_end:
|
||||
|
||||
IncludeIGlobals
|
||||
|
||||
align 16
|
||||
i_end:
|
||||
IncludeUGlobals
|
||||
procinfo process_information
|
||||
rb 1024
|
||||
thread:
|
||||
rb 1024
|
||||
stacktop:
|
||||
sys_path rb 4096
|
||||
file_name rb 4096
|
||||
file_name_rez rb 4096
|
||||
mem:
|
||||
|