diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2010-12-24 11:15:26 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2010-12-24 11:15:26 -0500 |
commit | f9b0930ab9efe5f340edbb61f3a5269dbff8c663 (patch) | |
tree | 792652a0173a2ccc76c24648eff6626b0d0569cd /src/bootsplash.c | |
parent | b9a7591188b9a6f43dfa66ec6020f64a939c6fdb (diff) | |
download | seabios-hppa-f9b0930ab9efe5f340edbb61f3a5269dbff8c663.zip seabios-hppa-f9b0930ab9efe5f340edbb61f3a5269dbff8c663.tar.gz seabios-hppa-f9b0930ab9efe5f340edbb61f3a5269dbff8c663.tar.bz2 |
Add romfile_loadfile() helper function.
Add function to find, malloc, and copy a romfile. Use it in the
bootsplash and bootorder code.
Diffstat (limited to 'src/bootsplash.c')
-rw-r--r-- | src/bootsplash.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/bootsplash.c b/src/bootsplash.c index 8f42dfd..cf1a603 100644 --- a/src/bootsplash.c +++ b/src/bootsplash.c @@ -149,17 +149,16 @@ enable_bootsplash(void) if (!CONFIG_BOOTSPLASH) return; dprintf(3, "Checking for bootsplash\n"); - u32 file = romfile_find("bootsplash.jpg"); - if (!file) + int filesize; + u8 *filedata = romfile_loadfile("bootsplash.jpg", &filesize); + if (!filedata) return; - int filesize = romfile_size(file); u8 *picture = NULL; - u8 *filedata = malloc_tmphigh(filesize); struct vesa_info *vesa_info = malloc_tmplow(sizeof(*vesa_info)); struct vesa_mode_info *mode_info = malloc_tmplow(sizeof(*mode_info)); struct jpeg_decdata *jpeg = jpeg_alloc(); - if (!filedata || !jpeg || !vesa_info || !mode_info) { + if (!jpeg || !vesa_info || !mode_info) { warn_noalloc(); goto done; } @@ -186,8 +185,6 @@ enable_bootsplash(void) vendor, product); // Parse jpeg and get image size. - dprintf(5, "Copying bootsplash.jpg\n"); - romfile_copy(file, filedata, filesize); dprintf(5, "Decoding bootsplash.jpg\n"); int ret = jpeg_decode(jpeg, filedata); if (ret) { |