SR16 TEST - test of the Overlay pixel mode SR16 of the VBXE FX core

FILES
  sr16test.xex   program
  sr16test.c, sr16test.ld - program sources (llvm-mos)
  sr16gen.py     makes sr16data.h (the pictures, the palette, the screen texts and rulers)
                 and, with the OS ROM of the Atari XL/XE, the reference pictures of the
                 screen (python3 sr16gen.py [ATARIXL.ROM])
  sr16data.h     generated by sr16gen.py
  sr16_new.png   reference: the screen with the SR16 mode (FX core v1.27.3), PAL colors
  sr16_old.png   reference: the same program on FX v1.26 ... v1.27.2 (no SR16 mode)
  sr16_zoom.png  enlarged detail of both (stripes and lines bands)
  build.sh       builds everything

WHAT IT SHOWS
  SR16 TEST is a tool intended mainly for the development and testing of VBXE emulators.
  The reference pictures show the exact screen it produces.

  SR16 (FX core v1.27.3): XDLC_OV_HR and XDLC_OV_LR set together. 16 colors, 2 pixels per
  byte (the left one in bits 7..4), pixels as wide as in the SR mode, 160 bytes per line
  (NORMAL width).

  The screen has four bands. Each band shows the same picture twice: 16 lines in the SR16
  mode and, right below, 16 lines in the SR mode (one byte per pixel) as the reference:
    COLOR BARS       16 bars of 20 pixels, colors 0..15 (color 0 is transparent)
    1-PIXEL STRIPES  white/blue and red/green stripes 1 pixel wide, a yellow line every
                     3 pixels
    1-PIXEL LINES    vertical lines in odd and even columns, a diagonal and a sine line
    8X8 TEXT         text in the OS ROM character set, not scaled, 40 characters
                     per row; column 0 of every character cell is a dark grey
                     reference line over the full height of the band (SR16 and SR
                     halves)
  The labels between the bands are ANTIC text.

  Above and below each band (except the text band, which has its own reference lines)
  there are 4 lines of ANTIC hires (GR.8) ticks: 1-pixel marks in the columns where the
  band has its edges (bar starts, even columns, the columns of the vertical lines) and
  in the first and the last column of the 320-pixel playfield. The overlay pixels must
  line up with them: a shift of the overlay against the ANTIC playfield shows as edges
  between the ticks.

  With the SR16 mode both halves of every band look the same (sr16_new.png).
  A core without the SR16 mode (FX v1.26 ... v1.27.2) shows each byte of the upper half
  as its pixel pair repeated at the HR pixel width (sr16_old.png): the 1-pixel stripes
  are twice as dense, the vertical lines in odd columns are doubled, the yellow lines of
  the stripes band come in pairs and the edges of the diagonal lines and of the text are
  frayed; in the text band the reference lines of the SR16 half are thinner and the
  glyphs lose their shape. The color bars look the same in both cases.

KEYS
  ESC  exit to DOS

REQUIREMENTS / MEMORY
  VBXE with the FX core v1.26 or newer v1.2x (the SR16 mode itself: v1.27.3).
  Atari XL/XE. Program from $2000 (below $8000), MEMAC-A window $8000-$8FFF (CPU only,
  enabled only while VRAM is written).
  VRAM: XDL at $00000, SR16 picture at $01000, SR reference at $04000.
  Overlay palette 1, colors 0..15.

BUILD
  build.sh:
    python3 sr16gen.py [ATARIXL.ROM]
    mos-atari8-dos-clang -Os -fno-builtin -T sr16test.ld -o sr16test.xex sr16test.c

Tomasz Piórek / electron, 2026-11-04
