Introduction
A SAP file holds a tune for the Atari 8-bit computers (the 400, 800, XL and XE) as the original 6502 player code, with a text header that says what the tune is and how to run it. It was created in the 1990s by Adam Bienias for his Slight Atari Player; the ASAP player is the one that documents it today. A player emulates a 6502, the POKEY sound chip and a little of the rest of the machine, so the tune sounds as it did on the real hardware.
Structure
Two parts. The header is lines of text, each ended by CR LF: the first is SAP, then tags such as AUTHOR, NAME,
TYPE and INIT. The binary part is an Atari executable: blocks of a start address, an end address and the data, the
first block beginning with $FF $FF.
0Header “SAP” and the tag lines, each ended by CR LFtext…Blocks$FF $FF, start, end, data; then more blocks (the marker is optional after the first)the rest
In the explorer
Drop a .sap file on the explorer to see:
- the tree: the header with one node a tag line, then each block with its marker, start address, end address and data;
- a summary: title, author, date, songs, player type and what it means, POKEY count, video standard, how often the player is called, INIT, PLAYER and MUSIC addresses and the durations;
- the 6502 code disassembled in every block with our own decoder, with the Atari hardware registers named and the INIT and PLAYER entry points labelled (for TYPE C the CMC player’s entry points at PLAYER+3 and PLAYER+6);
- the problems found: a tag line that is badly formed, missing or forbidden tags for the type, an address no block loads, a count of TIME lines that does not match SONGS, a block cut short.
The options bar chooses the processor to disassemble for: the Atari’s 6502C (an NMOS 6502, undocumented opcodes marked) or a 65C02.
Not described
Known, not yet covered
- Viewer: the music is not played; the code is not followed from INIT and PLAYER, every byte of a block is decoded as code (data in the blocks is shown as instructions too).
- Viewer: a TYPE R file is shown as 9-byte frames only; the registers of each frame are not named per byte.
- Reference: the CMC and SoftSynth players themselves (what the code at PLAYER does) are not described.
Unknown
- Reference: the page we read gives no grammar for DATE, no complete version history and no header terminator; the first line starting outside A–Z ends the header in this viewer, which is our reading, not the format’s statement.
- Viewer: no real SAP file is on this Mac and none was fetched; the reading is checked on built files only.
Links
Software
- ASAP – Another Slight Atari Player: plays and converts SAP files (Windows, macOS, Linux, plug-ins)
Reference
- SAP format specification (ASAP) – the main source of these pages, read through a summarising fetch, so the numbers are “our words”