- remove outdated unused code
- use built-in font instead of a file in /fonts/ folder

git-svn-id: svn://kolibrios.org@7433 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2018-10-04 17:53:33 +00:00
parent d305102f81
commit e0615bc762
9 changed files with 109 additions and 968 deletions

View File

@ -38,7 +38,6 @@ img_files = {
{"File Managers/FNAV/FNAV_CUR.PNG", "common/File Managers/fNav/fnav_cur.png"},
{"File Managers/FNAV/FNAV_FNT.PNG", "common/File Managers/fNav/fnav_fnt.png"},
{"File Managers/FNAV/FNAV_ICN.PNG", "common/File Managers/fNav/fnav_icn.png"},
{"FONTS/LITT.CHR", PROGS .. "/demos/bgitest/trunk/FONTS/LITT.CHR"},
{"FONTS/TAHOMA.KF", "common/fonts/tahoma.kf"},
{"LIB/ICONV.OBJ", "common/lib/iconv.obj"},
{"LIB/KMENU.OBJ", "common/lib/kmenu.obj"},

View File

@ -8,3 +8,5 @@ tup.rule("collections.c", "c-- /D=AUTOBUILD /D=$(C_LANG) %f" .. tup.getconfig("K
tup.rule("menu.c", "c-- /D=AUTOBUILD /D=$(C_LANG) %f" .. tup.getconfig("KPACK_CMD"), "menu.com")
tup.rule("rgb.c", "c-- /D=AUTOBUILD /D=$(C_LANG) %f" .. tup.getconfig("KPACK_CMD"), "rgb.com")
tup.rule("console.c", "c-- /D=AUTOBUILD /D=$(C_LANG) %f" .. tup.getconfig("KPACK_CMD"), "console.com")
tup.rule("info.c", "c-- /D=AUTOBUILD /D=$(C_LANG) %f" .. tup.getconfig("KPACK_CMD"), "info.com")
tup.rule("pig.c", "c-- /D=AUTOBUILD /D=$(C_LANG) %f" .. tup.getconfig("KPACK_CMD"), "pig.com")

View File

@ -0,0 +1,52 @@
/*
* Template C-- program.
*/
#define MEMSIZE 4096*15
#include "../lib/io.h"
#include "../lib/gui.h"
#define WIN_W 12*10+30
#define WIN_H 80
void main()
{
word btn;
loop() switch(WaitEvent())
{
case evButton:
btn = GetButtonID();
if (btn == 1) ExitProcess();
break;
case evKey:
GetKeys();
if (key_scancode == SCAN_CODE_ESC) ExitProcess();
break;
case evReDraw:
draw_window();
break;
}
}
inline GetRevisionNumber()
{
char buf[32];
EAX = 18;
EBX = 13;
ECX = #buf;
return ESDWORD[#buf+5];
}
void draw_window()
{
system.color.get();
DefineUnDragableWindow(screen.width-WIN_W-15, GetClientHeight()-WIN_H-15, WIN_W-1, WIN_H-1);
DrawBar(0,0,WIN_W,WIN_H,0x414155);
DrawWideRectangle(0,0,WIN_W,WIN_H, 3, 0x5555FF);
WriteText(15, 20, 0x81, 0xFFFF55, " REV 7321 ");
WriteText(15, 20+25, 0x81, 0xFFFF55, "17.09.2018");
}

View File

@ -0,0 +1,25 @@
/*
* Template C-- program.
*/
#define MEMSIZE 4096*5
#include "../lib/kolibri.h"
#include "../lib/fs.h"
#include "../lib/patterns/restart_process.h"
proc_info Form;
void main()
{
int i;
CreateDir("/tmp0/1/pig");
RunProgram("/sys/UNZ", "-o /tmp0/1/pig -h /kolibrios/games/pig.zip");
for (i = 0; i < 200; i++)
{
if (CheckProcessExists("UNZ")==false) break;
pause(3);
}
RunProgram("/tmp0/1/pig/pig", NULL);
}

View File

@ -12,7 +12,7 @@ enum {
#define MAX_PROCESS_COUNT 256
:int CheckProcessExists(dword proc_name) {
:bool CheckProcessExists(dword proc_name) {
int i;
proc_info Process;
for (i=0; i<MAX_PROCESS_COUNT; i++;)

View File

@ -1,819 +0,0 @@
lang equ ru ; ru en fr ge fi
;
; Assembler
; SMALL
; CODE
; Libary
;
; Ver 0.14 By Pavlushin Evgeni (RUSSIA)
; www.waptap@mail.ru
;Please compile aplications on FASM ver1.54 or higer!!!
;InfoList
;0.01 scank,putpix,puttxt
;0.02 label,random,colors
;0.03 window,startwd,endwd,attributes
;0.04 close,delay,scevent ~30.04.2004
;0.05 small random, ~04.05.2004
;0.06 wtevent ~09.05.2004
;0.07 timeevent ~23.05.2004
;0.08 txtput ~14.06.2004
;0.09 opendialog,savedialog ~20.06.2004
;0.10 wordstoreg by halyavin, add at ~30.08.2004
; random bug deleted eax is use.
;0.11 loadfile from me +puttxt bug del ~07.09.2004
;0.12 open/save dialog ~13.09.2004
;0.13 dialogs bugs deleted
;0.14 drawlbut ~03.10.2004
; LOADFILE
; (SYNTAX) LOADFILE 'full_path_to_file',file_load_area,file_temp_area
; (SAMPLE) LOADFILE '/rd/1/clock.bmp',load_area,temp_area
macro loadfile file_name,file_load_area,file_temp_area
{
local open,fileinfo,string
jmp open
fileinfo:
dd 0
dd 0
dd 1
dd file_load_area
dd file_temp_area
string:
db file_name,0
open:
mov dword [fileinfo+8],1 ; how many blocks to read (1)
mov eax,58
mov ebx,fileinfo
mcall
mov eax,[file_load_area+2]
shr eax,9 ; ¯®¤¥«¨¬ ­  512 ¨ ¯à¨¡ ¢¨¬ 1 - ¯®«ã稬 ç¨á«® ¡«®ª®¢
inc eax
mov dword [fileinfo+8],eax
mov eax,58
mov ebx,fileinfo
mcall
}
macro wordstoreg reg,hiword,loword
{
if hiword eqtype 0 & loword eqtype 0
mov reg,hiword*65536+loword
else if hiword eqtype 12 & loword eqtype eax
mov reg,hiword*65536
add reg,loword
else if hiword eqtype 12 & loword eqtype [123]
mov reg,hiword*65536
add reg,loword
else
mov reg,hiword
shl reg,16
add reg,loword
end if
}
; DRAW BUTTON with label
macro drawlbut x,y,xs,ys,text,id,bcolor,tcolor
{
local asd,lab
jmp asd
lab db text ;arg label
asd:
wordstoreg ebx,x,xs
wordstoreg ecx,y,ys
mov edx,id
mov esi,bcolor
mov eax,8
mcall
mov eax,asd-lab ;calc size
mov ebx,6
mul ebx
mov esi,eax
mov eax,xs
sub eax,esi
shr eax,1
add eax,x
mov edx,ys
sub edx,7
shr edx,1
add edx,y
mov ebx,eax
shl ebx,16
add ebx,edx
mov ecx,tcolor ;arg4 color
mov edx,lab
mov esi,asd-lab ;calc size
mov eax,4
mcall
}
macro opendialog redproc,openoff,erroff,path
{
local new_d, get_loops, dlg_pid_get, DLGPID, num_of_proc
local run_fileinfo, param
local getmesloop, loox, mred, mkey, mbutton, mgetmes
local dlg_is_work, ready, procinfo
;
; STEP 1 Run SYSXTREE with parametrs MYPID 4 bytes in dec,
; 1 byte space, 1 byte type of dialog (O - Open ,S - Save)
;
cld
;; mov esi,path
mov edi,path
xor eax,eax
mov ecx,(1024+16)/4
rep stosd
;mov [get_loops],0
mov [dlg_pid_get],0
; Get my PID in dec format 4 bytes
mov eax,9
mov ebx,procinfo
mov ecx,-1
mcall
; convert eax bin to param dec
mov eax,dword [procinfo+30] ;offset of myPID
mov edi,param+4-1 ;offset to 4 bytes
mov ecx,4
mov ebx,10
cld
new_d:
xor edx,edx
div ebx
add dl,'0'
mov [edi],dl
dec edi
loop new_d
; wirite 1 byte space to param
mov [param+4],byte 32 ;Space for next parametr
; and 1 byte type of dialog to param
mov [param+5],byte 'O' ;Get Open dialog (Use 'S' for Save dialog)
;
; STEP2 prepare IPC area for get messages
;
; prepare IPC area
mov [path],dword 0
mov [path+4],dword 8
; define IPC memory
mov eax,60
mov ebx,1 ; define IPC
mov ecx,path ; offset of area
mov edx,1024+16 ; size
mcall
; change wanted events list 7-bit IPC event
mov eax,40
mov ebx,01000111b
mcall
;
; STEP 3 run SYSTEM XTREE with parameters
;
mov eax,70
mov ebx,run_fileinfo
mcall
call redproc
mov [get_loops],0
getmesloop:
mov eax,23
mov ebx,50 ;0.5 sec
mcall
dec eax
jz mred
dec eax
jz mkey
dec eax
jz mbutton
cmp al, 7-3
jz mgetmes
; Get number of procces
mov ebx,procinfo
mov ecx,-1
mov eax,9
mcall
mov ebp,eax
loox:
mov eax,9
mov ebx,procinfo
mov ecx,ebp
mcall
mov eax,[DLGPID]
cmp [procinfo+30],eax ;IF Dialog find
je dlg_is_work ;jmp to dlg_is_work
dec ebp
jnz loox
jmp erroff
dlg_is_work:
cmp [procinfo+50],word 9 ;If slot state 9 - dialog is terminated
je erroff ;TESTODP2 terminated too
cmp [dlg_pid_get],dword 1
je getmesloop
inc [get_loops]
cmp [get_loops],4 ;2 sec if DLG_PID not get, TESTOP2 terminated
jae erroff
jmp getmesloop
mred:
call redproc
jmp getmesloop
mkey:
mov eax,2
mcall ; read (eax=2)
jmp getmesloop
mbutton:
mov eax,17 ; get id
mcall
cmp ah,1 ; button id=1 ?
jne getmesloop
mov eax,-1 ; close this program
mcall
mgetmes:
; If dlg_pid_get then second message get jmp to still
cmp [dlg_pid_get],dword 1
je ready
; First message is number of PID SYSXTREE dialog
; convert PID dec to PID bin
movzx eax,byte [path+16]
sub eax,48
imul eax,10
movzx ebx,byte [path+16+1]
add eax,ebx
sub eax,48
imul eax,10
movzx ebx,byte [path+16+2]
add eax,ebx
sub eax,48
imul eax,10
movzx ebx,byte [path+16+3]
add eax,ebx
sub eax,48
mov [DLGPID],eax
; Claear and prepare IPC area for next message
mov [path],dword 0
mov [path+4],dword 8
mov [path+8],dword 0
mov [path+12],dword 0
mov [path+16],dword 0
; Set dlg_pid_get for get next message
mov [dlg_pid_get],dword 1
call redproc ;show DLG_PID
jmp getmesloop
ready:
;
; The second message get
; Second message is 1024 bytes path to SAVE/OPEN file
; shl path string on 16 bytes
;
cld
mov esi,path+16
mov edi,path
mov ecx,1024/4
rep movsd
mov [edi],byte 0
jmp openoff
; DATA AREA
get_loops dd 0
dlg_pid_get dd 0
DLGPID dd 0
param:
dd 0 ; My dec PID
dd 0,0 ; Type of dialog
run_fileinfo:
dd 7
dd 0
dd param
dd 0
dd 0
;run_filepath
db '/sys/SYSXTREE',0
procinfo:
times 1024 db 0
}
macro savedialog redproc,openoff,erroff,path
{
local new_d, get_loops, dlg_pid_get, DLGPID, num_of_proc
local run_fileinfo, run_filepath, param
local getmesloop, loox, mred, mkey, mbutton, mgetmes
local dlg_is_work, ready, procinfo
;
; STEP 1 Run SYSXTREE with parametrs MYPID 4 bytes in dec,
; 1 byte space, 1 byte type of dialog (O - Open ,S - Save)
;
cld
;; mov esi,path
mov edi,path
xor eax,eax
mov ecx,(1024+16)/4
rep stosd
;mov [get_loops],0
mov [dlg_pid_get],0
; Get my PID in dec format 4 bytes
mov eax,9
mov ebx,procinfo
mov ecx,-1
mcall
; convert eax bin to param dec
mov eax,dword [procinfo+30] ;offset of myPID
mov edi,param+4-1 ;offset to 4 bytes
mov ecx,4
mov ebx,10
cld
new_d:
xor edx,edx
div ebx
add dl,'0'
mov [edi],dl
dec edi
loop new_d
; wirite 1 byte space to param
mov [param+4],byte 32 ;Space for next parametr
; and 1 byte type of dialog to param
mov [param+5],byte 'S' ;Get Open dialog (Use 'S' for Save dialog)
;
; STEP2 prepare IPC area for get messages
;
; prepare IPC area
mov [path],dword 0
mov [path+4],dword 8
; define IPC memory
mov eax,60
mov ebx,1 ; define IPC
mov ecx,path ; offset of area
mov edx,1024+16 ; size
mcall
; change wanted events list 7-bit IPC event
mov eax,40
mov ebx,01000111b
mcall
;
; STEP 3 run SYSTEM XTREE with parameters
;
mov eax,70
mov ebx,run_fileinfo
mcall
call redproc
mov [get_loops],0
getmesloop:
mov eax,23
mov ebx,50 ;0.5 sec
mcall
dec eax
jz mred
dec eax
jz mkey
dec eax
jz mbutton
cmp al, 7-3
jz mgetmes
; Get number of procces
mov ebx,procinfo
mov ecx,-1
mov eax,9
mcall
mov ebp,eax
loox:
mov eax,9
mov ebx,procinfo
mov ecx,ebp
mcall
mov eax,[DLGPID]
cmp [procinfo+30],eax ;IF Dialog find
je dlg_is_work ;jmp to dlg_is_work
dec ebp
jnz loox
jmp erroff
dlg_is_work:
cmp [procinfo+50],word 9 ;If slot state 9 - dialog is terminated
je erroff ;TESTODP2 terminated too
cmp [dlg_pid_get],dword 1
je getmesloop
inc [get_loops]
cmp [get_loops],4 ;2 sec if DLG_PID not get, TESTOP2 terminated
jae erroff
jmp getmesloop
mred:
call redproc
jmp getmesloop
mkey:
mov eax,2
mcall ; read (eax=2)
jmp getmesloop
mbutton:
mov eax,17 ; get id
mcall
cmp ah,1 ; button id=1 ?
jne getmesloop
mov eax,-1 ; close this program
mcall
mgetmes:
; If dlg_pid_get then second message get jmp to still
cmp [dlg_pid_get],dword 1
je ready
; First message is number of PID SYSXTREE dialog
; convert PID dec to PID bin
movzx eax,byte [path+16]
sub eax,48
imul eax,10
movzx ebx,byte [path+16+1]
add eax,ebx
sub eax,48
imul eax,10
movzx ebx,byte [path+16+2]
add eax,ebx
sub eax,48
imul eax,10
movzx ebx,byte [path+16+3]
add eax,ebx
sub eax,48
mov [DLGPID],eax
; Claear and prepare IPC area for next message
mov [path],dword 0
mov [path+4],dword 8
mov [path+8],dword 0
mov [path+12],dword 0
mov [path+16],dword 0
; Set dlg_pid_get for get next message
mov [dlg_pid_get],dword 1
call redproc ;show DLG_PID
jmp getmesloop
ready:
;
; The second message get
; Second message is 1024 bytes path to SAVE/OPEN file
; shl path string on 16 bytes
;
cld
mov esi,path+16
mov edi,path
mov ecx,1024/4
rep movsd
mov [edi],byte 0
jmp openoff
; DATA AREA
get_loops dd 0
dlg_pid_get dd 0
DLGPID dd 0
param:
dd 0 ; My dec PID
dd 0,0 ; Type of dialog
run_fileinfo:
dd 7
dd 0
dd param
dd 0
dd 0
;run_filepath:
db '/sys/SYSXTREE',0
procinfo:
times 1024 db 0
}
; RANDOM - generate random count (small)
; (SYNTAX) RANDOM MaxCount,OutArgument
; (SAMPLE) RANDOM 10000,eax
; ( NOTE ) Maxint<65536 ; use random 65536,eax for more combinations
randomuse = 0
macro random arg1,arg2
{
local rxproc
randomuse = randomuse + 1
jmp rxproc
if defined randomuse & randomuse = 1
randomproc:
jmp rnj
rsx1 dw 0x4321
rsx2 dw 0x1234
rnj:
; mov eax,arg1
push bx
push cx
push dx
push si
push di
mov cx,ax
mov ax,word ptr rsx1
mov bx,word ptr rsx2
mov si,ax
mov di,bx
mov dl,ah
mov ah,al
mov al,bh
mov bh,bl
xor bl,bl
rcr dl,1
rcr ax,1
rcr bx,1
add bx,di
adc ax,si
add bx,0x62e9
adc ax,0x3619
mov word ptr rsx1,bx
mov word ptr rsx2,ax
xor dx,dx
cmp ax,0
je nodiv
cmp cx,0
je nodiv
div cx
nodiv:
mov ax,dx
pop di
pop si
pop dx
pop cx
pop bx
and eax,0000ffffh
; mov arg2,0
; mov arg2,eax
ret
end if
rxproc:
mov eax,arg1
call randomproc
mov arg2,eax
}
macro scank
{
mov eax,10
mcall
}
macro putpix x,y,color
{
mov ebx,x
mov ecx,y
mov edx,color
mov eax,1
mcall
}
macro puttxt x,y,offs,size,color
{
; mov ebx,x
; shl ebx,16
; add ebx,y
wordstoreg ebx,x,y
mov ecx,color
mov edx,offs
mov esi,size
mov eax,4
mcall
}
macro outcount data, x, y, color, numtype
{
mov ecx,data
mov ebx,numtype
mov bl,0
; mov edx,x*65536+y
wordstoreg edx,x,y
mov esi,color
mov eax,47
mcall
}
; SCEVENT - Scan event
macro scevent red,key,but
{
mov eax,11
mcall
dec eax
jz red
dec eax
jz key
dec eax
jz but
}
; WTEVENT - Wait event
macro wtevent red,key,but
{
mov eax,10
mcall
dec eax
jz red
dec eax
jz key
dec eax
jz but
}
; TIMEEVENT - Wite for event with timeout
macro timeevent xfps,noevent,red,key,but
{
mov eax,23
mov ebx,xfps
mcall
cmp eax,0
je noevent
dec eax
jz red
dec eax
jz key
dec eax
jz but
}
; CLOSE - Close program
macro close
{
mov eax,-1
mcall
}
; DELAY - Create delay 1/100 sec
; (SYNTAX) Delay time
; (SAMPLE) Delay 100 ;delay 2 sec 1/100*200=2 sec
macro delay arg1
{
mov eax,5
mov ebx,arg1
mcall
}
; WINDOW - Draw window
; (SYNTAX) WINDOW Xstart,Ystart,'Text',Color
; (SAMPLE) WINDOW 10,10,640+8,480+24,window_Skinned
macro window arg1,arg2,arg3,arg4,arg5
{
; mov ebx,arg1*65536+arg3
; mov ecx,arg2*65536+arg4
wordstoreg ebx,arg1,arg3
wordstoreg ecx,arg2,arg4
mov edx,arg5
mov eax,0
mcall
}
macro colorwindow arg1,arg2,arg3,arg4,arg5,arg6,arg7
{
mov ebx,arg1*65536+arg3
mov ecx,arg2*65536+arg4
mov edx,arg5
mov esi,arg6
mov edi,arg7
mov eax,0
mcall
}
; STARTWD - Start of window draw
macro startwd
{
mov eax,12
mov ebx,1
mcall
}
; ENDWD - End window draw
macro endwd
{
mov eax,12
mov ebx,2
mcall
}
; LABEL - Put text to frame
; (SYNTAX) LABEL Xstart,Ystart,'Text',Color
; (SAMPLE) LABEL 10,12,'Hello World!',cl_Green+font_Big
;Key's
key_Up equ 178
key_Down equ 177
key_Right equ 179
key_Left equ 176
key_Esc equ 27
key_Space equ 32
key_Enter equ 13
key_Bspace equ 8
key_F1 equ 50
key_F2 equ 51
key_F3 equ 52
key_F4 equ 53
key_F5 equ 54
key_F6 equ 55
key_F7 equ 56
key_F8 equ 57
key_F9 equ 48
key_F10 equ 49
key_F11 equ 68
key_F12 equ 255
key_Home equ 180
key_End equ 181
key_PgUp equ 184
key_PgDown equ 183
;Attributes
;Window Attributes
window_Skinned equ 0x03000000
window_Type2 equ 0x02000000
window_Type1 equ 0x00000000
window_Reserve equ 0x01000000
;Font Attributes
font_Big equ 0x10000000
;Colors
cl_White equ 0x00ffffff
cl_Black equ 0x00000000
cl_Grey equ 0x00888888
cl_Red equ 0x00ff0000
cl_Lime equ 0x0000ff00
cl_Green equ 0x0000af00
cl_Blue equ 0x000000ff
cl_Purple equ 0x008080ff
cl_Violet equ 0x008040ff
cl_Cyan equ 0x0040e0ff

View File

@ -37,21 +37,6 @@ struc BGIfree FontName,XY,Angle,ScaleX,ScaleY,StrPtr,StrLen,Color,Align
dd Align ;32
}
; font options structure
struc BGIrec FontName,CharsCount,FirstChar,UpperMargin,LowerMargin,\
Widths,FirstData,EOF,font_data
{
.FontName dd ? ; 0
.CharsCount db ? ; 4
.FirstChar db ? ; 5
.UpperMargin db ? ; 6
.LowerMargin db ? ; 7
.Widths dd ? ; 8
.FirstData dd ? ; 12
.EOF dd ? ; 16
.font_data dd ? ; 20 follows (Offsets)
}
macro BGIfont_GetID
{
call _BGIfont_GetID
@ -80,54 +65,6 @@ if BGI_LEVEL eq KERNEL
end if
}
BGIfont_names:
_FI 'LCOM',11485 ;7
_FI 'EURO',8117 ;5
_FI 'GOTH',13816 ;6
_FI 'LITT',3596 ;8
_FI 'TRIP',11932 ;14
_FI 'SCRI',8490 ;11
_FI 'SMAL',4162 ;13
_FI 'TSCR',12134 ;15
_FI 'SANS',8453 ;10
_FI 'SIMP',9522 ;12
BGIfont_names_end:
macro BGIfont_Init
{
; in: ecx - number of fonts to load;
; esi-> _FI structure
; edi-> where to load
push edi
if BGI_LEVEL eq KERNEL
mov edi,0x40000
end if
.nfont:
mov edx,[esi]
if BGI_LEVEL eq KERNEL
movzx ebx,word[esi+4]
mov [BGIfont_Prepare.okflag],'N'
end if
call _BGIfont_Prepare
if ~ BGI_LEVEL eq KERNEL
add esi,4
else
push esi
test eax,eax
jz .fail
mov [BGIfont_Prepare.okflag],'*'
.fail:
mov esi,BGIfont_Prepare.font
call boot_log
pop esi
add esi,6
end if
loop .nfont
dph2 _BGI_BOLD,300,550
; movzx edi,byte[0x40000]
pop edi
}
BGIfont_get2head:
shr ecx,28 ; font #
sub ecx,4
@ -146,30 +83,11 @@ BGIfont_get2head:
.ex:
ret
BGIfont_GetName:
; in: ecx-fontID;
; out: edx-font name.
call BGIfont_get2head
xor edx,edx
test edi,edi
jz .ex
mov edx,[edi]
.ex:
ret
macro dps2 _str
{
if ~ BGI_LEVEL eq KERNEL
if LOAD_MSG eq 1
dps _str
end if
else
pusha
mov esi,BGIfont_Prepare.okflag
mov byte[esi], _str
call boot_log
popa
end if
}
macro dph2 num,x,y
@ -236,32 +154,21 @@ _BGIfont_Prepare:
mov dword[.font],edx ; filename
mov esi,edi ; esi->FontName
mov [.dest],edi ; ptr to load font
if ~ BGI_LEVEL eq KERNEL
mov eax, 70
mov ebx, .fontattr
mcall
test eax, eax
jnz .fail
;jnz .fail
dps2 '1'
mov eax, [.fileattr+32]
mov [.fsize], eax
mov [.fsize], litt_end-litt_file
mov ebx,.fontinfo
mov eax,70
mcall ; ebx - file size
else
push edi esi edx
mov eax,.font
xor ebx,ebx
mov esi,12
mov ecx,ebx
mov edx,edi
call fileread
pop edx esi edi
mov ebp,edi
add ebp,ebx
cmp ebp,0x50000
ja .fail
end if
;mov ebx, litt_end-litt_file
;mov edi, litt_file
;mov [.dest],litt_file ; ptr to load font
cmp dword[edi],0x08084b50 ; 'PK',8,8
jne .fail
dps2 '2'
@ -334,7 +241,6 @@ end if
popa
ret
if ~ BGI_LEVEL eq KERNEL
.fontinfo:
dd 0
dd 0
@ -343,7 +249,7 @@ if ~ BGI_LEVEL eq KERNEL
.dest dd 0
.fontfullname:
db BGIFONT_PATH
.font db 'FONT.CHR',0
.font db 'LITT.CHR',0
.fontattr:
dd 5
@ -354,11 +260,7 @@ if ~ BGI_LEVEL eq KERNEL
db 0
dd .fontfullname
.fileattr rd 40/4
else
.dest dd 0
.font db 'FONT CHR'
.okflag db ' ',0
end if
BGIfont_Coo:
; y->word[txt.y1], x->word[txt.x1]

Binary file not shown.

View File

@ -15,8 +15,6 @@ WINW equ 600
WINH equ 450
WIN_COLOR equ 0x73f0f0f0
DEFCOLOR equ 0x303030
;RENDER equ PIX
;RENDER equ BGI
RENDER equ FREE
BGIFONT_PATH equ '/sys/fonts/'
@ -56,34 +54,24 @@ AR_OFFSET equ 10
dd I_END0 ; à §¬¥à ¯à®£à ¬¬ë
dd esp_end ; ª®«¨ç¥á⢮ ¯ ¬ïâ¨
dd sys_mem ;  ¤à¥á ¢¥à設ë áâíª 
dd fname_buf ;  ¤à¥á ¡ãä¥à  ¤«ï ¯ à ¬¥â஢ (­¥ ¨á¯®«ì§ã¥âáï)
dd cur_dir_path ; § à¥§¥à¢¨à®¢ ­®
dd fname_buf ;  ¤à¥á ¡ãä¥à  ¤«ï ¯ à ¬¥â஢
dd cur_dir_path ; ¯ãâì ª ¯à®£à ¬¬¥
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 'MACROS.INC'
;include 'load_lib.mac'
@use_library
;include '../../../debug.inc'
; include '../../../debug.inc'
if ~ RENDER eq PIX
TOP=TOP+4
include 'bgifont.inc'
end if
TOP=TOP+4
include 'bgifont.inc'
include 'rtf_lite.inc'
;include 'ascl.inc'
;---------------------------------------------------------------------
;--- <20>€—€Ž <20><>Žƒ<C5BD>€ŒŒ ----------------------------------------------
;---------------------------------------------------------------------
help_file:
file 'reader.rtf'
help_end:
START:
mcall 68, 11
mcall 40, 0x80000027
@ -95,11 +83,9 @@ load_libraries l_libs_start,end_l_libs
call [OpenDialog_Init]
mov [pitch],2
if ~ RENDER eq PIX
mov edx,FONT_NAME
mov edi,save_limit
BGIfont_Prepare
end if
start2:
cmp byte[fname_buf],0
je load_file;top_red
@ -321,7 +307,6 @@ key: ;
; je still
jmp red
.noarup:
if RENDER eq FREE
cmp ah,56 ;zoom+
jne .noplus
.zplus:
@ -338,7 +323,6 @@ key: ;
fdiv [Zoomscale]
jmp .zoom
.nominus:
end if
cmp ah,0xB5 ; end
jne .pre_file_open
.end:
@ -672,14 +656,7 @@ end if
mov ecx,16
.l1:
push ecx
if RENDER eq BGI
mov edx,char
mov ecx,0x48000000
mov esi,1
BGIfont_Outtext
else
mcall 4,,0x10000000,char,1
end if
pop ecx
inc [char]
add ebx,(CHARW+3) shl 16
@ -1072,18 +1049,13 @@ scroll_bar_data_vertical:
;---------------------------------------------------------------------
;blind db ?
if RENDER eq PIX
; rd 2
Free rd 9
else
if RENDER eq BGI
FreeFontscale dd 0.07
else
Zoomscale dd 1.15
FreeFontscale dd 0.04
end if
Free BGIfree FONT_NAME,0,0,1.0,1.0,char,1,0x44000000,0
end if
I_END0:
fname_buf:
rb 1024+16
@ -1141,6 +1113,14 @@ szKeyword rb 31
szParameter rb 21
block_end dd ?
help_file:
file 'reader.rtf'
help_end:
litt_file:
file 'litt.chr'
litt_end:
;---------------------------------------------------------------------
I_END: ; ¬¥âª  ª®­æ  ¯à®£à ¬¬ë
rb RTFSIZE