diff --git a/data/Tupfile.lua b/data/Tupfile.lua index da3bd4b8dd..ea0052ad50 100644 --- a/data/Tupfile.lua +++ b/data/Tupfile.lua @@ -58,7 +58,6 @@ img_files = { {"File Managers/ICONS.INI", "common/File Managers/icons.ini"}, {"File Managers/KFM.INI", "common/File Managers/kfm.ini"}, {"LIB/PIXLIB.OBJ", "common/lib/pixlib.obj"}, - {"LIB/FS.OBJ", "common/lib/fs.obj"}, {"LIB/ARRAY.OBJ", "common/lib/array.obj"}, {"LIB/LIBRARY.OBJ", "common/lib/library.obj"}, {"LIB/ICONV.OBJ", "common/lib/iconv.obj"}, diff --git a/data/common/lib/fs.obj b/data/common/lib/fs.obj deleted file mode 100644 index f1cac43249..0000000000 Binary files a/data/common/lib/fs.obj and /dev/null differ diff --git a/programs/cmm/lib/font.h b/programs/cmm/lib/font.h index a0f54d1c65..9acf9e1c95 100644 --- a/programs/cmm/lib/font.h +++ b/programs/cmm/lib/font.h @@ -5,8 +5,8 @@ #include "../lib/math.h" #endif -#ifndef INCLUDE_FS_H -#include "../lib/obj/fs.h" +#ifndef INCLUDE_IO_H +#include "../lib/io.h" #endif #include "../lib/patterns/rgb.h" @@ -180,27 +180,25 @@ byte Cp866ToAnsi(byte s) { ELSE IF(s>=224)&&(s<=239)s+=16; ELSE IF(s==241)s=184; //e rus with dots (yo) ELSE IF(s==240)s=168; //E rus with dots (yo) - ELSE IF(s==242)s='E'; //E urk (ye) - ELSE IF(s==243)s=186; //e urk (ye) - ELSE IF(s==244)s='I'; //I urk (yi) - ELSE IF(s==245)s=191; //i urk (yi) + ELSE IF(s==242)s='E'; //E ukr (ye) + ELSE IF(s==243)s=186; //e ukr (ye) + ELSE IF(s==244)s='I'; //I ukr (yi) + ELSE IF(s==245)s=191; //i ukr (yi) return s; } :byte LABEL::init(dword font_path) { - lib_init_fs(); + IO label_io; IF(font)free(font); - IF(!fs.read(font_path)) { - debug("Error while loading font: "); - debugln(font_path); - //io.run("/sys/@notify","'Error: Font is not loaded.' -E"); + label_io.read(font_path); + IF(!EAX) { + notify("'Error: KFONT is not loaded.' -E"); return false; } - font_begin = font = EAX; - EBX = font_begin + ECX; - height = DSBYTE[EBX-1]; - width = DSBYTE[EBX-2]; + font_begin = font = label_io.buffer_data; + height = DSBYTE[calc(font_begin+label_io.FILES_SIZE)-1]; + width = DSBYTE[calc(font_begin+label_io.FILES_SIZE)-2]; block = math.ceil(height*width/32); smooth = true; return true; diff --git a/programs/cmm/lib/obj/fs.h b/programs/cmm/lib/obj/fs.h deleted file mode 100644 index 34b7dc023f..0000000000 --- a/programs/cmm/lib/obj/fs.h +++ /dev/null @@ -1,141 +0,0 @@ -#ifndef INCLUDE_LIBFS_H -#define INCLUDE_LIBFS_H -#print "[include ]\n" - -#ifndef INCLUDE_KOLIBRI_H -#include "../lib/kolibri.h" -#endif - -#ifndef INCLUDE_DLL_H -#include "../lib/dll.h" -#endif - -:struct FILE_SYSTEM_FUNCTION -{ - dword remove_pointer; - byte remove(dword path); - - dword open_pointer; - dword open(dword path); - - dword read_pointer; - dword read(dword path); - - dword run_pointer; - dword run(dword path,arg); - - dword move_pointer; - byte move(dword path1,path2); - - dword copy_pointer; - byte copy(dword path1,path2); - - dword write_pointer; - byte write(dword path1,path2,path3); - - dword get_size_pointer; - qword get_size(dword path); - - dword callback_copy_pointer; - byte callback_copy(dword path1,path2,ptr); -} fs; - -:byte FILE_SYSTEM_FUNCTION::remove(dword path) -{ - dword tmp = path; - lib_init_fs(); - remove_pointer stdcall(tmp); - return EAX; -} - -:dword FILE_SYSTEM_FUNCTION::read(dword path) -{ - dword tmp = path; - lib_init_fs(); - read_pointer stdcall(tmp); - return EAX; -} - -:byte FILE_SYSTEM_FUNCTION::write(dword path1,path2,path3) -{ - dword tmp1 = path1; - dword tmp2 = path2; - dword tmp3 = path3; - lib_init_fs(); - write_pointer stdcall(tmp1,tmp2,tmp3); - return EAX; -} - -:dword FILE_SYSTEM_FUNCTION::run(dword path,arg) -{ - dword tmp1 = path1; - dword tmp2 = arg; - lib_init_fs(); - run_pointer stdcall(tmp1,tmp2); - return EAX; -} - -:qword FILE_SYSTEM_FUNCTION::get_size(dword path) -{ - dword tmp = path; - lib_init_fs(); - //get_size_pointer stdcall(tmp); - $push tmp - $call get_size_pointer - $add esi,4 -} - -:dword FILE_SYSTEM_FUNCTION::open(dword path) -{ - dword tmp = path; - lib_init_fs(); - open_pointer stdcall(tmp); - return EAX; -} - -:byte FILE_SYSTEM_FUNCTION::move(dword path1,path2) -{ - dword tmp1 = path1; - dword tmp2 = path2; - lib_init_fs(); - move_pointer stdcall(tmp1,tmp2); - return EAX; -} - -:byte FILE_SYSTEM_FUNCTION::copy(dword path1,path2) -{ - dword tmp1 = path1; - dword tmp2 = path2; - lib_init_fs(); - copy_pointer stdcall(tmp1,tmp2); - return EAX; -} - -:byte FILE_SYSTEM_FUNCTION::callback_copy(dword path1,path2,ptr) -{ - dword tmp1 = path1; - dword tmp2 = path2; - lib_init_fs(); - callback_copy_pointer stdcall(tmp1,tmp2,ptr); - return EAX; -} - - -:byte __CHECK_FS__ = 0; -:void lib_init_fs() -{ - IF(__CHECK_FS__)return; - library.load("/sys/LIB/FS.OBJ"); - fs.remove_pointer = library.get("fs.remove"); - fs.get_size_pointer = library.get("fs.get_size"); - fs.move_pointer = library.get("fs.move"); - fs.open_pointer = library.get("fs.open"); - fs.copy_pointer = library.get("fs.copy"); - fs.read_pointer = library.get("fs.read"); - fs.run_pointer = library.get("fs.execute"); - fs.write_pointer = library.get("fs.write"); - fs.callback_copy_pointer = library.get("fs.callback_copy"); - __CHECK_FS__ = true; -} - -#endif \ No newline at end of file