local a=require('data.min')local b=require('battery.min')local c=require('image_sprite_block.min')local d=require('plain_text.min')TEXT_FLAG=0x0a;IMAGE_SPRITE_BLOCK=0x0d;a.parsers[TEXT_FLAG]=d.parse_plain_text;a.parsers[IMAGE_SPRITE_BLOCK]=c.parse_image_sprite_block;function print_text(e)local f=0;for g in e:gmatch("([^\n]*)\n?")do if g~=""then frame.display.text(g,1,f*60+1)f=f+1 end end end;function app_loop()frame.display.text(" ",1,1)frame.display.show()local h=0;local i=''while true do rc,err=pcall(function()local j=a.process_raw_items()if j>0 then if a.app_data[TEXT_FLAG]~=nil and a.app_data[TEXT_FLAG].string~=nil then i=a.app_data[TEXT_FLAG].string end;if a.app_data[IMAGE_SPRITE_BLOCK]~=nil then local k=a.app_data[IMAGE_SPRITE_BLOCK]if k.current_sprite_index>0 then if k.progressive_render or k.active_sprites==k.total_sprites then for l=1,k.active_sprites do local m=k.sprites[l]local n=k.sprite_line_height*(l-1)if l==1 then c.set_palette(m.num_colors,m.palette_data)end;frame.display.bitmap(301,n+1,m.width,2^m.bpp,0,m.pixel_data)end end end end;print_text(i)frame.display.show()end;frame.sleep(0.005)h=b.send_batt_if_elapsed(h,180)end)if rc==false then print(err)frame.display.text(" ",1,1)frame.display.show()frame.sleep(0.04)break end end end;app_loop()