
'pCallSign' keeps track of which character (byte) within the CallSign[ ] we are up to while processing the callsign.
The various kinds of radio navigation stations key their callsigns in different ways:
Non-Directional Beacons operate on the MF band sending out a 1020Hz continuous tone which is interrupted every 30 seconds to key the callsign. If we take the duration of one Morse dot to be a fifth of a second (ie the letter 'A' or the letter 'N' will occupy one second, then the callsign coding for an NDB will be as follows:
[10][1][-125];[10][1][5]NDB;
Radio Range Stations send out a keyed 1020Hz tone. You hear a letter 'A' keyed continually if you are in the Northeast or Southwest quadrants of the station, and 'N' if you are in the Southeast or Northwest quadrants. This keying is interrupted every 30 seconds at which time the station's callsign is keyed twice. Sample callsign coding:
[10][12][5]A;[10][1][7];[10][2][5]RRG;
An Instrument Landing Systems keys its callsign three times in a row with a 1020Hz tone every 30 seconds. It prefixes the first of the 3 callsigns with the letter 'I' to indicate that it is an ILS. If it has an associated DME (Distance Measuring Equipment), the DME callsign is keyed after the 3 ILS callsigns. The DME callsign is keyed with a 3kHz tone. Sample callsign coding:
[10][1][120];[10][1][5]I;[10][3][5]ILS;[30][1][5]DME;
A VHF Omnidirectional Range station keys identically to an ILS except that it prefixes its first callsign with a 'V'.
A lone DME keys its callsign 3 times in a row every 30 seconds at 3kHz.
Airways Markers and Runway Back-Markers key their callsigns continually using a 3kHz tone. An Outer landing marker keys dashes continually using a 400 Hz tone, a Middle landing marker keys alternate dots and dashes continually using a 1.3kHz tone and an Inner landing marker keys dots continually using a 3kHz tone.
[4][1][1]T; Outer marker [4][1][1]A; Middle marker [4][1][1]I; Inner markerThe Morse Code translation of a callsign segment is stored in Morse[ ] as follows:

'Morse[ ]' is a string in which each byte holds the duration of one of the Morse elements (a dot, dash, inter-element space or inter-letter space) which make up the current callsign segment. Each duration is expressed as an 8-bit binary number of Morse-dot durations. The final duration in Morse[ ] is the inter-segment duration 'd' (see above). This is followed by a normal 'C' language 'null' string terminator '\0' which marks the current end of the string. 'pMorse' keeps track of which Morse element is currently being keyed.
'Single' is TRUE within the GS.DAT record of stations with single segment callsigns. A single segment callsign is translated into Morse code once only by SetStn() when the station comes into receivable range and is placed on the active stations list. A station with a multi-segment callsign has each segment of its callsign translated dynamically by the SetUpCallSign() during the actual keying process.
The following function gets the next callsign segment from CallSign[ ] and sets it up as a string of Morse Code timer durations in Morse[ ]:
// t = ptr to Tx Data structure of stn currently being keyed
SetUpCallSign(struct TxData *t)
{
/* Array letters of the Morse Code alphabet where
the code for each letter is expressed as timer
durations: dot=1, dash = 3 */
char *MorseCode[] = {
"\3\1", "\3\1\1\3", "\3\1\3\1", "\3\1\1",
"\1", "\1\1\3\1", "\3\3\1", "\1\1\1\1",
"\1\1", "\1\3\3\3", "\3\1\3", "\1\3\1\1",
"\3\3", "\3\1", "\3\3\3", "\1\3\3\1", "\3\3\1\3",
"\1\3\1", "\1\1\1", "\3", "\1\1\3", "\1\1\1\3",
"\1\3\3", "\3\1\1\3", "\3\1\3\3", "\3\3\1\1"
};
char MC, //Morse Code element (dot/dash/gap)
*pMC, //ptr to Morse element in MorseCode[ ]
*pC = t->pCallSign, //ptr to start of next callsign segment
*pM = t->pMorse; //ptr to start of stn's Morse string
if(*pC == '\0') //if we've reached end of callsign data
pC = t->CallSign; //reset ptr to start of callsign data
t->Pitch = (int)*pC++; //audio frequency of keying tone
t->Repeat = (int)*pC++; //Nš of times it is to be repeated
if((int delay = (int)*pC++) < 0) //if the delay is negative
{
t->Key = TRUE; //set morse key to the on state
delay = -delay; //reverse its sign (make it positive)
}
else //if delay is zero or positive
t->Key = FALSE; //set morse key to the off state
/*While the next call sign character is not a semicolon
get pointer to next character's Morse sequence string*/
while((char Letter = *pC) != ';') {
pMC = MorseCode + Letter - 65;
//For each Morse element (dot or dash) of the character
while((MC = *pMC++) > '\0') {
*pM++ = MC; //store duration of this Morse element
*pM++ = '\1'; //store duration of inter-element pause
}
*--pM = '\3'; //overwrite with an inter-letter pause
pC++; //advance to next letter to be translated
}
*pM++ = delay; //overwrite with delay at end of callsign
*pM = '\0'; //terminating null for Morse Buffer
t->pCallSign = ++pC; //start of next segment of callsign
}