2006-08-14 16:50:43 +04:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2006-01-03 12:43:31 +03:00
|
|
|
|
; project name: TINYPAD
|
2007-09-18 04:41:58 +04:00
|
|
|
|
; compiler: flat assembler 1.67.21
|
2007-01-28 02:36:07 +03:00
|
|
|
|
; memory to compile: 3.0/9.0 MBytes (without/with size optimizations)
|
2007-09-18 04:41:58 +04:00
|
|
|
|
; version: 4.0.5
|
|
|
|
|
; last update: 2007-09-18 (Sep 18, 2007)
|
2007-09-02 01:38:00 +04:00
|
|
|
|
; minimal kernel: revision #270 (svn://kolibrios.org/kernel/trunk)
|
2006-08-14 16:50:43 +04:00
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
; originally by: Ville Michael Turjanmaa >> villemt@aton.co.jyu.fi
|
2006-12-30 20:44:05 +03:00
|
|
|
|
; maintained by: Mike Semenyako >> mike.dld@gmail.com
|
|
|
|
|
; Ivan Poddubny >> ivan-yar@bk.ru
|
2006-08-14 16:50:43 +04:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2007-01-28 02:36:07 +03:00
|
|
|
|
; TODO (4.1.0):
|
2007-09-02 01:38:00 +04:00
|
|
|
|
; - add vertical selection, undo, goto position, overwrite mode, smart tabulation
|
2006-10-12 00:40:53 +04:00
|
|
|
|
; - improve window drawing with small dimensions
|
2007-09-02 01:38:00 +04:00
|
|
|
|
; - save/load settings to/from ini file, not executable
|
|
|
|
|
; - path autocompletion for open/save dialogs
|
2007-01-28 02:36:07 +03:00
|
|
|
|
; - other bug-fixes and speed/size optimizations
|
2007-09-02 01:38:00 +04:00
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
; See history.txt for complete changelog
|
2006-08-14 16:50:43 +04:00
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
|
2006-10-12 00:40:53 +04:00
|
|
|
|
include 'lang.inc'
|
2007-09-02 01:38:00 +04:00
|
|
|
|
|
|
|
|
|
include '../../../macros.inc' ; useful stuff
|
|
|
|
|
include '../../../struct.inc'
|
|
|
|
|
include '../../../proc32.inc'
|
|
|
|
|
|
|
|
|
|
include 'external/libio.inc'
|
|
|
|
|
|
2006-08-14 16:50:43 +04:00
|
|
|
|
include 'tinypad.inc'
|
2007-09-02 01:38:00 +04:00
|
|
|
|
|
2007-01-28 02:36:07 +03:00
|
|
|
|
;purge mov,add,sub ; SPEED
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
2007-01-03 21:22:05 +03:00
|
|
|
|
header '01',1,@CODE,TINYPAD_END,STATIC_MEM_END,MAIN_STACK,@PARAMS,self_path
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
2007-09-18 04:41:58 +04:00
|
|
|
|
APP_VERSION equ '4.0.5'
|
2006-12-30 20:44:05 +03:00
|
|
|
|
|
2007-09-02 01:38:00 +04:00
|
|
|
|
TRUE = 1
|
|
|
|
|
FALSE = 0
|
|
|
|
|
|
2006-08-14 16:50:43 +04:00
|
|
|
|
;include 'debug.inc'
|
2007-01-19 00:14:15 +03:00
|
|
|
|
;define __DEBUG__ 1
|
|
|
|
|
;define __DEBUG_LEVEL__ 1
|
|
|
|
|
;include 'debug-fdo.inc'
|
|
|
|
|
|
|
|
|
|
ASEPC = '-' ; separator character (char)
|
|
|
|
|
ATOPH = 19 ; menu bar height (pixels)
|
|
|
|
|
SCRLW = 16 ; scrollbar widht/height (pixels)
|
|
|
|
|
ATABW = 8 ; tab key indent width (chars)
|
|
|
|
|
LINEH = 10 ; line height (pixels)
|
|
|
|
|
PATHL = 256 ; maximum path length (chars) !!! don't change !!!
|
|
|
|
|
AMINS = 8 ; minimal scroll thumb size (pixels)
|
|
|
|
|
LCHGW = 3 ; changed/saved marker width (pixels)
|
|
|
|
|
|
|
|
|
|
STATH = 16 ; status bar height (pixels)
|
|
|
|
|
TBARH = 18 ; tab bar height (pixels)
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
2006-08-14 16:50:43 +04:00
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
section @OPTIONS ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
|
|
|
|
;-----------------------------------------------------------------------------
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
2006-08-14 16:50:43 +04:00
|
|
|
|
label color_tbl dword
|
2007-01-28 02:36:07 +03:00
|
|
|
|
.text: RGB( 0, 0, 0)
|
|
|
|
|
.back: RGB(255,255,255)
|
|
|
|
|
.text.sel: RGB(255,255,255)
|
|
|
|
|
.back.sel: RGB( 10, 36,106)
|
|
|
|
|
.symbol: RGB( 48, 48,240)
|
|
|
|
|
.number: RGB( 0,144, 0)
|
|
|
|
|
.string: RGB(176, 0, 0)
|
|
|
|
|
.comment: RGB(128,128,128)
|
|
|
|
|
.line.moded: RGB(255,238, 98)
|
|
|
|
|
.line.saved: RGB(108,226,108)
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
2006-08-14 16:50:43 +04:00
|
|
|
|
ins_mode db 1
|
2007-01-28 02:36:07 +03:00
|
|
|
|
tab_pos db 2
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
2006-08-14 16:50:43 +04:00
|
|
|
|
options db OPTS_AUTOINDENT+OPTS_OPTIMSAVE+OPTS_SMARTTAB
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
2006-08-14 16:50:43 +04:00
|
|
|
|
mainwnd_pos:
|
2007-01-10 09:03:39 +03:00
|
|
|
|
.x dd 250
|
2006-08-14 16:50:43 +04:00
|
|
|
|
.y dd 75
|
2007-01-19 00:14:15 +03:00
|
|
|
|
.w dd 6*80+6+SCRLW+5 ;- 220
|
|
|
|
|
.h dd 402 ;- 220
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
2006-08-14 16:50:43 +04:00
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
section @CODE ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
|
|
|
|
;-----------------------------------------------------------------------------
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
2006-08-14 16:50:43 +04:00
|
|
|
|
; fninit
|
|
|
|
|
|
2007-01-19 00:14:15 +03:00
|
|
|
|
; stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_left,50
|
|
|
|
|
; mov [mainwnd_pos.x],eax
|
|
|
|
|
; stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_top,50
|
|
|
|
|
; mov [mainwnd_pos.y],eax
|
|
|
|
|
; stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_right,350
|
|
|
|
|
; sub eax,[mainwnd_pos.x]
|
|
|
|
|
; mov [mainwnd_pos.w],eax
|
|
|
|
|
; stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_bottom,450
|
|
|
|
|
; sub eax,[mainwnd_pos.y]
|
|
|
|
|
; mov [mainwnd_pos.h],eax
|
2006-10-12 00:40:53 +04:00
|
|
|
|
|
2006-12-30 20:44:05 +03:00
|
|
|
|
cld
|
|
|
|
|
mov edi,@UDATA
|
|
|
|
|
mov ecx,@PARAMS-@UDATA
|
|
|
|
|
mov al,0
|
|
|
|
|
rep stosb
|
2006-08-14 16:50:43 +04:00
|
|
|
|
|
2007-01-28 02:36:07 +03:00
|
|
|
|
mov al,[tab_pos]
|
|
|
|
|
mov [tab_bar.Style],al
|
2007-01-03 21:22:05 +03:00
|
|
|
|
|
|
|
|
|
mcall 68,11
|
|
|
|
|
or eax,eax
|
|
|
|
|
jz key.alt_x.close
|
|
|
|
|
|
2007-09-02 01:38:00 +04:00
|
|
|
|
stdcall dll.Load,@IMPORT
|
|
|
|
|
or eax,eax
|
|
|
|
|
jnz key.alt_x.close
|
|
|
|
|
|
|
|
|
|
stdcall mem.Alloc,65536
|
2007-01-03 21:22:05 +03:00
|
|
|
|
mov [temp_buf],eax
|
|
|
|
|
|
2006-10-12 00:40:53 +04:00
|
|
|
|
inc [do_not_draw]
|
|
|
|
|
|
2007-01-28 02:36:07 +03:00
|
|
|
|
mov dword[app_start],7
|
|
|
|
|
|
2006-12-30 20:44:05 +03:00
|
|
|
|
mov esi,s_example
|
|
|
|
|
mov edi,tb_opensave.text
|
|
|
|
|
mov ecx,s_example.size
|
|
|
|
|
mov [tb_opensave.length],cl
|
|
|
|
|
rep movsb
|
2006-08-14 16:50:43 +04:00
|
|
|
|
|
2006-12-30 20:44:05 +03:00
|
|
|
|
mov esi,s_still
|
|
|
|
|
mov edi,s_search
|
|
|
|
|
mov ecx,s_still.size
|
|
|
|
|
mov [s_search.size],ecx
|
|
|
|
|
rep movsb
|
2006-08-14 16:50:43 +04:00
|
|
|
|
|
2006-12-30 20:44:05 +03:00
|
|
|
|
cmp byte[@PARAMS],0
|
|
|
|
|
jz no_params
|
2006-08-14 16:50:43 +04:00
|
|
|
|
|
|
|
|
|
;// Willow's code to support DOCPAK [
|
|
|
|
|
|
2006-12-30 20:44:05 +03:00
|
|
|
|
cmp byte[@PARAMS],'*'
|
|
|
|
|
jne .noipc
|
2006-10-12 00:40:53 +04:00
|
|
|
|
|
|
|
|
|
;// diamond [ (convert size from decimal representation to dword)
|
|
|
|
|
;-- mov edx,dword[@PARAMS+1]
|
2006-12-30 20:44:05 +03:00
|
|
|
|
mov esi,@PARAMS+1
|
|
|
|
|
xor edx,edx
|
|
|
|
|
xor eax,eax
|
2006-10-12 00:40:53 +04:00
|
|
|
|
@@: lodsb
|
2006-12-30 20:44:05 +03:00
|
|
|
|
test al,al
|
|
|
|
|
jz @f
|
|
|
|
|
lea edx,[edx*4+edx]
|
|
|
|
|
lea edx,[edx*2+eax-'0']
|
|
|
|
|
jmp @b
|
2006-10-12 00:40:53 +04:00
|
|
|
|
@@:
|
|
|
|
|
;// diamond ]
|
|
|
|
|
|
2006-12-30 20:44:05 +03:00
|
|
|
|
add edx,20
|
2007-01-03 21:22:05 +03:00
|
|
|
|
|
2007-09-02 01:38:00 +04:00
|
|
|
|
stdcall mem.Alloc,edx
|
2007-01-03 21:22:05 +03:00
|
|
|
|
mov ebp,eax
|
2007-01-19 00:14:15 +03:00
|
|
|
|
push eax
|
|
|
|
|
|
|
|
|
|
mov dword[ebp+0],0
|
2007-01-03 21:22:05 +03:00
|
|
|
|
mov dword[ebp+4],8
|
2007-01-19 00:14:15 +03:00
|
|
|
|
mcall 60,1,ebp
|
2006-12-30 20:44:05 +03:00
|
|
|
|
mcall 40,1000000b
|
2007-01-19 00:14:15 +03:00
|
|
|
|
|
2006-12-30 20:44:05 +03:00
|
|
|
|
mcall 23,200
|
2007-01-19 00:14:15 +03:00
|
|
|
|
|
2006-12-30 20:44:05 +03:00
|
|
|
|
cmp eax,7
|
2007-01-03 21:22:05 +03:00
|
|
|
|
jne key.alt_x.close
|
|
|
|
|
mov byte[ebp],1
|
2007-01-19 00:14:15 +03:00
|
|
|
|
|
2007-01-03 21:22:05 +03:00
|
|
|
|
mov ecx,[ebp+12]
|
2007-01-19 00:14:15 +03:00
|
|
|
|
lea esi,[ebp+16]
|
2007-01-03 21:22:05 +03:00
|
|
|
|
call create_tab
|
|
|
|
|
call load_from_memory
|
|
|
|
|
|
2007-01-19 00:14:15 +03:00
|
|
|
|
pop ebp
|
2007-09-02 01:38:00 +04:00
|
|
|
|
stdcall mem.Free,ebp
|
2007-01-03 21:22:05 +03:00
|
|
|
|
|
2006-12-30 20:44:05 +03:00
|
|
|
|
jmp @f
|
2006-08-14 16:50:43 +04:00
|
|
|
|
.noipc:
|
|
|
|
|
|
|
|
|
|
;// Willow's code to support DOCPAK ]
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
2006-12-30 20:44:05 +03:00
|
|
|
|
mov esi,@PARAMS
|
|
|
|
|
mov edi,tb_opensave.text
|
|
|
|
|
mov ecx,PATHL
|
|
|
|
|
rep movsb
|
|
|
|
|
mov edi,tb_opensave.text
|
|
|
|
|
mov ecx,PATHL
|
|
|
|
|
xor al,al
|
|
|
|
|
repne scasb
|
|
|
|
|
jne key.alt_x.close
|
|
|
|
|
lea eax,[edi-tb_opensave.text-1]
|
|
|
|
|
mov [tb_opensave.length],al
|
2007-01-28 02:36:07 +03:00
|
|
|
|
call load_file
|
2007-01-19 00:14:15 +03:00
|
|
|
|
jnc @f
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
2006-08-14 16:50:43 +04:00
|
|
|
|
no_params:
|
2007-01-03 21:22:05 +03:00
|
|
|
|
call create_tab
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
|
|
@@:
|
2007-01-19 00:14:15 +03:00
|
|
|
|
mov [s_status],0
|
2006-10-12 00:40:53 +04:00
|
|
|
|
dec [do_not_draw]
|
2006-12-30 20:44:05 +03:00
|
|
|
|
mcall 66,1,1
|
|
|
|
|
mcall 40,00100111b
|
2006-10-12 00:40:53 +04:00
|
|
|
|
red:
|
2006-12-30 20:44:05 +03:00
|
|
|
|
call drawwindow
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
2006-08-14 16:50:43 +04:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
2006-08-14 16:50:43 +04:00
|
|
|
|
still:
|
2007-01-28 02:36:07 +03:00
|
|
|
|
call draw_statusbar ; write current position & number of strings
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
2006-08-14 16:50:43 +04:00
|
|
|
|
.skip_write:
|
2007-01-28 02:36:07 +03:00
|
|
|
|
mcall 10 ; wait here until event
|
2006-12-30 20:44:05 +03:00
|
|
|
|
cmp [main_closed],0
|
|
|
|
|
jne key.alt_x
|
|
|
|
|
dec eax ; redraw ?
|
|
|
|
|
jz red
|
|
|
|
|
dec eax ; key ?
|
|
|
|
|
jz key
|
|
|
|
|
dec eax ; button ?
|
|
|
|
|
jz button
|
|
|
|
|
sub eax,3 ; mouse ?
|
|
|
|
|
jz mouse
|
|
|
|
|
|
|
|
|
|
jmp still.skip_write
|
2006-08-14 16:50:43 +04:00
|
|
|
|
|
|
|
|
|
;-----------------------------------------------------------------------------
|
2007-09-02 01:38:00 +04:00
|
|
|
|
proc get_event ctx ;//////////////////////////////////////////////////////////
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
mcall 10
|
|
|
|
|
dec eax ; redraw ?
|
|
|
|
|
jz .redraw
|
|
|
|
|
dec eax ; key ?
|
|
|
|
|
jz .key
|
|
|
|
|
dec eax ; button ?
|
|
|
|
|
jz .button
|
|
|
|
|
sub eax,2 ; background ?
|
|
|
|
|
jz .background
|
|
|
|
|
dec eax ; mouse ?
|
|
|
|
|
jz .mouse
|
|
|
|
|
dec eax ; ipc ?
|
|
|
|
|
jz .ipc
|
|
|
|
|
dec eax ; network ?
|
|
|
|
|
jz .network
|
|
|
|
|
dec eax ; debug ?
|
|
|
|
|
jz .debug
|
|
|
|
|
sub eax,7 ; irq ?
|
|
|
|
|
js .nothing
|
|
|
|
|
cmp eax,15
|
|
|
|
|
jg .nothing
|
|
|
|
|
jmp .irq
|
|
|
|
|
|
|
|
|
|
.nothing:
|
|
|
|
|
mov eax,EV_IDLE
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.redraw:
|
|
|
|
|
mov eax,EV_REDRAW
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.key:
|
|
|
|
|
mov eax,EV_KEY
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.button:
|
|
|
|
|
mov eax,EV_BUTTON
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.background:
|
|
|
|
|
mov eax,EV_BACKGROUND
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.mouse:
|
|
|
|
|
mov eax,EV_MOUSE
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.ipc:
|
|
|
|
|
mov eax,EV_IPC
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.network:
|
|
|
|
|
mov eax,EV_NETWORK
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.debug:
|
|
|
|
|
mov eax,EV_DEBUG
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
proc start_fasm ;/////////////////////////////////////////////////////////////
|
2006-08-14 16:50:43 +04:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2006-01-03 12:43:31 +03:00
|
|
|
|
; BL = run after compile
|
2006-08-14 16:50:43 +04:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2007-01-28 02:36:07 +03:00
|
|
|
|
; FASM infile,outfile,/path/to/files[,run]
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
cmp [cur_editor.AsmMode],0
|
2006-12-30 20:44:05 +03:00
|
|
|
|
jne @f
|
|
|
|
|
ret
|
2007-01-28 02:36:07 +03:00
|
|
|
|
@@:
|
|
|
|
|
mov eax,[tab_bar.Default.Ptr]
|
|
|
|
|
or eax,eax
|
|
|
|
|
jnz @f
|
|
|
|
|
mov eax,[tab_bar.Current.Ptr]
|
|
|
|
|
@@: cmp byte[eax+TABITEM.Editor.FilePath],'/'
|
|
|
|
|
je @f
|
|
|
|
|
ret
|
|
|
|
|
@@:
|
2006-12-30 20:44:05 +03:00
|
|
|
|
mov edi,fasm_parameters
|
2007-01-28 02:36:07 +03:00
|
|
|
|
push eax
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
2007-01-28 02:36:07 +03:00
|
|
|
|
cld
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
2007-01-28 02:36:07 +03:00
|
|
|
|
lea esi,[eax+TABITEM.Editor.FilePath]
|
|
|
|
|
add esi,[eax+TABITEM.Editor.FileName]
|
|
|
|
|
push esi esi
|
|
|
|
|
@@: lodsb
|
|
|
|
|
cmp al,0
|
2006-12-30 20:44:05 +03:00
|
|
|
|
je @f
|
2007-01-28 02:36:07 +03:00
|
|
|
|
stosb
|
|
|
|
|
cmp al,'.'
|
|
|
|
|
jne @b
|
|
|
|
|
mov ecx,esi
|
2006-12-30 20:44:05 +03:00
|
|
|
|
jmp @b
|
2007-01-28 02:36:07 +03:00
|
|
|
|
@@:
|
2006-12-30 20:44:05 +03:00
|
|
|
|
mov al,','
|
|
|
|
|
stosb
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
2007-01-28 02:36:07 +03:00
|
|
|
|
pop esi
|
|
|
|
|
sub ecx,esi
|
|
|
|
|
dec ecx
|
|
|
|
|
jz @f
|
2006-12-30 20:44:05 +03:00
|
|
|
|
rep movsb
|
2007-01-28 02:36:07 +03:00
|
|
|
|
@@:
|
2006-12-30 20:44:05 +03:00
|
|
|
|
mov al,','
|
|
|
|
|
stosb
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
2007-01-28 02:36:07 +03:00
|
|
|
|
pop ecx esi
|
|
|
|
|
add esi,TABITEM.Editor.FilePath
|
|
|
|
|
sub ecx,esi
|
2006-12-30 20:44:05 +03:00
|
|
|
|
rep movsb
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
2006-12-30 20:44:05 +03:00
|
|
|
|
cmp bl,0 ; run outfile ?
|
|
|
|
|
je @f
|
2007-01-28 02:36:07 +03:00
|
|
|
|
mov dword[edi],',run'
|
|
|
|
|
add edi,4
|
2006-10-12 00:40:53 +04:00
|
|
|
|
@@:
|
2007-01-28 02:36:07 +03:00
|
|
|
|
mov al,0
|
|
|
|
|
stosb
|
|
|
|
|
|
|
|
|
|
mov [app_start.filename],app_fasm
|
|
|
|
|
mov [app_start.params],fasm_parameters
|
2006-10-12 00:40:53 +04:00
|
|
|
|
start_ret:
|
2007-01-28 02:36:07 +03:00
|
|
|
|
mcall 70,app_start
|
2006-12-30 20:44:05 +03:00
|
|
|
|
ret
|
2007-09-02 01:38:00 +04:00
|
|
|
|
endp
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
2006-08-14 16:50:43 +04:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2007-09-02 01:38:00 +04:00
|
|
|
|
proc open_debug_board ;///////////////////////////////////////////////////////
|
2006-08-14 16:50:43 +04:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2007-01-28 02:36:07 +03:00
|
|
|
|
mov [app_start.filename],app_board
|
|
|
|
|
mov [app_start.params],0
|
2006-12-30 20:44:05 +03:00
|
|
|
|
jmp start_ret
|
2007-09-02 01:38:00 +04:00
|
|
|
|
endp
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
2006-08-14 16:50:43 +04:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2007-09-02 01:38:00 +04:00
|
|
|
|
proc open_sysfuncs_txt ;//////////////////////////////////////////////////////
|
2006-08-14 16:50:43 +04:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2007-01-28 02:36:07 +03:00
|
|
|
|
mov [app_start.filename],app_docpak
|
|
|
|
|
mov [app_start.params],sysfuncs_param
|
2006-12-30 20:44:05 +03:00
|
|
|
|
call start_ret
|
|
|
|
|
cmp eax,0xfffffff0
|
|
|
|
|
jb @f
|
2007-01-28 02:36:07 +03:00
|
|
|
|
mov [app_start.filename],app_tinypad
|
|
|
|
|
mov [app_start.params],sysfuncs_filename
|
2006-12-30 20:44:05 +03:00
|
|
|
|
call start_ret
|
2006-08-14 16:50:43 +04:00
|
|
|
|
@@: ret
|
2007-09-02 01:38:00 +04:00
|
|
|
|
endp
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
2007-01-03 21:22:05 +03:00
|
|
|
|
set_opt:
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
2007-01-28 02:36:07 +03:00
|
|
|
|
.dialog:
|
|
|
|
|
mov [bot_mode],1
|
|
|
|
|
mov [bot_dlg_height],128
|
|
|
|
|
mov [bot_dlg_handler],optsdlg_handler
|
|
|
|
|
mov [focused_tb],tb_color
|
|
|
|
|
mov al,[tb_color.length]
|
|
|
|
|
mov [tb_color.pos.x],al
|
|
|
|
|
mov [tb_color.sel.x],0
|
|
|
|
|
mov [tb_casesen],1
|
|
|
|
|
mov [cur_part],0
|
|
|
|
|
m2m [cur_color],dword[color_tbl.text]
|
|
|
|
|
mov esi,color_tbl
|
|
|
|
|
mov edi,cur_colors
|
|
|
|
|
mov ecx,10
|
|
|
|
|
cld
|
|
|
|
|
rep movsd
|
|
|
|
|
call drawwindow
|
|
|
|
|
ret
|
|
|
|
|
|
2007-01-03 21:22:05 +03:00
|
|
|
|
.line_numbers:
|
2006-12-30 20:44:05 +03:00
|
|
|
|
mov al,OPTS_LINENUMS
|
2007-01-03 21:22:05 +03:00
|
|
|
|
jmp .main
|
|
|
|
|
.optimal_fill:
|
2006-12-30 20:44:05 +03:00
|
|
|
|
mov al,OPTS_OPTIMSAVE
|
2007-01-03 21:22:05 +03:00
|
|
|
|
jmp .main
|
|
|
|
|
.auto_indents:
|
2006-12-30 20:44:05 +03:00
|
|
|
|
mov al,OPTS_AUTOINDENT
|
2007-01-03 21:22:05 +03:00
|
|
|
|
jmp .main
|
|
|
|
|
.auto_braces:
|
2006-12-30 20:44:05 +03:00
|
|
|
|
mov al,OPTS_AUTOBRACES
|
2007-01-03 21:22:05 +03:00
|
|
|
|
jmp .main
|
|
|
|
|
.secure_sel:
|
2006-12-30 20:44:05 +03:00
|
|
|
|
mov al,OPTS_SECURESEL
|
2007-01-03 21:22:05 +03:00
|
|
|
|
|
|
|
|
|
.main:
|
|
|
|
|
xor [options],al
|
2006-12-30 20:44:05 +03:00
|
|
|
|
ret
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
|
2007-09-02 01:38:00 +04:00
|
|
|
|
include 'data/tp-defines.inc'
|
2007-01-03 21:22:05 +03:00
|
|
|
|
|
2006-08-14 16:50:43 +04:00
|
|
|
|
include 'tp-draw.asm'
|
|
|
|
|
include 'tp-key.asm'
|
2006-12-30 20:44:05 +03:00
|
|
|
|
include 'tp-button.asm'
|
2006-08-14 16:50:43 +04:00
|
|
|
|
include 'tp-mouse.asm'
|
|
|
|
|
include 'tp-files.asm'
|
2006-12-30 20:44:05 +03:00
|
|
|
|
include 'tp-common.asm'
|
|
|
|
|
include 'tp-dialog.asm'
|
2006-08-14 16:50:43 +04:00
|
|
|
|
include 'tp-popup.asm'
|
|
|
|
|
include 'tp-tbox.asm'
|
2007-01-03 21:22:05 +03:00
|
|
|
|
include 'tp-tabctl.asm'
|
|
|
|
|
include 'tp-editor.asm'
|
2006-12-30 20:44:05 +03:00
|
|
|
|
include 'tp-recode.asm'
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
2007-09-02 01:38:00 +04:00
|
|
|
|
include 'external/dll.inc'
|
2006-10-12 00:40:53 +04:00
|
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2006-08-14 16:50:43 +04:00
|
|
|
|
section @DATA ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
2006-01-03 12:43:31 +03:00
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
|
2007-09-02 01:38:00 +04:00
|
|
|
|
include 'data/tp-idata.inc'
|
2006-10-12 00:40:53 +04:00
|
|
|
|
|
2007-09-02 01:38:00 +04:00
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
section @IMPORT ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
;align 16
|
|
|
|
|
;@IMPORT:
|
|
|
|
|
|
|
|
|
|
library \
|
|
|
|
|
libini,'libini.obj',\
|
|
|
|
|
libio,'libio.obj',\
|
|
|
|
|
libgfx,'libgfx.obj'
|
|
|
|
|
|
|
|
|
|
import libini, \
|
|
|
|
|
ini.get_str,'ini.get_str',\
|
|
|
|
|
ini.set_str,'ini.set_str',\
|
|
|
|
|
ini.get_int,'ini.get_int',\
|
|
|
|
|
ini.set_int,'ini.set_int'
|
|
|
|
|
|
|
|
|
|
import libio, \
|
|
|
|
|
file.find_first,'file.find_first',\
|
|
|
|
|
file.find_next ,'file.find_next',\
|
|
|
|
|
file.find_close,'file.find_close',\
|
|
|
|
|
file.size ,'file.size',\
|
|
|
|
|
file.open ,'file.open',\
|
|
|
|
|
file.read ,'file.read',\
|
|
|
|
|
file.write ,'file.write',\
|
|
|
|
|
file.seek ,'file.seek',\
|
|
|
|
|
file.tell ,'file.tell',\
|
|
|
|
|
file.eof? ,'file.eof?',\
|
|
|
|
|
file.truncate ,'file.truncate',\
|
|
|
|
|
file.close ,'file.close'
|
|
|
|
|
|
|
|
|
|
import libgfx, \
|
|
|
|
|
gfx.open ,'gfx.open',\
|
|
|
|
|
gfx.close ,'gfx.close',\
|
|
|
|
|
gfx.pen.color ,'gfx.pen.color',\
|
|
|
|
|
gfx.brush.color ,'gfx.brush.color',\
|
|
|
|
|
gfx.pixel ,'gfx.pixel',\
|
|
|
|
|
gfx.move.to ,'gfx.move.to',\
|
|
|
|
|
gfx.line.to ,'gfx.line.to',\
|
|
|
|
|
gfx.line ,'gfx.line',\
|
|
|
|
|
gfx.polyline ,'gfx.polyline',\
|
|
|
|
|
gfx.polyline.to ,'gfx.polyline.to',\
|
|
|
|
|
gfx.fillrect ,'gfx.fillrect',\
|
|
|
|
|
gfx.fillrect.ex ,'gfx.fillrect.ex',\
|
|
|
|
|
gfx.framerect ,'gfx.framerect',\
|
|
|
|
|
gfx.framerect.ex,'gfx.framerect.ex',\
|
|
|
|
|
gfx.rectangle ,'gfx.rectangle',\
|
|
|
|
|
gfx.rectangle.ex,'gfx.rectangle.ex'
|
2006-08-14 16:50:43 +04:00
|
|
|
|
|
2007-09-02 01:38:00 +04:00
|
|
|
|
TINYPAD_END: ; end of file
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
2006-08-14 16:50:43 +04:00
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
section @UDATA ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
|
|
|
|
;-----------------------------------------------------------------------------
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
2007-09-02 01:38:00 +04:00
|
|
|
|
include 'data/tp-udata.inc'
|
2007-01-03 21:22:05 +03:00
|
|
|
|
|
2006-01-03 12:43:31 +03:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2006-08-14 16:50:43 +04:00
|
|
|
|
section @PARAMS ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
2006-01-03 12:43:31 +03:00
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
fasm_parameters:
|
|
|
|
|
|
2006-12-30 20:44:05 +03:00
|
|
|
|
p_info process_information
|
2006-08-14 16:50:43 +04:00
|
|
|
|
p_info2 process_information
|
2006-12-30 20:44:05 +03:00
|
|
|
|
sc system_colors
|
2006-08-14 16:50:43 +04:00
|
|
|
|
|
2007-01-03 21:22:05 +03:00
|
|
|
|
rb 1024*4
|
|
|
|
|
MAIN_STACK:
|
|
|
|
|
rb 1024*4
|
|
|
|
|
POPUP_STACK:
|
|
|
|
|
|
|
|
|
|
STATIC_MEM_END:
|
|
|
|
|
|
|
|
|
|
diff10 'Main memory size',0,$
|