The new build system for d1x

This commit is contained in:
michaelstather 2006-04-03 17:36:27 +00:00
parent 67819a155e
commit bf476e1dae
27 changed files with 3797 additions and 0 deletions

6
arch/linux/include/ipx_bsd.h Executable file
View file

@ -0,0 +1,6 @@
#ifndef _IPX_BSD_H
#define _IPX_BSD_H
#include "ipx_drv.h"
extern struct ipx_driver ipx_bsd;
#endif

28
arch/linux/include/ipx_hlpr.h Executable file
View file

@ -0,0 +1,28 @@
#ifndef IPXHELPER_H_
#define IPXHELPER_H_
#include <sys/types.h>
#include "ipx_ldescent.h"
#define IPX_MANUAL_ADDRESS
struct ipx_recv_data {
/* all network order */
u_char src_network[4];
u_char src_node[6];
u_short src_socket;
u_short dst_socket;
int pkt_type;
};
struct ipx_helper {
int (*GetMyAddress)(void);
int (*OpenSocket)(ipx_socket_t *sk, int port);
void (*CloseSocket)(ipx_socket_t *mysock);
int (*SendPacket)(ipx_socket_t *mysock, IPXPacket_t *IPXHeader,
u_char *data, int dataLen);
int (*ReceivePacket)(ipx_socket_t *s, char *buffer, int bufsize,
struct ipx_recv_data *rec);
int (*PacketReady)(ipx_socket_t *s);
};
#endif /* IPXHELPER_H_ */

6
arch/linux/include/ipx_kali.h Executable file
View file

@ -0,0 +1,6 @@
#ifndef _IPX_KALI_H
#define _IPX_KALI_H
#include "ipx_drv.h"
extern struct ipx_driver ipx_kali;
#endif

49
arch/linux/include/ipx_ld.h Executable file
View file

@ -0,0 +1,49 @@
/*
* parts from:
* ipx.h header file for IPX for the DOS emulator
* Tim Bird, tbird@novell.com
*/
#ifndef _IPX_DOSEMU
#define _IPX_DOSEMU
#define MAX_PACKET_DATA 1500
typedef struct IPXAddressStruct {
u_char Network[4] __attribute__((packed));
u_char Node[6] __attribute__((packed));
u_char Socket[2] __attribute__((packed));
} IPXAddress_t;
typedef struct IPXPacketStructure {
u_short Checksum __attribute__((packed));
u_short Length __attribute__((packed));
u_char TransportControl __attribute__((packed));
u_char PacketType __attribute__((packed));
IPXAddress_t Destination __attribute__((packed));
IPXAddress_t Source __attribute__((packed));
} IPXPacket_t;
typedef struct ipx_socket_struct {
#ifdef DOSEMU
struct ipx_socket_struct *next;
far_t listenList;
int listenCount;
far_t AESList;
int AESCount;
u_short PSP;
#endif
u_short socket;
int fd;
} ipx_socket_t;
#include "mono.h"
#ifndef NMONO
#define n_printf(format, args...) _mprintf(1, format, ## args)
#else
#define n_printf(format, args...) fprintf(stderr,format, ## args)
#endif
#define enter_priv_on()
#define leave_priv_setting()
#endif

13
arch/linux/include/ipx_lin.h Executable file
View file

@ -0,0 +1,13 @@
#ifndef IPX_LINUX_H_
#define IPX_LINUX_H_
#include <sys/types.h>
#include "ipx_helper.h"
int ipx_linux_GetMyAddress(void);
int ipx_linux_OpenSocket(ipx_socket_t *sk, int port);
void ipx_linux_CloseSocket(ipx_socket_t *mysock);
int ipx_linux_SendPacket(ipx_socket_t *mysock, IPXPacket_t *IPXHeader,
u_char *data, int dataLen);
int ipx_linux_ReceivePacket(ipx_socket_t *s, char *buffer, int bufsize,
struct ipx_recv_data *rd);
#endif

6
arch/linux/include/ipx_udp.h Executable file
View file

@ -0,0 +1,6 @@
#ifndef _IPX_UDP_H
#define _IPX_UDP_H
#include "ipx_drv.h"
extern struct ipx_driver ipx_udp;
#endif

152
arch/linux/include/joy.h Executable file
View file

@ -0,0 +1,152 @@
/*
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
*/
#ifndef _JOY_H
#define _JOY_H
#include "types.h"
#include "fix.h"
// added October 24, 2000 20:40 Steven Mueller: more than 4 joysticks now
#define MAX_JOY_DEVS 8
#define JOY_1_BUTTON_A 1
#define JOY_1_BUTTON_B 2
#define JOY_2_BUTTON_A 4
#define JOY_2_BUTTON_B 8
#define JOY_ALL_BUTTONS (1+2+4+8)
#define JOY_1_X_AXIS 1
#define JOY_1_Y_AXIS 2
#define JOY_2_X_AXIS 4
#define JOY_2_Y_AXIS 8
#define JOY_ALL_AXIS (1+2+4+8)
#define JOY_SLOW_READINGS 1
#define JOY_POLLED_READINGS 2
#define JOY_BIOS_READINGS 4
#define JOY_FRIENDLY_READINGS 8
#define MAX_AXES 32
#define MAX_BUTTONS 64
#define JOY_NUM_AXES 4
typedef struct joystick_device {
int device_number;
int version;
int buffer;
char num_buttons;
char num_axes;
} joystick_device;
typedef struct joystick_axis {
int value;
int min_val;
int center_val;
int max_val;
int joydev;
} joystick_axis;
typedef struct joystick_button {
ubyte state;
ubyte last_state;
//changed 6/24/1999 to finally squish the timedown bug - Owen Evans
fix timedown;
//end changed - OE
ubyte downcount;
int num;
int joydev;
} joystick_button;
//==========================================================================
// This initializes the joy and does a "quick" calibration which
// assumes the stick is centered and sets the minimum value to 0 and
// the maximum value to 2 times the centered reading. Returns 0 if no
// joystick was detected, 1 if everything is ok.
// joy_init() is called.
extern int joy_init();
extern void joy_close();
extern char joy_installed;
extern char joy_present;
extern int j_num_axes;
extern int j_num_buttons;
extern int joy_deadzone;
extern joystick_device j_joystick[MAX_JOY_DEVS];
extern joystick_axis j_axis[MAX_AXES];
extern joystick_button j_button[MAX_BUTTONS];
//==========================================================================
// The following 3 routines can be used to zero in on better joy
// calibration factors. To use them, ask the user to hold the stick
// in either the upper left, lower right, or center and then have them
// press a key or button and then call the appropriate one of these
// routines, and it will read the stick and update the calibration factors.
// Usually, assuming that the stick was centered when joy_init was
// called, you really only need to call joy_set_lr, since the upper
// left position is usually always 0,0 on most joys. But, the safest
// bet is to do all three, or let the user choose which ones to set.
extern void joy_set_cen();
//==========================================================================
// This reads the joystick. X and Y will be between -128 and 127.
// Takes about 1 millisecond in the worst case when the stick
// is in the lower right hand corner. Always returns 0,0 if no stick
// is present.
extern void joy_get_pos( int *x, int *y );
//==========================================================================
// This just reads the buttons and returns their status. When bit 0
// is 1, button 1 is pressed, when bit 1 is 1, button 2 is pressed.
extern int joy_get_btns();
//==========================================================================
// This returns the number of times a button went either down or up since
// the last call to this function.
extern int joy_get_button_up_cnt( int btn );
extern int joy_get_button_down_cnt( int btn );
//==========================================================================
// This returns how long (in approximate milliseconds) that each of the
// buttons has been held down since the last call to this function.
// It is the total time... say you pressed it down for 3 ticks, released
// it, and held it down for 6 more ticks. The time returned would be 9.
extern fix joy_get_button_down_time( int btn );
extern int j_Update_state ();
extern int j_Get_joydev_axis_number (int all_axis_number);
extern int j_Get_joydev_button_number (int all_button_number);
extern ubyte joystick_read_raw_axis( ubyte mask, int * axis );
extern void joy_flush();
extern ubyte joy_get_present_mask();
extern void joy_set_timer_rate(int max_value );
extern int joy_get_timer_rate();
extern int joy_get_button_state( int btn );
extern void joy_get_cal_vals(int *axis_min, int *axis_center, int *axis_max);
extern void joy_set_cal_vals(int *axis_min, int *axis_center, int *axis_max);
extern int joy_get_scaled_reading( int raw, int axn );
extern void joy_set_slow_reading( int flag );
extern void joy_set_min (int axis_number, int value);
extern void joy_set_center (int axis_number, int value);
extern void joy_set_max (int axis_number, int value);
#endif

265
arch/linux/include/joystick.h Executable file
View file

@ -0,0 +1,265 @@
#ifndef _LINUX_JOYSTICK_H
#define _LINUX_JOYSTICK_H
/*
* /usr/include/linux/joystick.h Version 1.2
*
* Copyright (C) 1996-1998 Vojtech Pavlik
*/
#include <asm/types.h>
/*
* Version
*/
#define JS_VERSION 0x01020a
/*
* Types and constants for reading from /dev/js
*/
#define JS_EVENT_BUTTON 0x01 /* button pressed/released */
#define JS_EVENT_AXIS 0x02 /* joystick moved */
#define JS_EVENT_INIT 0x80 /* initial state of device */
struct js_event {
__u32 time; /* event timestamp in miliseconds */
__s16 value; /* value */
__u8 type; /* event type */
__u8 number; /* axis/button number */
};
/*
* IOCTL commands for joystick driver
*/
#define JSIOCGVERSION _IOR('j', 0x01, __u32) /* get driver version */
#define JSIOCGAXES _IOR('j', 0x11, __u8) /* get number of axes */
#define JSIOCGBUTTONS _IOR('j', 0x12, __u8) /* get number of buttons */
#define JSIOCGNAME(len) _IOC(_IOC_READ, 'j', 0x13, len) /* get identifier string */
#define JSIOCSCORR _IOW('j', 0x21, struct js_corr) /* set correction values */
#define JSIOCGCORR _IOR('j', 0x22, struct js_corr) /* get correction values */
/*
* Types and constants for get/set correction
*/
#define JS_CORR_NONE 0x00 /* returns raw values */
#define JS_CORR_BROKEN 0x01 /* broken line */
struct js_corr {
__s32 coef[8];
__s16 prec;
__u16 type;
};
/*
* v0.x compatibility definitions
*/
#define JS_RETURN sizeof(struct JS_DATA_TYPE)
#define JS_TRUE 1
#define JS_FALSE 0
#define JS_X_0 0x01
#define JS_Y_0 0x02
#define JS_X_1 0x04
#define JS_Y_1 0x08
#define JS_MAX 2
#define JS_DEF_TIMEOUT 0x1300
#define JS_DEF_CORR 0
#define JS_DEF_TIMELIMIT 10L
#define JS_SET_CAL 1
#define JS_GET_CAL 2
#define JS_SET_TIMEOUT 3
#define JS_GET_TIMEOUT 4
#define JS_SET_TIMELIMIT 5
#define JS_GET_TIMELIMIT 6
#define JS_GET_ALL 7
#define JS_SET_ALL 8
struct JS_DATA_TYPE {
int buttons;
int x;
int y;
};
struct JS_DATA_SAVE_TYPE {
int JS_TIMEOUT;
int BUSY;
long JS_EXPIRETIME;
long JS_TIMELIMIT;
struct JS_DATA_TYPE JS_SAVE;
struct JS_DATA_TYPE JS_CORR;
};
/*
* Internal definitions
*/
#ifdef __KERNEL__
#define JS_BUFF_SIZE 64 /* output buffer size */
#include <linux/version.h>
#ifndef KERNEL_VERSION
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
#endif
#ifndef LINUX_VERSION_CODE
#error "You need to use at least 2.0 Linux kernel."
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,0,0)
#error "You need to use at least 2.0 Linux kernel."
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0)
#define JS_HAS_RDTSC (current_cpu_data.x86_capability & 0x10)
#include <linux/init.h>
#else
#ifdef MODULE
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,35)
#define JS_HAS_RDTSC (x86_capability & 0x10)
#else
#define JS_HAS_RDTSC 0
#endif
#else
#define JS_HAS_RDTSC (x86_capability & 0x10)
#endif
#define __initdata
#define __init
#define MODULE_AUTHOR(x)
#define MODULE_PARM(x,y)
#define MODULE_SUPPORTED_DEVICE(x)
#define signal_pending(x) (((x)->signal) & ~((x)->blocked))
#endif
/*
* Parport stuff
*/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0)
#define USE_PARPORT
#endif
#ifdef USE_PARPORT
#include <linux/parport.h>
#define JS_PAR_STATUS(y) parport_read_status(y->port)
#define JS_PAR_DATA_IN(y) parport_read_data(y->port)
#define JS_PAR_DATA_OUT(x,y) parport_write_data(y->port, x)
#define JS_PAR_CTRL_OUT(x,y) parport_write_control(y->port, x)
#else
#define JS_PAR_STATUS(y) inb(y+1)
#define JS_PAR_DATA_IN(y) inb(y)
#define JS_PAR_DATA_OUT(x,y) outb(x,y)
#define JS_PAR_CTRL_OUT(x,y) outb(x,y+2)
#endif
#define JS_PAR_STATUS_INVERT (0x80)
/*
* Internal types
*/
struct js_dev;
typedef int (*js_read_func)(void *info, int **axes, int **buttons);
typedef unsigned int (*js_time_func)(void);
typedef int (*js_delta_func)(unsigned int x, unsigned int y);
typedef int (*js_ops_func)(struct js_dev *dev);
struct js_data {
int *axes;
int *buttons;
};
struct js_dev {
struct js_dev *next;
struct js_list *list;
struct js_port *port;
struct wait_queue *wait;
struct js_data cur;
struct js_data new;
struct js_corr *corr;
struct js_event buff[JS_BUFF_SIZE];
js_ops_func open;
js_ops_func close;
int ahead;
int bhead;
int tail;
int num_axes;
int num_buttons;
char *name;
};
struct js_list {
struct js_list *next;
struct js_dev *dev;
int tail;
int startup;
};
struct js_port {
struct js_port *next;
struct js_port *prev;
js_read_func read;
struct js_dev **devs;
int **axes;
int **buttons;
struct js_corr **corr;
void *info;
int ndevs;
};
/*
* Sub-module interface
*/
extern unsigned int js_time_speed;
extern js_time_func js_get_time;
extern js_delta_func js_delta;
extern unsigned int js_time_speed_a;
extern js_time_func js_get_time_a;
extern js_delta_func js_delta_a;
extern struct js_port *js_register_port(struct js_port *port, void *info,
int devs, int infos, js_read_func read);
extern struct js_port *js_unregister_port(struct js_port *port);
extern int js_register_device(struct js_port *port, int number, int axes,
int buttons, char *name, js_ops_func open, js_ops_func close);
extern void js_unregister_device(struct js_dev *dev);
/*
* Kernel interface
*/
extern int js_init(void);
extern int js_am_init(void);
extern int js_an_init(void);
extern int js_as_init(void);
extern int js_console_init(void);
extern int js_db9_init(void);
extern int js_gr_init(void);
extern int js_l4_init(void);
extern int js_lt_init(void);
extern int js_sw_init(void);
extern int js_tm_init(void);
extern void js_am_setup(char *str, int *ints);
extern void js_an_setup(char *str, int *ints);
extern void js_as_setup(char *str, int *ints);
extern void js_console_setup(char *str, int *ints);
extern void js_db9_setup(char *str, int *ints);
extern void js_l4_setup(char *str, int *ints);
#endif /* __KERNEL__ */
#endif /* _LINUX_JOYSTICK_H */

33
arch/linux/include/music.h Executable file
View file

@ -0,0 +1,33 @@
#include <unistd.h>
#define SEQ_DEV "/dev/sequencer"
#define PLAYING 0
#define STOPPED 1
typedef struct
{
int position;
int status;
int time;
} Track_info;
typedef struct
{
signed short note;
signed short channel;
} Voice_info;
void seqbuf_dump();
int seq_init();
void seq_close();
void set_program(int, int);
void start_note(int, int, int);
void stop_note(int, int, int);
void set_control(int, int, int);
void set_pitchbend(int, int);
void set_chn_pressure(int,int);
void set_key_pressure(int,int,int);
void play_hmi (void * arg);
void send_ipc(char *);
void kill_ipc();

18
arch/linux/include/serial.h Executable file
View file

@ -0,0 +1,18 @@
// Name: Serial port support for Linux D1X
// Author: dph
// Date: Sun Oct 18, 1998
#ifndef _SERIAL_H
#define _SERIAL_H
void com_done(void);
int com_init(void);
int com_read(char *buffer, int len, int timeout_value);
int com_write(char *buffer, int len);
void com_port_hangup();
int com_getdcd();
void com_flushbuffers();
void com_setbaudrate(int rate);
int com_readline(int timeout, char *input_buffer,int len);
extern int commlib_initialised;
#endif

72
arch/linux/include/ukali.h Executable file
View file

@ -0,0 +1,72 @@
#ifndef __UKALI_H__
#define __UKALI_H__
//added on 10/04/98 by Matt Mueller to show correct ver in kali
#include "vers_id.h"
//end addition -MM
// 4213 is the port that KaliNix is listening on
//
// char code; // 1 == open, 2 == close, 3 == data, 5 == GetMyAddr
// acks // 6 == open, 7 == close 4 == GetMyAddr
// net data packets structure for send/recv
// struct {
// char code; == 3
// char sa_nodenum[6];
// char dport[2];
// char sport[2];
// char data[];
// }
// net data packets for open/close socket
//
// process_name is a null terminated 8byte string
// struct {
// char code; // 1/6 == open, 2/7 == close
// char socket[2];
// char pid[4];
// char process_name[9];
// }
// net myaddress struct which is returned after the GetMyAddress call
// struct {
// char code; == 4
// char sa_nodenum[6];
// }
// net data for GetMyAddress call
// struct {
// char code; == 5
// }
typedef struct kaliaddr_ipx_tag {
short sa_family;
char sa_netnum[4];
char sa_nodenum[6];
unsigned short sa_socket;
} kaliaddr_ipx;
// Process name that shows up in /whois and /games list.
// Maximum of 8 characters.
//edited on 10/04/98 by Matt Mueller to show correct ver in kali
#define KALI_PROCESS_NAME "D1X" D1XMAJOR D1XMINOR
//end edit -MM
#define MAX_PACKET_SIZE 1500
// struct ipx_helper ipx_kali = {
// ipx_kali_GetMyAddress,
// ipx_kali_OpenSocket,
// ipx_kali_CloseSocket,
// ipx_kali_SendPacket,
// ipx_kali_ReceivePacket,
// ipx_general_PacketReady
// };
int KaliGetNodeNum(kaliaddr_ipx *myaddr);
int KaliOpenSocket(unsigned short port);
int KaliCloseSocket(int hand);
int KaliSendPacket(int hand, char *data, int len, kaliaddr_ipx *to);
int KaliReceivePacket(int hand, char *data, int len, kaliaddr_ipx *from);
#endif

1967
arch/ogl/include/loadgl.h Executable file

File diff suppressed because it is too large Load diff

179
arch/ogl/include/ogl_init.h Executable file
View file

@ -0,0 +1,179 @@
//prototypes opengl functions - Added 9/15/99 Matthew Mueller
#ifndef _OGL_INIT_H_
#define _OGL_INIT_H_
#ifdef __WINDOWS__
#include <windows.h>
#include <stddef.h>
#endif
//#ifdef __WINDOWS__
//#define OGL_RUNTIME_LOAD
//#endif
#ifdef OGL_RUNTIME_LOAD
#include "loadgl.h"
int ogl_init_load_library(void);
#else
#include <GL/gl.h>
//######hack, since multi texture support is not working
#undef GL_ARB_multitexture
#undef GL_SGIS_multitexture
#endif
#ifndef GL_VERSION_1_1
#ifdef GL_EXT_texture
#define GL_INTENSITY4 GL_INTENSITY4_EXT
#define GL_INTENSITY8 GL_INTENSITY8_EXT
#endif
#endif
#include "gr.h"
#include "palette.h"
#include "types.h"
#define OGL_TEXTURE_LIST_SIZE 20000 // ZICO - works better than 2000
typedef struct _ogl_texture {
int handle;
GLint internalformat;
GLenum format;
int w,h,tw,th,lw;
int bytesu;
int bytes;
GLfloat u,v;
GLfloat prio;
int wrapstate;
fix lastrend;
ulong numrend;
char wantmip;
} ogl_texture;
extern ogl_texture ogl_texture_list[OGL_TEXTURE_LIST_SIZE];
extern int ogl_mem_target;
ogl_texture* ogl_get_free_texture(void);
void ogl_init_texture(ogl_texture* t);
void ogl_init_texture_list_internal(void);
void ogl_smash_texture_list_internal(void);
void ogl_vivify_texture_list_internal(void);
extern int ogl_fullscreen;
void ogl_do_fullscreen_internal(void);
extern int ogl_voodoohack;
extern int ogl_alttexmerge;//merge textures by just printing the seperate textures?
extern int ogl_rgba_format;
extern int ogl_intensity4_ok;
extern int ogl_luminance4_alpha4_ok;
extern int ogl_rgba2_ok;
extern int ogl_readpixels_ok;
extern int ogl_gettexlevelparam_ok;
#ifdef GL_ARB_multitexture
extern int ogl_arb_multitexture_ok;
#else
#define ogl_arb_multitexture_ok 0
#endif
#ifdef GL_SGIS_multitexture
extern int ogl_sgis_multitexture_ok;
#else
#define ogl_sgis_multitexture_ok 0
#endif
extern int gl_initialized;
extern int GL_texmagfilt,GL_texminfilt,GL_needmipmaps;
extern int gl_reticle;
extern int GL_TEXTURE_2D_enabled;
//extern int GL_texclamp_enabled;
//extern int GL_TEXTURE_ENV_MODE_state,GL_TEXTURE_MAG_FILTER_state,GL_TEXTURE_MIN_FILTER_state;
#define OGL_ENABLE2(a,f) {if (a ## _enabled!=1) {f;a ## _enabled=1;}}
#define OGL_DISABLE2(a,f) {if (a ## _enabled!=0) {f;a ## _enabled=0;}}
//#define OGL_ENABLE(a) OGL_ENABLE2(a,glEnable(a))
//#define OGL_DISABLE(a) OGL_DISABLE2(a,glDisable(a))
#define OGL_ENABLE(a) OGL_ENABLE2(GL_ ## a,glEnable(GL_ ## a))
#define OGL_DISABLE(a) OGL_DISABLE2(GL_ ## a,glDisable(GL_ ## a))
//#define OGL_TEXCLAMP() OGL_ENABLE2(GL_texclamp,glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);)
//#define OGL_TEXREPEAT() OGL_DISABLE2(GL_texclamp,glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);)
//#define OGL_SETSTATE(a,s,f) {if (a ## _state!=s) {f;a ## _state=s;}}
//#define OGL_TEXENV(p,m) OGL_SETSTATE(p,m,glTexEnvi(GL_TEXTURE_ENV, p,m));
//#define OGL_TEXPARAM(p,m) OGL_SETSTATE(p,m,glTexParameteri(GL_TEXTURE_2D,p,m));
extern int last_width,last_height;
#define OGL_VIEWPORT(x,y,w,h){if (w!=last_width || h!=last_height){glViewport(x,grd_curscreen->sc_canvas.cv_bitmap.bm_h-y-h,w,h);last_width=w;last_height=h;}}
//platform specific funcs
//MSVC seems to have problems with inline funcs not being found during linking
#ifndef _MSC_VER
inline
#endif
void ogl_swap_buffers_internal(void);
int ogl_init_window(int x, int y);//create a window/switch modes/etc
void ogl_destroy_window(void);//destroy window/etc
void ogl_init(void);//one time initialization
void ogl_close(void);//one time shutdown
//generic funcs
//#define OGLTEXBUFSIZE (1024*1024*4)
#define OGLTEXBUFSIZE (2048*2048*4)
extern GLubyte texbuf[OGLTEXBUFSIZE];
//void ogl_filltexbuf(unsigned char *data,GLubyte *texp,int width,int height,int twidth,int theight);
void ogl_filltexbuf(unsigned char *data,GLubyte *texp,int truewidth,int width,int height,int dxo,int dyo,int twidth,int theight,int type);
void ogl_loadbmtexture_m(grs_bitmap *bm,int domipmap);
void ogl_loadbmtexture(grs_bitmap *bm);
//void ogl_loadtexture(unsigned char * data, int width, int height,int dxo,int dyo, int *texid,float *u,float *v,char domipmap,float prio);
void ogl_loadtexture(unsigned char * data, int dxo,int dyo, ogl_texture *tex);
void ogl_freetexture(ogl_texture *gltexture);
void ogl_freebmtexture(grs_bitmap *bm);
void ogl_do_palfx(void);
void ogl_start_offscreen_render(int x, int y, int w, int h);
void ogl_end_offscreen_render(void);
void ogl_start_frame(void);
void ogl_end_frame(void);
void ogl_swap_buffers(void);
void ogl_set_screen_mode(void);
void ogl_cache_level_textures(void);
void ogl_urect(int left,int top,int right,int bot);
bool ogl_ubitmapm_c(int x, int y,grs_bitmap *bm,int c);
bool ogl_ubitmapm_cs(int x, int y,int dw, int dh, grs_bitmap *bm,int c, int scale, int orient);
bool ogl_ubitmapm(int x, int y,grs_bitmap *bm);
bool ogl_ubitblt_i(int dw,int dh,int dx,int dy, int sw, int sh, int sx, int sy, grs_bitmap * src, grs_bitmap * dest);
bool ogl_ubitblt(int w,int h,int dx,int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest);
bool ogl_ubitblt_tolinear(int w,int h,int dx,int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest);
bool ogl_ubitblt_copy(int w,int h,int dx,int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest);
void ogl_upixelc(int x, int y, int c);
void ogl_ulinec(int left,int top,int right,int bot,int c);
extern unsigned char *ogl_pal;
#include "3d.h"
bool g3_draw_tmap_2(int nv,g3s_point **pointlist,g3s_uvl *uvl_list,grs_bitmap *bmbot,grs_bitmap *bm,int orient);
void ogl_draw_reticle(int cross,int primary,int secondary);
//whee
//#define PAL2Tr(c) ((gr_palette[c*3]+gr_palette_gamma)/63.0)
//#define PAL2Tg(c) ((gr_palette[c*3+1]+gr_palette_gamma)/63.0)
//#define PAL2Tb(c) ((gr_palette[c*3+2]+gr_palette_gamma)/63.0)
//#define PAL2Tr(c) ((gr_palette[c*3])/63.0)
//#define PAL2Tg(c) ((gr_palette[c*3+1])/63.0)
//#define PAL2Tb(c) ((gr_palette[c*3+2])/63.0)
#define CPAL2Tr(c) ((gr_current_pal[c*3])/63.0)
#define CPAL2Tg(c) ((gr_current_pal[c*3+1])/63.0)
#define CPAL2Tb(c) ((gr_current_pal[c*3+2])/63.0)
#define PAL2Tr(c) ((ogl_pal[c*3])/63.0)
#define PAL2Tg(c) ((ogl_pal[c*3+1])/63.0)
#define PAL2Tb(c) ((ogl_pal[c*3+2])/63.0)
//inline GLfloat PAL2Tr(int c);
//inline GLfloat PAL2Tg(int c);
//inline GLfloat PAL2Tb(int c);
#endif

9
arch/sdl/include/event.h Executable file
View file

@ -0,0 +1,9 @@
// Event header file
#ifndef _EVENT_H
#define _EVENT_H
int event_init();
void event_poll();
#endif

6
arch/sdl/include/ipx_bsd.h Executable file
View file

@ -0,0 +1,6 @@
#ifndef _IPX_BSD_H
#define _IPX_BSD_H
#include "ipx_drv.h"
extern struct ipx_driver ipx_bsd;
#endif

28
arch/sdl/include/ipx_hlpr.h Executable file
View file

@ -0,0 +1,28 @@
#ifndef IPXHELPER_H_
#define IPXHELPER_H_
#include <sys/types.h>
#include "ipx_ldescent.h"
#define IPX_MANUAL_ADDRESS
struct ipx_recv_data {
/* all network order */
u_char src_network[4];
u_char src_node[6];
u_short src_socket;
u_short dst_socket;
int pkt_type;
};
struct ipx_helper {
int (*GetMyAddress)(void);
int (*OpenSocket)(ipx_socket_t *sk, int port);
void (*CloseSocket)(ipx_socket_t *mysock);
int (*SendPacket)(ipx_socket_t *mysock, IPXPacket_t *IPXHeader,
u_char *data, int dataLen);
int (*ReceivePacket)(ipx_socket_t *s, char *buffer, int bufsize,
struct ipx_recv_data *rec);
int (*PacketReady)(ipx_socket_t *s);
};
#endif /* IPXHELPER_H_ */

6
arch/sdl/include/ipx_kali.h Executable file
View file

@ -0,0 +1,6 @@
#ifndef _IPX_KALI_H
#define _IPX_KALI_H
#include "ipx_drv.h"
extern struct ipx_driver ipx_kali;
#endif

49
arch/sdl/include/ipx_ld.h Executable file
View file

@ -0,0 +1,49 @@
/*
* parts from:
* ipx.h header file for IPX for the DOS emulator
* Tim Bird, tbird@novell.com
*/
#ifndef _IPX_DOSEMU
#define _IPX_DOSEMU
#define MAX_PACKET_DATA 1500
typedef struct IPXAddressStruct {
u_char Network[4] __attribute__((packed));
u_char Node[6] __attribute__((packed));
u_char Socket[2] __attribute__((packed));
} IPXAddress_t;
typedef struct IPXPacketStructure {
u_short Checksum __attribute__((packed));
u_short Length __attribute__((packed));
u_char TransportControl __attribute__((packed));
u_char PacketType __attribute__((packed));
IPXAddress_t Destination __attribute__((packed));
IPXAddress_t Source __attribute__((packed));
} IPXPacket_t;
typedef struct ipx_socket_struct {
#ifdef DOSEMU
struct ipx_socket_struct *next;
far_t listenList;
int listenCount;
far_t AESList;
int AESCount;
u_short PSP;
#endif
u_short socket;
int fd;
} ipx_socket_t;
#include "mono.h"
#ifndef NMONO
#define n_printf(format, args...) _mprintf(1, format, ## args)
#else
#define n_printf(format, args...) fprintf(stderr,format, ## args)
#endif
#define enter_priv_on()
#define leave_priv_setting()
#endif

13
arch/sdl/include/ipx_lin.h Executable file
View file

@ -0,0 +1,13 @@
#ifndef IPX_LINUX_H_
#define IPX_LINUX_H_
#include <sys/types.h>
#include "ipx_helper.h"
int ipx_linux_GetMyAddress(void);
int ipx_linux_OpenSocket(ipx_socket_t *sk, int port);
void ipx_linux_CloseSocket(ipx_socket_t *mysock);
int ipx_linux_SendPacket(ipx_socket_t *mysock, IPXPacket_t *IPXHeader,
u_char *data, int dataLen);
int ipx_linux_ReceivePacket(ipx_socket_t *s, char *buffer, int bufsize,
struct ipx_recv_data *rd);
#endif

6
arch/sdl/include/ipx_udp.h Executable file
View file

@ -0,0 +1,6 @@
#ifndef _IPX_UDP_H
#define _IPX_UDP_H
#include "ipx_drv.h"
extern struct ipx_driver ipx_udp;
#endif

152
arch/sdl/include/joy.h Executable file
View file

@ -0,0 +1,152 @@
/*
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
*/
#ifndef _JOY_H
#define _JOY_H
#include "types.h"
#include "fix.h"
// added October 24, 2000 20:40 Steven Mueller: more than 4 joysticks now
#define MAX_JOY_DEVS 8
#define JOY_1_BUTTON_A 1
#define JOY_1_BUTTON_B 2
#define JOY_2_BUTTON_A 4
#define JOY_2_BUTTON_B 8
#define JOY_ALL_BUTTONS (1+2+4+8)
#define JOY_1_X_AXIS 1
#define JOY_1_Y_AXIS 2
#define JOY_2_X_AXIS 4
#define JOY_2_Y_AXIS 8
#define JOY_ALL_AXIS (1+2+4+8)
#define JOY_SLOW_READINGS 1
#define JOY_POLLED_READINGS 2
#define JOY_BIOS_READINGS 4
#define JOY_FRIENDLY_READINGS 8
#define MAX_AXES 32
#define MAX_BUTTONS 64
#define JOY_NUM_AXES 4
typedef struct joystick_device {
int device_number;
int version;
int buffer;
char num_buttons;
char num_axes;
} joystick_device;
typedef struct joystick_axis {
int value;
int min_val;
int center_val;
int max_val;
int joydev;
} joystick_axis;
typedef struct joystick_button {
ubyte state;
ubyte last_state;
//changed 6/24/1999 to finally squish the timedown bug - Owen Evans
fix timedown;
//end changed - OE
ubyte downcount;
int num;
int joydev;
} joystick_button;
//==========================================================================
// This initializes the joy and does a "quick" calibration which
// assumes the stick is centered and sets the minimum value to 0 and
// the maximum value to 2 times the centered reading. Returns 0 if no
// joystick was detected, 1 if everything is ok.
// joy_init() is called.
extern int joy_init();
extern void joy_close();
extern char joy_installed;
extern char joy_present;
extern int j_num_axes;
extern int j_num_buttons;
extern int joy_deadzone;
extern joystick_device j_joystick[MAX_JOY_DEVS];
extern joystick_axis j_axis[MAX_AXES];
extern joystick_button j_button[MAX_BUTTONS];
//==========================================================================
// The following 3 routines can be used to zero in on better joy
// calibration factors. To use them, ask the user to hold the stick
// in either the upper left, lower right, or center and then have them
// press a key or button and then call the appropriate one of these
// routines, and it will read the stick and update the calibration factors.
// Usually, assuming that the stick was centered when joy_init was
// called, you really only need to call joy_set_lr, since the upper
// left position is usually always 0,0 on most joys. But, the safest
// bet is to do all three, or let the user choose which ones to set.
extern void joy_set_cen();
//==========================================================================
// This reads the joystick. X and Y will be between -128 and 127.
// Takes about 1 millisecond in the worst case when the stick
// is in the lower right hand corner. Always returns 0,0 if no stick
// is present.
extern void joy_get_pos( int *x, int *y );
//==========================================================================
// This just reads the buttons and returns their status. When bit 0
// is 1, button 1 is pressed, when bit 1 is 1, button 2 is pressed.
extern int joy_get_btns();
//==========================================================================
// This returns the number of times a button went either down or up since
// the last call to this function.
extern int joy_get_button_up_cnt( int btn );
extern int joy_get_button_down_cnt( int btn );
//==========================================================================
// This returns how long (in approximate milliseconds) that each of the
// buttons has been held down since the last call to this function.
// It is the total time... say you pressed it down for 3 ticks, released
// it, and held it down for 6 more ticks. The time returned would be 9.
extern fix joy_get_button_down_time( int btn );
extern int j_Update_state ();
extern int j_Get_joydev_axis_number (int all_axis_number);
extern int j_Get_joydev_button_number (int all_button_number);
extern ubyte joystick_read_raw_axis( ubyte mask, int * axis );
extern void joy_flush();
extern ubyte joy_get_present_mask();
extern void joy_set_timer_rate(int max_value );
extern int joy_get_timer_rate();
extern int joy_get_button_state( int btn );
extern void joy_get_cal_vals(int *axis_min, int *axis_center, int *axis_max);
extern void joy_set_cal_vals(int *axis_min, int *axis_center, int *axis_max);
extern int joy_get_scaled_reading( int raw, int axn );
extern void joy_set_slow_reading( int flag );
extern void joy_set_min (int axis_number, int value);
extern void joy_set_center (int axis_number, int value);
extern void joy_set_max (int axis_number, int value);
#endif

265
arch/sdl/include/joystick.h Executable file
View file

@ -0,0 +1,265 @@
#ifndef _LINUX_JOYSTICK_H
#define _LINUX_JOYSTICK_H
/*
* /usr/include/linux/joystick.h Version 1.2
*
* Copyright (C) 1996-1998 Vojtech Pavlik
*/
#include <asm/types.h>
/*
* Version
*/
#define JS_VERSION 0x01020a
/*
* Types and constants for reading from /dev/js
*/
#define JS_EVENT_BUTTON 0x01 /* button pressed/released */
#define JS_EVENT_AXIS 0x02 /* joystick moved */
#define JS_EVENT_INIT 0x80 /* initial state of device */
struct js_event {
__u32 time; /* event timestamp in miliseconds */
__s16 value; /* value */
__u8 type; /* event type */
__u8 number; /* axis/button number */
};
/*
* IOCTL commands for joystick driver
*/
#define JSIOCGVERSION _IOR('j', 0x01, __u32) /* get driver version */
#define JSIOCGAXES _IOR('j', 0x11, __u8) /* get number of axes */
#define JSIOCGBUTTONS _IOR('j', 0x12, __u8) /* get number of buttons */
#define JSIOCGNAME(len) _IOC(_IOC_READ, 'j', 0x13, len) /* get identifier string */
#define JSIOCSCORR _IOW('j', 0x21, struct js_corr) /* set correction values */
#define JSIOCGCORR _IOR('j', 0x22, struct js_corr) /* get correction values */
/*
* Types and constants for get/set correction
*/
#define JS_CORR_NONE 0x00 /* returns raw values */
#define JS_CORR_BROKEN 0x01 /* broken line */
struct js_corr {
__s32 coef[8];
__s16 prec;
__u16 type;
};
/*
* v0.x compatibility definitions
*/
#define JS_RETURN sizeof(struct JS_DATA_TYPE)
#define JS_TRUE 1
#define JS_FALSE 0
#define JS_X_0 0x01
#define JS_Y_0 0x02
#define JS_X_1 0x04
#define JS_Y_1 0x08
#define JS_MAX 2
#define JS_DEF_TIMEOUT 0x1300
#define JS_DEF_CORR 0
#define JS_DEF_TIMELIMIT 10L
#define JS_SET_CAL 1
#define JS_GET_CAL 2
#define JS_SET_TIMEOUT 3
#define JS_GET_TIMEOUT 4
#define JS_SET_TIMELIMIT 5
#define JS_GET_TIMELIMIT 6
#define JS_GET_ALL 7
#define JS_SET_ALL 8
struct JS_DATA_TYPE {
int buttons;
int x;
int y;
};
struct JS_DATA_SAVE_TYPE {
int JS_TIMEOUT;
int BUSY;
long JS_EXPIRETIME;
long JS_TIMELIMIT;
struct JS_DATA_TYPE JS_SAVE;
struct JS_DATA_TYPE JS_CORR;
};
/*
* Internal definitions
*/
#ifdef __KERNEL__
#define JS_BUFF_SIZE 64 /* output buffer size */
#include <linux/version.h>
#ifndef KERNEL_VERSION
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
#endif
#ifndef LINUX_VERSION_CODE
#error "You need to use at least 2.0 Linux kernel."
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,0,0)
#error "You need to use at least 2.0 Linux kernel."
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0)
#define JS_HAS_RDTSC (current_cpu_data.x86_capability & 0x10)
#include <linux/init.h>
#else
#ifdef MODULE
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,35)
#define JS_HAS_RDTSC (x86_capability & 0x10)
#else
#define JS_HAS_RDTSC 0
#endif
#else
#define JS_HAS_RDTSC (x86_capability & 0x10)
#endif
#define __initdata
#define __init
#define MODULE_AUTHOR(x)
#define MODULE_PARM(x,y)
#define MODULE_SUPPORTED_DEVICE(x)
#define signal_pending(x) (((x)->signal) & ~((x)->blocked))
#endif
/*
* Parport stuff
*/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0)
#define USE_PARPORT
#endif
#ifdef USE_PARPORT
#include <linux/parport.h>
#define JS_PAR_STATUS(y) parport_read_status(y->port)
#define JS_PAR_DATA_IN(y) parport_read_data(y->port)
#define JS_PAR_DATA_OUT(x,y) parport_write_data(y->port, x)
#define JS_PAR_CTRL_OUT(x,y) parport_write_control(y->port, x)
#else
#define JS_PAR_STATUS(y) inb(y+1)
#define JS_PAR_DATA_IN(y) inb(y)
#define JS_PAR_DATA_OUT(x,y) outb(x,y)
#define JS_PAR_CTRL_OUT(x,y) outb(x,y+2)
#endif
#define JS_PAR_STATUS_INVERT (0x80)
/*
* Internal types
*/
struct js_dev;
typedef int (*js_read_func)(void *info, int **axes, int **buttons);
typedef unsigned int (*js_time_func)(void);
typedef int (*js_delta_func)(unsigned int x, unsigned int y);
typedef int (*js_ops_func)(struct js_dev *dev);
struct js_data {
int *axes;
int *buttons;
};
struct js_dev {
struct js_dev *next;
struct js_list *list;
struct js_port *port;
struct wait_queue *wait;
struct js_data cur;
struct js_data new;
struct js_corr *corr;
struct js_event buff[JS_BUFF_SIZE];
js_ops_func open;
js_ops_func close;
int ahead;
int bhead;
int tail;
int num_axes;
int num_buttons;
char *name;
};
struct js_list {
struct js_list *next;
struct js_dev *dev;
int tail;
int startup;
};
struct js_port {
struct js_port *next;
struct js_port *prev;
js_read_func read;
struct js_dev **devs;
int **axes;
int **buttons;
struct js_corr **corr;
void *info;
int ndevs;
};
/*
* Sub-module interface
*/
extern unsigned int js_time_speed;
extern js_time_func js_get_time;
extern js_delta_func js_delta;
extern unsigned int js_time_speed_a;
extern js_time_func js_get_time_a;
extern js_delta_func js_delta_a;
extern struct js_port *js_register_port(struct js_port *port, void *info,
int devs, int infos, js_read_func read);
extern struct js_port *js_unregister_port(struct js_port *port);
extern int js_register_device(struct js_port *port, int number, int axes,
int buttons, char *name, js_ops_func open, js_ops_func close);
extern void js_unregister_device(struct js_dev *dev);
/*
* Kernel interface
*/
extern int js_init(void);
extern int js_am_init(void);
extern int js_an_init(void);
extern int js_as_init(void);
extern int js_console_init(void);
extern int js_db9_init(void);
extern int js_gr_init(void);
extern int js_l4_init(void);
extern int js_lt_init(void);
extern int js_sw_init(void);
extern int js_tm_init(void);
extern void js_am_setup(char *str, int *ints);
extern void js_an_setup(char *str, int *ints);
extern void js_as_setup(char *str, int *ints);
extern void js_console_setup(char *str, int *ints);
extern void js_db9_setup(char *str, int *ints);
extern void js_l4_setup(char *str, int *ints);
#endif /* __KERNEL__ */
#endif /* _LINUX_JOYSTICK_H */

213
arch/sdl/include/key_arch.h Executable file
View file

@ -0,0 +1,213 @@
/*
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
*/
/*
* $Source: /cvsroot/dxx-rebirth/d1x-rebirth/arch/sdl/key_arch.h,v $
* $Revision: 1.1 $
* $Author: michaelstather $
* $Date: 2006/03/19 16:03:36 $
*
* Header for keyboard functions
*
* $Log: key_arch.h,v $
* Revision 1.1 2006/03/19 16:03:36 michaelstather
* *** empty log message ***
*
* Revision 1.1.1.1 2006/03/17 19:40:44 zicodxx
* initial import
*
* Revision 1.1 2000/01/17 05:58:38 donut
* switched from multiply reimplemented/reduntant/buggy key.c for each arch to a single main/key.c that calls the much smaller arch-specific parts. Also adds working emulated key repeat support.
*
* Revision 1.1.1.1 1999/06/14 22:02:01 donut
* Import of d1x 1.37 source.
*
* Revision 1.19 1994/10/24 13:58:12 john
* Hacked in support for pause key onto code 0x61.
*
* Revision 1.18 1994/10/21 15:17:10 john
* Added KEY_PRINT_SCREEN
*
* Revision 1.17 1994/08/31 12:22:13 john
* Added KEY_DEBUGGED
*
* Revision 1.16 1994/08/24 18:53:50 john
* Made Cyberman read like normal mouse; added dpmi module; moved
* mouse from assembly to c. Made mouse buttons return time_down.
*
* Revision 1.15 1994/08/18 14:56:16 john
* *** empty log message ***
*
* Revision 1.14 1994/08/08 10:43:24 john
* Recorded when a key was pressed for key_inkey_time.
*
* Revision 1.13 1994/06/17 17:17:28 john
* Added keyd_time_last_key_was_pressed or something like that.
*
* Revision 1.12 1994/04/29 12:14:19 john
* Locked all memory used during interrupts so that program
* won't hang when using virtual memory.
*
* Revision 1.11 1994/02/17 15:57:14 john
* Changed key libary to C.
*
* Revision 1.10 1994/01/31 08:34:09 john
* Fixed reversed lshift/rshift keys.
*
* Revision 1.9 1994/01/18 10:58:17 john
* *** empty log message ***
*
* Revision 1.8 1993/10/16 19:24:43 matt
* Added new function key_clear_times() & key_clear_counts()
*
* Revision 1.7 1993/10/15 10:17:09 john
* added keyd_last_key_pressed and released for use with recorder.
*
* Revision 1.6 1993/10/06 16:20:37 john
* fixed down arrow bug
*
* Revision 1.5 1993/10/04 13:26:42 john
* changed the #defines for scan codes.
*
* Revision 1.4 1993/09/28 11:35:20 john
* added key_peekkey
*
* Revision 1.3 1993/09/20 18:36:43 john
* *** empty log message ***
*
* Revision 1.1 1993/07/10 13:10:39 matt
* Initial revision
*
*
*/
#ifndef _SDL_KEY_H
#define _SDL_KEY_H
#include <SDL/SDL.h>
#define ARCH_KEY_0 SDLK_0
#define ARCH_KEY_1 SDLK_1
#define ARCH_KEY_2 SDLK_2
#define ARCH_KEY_3 SDLK_3
#define ARCH_KEY_4 SDLK_4
#define ARCH_KEY_5 SDLK_5
#define ARCH_KEY_6 SDLK_6
#define ARCH_KEY_7 SDLK_7
#define ARCH_KEY_8 SDLK_8
#define ARCH_KEY_9 SDLK_9
#define ARCH_KEY_A SDLK_a
#define ARCH_KEY_B SDLK_b
#define ARCH_KEY_C SDLK_c
#define ARCH_KEY_D SDLK_d
#define ARCH_KEY_E SDLK_e
#define ARCH_KEY_F SDLK_f
#define ARCH_KEY_G SDLK_g
#define ARCH_KEY_H SDLK_h
#define ARCH_KEY_I SDLK_i
#define ARCH_KEY_J SDLK_j
#define ARCH_KEY_K SDLK_k
#define ARCH_KEY_L SDLK_l
#define ARCH_KEY_M SDLK_m
#define ARCH_KEY_N SDLK_n
#define ARCH_KEY_O SDLK_o
#define ARCH_KEY_P SDLK_p
#define ARCH_KEY_Q SDLK_q
#define ARCH_KEY_R SDLK_r
#define ARCH_KEY_S SDLK_s
#define ARCH_KEY_T SDLK_t
#define ARCH_KEY_U SDLK_u
#define ARCH_KEY_V SDLK_v
#define ARCH_KEY_W SDLK_w
#define ARCH_KEY_X SDLK_x
#define ARCH_KEY_Y SDLK_y
#define ARCH_KEY_Z SDLK_z
#define ARCH_KEY_MINUS SDLK_MINUS
#define ARCH_KEY_EQUAL SDLK_EQUALS
#define ARCH_KEY_DIVIDE SDLK_SLASH
#define ARCH_KEY_SLASH SDLK_BACKSLASH
#define ARCH_KEY_COMMA SDLK_COMMA
#define ARCH_KEY_PERIOD SDLK_PERIOD
#define ARCH_KEY_SEMICOL SDLK_SEMICOLON
#define ARCH_KEY_LBRACKET SDLK_LEFTBRACKET
#define ARCH_KEY_RBRACKET SDLK_RIGHTBRACKET
#define ARCH_KEY_RAPOSTRO SDLK_QUOTE
#define ARCH_KEY_LAPOSTRO SDLK_BACKQUOTE
#define ARCH_KEY_ESC SDLK_ESCAPE
#define ARCH_KEY_ENTER SDLK_RETURN
#define ARCH_KEY_BACKSP SDLK_BACKSPACE
#define ARCH_KEY_TAB SDLK_TAB
#define ARCH_KEY_SPACEBAR SDLK_SPACE
#define ARCH_KEY_NUMLOCK SDLK_NUMLOCK
#define ARCH_KEY_SCROLLOCK SDLK_SCROLLOCK
#define ARCH_KEY_CAPSLOCK SDLK_CAPSLOCK
#define ARCH_KEY_LSHIFT SDLK_LSHIFT
#define ARCH_KEY_RSHIFT SDLK_RSHIFT
#define ARCH_KEY_LALT SDLK_LALT
#define ARCH_KEY_RALT SDLK_RALT
#define ARCH_KEY_LCTRL SDLK_LCTRL
#define ARCH_KEY_RCTRL SDLK_RCTRL
#define ARCH_KEY_F1 SDLK_F1
#define ARCH_KEY_F2 SDLK_F2
#define ARCH_KEY_F3 SDLK_F3
#define ARCH_KEY_F4 SDLK_F4
#define ARCH_KEY_F5 SDLK_F5
#define ARCH_KEY_F6 SDLK_F6
#define ARCH_KEY_F7 SDLK_F7
#define ARCH_KEY_F8 SDLK_F8
#define ARCH_KEY_F9 SDLK_F9
#define ARCH_KEY_F10 SDLK_F10
#define ARCH_KEY_F11 SDLK_F11
#define ARCH_KEY_F12 SDLK_F12
#define ARCH_KEY_PAD0 SDLK_KP0
#define ARCH_KEY_PAD1 SDLK_KP1
#define ARCH_KEY_PAD2 SDLK_KP2
#define ARCH_KEY_PAD3 SDLK_KP3
#define ARCH_KEY_PAD4 SDLK_KP4
#define ARCH_KEY_PAD5 SDLK_KP5
#define ARCH_KEY_PAD6 SDLK_KP6
#define ARCH_KEY_PAD7 SDLK_KP7
#define ARCH_KEY_PAD8 SDLK_KP8
#define ARCH_KEY_PAD9 SDLK_KP9
#define ARCH_KEY_PADMINUS SDLK_KP_MINUS
#define ARCH_KEY_PADPLUS SDLK_KP_PLUS
#define ARCH_KEY_PADPERIOD SDLK_KP_PERIOD
#define ARCH_KEY_PADDIVIDE SDLK_KP_DIVIDE
#define ARCH_KEY_PADMULTIPLY SDLK_KP_MULTIPLY
#define ARCH_KEY_PADENTER SDLK_KP_ENTER
#define ARCH_KEY_INSERT SDLK_INSERT
#define ARCH_KEY_HOME SDLK_HOME
#define ARCH_KEY_PAGEUP SDLK_PAGEUP
#define ARCH_KEY_DELETE SDLK_DELETE
#define ARCH_KEY_END SDLK_END
#define ARCH_KEY_PAGEDOWN SDLK_PAGEDOWN
#define ARCH_KEY_UP SDLK_UP
#define ARCH_KEY_DOWN SDLK_DOWN
#define ARCH_KEY_LEFT SDLK_LEFT
#define ARCH_KEY_RIGHT SDLK_RIGHT
#define ARCH_KEY_PRINT_SCREEN SDLK_PRINT
#define ARCH_KEY_PAUSE SDLK_PAUSE
#endif

133
arch/sdl/include/mouse.h Executable file
View file

@ -0,0 +1,133 @@
/*
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
*/
/*
* $Source: /cvsroot/dxx-rebirth/d1x-rebirth/arch/sdl/mouse.h,v $
* $Revision: 1.1 $
* $Author: michaelstather $
* $Date: 2006/03/19 16:03:36 $
*
* Header for mouse functions
*
* $Log: mouse.h,v $
* Revision 1.1 2006/03/19 16:03:36 michaelstather
* *** empty log message ***
*
* Revision 1.1.1.1 2006/03/17 19:40:44 zicodxx
* initial import
*
* Revision 1.1.1.1 1999/06/14 22:02:02 donut
* Import of d1x 1.37 source.
*
* Revision 1.10 1995/02/02 10:22:29 john
* Added cyberman init parameter.
*
* Revision 1.9 1994/11/18 23:18:09 john
* Changed some shorts to ints.
*
* Revision 1.8 1994/09/13 12:33:49 john
* Added functions to get down count and state.
*
* Revision 1.7 1994/08/29 20:52:20 john
* Added better cyberman support; also, joystick calibration
* value return funcctiionn,
*
* Revision 1.6 1994/08/24 17:54:35 john
* *** empty log message ***
*
* Revision 1.5 1994/08/24 17:51:43 john
* Added transparent cyberman support
*
* Revision 1.4 1993/07/27 09:32:22 john
* *** empty log message ***
*
* Revision 1.3 1993/07/26 10:46:44 john
* added definition for mouse_set_pos
*
* Revision 1.2 1993/07/22 13:07:59 john
* added header for mousesetlimts
*
* Revision 1.1 1993/07/10 13:10:40 matt
* Initial revision
*
*
*/
#ifndef MOUSE_H
#define MOUSE_H
#include "types.h"
#include "fix.h"
#define MOUSE_MAX_BUTTONS 8
#define MB_LEFT 0
#define MB_RIGHT 1
#define MB_MIDDLE 2
#define MB_Z_UP 3
#define MB_Z_DOWN 4
#define MB_PITCH_BACKWARD 5
#define MB_PITCH_FORWARD 6
#define MB_BANK_LEFT 7
#define MB_BANK_RIGHT 8
#define MB_HEAD_LEFT 9
#define MB_HEAD_RIGHT 10
#define MOUSE_LBTN 1
#define MOUSE_RBTN 2
#define MOUSE_MBTN 4
#undef NOMOUSE
#ifndef NOMOUSE
//========================================================================
// Check for mouse driver, reset driver if installed. returns number of
// buttons if driver is present.
extern int mouse_set_limits( int x1, int y1, int x2, int y2 );
extern void mouse_flush(); // clears all mice events...
//========================================================================
extern void mouse_get_pos( int *x, int *y);
extern void mouse_get_delta( int *dx, int *dy );
extern int mouse_get_btns();
extern void mouse_set_pos( int x, int y);
extern void mouse_get_cyberman_pos( int *x, int *y );
// Returns how long this button has been down since last call.
extern fix mouse_button_down_time(int button);
// Returns how many times this button has went down since last call.
extern int mouse_button_down_count(int button);
// Returns 1 if this button is currently down
extern int mouse_button_state(int button);
#else
// 'Neutered' functions... :-)
#define mouse_init(a) -1
#define mouse_set_limits(a,b,c,d) -1
#define mouse_flush()
#define mouse_close()
#define mouse_get_pos(a,b)
#define mouse_get_delta(a,b)
#define mouse_get_btns() 0
#define mouse_set_pos(a,b)
#define mouse_get_cyberman_pos(a,b)
#define mouse_button_down_time(a) 0
#define mouse_button_down_count(a) 0
#define mouse_button_state(a) 0
#endif
#endif

33
arch/sdl/include/music.h Executable file
View file

@ -0,0 +1,33 @@
#include <unistd.h>
#define SEQ_DEV "/dev/sequencer"
#define PLAYING 0
#define STOPPED 1
typedef struct
{
int position;
int status;
int time;
} Track_info;
typedef struct
{
signed short note;
signed short channel;
} Voice_info;
void seqbuf_dump();
int seq_init();
void seq_close();
void set_program(int, int);
void start_note(int, int, int);
void stop_note(int, int, int);
void set_control(int, int, int);
void set_pitchbend(int, int);
void set_chn_pressure(int,int);
void set_key_pressure(int,int,int);
void play_hmi (void * arg);
void send_ipc(char *);
void kill_ipc();

18
arch/sdl/include/serial.h Executable file
View file

@ -0,0 +1,18 @@
// Name: Serial port support for Linux D1X
// Author: dph
// Date: Sun Oct 18, 1998
#ifndef _SERIAL_H
#define _SERIAL_H
void com_done(void);
int com_init(void);
int com_read(char *buffer, int len, int timeout_value);
int com_write(char *buffer, int len);
void com_port_hangup();
int com_getdcd();
void com_flushbuffers();
void com_setbaudrate(int rate);
int com_readline(int timeout, char *input_buffer,int len);
extern int commlib_initialised;
#endif

72
arch/sdl/include/ukali.h Executable file
View file

@ -0,0 +1,72 @@
#ifndef __UKALI_H__
#define __UKALI_H__
//added on 10/04/98 by Matt Mueller to show correct ver in kali
#include "vers_id.h"
//end addition -MM
// 4213 is the port that KaliNix is listening on
//
// char code; // 1 == open, 2 == close, 3 == data, 5 == GetMyAddr
// acks // 6 == open, 7 == close 4 == GetMyAddr
// net data packets structure for send/recv
// struct {
// char code; == 3
// char sa_nodenum[6];
// char dport[2];
// char sport[2];
// char data[];
// }
// net data packets for open/close socket
//
// process_name is a null terminated 8byte string
// struct {
// char code; // 1/6 == open, 2/7 == close
// char socket[2];
// char pid[4];
// char process_name[9];
// }
// net myaddress struct which is returned after the GetMyAddress call
// struct {
// char code; == 4
// char sa_nodenum[6];
// }
// net data for GetMyAddress call
// struct {
// char code; == 5
// }
typedef struct kaliaddr_ipx_tag {
short sa_family;
char sa_netnum[4];
char sa_nodenum[6];
unsigned short sa_socket;
} kaliaddr_ipx;
// Process name that shows up in /whois and /games list.
// Maximum of 8 characters.
//edited on 10/04/98 by Matt Mueller to show correct ver in kali
#define KALI_PROCESS_NAME "D1X" D1XMAJOR D1XMINOR
//end edit -MM
#define MAX_PACKET_SIZE 1500
// struct ipx_helper ipx_kali = {
// ipx_kali_GetMyAddress,
// ipx_kali_OpenSocket,
// ipx_kali_CloseSocket,
// ipx_kali_SendPacket,
// ipx_kali_ReceivePacket,
// ipx_general_PacketReady
// };
int KaliGetNodeNum(kaliaddr_ipx *myaddr);
int KaliOpenSocket(unsigned short port);
int KaliCloseSocket(int hand);
int KaliSendPacket(int hand, char *data, int len, kaliaddr_ipx *to);
int KaliReceivePacket(int hand, char *data, int len, kaliaddr_ipx *from);
#endif