6 Commits

Author SHA1 Message Date
4813b67aaa drivers/usb: fix usbother driver
All checks were successful
Build system / Check kernel codestyle (pull_request) Successful in 1m0s
Build system / Build (pull_request) Successful in 9m10s
Added array of endpoints in DRV_CONTEXT and save params for ioctl API.
2025-06-08 10:11:37 +02:00
b96b78fa96 drivers/usb: fix auto build usbother (part 2) 2025-06-08 10:11:37 +02:00
ab0d02f5f4 drivers/usb: fix auto build usbother 2025-06-08 10:11:37 +02:00
b30a10e419 drivers/usb: add usbother driver and usbdrv.dat config
This driver loading usb drivers for class and for vendor and product id device.
2025-06-08 10:11:37 +02:00
2dfb3ddff3 Implement serial reconf
All checks were successful
Build system / Check kernel codestyle (pull_request) Successful in 26s
Build system / Build (pull_request) Successful in 4m31s
2025-05-22 21:26:05 +05:00
7e63294b5e Post-SVN clean up (#244)
- Move source code from `trunk` into program root directory.
- Fix build and ASM files.
- Translated a few RU comments to en_US.
- Note: Line endings standardised from `CRLF` > `LF`, so best to view diffs with whitespace changes hidden.

(Work towards #75, point 3)

Reviewed-on: #244
Reviewed-by: Gleb Zaharov <risdeveau@codrs.ru>
Reviewed-by: Burer <burer@kolibrios.org>
Co-authored-by: Andrew <dent.ace@gmail.com>
Co-committed-by: Andrew <dent.ace@gmail.com>
2025-05-20 17:36:10 +02:00
153 changed files with 4896 additions and 4074 deletions

View File

@@ -69,6 +69,7 @@ img_files = {
{"SETTINGS/SYSTEM.INI", "common/settings/system.ini"},
{"SETTINGS/TASKBAR.INI", "common/settings/taskbar.ini"},
{"SETTINGS/SYSTEM.ENV", "common/settings/system.env"},
{"SETTINGS/USBDRV.DAT",VAR_DRVS .. "/usb/usbother/usbdrv.dat"},
}
-- For russian build, add russian-only files.
@@ -152,6 +153,9 @@ extra_files = {
{"HD_Load/USB_boot_old/", SRC_PROGS .. "/hd_load/usb_boot_old/usb_boot_866.txt"},
{"HD_Load/USB_boot_old/", SRC_PROGS .. "/hd_load/usb_boot_old/usb_boot_1251.txt"},
{"kolibrios/3D/info3ds/INFO3DS.INI", SRC_PROGS .. "/develop/info3ds/info3ds.ini"},
{"kolibrios/3D/info3ds/OBJECTS.PNG", SRC_PROGS .. "/develop/info3ds/objects.png"},
{"kolibrios/3D/info3ds/TOOLBAR.PNG", SRC_PROGS .. "/develop/info3ds/toolbar.png"},
{"kolibrios/3D/info3ds/FONT8X9.BMP", SRC_PROGS .. "/fs/kfar/trunk/font8x9.bmp"},
{"kolibrios/3D/blocks/blocks.kex", "../programs/bcc32/games/blocks/bin/blocks.kex"},
{"kolibrios/3D/blocks/models/", "../programs/bcc32/games/blocks/models/*"},
{"kolibrios/3D/md2view/", "common/3d/md2view/*"},
@@ -192,8 +196,8 @@ extra_files = {
{"kolibrios/develop/utils/SPEDump", SRC_PROGS .. "/develop/SPEDump/SPEDump.kex"},
{"kolibrios/emul/", "common/emul/*"},
{"kolibrios/emul/dosbox/", "common/emul/DosBox/*"},
{"kolibrios/emul/e80/readme.txt", SRC_PROGS .. "/emulator/e80/trunk/readme.txt"},
{"kolibrios/emul/e80/keyboard.png", SRC_PROGS .. "/emulator/e80/trunk/keyboard.png"},
{"kolibrios/emul/e80/readme.txt", SRC_PROGS .. "/emulator/e80/readme.txt"},
{"kolibrios/emul/e80/keyboard.png", SRC_PROGS .. "/emulator/e80/keyboard.png"},
{"kolibrios/emul/fceu/fceu", SRC_PROGS .. "/emulator/fceu/fceu"},
{"kolibrios/emul/fceu/FCEU ReadMe.txt", SRC_PROGS .. "/emulator/fceu/FCEU ReadMe.txt"},
{"kolibrios/emul/chip8/chip8", VAR_PROGS .. "/emulator/chip8/chip8"},
@@ -281,7 +285,7 @@ extra_files = {
{"kolibrios/netsurf/res/", "common/network/netsurf/res/*"},
{"kolibrios/res/skins/", "../skins/authors.txt"},
{"kolibrios/res/templates/", "common/templates/*"},
{"kolibrios/res/templates/", SRC_PROGS .. "/emulator/e80/trunk/games/*"},
{"kolibrios/res/templates/", SRC_PROGS .. "/emulator/e80/games/*"},
{"kolibrios/res/templates/NES/", "common/templates/NES/*"},
{"kolibrios/res/wallpapers/", "common/wallpapers/*"},
{"kolibrios/res/system/", build_type .. "/settings/kolibri.lbl"},
@@ -406,7 +410,7 @@ tup.append_table(img_files, {
{"HACONFIG", VAR_PROGS .. "/other/ha/HACONFIG"},
{"ACLOCK", VAR_PROGS .. "/demos/aclock/aclock"},
{"APM", VAR_PROGS .. "/system/apm/apm"},
{"CALC", VAR_PROGS .. "/other/calc/trunk/calc"},
{"CALC", VAR_PROGS .. "/other/calc/calc"},
{"CALCPLUS", VAR_PROGS .. "/other/calcplus/calcplus"},
{"CALENDAR", VAR_PROGS .. "/system/calendar/trunk/calendar"},
{"COLRDIAL", VAR_PROGS .. "/system/colrdial/color_dialog"},
@@ -432,7 +436,7 @@ tup.append_table(img_files, {
{"MYKEY", VAR_PROGS .. "/system/MyKey/trunk/MyKey"},
{"PCIDEV", VAR_PROGS .. "/testing/pcidev/trunk/PCIDEV"},
{"RDSAVE", VAR_PROGS .. "/system/rdsave/trunk/rdsave"},
{"RTFREAD", VAR_PROGS .. "/other/rtfread/trunk/rtfread"},
{"RTFREAD", VAR_PROGS .. "/other/rtfread/rtfread"},
{"SEARCHAP", VAR_PROGS .. "/system/searchap/searchap"},
{"SCRSHOOT", VAR_PROGS .. "/media/scrshoot/scrshoot"},
{"SETUP", VAR_PROGS .. "/system/setup/trunk/setup"},
@@ -520,10 +524,10 @@ tup.append_table(img_files, {
{"LIB/RASTERWORKS.OBJ", VAR_PROGS .. "/develop/libraries/fontRasterWorks_unicode/RasterWorks.obj"},
{"LIB/SORT.OBJ", VAR_PROGS .. "/develop/libraries/sorter/sort.obj"},
{"LIB/TINYGL.OBJ", VAR_PROGS .. "/develop/libraries/TinyGL/asm_fork/tinygl.obj"},
{"MEDIA/ANIMAGE", VAR_PROGS .. "/media/animage/trunk/animage"},
{"MEDIA/ANIMAGE", VAR_PROGS .. "/media/animage/animage"},
{"MEDIA/FILLSCR", VAR_PROGS .. "/media/FillScr/fillscr"},
{"MEDIA/KIV", VAR_PROGS .. "/media/kiv/trunk/kiv"},
{"MEDIA/LISTPLAY", VAR_PROGS .. "/media/listplay/trunk/listplay"},
{"MEDIA/KIV", VAR_PROGS .. "/media/kiv/kiv"},
{"MEDIA/LISTPLAY", VAR_PROGS .. "/media/listplay/listplay"},
{"MEDIA/MIDAMP", VAR_PROGS .. "/media/midamp/trunk/midamp"},
{"MEDIA/MP3INFO", VAR_PROGS .. "/media/mp3info/mp3info"},
{"MEDIA/PALITRA", VAR_PROGS .. "/media/palitra/trunk/palitra"},
@@ -564,6 +568,7 @@ tup.append_table(img_files, {
{"DRIVERS/OHCI.SYS", VAR_DRVS .. "/usb/ohci.sys"},
{"DRIVERS/EHCI.SYS", VAR_DRVS .. "/usb/ehci.sys"},
{"DRIVERS/USBHID.SYS", VAR_DRVS .. "/usb/usbhid/usbhid.sys"},
{"DRIVERS/USBOTHER.SYS",VAR_DRVS .. "/usb/usbother/usbother.sys"},
{"DRIVERS/USBSTOR.SYS", VAR_DRVS .. "/usb/usbstor.sys"},
{"DRIVERS/RDC.SYS", VAR_DRVS .. "/video/rdc.sys"},
{"DRIVERS/COMMOUSE.SYS", VAR_DRVS .. "/mouse/commouse.sys"},
@@ -638,7 +643,7 @@ if build_type == "ru_RU" then tup.append_table(img_files, {
}) end
if build_type == "ru_RU" then tup.append_table(extra_files, {
{"kolibrios/utils/period", VAR_PROGS .. "/other/period/trunk/period"},
{"kolibrios/utils/period", VAR_PROGS .. "/other/period/period"},
{"kolibrios/games/Dungeons/Dungeons", VAR_PROGS .. "/games/Dungeons/Dungeons"},
}) end
@@ -749,7 +754,7 @@ tup.append_table(img_files, {
tup.append_table(extra_files, {
-- {"kolibrios/3D/cubeline", VAR_PROGS .. "/demos/cubeline/trunk/cubeline"},
{"kolibrios/3D/gears", VAR_PROGS .. "/demos/gears/gears"},
{"kolibrios/emul/e80/e80", VAR_PROGS .. "/emulator/e80/trunk/e80"},
{"kolibrios/emul/e80/e80", VAR_PROGS .. "/emulator/e80/e80"},
{"kolibrios/emul/uarm/", VAR_CONTRIB .. "/other/uarm/uARM"},
{"kolibrios/games/2048", VAR_PROGS .. "/games/2048/2048"},
{"kolibrios/games/checkers", VAR_PROGS .. "/games/checkers/checkers"},

View File

@@ -1,3 +1,5 @@
SERIAL_COMPATIBLE_API_VER = 0 ; increments in case of breaking changes
SERIAL_API_GET_VERSION = 0
SERIAL_API_SRV_ADD_PORT = 1
SERIAL_API_SRV_REMOVE_PORT = 2
@@ -21,14 +23,18 @@ SERIAL_CONF_PARITY_ODD = 2
SERIAL_CONF_PARITY_MARK = 3
SERIAL_CONF_PARITY_SPACE = 4
SERIAL_CONF_STOP_BITS_1 = 0
SERIAL_CONF_STOP_BITS_1_5 = 1
SERIAL_CONF_STOP_BITS_2 = 2
SERIAL_CONF_FLOW_CTRL_NONE = 0
struct SP_DRIVER
size dd ? ; size of this struct
startup dd ? ; void __stdcall (*startup)(void *drv_data, const struct serial_conf *conf);
shutdown dd ? ; void __stdcall (*shutdown)(void *drv_data);
reconf dd ? ; void __stdcall (*reconf)(void *drv_data, const struct serial_conf *conf);
tx dd ? ; void __stdcall (*tx)(void *drv_data);
startup dd ? ; int __stdcall (*startup)(void *drv_data, const struct serial_conf *conf);
shutdown dd ? ; int __stdcall (*shutdown)(void *drv_data);
reconf dd ? ; int __stdcall (*reconf)(void *drv_data, const struct serial_conf *conf);
tx dd ? ; int __stdcall (*tx)(void *drv_data);
ends
struct SP_CONF
@@ -123,6 +129,30 @@ proc serial_port_init
ret
endp
proc serial_port_get_version stdcall, version:dword
locals
.handler dd ?
.io_code dd ?
.input dd ?
.inp_size dd ?
.output dd ?
.out_size dd ?
endl
mov eax, [serial_drv_handle]
mov [.handler], eax
mov dword [.io_code], SERIAL_API_GET_VERSION
mov [.input], 0
mov dword [.inp_size], 0
mov eax, [version]
mov [.output], eax
mov dword [.out_size], 4
lea ecx, [.handler]
mcall SF_SYS_MISC, SSF_CONTROL_DRIVER
ret
endp
proc serial_port_open stdcall uses ebx, port_id:dword, conf:dword, handle:dword
locals
.handler dd ?

View File

@@ -9,8 +9,6 @@ __DEBUG_LEVEL__ = L_DBG
SERIAL_RING_BUF_SIZE = 32768
API_VERSION = 1
section '.flat' readable writable executable
include '../struct.inc'
@@ -23,6 +21,9 @@ include 'common.inc'
include 'ring_buf.inc'
include 'uart16550.inc'
CURRENT_API = 0x0001
API_VERSION = (SERIAL_COMPATIBLE_API_VER shl 16) + CURRENT_API
struct SERIAL_OBJ
magic dd ?
destroy dd ?
@@ -45,7 +46,7 @@ struct SERIAL_PORT
conf SP_CONF
ends
proc START c, reason:dword
proc START c, reason:dword, cmdline:dword
cmp [reason], DRV_ENTRY
jne .fail
@@ -347,15 +348,12 @@ proc sp_validate_conf
mov eax, [ecx + SP_CONF.baudrate]
test eax, eax
jz .fail
mov al, [ecx + SP_CONF.word_size]
cmp al, 8
jne .fail ; TODO implement different word size
mov al, [ecx + SP_CONF.stop_bits]
cmp al, 1
jne .fail ; TODO implement different stop bits count
cmp al, SERIAL_CONF_STOP_BITS_2
ja .fail
mov al, [ecx + SP_CONF.parity]
cmp al, SERIAL_CONF_PARITY_NONE
jne .fail ; TODO implement parity
cmp al, SERIAL_CONF_PARITY_SPACE
ja .fail
mov al, [ecx + SP_CONF.flow_ctrl]
cmp al, SERIAL_CONF_FLOW_CTRL_NONE
jne .fail ; TODO implement flow control
@@ -550,7 +548,6 @@ proc sp_setup
mov eax, [edi + SERIAL_PORT.drv]
mov ecx, [edi + SERIAL_PORT.drv_data]
stdcall dword [eax + SP_DRIVER.reconf], ecx, esi
xor eax, eax
push eax
test eax, eax
jnz @f

View File

@@ -350,10 +350,10 @@ endl
; calc stop bits
mov bx, LCR_STOP_1
mov al, [esi + SP_CONF.stop_bits]
cmp al, 1
cmp al, SERIAL_CONF_STOP_BITS_1
je .stop_bits_ok
or bx, LCR_STOP_2
cmp al, 2
cmp al, SERIAL_CONF_STOP_BITS_2
jne .fail
.stop_bits_ok:
or [lcr], bx

View File

@@ -1123,11 +1123,53 @@ proc uart_shutdown stdcall uses ebx, data:dword
ret
endp
proc uart_reconf stdcall uses ebx esi, dev:dword, conf:dword
mov ebx, [dev]
proc uart_reconf stdcall uses esi, dev:dword, conf:dword
locals
ConfPacket rb 8
endl
mov esi, [conf]
stdcall ftdi_set_baudrate, ebx, [esi + SP_CONF.baudrate]
; TODO set word_size, parity, etc.
xor edx, edx
mov al, [esi + SP_CONF.word_size]
cmp al, 7
jb .invalid
cmp al, 8
ja .invalid
mov dl, al
; odd and even parities are different from serial api
; serial api: even=1 odd=2
; ft232x api: odd=1 even=2
movzx eax, [esi + SP_CONF.parity]
cmp al, SERIAL_CONF_PARITY_SPACE
ja .invalid
cmp al, SERIAL_CONF_PARITY_ODD
ja .parity_ok
cmp al, SERIAL_CONF_PARITY_EVEN
jb .parity_ok
; swap bits
xor al, 0x3
.parity_ok:
shl eax, 8 ; parity offset
or edx, eax
movzx eax, [esi + SP_CONF.stop_bits]
cmp al, SERIAL_CONF_STOP_BITS_2
ja .invalid
shl eax, 11 ; stop bits offset
or edx, eax
mov word [ConfPacket], (FTDI_DEVICE_OUT_REQTYPE) \
+ (SIO_SET_DATA shl 8)
mov word [ConfPacket + 2], dx
mov word [ConfPacket + 4], 0
mov word [ConfPacket + 6], 0
lea edx, [ConfPacket]
stdcall ftdi_blocking_ctrl_tranfser, [dev], edx
test eax, eax
jnz .exit
stdcall ftdi_set_baudrate, [dev], [esi + SP_CONF.baudrate]
ret
.invalid:
or eax, -1
.exit:
ret
endp
@@ -1204,17 +1246,10 @@ proc uart_rx stdcall uses ebx esi, data:dword
ret
endp
proc ftdi_set_baudrate stdcall uses ebx esi edi, dev:dword, baud:dword
proc ftdi_set_baudrate stdcall uses ebx, dev:dword, baud:dword
locals
ConfPacket rb 10
EventData rd 3
ConfPacket rb 8
endl
xor esi, esi
xor ecx, ecx
invoke CreateEvent
mov [EventData], eax
mov [EventData + 4], edx
mov ebx, [dev]
cmp [ebx + ftdi_context.chipType], TYPE_2232H
jl .c_clk
@@ -1257,7 +1292,7 @@ endl
jmp .calcend
.c_nextbaud2:
cmp dword [edi + 8], C_CLK / (2 * 16)
cmp dword [baud], C_CLK / (2 * 16)
jl .c_nextbaud3
mov edx, 2
mov ecx, C_CLK / (2 * 16)
@@ -1348,16 +1383,40 @@ endl
mov word [ConfPacket + 4], cx
mov word [ConfPacket + 6], 0
lea esi, [ConfPacket]
lea ebx, [ConfPacket]
stdcall ftdi_blocking_ctrl_tranfser, [dev], ebx
ret
endp
proc ftdi_blocking_ctrl_tranfser stdcall uses ebx esi edi, dev:dword, conf:dword
; conf is a pointer to values: bmRequestType, bRequest, wValue, wIndex, wLength
locals
EventData rd 3
endl
xor esi, esi
xor ecx, ecx
invoke CreateEvent
test eax, eax
jz .exit
mov [EventData], eax
mov [EventData + 4], edx
mov eax, [dev]
mov esi, [conf]
lea edi, [EventData]
invoke USBControlTransferAsync, [ebx + ftdi_context.nullP], esi, 0,\
invoke USBControlTransferAsync, [eax + ftdi_context.nullP], esi, 0,\
0, control_callback, edi, 0
test eax, eax
jz .error
mov eax, [EventData]
mov ebx, [EventData + 4]
invoke WaitEvent
cmp [EventData + 8], 0 ; USB_STATUS_OK
jne .error
mov eax, [EventData]
mov ebx, [EventData + 4]
invoke DestroyEvent
@@ -1365,6 +1424,10 @@ endl
ret
.error:
mov eax, [EventData]
mov ebx, [EventData + 4]
invoke DestroyEvent
.exit:
or eax, -1
ret
endp

View File

@@ -0,0 +1,4 @@
if tup.getconfig("NO_FASM") ~= "" then return end
ROOT = "../../.."
tup.rule("usbother.asm", "fasm %f %o " .. tup.getconfig("PESTRIP_CMD") .. tup.getconfig("KPACK_CMD"), "%B.sys")
tup.rule("usbdrv.asm", "fasm %f %o ", "%B.dat")

View File

@@ -0,0 +1,214 @@
;*****************************************************************************;
; Copyright (C) 2025, Mikhail Frolov aka Doczom . All rights reserved. ;
; Distributed under terms of the 3-Clause BSD License. ;
;*****************************************************************************;
; File of usb drivers
; base = 0
; offset | Size | Name | Description
;=======================|=======|===============|=============================
; base + 0 | 4 | ID_drv_table | offset to dev_ven drv array
; base + 4 | 4 | Class_table | offset to class drv array
;
; n = 0 .. count driver with ID table
; nt = count driver with ID table
; ID_drv_table + 0*(n-1)| 4 | ID_TABLE | offset of base to table VID:PID
; ID_drv_table + 4*(n-1)| 4 | DRV_NAME | offset of base to name the driver
; ID_drv_table + 8*nt | 8 | __ZERO | terminaror of list
; k = 0 .. count driver on class code
; kt = count driver on class code
; Class_table + 0*(k-1) | 1 | LENGTH_CLASS | length of class code 1..3
; Class_table + 1*(k-1) | 1 | USB_CLASS | main usb class code (M)
; Class_table + 2*(k-1) | 1 | USB_SUBCLASS | USB subclass code or zero(V)
; Class_table + 2*(k-1) | 1 | USB_PROTOCOL | USB protocol code or zero(V)
; Class_table + 4*(k-1) | 4 | DRV_NAME | offset of base to name the driver
; Class_table + 8*kt | 8 | __ZERO | terminaror of list
; i = 0 .. count VID:PID
; it = count VID:PID
; ID_TABLE + 0*(i-1) | 2 | VID | Vendor id
; ID_TABLE + 2*(i-1) | 2 | PID | Product id
; ID_TABLE + 4*it | 4 | __ZERO | terminaror of list
macro INIT_USBDRV_FILE {
local ..id_list, ..class_list
format binary as 'dat'
use32
org 0
dd ..id_list
dd ..class_list
macro ID_DRV_TABLE \{
dd 0, 0
\}
macro CLASS_TABLE \{
dd 0, 0
\}
macro ID_TABLE \{
\}
macro DRV_NAME_LIST \{
\}
postpone \{
..id_list: ID_DRV_TABLE
..class_list: CLASS_TABLE
ID_TABLE
DRV_NAME_LIST
\}
}
macro ADD_CLASS drv_name, class, subclass, protocol {
local ..length, ..class_code, ..drv_name
..length = 3
match =X, class \{
err 'Class is mandatory argument'
\}
match =X, protocol \{
..length = 2
\}
match =X, subclass \{
..length = 1
\}
..class_code = ..length or (class shl 8)
if ..length = 3
..class_code = ..class_code or (protocol shl 24)
end if
if ..length = 2
..class_code = ..class_code or (subclass shl 16)
end if
; add in list
macro DRV_NAME_LIST \{
..drv_name: db drv_name, 0
DRV_NAME_LIST
\}
macro CLASS_TABLE \{
dd ..class_code, ..drv_name
CLASS_TABLE
\}
}
macro ADD_ID drv_name, [device_id] {
common
local ..drv_name, ..id_table
macro ID_TABLE \{
ID_TABLE
..id_table:
\}
reverse
local vid_pid
match VID:PID, device_id \{
vid_pid = (PID shl 16) + VID
\}
macro ID_TABLE \{
ID_TABLE
dd vid_pid
\}
common
macro ID_TABLE \{
ID_TABLE
dd 0
\}
macro DRV_NAME_LIST \{
..drv_name: db drv_name, 0
DRV_NAME_LIST
\}
macro ID_DRV_TABLE \{
dd ..id_table, ..drv_name
ID_DRV_TABLE
\}
}
; ADD ID driver Linux
macro ADD_IDL drv_name, [vendor_id, device_id] {
common
local ..drv_name, ..id_table
macro ID_TABLE \{
ID_TABLE
..id_table:
\}
reverse
local vid_pid
vid_pid = (device_id shl 16) + vendor_id
macro ID_TABLE \{
ID_TABLE
dd vid_pid
\}
common
macro ID_TABLE \{
ID_TABLE
dd 0
\}
macro DRV_NAME_LIST \{
..drv_name: db drv_name, 0
DRV_NAME_LIST
\}
macro ID_DRV_TABLE \{
dd ..id_table, ..drv_name
ID_DRV_TABLE
\}
}
INIT_USBDRV_FILE
;ADD_CLASS 'usbcdc-ctrl' , 0x02, X , X
;ADD_CLASS 'usbimage' , 0x06, 1 , 1
;ADD_CLASS 'usbcdc-data' , 0x0A, X , X
;ADD_CLASS 'ccid' , 0x0B, X , X
;ADD_CLASS 'uvd' , 0x0E, X , X
;ADD_CLASS 'uvd_2' , 0x0E, 0x02, X
;ADD_CLASS 'usb_bluetooth' , 0xE0, 0x01, X
;ADD_CLASS 'usb_wifi' , 0xE0, 0x02, X
ADD_ID 'usbftdi',\
0x0403:0 ; Any FTDI device
;https://github.com/avrdudes/avrdude/blob/main/src/usbdevs.h#L51
;ADD_ID 'usbasp',\
; 0x16c0:0x05dc,\ ; VOTI Obdev's free shared PID
; 0x03e8:0xc7b4,\ ; ATMEL (unofficial) USBasp
; 0x16c0:0x092f ; VOTI NIBObee PID
;https://github.com/WCHSoftGroup/ch341par_linux/blob/main/driver/ch34x_pis.c
;ADD_IDL 'ch341par',\
; 0x1a86, 0x5512,\ ; ch341a default
; 0x1a86, 0x55db,\ ; CH347T Mode1 SPI+IIC+UART
; 0x1a86, 0x55dd,\ ; CH347T Mode3 JTAG+UART
; 0x1a86, 0x55de,\ ; CH347F
; 0x1a86, 0x55e7 ; CH339W
;https://github.com/openbsd/src/blob/master/sys/dev/usb/uchcom.c
;https://github.com/WCHSoftGroup/ch341ser_linux/blob/main/driver/ch341.c
;ADD_IDL 'ch341ser',\
; 0x1a86, 0x7523,\ ; ch340 chip
; 0x1a86, 0x7522,\ ; ch340k chip
; 0x1a86, 0x5523,\ ; ch341 chip
; 0x1a86, 0xe523,\ ; ch330 chip
; 0x4348, 0x5523 ; ch340 custom chip

View File

@@ -0,0 +1,523 @@
;*****************************************************************************;
; Copyright (C) 2025, Mikhail Frolov aka Doczom . All rights reserved. ;
; Distributed under terms of the 3-Clause BSD License. ;
; ;
; usbother is a driver for loading USB drivers of a certain class and vendor. ;
; ;
; Version 0.1.1, 24 May 2025 ;
; ;
;*****************************************************************************;
format PE native 0.05
entry START
; const
DRV_VERSION = 0x0101 ; 0.1.1
; struct
include '../../struct.inc'
; USB device descriptor
struct DEVICE_DESCR
bLength db ?
bDescriptorType db ?
bcdUSB dw ?
bDeviceClass db ?
bDeviceSubClass db ?
bDeviceProtocol db ?
bMaxPacketSize0 db ?
idVendor dw ?
idProduct dw ?
bcdDevice dw ?
iManufacturer db ?
iProduct db ?
iSerialNumber db ?
bNumConfigurations db ?
ends
struct INTERFACE_DESCR
bLength db ?
bDescriptorType db ?
bInterfaceNumber db ?
bAlternateSetting db ?
bNumEndpoints db ?
bInterfaceClass db ?
bInterfaceSubClass db ?
bInterfaceProtocol db ?
iInterface db ?
ends
struct SRV
srv_name rb 16 ;ASCIIZ string
magic dd ? ;+0x10 ;'SRV '
size dd ? ;+0x14 ;size of structure SRV
fd dd ? ;+0x18 ;next SRV descriptor
bk dd ? ;+0x1C ;prev SRV descriptor
base dd ? ;+0x20 ;service base address
entry dd ? ;+0x24 ;service START function
srv_proc dd ? ;+0x28 ;user mode service handler
srv_proc_ex dd ? ;+0x2C ;kernel mode service handler
ends
struct USBSRV
srv SRV
usb_func dd ?
ends
struct USBFUNC
strucsize dd ?
add_device dd ?
device_disconnect dd ?
ends
USBDRV_TYPE_NOLOCK = 0 ; usb device not controlled (native driver
; not found and IOCTL not opened device)
USBDRV_TYPE_NATIVE = 1 ; native PE kernel driver for usb
USBDRV_TYPE_IOCTL = 2 ; usb device is controlled by IOCTL service
; (driver or userspace process/threads)
USBDRV_IOCTL_BLOCKED = 4 ; blocked IOCTL interface, device disconnected
struct DRV_CONTEXT
next dd ?
prev dd ?
drv_hand dd ?
drv_pdata dd ?
flags dd ?
config_descr dd ?
interface_descr dd ?
ep rd 64 ; 32 IN + 32 OUT endpointers pipe
ends
DRV_CONTEXT.ep0 fix (DRV_CONTEXT.ep + 0)
section '.flat' code readable writable executable
include '../../proc32.inc'
include '../../peimport.inc'
include '../../macros.inc'
proc START c, state:dword, cmdline:dword
cmp [state], DRV_ENTRY
jne .end
; init
mov ecx, drv_list_lock
invoke MutexInit
mov ecx, interface_list_lock
invoke MutexInit
; load drv_list
stdcall load_drv_list, default_list
test eax, eax
jnz .end
; reg driver
invoke RegUSBDriver, drv_name, service_proc, usb_functions
ret
.end:
xor eax, eax
ret
endp
proc load_drv_list stdcall, .path:dword
push ebx
mov ecx, drv_list_lock
invoke MutexLock
; load file
invoke LoadFile, [.path]
test eax, eax
push eax
jnz @f
mov dword[esp], -1
jmp .exit
@@:
cmp [drv_list], 0
jz @f
invoke KernelFree, [drv_list]
@@:
mov eax,[esp]
mov [drv_list], eax
mov dword[esp], 0
.exit:
mov ecx, drv_list_lock
invoke MutexUnlock
pop eax
pop ebx
ret
endp
proc service_proc stdcall, .ioctl:dword
push esi
or eax, -1
mov esi, [.ioctl]
mov ecx, [esi + IOCTL.io_code]
cmp ecx, .count_ioctl_codes
jae .fail
jmp dword[.table_subfunction + ecx*4]
.table_subfunction:
dd .get_version
dd .update_list
dd .get_array_dev
dd .get_full_dev_data
dd .open_dev
dd .close_dev
dd .control_transfer
dd .bulk_transfer
dd .interrupt_transfer
;dd .control_transfer_async
;dd .bulk_transfer_async
;dd .interrupt_transfer_async
.count_ioctl_codes = ($ - .table_subfunction)/4
.get_version:
mov eax, [esi + IOCTL.output]
cmp [esi + IOCTL.out_size], 4
jne .fail
mov dword[eax], DRV_VERSION
xor eax, eax
jmp .exit
.update_list:
; update list
mov ecx, [esi + IOCTL.input]
cmp [esi + IOCTL.inp_size], 0
jnz @f
mov ecx, default_list
@@:
stdcall load_drv_list, ecx
.exit:
pop esi
ret
.get_array_dev:
.get_full_dev_data:
.open_dev:
.close_dev:
;
.control_transfer:
.bulk_transfer:
.interrupt_transfer:
.fail:
or eax, -1
jmp .exit
endp
proc AddDevice stdcall, .config_pipe:dword, \
.config_descr:dword,\
.interface:dword
push esi edi
mov eax, sizeof.DRV_CONTEXT
invoke Kmalloc
test eax, eax
jz .err_init
mov esi, eax
mov ecx, interface_list_lock
invoke MutexLock
mov edx, [usb_interface_list] ; next
mov [esi + DRV_CONTEXT.next], edx
mov [esi + DRV_CONTEXT.prev], usb_interface_list
mov [usb_interface_list], esi
mov [edx + DRV_CONTEXT.prev], esi
mov ecx, interface_list_lock
invoke MutexUnlock
and [esi + DRV_CONTEXT.drv_hand], 0
mov [esi + DRV_CONTEXT.flags], USBDRV_TYPE_NOLOCK
; lock mutex
mov ecx, drv_list_lock
invoke MutexLock
; save device context data
mov eax, [.config_pipe]
mov [esi + DRV_CONTEXT.ep0], eax
mov eax, [.config_descr]
mov [esi + DRV_CONTEXT.config_descr], eax
mov eax, [.interface]
mov [esi + DRV_CONTEXT.interface_descr], eax
; get pointer to list
mov edx, [drv_list]
test edx, edx
jz .err_exit
mov edi, edx
add edi, [edx]
; get in ecx VID:PID code
invoke USBGetParam, [.config_pipe], 0
mov ecx, dword[eax + DEVICE_DESCR.idVendor]
.loop_id_drv:
cmp dword[edi], 0
jz .end_loop_id_drv
mov edx, [drv_list]
add edx, [edi] ; ID_TABLE
.loop_id:
cmp dword[edx], 0
jz .end_loop_id
; check id
mov eax, ecx
test word[edx + 2], 0xffff
jne @f
; driver for all devices of VID
and eax, 0xffff
@@:
cmp [edx], eax ; check VID:PID
je @f
add edx, 4
jmp .loop_id
@@: ; found
call .load_drv
jnz .exit
add edx, 4
jmp .loop_id
.end_loop_id:
add edi, 8
jmp .loop_id_drv
.end_loop_id_drv:
push esi
mov esi, str_1
invoke SysMsgBoardStr
pop esi
; get in ecx class code
mov eax, [.interface]
mov ecx, dword[eax + INTERFACE_DESCR.bInterfaceClass] ; 24-31bits
mov edi, [drv_list]
add edi, [edi + 4]
.loop_class:
cmp dword[edi], 0
jz .end_loop_class
; check class
movzx eax, byte[edi] ; length
and eax, 11b ; protect - max length = 3
lea eax, [eax*8] ; 1 = 8; 2 = 16; 3 = 24
xor edx, edx
bts edx, eax
dec edx ; bitmask
mov eax, [edi]
shr eax, 8
and eax, edx ; good class in list
and edx, ecx ; good class of device
cmp eax, edx
je @f
add edi, 8
jmp .loop_class
@@: ; found
call .load_drv
jnz .exit
add edi, 8
jmp .loop_class
; IN: edi - item list of driver
; esi - DRV_CONTEXT
; OUT: ZF - not found zF - found
; function save drv handl in DRV_CONTEXT.drv_hand
; and pdata in DRV_CONTEXT.drv_pdata
.load_drv:
push ecx edx
; load driver
push esi
mov esi, str_2
invoke SysMsgBoardStr
pop esi
mov ecx, [drv_list]
add ecx, [edi + 4]
pusha
mov esi, ecx
invoke SysMsgBoardStr
mov esi, str_newline
invoke SysMsgBoardStr
popa
invoke GetService, ecx
test eax, eax
jz @f
mov [esi + DRV_CONTEXT.drv_hand], eax
; get function list
mov ecx, [eax + USBSRV.usb_func]
; call AddDevice of driver
stdcall [ecx + USBFUNC.add_device], [.config_pipe], \
[.config_descr],\
[.interface]
mov [esi + DRV_CONTEXT.drv_pdata], eax
test eax, eax
jnz .load_drv.good
push esi
mov esi, str_4
invoke SysMsgBoardStr
pop esi
and [esi + DRV_CONTEXT.drv_hand], 0
@@:
pushf
push esi
mov esi, str_5
invoke SysMsgBoardStr
pop esi
popf
pop edx ecx
retn
.load_drv.good:
pushf
push esi
mov esi, str_3
invoke SysMsgBoardStr
pop esi
popf
mov [esi + DRV_CONTEXT.flags], USBDRV_TYPE_NATIVE
pop edx ecx
retn
.err_exit:
mov eax, esi
invoke Kfree
xor esi, esi
.end_loop_class:
.exit:
; driver not found - Added libusb driver
; unlock mutex
mov ecx, drv_list_lock
invoke MutexUnlock
mov eax, esi
pop edi esi
ret
.err_init:
xor eax, eax
pop edi esi
ret
endp
proc DeviceDisconnected stdcall, .pdata:dword
mov eax, [.pdata]
test [eax + DRV_CONTEXT.flags], USBDRV_TYPE_NATIVE
jz .no_native
cmp [eax + DRV_CONTEXT.drv_hand], 0
jz .free
; call device disconnected
mov ecx, [eax + DRV_CONTEXT.drv_hand]
mov edx, [ecx + USBSRV.usb_func]
cmp dword[edx], USBFUNC.device_disconnect
jbe .free ; TODO: check
stdcall [edx + USBFUNC.device_disconnect], [eax + DRV_CONTEXT.drv_pdata]
.free:
; clear list of DRV_CONTENT
mov ecx, interface_list_lock
invoke MutexLock
mov eax, [.pdata]
mov edx, [eax + DRV_CONTEXT.prev]
mov ecx, [eax + DRV_CONTEXT.next]
mov [edx + DRV_CONTEXT.next], ecx
mov [ecx + DRV_CONTEXT.prev], edx
mov ecx, interface_list_lock
invoke MutexUnlock
; free context
mov eax, [.pdata]
invoke Kfree
ret
.no_native:
test [eax + DRV_CONTEXT.flags], USBDRV_TYPE_IOCTL
jz .free
; set state for block user api and clear struct
or [eax + DRV_CONTEXT.flags], USBDRV_IOCTL_BLOCKED
xor ecx, ecx
;mov [eax + DRV_CONTEXT.drv_hand], ecx
;mov [eax + DRV_CONTEXT.drv_pdata], ecx
mov [eax + DRV_CONTEXT.config_descr], ecx
mov [eax + DRV_CONTEXT.interface_descr], ecx
mov [eax + DRV_CONTEXT.ep0], ecx
; TODO
jmp .free
endp
; data
drv_list_lock MUTEX
drv_list dd ?
interface_list_lock MUTEX
usb_interface_list:
dd usb_interface_list
dd usb_interface_list
usb_functions:
dd .end - usb_functions
dd AddDevice
dd DeviceDisconnected
.end:
drv_name db 'usbother', 0
default_list: db '/sys/settings/usbdrv.dat', 0
str_1: db 'USBOTHER: Not found ID driver', 13, 10, 0
str_2: db 'USBOTHER: Check found driver: ', 0, 13, 10, 0
str_3: db 'USBOTHER: Device driver good', 13, 10, 0
str_4: db 'USBOTHER: Device driver fail prob', 13, 10, 0
str_5: db 'USBOTHER: Load device driver error', 13, 10, 0
str_newline: db 13,10,0
data fixups
end data

View File

@@ -154,16 +154,16 @@ echo *
echo Building other
echo *
rem fasm other\archer\trunk\@rcher.asm %BIN%\@rcher
fasm other\calc\trunk\calc.asm %BIN%\calc
fasm other\calc\calc.asm %BIN%\calc
fasm other\mhc\trunk\mhc.asm %BIN%\mhc
fasm other\period\trunk\period.asm %BIN%\period
fasm other\rtfread\trunk\rtfread.asm %BIN%\rtfread
fasm other\period\period.asm %BIN%\period
fasm other\rtfread\rtfread.asm %BIN%\rtfread
echo *
echo Building media
echo *
rem media\ac97snd\trunk\ac97snd.asm ac97snd
fasm media\animage\trunk\animage.asm %BIN%\animage
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
@@ -231,9 +231,9 @@ echo *
echo Building depend application for fdd's nightbuild
echo *
echo __nightbuild fix yes >> config.inc
fasm media\kiv\trunk\kiv.asm %BIN%\nightbuild\kiv
fasm media\kiv\kiv.asm %BIN%\nightbuild\kiv
fasm media\scrshoot\scrshoot.asm %BIN%\nightbuild\scrshoot
fasm media\animage\trunk\animage.asm %BIN%\nightbuild\animage
fasm media\animage\animage.asm %BIN%\nightbuild\animage
fasm media\midamp\trunk\midamp.asm %BIN%\nightbuild\midamp
fasm develop\heed\trunk\heed.asm %BIN%\nightbuild\heed
fasm develop\tinypad\trunk\tinypad.asm %BIN%\nightbuild\tinypad
@@ -242,7 +242,7 @@ fasm system\hdd_info\trunk\hdd_info.asm %BIN%\nightbuild\hdd_info
fasm system\mgb\trunk\mgb.asm %BIN%\nightbuild\mgb
fasm system\rdsave\trunk\rdsave.asm %BIN%\nightbuild\rdsave
fasm other\kpack\trunk\kpack.asm %BIN%\nightbuild\kpack
fasm other\rtfread\trunk\rtfread.asm %BIN%\nightbuild\rtfread
fasm other\rtfread\rtfread.asm %BIN%\nightbuild\rtfread
;restore
echo __CPU_type fix %res% > config.inc
erase lang.inc

View File

@@ -2,6 +2,9 @@ if not exist bin mkdir bin
@erase lang.inc
@echo lang fix en_US >lang.inc
@copy objects.png bin\objects.png
if not exist bin\info3ds.ini @copy info3ds.ini bin\info3ds.ini
if not exist bin\toolbar.png @copy toolbar.png bin\toolbar.png
if not exist bin\font8x9.bmp @copy ..\..\fs\kfar\trunk\font8x9.bmp bin\font8x9.bmp
@fasm.exe -m 16384 info3ds.asm bin\info3ds.kex
@kpack bin\info3ds.kex
@fasm.exe -m 16384 info3ds_u.asm bin\info3ds_u.kex

View File

@@ -2,6 +2,9 @@ if not exist bin mkdir bin
@erase lang.inc
@echo lang fix ru_RU >lang.inc
@copy objects.png bin\objects.png
if not exist bin\info3ds.ini @copy info3ds.ini bin\info3ds.ini
if not exist bin\toolbar.png @copy toolbar.png bin\toolbar.png
if not exist bin\font8x9.bmp @copy ..\..\fs\kfar\trunk\font8x9.bmp bin\font8x9.bmp
@fasm.exe -m 16384 info3ds.asm bin\info3ds.kex
@kpack bin\info3ds.kex
@fasm.exe -m 16384 info3ds_u.asm bin\info3ds_u.kex

View File

@@ -1,10 +1,6 @@
; SPDX-License-Identifier: GPL-2.0-only
; Info3ds - is a program for viewing the structure of *.3ds files
; Copyright (C) 2011-2025 KolibriOS team
use32
org 0
db 'MENUET01'
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
version_edit equ 1
@@ -26,34 +22,36 @@ include 'convert_stl_3ds.inc'
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
ID_ICON_CHUNK_MAIN equ 0 ;main block icon
ID_ICON_CHUNK_NOT_FOUND equ 1 ;unknown block icon
ID_ICON_DATA equ 2 ;icon for block data, undefined structure
ID_ICON_CHUNK_MAIN equ 0 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
ID_ICON_CHUNK_NOT_FOUND equ 1 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E2ADAE> <20><><EFBFBD><EFBFBD><EFBFBD>
ID_ICON_DATA equ 2 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><> <20><><EFBFBD><E0A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ID_ICON_POINT equ 8
ID_ICON_POINT_SEL equ 9
FILE_ERROR_CHUNK_SIZE equ -3 ;block size error
FILE_ERROR_CHUNK_SIZE equ -3 ;<EFBFBD><EFBFBD><EFBFBD> <20><><E0A0A7><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
include 'info_o3d.inc'
main_wnd_height equ 460 ;height of the main program window
main_wnd_height equ 460 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC>
IMAGE_TOOLBAR_ICON_SIZE equ 21*21*3
align 4
fl255 dd 255.0
open_file_data dd 0 ;pointer to memory for opening 3ds files
open_file_size dd 0
open_file_data dd 0 ;<EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E4A0A9><EFBFBD> 3ds
open_file_size dd 0 ;ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E4A0A9>
image_data_toolbar dd 0
icon_tl_sys dd 0 ;pointer to memory for storing system icons
icon_toolbar dd 0 ;pointer to memory for storing object icons
level_stack dd 0
offs_last_timer dd 0 ;last shift shown in timer function
icon_tl_sys dd 0 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><EFBFBD><E0A0AD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E2A5AC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
icon_toolbar dd 0 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><EFBFBD><E0A0AD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ꥪ⮢
fn_toolbar db 'toolbar.png',0
align 4
file_3ds: ;variables used when opening a file
.offs: dd 0 ;+0 pointer to the beginning of the block
.size: dd 0 ;+4 block size (for 1st parameter = 3ds file size)
level_stack dd 0
offs_last_timer dd 0 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E1A4A2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20>㭪樨 ⠩<><E2A0A9><EFBFBD><EFBFBD>
align 4
file_3ds: ;<3B><><EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E1AFAE><EFBFBD><EFBFBD><E3A5AC> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>⨨ 䠩<><E4A0A9>
.offs: dd 0 ;+0 㪠<><E3AAA0><EFBFBD> <20><> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
.size: dd 0 ;+4 ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD> 1-<2D><> <20><><EFBFBD><E0A0AC><EFBFBD><EFBFBD> = ࠧ<><E0A0A7><EFBFBD><><E4A0A9> 3ds)
rb 8*MAX_FILE_LEVEL
size_one_list equ 42
@@ -83,7 +81,7 @@ start:
stosd
load_libraries l_libs_start,l_libs_end
;checking how successfully the libraries were loaded
;<EFBFBD><EFBFBD><20><><>쪮 㤠筮 <20><><EFBFBD><EFBFBD><E3A7A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mov ebp,lib_0
.test_lib_open:
cmp dword [ebp+ll_struc_size-4],0
@@ -96,7 +94,7 @@ start:
mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
mcall SF_SET_EVENTS_MASK,0xC0000027
stdcall [OpenDialog_Init],OpenDialog_data ;preparation of dialogue
stdcall [OpenDialog_Init],OpenDialog_data ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
;kmenu initialisation
stdcall [kmenu_init],sc
@@ -145,68 +143,70 @@ start:
stdcall [tl_data_init], tree1
;<3B><><EFBFBD><EFBFBD><E2A5AC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 16*16 <20><><EFBFBD> tree_list
include_image_file 'tl_sys_16.png', icon_tl_sys
mov eax,[icon_tl_sys]
mov [tree1.data_img_sys],eax
;<3B><20><><EFBFBD><EFBFBD><EFBFBD><E0A0A6><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EBABAE>, <20><> <20> icon_tl_sys <20><><EFBFBD><EFBFBD><EFBFBD>
;<3B><> <20><><EFBFBD><EFBFBD><E6A8A0><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><> <20><EFBFBD><E8A8A1> <20><> <20><EFBFBD>, <20>. <20>. <20><><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E3A6AD><EFBFBD><><E0A0A7><EFBFBD><EFBFBD>
mov eax,dword[icon_tl_sys]
mov dword[tree1.data_img_sys],eax
include_image_file 'objects.png', icon_toolbar
mov eax,[icon_toolbar]
mov [tree1.data_img],eax
load_image_file 'objects.png', icon_toolbar
mov eax,dword[icon_toolbar]
mov dword[tree1.data_img],eax
stdcall [buf2d_create], buf_0 ;ᮧ<><E1AEA7><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
include_image_file '../../fs/kfar/trunk/font8x9.bmp', image_data_toolbar
load_image_file 'font8x9.bmp', image_data_toolbar
stdcall [buf2d_create_f_img], buf_1,[image_data_toolbar] ;ᮧ<><E1AEA7><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
stdcall mem.Free,[image_data_toolbar] ;<3B><EFBFBD><E1A2AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
stdcall [buf2d_conv_24_to_8], buf_1,1 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E0AEA7><EFBFBD><E7ADAE><EFBFBD> 8 <20><><EFBFBD>
stdcall [buf2d_convert_text_matrix], buf_1
include_image_file 'toolbar.png', image_data_toolbar
load_image_file fn_toolbar, image_data_toolbar
;ࠡ<><E0A0A1><EFBFBD> <20><><E4A0A9><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
copy_path ini_name,sys_path,file_name,0
mov dword[def_dr_mode],0
stdcall [ini_get_int],file_name,ini_sec_w3d,key_dv,1
stdcall dword[ini_get_int],file_name,ini_sec_w3d,key_dv,1
or eax,eax
jz @f
or dword[def_dr_mode], 1 shl bit_vertexes
@@:
stdcall [ini_get_int],file_name,ini_sec_w3d,key_df,1
stdcall dword[ini_get_int],file_name,ini_sec_w3d,key_df,1
or eax,eax
jz @f
or dword[def_dr_mode], 1 shl bit_faces
@@:
stdcall [ini_get_int],file_name,ini_sec_w3d,key_dff,1
stdcall dword[ini_get_int],file_name,ini_sec_w3d,key_dff,1
or eax,eax
jz @f
or dword[def_dr_mode], 1 shl bit_faces_fill
@@:
stdcall [ini_get_int],file_name,ini_sec_w3d,key_dl,1
stdcall dword[ini_get_int],file_name,ini_sec_w3d,key_dl,1
or eax,eax
jz @f
or dword[def_dr_mode], 1 shl bit_light
@@:
stdcall [ini_get_int],file_name,ini_sec_w3d,key_ds,1
stdcall dword[ini_get_int],file_name,ini_sec_w3d,key_ds,1
or eax,eax
jz @f
or dword[def_dr_mode], 1 shl bit_smooth
@@:
stdcall [ini_get_color],file_name,ini_sec_w3d,key_ox,0x0000ff
stdcall dword[ini_get_color],file_name,ini_sec_w3d,key_ox,0x0000ff
mov [color_ox],eax
stdcall [ini_get_color],file_name,ini_sec_w3d,key_oy,0xff0000
stdcall dword[ini_get_color],file_name,ini_sec_w3d,key_oy,0xff0000
mov [color_oy],eax
stdcall [ini_get_color],file_name,ini_sec_w3d,key_oz,0x00ff00
stdcall dword[ini_get_color],file_name,ini_sec_w3d,key_oz,0x00ff00
mov [color_oz],eax
stdcall [ini_get_color],file_name,ini_sec_w3d,key_bk,0x000000
stdcall dword[ini_get_color],file_name,ini_sec_w3d,key_bk,0x000000
mov [color_bk],eax
shr eax,8
mov [color_bk+4],eax
shr eax,8
mov [color_bk+8],eax
stdcall [ini_get_color],file_name,ini_sec_w3d,key_vert,0xffffff
stdcall dword[ini_get_color],file_name,ini_sec_w3d,key_vert,0xffffff
mov [color_vert],eax
stdcall [ini_get_color],file_name,ini_sec_w3d,key_face,0x808080
stdcall dword[ini_get_color],file_name,ini_sec_w3d,key_face,0x808080
mov [color_face],eax
stdcall [ini_get_color],file_name,ini_sec_w3d,key_select,0xffff00
stdcall dword[ini_get_color],file_name,ini_sec_w3d,key_select,0xffff00
mov [color_select],eax
finit
fild dword[color_bk+8]
@@ -262,19 +262,19 @@ still:
or eax,eax
jz timer_funct
cmp al,EV_REDRAW
cmp al,1
jne @f
call draw_window
jmp still
@@:
cmp al,EV_KEY
cmp al,2
jz key
cmp al,EV_BUTTON
cmp al,3
jz button
cmp al,EV_MOUSE
cmp al,6
jne @f
mcall SF_THREAD_INFO,procinfo,-1
cmp ax,word[procinfo.window_stack_position]
cmp ax,word[procinfo+4]
jne @f ;<3B><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><E2A8A2>
call mouse
@@:
@@ -282,7 +282,7 @@ still:
align 4
mouse:
stdcall [tl_mouse], tree1
stdcall [tl_mouse], dword tree1
ret
align 4
@@ -385,7 +385,7 @@ pushad
mcall , (20 shl 16)+560, (20 shl 16)+main_wnd_height
mcall SF_THREAD_INFO,procinfo,-1
mov eax,[procinfo.box.height]
mov eax,dword[procinfo.box.height]
cmp eax,250
jge @f
mov eax,250
@@ -399,7 +399,7 @@ pushad
mov dword[offs_last_timer],0 ;<3B><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><E2A0A9><EFBFBD><EFBFBD>
@@:
mov eax,[procinfo.box.width]
mov eax,dword[procinfo.box.width]
cmp eax,400
jge @f
mov eax,400
@@ -457,7 +457,7 @@ popad
align 4
key:
mcall SF_GET_KEY
stdcall [tl_key], tree1
stdcall [tl_key], dword tree1
jmp still
@@ -1087,6 +1087,53 @@ l_libs_start:
lib_6 l_libs lib_name_6, file_name, system_dir_6, import_libini
l_libs_end:
align 4
import_libimg:
dd alib_init1
img_is_img dd aimg_is_img
img_info dd aimg_info
img_from_file dd aimg_from_file
img_to_file dd aimg_to_file
img_from_rgb dd aimg_from_rgb
img_to_rgb dd aimg_to_rgb
img_to_rgb2 dd aimg_to_rgb2
img_decode dd aimg_decode
img_encode dd aimg_encode
img_create dd aimg_create
img_destroy dd aimg_destroy
img_destroy_layer dd aimg_destroy_layer
img_count dd aimg_count
img_lock_bits dd aimg_lock_bits
img_unlock_bits dd aimg_unlock_bits
img_flip dd aimg_flip
img_flip_layer dd aimg_flip_layer
img_rotate dd aimg_rotate
img_rotate_layer dd aimg_rotate_layer
img_draw dd aimg_draw
dd 0,0
alib_init1 db 'lib_init',0
aimg_is_img db 'img_is_img',0 ;<3B><><EFBFBD><E0A5A4><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E1A4A5><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E0A0A6><EFBFBD><EFBFBD>
aimg_info db 'img_info',0
aimg_from_file db 'img_from_file',0
aimg_to_file db 'img_to_file',0
aimg_from_rgb db 'img_from_rgb',0
aimg_to_rgb db 'img_to_rgb',0 ;<3B><EFBFBD><EFBFBD><E0A0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E0A0A6><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> RGB
aimg_to_rgb2 db 'img_to_rgb2',0
aimg_decode db 'img_decode',0 ;<3B><><EFBFBD><E2AEAC><EFBFBD><EFBFBD><EFBFBD><20><><EFBFBD><E0A5A4><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
aimg_encode db 'img_encode',0
aimg_create db 'img_create',0
aimg_destroy db 'img_destroy',0
aimg_destroy_layer db 'img_destroy_layer',0
aimg_count db 'img_count',0
aimg_lock_bits db 'img_lock_bits',0
aimg_unlock_bits db 'img_unlock_bits',0
aimg_flip db 'img_flip',0
aimg_flip_layer db 'img_flip_layer',0
aimg_rotate db 'img_rotate',0
aimg_rotate_layer db 'img_rotate_layer',0
aimg_draw db 'img_draw',0
align 4
import_proclib:
OpenDialog_Init dd aOpenDialog_Init
@@ -1099,9 +1146,122 @@ dd 0,0
aOpenDialog_Set_file_name db 'OpenDialog_set_file_name',0
aOpenDialog_Set_file_ext db 'OpenDialog_set_file_ext',0
include '../../develop/libraries/libs-dev/libimg/import.inc'
include '../../develop/libraries/box_lib/import.inc'
include '../../develop/libraries/buf2d/import.inc'
align 4
import_buf2d:
dd sz_init0
buf2d_create dd sz_buf2d_create
buf2d_create_f_img dd sz_buf2d_create_f_img
buf2d_clear dd sz_buf2d_clear
buf2d_draw dd sz_buf2d_draw
buf2d_delete dd sz_buf2d_delete
buf2d_resize dd sz_buf2d_resize
buf2d_line dd sz_buf2d_line
buf2d_rect_by_size dd sz_buf2d_rect_by_size
buf2d_filled_rect_by_size dd sz_buf2d_filled_rect_by_size
buf2d_circle dd sz_buf2d_circle
buf2d_img_hdiv2 dd sz_buf2d_img_hdiv2
buf2d_img_wdiv2 dd sz_buf2d_img_wdiv2
buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8
buf2d_conv_24_to_32 dd sz_buf2d_conv_24_to_32
buf2d_bit_blt dd sz_buf2d_bit_blt
buf2d_bit_blt_transp dd sz_buf2d_bit_blt_transp
buf2d_bit_blt_alpha dd sz_buf2d_bit_blt_alpha
buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix
buf2d_draw_text dd sz_buf2d_draw_text
buf2d_crop_color dd sz_buf2d_crop_color
buf2d_offset_h dd sz_buf2d_offset_h
buf2d_set_pixel dd sz_buf2d_set_pixel
dd 0,0
sz_init0 db 'lib_init',0
sz_buf2d_create db 'buf2d_create',0
sz_buf2d_create_f_img db 'buf2d_create_f_img',0
sz_buf2d_clear db 'buf2d_clear',0
sz_buf2d_draw db 'buf2d_draw',0
sz_buf2d_delete db 'buf2d_delete',0
sz_buf2d_resize db 'buf2d_resize',0
sz_buf2d_line db 'buf2d_line',0
sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0
sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0
sz_buf2d_circle db 'buf2d_circle',0
sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0
sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0
sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0
sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0
sz_buf2d_bit_blt db 'buf2d_bit_blt',0
sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0
sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0
sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0
sz_buf2d_draw_text db 'buf2d_draw_text',0
sz_buf2d_crop_color db 'buf2d_crop_color',0
sz_buf2d_offset_h db 'buf2d_offset_h',0
sz_buf2d_set_pixel db 'buf2d_set_pixel',0
align 4
import_box_lib:
dd sz_init1
edit_box_draw dd sz_edit_box_draw
edit_box_key dd sz_edit_box_key
edit_box_mouse dd sz_edit_box_mouse
edit_box_set_text dd sz_edit_box_set_text
scrollbar_ver_draw dd sz_scrollbar_ver_draw
scrollbar_hor_draw dd sz_scrollbar_hor_draw
tl_data_init dd sz_tl_data_init
tl_data_clear dd sz_tl_data_clear
tl_info_clear dd sz_tl_info_clear
tl_key dd sz_tl_key
tl_mouse dd sz_tl_mouse
tl_draw dd sz_tl_draw
tl_info_undo dd sz_tl_info_undo
tl_info_redo dd sz_tl_info_redo
tl_node_add dd sz_tl_node_add
tl_node_set_data dd sz_tl_node_set_data
tl_node_get_data dd sz_tl_node_get_data
tl_node_delete dd sz_tl_node_delete
tl_node_move_up dd sz_tl_node_move_up
tl_node_move_down dd sz_tl_node_move_down
tl_cur_beg dd sz_tl_cur_beg
tl_cur_next dd sz_tl_cur_next
tl_cur_perv dd sz_tl_cur_perv
tl_node_close_open dd sz_tl_node_close_open
tl_node_lev_inc dd sz_tl_node_lev_inc
tl_node_lev_dec dd sz_tl_node_lev_dec
tl_node_poi_get_info dd sz_tl_node_poi_get_info
tl_node_poi_get_next_info dd sz_tl_node_poi_get_next_info
tl_node_poi_get_data dd sz_tl_node_poi_get_data
dd 0,0
sz_init1 db 'lib_init',0
sz_edit_box_draw db 'edit_box_draw',0
sz_edit_box_key db 'edit_box_key',0
sz_edit_box_mouse db 'edit_box_mouse',0
sz_edit_box_set_text db 'edit_box_set_text',0
sz_scrollbar_ver_draw db 'scrollbar_v_draw',0
sz_scrollbar_hor_draw db 'scrollbar_h_draw',0
sz_tl_data_init db 'tl_data_init',0
sz_tl_data_clear db 'tl_data_clear',0
sz_tl_info_clear db 'tl_info_clear',0
sz_tl_key db 'tl_key',0
sz_tl_mouse db 'tl_mouse',0
sz_tl_draw db 'tl_draw',0
sz_tl_info_undo db 'tl_info_undo',0
sz_tl_info_redo db 'tl_info_redo',0
sz_tl_node_add db 'tl_node_add',0
sz_tl_node_set_data db 'tl_node_set_data',0
sz_tl_node_get_data db 'tl_node_get_data',0
sz_tl_node_delete db 'tl_node_delete',0
sz_tl_node_move_up db 'tl_node_move_up',0
sz_tl_node_move_down db 'tl_node_move_down',0
sz_tl_cur_beg db 'tl_cur_beg',0
sz_tl_cur_next db 'tl_cur_next',0
sz_tl_cur_perv db 'tl_cur_perv',0
sz_tl_node_close_open db 'tl_node_close_open',0
sz_tl_node_lev_inc db 'tl_node_lev_inc',0
sz_tl_node_lev_dec db 'tl_node_lev_dec',0
sz_tl_node_poi_get_info db 'tl_node_poi_get_info',0
sz_tl_node_poi_get_next_info db 'tl_node_poi_get_next_info',0
sz_tl_node_poi_get_data db 'tl_node_poi_get_data',0
align 4
import_libkmenu:
@@ -1127,7 +1287,23 @@ dd 0,0
akmenuitem_delete db 'kmenuitem_delete',0
akmenuitem_draw db 'kmenuitem_draw',0
include '../../develop/libraries/TinyGL/asm_fork/import.inc'
align 4
import_tinygl:
macro E_LIB n
{
if defined sz_#n
n dd sz_#n
end if
}
include '../../develop/libraries/TinyGL/asm_fork/export.inc'
dd 0,0
macro E_LIB n
{
if used n
sz_#n db `n,0
end if
}
include '../../develop/libraries/TinyGL/asm_fork/export.inc'
align 4
import_libini:
@@ -1191,9 +1367,9 @@ white_light dd 0.8, 0.8, 0.8, 1.0 ;
lmodel_ambient dd 0.3, 0.3, 0.3, 1.0 ; <20><><EFBFBD><E0A0AC><EFBFBD><EFBFBD><><E4AEAD><EFBFBD><EFBFBD><EFBFBD> <20>ᢥ饭<E1A2A5><E9A5AD>
if lang eq ru_RU
capt db 'info 3ds <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 14.07.25',0
capt db 'info 3ds <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 04.05.25',0 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
else ; Default to en_US
capt db 'info 3ds version 14.07.25',0 ;window caption
capt db 'info 3ds version 04.05.25',0 ;window caption
end if
align 16

View File

@@ -1,7 +1,3 @@
; SPDX-License-Identifier: GPL-2.0-only
; Info3ds_u - is a program for viewing the structure of *.3ds files
; Copyright (C) 2015-2025 KolibriOS team
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>
@@ -16,7 +12,6 @@ include '../../develop/libraries/libs-dev/libimg/libimg.inc'
include '../../load_img.inc'
include '../../load_lib.mac'
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
include '../../develop/libraries/TinyGL/asm_fork/kosgl.inc'
include '../../develop/libraries/TinyGL/asm_fork/opengl_const.inc'
include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US.
include 'info_fun_float.inc'
@@ -26,8 +21,8 @@ include 'convert_stl_3ds.inc'
3d_wnd_l equ 205 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> tinygl <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E1ABA5>
3d_wnd_t equ 47 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> tinygl <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E1A2A5><EFBFBD>
3d_wnd_w equ 345
3d_wnd_h equ 384
3d_wnd_w equ 344
3d_wnd_h equ 312
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
@@ -48,13 +43,13 @@ list_offs_text equ 14+sizeof.obj_3d ;ᤢ
include 'info_o3d.inc'
align 4
fl180 dd 180.0
fl255 dd 255.0
open_file_data dd 0 ;㪠<><E3AAA0><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E4A0A9><EFBFBD> 3ds
open_file_size dd 0 ;ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E4A0A9>
;
main_wnd_height equ 460 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC>
fn_toolbar db 'toolbar.png',0
IMAGE_TOOLBAR_ICON_SIZE equ 21*21*3
image_data_toolbar dd 0
;
@@ -145,17 +140,17 @@ start:
mov eax,dword[icon_tl_sys]
mov dword[tree1.data_img_sys],eax
include_image_file 'objects.png', icon_toolbar
load_image_file 'objects.png', icon_toolbar
mov eax,dword[icon_toolbar]
mov dword[tree1.data_img],eax
include_image_file '../../fs/kfar/trunk/font8x9.bmp', image_data_toolbar
load_image_file 'font8x9.bmp', image_data_toolbar
stdcall [buf2d_create_f_img], buf_1,[image_data_toolbar] ;ᮧ<><E1AEA7><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
stdcall mem.Free,[image_data_toolbar] ;<3B><EFBFBD><E1A2AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
stdcall [buf2d_conv_24_to_8], buf_1,1 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E0AEA7><EFBFBD><E7ADAE><EFBFBD> 8 <20><><EFBFBD>
stdcall [buf2d_convert_text_matrix], buf_1
include_image_file 'toolbar.png', image_data_toolbar
load_image_file fn_toolbar, image_data_toolbar
;ࠡ<><E0A0A1><EFBFBD> <20><><E4A0A9><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
copy_path ini_name,sys_path,file_name,0
@@ -228,7 +223,7 @@ start:
mcall SF_SYSTEM_GET,SSF_TIME_COUNT
mov [last_time],eax
stdcall [kosglMakeCurrent], 3d_wnd_l,3d_wnd_t,[buf_ogl.w],[buf_ogl.h],ctx1
stdcall [kosglMakeCurrent], 3d_wnd_l,3d_wnd_t,3d_wnd_w,3d_wnd_h,ctx1
stdcall [glEnable], GL_DEPTH_TEST
stdcall [glEnable], GL_NORMALIZE ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><E0ACA0> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>䠪⮢
stdcall [glClearColor], [color_bk+8],[color_bk+4],[color_bk],0.0
@@ -236,7 +231,7 @@ start:
call [gluNewQuadric]
mov [qObj],eax
mov eax,[ctx1.gl_context]
mov eax,dword[ctx1] ;eax -> TinyGLContext.GLContext
mov eax,[eax] ;eax -> ZBuffer
mov eax,[eax+ZBuffer.pbuf]
mov dword[buf_ogl],eax
@@ -262,20 +257,20 @@ still:
or eax,eax
jz timer_funct
cmp al,EV_REDRAW
cmp al,1
jne @f
call draw_window
jmp still
@@:
cmp al,EV_KEY
cmp al,2
jz key
cmp al,EV_BUTTON
cmp al,3
jz button
cmp al,EV_MOUSE
cmp al,6
jne @f
mcall SF_THREAD_INFO,procinfo,-1
cmp ax,word[procinfo.window_stack_position]
jne @f ;window is not active
cmp ax,word[procinfo+4]
jne @f ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><E2A8A2>
call mouse
@@:
jmp still
@@ -306,9 +301,9 @@ mouse:
mov ebx,3d_wnd_l
@@:
sub ebx,3d_wnd_l
cmp ebx,[buf_ogl.w]
cmp ebx,3d_wnd_w
jle @f
mov ebx,[buf_ogl.w]
mov ebx,3d_wnd_w
@@:
movsx eax,ax ;mouse.y
cmp eax,3d_wnd_t
@@ -316,9 +311,9 @@ mouse:
mov eax,3d_wnd_t
@@:
sub eax,3d_wnd_t
cmp eax,[buf_ogl.h]
cmp eax,3d_wnd_h
jle @f
mov eax,[buf_ogl.h]
mov eax,3d_wnd_h
@@:
finit
fild dword[mouse_y]
@@ -356,13 +351,13 @@ mouse:
cmp ebx,3d_wnd_l
jl .end_d
sub ebx,3d_wnd_l
cmp ebx,[buf_ogl.w]
cmp ebx,3d_wnd_w
jg .end_d
movsx eax,ax ;mouse.y
cmp eax,3d_wnd_t
jl .end_d
sub eax,3d_wnd_t
cmp eax,[buf_ogl.h]
cmp eax,3d_wnd_h
jg .end_d
mov dword[mouse_drag],1
mov dword[mouse_x],ebx
@@ -445,7 +440,16 @@ pushad
or edx,0x33000000
mcall SF_CREATE_WINDOW, (20 shl 16)+560, (20 shl 16)+main_wnd_height,,, capt
call OnResize
mcall SF_THREAD_INFO,procinfo,-1
mov eax,dword[procinfo.box.height]
cmp eax,250
jge @f
mov eax,250
@@:
sub eax,30
sub eax,[tree1.box_top]
mov [tree1.box_height],eax
mov word[w_scr_t1.y_size],ax ;<3B><><EFBFBD><EFBFBD><EFBFBD><><E0A0A7><EFBFBD><EFBFBD> <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD>
stdcall [kmainmenu_draw], [main_menu]
@@ -489,62 +493,6 @@ pushad
popad
ret
align 4
OnResize:
mcall SF_STYLE_SETTINGS,SSF_GET_SKIN_HEIGHT
push eax
mcall SF_THREAD_INFO,procinfo,-1
mov eax,[procinfo.box.height]
cmp eax,250
jge @f
mov eax,250
@@:
sub eax,[esp]
sub eax,5
sub eax,[tree1.box_top]
mov [tree1.box_height],eax
mov word[w_scr_t1.y_size],ax ;new scroll sizes
cmp [buf_ogl.h],eax
je @f
mov [buf_ogl.h],eax
mov dword[buf_ogl.w],0 ;reset width
@@:
pop eax
movzx eax,word[w_scr_t1.x_size]
add eax,[tree1.box_left]
add eax,[tree1.box_width]
add eax,15 ;5 px * 3 borders
sub eax,[procinfo.box.width]
neg eax
cmp eax,64
jge @f
mov eax,64
@@:
cmp [buf_ogl.w],eax
je .end
mov [buf_ogl.w],eax
fild dword[buf_ogl.w]
fld st0
fdiv dword[fl180]
fstp dword[angle_dxm]
fidiv dword[buf_ogl.h]
fstp dword[ratio]
stdcall [glViewport], 0,0, [buf_ogl.w], [buf_ogl.h]
mov eax,[ctx1.gl_context]
mov eax,[eax] ;eax -> ZBuffer
mov eax,[eax+ZBuffer.pbuf]
mov dword[buf_ogl],eax
stdcall [tl_node_get_data],tree1
or eax,eax
jz .end
add eax,list_offs_obj3d
stdcall draw_3d, eax
.end:
ret
align 4
key:
mcall SF_GET_KEY
@@ -1204,10 +1152,57 @@ l_libs_start:
lib_2 l_libs lib_name_2, file_name, system_dir_2, import_box_lib
lib_3 l_libs lib_name_3, file_name, system_dir_3, import_buf2d
lib_4 l_libs lib_name_4, file_name, system_dir_4, import_libkmenu
lib_5 l_libs lib_name_5, file_name, system_dir_5, import_tinygl
lib_5 l_libs lib_name_5, file_name, system_dir_5, import_lib_tinygl
lib_6 l_libs lib_name_6, file_name, system_dir_6, import_libini
l_libs_end:
align 4
import_libimg:
dd alib_init1
img_is_img dd aimg_is_img
img_info dd aimg_info
img_from_file dd aimg_from_file
img_to_file dd aimg_to_file
img_from_rgb dd aimg_from_rgb
img_to_rgb dd aimg_to_rgb
img_to_rgb2 dd aimg_to_rgb2
img_decode dd aimg_decode
img_encode dd aimg_encode
img_create dd aimg_create
img_destroy dd aimg_destroy
img_destroy_layer dd aimg_destroy_layer
img_count dd aimg_count
img_lock_bits dd aimg_lock_bits
img_unlock_bits dd aimg_unlock_bits
img_flip dd aimg_flip
img_flip_layer dd aimg_flip_layer
img_rotate dd aimg_rotate
img_rotate_layer dd aimg_rotate_layer
img_draw dd aimg_draw
dd 0,0
alib_init1 db 'lib_init',0
aimg_is_img db 'img_is_img',0 ;<3B><><EFBFBD><E0A5A4><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E1A4A5><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E0A0A6><EFBFBD><EFBFBD>
aimg_info db 'img_info',0
aimg_from_file db 'img_from_file',0
aimg_to_file db 'img_to_file',0
aimg_from_rgb db 'img_from_rgb',0
aimg_to_rgb db 'img_to_rgb',0 ;<3B><EFBFBD><EFBFBD><E0A0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E0A0A6><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> RGB
aimg_to_rgb2 db 'img_to_rgb2',0
aimg_decode db 'img_decode',0 ;<3B><><EFBFBD><E2AEAC><EFBFBD><EFBFBD><EFBFBD><20><><EFBFBD><E0A5A4><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
aimg_encode db 'img_encode',0
aimg_create db 'img_create',0
aimg_destroy db 'img_destroy',0
aimg_destroy_layer db 'img_destroy_layer',0
aimg_count db 'img_count',0
aimg_lock_bits db 'img_lock_bits',0
aimg_unlock_bits db 'img_unlock_bits',0
aimg_flip db 'img_flip',0
aimg_flip_layer db 'img_flip_layer',0
aimg_rotate db 'img_rotate',0
aimg_rotate_layer db 'img_rotate_layer',0
aimg_draw db 'img_draw',0
align 4
import_proclib:
OpenDialog_Init dd aOpenDialog_Init
@@ -1220,9 +1215,122 @@ dd 0,0
aOpenDialog_Set_file_name db 'OpenDialog_set_file_name',0
aOpenDialog_Set_file_ext db 'OpenDialog_set_file_ext',0
include '../../develop/libraries/libs-dev/libimg/import.inc'
include '../../develop/libraries/box_lib/import.inc'
include '../../develop/libraries/buf2d/import.inc'
align 4
import_buf2d:
dd sz_init0
buf2d_create dd sz_buf2d_create
buf2d_create_f_img dd sz_buf2d_create_f_img
buf2d_clear dd sz_buf2d_clear
buf2d_draw dd sz_buf2d_draw
buf2d_delete dd sz_buf2d_delete
buf2d_resize dd sz_buf2d_resize
buf2d_line dd sz_buf2d_line
buf2d_rect_by_size dd sz_buf2d_rect_by_size
buf2d_filled_rect_by_size dd sz_buf2d_filled_rect_by_size
buf2d_circle dd sz_buf2d_circle
buf2d_img_hdiv2 dd sz_buf2d_img_hdiv2
buf2d_img_wdiv2 dd sz_buf2d_img_wdiv2
buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8
buf2d_conv_24_to_32 dd sz_buf2d_conv_24_to_32
buf2d_bit_blt dd sz_buf2d_bit_blt
buf2d_bit_blt_transp dd sz_buf2d_bit_blt_transp
buf2d_bit_blt_alpha dd sz_buf2d_bit_blt_alpha
buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix
buf2d_draw_text dd sz_buf2d_draw_text
buf2d_crop_color dd sz_buf2d_crop_color
buf2d_offset_h dd sz_buf2d_offset_h
buf2d_set_pixel dd sz_buf2d_set_pixel
dd 0,0
sz_init0 db 'lib_init',0
sz_buf2d_create db 'buf2d_create',0
sz_buf2d_create_f_img db 'buf2d_create_f_img',0
sz_buf2d_clear db 'buf2d_clear',0
sz_buf2d_draw db 'buf2d_draw',0
sz_buf2d_delete db 'buf2d_delete',0
sz_buf2d_resize db 'buf2d_resize',0
sz_buf2d_line db 'buf2d_line',0
sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0
sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0
sz_buf2d_circle db 'buf2d_circle',0
sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0
sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0
sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0
sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0
sz_buf2d_bit_blt db 'buf2d_bit_blt',0
sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0
sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0
sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0
sz_buf2d_draw_text db 'buf2d_draw_text',0
sz_buf2d_crop_color db 'buf2d_crop_color',0
sz_buf2d_offset_h db 'buf2d_offset_h',0
sz_buf2d_set_pixel db 'buf2d_set_pixel',0
align 4
import_box_lib:
dd sz_init1
edit_box_draw dd sz_edit_box_draw
edit_box_key dd sz_edit_box_key
edit_box_mouse dd sz_edit_box_mouse
edit_box_set_text dd sz_edit_box_set_text
scrollbar_ver_draw dd sz_scrollbar_ver_draw
scrollbar_hor_draw dd sz_scrollbar_hor_draw
tl_data_init dd sz_tl_data_init
tl_data_clear dd sz_tl_data_clear
tl_info_clear dd sz_tl_info_clear
tl_key dd sz_tl_key
tl_mouse dd sz_tl_mouse
tl_draw dd sz_tl_draw
tl_info_undo dd sz_tl_info_undo
tl_info_redo dd sz_tl_info_redo
tl_node_add dd sz_tl_node_add
tl_node_set_data dd sz_tl_node_set_data
tl_node_get_data dd sz_tl_node_get_data
tl_node_delete dd sz_tl_node_delete
tl_node_move_up dd sz_tl_node_move_up
tl_node_move_down dd sz_tl_node_move_down
tl_cur_beg dd sz_tl_cur_beg
tl_cur_next dd sz_tl_cur_next
tl_cur_perv dd sz_tl_cur_perv
tl_node_close_open dd sz_tl_node_close_open
tl_node_lev_inc dd sz_tl_node_lev_inc
tl_node_lev_dec dd sz_tl_node_lev_dec
tl_node_poi_get_info dd sz_tl_node_poi_get_info
tl_node_poi_get_next_info dd sz_tl_node_poi_get_next_info
tl_node_poi_get_data dd sz_tl_node_poi_get_data
dd 0,0
sz_init1 db 'lib_init',0
sz_edit_box_draw db 'edit_box_draw',0
sz_edit_box_key db 'edit_box_key',0
sz_edit_box_mouse db 'edit_box_mouse',0
sz_edit_box_set_text db 'edit_box_set_text',0
sz_scrollbar_ver_draw db 'scrollbar_v_draw',0
sz_scrollbar_hor_draw db 'scrollbar_h_draw',0
sz_tl_data_init db 'tl_data_init',0
sz_tl_data_clear db 'tl_data_clear',0
sz_tl_info_clear db 'tl_info_clear',0
sz_tl_key db 'tl_key',0
sz_tl_mouse db 'tl_mouse',0
sz_tl_draw db 'tl_draw',0
sz_tl_info_undo db 'tl_info_undo',0
sz_tl_info_redo db 'tl_info_redo',0
sz_tl_node_add db 'tl_node_add',0
sz_tl_node_set_data db 'tl_node_set_data',0
sz_tl_node_get_data db 'tl_node_get_data',0
sz_tl_node_delete db 'tl_node_delete',0
sz_tl_node_move_up db 'tl_node_move_up',0
sz_tl_node_move_down db 'tl_node_move_down',0
sz_tl_cur_beg db 'tl_cur_beg',0
sz_tl_cur_next db 'tl_cur_next',0
sz_tl_cur_perv db 'tl_cur_perv',0
sz_tl_node_close_open db 'tl_node_close_open',0
sz_tl_node_lev_inc db 'tl_node_lev_inc',0
sz_tl_node_lev_dec db 'tl_node_lev_dec',0
sz_tl_node_poi_get_info db 'tl_node_poi_get_info',0
sz_tl_node_poi_get_next_info db 'tl_node_poi_get_next_info',0
sz_tl_node_poi_get_data db 'tl_node_poi_get_data',0
align 4
import_libkmenu:
@@ -1248,7 +1356,19 @@ dd 0,0
akmenuitem_delete db 'kmenuitem_delete',0
akmenuitem_draw db 'kmenuitem_draw',0
include '../../develop/libraries/TinyGL/asm_fork/import.inc'
align 4
import_lib_tinygl:
macro E_LIB n
{
n dd sz_#n
}
include '../../develop/libraries/TinyGL/asm_fork/export.inc'
dd 0,0
macro E_LIB n
{
sz_#n db `n,0
}
include '../../develop/libraries/TinyGL/asm_fork/export.inc'
align 4
import_libini:
@@ -1307,14 +1427,14 @@ white_light dd 0.8, 0.8, 0.8, 1.0 ;
lmodel_ambient dd 0.3, 0.3, 0.3, 1.0 ; <20><><EFBFBD><E0A0AC><EFBFBD><EFBFBD><><E4AEAD><EFBFBD><EFBFBD><EFBFBD> <20>ᢥ饭<E1A2A5><E9A5AD>
if lang eq ru_RU
capt db 'info 3ds [user] <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 14.07.25',0 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
capt db 'info 3ds [user] <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 14.04.25',0 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
else ; Default to en_US
capt db 'info 3ds [user] version 14.07.25',0 ; Window caption
capt db 'info 3ds [user] version 14.04.25',0 ; Window caption
end if
align 16
i_end:
ctx1 TinyGLContext
ctx1 rb 28 ;sizeof.TinyGLContext = 28
procinfo process_information
run_file_70 FileInfoBlock
sc system_colors

View File

@@ -1,19 +1,18 @@
;
; This file contains functions needed to create
; and operate a window with vertex coordinates
; <EFBFBD> <EFBFBD> <EFBFBD><EFBFBD> ᮡ࠭<EFBFBD> <EFBFBD>㭪樨 <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>
; <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>
;
3d_wnd_l equ 5 ;tinygl buffer left indent
3d_wnd_t equ 23 ;tinygl buffer top indent
3d_wnd_w equ 396
prop_wnd_width equ 340 ;<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
prop_wnd_height equ 460 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
3d_wnd_l equ 5 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> tinygl <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>
3d_wnd_t equ 23 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> tinygl <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>
3d_wnd_w equ 320
3d_wnd_h equ 240
SIZE_ONE_FLOAT equ 14
MAX_OBJECT_SIZE equ (4+SIZE_ONE_FLOAT*3+1)
align 4
fl180 dd 180.0
prop_wnd_run db 0 ;variable that ensures that no more than 1 window with properties is launched at the same time
prop_wnd_run db 0 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>-<EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1-<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
txt_q db '?',0
txt_space:
@@ -174,23 +173,20 @@ prop_still:
jmp .end
@@:
cmp al,EV_REDRAW
cmp al,1 ;<EFBFBD><EFBFBD><EFBFBD>. <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
jne @f
call prop_red_win
jmp .end
@@:
cmp al,EV_KEY
cmp al,2
jne @f
call prop_key
jmp .end
@@:
cmp al,EV_BUTTON
cmp al,3
jz prop_button
cmp al,EV_MOUSE
cmp al,6
jne @f
mcall SF_THREAD_INFO,procinfo,-1
cmp ax,word[procinfo.window_stack_position]
jne @f ;window is not active
call prop_mouse
@@:
.end:
@@ -202,65 +198,20 @@ prop_red_win:
pushad
mcall SF_REDRAW,SSF_BEGIN_DRAW
mcall SF_STYLE_SETTINGS,SSF_GET_SKIN_HEIGHT
push eax
mcall SF_THREAD_INFO,procinfo,-1
cmp dword[procinfo.box.height],0
je .resize_end
mov eax,[procinfo.box.height]
sub eax,[esp]
sub eax,[tree3.box_top]
sub eax,5
cmp eax,48
jge @f
mov eax,48 ;min size
@@:
mov dword[tree3.box_height],eax
mov word[w_scr_t3.y_size],ax
mov ebx,[procinfo.box.width]
sub ebx,37
cmp ebx,240
jge @f
mov ebx,240
@@:
mov [tree3.box_width],ebx
add ebx,[tree3.box_left]
mov word[w_scr_t3.x_pos],bx
;todo: resize scroll slider
mov eax,[tree3.box_width]
add eax,16
cmp [buf_ogl.w],eax
je .resize_end
mov [buf_ogl.w],eax
fild dword[buf_ogl.w]
fld st0
fdiv dword[fl180]
fstp dword[angle_dxm]
fidiv dword[buf_ogl.h]
fstp dword[ratio]
stdcall [glViewport], 0,0, [buf_ogl.w], 3d_wnd_h
stdcall obj_set_sizes, o3d
.resize_end:
xor eax,eax
mov edi,dword[capt_p] ;children window caption
mov bx,word[procinfo.box.left]
add bx,word[buf_0.l]
add bx,5 ;side frame width
add bx,5 ;<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>
shl ebx,16
mov bx,word[tree3.box_width]
add bx,37
mov bx,prop_wnd_width
mov cx,word[procinfo.box.top]
add cx,word[buf_0.t]
shl ecx,16
pop eax
add eax,[tree3.box_height]
add eax,[tree3.box_top]
add eax,5
mov cx,ax
mov cx,prop_wnd_height
mov edx,[sc.work]
or edx,0x33000000
mcall SF_CREATE_WINDOW
int 0x40
mov esi,[sc.work_button]
mcall SF_DEFINE_BUTTON, (5 shl 16)+20, (266 shl 16)+20, 0x40000003
@@ -275,7 +226,7 @@ pushad
int 0x40
mov dword[w_scr_t3.all_redraw],1
stdcall [scrollbar_v_draw], w_scr_t3
stdcall [scrollbar_ver_draw],dword w_scr_t3
stdcall [tl_draw], tree3
stdcall [edit_box_draw], edit1
stdcall [edit_box_draw], edit2
@@ -365,9 +316,9 @@ prop_mouse:
mov ebx,3d_wnd_l
@@:
sub ebx,3d_wnd_l
cmp ebx,[buf_ogl.w]
cmp ebx,3d_wnd_w
jle @f
mov ebx,[buf_ogl.w]
mov ebx,3d_wnd_w
@@:
and eax,0xffff ;mouse.y
cmp eax,3d_wnd_t
@@ -383,14 +334,14 @@ prop_mouse:
fild dword[mouse_y]
mov [mouse_y],eax
fisub dword[mouse_y]
fdiv dword[angle_dym] ;if the cursor moves along the y axis
fdiv dword[angle_dxm] ;<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> y (<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>) <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> x
fadd dword[angle_x]
fstp dword[angle_x]
fild dword[mouse_x]
mov [mouse_x],ebx
fisub dword[mouse_x]
fdiv dword[angle_dxm] ;if the cursor moves along the x axis
fdiv dword[angle_dym] ;<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> x (<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>) <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> y
fadd dword[angle_y]
fstp dword[angle_y]
@@ -412,7 +363,7 @@ prop_mouse:
cmp ebx,3d_wnd_l
jl .end_d
sub ebx,3d_wnd_l
cmp ebx,[buf_ogl.w]
cmp ebx,3d_wnd_w
jg .end_d
and eax,0xffff ;mouse.y
cmp eax,3d_wnd_t
@@ -860,7 +811,7 @@ capt_p dd 0
;<EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD>ꥪ⠬<EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>
tree3 tree_list MAX_OBJECT_SIZE,3, tl_key_no_edit+tl_list_box_mode,\
16,16, 0xffffff,0xb0d0ff,0x10400040, 5,290,380,140, 16, 4,0, el_focus,\
16,16, 0xffffff,0xb0d0ff,0x400040, 5,290,303,140, 16, 4,0, el_focus,\
w_scr_t3,get_point_coords
edit1 edit_box 80, 76, 269, 0xffd0d0, 0xff, 0x80ff, 0, 0x8000, 32, string1, mouse_dd, 0

View File

@@ -1,18 +0,0 @@
align 4
import_tinygl:
macro E_LIB n
{
if defined sz_#n
n dd sz_#n
end if
}
include 'export.inc'
dd 0,0
macro E_LIB n
{
if used n
sz_#n db `n,0
end if
}
include 'export.inc'

View File

@@ -1,117 +0,0 @@
;
; Export functions
;
E_LIB lib_init
E_LIB version
E_LIB edit_box_draw
E_LIB edit_box_key
E_LIB edit_box_key_safe
E_LIB edit_box_mouse
E_LIB edit_box_set_text
E_LIB version_ed
E_LIB init_checkbox, init_checkbox2
E_LIB check_box_draw, check_box_draw2
E_LIB check_box_mouse, check_box_mouse2
E_LIB version_ch, version_ch2
E_LIB option_box_draw
E_LIB option_box_mouse
E_LIB version_op
E_LIB scrollbar_v_draw
E_LIB scrollbar_v_mouse
E_LIB scrollbar_h_draw
E_LIB scrollbar_h_mouse
E_LIB version_scrollbar
E_LIB dbutton_draw
E_LIB dbutton_mouse
E_LIB version_dbutton
E_LIB menu_bar_draw
E_LIB menu_bar_mouse
E_LIB menu_bar_activate
E_LIB version_menu_bar
E_LIB FileBrowser_draw
E_LIB FileBrowser_mouse
E_LIB FileBrowser_key
E_LIB version_FileBrowser
E_LIB tl_data_init
E_LIB tl_data_clear
E_LIB tl_info_clear
E_LIB tl_key
E_LIB tl_mouse
E_LIB tl_draw
E_LIB tl_info_undo
E_LIB tl_info_redo
E_LIB tl_node_add
E_LIB tl_node_set_data
E_LIB tl_node_get_data
E_LIB tl_node_delete
E_LIB tl_cur_beg
E_LIB tl_cur_next
E_LIB tl_cur_perv
E_LIB tl_node_close_open
E_LIB tl_node_lev_inc
E_LIB tl_node_lev_dec
E_LIB tl_node_move_up
E_LIB tl_node_move_down
E_LIB tl_node_poi_get_info
E_LIB tl_node_poi_get_next_info
E_LIB tl_node_poi_get_data
E_LIB tl_save_mem
E_LIB tl_load_mem
E_LIB tl_get_mem_size
E_LIB version_tree_list
E_LIB PathShow_prepare
E_LIB PathShow_draw
E_LIB version_PathShow
E_LIB ted_but_sumb_upper
E_LIB ted_but_sumb_lover
E_LIB ted_but_convert_by_table
E_LIB ted_can_save
E_LIB ted_clear
E_LIB ted_delete
E_LIB ted_draw
E_LIB ted_init
E_LIB ted_init_scroll_bars
E_LIB ted_init_syntax_file
E_LIB ted_is_select
E_LIB ted_key
E_LIB ted_mouse
E_LIB ted_open_file
E_LIB ted_save_file
E_LIB ted_text_add
E_LIB ted_but_select_word
E_LIB ted_but_cut
E_LIB ted_but_copy
E_LIB ted_but_paste
E_LIB ted_but_undo
E_LIB ted_but_redo
E_LIB ted_but_reverse
E_LIB ted_but_find
E_LIB ted_but_replace
E_LIB ted_text_colored
E_LIB ted_go_to_position
E_LIB version_text_edit
E_LIB frame_draw
E_LIB version_frame
E_LIB progressbar_draw
E_LIB progressbar_progress
E_LIB tooltip_init
E_LIB tooltip_delete
E_LIB tooltip_test_show
E_LIB tooltip_mouse
E_LIB get_font_size
purge E_LIB

View File

@@ -1,24 +0,0 @@
align 4
import_box_lib:
macro E_LIB n, lfn
{
if n eq lib_init
dd strz_#n
else if defined sz_#n
n dd sz_#n
end if
}
include 'export.inc'
dd 0,0
macro E_LIB n, lfn
{
if used n
if lfn eq
sz_#n db `n,0
else
sz_#n db `lfn,0
end if
end if
}
include 'export.inc'

View File

@@ -1,48 +0,0 @@
;
; Export functions
;
E_LIB lib_init
E_LIB buf2d_create
E_LIB buf2d_create_f_img
E_LIB buf2d_clear
E_LIB buf2d_draw
E_LIB buf2d_delete
E_LIB buf2d_resize
E_LIB buf2d_rotate
E_LIB buf2d_line
E_LIB buf2d_line_sm
E_LIB buf2d_rect_by_size
E_LIB buf2d_filled_rect_by_size
E_LIB buf2d_circle
E_LIB buf2d_img_hdiv2
E_LIB buf2d_img_wdiv2
E_LIB buf2d_conv_24_to_8
E_LIB buf2d_conv_24_to_32
E_LIB buf2d_bit_blt
E_LIB buf2d_bit_blt_transp
E_LIB buf2d_bit_blt_alpha
E_LIB buf2d_curve_bezier
E_LIB buf2d_convert_text_matrix
E_LIB buf2d_draw_text
E_LIB buf2d_crop_color
E_LIB buf2d_offset_h
E_LIB buf2d_flood_fill
E_LIB buf2d_set_pixel
E_LIB buf2d_get_pixel
E_LIB buf2d_flip_h
E_LIB buf2d_flip_v
E_LIB buf2d_filter_dither
E_LIB buf2d_vox_brush_create
E_LIB buf2d_vox_brush_delete
E_LIB buf2d_vox_obj_get_img_w_3g
E_LIB buf2d_vox_obj_get_img_h_3g
E_LIB buf2d_vox_obj_draw_1g
E_LIB buf2d_vox_obj_draw_3g
E_LIB buf2d_vox_obj_draw_3g_scaled
E_LIB buf2d_vox_obj_draw_pl
E_LIB buf2d_vox_obj_draw_pl_scaled
E_LIB buf2d_vox_obj_draw_3g_shadows
purge E_LIB

View File

@@ -1,20 +0,0 @@
align 4
import_buf2d:
macro E_LIB n
{
if n eq lib_init
dd strz_#n
else if defined sz_#n
n dd sz_#n
end if
}
include 'export.inc'
dd 0,0
macro E_LIB n
{
if used n
sz_#n db `n,0
end if
}
include 'export.inc'

View File

@@ -1,34 +0,0 @@
;
; Export functions
;
E_LIB lib_init
E_LIB version
E_LIB img_is_img
E_LIB img_info
E_LIB img_from_file
E_LIB img_to_file
E_LIB img_from_rgb
E_LIB img_to_rgb
E_LIB img_to_rgb2
E_LIB img_decode
E_LIB img_encode ;supported formats: PNG 24 32, BMP 24 32, PNM 1 8g 24
E_LIB img_create
E_LIB img_destroy
E_LIB img_destroy_layer
E_LIB img_count
E_LIB img_lock_bits
E_LIB img_unlock_bits
E_LIB img_flip
E_LIB img_flip_layer
E_LIB img_rotate
E_LIB img_rotate_layer
E_LIB img_draw
E_LIB img_scale
E_LIB img_get_scaled_size
E_LIB img_convert
E_LIB img_blend
E_LIB img_resize_data
E_LIB img_formats_table
purge E_LIB

View File

@@ -1,20 +0,0 @@
align 4
import_libimg:
macro E_LIB n
{
if n eq lib_init
dd strz_#n
else if defined sz_#n
n dd sz_#n
end if
}
include 'export.inc'
dd 0,0
macro E_LIB n
{
if used n
sz_#n db `n,0
end if
}
include 'export.inc'

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

@@ -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")
tup.rule("PrMK.asm", FASM .. " %f %o " .. tup.getconfig("KPACK_CMD"), "PrMK")

View File

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

View File

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 103 KiB

View File

@@ -1,5 +1,5 @@
if tup.getconfig("NO_FASM") ~= "" or tup.getconfig("NO_GCC") ~= "" then return end
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../.." or tup.getconfig("HELPERDIR")
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR")
tup.include(HELPERDIR .. "/use_gcc.lua")
INCLUDES = INCLUDES .. "-I" .. tup.getvariantdir()
LDFLAGS = LDFLAGS .. " -T kolibri.ld"

View File

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@@ -1,8 +1,9 @@
; Text CodePage = cp1251
; SPDX-License-Identifier: NOASSERTION
;
; <--- include all MeOS stuff --->
include "../../../../../macros.inc"
include "../../../../macros.inc"
; <--- start of MenuetOS application --->
@@ -21,7 +22,7 @@ CODE
xor ecx, ecx
inc ecx
mcall 66,1 ; установка режима ввода сканкодов
mcall 66,1 ; setting scancode input mode
@@ -30,9 +31,9 @@ CODE
wait_event: ; main cycle
mcall 10 ; ожидать событие
mcall 10 ; expect an event
; mcall 23, 2 ; вариант постоянный опрос
; mcall 23, 2 ; option constant poll
; or eax, eax
; jz key.1
@@ -55,7 +56,7 @@ CODE
key: ; key event handler
; get key code
call load_keys
; преобразование
; transformation
.1:
mov ah, 0xfe
mov edx, txt_data.fe
@@ -127,8 +128,8 @@ CODE
ret
load_ports: ; вход ah - старший байт порта
; edx - адрес текста
load_ports: ; input ah - port high byte
; edx - text address
mov al, 0xFE
call load_port_FE

View File

@@ -23,9 +23,6 @@ library_fun_memory_free equ mem_free
library_fun_memory_realloc equ mem_realloc
library_fun_dll_load equ dll_load
align 4
strz_lib_init db 'lib_init',0
align 4
arrea_xx dd 0
file_name db '/sys/@notify',0
@@ -217,7 +214,7 @@ end if
jmp i_error
align 4
i_begin:
import_some_library myimport
import_boxlib myimport
test eax,eax
jz i_exit
i_error:
@@ -237,13 +234,13 @@ macro load_library library_name__, library_path__, system_path__, myimport, poin
local i_begin
local i_error
local i_exit
push ebx
if point_dir_name__ eq
copy_path library_name__, [32], library_path__,0
else
;the macros making way /current path a program/ + name system library
copy_path library_name__, [32], library_path__,point_dir_name__
end if
push ebx
mcall SF_SYS_MISC,SSF_LOAD_DLL,library_path__ ; load of alternative
test eax,eax
jnz i_begin
@@ -254,7 +251,7 @@ end if
jmp i_error
align 4
i_begin:
import_some_library myimport
import_boxlib myimport
test eax,eax
jz i_exit
i_error:
@@ -312,7 +309,7 @@ align 4
align 4
end_steep:
mov adr_load_lib,eax ;save adr lib in memory
import_some_library my_import
import_boxlib my_import
test eax,eax
jz cycle0n
or status_lib,2 ; status of code - enable error - import error
@@ -390,7 +387,7 @@ align 4
align 4
end_steep:
mov adr_load_lib,eax ;save adr lib in memory
import_some_library my_import
import_boxlib my_import
test eax,eax
jz cycle0n
or status_lib,2 ; status of code - enable error - import error
@@ -454,7 +451,7 @@ pop ebx eax
;output:
; eax - <20>᫨ 㤠筮 <20><> 0 <20><><EFBFBD><><E3AAA0><EFBFBD> <20><> <20><><EFBFBD> <20>㭪樨 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><><E3A4A0><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E3A7A8>
; ebx - ࠧ<><E0A0A7><EFBFBD><E8A0A5><EFBFBD>
macro import_some_library myimport
macro import_boxlib myimport
{
local import_loop
local import_find

View File

@@ -1,20 +1,23 @@
; SPDX-License-Identifier: NOASSERTION
;
;*******************************************************
;**************GRAPHICS EDITOR ANIMAGE *****************
;*******************************************************
; version: 1.52
; last update: 23.11.2016
; changes: Can save *.png files
; autors: IgorA
; author: IgorA
;--------------------------------------------------------
; version: 1.51
; last update: 23.03.2016
; changes: Use library 'kmenu.obj', update GUI
; autors: IgorA, Veliant, Leency
; authors: IgorA, Veliant, Leency
;--------------------------------------------------------
; version: 1.4
; last update: 12.03.2016
; changes: Use library 'libimg.obj'
; autors: IgorA
; author: IgorA
;--------------------------------------------------------
; version: 1.3
; last update: 05.10.2010
@@ -30,7 +33,7 @@
;--------------------------------------------------------
; version: 1.1
; last update: 09.12.2006
; autors:
; authors:
; programming by andrew_programmer
; design by golus
@@ -40,49 +43,48 @@ org 0
dd 1, START, IM_END, I_END
dd stacktop, file_path, cur_dir_path
include '../../../config.inc' ;for nightbuild
include '../../../macros.inc'
include '../../../proc32.inc'
include '../../../KOSfuncs.inc'
include '../../../load_lib.mac'
include '../../../dll.inc'
include '../../../develop/libraries/libs-dev/libio/libio.inc'
include '../../../develop/libraries/libs-dev/libimg/libimg.inc'
;include '../../../debug.inc'
include '../../config.inc' ;for nightbuild
include '../../macros.inc'
include '../../proc32.inc'
include '../../KOSfuncs.inc'
include '../../load_lib.mac'
include '../../dll.inc'
include '../../develop/libraries/libs-dev/libio/libio.inc'
include '../../develop/libraries/libs-dev/libimg/libimg.inc'
;include '../../debug.inc'
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
;---------------------------------------------------------
; *** ª®­áâ ­âë ¤«ï ¨­â¥àä¥©á  ***
; *** constants for interface ***
; ª®à४â¨à®¢ª¨ ­  ᪨­
ci_offs_skin_w equ 5 ;ª®à४â¨à®¢ª  ­  è¨à¨­ã à ¬ª¨ ᪨­ 
ci_offs_skin_h equ 24 ;ª®à४â¨à®¢ª  ­  ¢ëá®âã ᪨­ 
; skin adjustments
ci_offs_skin_w equ 5 ;adjustment to the width of the skin frame
ci_offs_skin_h equ 24 ;skin height adjustment
; £« ¢­®¥ ®ª­®
; main window
ci_wnd_min_siz_x equ 585 ;minimum size x
ci_wnd_min_siz_y equ 400 ;minimum size y
; ¯ ­¥«ì ¨­áâà㬥­â®¢
ci_panel_x_pos equ 0 ;ª®®à¤. x ¤«ï ¯ ­¥«¨
ci_panel_y_pos equ 20 ;ª®®à¤. y ¤«ï ¯ ­¥«¨
ci_panel_but_y1 equ ci_panel_y_pos +5 ;ª®®à¤. y ¤«ï 1-£® à鸞 ª­®¯®ª
ci_panel_but_y2 equ ci_panel_y_pos+30 ;ª®®à¤. y ¤«ï 2-£® à鸞 ª­®¯®ª
ci_palete_y_pos equ ci_panel_y_pos+51 ;ª®®à¤. y ¤«ï ¯ «¨âàë æ¢¥â®¢
ci_panel_zoom_x equ 178 ;ª®®à¤. x ¤«ï ª­®¯®ª ¯ ­¥«¨ ¬ áèâ ¡ 
; toolbar
ci_panel_x_pos equ 0 ;coord. x for panel
ci_panel_y_pos equ 20 ;coord. y for panel
ci_panel_but_y1 equ ci_panel_y_pos +5 ;y coordinate for 1st row of buttons
ci_panel_but_y2 equ ci_panel_y_pos+30 ;y coordinate for 2nd row of buttons
ci_palete_y_pos equ ci_panel_y_pos+51 ;y coordinate for color palette
ci_panel_zoom_x equ 178 ;x coordinate for zoom bar buttons
; ®ª­® । ªâ®à 
ci_edit_wnd_x_pos equ 0 ;ª®®à¤. x ¤«ï ®ª­  । ªâ®à 
ci_edit_wnd_y_pos equ 71 ;ª®®à¤. y ¤«ï ®ª­  । ªâ®à 
ci_edit_wnd_border equ 3 ;à ¬ª  ¢®ªà㣠®ª­  । ªâ®à 
; editor window
ci_edit_wnd_x_pos equ 0 ;x coordinate for editor window
ci_edit_wnd_y_pos equ 71 ;y coordinate for editor window
ci_edit_wnd_border equ 3 ;frame around the editor window
; áªà®««¨­£¨
ci_scroll_dim equ 22 ;à §¬¥àë áªà®««¨­£®¢
ci_scrollh_coord_x_min equ (ci_edit_wnd_x_pos+3) ;¬¨­¨¬ «ì­ ï ¯®§¨æ¨ï ¯®«§ã­ª 
;£®à¨§®­â «ì­®£® áªà®««¨­£ 
ci_scrollv_coord_y_min equ (ci_edit_wnd_y_pos+3) ;¬¨­¨¬ «ì­ ï ¯®§¨æ¨ï ¯®«§ã­ª 
;¢¥à⨪ «ì­®£® áªà®««¨­£ 
; scrolling
ci_scroll_dim equ 22 ;scroll sizes
ci_scrollh_coord_x_min equ (ci_edit_wnd_x_pos+3) ;x minimum slider position
;horizontal scrolling
ci_scrollv_coord_y_min equ (ci_edit_wnd_y_pos+3) ;y minimum slider position
;vertical scrolling
;---------------------------------------------------------
include 'bmplib.inc'
@@ -254,7 +256,7 @@ PointerToCopyPicture rd 1
PointerToCopyPicture2 rd 1
PointerToEditBufer rd 1
PointerToSpriteBufer rd 1
PointerToPalette rd 1 ;㪠§ â¥«ì ­  ¯¨«¨âàã (­ã¦¥­ ¤«ï á®åà ­¥­¨ï ¢ *.bmp)
PointerToPalette rd 1 ;pointer to the file (needed for saving in *.bmp)
Color rd 1
SColor rd 1
Number_Brush rd 1
@@ -267,34 +269,34 @@ OldY rd 1
MouseX rd 1
MouseY rd 1
MouseBut rd 1 ;ᮡëâ¨ï ®â ª­®¯®ª ¬ëè¨
MouseBut rd 1 ;mouse button events
Window_SizeX rd 1
Window_SizeY rd 1
Window_CordinatX rd 1
Window_CordinatY rd 1
Picture_SizeX rd 1
Picture_SizeY rd 1
ScreenX rd 1 ;ª®®à¤¨­ â  x ªãàá®à  á ãç¥â®¬ ¬ áèâ ¡ 
ScreenY rd 1 ;ª®®à¤¨­ â  y ªãàá®à  á ãç¥â®¬ ¬ áèâ ¡ 
WorkScreen_SizeX rd 1 ;è¨à¨­  à ¡®ç¥£® íªà ­ 
WorkScreen_SizeY rd 1 ;¢ëá®â  à ¡®ç¥£® íªà ­ 
ScreenX rd 1 ;x coordinate of the cursor accounting for the scale
ScreenY rd 1 ;y coordinate of the cursor accounting for the scale
WorkScreen_SizeX rd 1 ;width of the working screen
WorkScreen_SizeY rd 1 ;height of the working screen
MaxWorkScreen_SizeX rd 1
MaxWorkScreen_SizeY rd 1
k rd 1 ;¬ áèâ ¡
k rd 1 ;scale
ReserveArray rd 1 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¨á¯®«ì§ã¥¬ãî ¯à¨ à¨á®¢ ­¨¨ 䨣ãà
;¤«ï á®åà ­¥­¨ï ãç á⪮¢ ä®­  ¯®¤ 䨣ãà ¬¨,   â ª¦¥ ¤«ï § «¨¢ª¨
CounterX rd 1 ;ç¨á«® ¯¨ªá¥«¥© ¨§®¡à ¦¥­¨ï ¯® è¨à¨­¥, ª®â®àë¥ ¯®¯ ¤ îâ
;¢ íªà ­ à ¡®ç¥© ®¡« áâ¨, á ãç¥â®¬ ⥪ã饣® ¬ áèâ ¡ 
ReserveArray rd 1 ;pointer to memory used when drawing figures
;to save background areas under figures, as well as for filling
CounterX rd 1 ;number of image pixels by width that fall
;within the workspace screen, given the current zoom level
CounterY rd 1
OffsetYPicture rd 1 ;ᤢ¨£ ¯® ®á¨ y ¢ ¡ãä¥à¥ ¨§®¡à ¦¥­¨ï ¯à¨ à¨á®¢ ­¨¨
;á«¥¤ãî饩 «¨­¨¨ ¨§®¡à ¦¥­¨ï
OffsetYWorkScreen rd 1 ;ᤢ¨£ ¯® ®á¨ y ¢ ¡ãä¥à¥ à ¡®ç¥© ®¡« á⨠¯à¨
;à¨á®¢ ­¨¨ á«¥¤ãî饩 «¨­¨¨ ¯¨ªá¥«¥©. —¥¬ ¡®«ìè¥ ¬ áèâ ¡, ⥬ ­¨¦¥
;­ã¦­® ®¯ã᪠âìáï ¯® à ¡®ç¥© ®¡« áâ¨.
OffsetYBigPixel rd 1 ;ᤢ¨£ ¯® ®á¨ y ¤«ï à¨á®¢ ­¨ï ¯¨ªá¥«¥© ­  ¡®«ì讬
;¬ áèâ ¡¥. <20>¨áã¥âáï 1-ï ¯®«®á  ¯¨ªá¥«ï,   ¯®â®¬ ­ã¦­® ¯¥à¥©â¨ ¢­¨§ ¨
;¢«¥¢® ¤«ï à¨á®¢ ­¨ï á«¥¤ãî饩 ¯®«®áë.
OffsetYPicture rd 1 ;y-shift in image buffer when drawing
;next line of image
OffsetYWorkScreen rd 1 ;y-shift in the workspace buffer when
;drawing the next line of pixels. The larger the scale, the lower
;you need to go down the workspace.
OffsetYBigPixel rd 1 ;shift along the y-axis to draw pixels on a large
;scale. The 1st strip of the pixel is drawn, and then you need to move down and
;left to draw the next strip.
Icon_X rd 1
Icon_Y rd 1
@@ -329,14 +331,14 @@ b_ellips rd 1
used_OldX rd 1 ;for draw hard contour
used_OldY rd 1
paste_img_w rd 1 ;è¨à¨­  ¢áâ ¢«ï¥¬®£® ¨§®¡à ¦¥­¨ï
paste_img_h rd 1 ;¢ëá®â  ¢áâ ¢«ï¥¬®£® ¨§®¡à ¦¥­¨ï
crossing_old_x rd 1 ;­ ç «ì­ ï ª®®à¤. x ®¡« á⨠ª®¯¨à®¢ ­¨ï
crossing_old_y rd 1 ;­ ç «ì­ ï ª®®à¤. y ®¡« á⨠ª®¯¨à®¢ ­¨ï
rectangular_shade_x rd 1 ;ª®­¥ç­ ï ª®®à¤. x ®¡« á⨠ª®¯¨à®¢ ­¨ï
rectangular_shade_y rd 1 ;ª®­¥ç­ ï ª®®à¤. y ®¡« á⨠ª®¯¨à®¢ ­¨ï
crossing rd 1 ;0 - ¢ë¤¥«¥­¨ï ­¥â, 1 - ¨¤¥â ¯à®æ¥á ¢ë¤¥«¥­¨ï,
;2 - ¢ë¤¥«¥­¨¥ § ¢¥à襭®, 3 - ®¡« áâì ¢ë¤¥«¥­¨ï ¯¥à¥¬¥é ¥âáï
paste_img_w rd 1 ;width of the inserted image
paste_img_h rd 1 ;height of the inserted image
crossing_old_x rd 1 ;initial x-coord of copy area
crossing_old_y rd 1 ;initial y-coord of copy area
rectangular_shade_x rd 1 ;end x-coord of copy area
rectangular_shade_y rd 1 ;end y-coord of copy area
crossing rd 1 ;0 - no selection, 1 - selection in progress,
;2 - selection complete, 3 - selection area moving
number_undo rd 1
SpriteSizeX rd 1 ;???
SpriteSizeY rd 1 ;???
@@ -347,8 +349,8 @@ SpriteOldCoordinatY rd 1
CursorsID rd 10
Activate_instrument rb 1 ;¥á«¨ à ¢­® 0 - â® ª®¯¨à®¢ ­¨¥ ⥪ã饣® ¡ãä¥à 
;¤«ï ¥£® । ªâ¨à®¢ ­¨ï, ¥á«¨ 1 - ⥪ã騩 ¡ãä¥à ­¥ ª®¯¨àã¥âáï
Activate_instrument rb 1 ;if equal to 0 - then copy the current buffer
;for editing it, if 1 - the current buffer is not copied
save_flag rb 1
exit_from_work_arrea rb 1
lastik_is_active rb 1

View File

Before

Width:  |  Height:  |  Size: 766 B

After

Width:  |  Height:  |  Size: 766 B

View File

Before

Width:  |  Height:  |  Size: 766 B

After

Width:  |  Height:  |  Size: 766 B

View File

Before

Width:  |  Height:  |  Size: 766 B

After

Width:  |  Height:  |  Size: 766 B

View File

Before

Width:  |  Height:  |  Size: 766 B

After

Width:  |  Height:  |  Size: 766 B

View File

Before

Width:  |  Height:  |  Size: 766 B

After

Width:  |  Height:  |  Size: 766 B

View File

Before

Width:  |  Height:  |  Size: 766 B

After

Width:  |  Height:  |  Size: 766 B

Some files were not shown because too many files have changed in this diff Show More