VincentWei / MiniGUI

A modern and mature cross-platform window system for embedded systems and smart IoT devices.
http://www.minigui.com
GNU General Public License v3.0
673 stars 157 forks source link

load_cursor_from_file: LoadCursorFromFile: bad file type: 512 #80

Open maikebing opened 2 years ago

maikebing commented 2 years ago

oad_cursor_from_file: LoadCursorFromFile: bad file type: 512 load_cursor_from_file: LoadCursorFromFile: failed when loading cursor from /usr/local/share/minigui/res/cursor/d_arrow.cur KERNEL>InitGUI: Count not init mouse cursor! KERNEL>InitGUI: initialization failed; please check your MiniGUI configuration or resource.

maikebing commented 2 years ago

高低位的问题。 因为 512 的二进制是 0010 0000 0000

2 的二进制是 0010

maikebing commented 2 years ago

在我修改 了 大小端转换后,

load_cursor_from_file: LoadCursorFromFile: bad cursor image width (-1) and height (-1) load_cursor_from_file: LoadCursorFromFile: failed when loading cursor from /usr/local/share/minigui/res/cursor/d_arrow.cur

maikebing commented 2 years ago

平台是 loongarch64

maikebing commented 2 years ago

mips64 的机子就没这问题

VincentWei commented 2 years ago

Please check the endianess.

maikebing commented 2 years ago

重置了龙芯版的统信系统, 重新安装了所有环境, 编译并启动后提示

GUI>LFRDR: failed to initialize default renderer's private info.
KERNEL>InitGUI: failed to init LF Manager!
KERNEL>InitGUI: initialization failed; please check your MiniGUI configuration or resource.

然后在 src/gui/lf_manager.c:864 设置断点, if (rdr->init && 0 != rdr->init (rdr)) { (gdb) p rdr->init $1 = (int (*)(PWERENDERER)) 0xfff7c09c78 (gdb) p rdr->init(rdr) $2 = -1 即 rdr->init(rdr) 返回-1 .

maikebing commented 2 years ago

尝试了, 如果 禁用掉 cursor 不编译, 则 会出现上面的问题, 如果启用 -cursor 则 会 依旧出现


load_cursor_from_file: LoadCursorFromFile: bad file type: 512
load_cursor_from_file: LoadCursorFromFile: failed when loading cursor from /usr/local/share/minigui/res/cursor/d_arrow.cur
KERNEL>InitGUI: Count not init mouse cursor!
KERNEL>InitGUI: initialization failed; please check your MiniGUI configuration or resource.
maikebing commented 2 years ago
# lscpu | grep -i byte
Byte Order:          Little Endian
# dpkg-architecture | grep -i end
DEB_BUILD_ARCH_ENDIAN=little
DEB_HOST_ARCH_ENDIAN=little
DEB_TARGET_ARCH_ENDIAN=little
VincentWei commented 1 year ago

应该是缺少对龙芯架构的处理导致的,在 common.h 中增加 defined(__loongarch__) 即可。

相关修改已添加到 ref-5-0 分支,可以试试 rel-5-0 上的代码。

maikebing commented 1 year ago

好的, 我尝试一下。