forked from KolibriOS/kolibrios
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:
parent
4e1ac7b0d6
commit
6a725a3db0
12
programs/develop/info3ds/build_en.bat
Normal file
12
programs/develop/info3ds/build_en.bat
Normal 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
|
12
programs/develop/info3ds/build_ru.bat
Normal file
12
programs/develop/info3ds/build_ru.bat
Normal 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
|
99
programs/develop/info3ds/dll.inc
Normal file
99
programs/develop/info3ds/dll.inc
Normal 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
|
1164
programs/develop/info3ds/info3ds.asm
Normal file
1164
programs/develop/info3ds/info3ds.asm
Normal file
File diff suppressed because it is too large
Load Diff
48
programs/develop/info3ds/mem.inc
Normal file
48
programs/develop/info3ds/mem.inc
Normal 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
|
BIN
programs/develop/info3ds/objects.png
Normal file
BIN
programs/develop/info3ds/objects.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
BIN
programs/develop/info3ds/tl_sys_16.png
Normal file
BIN
programs/develop/info3ds/tl_sys_16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
BIN
programs/develop/info3ds/toolbar.png
Normal file
BIN
programs/develop/info3ds/toolbar.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
@ -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, ¨§ ª®â®àëå ¡ã¤ãâ ᮧ¤ ¢ âìáï âà ä à¥âë
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user