Skip to main content

Timing data

Data · Routines · Address index

The timed-callback table, counters and step pacing, script timers, and the state of sound effects and the sound driver. The data page explains how the entries are written.

DS:0x5bfc — Timed-callback table​

DS:0x6676 — State of the drawing generator​

  • Layout: 3 bytes, initially 0x34, 0x12, 0x76
  • Role: State of 0x33dc4; nothing else uses it, so the sequence depends only on how often the routine has run.
  • Used by: Drawing helpers

DS:0xf16c — Screen refresh wait mode​

DS:0x667c — Free-running counter​

DS:0xdf2c — Step pacing flag​

DS:0xdf24 — Keyboard pick-up zone​

  • Layout: byte
  • Role: Current zone of the keyboard pick-up cycle, advanced by 0x1c6d9; set to 0xff, restarting the cycle, by the turn and step commands, by move the party or an object and by turn the party (0x27547).
  • Used by:

DS:0xe442 — First item of a keyboard take​

  • Layout: word
  • Role: The first item taken since the zone last changed, −1 when none, used by the keyboard take. While it is set the zone does not advance (0x1c72a), so repeated presses of G walk through a pile, each one taking the top item and appending the one held. When the top item is that first item again, it is put back; that case and an empty zone clear the variable (0x1c79f, 0x1c88d–0x1c8b7), and a press with nothing taken tries the next zone, up to five tries over the four zones (0x1c8c3).
  • Used by:

DS:0xeef2 — Next step time​

  • Layout: dword
  • Role: Value of the free-running counter before which a paced redraw waits. Set to the counter at game start (0x1cb41–0x1cb4b) and to the counter plus 4 by the scene redraw after each paced redraw (0x3f7df–0x3f7fb). See the step pacing flag.
  • Used by:

DS:0x6684 — Shared counter​

DS:0x6690 — Counter switches​

DS:0x668c — Flash countdown​

DS:0xcbc8 — Script timers​

DS:0xef2a — Ambient-sound deadline​

DS:0xef58 — Sound-effect table​

DS:0x638a, DS:0x638c — Sound driver​

  • Layout: word 0x638a, byte 0x638c
  • Role: 0x638a is the sound driver: 1 AdLib (the .ADL files), 2 PC speaker and 3 Tandy sound chip (the .SND files), 0 none. The start-up reads it as the second word of EOSPREFS.DAT (0x18912–0x18921), sets the "Sounds" option when it is not 0, and starts the driver. 0x638c is 1 for driver 3 and 0 for driver 2. The devices follow from the ports each driver writes: 0x388–0x389 for driver 1, the speaker ports 0x42 and 0x61 for driver 2, port 0xc0 for driver 3. SETUP.EXE writes the value as the second of the three words of EOSPREFS.DAT (image offsets 0x485–0x4f0): its sound menu stores 1 for "Adlib or Sound Blaster", 2 for "Built in speaker" and 0 for "No Sound" (0x10b9, 0x10f9, 0x111d). Its summary screen also names a value of 3 "Tandy speaker" (0x14da), but no store of 3 was found in the program, so driver 3 is reached only with an EOSPREFS.DAT written otherwise. The reference EOSPREFS.DAT holds 1.
  • Used by: PC speaker and Tandy sounds (SND) › In brief, Sound and music, From files to the game, Settings (EOSPREFS.DAT)

DS:0x6a80–DS:0x6c48 — Speaker and Tandy sound state​

  • Layout: the data of the speaker and Tandy sound routines, which address it with segment 0x31be, that is DS:0x6a80 + offset. The main fields, as data-segment offsets:

    OffsetSizeContent
    0x6a84, 0x6a862 wordsReload, 15, and countdown of the interrupts before the BIOS handler is called.
    0x6a88far pointerThe program playing.
    0x6a8c4 wordsPosition of each voice in the program.
    0x6a94far pointerThe program requested.
    0x6a9896 wordsSpeaker note table: system timer divisors, 0 for note 0 (a rest), 65 023 for note 1 to 285 for note 95.
    0x6b5896 wordsTandy note table: chip divisors, 0 for note 0, 1023 for notes 1–31, down to 27 for note 95.
    0x6c18bytePort 0x61 as saved at start-up.
    0x6c19wordVoice count, 1 or 3.
    0x6c1b–0x6c1d3 bytesPlaying, start request, stop request.
    0x6c1e–0x6c293 × 4 bytesPer voice: stop, waiting for an element, ended.
    0x6c2a4 wordsPer voice: countdown.
    0x6c324 bytesPer voice: level, 15, 10, 5 and 0 in the file image.
    0x6c36–0x6c413 × 4 bytesPer voice: tempo factor, loop counters A and B.
    0x6c42, 0x6c432 bytesStart delays of voices 1 and 2.
    0x6c44byteBusy while a sound plays.
    0x6c45byteTandy flag: the output goes to the Tandy chip when 1, to the speaker otherwise.
    0x6c46, 0x6c48word, byteInterrupt count within the second, 0–291, and a count of seconds, 0–59; only the interrupt handler uses them.
  • Role: Written and read by the timer interrupt, the sound run, the output and voice routines; the Tandy flag also by the sound-effect player and the driver start. The note tables are not changed at run time: notes follow an equal-tempered scale, the speaker table within 14 cents of it.

  • Comparative source: REF-SCUMM-023, _periodsPCSpk and _periodsPCjr.

  • Used by: Playing speaker and Tandy programs › How a program plays