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:
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 |
Reference in New Issue
Block a user