View Single Post
raandoom's Avatar
Posts: 46 | Thanked: 131 times | Joined on Jul 2011 @ Russia, Moscow area
#49
This FAQ about how you can use images with custom width and height in NOLO.
* Remember about size limits (in bytes) for compressed images. You can read about it in previous FAQs.

I am already wrote how to compress images, that's why here I try briefly show how correctly patch 'secondary' with your custom-size images

If you decided to use some icon with custom size and some icon with standart size - you must use THIS FAQ for both images, NOT previous. Because instructions and addresses from this FAQ intersect with addresses from older FAQs, that's why using of all FAQs together can lead to bad results

At this moment this FAQ is universal for all images. You can consider it as the Main FAQ and use only its But dont forget about previous: maybe you can find some additional information there.

1. Boot logo:
a) This commands are required:
Code:
echo -ne '\x5A\xA3\x59\x88\x1B\x88\xBF\xF8\x3E\x61' | dd of=my_secondary.bin bs=1 seek=33234 conv=notrunc
echo -ne '\x3C\x4B' | dd of=my_secondary.bin bs=1 seek=33584 conv=notrunc
b) Flashing logo to 'secondary':
Code:
dd if=logo.bin of=my_secondary.bin bs=1 seek=75940 conv=notrunc
c) Specify parameters of used image: size of compressed image (in bytes), width and height:
Size (must be less than 6646 bytes). In this example used size equal to 6646 bytes -> 0x19F6 bytes -> '\xF6\x19'
Code:
echo -ne '\xF6\x19' | dd of=my_secondary.bin bs=1 seek=33562 conv=notrunc
Width. In this example used size equal to 486 pixels -> 0x1E6 pixels -> '\xE6\x01'
Code:
echo -ne '\xE6\x01' | dd of=my_secondary.bin bs=1 seek=33596 conv=notrunc
Height. In this example used size equal to 138 pixels -> 0x8A pixels -> '\x8A\x00'
Code:
echo -ne '\x8A\x00' | dd of=my_secondary.bin bs=1 seek=33598 conv=notrunc
2. Background color:
a) This commands are required:
Code:
echo -ne '\x17\xE0' | dd of=my_secondary.bin bs=1 seek=36834 conv=notrunc
echo -ne '\xC0\x46\x40\x4A' | dd of=my_secondary.bin bs=1 seek=36574 conv=notrunc
b) Of course, the color (in example used black color, #0000):
Code:
echo -ne '\x00\x00\x00\x00' | dd of=my_secondary.bin bs=1 seek=36836 conv=notrunc
A little help for select the right color:
You can use a color value from 16-bit pallete only (rgb565, 65536 colors). You must reverse color bytes and duplicate them in commamd. Example:
0xF800 is RED, it is mean '\x00\xF8\x00\xF8'
0x07E0 is GREEN, it is mean '\xE0\x07\xE0\x07'
0x001F is BLUE, it is mean '\x1F\x00\x1F\x00'

3. USB icon:
a) Flashing compressed icon to 'secondary':
Code:
dd if=usb.bin of=my_secondary.bin bs=1 seek=82596 conv=notrunc
b) Specify parameters of used image: size of compressed image (in bytes), width and height:

Size (must be less than 1089 bytes). In this example used size equal to 1089 bytes -> 0x441 bytes -> '\x40\xF2\x41\x46'
* Please note, a more intuitive explanation: let assume that the size of your compressed icon in hex is 0xXYZ, this mean that bytes for patching must be looks like '\x40\xF2\xYZ\xX6'
Code:
echo -ne '\x40\xF2\x41\x46' | dd of=my_secondary.bin bs=1 seek=33252 conv=notrunc
Width. In this example used size equal to 102 pixels -> 0x66 pixels -> '\x66'
Code:
echo -ne '\x66' | dd of=my_secondary.bin bs=1 seek=33246 conv=notrunc
Height. In this example used size equal to 44 pixels -> 0x2С pixels -> '\x2С\x21'
Code:
echo -ne '\x2C\x21' | dd of=my_secondary.bin bs=1 seek=33250 conv=notrunc
c) Optional! For those who don't like white square after the disappearance of USB icon.
If you never noticed this square, then you probably do not need that
I dont use this and dont test it, but it must work. In example used black color.
Code:
echo -ne '\x00' | dd of=my_secondary.bin bs=1 seek=35126 conv=notrunc
And as you can see, there is only one byte for color. It is mean that if you write '\xAA' - the color of square will be 0xAAAA. That not so much color, there is more than nothing

4. R&D icon:
a) Flashing compressed icon to 'secondary':
Code:
dd if=rd.bin of=secondary.bin bs=1 seek=71976 conv=notrunc
b) Specify parameters of used image: size of compressed image (in bytes), width and height:

Size (must be less than 3954 bytes).
* Attention, how build correct string of bytes for patching:
Template string: '\x40\xFk\xYZ\xX6'
k - must have value 2 or 6. Depends on size of compressed icon.
k = 2, if size of your compressed icon less tnan 0x800 bytes (size < 2048 bytes). Further, use XYZ values like in paragraph 3b.
k = 6, if size of your compressed icon more than or equal to 0x800 bytes (size >= 2048 bytes). In this case, value 0x800 will be added to your XYZ value.
Example: size = 2753 bytes = 0xAC1 bytes = (0x800 + 0x2C1) bytes => k=6 => '\x40\xF6\xC1\x26'
Code:
echo -ne '\x40\xF6\xC1\x26' | dd of=my_secondary.bin bs=1 seek=33226 conv=notrunc
Width. In this example used size equal to 64 pixels -> 0x40 pixels -> '\x40'
Code:
echo -ne '\x40' | dd of=my_secondary.bin bs=1 seek=33222 conv=notrunc
Height. In this example used size equal to 54 pixels -> 0x36 pixels -> '\x36'
Code:
echo -ne '\x36' | dd of=my_secondary.bin bs=1 seek=33224 conv=notrunc
That's all. Sorry, if something is hard to understand Ask questions - i will try to help.

Last edited by raandoom; 2013-01-07 at 21:23.
 

The Following 10 Users Say Thank You to raandoom For This Useful Post: