==============================================================================
Janitor 15
==============================================================================

A Short Demo for the Sommarhack 2026 Short Demo compo, by T.O.Y.S.

What to make for a Short Demo? I have lost count of how many times I booted
Starglider just to hear the sampled music, or Wings of Death only to stare
at the intro picture. And I never coded anything for plain ST, so why not...

A 33-second 15 kHz sample AND a Spectrum 512 image on a bog-standard half-meg
plain ST, exactly as one rolled off the assembly line in the summer of 1985.

------------------------------------------------------------------------------
Credits
------------------------------------------------------------------------------

  PeyloW               code and "design".
  AiO                  audio engineering.
  Claude               tools.

------------------------------------------------------------------------------
What it does
------------------------------------------------------------------------------

  Spectrum 512 image   512 colours via a cycle-exact raster palette.  A full
                       row costs 492 cycles, leaving nothing for the YM - so
                       every other line reloads only 32 colours, not 48, to
                       buy back the time the sample replay needs.

  33 s 15 kHz sample   played on the YM2149 by ganging its three volume
                       channels into one software DAC (~8-bit PCM), packed
                       ~2:1 with a custom adaptive delta coder, so it fits in
                       half a meg, with real-time depacking. 300 samples per
                       VBL in three bands of replay speed for 15kHz average.

  6 px scroll text     because every demo needs one.

------------------------------------------------------------------------------
Source
------------------------------------------------------------------------------

  main.s      entry, the VBL + HBL handlers, the cycle-exact display loop.
  helpers.s   equates, init/deinit, video + palette setup.
  fade.s      startup palette fade to black (fade_out).
  spu.s       Spectrum macros (SYNC_BEAM, SPU_ROW), init_spu.
  audio.s     YM DAC table, SND_PLAY, init_audio, the incbin'd packed sample.
  scroller.s  the 6 px scroll text.
  debug.s     the disabled stuff for debugging.

------------------------------------------------------------------------------
Build
------------------------------------------------------------------------------

Source assets live in ./assets/.  The root Makefile builds the host tools in
./tools/, runs them to generate every incbin'd input, then assembles:

  assets/image512.png -> [spec512]              -> image.spu
  assets/audio.wav    -> [downsample]           -> 15 kHz 8-bit wav
                      -> [compsample]           -> audio.tab + audio.dat

  make          build tools, regenerate stale assets, link jan15.tos
  make tools    just the host tools (see tools/*/README.txt)
  make clean    remove the derived files

------------------------------------------------------------------------------
Run
------------------------------------------------------------------------------

Copy jan15.tos to an ST (or Hatari), a floppy, or a hard disk, then run it. 
Requires a plain Atari ST or STe, with half a megabyte of memory. 
Tested with TOS 1.04, 1.62, and 2.06.
