[comp.sys.atari.st] MIDI Interrupts

SCHWIETZ@DBNUOR1.BITNET (Edgar Schwietzke) (10/06/88)

Perhaps somebody has an answer to the following:

XBIOS  function Kbdvbase()  returns a  pointer  to a  structure where  -
among  others  -  three pointers  (*kb_midisys)(),  (*kb_vmiderr)()  and
(*kb_midivec)() are stored.  As far as I know from  several books on the
ATARI ST, kb_midisys() is called, when  an interrupt has occured (in one
of the ACIAs),  kb_vmiderr() is the MIDI error  handler and kb_midivec()
is responsible for  receiving a byte from the MIDI  port. But I couldn't
find any further  description of what the routines should do EXACTLY and
when/how  they are  called.  Therefore, I've  disassembled the  relevant
XBIOS code in  order to determine the precise  entry/exit conditions for
these routines, but with respect to old and future TOS versions I wonder
whether I should rely on the information obtained in this way ...

Is there  some sort of  "official", detailed and  reliable documentation
of  these (and  possibly other)  routines and  TOS pecularities?  Is the
documentation, if any, available to "normal" users? Where? In W-Germany?

Any help would be appreciated.

-Edgar

PS:  Please  don't refer  to  "The  complete,  hmm ...  almost  complete
TOS-Listing" compiled by  S.T. Expert,  author of  the well-known  books
"GEM-Programming  with XYZ-BASIC  Version  2.10.1.13c"  and "Inside  the
74LS04". Or will this really be the "ultima ratio"?

burris@ihuxz.ATT.COM (Burris) (10/08/88)

> 
> Perhaps somebody has an answer to the following:
> 
> XBIOS  function Kbdvbase()  returns a  pointer  to a  structure where  -
> among  others  -  three pointers  (*kb_midisys)(),  (*kb_vmiderr)()  and
> (*kb_midivec)() are stored.  As far as I know from  several books on the
> ATARI ST, kb_midisys() is called, when  an interrupt has occured (in one
> of the ACIAs),  kb_vmiderr() is the MIDI error  handler and kb_midivec()
> is responsible for  receiving a byte from the MIDI  port. But I couldn't
> find any further  description of what the routines should do EXACTLY and
> when/how  they are  called.

> Is there  some sort of  "official", detailed and  reliable documentation
> of  these (and  possibly other)  routines and  TOS pecularities?  Is the
> documentation, if any, available to "normal" users? Where? In W-Germany?
> 


Actually the routine is like this:

struct	vectors
{
	long	midivec;	/* MIDI input */
	long	vkbderr;	/* Keyboard error */
	long	vmiderr;	/* MIDI error */
	long	statvec;	/* IKBD status */
	long	mousevec;	/* Mouse routines */
	long	clockvec;	/* clock time routine */
	long	joyvec;		/* joystick routines */
	long	midisys;	/* system MIDI vector */
	long	ikbdsys;	/* IKBD system vector */
};

struct	vectors *kbdvbase();

midivec is the interrupt vector for the MIDI receiver. Essentially,
it just calls a routine that stores the MIDI bytes in a circular
buffer that is then read by the conin() BIOS routine.

The vmiderr vector is called whenever an overrun of the buffer is
detected.

You can supply your own MIDI interrupt routine by writing a new vector
to midivec. You should not mess with midisys.

Dave Burris