1
0
Fork 0
forked from len0rd/rockbox

Lua Fix image saving for 32 bit targets -- update make file

Hopefully this will fix the build faliures for a few targets

Change-Id: I68f6c85513ef589e5f6a50a8efc7bfae9fd62acd
This commit is contained in:
William Wilgus 2018-07-24 07:09:01 +02:00
parent af35d19916
commit aefdd2061d
2 changed files with 22 additions and 10 deletions

View file

@ -235,9 +235,12 @@ local _img = {} do
elseif depth <= 16 then elseif depth <= 16 then
bpp = 16 bpp = 16
bypl = (w * 2 + 3) bypl = (w * 2 + 3)
else elseif depth <= 24 then
bpp = 24 bpp = 24
bypl = (w * 3 + 3) bypl = (w * 3 + 3)
else
bpp = 32
bypl = (w * 4 + 3)
end end
local linebytes = bit.band(bypl, bit.bnot(3)) local linebytes = bit.band(bypl, bit.bnot(3))
@ -294,12 +297,21 @@ local _img = {} do
bmpheader[#bmpheader + 1] = bmp_color_mix(0xFFFFFF, 0, 2, 3) bmpheader[#bmpheader + 1] = bmp_color_mix(0xFFFFFF, 0, 2, 3)
bmpheader[#bmpheader + 1] = bmp_color(0x0) bmpheader[#bmpheader + 1] = bmp_color(0x0)
elseif depth == 16 then elseif depth == 16 then
-- red bitfield mask if format == 565 then
bmpheader[#bmpheader + 1] = s_bytesLE(32, 0x0000F800) -- red bitfield mask
-- green bitfield mask bmpheader[#bmpheader + 1] = s_bytesLE(32, 0x0000F800)
bmpheader[#bmpheader + 1] = s_bytesLE(32, 0x000007E0) -- green bitfield mask
-- blue bitfield mask bmpheader[#bmpheader + 1] = s_bytesLE(32, 0x000007E0)
bmpheader[#bmpheader + 1] = s_bytesLE(32, 0x0000001F) -- blue bitfield mask
bmpheader[#bmpheader + 1] = s_bytesLE(32, 0x0000001F)
else -- 555
-- red bitfield mask
bmpheader[#bmpheader + 1] = s_bytesLE(32, 0x00007C00)
-- green bitfield mask
bmpheader[#bmpheader + 1] = s_bytesLE(32, 0x000003E0)
-- blue bitfield mask
bmpheader[#bmpheader + 1] = s_bytesLE(32, 0x0000001F)
end
end end
dump_fbuffer(0) -- write the header to the file now dump_fbuffer(0) -- write the header to the file now

View file

@ -16,7 +16,7 @@ LUA_OBJ := $(call c2obj, $(LUA_SRC))
OTHER_SRC += $(LUA_SRC) OTHER_SRC += $(LUA_SRC)
LUA_INCLUDEDIR := $(LUA_SRCDIR)/include_lua LUA_INCLUDEDIR := $(LUA_SRCDIR)/include_lua
LUA_INCLUDELIST = blit color draw image lcd math_ex print timer LUA_INCLUDELIST := $(addprefix $(LUA_BUILDDIR)/,blit.lua color.lua draw.lua image.lua lcd.lua math_ex.lua print.lua timer.lua)
ifndef APP_TYPE ifndef APP_TYPE
ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET))))) ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET)))))
@ -49,8 +49,8 @@ $(LUA_BUILDDIR)/rocklib_aux.c: $(APPSDIR)/plugin.h $(LUA_OBJ) $(LUA_SRCDIR)/rock
$(LUA_BUILDDIR)/rocklib_aux.o: $(LUA_BUILDDIR)/rocklib_aux.c $(LUA_BUILDDIR)/rocklib_aux.o: $(LUA_BUILDDIR)/rocklib_aux.c
$(call PRINTS,CC $(<F))$(CC) $(INCLUDES) $(PLUGINFLAGS) -I $(LUA_SRCDIR) -c $< -o $@ $(call PRINTS,CC $(<F))$(CC) $(INCLUDES) $(PLUGINFLAGS) -I $(LUA_SRCDIR) -c $< -o $@
$(LUA_INCLUDELIST): %: $(LUA_INCLUDEDIR)/%.lua $(LUA_BUILDDIR)/%.lua: $(LUA_INCLUDEDIR)/%.lua
$(call PRINTS,CP $(subst $(LUA_INCLUDEDIR)/,,$<))cp $< $(LUA_BUILDDIR)/$@.lua $(call PRINTS,CP $(subst $(LUA_INCLUDEDIR)/,,$<))cp $< $@
$(LUA_BUILDDIR)/lua.refmap: $(LUA_OBJ) $(TLSFLIB) $(LUA_BUILDDIR)/lua.refmap: $(LUA_OBJ) $(TLSFLIB)