new program to see the structure of blocks in the files 3ds

git-svn-id: svn://kolibrios.org@2051 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2011-08-17 11:18:45 +00:00
parent 4e1ac7b0d6
commit 6a725a3db0
9 changed files with 1353 additions and 10 deletions

View File

@ -0,0 +1,12 @@
if not exist bin mkdir bin
@erase lang.inc
@echo lang fix en >lang.inc
if not exist bin\objects.png @copy objects.png bin\objects.png
if not exist bin\tl_sys_16.png @copy tl_sys_16.png bin\tl_sys_16.png
if not exist bin\toolbar.png @copy toolbar.png bin\toolbar.png
if not exist bin\font8x9.bmp @copy ..\..\fs\kfar\trunk\font8x9.bmp bin\font8x9.bmp
@fasm.exe -m 16384 ..\libraries\buf2d\trunk\buf2d.asm bin\buf2d.obj
@kpack bin\buf2d.obj
@fasm.exe -m 16384 info3ds.asm bin\info3ds.kex
@kpack bin\info3ds.kex
pause

View File

@ -0,0 +1,12 @@
if not exist bin mkdir bin
@erase lang.inc
@echo lang fix ru >lang.inc
if not exist bin\objects.png @copy objects.png bin\objects.png
if not exist bin\tl_sys_16.png @copy tl_sys_16.png bin\tl_sys_16.png
if not exist bin\toolbar.png @copy toolbar.png bin\toolbar.png
if not exist bin\font8x9.bmp @copy ..\..\fs\kfar\trunk\font8x9.bmp bin\font8x9.bmp
@fasm.exe -m 16384 ..\libraries\buf2d\trunk\buf2d.asm bin\buf2d.obj
@kpack bin\buf2d.obj
@fasm.exe -m 16384 info3ds.asm bin\info3ds.kex
@kpack bin\info3ds.kex
pause

View File

@ -0,0 +1,99 @@
proc dll.Load, import_table:dword
mov esi,[import_table]
.next_lib: mov edx,[esi]
or edx,edx
jz .exit
push esi
mov esi,[esi+4]
mov edi,s_libdir.fname
@@: lodsb
stosb
or al,al
jnz @b
mcall 68,19,s_libdir
or eax,eax
jz .fail
stdcall dll.Link,eax,edx
push eax
mov eax, [eax]
cmp dword [eax], 'lib_'
pop eax
jnz @f
stdcall dll.Init,[eax+4]
@@:
pop esi
add esi,8
jmp .next_lib
.exit: xor eax,eax
ret
.fail: add esp,4
xor eax,eax
inc eax
ret
endp
proc dll.Link, exp:dword,imp:dword
push eax
mov esi,[imp]
test esi,esi
jz .done
.next: lodsd
test eax,eax
jz .done
stdcall dll.GetProcAddress,[exp],eax
or eax,eax
jz @f
mov [esi-4],eax
jmp .next
@@: mov dword[esp],0
.done: pop eax
ret
endp
proc dll.Init, dllentry:dword
pushad
mov eax,mem.Alloc
mov ebx,mem.Free
mov ecx,mem.ReAlloc
mov edx,dll.Load
stdcall [dllentry]
popad
ret
endp
proc dll.GetProcAddress, exp:dword,sz_name:dword
mov edx,[exp]
xor eax,eax
.next: or edx,edx
jz .end
cmp dword[edx],0
jz .end
stdcall strcmp,[edx],[sz_name]
test eax,eax
jz .ok
add edx,8
jmp .next
.ok: mov eax,[edx+4]
.end: ret
endp
proc strcmp, str1:dword,str2:dword
push esi edi
mov esi,[str1]
mov edi,[str2]
xor eax,eax
@@: lodsb
scasb
jne .fail
or al,al
jnz @b
jmp .ok
.fail: or eax,-1
.ok: pop edi esi
ret
endp
s_libdir:
db '/sys/lib/'
.fname rb 32

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,48 @@
;-----------------------------------------------------------------------------
proc mem.Alloc,size ;/////////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
push ebx ecx
mov ecx,[size]
;*** add ecx,4
mcall 68,12
;*** add ecx,-4
;*** mov [eax],ecx
;*** add eax,4
pop ecx ebx
ret
endp
;-----------------------------------------------------------------------------
proc mem.ReAlloc,mptr,size ;//////////////////////////////////////////////////
;-----------------------------------------------------------------------------
push ebx ecx edx
mov ecx,[size]
or ecx,ecx
jz @f
;*** add ecx,4
@@: mov edx,[mptr]
or edx,edx
jz @f
;*** add edx,-4
@@: mcall 68,20
or eax,eax
jz @f
;*** add ecx,-4
;*** mov [eax],ecx
;*** add eax,4
@@: pop edx ecx ebx
ret
endp
;-----------------------------------------------------------------------------
proc mem.Free,mptr ;//////////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
push ebx ecx
mov ecx,[mptr]
or ecx,ecx
jz @f
;*** add ecx,-4
@@: mcall 68,13
pop ecx ebx
ret
endp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -75,9 +75,7 @@ fn_icon0 rb FILE_NAME_MAX ;
fn_icon1 rb FILE_NAME_MAX ;¨¬ï ä ©«  á ¢®«ª®¬ ¨ § ©æ¥¬
fn_icon2 rb FILE_NAME_MAX ;¨¬ï ä ©«  á ï©æ ¬¨
fn_icon3 rb FILE_NAME_MAX ;¨¬ï ä ©«  á 樯«ïâ ¬¨
fn_font db 'font8x9.bmp',0
fn_icon_tl_sys db 'tl_sys_16.png',0
TREE_ICON_SYS16_BMP_SIZE equ 256*3*11+54 ;à §¬¥à bmp ä ©«  á á¨á⥬­ë¬¨ ¨ª®­ª ¬¨
ini_m_name db 'main.ini',0
@ -124,7 +122,18 @@ color_but_sm dd 0x808080 ;梥
color_but_te dd 0xffffff ;梥â ⥪áâ  ­  ª­®¯ª å
macro load_image_file path,buf,size { ;¬ ªà®á ¤«ï § £à㧪¨ ¨§®¡à ¦¥­¨©
copy_path path,sys_path,file_name,0x0 ;ä®à¬¨à㥬 ¯®«­ë© ¯ãâì ª ä ©«ã ¨§®¡à ¦¥­¨ï, ¯®¤à §ã¬¥¢ ¥¬ çâ® ®­ ¢ ®¤­®© ¯ ¯ª¥ á ¯à®£à ¬¬®©
;path - ¬®¦¥â ¡ëâì ¯¥à¥¬¥­­®© ¨«¨ áâப®¢ë¬ ¯ à ¬¥â஬
if path eqtype '' ;¯à®¢¥à塞 § ¤ ­ «¨ áâப®© ¯ à ¬¥âà path
jmp @f
local .path_str
.path_str db path ;ä®à¬¨à㥬 «®ª «ì­ãî ¯¥à¥¬¥­­ãî
db 0
@@:
;32 - áâ ­¤ àâ­ë©  ¤à¥á ¯® ª®â®à®¬ã ¤®«¦¥­ ¡ëâì ¡ãä¥à á á¨á⥬­ë¬ ¯ã⥬
copy_path .path_str,[32],file_name,0x0
else
copy_path path,[32],file_name,0x0 ;ä®à¬¨à㥬 ¯®«­ë© ¯ãâì ª ä ©«ã ¨§®¡à ¦¥­¨ï, ¯®¤à §ã¬¥¢ ¥¬ çâ® ®­ ¢ ®¤­®© ¯ ¯ª¥ á ¯à®£à ¬¬®©
end if
stdcall mem.Alloc, dword size ;¢ë¤¥«ï¥¬ ¯ ¬ïâì ¤«ï ¨§®¡à ¦¥­¨ï
mov [buf],eax
@ -711,7 +720,7 @@ InitAll:
stdcall LoadArrayBuffer, fn_icon2, buf_egg,22 ;áç¨â뢠¥¬ 22 ¡ãä¥à®¢ á ï©æ ¬¨
stdcall LoadArrayBuffer, fn_icon3, buf_chi,13 ;áç¨â뢠¥¬ 13 ¡ãä¥à®¢ á 樯«ïâ ¬¨
load_image_file fn_font, image_data_gray,IMAGE_FONT_SIZE
load_image_file 'font8x9.bmp', image_data_gray,IMAGE_FONT_SIZE
stdcall [buf2d_create_f_img], buf_font,[image_data_gray] ;ᮧ¤ ¥¬ ¡ãä¥à
stdcall mem.Free,[image_data_gray] ;®á¢®¡®¦¤ ¥¬ ¯ ¬ïâì
@ -765,7 +774,7 @@ start:
;******************************************************************************
stdcall dword[tl_data_init], tree1
load_image_file fn_icon_tl_sys, image_data_gray,TREE_ICON_SYS16_BMP_SIZE
load_image_file 'tl_sys_16.png', image_data_gray,TREE_ICON_SYS16_BMP_SIZE
stdcall [buf2d_create_f_img], buf_tree_sys,[image_data_gray] ;ᮧ¤ ¥¬ ¡ãä¥à
stdcall mem.Free,[image_data_gray] ;®á¢®¡®¦¤ ¥¬ ¯ ¬ïâì
@ -791,7 +800,7 @@ start:
stdcall dword[tl_cur_beg], tree1 ;¯¥à¥­®á¨¬ ªãàá®à ¢¢¥àå
mcall 26,9
mov [last_time],ebx
mov [last_time],eax
@ -814,7 +823,6 @@ still: ;
test ebx,ebx
jz it_is_time_now
mcall 23
cmp eax,0
je it_is_time_now
@ -847,8 +855,8 @@ it_is_time_now:
mcall 26,9
mov [last_time],eax
cmp byte[game_select_mode],0
jne still
;cmp byte[game_select_mode],0
;jne still
;...§¤¥áì ¨¤ãâ ¤¥©á⢨ï, ¢ë§ë¢ ¥¬ë¥ ª ¦¤ë¥ delay á®âëå ¤®«¥© ᥪ㭤...
call MoveEggs
@ -1218,7 +1226,7 @@ align 4
ret ;¢¥à­ãâìáï ç¥­ì ¨­â¥à¥á­ë© 室 â.ª. ¯®ª  ¢ á⥪¥ åà ­¨âìáï ª®«-¢® ¢ë§®¢®¢ â® á⮫쪮 à § ¬ë ¨ ¡ã¤¥¬ ¢ë§ë¢ âìáï
last_time dd ?
last_time dd 0
image_data dd 0 ;¯ ¬ïâì ¤«ï ¯à¥®¡à §®¢ ­¨ï ª à⨭ª¨ äã­ªæ¨ï¬¨ libimg
image_data_gray dd 0 ;¯ ¬ïâì á ¢à¥¬¥­­ë¬¨ á¥à묨 ¨§®¡à ¦¥­¨ï¬¨ ¢ ä®à¬ â¥ 24-bit, ¨§ ª®â®àëå ¡ã¤ãâ ᮧ¤ ¢ âìáï âà ä à¥âë