Compare commits

...

2 commits

Author SHA1 Message Date
William Wilgus
530cad0c7a FS#13718 - The image_save library (rocklua) can't correctly save an image with an odd resolution.
the image save script apparently does not like odd numbers for width

local bytesleft = linebytes - (bytesperpixel * w )

this should actually be pxleft since the image loop below returns pixels not bytes

tested on 1 bit 2 bit, 16 bit and 32 bit images in sim

Change-Id: Ic186c095c29d318dcfb7d76b83e07c75f1460584
2026-01-21 08:15:56 -05:00
Roman Artiukhin
86f35f1b53 hiby: r1_patcher: use generic bootloader name
Rename bootloader.r1 to bootloader.rb for use across multiple devices (Hiby R1, HiBy R3 Pro II and others).

Change-Id: Ib509d37d605391012a792a69b11a557b0319d2ce
2026-01-21 08:41:08 +02:00
3 changed files with 9 additions and 8 deletions

View file

@ -188,8 +188,9 @@ do
for i=1, #fbuffer do fbuffer[i] = _NIL end -- reuse table
local imgdata = fbuffer
-- pad rows to a multiple of 4 bytes
local bytesleft = linebytes - (bytesperpixel * w)
-- pad rows to get even number of pixels
local pxleft = (linebytes - (bytesperpixel * w)) / bytesperpixel
local t_data = {}
local fs_bytes_E = s_bytesLE -- default save in Little Endian
@ -198,7 +199,7 @@ do
end
-- Bitmap lines start at bottom unless biHeight is negative
for point in _points(img, 1, h, w + bytesleft, 1, 1, 1, true) do
for point in _points(img, 1, h, w + pxleft, 1, 1, 1, true) do
imgdata[#imgdata + 1] = fs_bytes_E(bpp, point or 0)
if #fbuffer >= 31 then -- buffered write, increase # for performance

View file

@ -3,8 +3,8 @@
killall hiby_player &>/dev/null
killall -9 hiby_player &>/dev/null
killall bootloader.r1 &>/dev/null
killall -9 bootloader.r1 &>/dev/null
killall bootloader.rb &>/dev/null
killall -9 bootloader.rb &>/dev/null
/usr/bin/bootloader.r1
/usr/bin/bootloader.rb
sleep 1s

View file

@ -51,8 +51,8 @@ unsquashfs -f -d $workingdir_in/rootfs/extracted $workingdir_in/rootfs/rootfs.sq
################################################################################
# copy 'bootloader'
cp "$2" "$workingdir_in/rootfs/extracted/usr/bin/bootloader.r1"
chmod 0755 "$workingdir_in/rootfs/extracted/usr/bin/bootloader.r1"
cp "$2" "$workingdir_in/rootfs/extracted/usr/bin/bootloader.rb"
chmod 0755 "$workingdir_in/rootfs/extracted/usr/bin/bootloader.rb"
# copy modified 'hibyplayer.sh' script
cp hiby_player.sh $workingdir_in/rootfs/extracted/usr/bin/