kolibrios/programs/system/eskin/trunk/eskin.asm

1 line
3.5 KiB
NASM
Raw Normal View History

use32 org 0x0 db 'MENUET01' ; 8 byte id dd 38 ; required os dd STARTAPP ; program start dd I_END ; program image size dd 0x1000000 ; required amount of memory dd 0x1000000 ; stack heap dd 0x0 dd 0x0 include '../../../proc32.inc' include '../../../macros.inc' include '../../../dll.inc' PATH_MAX_CHARS equ 255 STARTAPP: ; Initialize memory mcall 68, 11 or eax,eax jz close_app ;Import libraries stdcall dll.Load,importTable test eax, eax jnz close_app invoke ini_get_int, aIni, aMain, aButton, 0 mov ecx, eax mcall 48, 1 invoke ini_get_int, aIni, aMain, aBg, 0 cmp eax, 1 jnz set_bg set_program: invoke ini_get_str, aIni, aMain, aProgram, sz_buffer, PATH_MAX_CHARS, 0 invoke ini_get_str, aIni, aMain, aParam, sz_param, PATH_MAX_CHARS, 0 stdcall RunProgram, sz_buffer, sz_param jmp set_skin set_bg: invoke ini_get_str, aIni, aMain, aWallpaper, sz_param, PATH_MAX_CHARS, 0 mov dword [sz_buffer], "\__S" xor edi, edi @@: mov ah, byte [sz_param + edi] mov byte [sz_buffer + edi + 4], ah inc edi cmp byte [sz_param + edi], 0 jne @b mov byte [sz_buffer + edi + 4], 0 stdcall RunProgram, sz_buffer, aKiv set_skin: invoke ini_get_str, aIni, aMain, aSkin, sz_param, PATH_MAX_CHARS, 0 mcall 48, 8, sz_param close_app: mcall -1 proc RunProgram stdcall, app_path:dword, app_param:dword push eax m2m dword [InfoStructure+8], [app_param] ; pointer to the parametrs m2m dword [InfoStructure+21], [app_path] ; pointer to the file name mcall 70, InfoStructure pop eax ret endp align 16 importTable: library \ libini, 'libini.obj' import libini, \ ini_get_str ,'ini_get_str', \ ini_get_int ,'ini_get_int' InfoStructure: dd 7 ; subfunction number dd 0 ; position in the file in bytes dd ? ; upper part of the position address dd 0 ; number of bytes to read dd 0 ; pointer to the buffer to write data db 0 dd ? ; pointer to the filename aIni db '/sys/settings/eskin.ini',0 aKiv db '/sys/media/kiv',0 aMain db 'main',0 aBg db 'bg',0 aButton db '3d',0 aSkin db 'skin',0 aWallpaper db 'wallpaper',0 aProgram db 'program',0 aParam db 'param',0 sz_buffer: rb PATH_MAX_CHARS sz_param: rb PATH_MAX_CHARS I_END: ; End of application code and data marker