main/kconfig.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <ctype.h>
#include "error.h"
#include "types.h"
#include "gr.h"
#include "mono.h"
#include "key.h"
#include "palette.h"
#include "game.h"
#include "gamefont.h"
#include "iff.h"
#include "u_mem.h"
#include "joy.h"
#include "mouse.h"
#include "kconfig.h"
#include "gauges.h"
#include "joydefs.h"
#include "render.h"
#include "digi.h"
#include "newmenu.h"
#include "endlevel.h"
#include "multi.h"
#include "timer.h"
#include "text.h"
#include "player.h"
#include "menu.h"
#include "args.h"
#include "reorder.h"
#include "d_delay.h"
#include "physics.h"
#include "vlcnfire.h"
#include "screens.h"

Classes

struct  kc_item

Defines

#define TABLE_CREATION
#define BT_KEY   0
#define BT_MOUSE_BUTTON   1
#define BT_MOUSE_AXIS   2
#define BT_JOY_BUTTON   3
#define BT_JOY_AXIS   4
#define BT_INVERT   5
#define INFO_Y   (188*scale)
#define PH_SCALE   8
#define JOYSTICK_READ_TIME   (F1_0/10)

Functions

void kc_drawitem (kc_item *item, int is_current)
void kc_change_key (kc_item *item)
void kc_change_joybutton (kc_item *item)
void kc_change_mousebutton (kc_item *item)
void kc_change_joyaxis (kc_item *item)
void kc_change_mouseaxis (kc_item *item)
void kc_change_invert (kc_item *item)
void kconfig_read_fcs (int raw_axis)
void kconfig_set_fcs_button (int btn, int button)
int isJoyRotationKey (int test_key)
int isMouseRotationKey (int test_key)
int isKeyboardRotationKey (int test_key)
int kconfig_is_axes_used (int axis)
int find_item_at (kc_item *items, int nitems, int x, int y)
int find_next_item_up (kc_item *items, int nitems, int citem)
int find_next_item_down (kc_item *items, int nitems, int citem)
int find_next_item_right (kc_item *items, int nitems, int citem)
int find_next_item_left (kc_item *items, int nitems, int citem)
void kconfig_sub (kc_item *items, int nitems, char *title)
void kc_drawquestion (kc_item *item)
void kconfig (int n, char *title)
void kconfig_init_external_controls (int intno, ssize_t address)
void kconfig_read_external_controls ()
void controls_read_all ()
void reset_cruise (void)
void kc_set_controls ()

Variables

byte fades [64] = { 1,1,1,2,2,3,4,4,5,6,8,9,10,12,13,15,16,17,19,20,22,23,24,26,27,28,28,29,30,30,31,31,31,31,31,30,30,29,28,28,27,26,24,23,22,20,19,17,16,15,13,12,10,9,8,6,5,4,4,3,2,2,1,1 }
int invert_text [2] = { TNUM_N, TNUM_Y }
char * joybutton_text [JOY_MAX_BUTTONS]
char * joyaxis_text [JOY_MAX_AXES]
int mouseaxis_text [3] = { TNUM_L_R, TNUM_F_B, "Z1" }
int mousebutton_text [3] = { TNUM_LEFT, TNUM_RIGHT, TNUM_MID }
char * mousebutton_textra [13] = { "M4", "M5", "M6", "M7", "M8", "M9", "M10","M11","M12","M13","M14","M15","M16" }
ubyte system_keys [] = { KEY_ESC, KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5, KEY_F6, KEY_F7, KEY_F8, KEY_F9, KEY_F10, KEY_F11, KEY_F12, KEY_MINUS, KEY_EQUAL, KEY_PRINT_SCREEN }
control_info Controls
ubyte Config_digi_volume = 16
ubyte Config_midi_volume = 16
ubyte Config_control_type = 0
ubyte Config_channels_reversed = 0
ubyte Config_joystick_sensitivity = 8
fix Cruise_speed = 0
int Allow_primary_cycle = 1
int Allow_secondary_cycle = 1
char * btype_text [] = { "BT_KEY", "BT_MOUSE_BUTTON", "BT_MOUSE_AXIS", "BT_JOY_BUTTON", "BT_JOY_AXIS", "BT_INVERT" }
int Num_items = 23
kc_itemAll_items
ubyte kconfig_settings [CONTROL_MAX_TYPES][MAX_CONTROLS]
ubyte kconfig_d1x_settings [MAX_D1X_CONTROLS]
ubyte default_kconfig_settings [CONTROL_MAX_TYPES][MAX_CONTROLS]
ubyte default_kconfig_d1x_settings [MAX_D1X_CONTROLS]
kc_item kc_keyboard [NUM_ALL_KEY_CONTROLS]
kc_item kc_joystick [NUM_ALL_OTHER_CONTROLS]
kc_item kc_mouse [NUM_OTHER_CONTROLS]
kc_item kc_d1x [NUM_D1X_CONTROLS]
static float scale = 1.0
static int looper = 0
fix LastReadTime = 0
fix joy_axis [JOY_NUM_AXES]
ubyte kc_use_external_control = 0
ubyte kc_enable_external_control = 1
ubyte kc_external_intno = 0
control_infokc_external_control = NULL
ubytekc_external_name = NULL
ubyte kc_external_version = 0
int Allow_primary_cycle_ostate = 0
int Allow_secondary_cycle_ostate = 0
int d1x_joystick_ostate [20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
int Vulcan_kostate = 0
int Vulcan_jostate = 0
int Vulcan_mostate = 0

Define Documentation

#define BT_INVERT   5
 

#define BT_JOY_AXIS   4
 

#define BT_JOY_BUTTON   3
 

#define BT_KEY   0
 

#define BT_MOUSE_AXIS   2
 

#define BT_MOUSE_BUTTON   1
 

#define INFO_Y   (188*scale)
 

#define JOYSTICK_READ_TIME   (F1_0/10)
 

#define PH_SCALE   8
 

#define TABLE_CREATION
 


Function Documentation

void controls_read_all  ) 
 

added/killed on 2/4/99 by Victor Rachels for d1x keys

int find_item_at kc_item items,
int  nitems,
int  x,
int  y
 

int find_next_item_down kc_item items,
int  nitems,
int  citem
 

int find_next_item_left kc_item items,
int  nitems,
int  citem
 

int find_next_item_right kc_item items,
int  nitems,
int  citem
 

int find_next_item_up kc_item items,
int  nitems,
int  citem
 

int isJoyRotationKey int  test_key  ) 
 

int isKeyboardRotationKey int  test_key  ) 
 

int isMouseRotationKey int  test_key  ) 
 

void kc_change_invert kc_item item  ) 
 

void kc_change_joyaxis kc_item item  ) 
 

void kc_change_joybutton kc_item item  ) 
 

void kc_change_key kc_item item  ) 
 

void kc_change_mouseaxis kc_item item  ) 
 

void kc_change_mousebutton kc_item item  ) 
 

void kc_drawitem kc_item item,
int  is_current
 

void kc_drawquestion kc_item item  ) 
 

void kc_set_controls  ) 
 

void kconfig int  n,
char *  title
 

void kconfig_init_external_controls int  intno,
ssize_t  address
 

int kconfig_is_axes_used int  axis  ) 
 

void kconfig_read_external_controls  ) 
 

void kconfig_read_fcs int  raw_axis  ) 
 

void kconfig_set_fcs_button int  btn,
int  button
 

void kconfig_sub kc_item items,
int  nitems,
char *  title
 

void reset_cruise void   ) 
 


Variable Documentation

kc_item* All_items
 

int Allow_primary_cycle = 1
 

int Allow_primary_cycle_ostate = 0
 

int Allow_secondary_cycle = 1
 

int Allow_secondary_cycle_ostate = 0
 

char* btype_text[] = { "BT_KEY", "BT_MOUSE_BUTTON", "BT_MOUSE_AXIS", "BT_JOY_BUTTON", "BT_JOY_AXIS", "BT_INVERT" }
 

ubyte Config_channels_reversed = 0
 

ubyte Config_control_type = 0
 

ubyte Config_digi_volume = 16
 

ubyte Config_joystick_sensitivity = 8
 

ubyte Config_midi_volume = 16
 

control_info Controls
 

fix Cruise_speed = 0
 

int d1x_joystick_ostate[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
 

ubyte default_kconfig_d1x_settings[MAX_D1X_CONTROLS]
 

Initial value:

 {
 0x2 ,0xff,0x3 ,0xff,0x4 ,0xff,0x5 ,0xff,0x6 ,0xff,0x7 ,0xff,0x8 ,0xff,0x9 ,
 0xff,0xa ,0xff,0xb ,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff }

ubyte default_kconfig_settings[CONTROL_MAX_TYPES][MAX_CONTROLS]
 

byte fades[64] = { 1,1,1,2,2,3,4,4,5,6,8,9,10,12,13,15,16,17,19,20,22,23,24,26,27,28,28,29,30,30,31,31,31,31,31,30,30,29,28,28,27,26,24,23,22,20,19,17,16,15,13,12,10,9,8,6,5,4,4,3,2,2,1,1 }
 

int invert_text[2] = { TNUM_N, TNUM_Y }
 

fix joy_axis[JOY_NUM_AXES]
 

char* joyaxis_text[JOY_MAX_AXES]
 

char* joybutton_text[JOY_MAX_BUTTONS]
 

kc_item kc_d1x[NUM_D1X_CONTROLS]
 

ubyte kc_enable_external_control = 1
 

control_info* kc_external_control = NULL
 

ubyte kc_external_intno = 0
 

ubyte* kc_external_name = NULL
 

ubyte kc_external_version = 0
 

kc_item kc_joystick[NUM_ALL_OTHER_CONTROLS]
 

Initial value:

 {
        {  0, 25, 46, 85, 26, 15,  1, 24,  5,TNUM_FIRE_PRIMARY, BT_JOY_BUTTON, 255 },
        {  1, 25, 54, 85, 26,  0,  4,  5,  6,TNUM_FIRE_SECONDARY, BT_JOY_BUTTON, 255 },
        {  2, 25, 82, 85, 26, 26,  3,  9,  3,TNUM_ACCELERATE, BT_JOY_BUTTON, 255 },
        {  3, 25, 90, 85, 26,  2, 25,  2, 10,TNUM_REVERSE, BT_JOY_BUTTON, 255 },
        {  4, 25, 62, 85, 26,  1, 26,  6,  7,TNUM_FIRE_FLARE, BT_JOY_BUTTON, 255 },
        {  5,180, 46, 59, 26, 23,  6,  0,  1,TNUM_SLIDE_ON, BT_JOY_BUTTON, 255 },
        {  6,180, 54, 59, 26,  5,  7,  1,  4,TNUM_SLIDE_LEFT, BT_JOY_BUTTON, 255 },
        {  7,180, 62, 59, 26,  6,  8,  4, 26,TNUM_SLIDE_RIGHT, BT_JOY_BUTTON, 255 },
        {  8,180, 70, 59, 26,  7,  9, 26,  9,TNUM_SLIDE_UP, BT_JOY_BUTTON, 255 },
        {  9,180, 78, 59, 26,  8, 10,  8,  2,TNUM_SLIDE_DOWN, BT_JOY_BUTTON, 255 },
        { 10,180, 90, 59, 26,  9, 11,  3, 11,TNUM_BANK_ON, BT_JOY_BUTTON, 255 },
        { 11,180, 98, 59, 26, 10, 12, 10, 25,TNUM_BANK_LEFT, BT_JOY_BUTTON, 255 },
        { 12,180,106, 59, 26, 11, 18, 25, 13,TNUM_BANK_RIGHT, BT_JOY_BUTTON, 255 },
        { 13, 22,146, 51, 26, 24, 15, 12, 14,TNUM_PITCH_UD, BT_JOY_AXIS, 255 },
        { 14, 22,146, 99,  8, 25, 16, 13, 17,TNUM_PITCH_UD, BT_INVERT, 255 },
        { 15, 22,154, 51, 26, 13,  0, 18, 16,TNUM_TURN_LR, BT_JOY_AXIS, 255 },
        { 16, 22,154, 99,  8, 14, 17, 15, 19,TNUM_TURN_LR, BT_INVERT, 255 },
        { 17,164,146, 58, 26, 16, 19, 14, 18,TNUM_SLIDE_LR, BT_JOY_AXIS, 255 },
        { 18,164,146,106,  8, 12, 20, 17, 15,TNUM_SLIDE_LR, BT_INVERT, 255 },
        { 19,164,154, 58, 26, 17, 21, 16, 20,TNUM_SLIDE_UD, BT_JOY_AXIS, 255 },
        { 20,164,154,106,  8, 18, 22, 19, 21,TNUM_SLIDE_UD, BT_INVERT, 255 },
        { 21,164,162, 58, 26, 19, 23, 20, 22,TNUM_BANK_LR, BT_JOY_AXIS, 255 },
        { 22,164,162,106,  8, 20, 24, 21, 23,TNUM_BANK_LR, BT_INVERT, 255 },
        { 23,164,174, 58, 26, 21,  5, 22, 24,TNUM_THROTTLE, BT_JOY_AXIS, 255 },
        { 24,164,174,106,  8, 22, 13, 23,  0,TNUM_THROTTLE, BT_INVERT, 255 },
        { 25, 25,102, 85, 26,  3, 14, 11, 12,TNUM_REAR_VIEW, BT_JOY_BUTTON, 255 },
        { 26, 25, 70, 85, 26,  4,  2,  7,  8,TNUM_DROP_BOMB, BT_JOY_BUTTON, 255 },
}

kc_item kc_keyboard[NUM_ALL_KEY_CONTROLS]
 

kc_item kc_mouse[NUM_OTHER_CONTROLS]
 

Initial value:

 {
        {  0, 25, 46, 85, 26, 12,  1, 24,  5,TNUM_FIRE_PRIMARY, BT_MOUSE_BUTTON, 255 },
        {  1, 25, 54, 85, 26,  0,  4,  5,  6,TNUM_FIRE_SECONDARY, BT_MOUSE_BUTTON, 255 },
        {  2, 25, 85, 85, 26, 26,  3,  9, 10,TNUM_ACCELERATE, BT_MOUSE_BUTTON, 255 },
        {  3, 25, 93, 85, 26,  2, 25, 10, 11,TNUM_REVERSE, BT_MOUSE_BUTTON, 255 },
        {  4, 25, 62, 85, 26,  1, 26,  6,  7,TNUM_FIRE_FLARE, BT_MOUSE_BUTTON, 255 },
        {  5,180, 46, 59, 26, 24,  6,  0,  1,TNUM_SLIDE_ON, BT_MOUSE_BUTTON, 255 },
        {  6,180, 54, 59, 26,  5,  7,  1,  4,TNUM_SLIDE_LEFT, BT_MOUSE_BUTTON, 255 },
        {  7,180, 62, 59, 26,  6,  8,  4, 26,TNUM_SLIDE_RIGHT, BT_MOUSE_BUTTON, 255 },
        {  8,180, 70, 59, 26,  7,  9, 26,  9,TNUM_SLIDE_UP, BT_MOUSE_BUTTON, 255 },
        {  9,180, 78, 59, 26,  8, 10,  8,  2,TNUM_SLIDE_DOWN, BT_MOUSE_BUTTON, 255 },
        { 10,180, 90, 59, 26,  9, 11,  2,  3,TNUM_BANK_ON, BT_MOUSE_BUTTON, 255 },
        { 11,180, 98, 59, 26, 10, 12,  3, 12,TNUM_BANK_LEFT, BT_MOUSE_BUTTON, 255 },
        { 12,180,106, 59, 26, 11,  0, 11, 25,TNUM_BANK_RIGHT, BT_MOUSE_BUTTON, 255 },
        { 13,103,138, 58, 26, 25, 15, 25, 14,TNUM_PITCH_UD, BT_MOUSE_AXIS, 255 },
        { 14,103,138,106,  8, 23, 16, 13, 15,TNUM_PITCH_UD, BT_INVERT, 255 },
        { 15,103,146, 58, 26, 13, 17, 14, 16,TNUM_TURN_LR, BT_MOUSE_AXIS, 255 },
        { 16,103,146,106,  8, 14, 18, 15, 17,TNUM_TURN_LR, BT_INVERT, 255 },
        { 17,103,154, 58, 26, 15, 19, 16, 18,TNUM_SLIDE_LR, BT_MOUSE_AXIS, 255 },
        { 18,103,154,106,  8, 16, 20, 17, 19,TNUM_SLIDE_LR, BT_INVERT, 255 },
        { 19,103,162, 58, 26, 17, 21, 18, 20,TNUM_SLIDE_UD, BT_MOUSE_AXIS, 255 },
        { 20,103,162,106,  8, 18, 22, 19, 21,TNUM_SLIDE_UD, BT_INVERT, 255 },
        { 21,103,170, 58, 26, 19, 23, 20, 22,TNUM_BANK_LR, BT_MOUSE_AXIS, 255 },
        { 22,103,170,106,  8, 20, 24, 21, 23,TNUM_BANK_LR, BT_INVERT, 255 },
        { 23,103,182, 58, 26, 21, 14, 22, 24,TNUM_THROTTLE, BT_MOUSE_AXIS, 255 },
        { 24,103,182,106,  8, 22,  5, 23,  0,TNUM_THROTTLE, BT_INVERT, 255 },
        { 25, 25,109, 85, 26,  3, 13, 12, 13,TNUM_REAR_VIEW, BT_MOUSE_BUTTON, 255 },
        { 26, 25, 70, 85, 26,  4,  2,  7,  8,TNUM_DROP_BOMB, BT_MOUSE_BUTTON, 255 },
}

ubyte kc_use_external_control = 0
 

ubyte kconfig_d1x_settings[MAX_D1X_CONTROLS]
 

ubyte kconfig_settings[CONTROL_MAX_TYPES][MAX_CONTROLS]
 

fix LastReadTime = 0
 

int looper = 0 [static]
 

int mouseaxis_text[3] = { TNUM_L_R, TNUM_F_B, "Z1" }
 

int mousebutton_text[3] = { TNUM_LEFT, TNUM_RIGHT, TNUM_MID }
 

char* mousebutton_textra[13] = { "M4", "M5", "M6", "M7", "M8", "M9", "M10","M11","M12","M13","M14","M15","M16" }
 

int Num_items = 23
 

float scale = 1.0 [static]
 

ubyte system_keys[] = { KEY_ESC, KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5, KEY_F6, KEY_F7, KEY_F8, KEY_F9, KEY_F10, KEY_F11, KEY_F12, KEY_MINUS, KEY_EQUAL, KEY_PRINT_SCREEN }
 

int Vulcan_jostate = 0
 

int Vulcan_kostate = 0
 

int Vulcan_mostate = 0
 


Generated on Mon Aug 28 20:55:33 2006 for D1X-Rebirth by  doxygen 1.4.6