Files
uv-k1-k5v3-firmware-custom/App/apps/foxhunt/gen_assets.py
T

38 lines
1.7 KiB
Python
Executable File

#!/usr/bin/env python3
# FoxHunt read-only assets: texts, attenuator ladder and icons (bytes copied
# verbatim from App/bitmaps.c).
#
# ./gen_assets.py foxhunt_assets.bin foxhunt_assets.h
import os, sys
sys.dont_write_bytecode = True
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))
from app_assets import Assets
a = Assets("FOXHUNT")
a.text("T_TITLE", "FOX HUNT")
a.text("T_DBM", "dBm")
a.text("T_S9P", "S9+")
a.text("T_S0", "S0")
a.text("T_S", "S")
a.text("T_PK", "PK ")
a.text("T_MN", "MN ")
a.text("T_ATT", "ATT ")
a.text("T_DB", "dB")
a.text("T_BYP", "BYP")
a.text("T_BYP_PLUS", "BYP+")
a.u16("ATT_REG13", [0x03DF, 0x03DD, 0x03DB, 0x03D9, 0x0379, 0x0139]) # REG_13 gain bits by attStep
a.u8("ATT_DB", [0, 6, 15, 27]) # attenuation below the bypass steps
a.u8("BMP_BARS", [0x40,0x40,0x00,0x70,0x70,0x00,0x7c,0x7c,0x00,0x7f,0x7f])
a.u8("BMP_GRAPH", [0x08,0x04,0x02,0x04,0x08,0x10,0x20,0x10,0x08,0x04,0x02,0x04,0x08,0x10,0x20])
a.u8("BMP_SIGNAL", [0x08,0x1c,0x1c,0x08,0x00,0x22,0x1c,0x41,0x22,0x1c])
a.u8("BMP_SPEAKER", [0x1c,0x1c,0x3e,0x7f,0x00,0x22,0x1c,0x41,0x22,0x1c])
a.u8("BMP_UP", [0x20,0x30,0x38,0x3c,0x3e,0x3f,0x3e,0x3c,0x38,0x30,0x20])
a.u8("BMP_DOWN", [0x01,0x03,0x07,0x0f,0x1f,0x3f,0x1f,0x0f,0x07,0x03,0x01])
a.u8("BMP_FLAT", [0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12])
a.u8("BMP_F", [0x3e,0x7f,0x41,0x75,0x75,0x75,0x7d,0x7f,0x3e])
a.u8("BMP_LOCK", [0x7c,0x46,0x45,0x45,0x45,0x45,0x45,0x46,0x7c])
# Powers of ten, 10^8 down to 1: numbers (the frequency too) are printed by
# subtraction, so the app links no division.
a.u32("PLACE", [10 ** k for k in range(8, -1, -1)])
a.main()