1) some programs use new macros load_lib.mac

2) bcc32 add example use libimg.obj

git-svn-id: svn://kolibrios.org@8236 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2020-11-22 13:13:45 +00:00
parent 8311f3e3c4
commit faf7939a32
27 changed files with 417 additions and 412 deletions

View File

@ -2,8 +2,8 @@ Set NAME=file_open
Set BCC_DIR=..\..\..\bcc32
kos32-bcc -S -v- -R- -6 -a4 -O2 -Og -Oi -Ov -OS -k- -D__KOLIBRI__ -I..\..\..\bcc32\include %NAME%.cpp
echo STACKSIZE equ 102400> kos_make.inc
echo HEAPSIZE equ 102400>> kos_make.inc
echo STACKSIZE equ 8192> kos_make.inc
echo HEAPSIZE equ 0>> kos_make.inc
echo include "%BCC_DIR%\include\kos_start.inc">> kos_make.inc
echo include "%BCC_DIR%\include\kos_func.inc">> kos_make.inc
echo include "%BCC_DIR%\include\kos_heap.inc">> kos_make.inc

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

View File

@ -0,0 +1,19 @@
# Path to /programs
SVN_PROGR:=../../..
# Path to /programs/bcc32
SVN_BCC32:=$(SVN_PROGR)/bcc32
# Path to t2fasm
T2FASM:=$(SVN_BCC32)/t2fasm
# Path to include
INCLUDE:=$(SVN_BCC32)/include
# Path to Bin folder
KOS32_BCC:=/home/autobuild/borlandcpp/bin
# Filename without .cpp
FILENAME:=libimg_1
include $(SVN_BCC32)/Makefile_app

View File

@ -0,0 +1,81 @@
#include <kolibri.h>
#include <kos_heap.h>
#include <kos_file.h>
#include <load_lib.h>
#include <l_libimg.h>
using namespace Kolibri;
const char header[] = "Image";
unsigned char* img_d = 0;
long img_w, img_h;
char library_path[2048];
namespace Kolibri{
char CurrentDirectoryPath[2048];
}
bool KolibriOnStart(TStartData &kos_start, TThreadData /*th*/)
{
kos_start.Left = 10;
kos_start.Top = 40;
kos_start.Width = 280;
kos_start.Height = 200;
kos_start.WinData.WindowColor = 0xFFFFFF;
kos_start.WinData.WindowType = 0x33; // 0x34 - fixed, 0x33 - not fixed
kos_start.WinData.Title = header;
LoadLibrary("libimg.obj", library_path, "/sys/lib/libimg.obj", &import_libimg);
return true;
}
void KolibriOnPaint(void)
{
// If button have ID 1, this is close button
DrawButton(2,0xf0f0f0, 10,10,50,20);
DrawText(20,16,0,"Open");
if(img_d) PutImage(img_d,10,40,img_w,img_h);
}
void KolibriOnButton(long id, TThreadData /*th*/)
{
FileInfoBlock* file;
long int k;
switch(id){
case 2:
file = FileOpen("1.png");
if (!file){
SetWindowCaption("Error open file '1.png'");
break;
}
k = FileGetLength(file);
if (k > 0){
if(img_d) Free(img_d);
img_d = (unsigned char*)Alloc(k);
if (img_d){
if (FileRead(file, img_d, k) != k){
Free(img_d); img_d = 0;
}
else{
Image* img;
img = img_decode(img_d,k,0);
img_w = img->Width;
img_h = img->Height;
img_d = (unsigned char*)ReAlloc(img_d, 3*img_w*img_h);
//if (!img_d){ ... }
img_to_rgb2(img,img_d);
img_destroy(img);
SetWindowCaption("1.png");
Redraw(1);
}
}
}
FileClose(file);
//break;
};
}
bool KolibriOnClose(TThreadData /*th*/) {
if(img_d) {Free(img_d); img_d = 0;}
return true;
}

View File

@ -0,0 +1,16 @@
Set NAME=libimg_1
Set BCC_DIR=..\..\..\bcc32
kos32-bcc -S -v- -R- -6 -a4 -O2 -Og -Oi -Ov -OS -k- -D__KOLIBRI__ -I..\..\..\bcc32\include %NAME%.cpp
echo STACKSIZE equ 8192> kos_make.inc
echo HEAPSIZE equ 0>> kos_make.inc
echo include "%BCC_DIR%\include\kos_start.inc">> kos_make.inc
echo include "%BCC_DIR%\include\kos_func.inc">> kos_make.inc
echo include "%BCC_DIR%\include\kos_heap.inc">> kos_make.inc
echo include "kos_make.inc" > f_%NAME%.asm
t2fasm < %NAME%.asm >> f_%NAME%.asm
fasm f_%NAME%.asm %NAME%.kex
if exist %NAME%.kex kpack %NAME%.kex
if exist %NAME%.kex del kos_make.inc
pause

View File

@ -2,8 +2,8 @@ Set NAME=template
Set BCC_DIR=..\..\..\bcc32
kos32-bcc -S -v- -R- -6 -a4 -O2 -Og -Oi -Ov -OS -k- -D__KOLIBRI__ -I..\..\..\bcc32\include %NAME%.cpp
echo STACKSIZE equ 102400> kos_make.inc
echo HEAPSIZE equ 102400>> kos_make.inc
echo STACKSIZE equ 8192> kos_make.inc
echo HEAPSIZE equ 0>> kos_make.inc
echo include "%BCC_DIR%\include\kos_start.inc">> kos_make.inc
echo include "%BCC_DIR%\include\kos_func.inc">> kos_make.inc
echo include "%BCC_DIR%\include\kos_heap.inc">> kos_make.inc

View File

@ -2,8 +2,8 @@ Set NAME=window
Set BCC_DIR=..\..\..\bcc32
kos32-bcc -S -v- -R- -6 -a4 -O2 -Og -Oi -Ov -OS -k- -D__KOLIBRI__ -I..\..\..\bcc32\include %NAME%.cpp
echo STACKSIZE equ 102400> kos_make.inc
echo HEAPSIZE equ 102400>> kos_make.inc
echo STACKSIZE equ 8192> kos_make.inc
echo HEAPSIZE equ 0>> kos_make.inc
echo include "%BCC_DIR%\include\kos_start.inc">> kos_make.inc
echo include "%BCC_DIR%\include\kos_func.inc">> kos_make.inc
echo include "%BCC_DIR%\include\kos_heap.inc">> kos_make.inc

View File

@ -8,7 +8,7 @@
namespace Kolibri // All kolibri functions, types and data are nested in the (Kolibri) namespace.
{
const char *DebugPrefix = "User program: ";
char CommandLine[257];
char CommandLine[4096];
struct TWindowData // Data for drawing a window.
{
@ -135,6 +135,7 @@ namespace Kolibri // All kolibri functions, types and data are nested in the (
//_ of the stack if (stack_end) is zero or (stack_size) is not zero, in this case stack
//_ will be deleted automaticaly from dynamic memory at the finish of the thread.
void DrawText(short x, short y, int color, const char* string);
void PutImage(unsigned char* img_data, long img_l, long img_t, long img_w, long img_h);
void SetWindowCaption(const char* caption);
}

View File

@ -77,16 +77,13 @@ proc @Kolibri@Main$qv
mov ebx,esp
mov ecx,-1
int 0x40
mov ebx,[esp+26]
mov edx,[esp+30]
mov ebx,[esp+process_information.used_memory]
mov edx,[esp+process_information.PID]
lea eax,[ebx-0x20]
add esp,1024
cmp esp,eax
cmova esp,eax
and esp,not 3
if defined @Kolibri@CommandLine
mov byte [@Kolibri@CommandLine+256], 0
end if
xor eax,eax
cld
mov edi,@Kolibri@_ThreadTable
@ -173,10 +170,10 @@ end if
mov ebx,esp
mov ecx,-1
int 0x40
mov eax,[esp+34]
mov ebx,[esp+38]
mov ecx,[esp+42]
mov edx,[esp+46]
mov eax,[esp+process_information.box.left]
mov ebx,[esp+process_information.box.top]
mov ecx,[esp+process_information.box.width]
mov edx,[esp+process_information.box.height]
add esp,1024
cmp ecx,[esp+KOLIBRI_THREAD_DATA_LAST_SX*4]
jnz .main_size
@ -332,15 +329,6 @@ end if
ret
endp
macro call func
{
if func eq __chkstk
sub esp,eax
else
call func
end if
}
proc @Kolibri@Redraw$qippv
push ebp
mov ebp,[esp+12]
@ -379,7 +367,7 @@ proc @Kolibri@Redraw$qippv
add ecx,5-1
mov edx,[ebp+KOLIBRI_THREAD_DATA_C_WINDOW*4]
mov edi,[ebp+KOLIBRI_THREAD_DATA_TITLE*4]
xor eax,eax
xor eax,eax ;SF_CREATE_WINDOW
int 0x40
.redraw_picture:
call @@KolibriOnPaint$qv
@ -420,13 +408,13 @@ proc @Kolibri@ExitProcess$qv
mov ecx,-1
int 0x40
mov esi,eax
mov edi,[esp+30]
mov edi,[esp+process_information.PID]
.exit_process_loop:
mov eax,SF_THREAD_INFO
mov ebx,esp
mov ecx,esi
int 0x40
mov eax,[esp+30]
mov eax,[esp+process_information.PID]
cmp eax,edi
jz .exit_process_continue
mov ebx,eax
@ -476,16 +464,16 @@ end if
jmp .exit_process_wait_loop
endp
proc @Kolibri@ExitThread$qppv,@Kolibri@ThreadMain$qpvt1
proc @Kolibri@ExitThread$qppv
mov esp,[esp+4]
jmp Kolibri_main_end
jmp @Kolibri@ThreadMain$qpvt1.main_end
endp
proc @Kolibri@ReturnMessageLoop$qppv,@Kolibri@ThreadMain$qpvt1
proc @Kolibri@ReturnMessageLoop$qppv
mov esp,[esp+4]
bt dword [esp+KOLIBRI_THREAD_DATA_FLAG*4],30
jc Kolibri_main_end
jmp Kolibri_main_cycle
jc @Kolibri@ThreadMain$qpvt1.main_end
jmp @Kolibri@ThreadMain$qpvt1.main_cycle
endp
proc @Kolibri@Delay$qui uses ebx
@ -598,6 +586,17 @@ proc @Kolibri@DrawText$qssipxc uses ebx
ret
endp
proc @Kolibri@PutImage$qpucllll uses ebx
mov eax,SF_PUT_IMAGE
mov ebx,[esp+8]
mov ecx,[esp+20-2]
mov cx,[esp+24]
mov edx,[esp+12-2]
mov dx,[esp+16]
int 0x40
ret
endp
proc @Kolibri@SetWindowCaption$qpxc uses ebx
mov eax,SF_SET_CAPTION
mov ebx,2
@ -621,7 +620,7 @@ proc @Kolibri@GetProcessInfo$qpuipct1t1piui uses ebx esi edi
.get_proc_info_no_usecpu:
or edi,[1024+12+8+esp]
jz .get_proc_info_no_name
lea esi,[esp+10]
lea esi,[esp+process_information.process_name]
cld
movsd
movsd
@ -631,19 +630,19 @@ proc @Kolibri@GetProcessInfo$qpuipct1t1piui uses ebx esi edi
.get_proc_info_no_name:
or edi,[1024+12+12+esp]
jz .get_proc_info_no_mem
mov ecx,[esp+26]
mov ecx,[esp+process_information.used_memory]
mov [edi],ecx
xor edi,edi
.get_proc_info_no_mem:
or edi,[1024+12+16+esp]
jz .get_proc_info_no_pid
mov ecx,[esp+30]
mov ecx,[esp+process_information.PID]
mov [edi],ecx
xor edi,edi
.get_proc_info_no_pid:
or edi,[1024+12+20+esp]
jz .get_proc_info_no_rect
lea esi,[esp+34]
lea esi,[esp+process_information.box]
cld
movsd
movsd

View File

@ -6,10 +6,22 @@ org 0
dd I_END
dd U_END+STACKSIZE+HEAPSIZE
dd U_END+STACKSIZE
dd @Kolibri@CommandLine,0
if defined @Kolibri@CommandLine
dd @Kolibri@CommandLine
else
dd 0
end if
if defined @Kolibri@CurrentDirectoryPath
dd @Kolibri@CurrentDirectoryPath
else
dd 0
end if
include "..\..\..\KOSfuncs.inc"
include "..\..\..\proc32.inc"
include "..\..\..\macros.inc"
include "..\..\..\dll.inc"
include "..\..\..\load_lib.mac"
ptr equ
offset equ

View File

@ -0,0 +1,53 @@
#ifndef __L_LIBIMG_H_INCLUDED_
#define __L_LIBIMG_H_INCLUDED_
//
// libimg.obj
//
struct Image{
long Checksum; // ((Width ROL 16) OR Height) XOR Data[0] ; ignored so far
long Width;
long Height;
long Next;
long Previous;
long Type; // one of Image.bppN
long Data;
long Palette; // used iff Type eq Image.bpp1, Image.bpp2, Image.bpp4 or Image.bpp8i
long Extended;
long Flags; // bitfield
long Delay; // used iff Image.IsAnimated is set in Flags
};
//
// libimg - import table
//
void (__stdcall* import_libimg)() = (void (__stdcall*)())&"lib_init";
//"img_is_img";
//"img_info";
//"img_from_file";
//"img_to_file";
//"img_from_rgb";
//"img_to_rgb";
void (__stdcall* img_to_rgb2)(Image* img, unsigned char* out) = (void (__stdcall*)(Image*, unsigned char*))&"img_to_rgb2";
//"img_encode";
Image* (__stdcall* img_decode)(unsigned char* data, long length, long options) = (Image* (__stdcall*)(unsigned char*, long, long))&"img_decode";
Image* (__stdcall* img_create)(long width, long height, long type) = (Image* (__stdcall*)(long, long, long))&"img_create";
bool (__stdcall* img_destroy)(Image* img) = (bool (__stdcall*)(Image*))&"img_destroy";
//"img_destroy_layer";
//"img_count";
//"img_lock_bits";
//"img_unlock_bits";
//"img_flip";
//"img_flip_layer";
//"img_rotate";
//"img_rotate_layer";
//"img_draw";
//"img_scale";
//"img_get_scaled_size";
Image* (__stdcall* img_convert)(Image* src, Image* dst, long dst_type, long flags, long param) = (Image* (__stdcall*)(Image*, Image*, long, long, long))&"img_convert";
//"img_formats_table";
asm{
dd 0,0
}
#endif

View File

@ -0,0 +1,18 @@
#ifndef __LOAD_LIB_H_LINCLUDED_
#define __LOAD_LIB_H_INCLUDED_
// macros '@use_library' and 'load_library' defined in file 'load_lib.mac'
asm{
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
}
bool LoadLibrary(const char* lib_name, char* lib_path, const char* system_path, void* myimport)
{
asm{
load_library [ebp+8], [ebp+12], [ebp+16], [ebp+20]
}
return true;
}
#endif

View File

@ -50,7 +50,8 @@ org 0x0
;---------------------------------------------------------------------
include '../../../macros.inc'
;include 'macros.inc'
include '../../../develop/libraries/box_lib/load_lib.mac'
include '../../../KOSfuncs.inc'
include '../../../load_lib.mac'
;include 'load_lib.mac'
@use_library
;---------------------------------------------------------------------
@ -1233,28 +1234,18 @@ icons_file_name db 'texture_24b.png',0
;---------------------------------------------------------------------
plugins_directory db 0
system_dir_Boxlib db '/sys/lib/box_lib.obj',0
;system_dir_Boxlib db '/sys/lib/box_lib.obj',0
system_dir_CnvPNG db '/sys/lib/cnv_png.obj',0
system_dir_Sort db '/sys/lib/sort.obj',0
;system_dir_Sort db '/sys/lib/sort.obj',0
system_dir_UNPACK db '/sys/lib/archiver.obj',0
ihead_f_i:
ihead_f_l db 'System error',0
er_message_found_lib1 db 'cnv_png.obj - Not found!',0
er_message_import1 db 'cnv_png.obj - Wrong import!',0
err_message_found_lib2 db 'archiver.obj - Not found!',0
err_message_import2 db 'archiver.obj - Wrong import!',0
align 4
l_libs_start:
library01 l_libs system_dir_CnvPNG+9,path,file_name,system_dir_CnvPNG,\
er_message_found_lib1,ihead_f_l,cnv_png_import,er_message_import1,ihead_f_i,plugins_directory
library01 l_libs system_dir_CnvPNG+9,file_name,system_dir_CnvPNG,\
cnv_png_import,plugins_directory
library02 l_libs system_dir_UNPACK+9,path,file_name,system_dir_UNPACK,\
err_message_found_lib2,ihead_f_l,UNPACK_import,err_message_import2,ihead_f_i,plugins_directory
library02 l_libs system_dir_UNPACK+9,file_name,system_dir_UNPACK,\
UNPACK_import,plugins_directory
end_l_libs:
;---------------------------------------------------------------------

View File

@ -2,35 +2,27 @@
;¨ ¤à㣨¬ ¯à®£à ¬¬¨áâ ¬,   â ª¦¥
;’¥¯«®¢ã €«¥ªá¥î (<Lrz> www.lrz.land.ru)
use32
org 0x0
org 0
db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
dd 0x1
dd start
dd i_end ; à §¬¥à ¯à¨«®¦¥­¨ï
dd mem
dd stacktop
dd 0x0 ;library_path
dd cur_dir_path
dd 0,start,i_end,mem,stacktop,0,cur_dir_path
include '../../KOSfuncs.inc'
include '../../macros.inc'
include '../../develop/libraries/box_lib/load_lib.mac'
include '../../proc32.inc'
include '../../load_lib.mac'
include 'lang.inc'
@use_library
align 4
start:
mcall SF_SET_EVENTS_MASK,0x25 ;¬ áª  ®¦¨¤ ¥¬ëå ᮡë⨩
mov eax,40
mov ebx,0x25 ;¬ áª  ®¦¨¤ ¥¬ëå ᮡë⨩
mcall
sys_load_library msgbox_name, cur_dir_path, library_path, system_path, \
err_message_found_lib, head_f_l, msgbox_lib_import, err_message_import, head_f_i
sys_load_library msgbox_name, library_path, system_path, msgbox_lib_import
red_win:
mcall 12,1
mcall SF_REDRAW,SSF_BEGIN_DRAW
xor eax,eax
mov ebx,50*65536+200
@ -40,7 +32,7 @@ red_win:
mov edi,hed
mcall
mov eax,8 ;ª­®¯ª 
mov eax,SF_DEFINE_BUTTON
mov ebx,10*65536+30
mov ecx,110*65536+20
mov edx,7
@ -71,28 +63,28 @@ red_win:
mov ebx,50*65536+115
mov ecx,0x4000d0
or ecx,0x80000000
mov edx,txt140
mov edx,txt5
mcall
mov ebx,50*65536+90
mov edx,txt139
mov edx,txt4
mcall
mov ebx,50*65536+65
mov edx,txt138
mov edx,txt3
mcall
mov ebx,50*65536+40
mov edx,txt137
mov edx,txt2
mcall
mov ebx,50*65536+15
mov edx,txt136
mov edx,txt1
mcall
push eax ebx ecx edx esi
;line numbers
mov eax,47
mov eax,SF_DRAW_NUMBER
mov esi,0xd00000
mov ebx,0x10000 ;format
@ -122,11 +114,11 @@ red_win:
pop esi edx ecx ebx eax
call draw_square
mcall 12,2
mcall SF_REDRAW,SSF_END_DRAW
align 4
still:
mov eax,10
mcall
mcall SF_WAIT_EVENT
cmp al,1 ;¨§¬. ¯®«®¦¥­¨¥ ®ª­ 
jz red_win
@ -135,7 +127,7 @@ still:
jmp still
button:
mcall 17 ;¯®«ãç¨âì ª®¤ ­ ¦ â®© ª­®¯ª¨
mcall SF_GET_BUTTON
cmp ah,3
jz but_1
@ -151,64 +143,46 @@ button:
cmp ah,1
jne still
.exit:
mcall -1 ;¢ë室 ¨§ ¯à®£à ¬¬ë
mcall SF_TERMINATE_PROCESS
but_1:
push thread
push msgbox_1
call [mb_create]
stdcall [mb_create],msgbox_1,thread
jmp still
but_2:
push thread
push msgbox_2
call [mb_create]
;mov eax,5
;mov ebx,50
;int 0x40
push msgbox_2_funct
call [mb_setfunctions]
stdcall [mb_create],msgbox_2,thread
stdcall [mb_setfunctions],msgbox_2_funct
jmp still
but_3:
push thread
push msgbox_3
call [mb_create]
stdcall [mb_create],msgbox_3,thread
jmp still
but_4:
push thread
push msgbox_4
call [mb_create]
stdcall [mb_create],msgbox_4,thread
jmp still
but_5:
push thread
push msgbox_5
call [mb_create]
mcall 5,100 ;stop program
push msgbox_5_2
call [mb_reinit]
stdcall [mb_create],msgbox_5,thread
mcall SF_SLEEP,100 ;stop program
stdcall [mb_reinit],msgbox_5_2
jmp still
if lang eq ru
txt136 db '¯à®á⮥',0
txt137 db '3 ª­®¯ª¨',0
txt138 db '3 áâப¨',0
txt139 db '¡®«ì讥',0
txt140 db 'mb_reinit',0
txt1 db '¯à®á⮥',0
txt2 db '3 ª­®¯ª¨',0
txt3 db '3 áâப¨',0
txt4 db '¡®«ì讥',0
txt5 db 'mb_reinit',0
hed db '<27>ਬ¥à ¨á¯®«ì§®¢ ­¨ï MsgBox',0
else
txt136 db 'Simple',0
txt137 db '3 buttons',0
txt138 db '3 lines',0
txt139 db 'Big',0
txt140 db 'mb_reinit',0
txt1 db 'Simple',0
txt2 db '3 buttons',0
txt3 db '3 lines',0
txt4 db 'Big',0
txt5 db 'mb_reinit',0
hed db 'MsgBox usage example',0
end if
end if
;sc system_colors
@ -240,20 +214,18 @@ else
end if
db 0
msgbox_2_funct:
dd 0
dd 0
dd fun_show_help
dd 0,0,fun_show_help
msgbox_3:
dw 0
db 'MBox 3 lines',0 ;+2 = +MB_TEXT_OFFSET
if lang eq ru
db '‘âப  1',13,'‘âப  2',13,'‘âப  3',0
db '2009 £.',0 ;button1
db '2020 £.',0 ;button1
else
db 'Line 1',13,'Line 2',13,'Line 3',0
db 'Year 2009',0 ;button1
end if
db 'Year 2020',0 ;button1
end if
db 0
msgbox_4:
dw 0
@ -282,21 +254,9 @@ end if
db ' @......@....@..@....@.........@',13
db ' @@@@@@@@@@@@@@@@@@@@@@@@@@@@@',0
if lang eq ru
db '<27>­',0
db '‚â',0
db '‘à',0
db '—â',0
db '<27>â',0
db '‘¡',0
db '‚®áªà¥á¥­¨¥',0
db '<27>­',0,'‚â',0,'‘à',0,'—â',0,'<27>â',0,'‘¡',0,'‚®áªà¥á¥­¨¥',0
else
db 'Sun',0
db 'Mon',0
db 'Tue',0
db 'Wed',0
db 'Thu',0
db 'Fri',0
db 'Sat',0
db 'Sun',0,'Mon',0,'Tue',0,'Wed',0,'Thu',0,'Fri',0,'Sat',0
end if
db 0
msgbox_5:
@ -310,7 +270,7 @@ else
db 'Message',0 ;+2 = +MB_TEXT_OFFSET
db 'Running process ...',0
db 'Stop',0
db 'Abort',0
db 'Terminate',0
end if
db 0
msgbox_5_2:
@ -339,38 +299,20 @@ msgbox_lib_import:
;--------------------------------------------------
system_path db '/sys/lib/'
msgbox_name db 'msgbox.obj',0
err_message_found_lib db 'Sorry I cannot load library msgbox.obj',0
head_f_i:
head_f_l db 'System error',0
err_message_import db 'Error on load import library msgbox.obj',0
;--------------------------------------------------
draw_square:
cmp byte[sh_help],0
je @f
push eax ebx ecx edx
mov eax,13 ;à¨á®¢ ­¨¥ ¯àאַ㣮«ì­¨ª 
mov ebx,105*65536+70
mov ecx,15*65536+50
mov edx,0x8080ff
int 0x40
mcall SF_DRAW_RECT, 105*65536+70, 15*65536+50, 0x8080ff
mcall SF_DRAW_TEXT, 110*65536+25, 0xffffff, txt_help
mov eax,4 ;à¨á®¢ ­¨¥ ⥪áâ 
mov ebx,110*65536+25
mov ecx,0xffffff
mov edx,txt_help
mov esi,9
mcall
mov eax,47
mov esi,0xffff
mov ebx,0x10000 ;format
xor ecx,ecx
mov cl,byte[sh_help]
mov dx,150
shl edx,16
mov dx,40
int 0x40
movzx ecx,byte[sh_help]
mov edx,(150 shl 16)+40
mcall SF_DRAW_NUMBER
pop edx ecx ebx eax
@@:
@ -390,6 +332,7 @@ else
txt_help db 'Help...'
end if
align 16
i_end: ;ª®­¥æ ª®¤ 
rb 1024
thread:

View File

@ -16,14 +16,14 @@ include 'lang.inc'
include '../../../../macros.inc'
include '../../../../proc32.inc'
include '../../../../KOSfuncs.inc'
include '../../../../develop/libraries/box_lib/load_lib.mac'
include '../../../../load_lib.mac'
include '../../../../dll.inc'
KMENUITEM_NORMAL equ 0
KMENUITEM_SUBMENU equ 1
KMENUITEM_SEPARATOR equ 2
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
start: ; start of execution
@ -264,22 +264,9 @@ align 4
system_dir_0 db '/sys/lib/'
lib_name_0 db 'kmenu.obj',0
if lang eq ru
head_f_i:
head_f_l db '‘¨á⥬­ ï ®è¨¡ª ',0
err_msg_found_lib_0 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'kmenu.obj',39,0
err_msg_import_0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'kmenu',39,0
else
head_f_i:
head_f_l db 'System error',0
err_msg_found_lib_0 db 'Sorry I cannot found library ',39,'kmenu.obj',39,0
err_msg_import_0 db 'Error on load import library ',39,'kmenu.obj',39,0
end if
align 4
l_libs_start:
lib_0 l_libs lib_name_0, sys_path, file_name, system_dir_0,\
err_msg_found_lib_0, head_f_l, import_libkmenu,err_msg_import_0,head_f_i
lib_0 l_libs lib_name_0, file_name, system_dir_0, import_libkmenu
l_libs_end:
align 4

View File

@ -1,7 +1,7 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; flat assembler source ;;
;; Copyright (c) 1999-2012, Tomasz Grysztar ;;
;; Copyright (c) 1999-2020, Tomasz Grysztar ;;
;; All rights reserved. ;;
;; ;;
;; KolibriOS port by KolibriOS Team ;;
@ -42,7 +42,8 @@ purge add,sub ; macros.inc does incorrect substitution
include 'fasm.inc'
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
include '../../../develop/libraries/box_lib/load_lib.mac'
include '../../../KOSfuncs.inc'
include '../../../load_lib.mac'
@use_library
center fix true
@ -476,12 +477,6 @@ text:
s_dbgdescr db '‘®§¤ ¢ âì ®â« ¤®ç­ãî ¨­ä®à¬ æ¨î',0
err_message_found_lib0 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  box_lib.obj',0 ;áâப , ª®â®à ï ¡ã¤¥â ¢ áä®à¬¨à®¢ ­­®¬ ®ª­¥, ¥á«¨ ¡¨¡«¨®â¥ª  ­¥ ¡ã¤¥â ­ ©¤¥­ 
err_message_import0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ box_lib.obj',0
err_message_found_lib1 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  proc_lib.obj',0
err_message_import1 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ proc_lib.obj',0
head_f_i:
head_f_l db '‘¨á⥬­ ï ®è¨¡ª ',0 ;§ £®«®¢®ª ®ª­ , ¯à¨ ¢®§­¨ª­®¢¥­¨¨ ®è¨¡ª¨
else
text:
db ' InFile:'
@ -496,13 +491,6 @@ text:
s_dbgdescr db 'Generate debug information',0
err_message_found_lib0 db 'Sorry I cannot found library box_lib.obj',0
err_message_import0 db 'Error on load import library box_lib.obj',0
err_message_found_lib1 db 'Sorry I cannot found library proc_lib.obj',0
err_message_import1 db 'Error on load import library proc_lib.obj',0
head_f_i:
head_f_l db 'System error',0 ;§ £®«®¢®ª ®ª­ , ¯à¨ ¢®§­¨ª­®¢¥­¨¨ ®è¨¡ª¨
end if
system_dir0 db '/sys/lib/'
@ -547,8 +535,8 @@ aOpenDialog_Start db 'OpenDialog_start',0
;---------------------------------------------------------------------
;library structures
l_libs_start:
lib0 l_libs lib0_name, cur_dir_path, library_path, system_dir0, err_message_found_lib0, head_f_l, import_box_lib, err_message_import0, head_f_i
lib1 l_libs lib1_name, cur_dir_path, library_path, system_dir1, err_message_found_lib1, head_f_l, import_proc_lib,err_message_import1, head_f_i
lib0 l_libs lib0_name, library_path, system_dir0, import_box_lib
lib1 l_libs lib1_name, library_path, system_dir1, import_proc_lib
load_lib_end:
edit1 edit_box 153, 72, 3, 0xffffff, 0xA4C4E4, 0x80ff, 0, 0x10000000,(outfile-infile-1), infile, mouse_dd, 0, 11,11

View File

@ -19,7 +19,8 @@ use32
include '../../../proc32.inc'
include '../../../macros.inc' ; ¬ ªà®áë ®¡«¥£ç îâ ¦¨§­ì  áᥬ¡«¥à騪®¢!
include '../../../develop/libraries/box_lib/load_lib.mac'
include '../../../KOSfuncs.inc'
include '../../../load_lib.mac'
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
include 'lang.inc'
@ -289,12 +290,9 @@ editboxes_end:
system_dir_0 db '/sys/lib/'
lib_name_0 db 'box_lib.obj',0
err_msg_found_lib_0 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'box_lib.obj',39,0
err_msg_import_0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'box_lib',39,0
l_libs_start:
lib_0 l_libs lib_name_0, sys_path, library_path, system_dir_0,\
err_msg_found_lib_0,head_f_l,import_box_lib,err_msg_import_0,head_f_i
lib_0 l_libs lib_name_0, library_path, system_dir_0,import_box_lib
l_libs_end:
align 4
@ -312,8 +310,8 @@ dd 0,0
;sz_edit_box_set_text db 'edit_box_set_text',0
i_end:
sys_colors system_colors
rb 0x400 ;stack
sys_path rb 4096
library_path rb 4096
e_end: ; ¬¥âª  ª®­æ  ¯à®£à ¬¬ë
sys_colors system_colors
sys_path rb 4096
library_path rb 4096
rb 0x400 ; stack
e_end: ; ¬¥âª  ª®­æ  ¯à®£à ¬¬ë

View File

@ -60,10 +60,11 @@ use32
_title equ 'HeEd 0.16', 0
include 'lang.inc'
include '../../../KOSfuncs.inc'
include '../../../config.inc' ;for nightbuild
include '../../../macros.inc'
include '../../libraries/box_lib/trunk/box_lib.mac'
include '../../libraries/box_lib/load_lib.mac'
include '../../../load_lib.mac'
@use_library
;--------------------------------------------------------------------
@ -3289,23 +3290,9 @@ help_but_text = menu_text_area_3 ;db 'Help',0
head_f_i:
if lang eq ru
head_f_l db '®è¨¡ª ',0
err_message_found_lib1 db 'box_lib.obj - <20>¥ ­ ©¤¥­!',0
err_message_found_lib2 db 'proc_lib.obj - <20>¥ ­ ©¤¥­!',0
err_message_import1 db 'box_lib.obj - Žè¨¡ª  ¨¬¯®àâ !',0
err_message_import2 db 'proc_lib.obj - Žè¨¡ª  ¨¬¯®àâ !',0
error_open_file_string db "” ©« ­¥ ­ ©¤¥­!",0
error_save_file_string db "” ©« ­¥ á®åà ­¥­!",0
else
head_f_l db 'error',0
err_message_found_lib1 db 'box_lib.obj - Not found!',0
err_message_found_lib2 db 'proc_lib.obj - Not found!',0
err_message_import1 db 'box_lib.obj - Wrong import!',0
err_message_import2 db 'proc_lib.obj - Wrong import!',0
error_open_file_string db "Isn't found!",0
error_save_file_string db "Isn't saved!",0
end if
@ -3397,14 +3384,10 @@ koi8_r file 'koi8-r-8x16'
title db _title
;---------------------------------------------------------------------
l_libs_start:
; load_library boxlib_name,cur_dir_path,buf_cmd_lin,system_path,\
; err_message_found_lib,head_f_l,myimport,err_message_import,head_f_i
library01 l_libs system_dir_Boxlib+9, cur_dir_path, buf_cmd_lin, system_dir_Boxlib, \
err_message_found_lib1, head_f_l, Box_lib_import, err_message_import1, head_f_i
library01 l_libs system_dir_Boxlib+9, buf_cmd_lin, system_dir_Boxlib, Box_lib_import
library02 l_libs system_dir_ProcLib+9, cur_dir_path, buf_cmd_lin, system_dir_ProcLib, \
err_message_found_lib2, head_f_l, ProcLib_import, err_message_import2, head_f_i
library02 l_libs system_dir_ProcLib+9, buf_cmd_lin, system_dir_ProcLib, ProcLib_import
end_l_libs:
;---------------------------------------------------------------------

View File

@ -3,9 +3,10 @@ use32
db 'MENUET01'
dd 1,start,i_end,mem,stacktop,buf_cmd_lin,sys_path
include '../../KOSfuncs.inc'
include '../../macros.inc'
include '../../proc32.inc'
include '../../develop/libraries/box_lib/load_lib.mac'
include '../../load_lib.mac'
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
include '../../dll.inc'
include '../../system/skincfg/trunk/kglobals.inc'
@ -13,7 +14,7 @@ include '../../system/skincfg/trunk/unpacker.inc'
include 'strlen.inc'
include 'obj_codes.inc'
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc, dll.Load
@use_library mem.Alloc,mem.Free,mem.ReAlloc, dll.Load
hed db 'kol_f_edit 29.09.20',0
@ -88,12 +89,12 @@ macro load_image_file path,buf,size { ;
cmp ebx,0xffffffff
je @f
;®¯à¥¤¥«ï¥¬ ¢¨¤ ¨§®¡à ¦¥­¨ï ¨ ¯¥à¥¢®¤¨¬ ¥£® ¢® ¢à¥¬¥­­ë© ¡ãä¥à image_data
stdcall dword[img_decode], dword[buf],ebx,0
mov dword[image_data],eax
stdcall [img_decode], [buf],ebx,0
mov [image_data],eax
;¯à¥®¡à §ã¥¬ ¨§®¡à ¦¥­¨¥ ª ä®à¬ âã rgb
stdcall dword[img_to_rgb2], dword[image_data],dword[buf]
stdcall [img_to_rgb2], [image_data],[buf]
;㤠«ï¥¬ ¢à¥¬¥­­ë© ¡ãä¥à image_data
stdcall dword[img_destroy], dword[image_data]
stdcall [img_destroy], [image_data]
@@:
}
@ -205,8 +206,8 @@ start:
mcall 48,3,sc,sizeof.system_colors
mcall 40,0x27
stdcall dword[tl_data_init], tree1
stdcall dword[tl_data_init], tree2
stdcall [tl_data_init], tree1
stdcall [tl_data_init], tree2
copy_path fn_icon,sys_path,file_name,0 ;ä®à¬¨à㥬 ¯®«­ë© ¯ãâì ª ä ©«ã ¨§®¡à ¦¥­¨ï, ¯®¤à §ã¬¥¢ ¥¬ çâ® ®­ ¢ ®¤­®© ¯ ¯ª¥ á ¯à®£à ¬¬®©
mov [run_file_70.Function], 0
@ -478,15 +479,15 @@ pushad
mcall 4,10*65536+35,0x80ff0000,txtErrOpen
@@:
stdcall [edit_box_draw], dword edit1
stdcall [edit_box_draw], dword edit_sav
stdcall [edit_box_draw], edit1
stdcall [edit_box_draw], edit_sav
mov dword[w_scr_t1.all_redraw],1
;stdcall [scrollbar_ver_draw],dword w_scr_t1
stdcall [tl_draw],dword tree1
;stdcall [scrollbar_ver_draw], w_scr_t1
stdcall [tl_draw], tree1
mov dword[w_scr_t2.all_redraw],1
;stdcall [scrollbar_ver_draw],dword w_scr_t2
stdcall [tl_draw],dword tree2
;stdcall [scrollbar_ver_draw], w_scr_t2
stdcall [tl_draw], tree2
cmp byte[show_mode],0 ;ãá«®¢¨¥ ¢¨¤¨¬®á⨠®ª­  ª®­áâàãªâ®à 
jne @f
@ -502,10 +503,10 @@ popad
align 4
mouse:
stdcall [edit_box_mouse], dword edit1
stdcall [edit_box_mouse], dword edit_sav
stdcall [tl_mouse], dword tree1
stdcall [tl_mouse], dword tree2
stdcall [edit_box_mouse], edit1
stdcall [edit_box_mouse], edit_sav
stdcall [tl_mouse], tree1
stdcall [tl_mouse], tree2
cmp byte[show_mode],1 ;ãá«®¢¨¥ ¢¨¤¨¬®á⨠⥪á⮢®£® ®ª­ 
jne @f
stdcall [ted_mouse], tedit0
@ -516,10 +517,10 @@ mouse:
align 4
key:
mcall 2
stdcall [edit_box_key], dword edit1
stdcall [edit_box_key], dword edit_sav
stdcall [tl_key], dword tree1
stdcall [tl_key], dword tree2
stdcall [edit_box_key], edit1
stdcall [edit_box_key], edit_sav
stdcall [tl_key], tree1
stdcall [tl_key], tree2
jmp still
@ -1328,39 +1329,6 @@ foc_obj dd 0 ;
obj_count_txt_props dd 0 ;ª®«¨ç¥á⢮ ¨á¯®«ì§ã¥¬ëå ⥪á⮢ëå ᢮©áâ¢
obj_m_win dd 0 ;áâàãªâãà  £« ¢­®£® ®ª­ 
;
if 1 ;lang eq ru
err_message_found_lib0 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  box_lib.obj',39,'" -tE',0
err_message_import0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ box_lib.obj',39,'" -tW',0
err_message_found_lib1 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  proc_lib.obj',39,'" -tE',0
err_message_import1 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ proc_lib.obj',39,'" -tW',0
err_message_found_lib2 db '<27>¥ 㤠«®áì ­ ©â¨ ¡¨¡«¨®â¥ªã buf2d.obj',39,'" -tE',0
err_message_import2 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ buf2d.obj',39,'" -tW',0
err_message_found_lib3 db '<27>¥ 㤠«®áì ­ ©â¨ ¡¨¡«¨®â¥ªã libimg.obj',39,'" -tE',0
err_message_import3 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ libimg.obj',39,'" -tW',0
err_message_found_lib4 db '<27>¥ 㤠«®áì ­ ©â¨ ¡¨¡«¨®â¥ªã msgbox.obj',39,'" -tE',0
err_message_import4 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ msgbox.obj',39,'" -tW',0
head_f_i:
head_f_l db '"‘¨á⥬­ ï ®è¨¡ª ',0 ;§ £®«®¢®ª ®ª­ , ¯à¨ ¢®§­¨ª­®¢¥­¨¨ ®è¨¡ª¨
else
err_message_found_lib0 db 'Sorry I cannot found library box_lib.obj',39,'" -tE',0
err_message_import0 db 'Error on load import library box_lib.obj',39,'" -tW',0
err_message_found_lib1 db 'Sorry I cannot found library proc_lib.obj',39,'" -tE',0
err_message_import1 db 'Error on load import library proc_lib.obj',39,'" -tW',0
err_message_found_lib2 db 'Sorry I cannot found library buf2d.obj',39,'" -tE',0
err_message_import2 db 'Error on load import library buf2d.obj',39,'" -tW',0
err_message_found_lib3 db 'Sorry I cannot found library libimg.obj',39,'" -tE',0
err_message_import3 db 'Error on load import library libimg.obj',39,'" -tW',0
err_message_found_lib4 db 'Sorry I cannot found library msgbox.obj',39,'" -tE',0
err_message_import4 db 'Error on load import library msgbox.obj',39,'" -tW',0
head_f_i:
head_f_l db '"System error',0 ;§ £®«®¢®ª ®ª­ , ¯à¨ ¢®§­¨ª­®¢¥­¨¨ ®è¨¡ª¨
end if
system_dir0 db '/sys/lib/'
lib0_name db 'box_lib.obj',0
@ -1624,11 +1592,11 @@ dd 0,0
;library structures
l_libs_start:
lib0 l_libs lib0_name, sys_path, library_path, system_dir0, err_message_found_lib0, head_f_l, import_box_lib, err_message_import0, head_f_i
lib1 l_libs lib1_name, sys_path, library_path, system_dir1, err_message_found_lib1, head_f_l, import_proc_lib,err_message_import1, head_f_i
lib2 l_libs lib2_name, sys_path, library_path, system_dir2, err_message_found_lib2, head_f_l, import_buf2d_lib, err_message_import2, head_f_i
lib3 l_libs lib3_name, sys_path, library_path, system_dir3, err_message_found_lib3, head_f_l, import_libimg, err_message_import3, head_f_i
lib4 l_libs lib4_name, sys_path, library_path, system_dir4, err_message_found_lib4, head_f_l, import_msgbox_lib, err_message_import4, head_f_i
lib0 l_libs lib0_name, library_path, system_dir0, import_box_lib
lib1 l_libs lib1_name, library_path, system_dir1, import_proc_lib
lib2 l_libs lib2_name, library_path, system_dir2, import_buf2d_lib
lib3 l_libs lib3_name, library_path, system_dir3, import_libimg
lib4 l_libs lib4_name, library_path, system_dir4, import_msgbox_lib
load_lib_end:

View File

@ -1,23 +1,19 @@
use32
org 0x0
db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
dd 0x1
dd start
dd i_end ;à §¬¥à ¯à¨«®¦¥­¨ï
dd mem,stacktop
dd 0,cur_dir_path
org 0
db 'MENUET01'
dd 1,start,i_end,mem,stacktop,0,cur_dir_path
include '../../../../../KOSfuncs.inc'
include '../../../../../macros.inc'
include '../../../../../proc32.inc'
include '../../../../../develop/libraries/box_lib/load_lib.mac'
include '../../../../../load_lib.mac'
include '../../../../../dll.inc'
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc, 0 ;dll.Load
@use_library mem.Alloc,mem.Free,mem.ReAlloc, 0 ;dll.Load
align 4
start:
load_library vectors_name, cur_dir_path, library_path, system_path, \
err_message_found_lib, head_f_l, import_buf2d_lib, err_message_import, head_f_i
load_library lib0_name, library_path, system_path, import_buf2d_lib
cmp eax,-1
jz button.exit
@ -132,11 +128,7 @@ buf_0:
;--------------------------------------------------
system_path db '/sys/lib/'
vectors_name db 'buf2d.obj',0
err_message_found_lib db 'Sorry I cannot load library buf2d.obj',0
head_f_i:
head_f_l db 'System error',0
err_message_import db 'Error on load import library buf2d.obj',0
lib0_name db 'buf2d.obj',0
;--------------------------------------------------
i_end: ;ª®­¥æ ª®¤ 

View File

@ -1,23 +1,19 @@
use32
org 0x0
db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
dd 0x1
dd start
dd i_end ;à §¬¥à ¯à¨«®¦¥­¨ï
dd mem,stacktop
dd 0,cur_dir_path
org 0
db 'MENUET01'
dd 1,start,i_end,mem,stacktop,0,cur_dir_path
include '../../../../../KOSfuncs.inc'
include '../../../../../macros.inc'
include '../../../../../proc32.inc'
include '../../../../../develop/libraries/box_lib/load_lib.mac'
include '../../../../../dll.inc'
include '../../../../../load_lib.mac'
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc, 0 ;dll.Load
@use_library mem.Alloc,mem.Free,mem.ReAlloc, 0 ;dll.Load
align 4
start:
load_library vectors_name, cur_dir_path, library_path, system_path, \
err_message_found_lib, head_f_l, import_buf2d_lib, err_message_import, head_f_i
load_library lib0_name, library_path, system_path, import_buf2d_lib
cmp eax,-1
jz button.exit
@ -164,11 +160,7 @@ buf_1:
;--------------------------------------------------
system_path db '/sys/lib/'
vectors_name db 'buf2d.obj',0
err_message_found_lib db 'Sorry I cannot load library buf2d.obj',0
head_f_i:
head_f_l db 'System error',0
err_message_import db 'Error on load import library buf2d.obj',0
lib0_name db 'buf2d.obj',0
;--------------------------------------------------
i_end: ;ª®­¥æ ª®¤ 

View File

@ -1,18 +1,15 @@
use32
org 0x0
db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
dd 0x1
dd start
dd i_end ;à §¬¥à ¯à¨«®¦¥­¨ï
dd mem,stacktop
dd 0,sys_path
org 0
db 'MENUET01'
dd 1,start,i_end,mem,stacktop,0,cur_dir_path
include '../../../../../KOSfuncs.inc'
include '../../../../../macros.inc'
include '../../../../../proc32.inc'
include '../../../../../develop/libraries/box_lib/load_lib.mac'
include '../../../../../load_lib.mac'
include '../../../../../dll.inc'
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc, dll.Load
@use_library mem.Alloc,mem.Free,mem.ReAlloc, dll.Load
struct FileInfoBlock
Function dd ?
@ -58,12 +55,12 @@ macro load_image_file path,buf,size { ;
cmp ebx,0xffffffff
je @f
;®¯à¥¤¥«ï¥¬ ¢¨¤ ¨§®¡à ¦¥­¨ï ¨ ¯¥à¥¢®¤¨¬ ¥£® ¢® ¢à¥¬¥­­ë© ¡ãä¥à image_data
stdcall dword[img_decode], dword[buf],ebx,0
mov dword[image_data],eax
stdcall [img_decode], [buf],ebx,0
mov [image_data],eax
;¯à¥®¡à §ã¥¬ ¨§®¡à ¦¥­¨¥ ª ä®à¬ âã rgb
stdcall dword[img_to_rgb2], dword[image_data],dword[buf]
stdcall [img_to_rgb2], [image_data],[buf]
;㤠«ï¥¬ ¢à¥¬¥­­ë© ¡ãä¥à image_data
stdcall dword[img_destroy], dword[image_data]
stdcall [img_destroy], [image_data]
@@:
}
@ -146,23 +143,17 @@ draw_window:
popad
ret
head_f_i:
head_f_l db '‘¨á⥬­ ï ®è¨¡ª ',0
system_dir0 db '/sys/lib/'
name_buf2d db 'buf2d.obj',0
err_message_found_lib0 db '<27>¥ 㤠«®áì ­ ©â¨ ¡¨¡«¨®â¥ªã buf2d.obj',0
err_message_import0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ buf2d.obj',0
system_dir1 db '/sys/lib/'
name_libimg db 'libimg.obj',0
err_message_found_lib1 db '<27>¥ 㤠«®áì ­ ©â¨ ¡¨¡«¨®â¥ªã libimg.obj',0
err_message_import1 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ libimg.obj',0
;library structures
l_libs_start:
lib0 l_libs name_buf2d, sys_path, file_name, system_dir0, err_message_found_lib0, head_f_l, import_buf2d_lib, err_message_import0, head_f_i
lib1 l_libs name_libimg, sys_path, file_name, system_dir1, err_message_found_lib1, head_f_l, import_libimg, err_message_import1, head_f_i
lib0 l_libs name_buf2d, file_name, system_dir0, import_buf2d_lib
lib1 l_libs name_libimg, file_name, system_dir1, import_libimg
load_lib_end:
align 4

View File

@ -1,18 +1,15 @@
use32
org 0x0
db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
dd 0x1
dd start
dd i_end ;à §¬¥à ¯à¨«®¦¥­¨ï
dd mem,stacktop
dd 0,sys_path
org 0
db 'MENUET01'
dd 1,start,i_end,mem,stacktop,0,cur_dir_path
include '../../../../../KOSfuncs.inc'
include '../../../../../macros.inc'
include '../../../../../proc32.inc'
include '../../../../../develop/libraries/box_lib/load_lib.mac'
include '../../../../../load_lib.mac'
include '../../../../../dll.inc'
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc, dll.Load
@use_library mem.Alloc,mem.Free,mem.ReAlloc, dll.Load
struct FileInfoBlock
Function dd ?
@ -56,12 +53,12 @@ macro load_image_file path,buf,size { ;
cmp ebx,0xffffffff
je @f
;®¯à¥¤¥«ï¥¬ ¢¨¤ ¨§®¡à ¦¥­¨ï ¨ ¯¥à¥¢®¤¨¬ ¥£® ¢® ¢à¥¬¥­­ë© ¡ãä¥à image_data
stdcall dword[img_decode], dword[buf],ebx,0
mov dword[image_data],eax
stdcall [img_decode], [buf],ebx,0
mov [image_data],eax
;¯à¥®¡à §ã¥¬ ¨§®¡à ¦¥­¨¥ ª ä®à¬ âã rgb
stdcall dword[img_to_rgb2], dword[image_data],dword[buf]
stdcall [img_to_rgb2], [image_data],[buf]
;㤠«ï¥¬ ¢à¥¬¥­­ë© ¡ãä¥à image_data
stdcall dword[img_destroy], dword[image_data]
stdcall [img_destroy], [image_data]
@@:
}
@ -137,23 +134,17 @@ draw_window:
popad
ret
head_f_i:
head_f_l db '‘¨á⥬­ ï ®è¨¡ª ',0
system_dir0 db '/sys/lib/'
name_buf2d db 'buf2d.obj',0
err_message_found_lib0 db '<27>¥ 㤠«®áì ­ ©â¨ ¡¨¡«¨®â¥ªã buf2d.obj',0
err_message_import0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ buf2d.obj',0
system_dir1 db '/sys/lib/'
name_libimg db 'libimg.obj',0
err_message_found_lib1 db '<27>¥ 㤠«®áì ­ ©â¨ ¡¨¡«¨®â¥ªã libimg.obj',0
err_message_import1 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ libimg.obj',0
;library structures
l_libs_start:
lib0 l_libs name_buf2d, sys_path, file_name, system_dir0, err_message_found_lib0, head_f_l, import_buf2d_lib, err_message_import0, head_f_i
lib1 l_libs name_libimg, sys_path, file_name, system_dir1, err_message_found_lib1, head_f_l, import_libimg, err_message_import1, head_f_i
lib0 l_libs name_buf2d, file_name, system_dir0, import_buf2d_lib
lib1 l_libs name_libimg, file_name, system_dir1, import_libimg
load_lib_end:
align 4

View File

@ -1,26 +1,22 @@
use32
org 0x0
db 'MENUET01' ;èäåíòèô. èñïîëíÿåìîãî ôàéëà âñåãäà 8 áàéò
dd 0x1
dd start
dd i_end ;ðàçìåð ïðèëîæåíèÿ
dd mem,stacktop
dd 0,cur_dir_path
org 0
db 'MENUET01'
dd 1,start,i_end,mem,stacktop,0,cur_dir_path
include '../../../../../KOSfuncs.inc'
include '../../../../../macros.inc'
include '../../../../../proc32.inc'
include '../../../../../develop/libraries/box_lib/load_lib.mac'
include '../../../../../load_lib.mac'
include '../../../../../dll.inc'
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc, 0 ;dll.Load
@use_library mem.Alloc,mem.Free,mem.ReAlloc, 0 ;dll.Load
buf2d_l equ word[edi+4] ;îòñòóï ñëåâà
buf2d_t equ word[edi+6] ;îòñòóï ñâåðõó
align 4
start:
load_library vectors_name, cur_dir_path, library_path, system_path, \
err_message_found_lib, head_f_l, import_buf2d_lib, err_message_import, head_f_i
load_library lib0_name, library_path, system_path, import_buf2d_lib
cmp eax,-1
jz button.exit
@ -171,11 +167,7 @@ buf_0:
;--------------------------------------------------
system_path db '/sys/lib/'
vectors_name db 'buf2d.obj',0
err_message_found_lib db 'Sorry I cannot load library buf2d.obj',0
head_f_i:
head_f_l db 'System error',0
err_message_import db 'Error on load import library buf2d.obj',0
lib0_name db 'buf2d.obj',0
;--------------------------------------------------
i_end: ;êîíåö êîäà

View File

@ -1,18 +1,15 @@
use32
org 0x0
db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
dd 0x1
dd start
dd i_end ;à §¬¥à ¯à¨«®¦¥­¨ï
dd mem,stacktop
dd 0,cur_dir_path
org 0
db 'MENUET01'
dd 1,start,i_end,mem,stacktop,0,cur_dir_path
include '../../../../../KOSfuncs.inc'
include '../../../../../macros.inc'
include '../../../../../proc32.inc'
include '../../../../../develop/libraries/box_lib/load_lib.mac'
include '../../../../../load_lib.mac'
include '../../../../../dll.inc'
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc, 0 ;dll.Load
@use_library mem.Alloc,mem.Free,mem.ReAlloc, 0 ;dll.Load
buf2d_l equ word[edi+4] ;®âáâ㯠᫥¢ 
buf2d_t equ word[edi+6] ;®âáâ㯠ᢥàåã
@ -20,8 +17,7 @@ buf2d_color equ dword[edi+16] ;梥
align 4
start:
load_library vectors_name, cur_dir_path, library_path, system_path, \
err_message_found_lib, head_f_l, import_buf2d_lib, err_message_import, head_f_i
load_library lib0_name, library_path, system_path, import_buf2d_lib
cmp eax,-1
jz button.exit
@ -165,11 +161,7 @@ buf_0:
;--------------------------------------------------
system_path db '/sys/lib/'
vectors_name db 'buf2d.obj',0
err_message_found_lib db 'Sorry I cannot load library buf2d.obj',0
head_f_i:
head_f_l db 'System error',0
err_message_import db 'Error on load import library buf2d.obj',0
lib0_name db 'buf2d.obj',0
;--------------------------------------------------
i_end: ;ª®­¥æ ª®¤ 

View File

@ -192,7 +192,7 @@ macro sys_load_library library_name__, library_path__, system_path__, myimport,
local i_begin
local i_error
local i_exit
push ebx
mcall SF_SYS_MISC,SSF_LOAD_DLL,system_path__ ; load of sys directory
test eax,eax
jnz i_begin
@ -218,15 +218,18 @@ align 4
call l_lib_init_error_window
notify_window_run [arrea_xx] ; ᮧ¤ ¥¬ ®ª­® @notify
i_exit:
pop ebx
}
;---------------------------------------------------------------------
;output:
; eax - ¥á«¨ 㤠筮 â® 0
macro load_library library_name__, library_path__, system_path__, myimport, point_dir_name__
{
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
@ -252,6 +255,7 @@ align 4
call l_lib_init_error_window
notify_window_run [arrea_xx] ; ᮧ¤ ¥¬ ®ª­® @notify
i_exit:
pop ebx
;---------------------------------------------------------------------
}
@ -441,6 +445,7 @@ pop ebx eax
; myimport - ¨¬¯®àâ¨àã¥¬ë¥ ä㭪樨
;output:
; eax - ¥á«¨ 㤠筮 â® 0 ¨«¨ 㪠§ â¥«ì ­  ¨¬ï ä㭪樨 ª®â®àãî ­¥ 㤠«®áì § £à㧨âì
; ebx - à §àãè ¥âáï
macro import_boxlib myimport
{
local import_loop
@ -452,9 +457,10 @@ local import_done
local exit
local import_not_found
; initialize import
push esi
mov edx, eax
mov esi,myimport
mov esi, myimport
cld
import_loop:
lodsd ;mov eax,dword[esi] ;add esi,4 ;¯®«ãç ¥¬ ¢ eax 㪠§ â¥«ì ­  ¨¬ï ¨¬¯®àâ¨à㥬®© ä㭪樨
test eax, eax
@ -465,6 +471,7 @@ import_find:
test ebx, ebx
jz import_not_found ;¥á«¨ 㪠§ â¥«ì ­  ¨¬ï ä㭪樨 = 0 (¢ ¡¨¡«¨®â¥ª¥)
push eax ;eax - 㪠§ â¥«ì ­  ¨¬ï íªá¯®àâ¨à㥬®© ä㭪樨 (¢ ¯®«ì§®¢ â¥«ì᪮© ¯à®£à ¬¬¥)
align 4
lp:
mov cl, [eax]
cmp cl, [ebx] ;áà ¢­¨¢ ¥¬ ¨¬¥­  ä㭪権 ¢ ¡¨¡«¨®â¥ª¥ ¨ ¢ ¯®«ì§®¢ â¥«ì᪮© ¯à®£à ¬¬¥
@ -512,6 +519,7 @@ import_not_found:
import_done:
xor eax,eax ;=0 ¢á¥ § £à㧨«®áì 㤠筮
exit:
pop esi
}
;---------------------------------------------------------------------

View File

@ -60,7 +60,8 @@ AR_OFFSET equ 10
include '../../../config.inc' ;for nightbuild
include '../../../macros.inc' ; ¬ ªà®áë ®¡«¥£ç îâ ¦¨§­ì  áᥬ¡«¥à騪®¢!
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
include '../../../develop/libraries/box_lib/load_lib.mac'
include '../../../KOSfuncs.inc'
include '../../../load_lib.mac'
@use_library
@ -749,26 +750,15 @@ skin_height dd 0x0
;---------------------------------------------------------------------
l_libs_start:
library01 l_libs system_dir_ProcLib+9, cur_dir_path, library_path, system_dir_ProcLib, \
err_message_found_lib2, head_f_l, ProcLib_import, err_message_import2, head_f_i
library01 l_libs system_dir_ProcLib+9, library_path, system_dir_ProcLib, ProcLib_import
library02 l_libs system_dir_Boxlib+9, cur_dir_path, library_path, system_dir_Boxlib, \
err_message_found_lib1, head_f_l, Box_lib_import, err_message_import1, head_f_i
library02 l_libs system_dir_Boxlib+9, library_path, system_dir_Boxlib, Box_lib_import
end_l_libs:
;---------------------------------------------------------------------
system_dir_ProcLib db '/sys/lib/proc_lib.obj',0
system_dir_Boxlib db '/sys/lib/box_lib.obj',0
head_f_i:
head_f_l db 'error',0
err_message_found_lib1 db 'box_lib.obj - Not found!',0
err_message_found_lib2 db 'proc_lib.obj - Not found!',0
err_message_import1 db 'box_lib.obj - Wrong import!',0
err_message_import2 db 'proc_lib.obj - Wrong import!',0
;---------------------------------------------------------------------
align 4
ProcLib_import: