diff --git a/data/Tupfile.lua b/data/Tupfile.lua index f748b3964c..881ce7c5cc 100644 --- a/data/Tupfile.lua +++ b/data/Tupfile.lua @@ -70,7 +70,7 @@ img_files = { {"SETTINGS/NETWORK.INI", build_type .. "/settings/network.ini"}, {"NETWORK/FTPD.INI", "common/network/ftpd.ini"}, {"NETWORK/USERS.INI", "common/network/users.ini"}, - {"KFVIEWER", "common/kfviewer"}, + {"FONT_VIEWER", "common/font_viewer"}, } -- For russian build, add russian-only files. if build_type == "rus" then tup.append_table(img_files, { diff --git a/data/common/font_viewer b/data/common/font_viewer new file mode 100644 index 0000000000..4b23b42cd2 Binary files /dev/null and b/data/common/font_viewer differ diff --git a/data/common/kfviewer b/data/common/kfviewer deleted file mode 100644 index 35cc97a688..0000000000 Binary files a/data/common/kfviewer and /dev/null differ diff --git a/data/common/lib/fs.obj b/data/common/lib/fs.obj index 06fd354f83..cd3e8721f9 100644 Binary files a/data/common/lib/fs.obj and b/data/common/lib/fs.obj differ diff --git a/data/common/settings/assoc.ini b/data/common/settings/assoc.ini index aae7f711a0..573af519a6 100644 --- a/data/common/settings/assoc.ini +++ b/data/common/settings/assoc.ini @@ -15,7 +15,7 @@ exec=/sys/media/kiv icon=70 [FontViewer] -exec=/sys/kfviewer +exec=/sys/FONT_VIEWER [Animage] exec=/sys/media/animage diff --git a/programs/cmm/kolibri font viewer/kolibri font viewer.c b/programs/cmm/kolibri font viewer/kolibri font viewer.c index a05d105bed..b813e350d7 100644 --- a/programs/cmm/kolibri font viewer/kolibri font viewer.c +++ b/programs/cmm/kolibri font viewer/kolibri font viewer.c @@ -35,7 +35,7 @@ void main() font_option.use_smooth = 1; font_option.bg_color = 0xDADADA; - strcpy(#title, "Kolibri font preview: "); + strcpy(#title, "Font preview: "); strcat(#title, #param); font_title.prepare(5, 4, #title); loop() diff --git a/programs/cmm/lib/font.h b/programs/cmm/lib/font.h index 73ea680672..ab7ac9615f 100644 --- a/programs/cmm/lib/font.h +++ b/programs/cmm/lib/font.h @@ -6,7 +6,7 @@ #endif #ifndef INCLUDE_IO_H -#include "../lib/io.h" +#include "../lib/obj/fs.h" #endif :struct __OFFSET_FONT @@ -306,12 +306,13 @@ inline fastcall dword b24(EBX) { return DSDWORD[EBX] << 8; } } :byte FONT::load(dword path) { + lib_init_fs(); buffer_size = 0; use_smooth = true; IF(data)free(data); - IF(!io.read(path)) { debug("Error while loading font: "); debugln(path); return false; } - begin = data = io.buffer_data; - EBX = begin + io.FILES_SIZE; + IF(!fs.read(path)) { debug("Error while loading font: "); debugln(path); return false; } + begin = data = EAX; + EBX = begin + ECX; $dec ebx height = DSBYTE[EBX]; $dec ebx diff --git a/programs/cmm/lib/obj/fs.h b/programs/cmm/lib/obj/fs.h index 0c1b136417..6e961a5f25 100644 --- a/programs/cmm/lib/obj/fs.h +++ b/programs/cmm/lib/obj/fs.h @@ -15,6 +15,9 @@ dword remove_pointer; byte remove(dword path); + dword read_pointer; + dword read(dword path); + dword move_pointer; byte move(dword path1,path2); @@ -32,6 +35,13 @@ return EAX; } +:dword FILE_SYSTEM_FUNCTION::read(dword path) +{ + dword tmp = path; + read_pointer stdcall(tmp); + return EAX; +} + :qword FILE_SYSTEM_FUNCTION::get_size(dword path) { dword tmp = path; @@ -55,14 +65,17 @@ 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.copy_pointer = library.get("fs.copy"); - //alert(itoa(fs.get_size("/sys/"))); + fs.read_pointer = library.get("fs.read"); + __CHECK_FS__ = true; } #endif \ No newline at end of file