[net.micro.atari16] i'm learning, but slowly

turner@imagen.UUCP (08/12/86)

~~~~~~~~~~~~~~~~~~~\ lineater, \~~~~~~~~~~~~~~~~~~~~~

i'm porting uE3.7 to the ST and have run into a few problems,
perhaps some kind soul could help me. I am using Megamax C to do it.

1) when i call a sub-command using Pexec(0,STcmd,STargs,STenv)
[assume they are all char *] the first character of STargs gets
dropped or more likely the ptr is getting incremented by 1, putting
a leading blank in STargs works but seems silly


2) when the program is called from another (i.e. the megamax shell)
the cursor does not appear, if it is called from the desktop all works
fine, i have tried calling Cursconf and naming the file .prg, .tos
or .ttp but to not avail

3) if Initmous(0,0,0) is used to disable the mouse (is that
correct?) i know that you use kbdvbase to get the address of the
system interrupt routine, but what about the param struct ? just
malloc some memory before exiting the program and pray ?

A t D h V a A n N k C s E (thats not mine but it was too good not to
steal)
-- 
----
	"I ain't gay, but there are sure times when i wish i could say
		that i wasn't straight"

Name:	James M. Turner
Mail:	Imagen Corp. 2650 San Tomas Expressway, P.O. Box 58101
        Santa Clara, CA 95052-8101
AT&T:	(408) 986-9400
UUCP:	...{decvax,ucbvax}!decwrl!imagen!turner
CompuServe: 76327,1575
GEnie     : D-ARCANGEL

metcalf@miro.Berkeley.EDU (Chris Metcalf) (08/14/86)

In article <469@imagen.UUCP> turner@imagen.UUCP writes:
>i'm porting uE3.7 to the ST and have run into a few problems,
>perhaps some kind soul could help me. I am using Megamax C to do it.

I've just finished doing a port to the Atari with Megamax.  Not entirely
straightforward.  The problem with Pexec() is an annoying one.  It's not
that the first character of the args is being dropped; rather, the
first character of the arg string is supposed to be the LENGTH of the
rest of the string (0-127).  You can't specify a longer argument list 
than that, and you have to tell Pexec() how long the arg list is.  Remember,
we're dealing with an MS-DOS/CPM lookalike computer here, and the
"commandline" argument is simply copied into the new program's base
page starting at location 0x0080.

I didn't run into your other problem, with losing the cursor.  I don't
know why that should happen; I get a cursor with mine.  Certainly avoid
naming the file "emacs.prg", since you're guaranteed not to get a cursor
that way.  I also don't know why you're using Initmous(); there's no mouse
pointer when I run emacs (is it for character input, or ...?).

One problem I ran into with porting to emacs is that calling Bconin() or
Crawcin() always return ^@ for "extended function" keys like the cursor keys.
I eventually got around this problem by calling appl_init() and appl_exit()
in ttopen() and ttclose(), and using evnt_keybd() to get characters from
the keyboard.  Kind of ugly.  But Bconstat() and Bconout() work fine for
typeahead detection and fast character output.

One possibly undocumented feature of the Atari's lowlevel VT52 emulation
is that it DOES support reverse field.  If you output an ^[p the output
goes into reverse field; use ^[q to return to normal.  Convenient!  To
use it, fix up the vt52rev() function in vt52.c and add "revexist = TRUE"
to vt52open() (as well as defining REVSTA in estruct.h).

The only fix I still want to make to Atari emacs is to add a 50-line
mode for monochrome; once I've got that in place I'll submit some diffs
(probably to Lawrence, the emacs coordinator).  I already hacked up a nice
Amiga version; I love that 80 x 50 line screen, and running Emacs on the
ST over the serial line as a background job on the Amiga isn't bad either...

Yours in MicroEMACS hacking,

Chris Metcalf (metcalf@yale.ARPA)		   ..!decvax!yale!metcalf
	      (metcalf@yalecs.BITNET)		..!ihnp4!hsi!yale!metcalf

gert@nikhefh.uucp (Gert Poletiek) (08/15/86)

In article <469@imagen.UUCP> turner@imagen.UUCP writes:
>~~~~~~~~~~~~~~~~~~~\ lineater, \~~~~~~~~~~~~~~~~~~~~~
>
>i'm porting uE3.7 to the ST and have run into a few problems,
>perhaps some kind soul could help me. I am using Megamax C to do it.
>
>1) when i call a sub-command using Pexec(0,STcmd,STargs,STenv)
>[assume they are all char *] the first character of STargs gets
>dropped or more likely the ptr is getting incremented by 1, putting
>a leading blank in STargs works but seems silly
>
	Pexex does not work exactly like the unix execve, it has to be called
	like this:

	/* if MEGAMAX, DRI etc */
	int success;
	/* if LATTICE .. */
	short succes;

	succes = Pexec(0,STcmd,STargs,STenv)


	Pexec ( mode, name, tail, envp )
	int mode;
	char	*name;
	PasChar *tail;
	char	*envp;


	Now your problem pops up :
	the tail parameter is not a standard C string ( 0 terminated ) but
	is a standard PASCAL string, the first byte is the character count,
	and the string needs not be nul terminated.

	try this before you pass the string to Pexec:

	j = strlen ( tail );
	for ( i=0; i<j; i++ )
		tail[i+1]=tail[i];
	tail[0] = strlen ( &tail[1] );


>
>2) when the program is called from another (i.e. the megamax shell)
>the cursor does not appear, if it is called from the desktop all works
>fine, i have tried calling Cursconf and naming the file .prg, .tos
>or .ttp but to not avail
>


	A program like emacs should have the .tos or .ttp extension.
	If everything works fine from the desktop you should not worry,
	MEGAMAX should.

>3) if Initmous(0,0,0) is used to disable the mouse (is that
>correct?) i know that you use kbdvbase to get the address of the
>system interrupt routine, but what about the param struct ? just
>malloc some memory before exiting the program and pray ?
>


	The easiest way to get rid of the mouse pointer is calling the
	AES routine "graf_mous". ( But be sure to turn it back on
	when emacs quits, because there is a counter involved, that keeps
	track of the number of mouse hides in the system.



Hope this solves the problems..

Gert Poletiek
Dutch National Institute for High Energy Physics
Amsterdam
The Netherlands