[comp.emacs] MicroEmacs 3.8b bugs on ATARI ST

DERMOTT@DREA-XX.ARPA.UUCP (03/04/87)

BUGS in MicroEmacs 3.8b for ATARI and MEGAMAX

I picked up the sources for MicroEmacs 3.8b (dated Feb 13 87)from
SIMTEL20. I'm using  a ATARI 1040 ST with Megamax compiler V1.1 .
The sources needed several changes.

Features of ATARI ST and MEGAMAX compiler.
1/    Raw terminal input returns ASCII value and scan code in one long word.
ASCII value is 0 for function keys. The scan codes for function keys are
the same as codes in MSDOS.

2/   Megamax is a one pass compliler so static functions must be declared 
before they are called

3/    With Megamax short is 8 bits ,int is 16 bits and long is 32 bits.

4/   Program sections must be less than 32k each so the overlay statement
is used to break up large programs.

5/   Apparent bug in compiler (v 1.1) in statement of form
#if FLAG
  *pointer = *foo;
#endif  
Putting a comment after the #if statement clears it up.

Found Bugs in MicroEmacs 3.8b
1/ In estruct.h IBMMONO is not defined.
2/ In estruct.h all short's should be changed to SHORT (ie int). 
    Important for KEYTAB.
3/ Since estruct.h defines system constants it should be #include'd
at beginning of every file. Change in main.c,word.c.
4/ In st520.c grez is not declared
5/ In st520.c term is not initialized properly. First 7 lines 
should be same as in vt52.c i.e.
TERM	term	= {
	NROWS - 1,
	NROWS - 1,
	NCOLS,
	NCOLS,
	MARGIN,
	SCRSIZ,
	NPAUSE,


6/ In search.c all static functions must be declared before use.
7/ In search.c bug in compiler 	. Adding comment fixes it.
    Also Megamax supports struct assigns so include it.
#if MEGAMAX | MWC86 | AZTEC | MSC | VMS | USG | BSD | V7 /* add comment */
			*rtpcm++ = *--mcptr; 

8/ in termio.c Scancode is never returned so special function
keys are not detected. add code:
#if	ST520
	long ch;
        int ch2;
	
/*
 * blink the cursor only if nothing is happening, this keeps the
 * cursor on steadily during movement making it easier to track
 */
	STcurblink(TRUE);  /* the cursor blinks while we wait */
	ch = Bconin(2);
	STcurblink(FALSE); /* the cursor is steady while we work */
	STscancode = (ch >> 16) & 0xff;
/* return scancode if ASCII is 0 */
	ch2 = 255 & (int)ch;
	if(ch2 == 0)return(SPEC|STscancode);
	else return(ch2);
	
#endif

9/ In spawn.c line 573 change MWC_86 to MWC86 .
10/ In search.c 1st arg to ldelete() must be a long. Cast it.
     ldelete((long)rlength,FALSE)
     ldelete((long)slength,FALSE)
11/ In fileio.c in ffputline() it is not necessary to add
a car. return before newline since fputc does this. 
12/ In ebind.h the default bindings under ST520 are not very useful.
The function keys return the same codes as MSDOS so use the  MSDOS 
bindings.
    I think that's all.
    David Dermott   DERMOTT@DREA.arpa
    Dartmouth Nova Scotia Canada
-------