Reject tile/tomb IFF files whose nPlanes field exceeds DEPTH:
the CMAP loop writes 1<<np entries into amii_initmap[] /
amiv_init_map[], both sized AMII_MAXCOLORS = 1<<DEPTH = 64, so
a malformed file with nPlanes >= 7 would corrupt adjacent BSS.
After OpenScreen succeeds, clamp amii_numcolors to the actually
populated portion of the init-map arrays (AMII_PALETTE_SIZE for
text mode, AMIV_PALETTE_SIZE for tile mode). On a 64-color
screen this stops LoadRGB4 from loading the zero-initialized
tail entries as black. Replace the matching magic 32 in the
tilefile selection with AMIV_PALETTE_SIZE.
While there, add the (char) cast on amii_glyph_buffer's
truncating assignment to make the contract explicit.