Skip to content

Commit e251f26

Browse files
committed
Improves behavior of display subrs DSPBOUT and SHOWDISPLAY
DSPBOUT is called to output a single character to the "BCPL display", which is the system text output rather than the bitmapped display. Under maiko, this is mapped to "stdout". Interlisp-D uses CR as the EOL character, but that is not appropriate for output to standard output so CR is translated to LF here. Standard output is buffered, but there is no indication of when the output should be flushed, so flush on every character, since this is a low frequency operation. SHOWDISPLAY is called to switch between the "BCPL display" and the bitmapped display. The current display subsystems are not hooked up to this subr, but this is a potential place to hook display size changes in the future, so the code is updated to indicate the parameters passed in and to set/reset the display initialization state variable.
1 parent 51045b4 commit e251f26

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/dspsubrs.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ extern int Mouse_Included;
4040
****************************************************/
4141

4242
void DSP_dspbout(LispPTR *args) /* args[0] : charcode */
43-
{ putc((args[0] & 0xFFFF) & 0x7f, BCPLDISPLAY); }
43+
{
44+
int charcode = (args[0] & 0x7F);
45+
/* Interlisp-D uses CR as EOL which isn't useful here */
46+
putc((charcode == '\r') ? '\n' : charcode, BCPLDISPLAY);
47+
fflush(BCPLDISPLAY);
48+
}
4449

4550
/****************************************************
4651
*
@@ -52,7 +57,16 @@ void DSP_dspbout(LispPTR *args) /* args[0] : charcode */
5257
extern int DisplayInitialized;
5358

5459
void DSP_showdisplay(LispPTR *args)
55-
{ DisplayInitialized = 1; }
60+
{
61+
LispPTR base = args[0]; /* pointer to the display bitmap */
62+
LispPTR rasterwidth = args[1]; /* should be a smallp */
63+
64+
if (base == NIL) {
65+
DisplayInitialized = 0;
66+
} else {
67+
DisplayInitialized = 1;
68+
}
69+
}
5670

5771
/****************************************************
5872
*

0 commit comments

Comments
 (0)