#!/usr/bin/env python3
"""Build the boot credits card and native tile asset from maintained attribution.
Text only, authored here; sources and contribution scope are in CREDITS.md.
"""
from pathlib import Path
from PIL import Image,ImageDraw,ImageFont
import subprocess
here=Path(__file__).resolve().parent;data=here.parent/'data'
font_path='/usr/share/fonts/TTF/DejaVuSansMono.ttf'
font=ImageFont.truetype(font_path,9);title=ImageFont.truetype(font_path,13)
im=Image.new('RGB',(320,224),(0,0,0));draw=ImageDraw.Draw(im)
def center(y,text,ft=font,color=219):
 box=draw.textbbox((0,0),text,font=ft);x=(320-(box[2]-box[0]))//2;assert x>=4,text
 draw.text((x,y),text,font=ft,fill=(color,)*3)
center(7,"NHL '94 SEASON EDITION",title,255);center(26,'CREDITS',font,255)
rows=[(44,'Original NHL 94: EA Sports'),(58,'NHL 2026 - 94 Edition v5.1W'),(69,'Jkline3 & von Ozbourne'),(85,'Community work credited by the base ROM:'),(96,'Drezz / slapshot67 / AdamCatalyst'),(107,'chaos / smozoma / clockwise / McMarkis'),(123,'Disassemblies and mechanics research:'),(134,'abdulahmad / NHL94Genesis'),(145,'Chaos81 / nhl94-disassembly'),(156,'Tickenest / NHL94MatchViewer'),(172,'Season additions: jdc with Claude & Codex'),(183,'Playtesting: jdc & Bodin'),(198,'Website: https://games.jdc.se'),(211,'START to continue')]
for y,text in rows:center(y,text)
im.save(data/'boot-credits.png')
subprocess.run(['python3',str(here.parent/'introimg.py'),str(data/'boot-credits.png'),str(data/'boot-credits.bin')],check=True)
