]>
git.ipfire.org Git - thirdparty/u-boot.git/blob - cmd/bmp.c
1 // SPDX-License-Identifier: GPL-2.0+
4 * Detlev Zundel, DENX Software Engineering, dzu@denx.de.
8 * BMP handling routines
19 static int do_bmp_info(struct cmd_tbl
*cmdtp
, int flag
, int argc
,
25 case 1: /* use image_load_addr as default address */
26 addr
= image_load_addr
;
28 case 2: /* use argument */
29 addr
= hextoul(argv
[1], NULL
);
35 return (bmp_info(addr
));
38 static int do_bmp_display(struct cmd_tbl
*cmdtp
, int flag
, int argc
,
44 splash_get_pos(&x
, &y
);
47 case 1: /* use image_load_addr as default address */
48 addr
= image_load_addr
;
50 case 2: /* use argument */
51 addr
= hextoul(argv
[1], NULL
);
54 addr
= hextoul(argv
[1], NULL
);
55 if (!strcmp(argv
[2], "m"))
58 x
= dectoul(argv
[2], NULL
);
59 if (!strcmp(argv
[3], "m"))
62 y
= dectoul(argv
[3], NULL
);
68 return (bmp_display(addr
, x
, y
));
71 static struct cmd_tbl cmd_bmp_sub
[] = {
72 U_BOOT_CMD_MKENT(info
, 3, 0, do_bmp_info
, "", ""),
73 U_BOOT_CMD_MKENT(display
, 5, 0, do_bmp_display
, "", ""),
76 static int do_bmp(struct cmd_tbl
*cmdtp
, int flag
, int argc
, char *const argv
[])
80 /* Strip off leading 'bmp' command argument */
84 c
= find_cmd_tbl(argv
[0], &cmd_bmp_sub
[0], ARRAY_SIZE(cmd_bmp_sub
));
87 return c
->cmd(cmdtp
, flag
, argc
, argv
);
94 "manipulate BMP image data",
95 "info <imageAddr> - display image info\n"
96 "bmp display <imageAddr> [x y] - display image at x,y"