File:  [RetroPC.NET] / np2 / x11 / commng.h
Revision 1.2: download - view: text, annotated - select for diffs
Fri Mar 26 00:10:33 2004 JST (21 years, 7 months ago) by monaka
Branches: MAIN
CVS tags: VER_0_82_x64, VER_0_82, VER_0_81A, VER_0_81, VER_0_80, VER_0_79, VER_0_78, VER_0_77, VER_0_76, HEAD
added serial port support.  but not work yet...

/*	$Id: commng.h,v 1.2 2004/03/25 15:10:33 monaka Exp $	*/

#ifndef	NP2_X11_COMMNG_H__
#define	NP2_X11_COMMNG_H__

// ---- com manager interface

enum {
	COMCREATE_SERIAL		= 0,
	COMCREATE_PC9861K1,
	COMCREATE_PC9861K2,
	COMCREATE_PRINTER,
	COMCREATE_MPU98II
};

enum {
	COMCONNECT_OFF			= 0,
	COMCONNECT_SERIAL,
	COMCONNECT_MIDI,
	COMCONNECT_PARALLEL
};

enum {
	COMMSG_MIDIRESET		= 0,
	COMMSG_SETFLAG,
	COMMSG_GETFLAG,
	COMMSG_USER
};

struct _commng;
typedef struct _commng	_COMMNG;
typedef struct _commng	*COMMNG;

struct _commng {
	UINT	connect;
	UINT	(*read)(COMMNG self, BYTE *data);
	UINT	(*write)(COMMNG self, BYTE data);
	BYTE	(*getstat)(COMMNG self);
	long	(*msg)(COMMNG self, UINT msg, long param);
	void	(*release)(COMMNG self);
};

typedef struct {
	UINT32	size;
	UINT32	sig;
	UINT32	ver;
	UINT32	param;
} _COMFLAG, *COMFLAG;


#ifdef __cplusplus
extern "C" {
#endif

COMMNG commng_create(UINT device);
void commng_destroy(COMMNG hdl);

#ifdef __cplusplus
}
#endif


// ---- com manager for unix

enum {
	COMPORT_NONE			= 0,
	COMPORT_COM1,
	COMPORT_COM2,
	COMPORT_COM3,
	COMPORT_COM4,
	COMPORT_MIDI
};

enum {
	COMSIG_COM1			= 0x314d4f43,
	COMSIG_COM2			= 0x324d4f43,
	COMSIG_COM3			= 0x334d4f43,
	COMSIG_COM4			= 0x344d4f43,
	COMSIG_MIDI			= 0x4944494d
};

enum {
	COMMSG_MIMPIDEFFILE		= COMMSG_USER,
	COMMSG_MIMPIDEFEN
};

void commng_initialize(void);

#include "cmmidi.h"
#include "cmserial.h"
#include "cmpara.h"

#endif	/* NP2_X11_COMMNG_H__ */

RetroPC.NET-CVS <cvs@retropc.net>