diff --git a/fusee/build_package3.py b/fusee/build_package3.py index e196c2e7b..eb09ac459 100644 --- a/fusee/build_package3.py +++ b/fusee/build_package3.py @@ -164,7 +164,7 @@ def main(argc, argv): mesosphere = read_file(os.path.join(ams_dir, 'mesosphere/mesosphere%s.bin' % target)) all_kips = get_kips(ams_dir) tsec_keygen = read_file(os.path.join(ams_dir, 'fusee/program/tsec_keygen/tsec_keygen.bin')) - splash_bin = read_file(os.path.join(ams_dir, 'fusee/program/splash_screen/splash_screen.bin')) + splash_bin = read_file(os.path.join(ams_dir, 'img/splash.bin')) assert len(splash_bin) == 0x3C0000 with open(os.path.join(ams_dir, 'fusee/package3%s' % target), 'wb') as f: # Write header diff --git a/fusee/program/splash_screen/splash_screen.bmp b/fusee/program/splash_screen/splash_screen.bmp deleted file mode 100644 index 3fe43bd90..000000000 Binary files a/fusee/program/splash_screen/splash_screen.bmp and /dev/null differ diff --git a/fusee/program/splash_screen/splash_screen.bin b/img/splash.bin similarity index 100% rename from fusee/program/splash_screen/splash_screen.bin rename to img/splash.bin diff --git a/utilities/insert_splash_screen.py b/utilities/insert_splash_screen.py new file mode 100644 index 000000000..99b4ef9a2 --- /dev/null +++ b/utilities/insert_splash_screen.py @@ -0,0 +1,44 @@ +from PIL import Image +import sys, os +from struct import pack as pk + +SPLASH_SCREEN_WIDTH = 1280 +SPLASH_SCREEN_HEIGHT = 720 + +SPLASH_SCREEN_STRIDE = 768 + +def convert_image(image_fn): + splash = Image.open(image_fn, 'r') + w, h = splash.size + if w == 1280 and h == 720: + splash = splash.transpose(Image.ROTATE_90) + w, h = splash.size + assert w == 720 + assert h == 1280 + splash = splash.convert('RGBA') + splash_bin = b'' + for row in range(SPLASH_SCREEN_WIDTH): + for col in range(SPLASH_SCREEN_HEIGHT): + r, g, b, a = splash.getpixel((col, row)) + splash_bin += pk('