|
|
1.1 root 1: The Coherent instance of this software requires no assembly routines (thank God).
2: The MSDOS instance includes the sourcefile talkbios.asm,
3: which contains interface routines between the speech functions,
4: the BIOS calls, and the timer and keyboard interrupts.
5: This file also contains replicas of several essential Coherent kernel routines,
6: such as sphi, kalloc, outb, read_t0, etc.
7: Thus the C code is largely portable between Coherent and MSDOS.
8:
9: sdload is called by isload (in kb.c), as the last command.
10: It performs the load/initialization functions for the speech session.
11:
12: sduload is called by isuload (in kb.c), as the last command.
13: It performs the unload/free functions for the speech session.
14:
15: sdtime is called by mmtime (in mm.c), as the last command before rescheduling.
16: Sdtime manages longer sounds such as error bells,
17: and executes the deferred speech commands.
18: It also maintains the ongoing reading of text in the internal buffer.
19: Once reading is initiated, sdtime performs a form of polling,
20: asking whether the synthesizer is ready for more.
21: If it is, send more text.
22: Continue reading until another command is entered.
23: The polling rate of 10HZ is (generally) adequate for this task.
24: The rescheduling frequency is dynamically determined by the variable mmticks.
25: Usually this is set to 10 ticks, the original value.
26: It is upped to 1 tick when producing audio feedback
27: or initiating speech.
28: The new routine mmhasten hastens the execution
29: of mmtime() by rescheduling with mmticks = 1.
30: Unfortunately, I virtually rewrote mmtime() and mmstart().
31: This is far from the decoupled driver we had hoped for,
32: but I believe these rewrites are necessary.
33:
34: mmgo1() is called from mm_start() in mm.c.
35: mmgo1() in turn calls mmgo() (the original) if the character needs
36: to be displayed on the screen.
37: After each byte is taken from the output queue of the tty,
38: c = ttout(tp),
39: call mmgo1(c), and exit the loop if the return value is 1.
40: This is used to generate a significant delay between characters,
41: e.g. when each character produces a distinct tone.
42: If the return is 0 then continue the loop, processing the next output character.
43: This resurrects the original functionality,
44: appropriate when running in the (backward compatible) transparent mode.
45: Normally the return value is 2, which invokes some nontrivial fine timing.
46: If the timer shows we are at the start of the 11932 cycle,
47: wait until the cycle is (roughly) 1/5 finished.
48: (Use read_t0 to implement this timing control.)
49: Thus output characters and their associated clicks are somewhat synchronized.
50: The second character is held until 1/5+1/2 of the cycle has elapsed.
51: No more than two characters are displayed per cycle.
52: Once displayed, mmtime() returns and gives another process
53: a chance to grab the CPU.
54: However its timeout value is set to 1,
55: so if there is no contention, it immediately
56: receives the CPU and displays the next two characters.
57: Thus the output rate is (roughly) 200 characters per second,
58: which is just about optimal.
59: Furthermore, this is accomplished without monopolizing
60: the CPU or consuming too many CPU resources.
61:
62: isrint() in kb.c calls sdinkey_coh().
63: This in turn calls isin() if the character is destined
64: for the tty input queue.
65: If the return is 0 then kb.c calls the usual machinery,
66: including isspecial() to interpret special characters.
67: Some code in isrint() is modified to allow control-fkeys to pass through;
68: they were originally discarded.
69:
70: Before initializing the serial ports, al.c calls sdport_taken
71: to see if a speech session has taken over a serial port,
72: whereupon al.c should leav it alone.
73: As a quick hack, both sibling ports are declared nonexistent.
74: Someday we will leave the sibling port accessible.
75:
76: Patchable variables sd0synth, sd0comport, and sd0bufsize
77: determine the type of synthesizer, the serial port it is attached to,
78: and the desired size of the internal circular buffer respectively.
79: Use patch to change these parameters.
80: Set sd0synth to 0 and the driver behaves
81: exactly as it use to.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.