whosmatt / uvmod

Web-based firmware patcher for various Quansheng radios
https://whosmatt.github.io/uvmod/
268 stars 47 forks source link

File size issues with setting a custom boot image #42

Closed Luporion closed 2 months ago

Luporion commented 2 months ago

I was trying to set a custom image for the boot screen, and got it's size down to 368 kb.

I'm using kamilsss655's version of the firmware.

Unfortunately when i press "patch" Uvmod keeps telling me: image

although my file is only image big.

Here's the picture: Immanuelgemeinde Logo 128x64 px_less size_2 I created it using gimp - exactly 128x64 pixels.

So i did some calculations: When trying to patch without my custom image, the screen shows image meaning 60872 bytes are used.

Substract 60872 (without image) from 61896 (with the image) 61896 - 60872 = 1024 bytes Thats exactly the max file size image meaning the firmware is calculated using the max filesize.

The way of calculating firmware size should be changed to the actual filesize uploaded - is that possible?

whosmatt commented 2 months ago

there are a few misunderstandings here:

compiled firmware does not work in uvmod because the offsets of all the symbols are never going to be the same. the same goes for different versions. i started implementing a universal patcher but its abandoned because i dont have the time.

the image you upload is converted first since the radio does not support any file formats. the internal image format is a raw 1bit/pixel stream with the slight optimization hack where empty lines are cut from top and bottom. thats the only way you can reduce the image size with the current implementation of the bootscreen stub code. make your image black on white if alpha doesnt work.

firmware size isnt calculated. its taken directly after patching so its always accurate.