2006-01-03 10:43:31 +01:00
|
|
|
|
; RTF READER FOR MENUET v1.
|
|
|
|
|
; Written in pure assembler by Ivushkin Andrey aka Willow
|
|
|
|
|
;
|
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
M64 equ 64*1024
|
|
|
|
|
N_A equ 0x412f4e
|
|
|
|
|
RTFSIZE equ M64
|
|
|
|
|
RTFSTACKSIZE equ M64
|
|
|
|
|
BGIFONTSIZE equ 120*1024
|
|
|
|
|
ESPSIZE equ M64
|
|
|
|
|
LMARGIN equ 20
|
|
|
|
|
CHARW equ 6
|
|
|
|
|
CHARH equ 11
|
|
|
|
|
WINW equ 600
|
|
|
|
|
WINH equ 450
|
|
|
|
|
WIN_COLOR equ 0x3f0f0f0
|
|
|
|
|
DEFCOLOR equ 0x303030
|
|
|
|
|
;RENDER equ PIX
|
|
|
|
|
;RENDER equ BGI
|
|
|
|
|
RENDER equ FREE
|
|
|
|
|
|
2007-05-30 16:45:45 +02:00
|
|
|
|
BGIFONT_PATH equ '/sys/fonts/'
|
2006-01-03 10:43:31 +01:00
|
|
|
|
FONT_NAME equ 'LITT'
|
2009-10-04 14:45:50 +02:00
|
|
|
|
TOP =55
|
2006-01-03 10:43:31 +01:00
|
|
|
|
MODE equ RTF
|
|
|
|
|
INVALHEX equ 0
|
|
|
|
|
RTF_COLORLESS equ 1
|
|
|
|
|
RTF_ALIGNLESS equ 2
|
|
|
|
|
RTF_NO1STLINE equ 4
|
|
|
|
|
RTF_OPENING equ 8
|
|
|
|
|
RTF_HELP equ 16
|
|
|
|
|
RTF_VALID equ 32
|
|
|
|
|
RTF_BLIND equ 64
|
|
|
|
|
RTF_TOEOF equ 128
|
|
|
|
|
RTF_BOTTOM equ 256
|
|
|
|
|
STEPBYSTEP equ 10
|
|
|
|
|
DEBUG_BLOCK equ 10
|
|
|
|
|
SHOWALIGN equ 10
|
|
|
|
|
GUTTER equ 10
|
|
|
|
|
BENCH equ 0;1
|
|
|
|
|
syms equ 12
|
|
|
|
|
|
2006-08-24 14:33:31 +02:00
|
|
|
|
use32 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 32-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ०<><E0A5A6> <20><>ᥬ<EFBFBD><E1A5AC><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
org 0x0 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2006-08-24 14:33:31 +02:00
|
|
|
|
db 'MENUET01' ; 8-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䨪<EFBFBD><E4A8AA><EFBFBD><EFBFBD> MenuetOS
|
|
|
|
|
dd 0x01 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28>ᥣ<EFBFBD><E1A5A3> 1)
|
|
|
|
|
dd START ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ࢮ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
dd I_END0 ; ࠧ<><E0A0A7><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC>
|
|
|
|
|
dd esp_end ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⢮ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
dd sys_mem ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>設<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
dd fname_buf ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>ࠬ<EFBFBD><E0A0AC> (<28><> <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
|
|
|
|
dd 0x0 ; <20><>१<EFBFBD>ࢨ<E0A2A8><E0AEA2><EFBFBD>
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2007-05-10 15:48:35 +02:00
|
|
|
|
include '..\..\..\MACROS.INC' ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ᥬ<EFBFBD><E1A5AC><EFBFBD><EFBFBD>騪<EFBFBD><E9A8AA>!
|
2010-02-17 16:15:50 +01:00
|
|
|
|
include '..\..\..\develop\libraries\box_lib\load_lib.mac'
|
|
|
|
|
include '..\..\..\develop\libraries\box_lib\asm\trunk\opendial.mac'
|
|
|
|
|
|
|
|
|
|
;include 'MACROS.INC'
|
|
|
|
|
;include 'load_lib.mac'
|
|
|
|
|
;include 'opendial.mac'
|
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
include 'debug.inc'
|
2010-02-17 16:15:50 +01:00
|
|
|
|
|
|
|
|
|
use_OpenDialog
|
2006-01-03 10:43:31 +01:00
|
|
|
|
if ~ RENDER eq PIX
|
|
|
|
|
TOP=TOP+4
|
|
|
|
|
include 'bgifont.inc'
|
|
|
|
|
end if
|
|
|
|
|
include 'rtf_lite.inc'
|
|
|
|
|
include 'ascl.inc'
|
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
;--- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ----------------------------------------------
|
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
help_file:
|
|
|
|
|
file 'reader.rtf'
|
|
|
|
|
help_end:
|
|
|
|
|
|
|
|
|
|
START:
|
2010-02-17 16:15:50 +01:00
|
|
|
|
mcall 68, 11
|
|
|
|
|
;OpenDialog initialisation
|
|
|
|
|
init_OpenDialog OpenDialog_data
|
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
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
|
2006-08-24 14:33:31 +02:00
|
|
|
|
je load_file;top_red
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jmp noactivate
|
|
|
|
|
prep_load:
|
|
|
|
|
; mcall 18,3,dword[prcinfo+30]
|
|
|
|
|
noactivate:
|
|
|
|
|
; and ebp,not RTF_OPENING
|
|
|
|
|
; and ebp,not RTF_HELP
|
|
|
|
|
|
|
|
|
|
; and [mode],not RTF_OPENING
|
|
|
|
|
and [mode],not (RTF_HELP+RTF_OPENING)
|
|
|
|
|
mov ecx,16
|
|
|
|
|
mov edi,fileinfo.name
|
|
|
|
|
mov esi,fname_buf
|
|
|
|
|
rep movsd
|
|
|
|
|
load_file:
|
2006-08-28 15:34:54 +02:00
|
|
|
|
mov eax, 70
|
|
|
|
|
and [fileattr+32], 0
|
|
|
|
|
mov ebx, attrinfo
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall
|
2006-08-28 15:34:54 +02:00
|
|
|
|
mov ebx, [fileattr+32]
|
|
|
|
|
test eax, eax
|
|
|
|
|
jz .sizok
|
|
|
|
|
mov dword [fileinfo.name], N_A
|
|
|
|
|
.sizok:
|
2006-01-03 10:43:31 +01:00
|
|
|
|
and [wSave],0
|
|
|
|
|
mov [HClick],-100
|
|
|
|
|
mov eax,ebx
|
|
|
|
|
and eax,RTFSIZE-1
|
|
|
|
|
add eax,I_END
|
|
|
|
|
mov [tail],eax
|
|
|
|
|
shr ebx,16
|
|
|
|
|
; dpd ebx
|
|
|
|
|
mov [max_block],ebx
|
|
|
|
|
xor eax,eax
|
|
|
|
|
mov ecx,256
|
|
|
|
|
mov edi,fileinfo.name
|
|
|
|
|
repne scasb
|
|
|
|
|
sub edi,fileinfo.name+1
|
|
|
|
|
mov [fname_size],edi
|
|
|
|
|
top_red:
|
|
|
|
|
mov [top],TOP
|
2006-08-24 14:33:31 +02:00
|
|
|
|
red: ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᮢ<EFBFBD><E1AEA2><EFBFBD> <20><><EFBFBD><EFBFBD>
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2006-08-24 14:33:31 +02:00
|
|
|
|
call draw_window ; <20><><EFBFBD>뢠<EFBFBD><EBA2A0> <20><><EFBFBD>楤<EFBFBD><E6A5A4><EFBFBD> <20><><EFBFBD><EFBFBD>ᮢ<EFBFBD><E1AEA2> <20><><EFBFBD><EFBFBD>
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
;--- <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ----------------------------------------
|
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
still:
|
2006-08-24 14:33:31 +02:00
|
|
|
|
mcall 10 ; <20>㭪<EFBFBD><E3ADAA><EFBFBD> 10 - <20><><EFBFBD><EFBFBD><EFBFBD> ᮡ<><E1AEA1><EFBFBD><EFBFBD>
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2006-08-24 14:33:31 +02:00
|
|
|
|
cmp eax,1 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᮢ<EFBFBD><E1AEA2><EFBFBD> <20><><EFBFBD><EFBFBD> ?
|
|
|
|
|
je red ; <20> <20><> - <20><> <20><><EFBFBD><EFBFBD><EFBFBD> red
|
|
|
|
|
cmp eax,3 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ?
|
|
|
|
|
je button ; <20> <20><> - <20><> button
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
2006-08-24 14:33:31 +02:00
|
|
|
|
key: ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mcall 2 ; <20>㭪<EFBFBD><E3ADAA><EFBFBD> 2 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD> (<28> ah)
|
|
|
|
|
cmp ah,104 ; HELP
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jne .nohelp
|
|
|
|
|
.help:
|
|
|
|
|
xor [mode],RTF_HELP
|
|
|
|
|
test [mode],RTF_HELP
|
2006-08-24 14:33:31 +02:00
|
|
|
|
jz load_file
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov ecx,help_end-help_file
|
|
|
|
|
mov [block_end],ecx
|
|
|
|
|
add [block_end],I_END
|
|
|
|
|
mov [tail],ecx
|
|
|
|
|
add [tail],I_END
|
|
|
|
|
mov esi,help_file
|
|
|
|
|
mov edi,I_END
|
|
|
|
|
rep movsb
|
|
|
|
|
; or [mode],RTF_HELP
|
|
|
|
|
xor eax,eax
|
|
|
|
|
mov [max_block],eax
|
|
|
|
|
jmp top_red
|
|
|
|
|
.nohelp:
|
|
|
|
|
; test [mode],RTF_HELP
|
|
|
|
|
; jz .nohelp2
|
|
|
|
|
; and [mode],not RTF_HELP
|
|
|
|
|
; cmp dword[fileinfo.name],N_A
|
|
|
|
|
; je still
|
|
|
|
|
; jmp prep_load
|
|
|
|
|
.nohelp2:
|
2006-08-24 14:33:31 +02:00
|
|
|
|
cmp ah,114 ; R - redraw
|
|
|
|
|
je red
|
|
|
|
|
cmp ah,99 ; C - color
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jne .nocolor
|
|
|
|
|
.color:
|
|
|
|
|
xor [mode],RTF_COLORLESS
|
|
|
|
|
jmp red
|
|
|
|
|
.nocolor:
|
2006-08-24 14:33:31 +02:00
|
|
|
|
cmp ah,97 ; A - alignment
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jne .noalign
|
|
|
|
|
.alignment:
|
|
|
|
|
xor [mode],RTF_ALIGNLESS
|
|
|
|
|
jmp red
|
|
|
|
|
.noalign:
|
2006-08-24 14:33:31 +02:00
|
|
|
|
cmp ah,44 ; < - pitch dec
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jne .nopd
|
|
|
|
|
.decp:
|
|
|
|
|
dec [pitch]
|
|
|
|
|
jmp red
|
|
|
|
|
.nopd:
|
2006-08-24 14:33:31 +02:00
|
|
|
|
cmp ah,46 ; < - pitch inc
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jne .nopi
|
|
|
|
|
.incp:
|
|
|
|
|
inc [pitch]
|
|
|
|
|
jmp red
|
|
|
|
|
.nopi:
|
2006-08-24 14:33:31 +02:00
|
|
|
|
cmp ah,180 ; Home
|
|
|
|
|
je top_red
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov ebx,dword[prcinfo+46]
|
|
|
|
|
sub ebx,TOP+15
|
|
|
|
|
cmp ah,183 ;PgDn
|
|
|
|
|
jne .nopgdn
|
|
|
|
|
sub [top],bx
|
|
|
|
|
jmp red
|
|
|
|
|
.nopgdn:
|
|
|
|
|
cmp ah,177 ;arrDn
|
|
|
|
|
jne .noardn
|
|
|
|
|
sub [top],CHARH
|
|
|
|
|
jmp red
|
|
|
|
|
.noardn:
|
|
|
|
|
mov cx,[top]
|
|
|
|
|
cmp ah,184 ;PgUp
|
|
|
|
|
jne .nopgup
|
|
|
|
|
add [top],bx
|
|
|
|
|
cmp [top],TOP
|
2006-08-24 14:33:31 +02:00
|
|
|
|
jl red
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov [top],TOP
|
|
|
|
|
cmp cx,[top]
|
2006-08-24 14:33:31 +02:00
|
|
|
|
je still
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jmp red
|
|
|
|
|
.nopgup:
|
|
|
|
|
cmp ah,178 ;arrUp
|
|
|
|
|
jne .noarup
|
|
|
|
|
add [top],CHARH
|
|
|
|
|
cmp [top],TOP
|
2006-08-24 14:33:31 +02:00
|
|
|
|
jl red
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov [top],TOP
|
|
|
|
|
cmp cx,[top]
|
2006-08-24 14:33:31 +02:00
|
|
|
|
je still
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jmp red
|
|
|
|
|
.noarup:
|
|
|
|
|
if RENDER eq FREE
|
|
|
|
|
cmp ah,56 ;zoom+
|
|
|
|
|
jne .noplus
|
|
|
|
|
.zplus:
|
|
|
|
|
fld [FreeFontscale]
|
|
|
|
|
fmul [Zoomscale]
|
|
|
|
|
.zoom:
|
|
|
|
|
fstp [FreeFontscale]
|
|
|
|
|
jmp red
|
|
|
|
|
.noplus:
|
|
|
|
|
cmp ah,54 ;zoom-
|
|
|
|
|
jne .nominus
|
|
|
|
|
.zminus:
|
|
|
|
|
fld [FreeFontscale]
|
|
|
|
|
fdiv [Zoomscale]
|
|
|
|
|
jmp .zoom
|
|
|
|
|
.nominus:
|
|
|
|
|
end if
|
2006-08-24 14:33:31 +02:00
|
|
|
|
cmp ah,108 ; L - load
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jne stilld
|
|
|
|
|
.file_open:
|
2010-02-17 16:15:50 +01:00
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
;OpenDialog_start:
|
|
|
|
|
call get_filter_data
|
|
|
|
|
; copy_path open_dialog_name,path,library_path,0
|
|
|
|
|
|
|
|
|
|
start_OpenDialog OpenDialog_data
|
|
|
|
|
|
|
|
|
|
cmp [OpenDialog_data.status],2 ; OpenDialog does not start
|
|
|
|
|
je .sysxtree ; some kind of alternative, instead OpenDialog
|
|
|
|
|
cmp [OpenDialog_data.status],1
|
|
|
|
|
; jne still ; OpenDialog user say cancel
|
|
|
|
|
; copy path
|
|
|
|
|
; call draw_window
|
|
|
|
|
je prep_load
|
|
|
|
|
|
|
|
|
|
;.copy_dir_path:
|
|
|
|
|
; mov esi,fname_buf
|
|
|
|
|
; mov edi,temp_dir_pach
|
|
|
|
|
; call copy_dir_path
|
|
|
|
|
|
|
|
|
|
jmp still ; OpenDialog user selected the target file
|
|
|
|
|
; [OpenDialog_data.openfile_pach] pointer of area the target file
|
|
|
|
|
|
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
.sysxtree:
|
2006-08-24 14:33:31 +02:00
|
|
|
|
or [mode],RTF_OPENING
|
2006-01-03 10:43:31 +01:00
|
|
|
|
opendialog draw_window, prep_load, st_1, fname_buf
|
|
|
|
|
st_1:
|
|
|
|
|
and [mode],not RTF_OPENING
|
|
|
|
|
jmp still;red
|
|
|
|
|
stilld:
|
|
|
|
|
jmp still
|
2010-02-17 16:15:50 +01:00
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
get_filter_data:
|
|
|
|
|
mov edi,[OpenDialog_data.com_area]
|
|
|
|
|
test edi,edi
|
|
|
|
|
jnz @f
|
|
|
|
|
add esp,4
|
|
|
|
|
jmp still
|
|
|
|
|
@@:
|
|
|
|
|
add edi,4096+4
|
|
|
|
|
mov esi,Filter
|
|
|
|
|
mov ecx,[esi]
|
|
|
|
|
inc ecx
|
|
|
|
|
cld
|
|
|
|
|
rep movsb
|
|
|
|
|
mov edi,[OpenDialog_data.com_area]
|
|
|
|
|
mov [edi+4096],dword 1
|
|
|
|
|
ret
|
2006-01-03 10:43:31 +01:00
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
button:
|
2006-08-24 14:33:31 +02:00
|
|
|
|
mcall 17 ; 17 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䨪<EFBFBD><E4A8AA><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>⮩ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2006-01-03 10:43:31 +01:00
|
|
|
|
cmp ah,2
|
2006-08-24 14:33:31 +02:00
|
|
|
|
je key.help
|
2006-01-03 10:43:31 +01:00
|
|
|
|
cmp ah,3
|
2006-08-24 14:33:31 +02:00
|
|
|
|
je key.color
|
2006-01-03 10:43:31 +01:00
|
|
|
|
cmp ah,4
|
2006-08-24 14:33:31 +02:00
|
|
|
|
je key.alignment
|
2006-01-03 10:43:31 +01:00
|
|
|
|
cmp ah,5
|
2006-08-24 14:33:31 +02:00
|
|
|
|
je key.file_open
|
2006-01-03 10:43:31 +01:00
|
|
|
|
cmp ah,6
|
2006-08-24 14:33:31 +02:00
|
|
|
|
je key.incp
|
2006-01-03 10:43:31 +01:00
|
|
|
|
cmp ah,7
|
2006-08-24 14:33:31 +02:00
|
|
|
|
je key.decp
|
2006-01-03 10:43:31 +01:00
|
|
|
|
if RENDER eq FREE
|
|
|
|
|
cmp ah,8
|
2006-08-24 14:33:31 +02:00
|
|
|
|
je key.zminus
|
2006-01-03 10:43:31 +01:00
|
|
|
|
cmp ah,9
|
2006-08-24 14:33:31 +02:00
|
|
|
|
je key.zplus
|
2006-01-03 10:43:31 +01:00
|
|
|
|
end if
|
2006-08-24 14:33:31 +02:00
|
|
|
|
cmp ah, 1 ; <20> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD> 1,
|
|
|
|
|
jne .noexit ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
.exit:
|
2006-08-24 14:33:31 +02:00
|
|
|
|
mcall -1 ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC>
|
2006-01-03 10:43:31 +01:00
|
|
|
|
.noexit:
|
|
|
|
|
cmp ah,20
|
|
|
|
|
jne still
|
|
|
|
|
mcall 37,1
|
|
|
|
|
and eax,0xffff
|
|
|
|
|
cmp eax,[HClick]
|
2006-08-24 14:33:31 +02:00
|
|
|
|
je still
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov [HClick],eax
|
|
|
|
|
sub eax,25
|
|
|
|
|
mul [HDoc]
|
|
|
|
|
mov ebx,dword[prcinfo+46]
|
|
|
|
|
sub ebx,25
|
|
|
|
|
div ebx
|
|
|
|
|
dpd eax
|
|
|
|
|
mov [top],TOP
|
|
|
|
|
sub [top],ax
|
|
|
|
|
dps 'B'
|
|
|
|
|
jmp red;still
|
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
;--- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ----------------------------------
|
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
draw_window:
|
|
|
|
|
|
2006-08-24 14:33:31 +02:00
|
|
|
|
mcall 12, 1 ; <20>㭪<EFBFBD><E3ADAA><EFBFBD> 12: ᮮ<><E1AEAE><EFBFBD><EFBFBD><EFBFBD> <20><> <20><> <20><><EFBFBD><EFBFBD>ᮢ<EFBFBD><E1AEA2> <20><><EFBFBD><EFBFBD>
|
|
|
|
|
; 1 - <20><>稭<EFBFBD><E7A8AD><EFBFBD> <20><>ᮢ<EFBFBD><E1AEA2><EFBFBD>
|
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mcall 0, <10,WINW>, <100,WINH>, WIN_COLOR,0x805080D0, 0x005080D0
|
2007-05-10 15:48:35 +02:00
|
|
|
|
mcall 4, <8,8>, 0x10DDEEFF, title, titlesize-title
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov esi,ecx
|
|
|
|
|
mcall 47,0x30000,isymImplemented,<114,8>
|
|
|
|
|
add edx,36 shl 16
|
|
|
|
|
mcall ,,isymMax
|
|
|
|
|
add edx,40 shl 16
|
|
|
|
|
mov esi,0x104e00e7;0x10f27840
|
|
|
|
|
cmp dword[fileinfo.name],N_A
|
|
|
|
|
jne .noNA
|
|
|
|
|
mov esi,0x10ff0000
|
|
|
|
|
.noNA:
|
|
|
|
|
mcall 4,edx,esi,fileinfo.name,[fname_size]
|
|
|
|
|
mov edi,prcinfo
|
|
|
|
|
mcall 9,edi,-1
|
|
|
|
|
and [mode],not RTF_TOEOF
|
|
|
|
|
mov ebx,[edi+42]
|
|
|
|
|
cmp ebx,[wSave]
|
2006-08-24 14:33:31 +02:00
|
|
|
|
je .nochg
|
2006-01-03 10:43:31 +01:00
|
|
|
|
.chg:
|
|
|
|
|
mov [wSave],ebx
|
2006-08-24 14:33:31 +02:00
|
|
|
|
or [mode],RTF_TOEOF
|
2006-01-03 10:43:31 +01:00
|
|
|
|
and [HDoc],0
|
|
|
|
|
and [line_count],0
|
|
|
|
|
mov [HClick],-100
|
|
|
|
|
.nochg:
|
2009-10-04 14:45:50 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mcall 13,<5,dword[prcinfo+42]>,<21,21>,0x8000459a
|
|
|
|
|
|
|
|
|
|
mcall 8,7*65536+39,23*65536+16,5,0x459a ;load
|
|
|
|
|
mcall 8,46*65536+57,23*65536+16,4,0x459a ;align
|
|
|
|
|
mcall 8,103*65536+44,23*65536+16,3,0x459a ;color
|
|
|
|
|
mcall 8,147*65536+37,23*65536+16,2,0x459a ;help
|
|
|
|
|
|
|
|
|
|
mcall 8,184*65536+44,23*65536+16,7,0x459a ;prev
|
|
|
|
|
mcall 8,229*65536+46,23*65536+16,6,0x459a ;next
|
|
|
|
|
|
|
|
|
|
if RENDER eq FREE
|
|
|
|
|
mcall 8,276*65536+44,23*65536+16,9,0x459a ;zoom+
|
|
|
|
|
mcall 8,320*65536+44,23*65536+16,8,0x459a ;zoom-
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; sub ebx,60
|
|
|
|
|
; shl ebx,16
|
|
|
|
|
; mov bx,12
|
|
|
|
|
; mov ecx,5 shl 16+12
|
|
|
|
|
; mov esi,0xb810e7
|
|
|
|
|
; mov edx,2
|
|
|
|
|
; BTN_SPACE equ 14 shl 16
|
|
|
|
|
; mcall 8 ;2
|
|
|
|
|
; sub ebx,BTN_SPACE
|
|
|
|
|
; inc edx
|
|
|
|
|
; mcall 8,,,,0x459a ;3
|
|
|
|
|
; sub ebx,BTN_SPACE
|
|
|
|
|
; inc edx
|
|
|
|
|
; mcall ,,,,0x107a30 ;4
|
|
|
|
|
; sub ebx,BTN_SPACE
|
|
|
|
|
; inc edx
|
|
|
|
|
; mcall ,,,,0xcc0000 ;5
|
|
|
|
|
; sub ebx,BTN_SPACE
|
|
|
|
|
; inc edx
|
|
|
|
|
; mcall ,,,,0x575f8c ;6
|
|
|
|
|
; sub ebx,BTN_SPACE
|
|
|
|
|
; inc edx
|
|
|
|
|
; mcall ,,,,0x575f8c ;7
|
|
|
|
|
; if RENDER eq FREE
|
|
|
|
|
; sub ebx,BTN_SPACE
|
|
|
|
|
; inc edx
|
|
|
|
|
; mcall ,,,,0x6a73d0 ;8
|
|
|
|
|
; sub ebx,BTN_SPACE
|
|
|
|
|
; inc edx
|
|
|
|
|
; mcall ,,,,0xd048c8 ;9
|
|
|
|
|
; end if
|
|
|
|
|
;text
|
|
|
|
|
; shr ecx,16
|
|
|
|
|
; mov bx,cx
|
|
|
|
|
; add ebx,3 shl 16+3
|
|
|
|
|
mcall 4,10*65536+27,0x10ddeeff,btn_text,btn_end-btn_text
|
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
sub dword[prcinfo+42],LMARGIN
|
|
|
|
|
sub dword[prcinfo+46],CHARH
|
|
|
|
|
if GUTTER eq 1
|
|
|
|
|
mov ebx,LMARGIN shl 16+20
|
|
|
|
|
mov ecx,20
|
|
|
|
|
mov eax,4
|
|
|
|
|
mov edx,arrow
|
|
|
|
|
mov esi,1
|
|
|
|
|
.loop1:
|
|
|
|
|
push ecx
|
|
|
|
|
mcall ,,0xff0000
|
|
|
|
|
pop ecx
|
|
|
|
|
add ebx,50 shl 16
|
|
|
|
|
loop .loop1
|
|
|
|
|
end if
|
|
|
|
|
mov ebx,dword[prcinfo+42]
|
|
|
|
|
shl ebx,16
|
2009-10-04 14:45:50 +02:00
|
|
|
|
add ebx,2 shl 16+13
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov ecx,dword[prcinfo+46]
|
2009-10-04 14:45:50 +02:00
|
|
|
|
add ecx,40 shl 16-35
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov edx,20+1 shl 29
|
|
|
|
|
mcall 8
|
|
|
|
|
mov ecx,[HClick]
|
|
|
|
|
shl ecx,16
|
2009-10-04 14:45:50 +02:00
|
|
|
|
add ecx,6-3 shl 16 + 7
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mcall 13,,,0xe26830
|
|
|
|
|
if MODE eq RTF
|
|
|
|
|
test [mode],RTF_OPENING
|
|
|
|
|
jne .ex
|
|
|
|
|
and [mode],not (RTF_BOTTOM);+RTF_TOEOF)
|
|
|
|
|
mov [colorptr],colortbl
|
|
|
|
|
mov eax,DEFCOLOR
|
|
|
|
|
mov edi,colortbl
|
|
|
|
|
mov ecx,16
|
|
|
|
|
rep stosd
|
|
|
|
|
xor eax,eax
|
|
|
|
|
mov [cGroup],eax
|
|
|
|
|
mov edi,Chp
|
|
|
|
|
mov ecx,SIZE_save
|
|
|
|
|
rep stosb
|
|
|
|
|
mov ax,[top]
|
|
|
|
|
mov word[Free+6],10
|
|
|
|
|
mov word[Free+4],ax
|
|
|
|
|
mov esi,I_END
|
|
|
|
|
call RtfParse
|
|
|
|
|
dpd eax
|
|
|
|
|
dps 'Lines='
|
|
|
|
|
mov eax,[line_count]
|
|
|
|
|
dpd eax
|
|
|
|
|
newline
|
|
|
|
|
; movzx eax,word[Free+4]
|
|
|
|
|
; dpd eax
|
|
|
|
|
mov eax,dword[prcinfo+42]
|
|
|
|
|
mov edx,WIN_COLOR
|
|
|
|
|
call draw_progress
|
|
|
|
|
if BENCH eq 1
|
|
|
|
|
mcall 26,9
|
|
|
|
|
sub eax,[bench]
|
|
|
|
|
dps <13,10,'Bench='>
|
|
|
|
|
dpd eax
|
|
|
|
|
end if
|
|
|
|
|
else
|
|
|
|
|
mov [char],0
|
|
|
|
|
mov ebx,10 shl 16+TOP
|
|
|
|
|
mov ecx,16
|
|
|
|
|
.l0:
|
|
|
|
|
push ecx
|
|
|
|
|
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
|
|
|
|
|
loop .l1
|
|
|
|
|
pop ecx
|
|
|
|
|
add ebx,CHARH+2
|
|
|
|
|
and ebx,0x0000ffff
|
|
|
|
|
add ebx,10 shl 16
|
|
|
|
|
loop .l0
|
|
|
|
|
end if
|
|
|
|
|
.ex:
|
2006-08-24 14:33:31 +02:00
|
|
|
|
mcall 12, 2 ; <20>㭪<EFBFBD><E3ADAA><EFBFBD> 12: ᮮ<><E1AEAE><EFBFBD><EFBFBD><EFBFBD> <20><> <20><> <20><><EFBFBD><EFBFBD>ᮢ<EFBFBD><E1AEA2> <20><><EFBFBD><EFBFBD>
|
|
|
|
|
; 2, <20><><EFBFBD><EFBFBD><EFBFBD>稫<EFBFBD> <20><>ᮢ<EFBFBD><E1AEA2><EFBFBD>
|
|
|
|
|
ret ; <20><>室<EFBFBD><E5AEA4> <20><> <20><><EFBFBD>楤<EFBFBD><E6A5A4><EFBFBD>
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
if GUTTER eq 1
|
|
|
|
|
arrow db 0x19
|
|
|
|
|
end if
|
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
;--- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ----------------------------------------------
|
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
; <20><><EFBFBD><EFBFBD><EFBFBD>䥩<EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> MACROS.INC (lang fix <20><><EFBFBD><EFBFBD>)
|
2007-05-10 15:48:35 +02:00
|
|
|
|
|
|
|
|
|
title:
|
2009-10-04 14:45:50 +02:00
|
|
|
|
db 'RTF Reader v1. ( ):'
|
2007-05-10 15:48:35 +02:00
|
|
|
|
titlesize:
|
2006-01-03 10:43:31 +01:00
|
|
|
|
btn_text:
|
2010-02-08 23:13:58 +01:00
|
|
|
|
db 'Load Aligment Color Help < >'
|
2009-10-04 14:45:50 +02:00
|
|
|
|
if RENDER eq FREE
|
|
|
|
|
db ' Zoom+ Zoom- '
|
|
|
|
|
end if
|
2006-01-03 10:43:31 +01:00
|
|
|
|
btn_end:
|
2010-02-17 16:15:50 +01:00
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
OpenDialog_data:
|
|
|
|
|
.type dd 0
|
|
|
|
|
.procinfo dd procinfo ;+4
|
|
|
|
|
.com_area_name dd communication_area_name ;+8
|
|
|
|
|
.com_area dd 0 ;+12
|
|
|
|
|
.opendir_pach dd temp_dir_pach ;+16
|
|
|
|
|
.dir_default_pach dd communication_area_default_pach ;+20
|
|
|
|
|
.start_path dd open_dialog_path ;+24
|
|
|
|
|
.draw_window dd draw_window ;+28
|
|
|
|
|
.status dd 0 ;+32
|
|
|
|
|
.openfile_pach dd fname_buf ;+36
|
|
|
|
|
|
|
|
|
|
communication_area_name:
|
|
|
|
|
db 'FFFFFFFF_open_dialog',0
|
|
|
|
|
open_dialog_path:
|
|
|
|
|
db '/sys/File Managers/opendial',0
|
|
|
|
|
communication_area_default_pach:
|
|
|
|
|
db '/rd/1',0
|
|
|
|
|
|
|
|
|
|
Filter:
|
|
|
|
|
dd Filter.end - Filter
|
|
|
|
|
db 'RTF',0
|
|
|
|
|
.end:
|
|
|
|
|
db 0
|
|
|
|
|
;---------------------------------------------------------------------
|
2006-08-28 15:34:54 +02:00
|
|
|
|
attrinfo:
|
|
|
|
|
dd 5
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd 0
|
|
|
|
|
dd fileattr
|
|
|
|
|
db 0
|
|
|
|
|
dd fileinfo.name
|
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
fileinfo:
|
|
|
|
|
dd 0
|
|
|
|
|
.block:
|
|
|
|
|
dd 0
|
2006-08-28 15:34:54 +02:00
|
|
|
|
dd 0
|
2006-01-03 10:43:31 +01:00
|
|
|
|
.size dd 1
|
|
|
|
|
dd I_END
|
|
|
|
|
.name:
|
|
|
|
|
; db '//'
|
|
|
|
|
; db ' /HD/1/RTF/texts/FASM.TXT',0
|
|
|
|
|
; db '/HD/1/RTF/TEST2.RTF',0
|
|
|
|
|
; db '/HD/1/RTF/texts/index_ru.RTF',0
|
|
|
|
|
; db '/HD/1/RTF/texts/stas.RTF',0
|
|
|
|
|
; db '/HD/1/RTF/texts/zed.RTF',0
|
|
|
|
|
; db '/HD/1/RTF/PRACT.RTF',0
|
|
|
|
|
; db '/HD/1/RTF/SETUP2.RTF',0
|
|
|
|
|
; db '/HD/1/RTF/texts/TC_RU.RTF',0
|
|
|
|
|
; db '/HD/1/RTF/texts/WORD.RTF',0
|
|
|
|
|
; db '/HD/1/RTF/texts/WORD97.RTF',0
|
|
|
|
|
; db '/HD/1/RTF/texts/MASTAPP.RTF',0
|
|
|
|
|
; db '/HD/1/RTF/texts/1c_tor77.RTF',0
|
|
|
|
|
; db '/HD/1/RTF/texts/RELATION.RTF',0
|
|
|
|
|
; db '/HD/1/RTF/texts/PLANETS.RTF',0
|
|
|
|
|
; db '/HD/1/RTF/texts/LOTRRUS.RTF',0
|
2009-10-04 14:45:50 +02:00
|
|
|
|
; db '/HD/1/RTF/texts/RULEBOOK.RTF',0
|
2006-01-03 10:43:31 +01:00
|
|
|
|
; db '/HD/1/RTF/texts/RULEBK2.RTF',0
|
|
|
|
|
; db '/HD/1/RTF/texts/GLEB.RTF',0
|
|
|
|
|
; db '/HD/1/RTF/texts/DWG13_14.RTF',0
|
|
|
|
|
; db '/HD/1/RTF/texts/LK.RTF',0
|
|
|
|
|
|
|
|
|
|
; db '/HD/1/RTF/texts/JUSTIFY.RTF',0
|
|
|
|
|
rb 256-($-.name)
|
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
;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:
|
2006-08-24 14:33:31 +02:00
|
|
|
|
fname_buf:
|
|
|
|
|
rb 1024+16
|
2006-08-28 15:34:54 +02:00
|
|
|
|
fileattr rd 40/4
|
2006-01-03 10:43:31 +01:00
|
|
|
|
if BENCH eq 1
|
|
|
|
|
bench dd ?
|
|
|
|
|
end if
|
|
|
|
|
tail dd ?
|
|
|
|
|
cGroup dd ?
|
|
|
|
|
Chp:
|
|
|
|
|
CHP
|
|
|
|
|
Pap:
|
|
|
|
|
PAP
|
|
|
|
|
Sep:
|
|
|
|
|
SEP
|
|
|
|
|
Dop:
|
|
|
|
|
DOP
|
|
|
|
|
rds db ?
|
|
|
|
|
ris db ?
|
|
|
|
|
cbBin dd ?
|
|
|
|
|
lParam dd ?
|
|
|
|
|
fSkipDestIfUnk db ?
|
|
|
|
|
mode dd ?
|
|
|
|
|
curheight dw ?
|
|
|
|
|
maxheight dw ?
|
|
|
|
|
RetroBlock dd ?
|
|
|
|
|
RetroSave:
|
|
|
|
|
SAVE
|
|
|
|
|
prcinfo rb 1024
|
|
|
|
|
RetroPtr dd ?
|
|
|
|
|
colorptr dd ?
|
|
|
|
|
colortbl rd 16
|
|
|
|
|
ct_end:
|
|
|
|
|
fname_size dd ?
|
|
|
|
|
max_block dd ?
|
|
|
|
|
cur_block dd ?
|
|
|
|
|
HDoc dd ?
|
|
|
|
|
HClick dd ?
|
|
|
|
|
top dw ?
|
|
|
|
|
line_count dd ?
|
|
|
|
|
par_count dd ?
|
|
|
|
|
char db ?
|
|
|
|
|
pitch db ?
|
|
|
|
|
wSave dd ?
|
|
|
|
|
RetroXY dd ?
|
|
|
|
|
RetroGroup dd ?
|
|
|
|
|
|
|
|
|
|
save_stack:
|
|
|
|
|
rb RTFSTACKSIZE
|
|
|
|
|
save_limit:
|
|
|
|
|
rb BGIFONTSIZE
|
|
|
|
|
|
|
|
|
|
listptr dd ?
|
|
|
|
|
szKeyword rb 31
|
|
|
|
|
szParameter rb 21
|
|
|
|
|
block_end dd ?
|
2006-08-24 14:33:31 +02:00
|
|
|
|
I_END: ; <20><>⪠ <20><><EFBFBD><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC>
|
2007-05-10 15:48:35 +02:00
|
|
|
|
|
|
|
|
|
procinfo process_information
|
2006-01-03 10:43:31 +01:00
|
|
|
|
rb RTFSIZE
|
|
|
|
|
esp1:
|
|
|
|
|
rb ESPSIZE
|
|
|
|
|
sys_mem:
|
|
|
|
|
rb ESPSIZE
|
2010-02-17 16:15:50 +01:00
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
temp_dir_pach:
|
|
|
|
|
rb 4096
|
|
|
|
|
;---------------------------------------------------------------------
|
2006-08-24 14:33:31 +02:00
|
|
|
|
esp_end:
|