From: lordhavoc Date: Sat, 5 May 2001 03:32:21 +0000 (+0000) Subject: stripped out serial and modem stuff (was not supported anyway) X-Git-Tag: RELEASE_0_2_0_RC1~832 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=23bc50c038a78e63f8686b9da4a814a5116d8c3f;p=xonotic%2Fdarkplaces.git stripped out serial and modem stuff (was not supported anyway) a little bit of new very incomplete menu code git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@196 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/menu.c b/menu.c index 0e856961..dbb8addc 100644 --- a/menu.c +++ b/menu.c @@ -32,7 +32,7 @@ void (*vid_menukeyfn)(int key); int NehGameType; -enum {m_none, m_main, m_demo, m_singleplayer, m_load, m_save, m_multiplayer, m_setup, m_net, m_options, m_video, m_keys, m_help, m_quit, m_serialconfig, m_modemconfig, m_lanconfig, m_gameoptions, m_search, m_slist} m_state; +enum {m_none, m_main, m_demo, m_singleplayer, m_load, m_save, m_multiplayer, m_setup, m_net, m_options, m_video, m_keys, m_help, m_quit, m_lanconfig, m_gameoptions, m_search, m_slist} m_state; void M_Menu_Main_f (void); void M_Menu_SinglePlayer_f (void); @@ -46,8 +46,6 @@ void M_Menu_Main_f (void); void M_Menu_Video_f (void); void M_Menu_Help_f (void); void M_Menu_Quit_f (void); -void M_Menu_SerialConfig_f (void); - void M_Menu_ModemConfig_f (void); void M_Menu_LanConfig_f (void); void M_Menu_GameOptions_f (void); void M_Menu_Search_f (void); @@ -65,8 +63,6 @@ void M_Main_Draw (void); void M_Video_Draw (void); void M_Help_Draw (void); void M_Quit_Draw (void); -void M_SerialConfig_Draw (void); - void M_ModemConfig_Draw (void); void M_LanConfig_Draw (void); void M_GameOptions_Draw (void); void M_Search_Draw (void); @@ -84,8 +80,6 @@ void M_Main_Key (int key); void M_Video_Key (int key); void M_Help_Key (int key); void M_Quit_Key (int key); -void M_SerialConfig_Key (int key); - void M_ModemConfig_Key (int key); void M_LanConfig_Key (int key); void M_GameOptions_Key (int key); void M_Search_Key (int key); @@ -101,10 +95,8 @@ char m_return_reason [32]; #define StartingGame (m_multiplayer_cursor == 1) #define JoiningGame (m_multiplayer_cursor == 0) -#define SerialConfig (m_net_cursor == 0) -#define DirectConfig (m_net_cursor == 1) -#define IPXConfig (m_net_cursor == 2) -#define TCPIPConfig (m_net_cursor == 3) +#define IPXConfig (m_net_cursor == 0) +#define TCPIPConfig (m_net_cursor == 1) void M_ConfigureNetSubsystem(void); @@ -280,6 +272,52 @@ void M_ToggleMenu_f (void) } } +// LordHavoc: FIXME: finish this menu stuff +#if 0 +#define MAXMENUITEMS 128 + +typedef struct menuitem_s +{ + char *string; // may be text, or an image to use, or a cvar name, depending on the functions used + char *description; + char *command; // used by command items mainly (when used, this command is executed) + cvar_t *cvar; // used for cvar items (sliders, number boxes), value is retrieved from the cvar itself + int selectable; // purely decorative if this is false + int selected; // true if this menu item is currently selected, used by funcs so they don't need to know anything but fields in the menuitem + float selecttime; // the time that this menu item was activated (copied from realtime), used for animating selection flashs and such + float color[4]; // current color for the item (may be different than base color, due to selection flash effects) + float basecolor[4]; // the base color + float x, y, width, height; // width and height are used for mouse selection + void(*drawfunc)(struct menuitem_s *item); + void(*activefunc)(struct menuitem_s *item); +// void(*selectfunc)(struct menuitem_s *item); +// void(*deselectfunc)(struct menuitem_s *item); + void(*usefunc)(struct menuitem_s *item); +} +menuitem_t; + +menuitem_t menuitem[MAXMENUITEMS]; +int menuitems; + +void menuitem_text_drawfunc(struct menuitem_s *item) +{ + // FIXME: handle color flashs and such when selected + M_Print (item->x, item->y, item->string); +} + +void menuitem_image_drawfunc(struct menuitem_s *item) +{ + qpic_t *p = Draw_CachePic (item->string); + // FIXME: handle color flashs and such when selected + M_DrawPic (item->x, item->y, p); +} + +void menuitem_command_usefunc(struct menuitem_s *item) +{ + Cbuf_AddText (item->command); +} +#endif + int demo_cursor; void M_Demo_Draw (void) { @@ -851,7 +889,7 @@ void M_MultiPlayer_Draw (void) M_DrawPic (54, 32 + m_multiplayer_cursor * 20,Draw_CachePic( va("gfx/menudot%i.lmp", f+1 ) ) ); - if (serialAvailable || ipxAvailable || tcpipAvailable) + if (ipxAvailable || tcpipAvailable) return; M_PrintWhite ((320/2) - ((27*8)/2), 148, "No Communications Available"); } @@ -882,12 +920,12 @@ void M_MultiPlayer_Key (int key) switch (m_multiplayer_cursor) { case 0: - if (serialAvailable || ipxAvailable || tcpipAvailable) + if (ipxAvailable || tcpipAvailable) M_Menu_Net_f (); break; case 1: - if (serialAvailable || ipxAvailable || tcpipAvailable) + if (ipxAvailable || tcpipAvailable) M_Menu_Net_f (); break; @@ -1082,16 +1120,6 @@ int m_net_saveHeight; char *net_helpMessage [] = { /* .........1.........2.... */ - " ", - " Two computers connected", - " through two modems. ", - " ", - - " ", - " Two computers connected", - " by a null-modem cable. ", - " ", - " Novell network LANs ", " or Windows 95 DOS-box. ", " ", @@ -1108,7 +1136,7 @@ void M_Menu_Net_f (void) key_dest = key_menu; m_state = m_net; m_entersound = true; - m_net_items = 4; + m_net_items = 2; if (m_net_cursor >= m_net_items) m_net_cursor = 0; @@ -1128,41 +1156,6 @@ void M_Net_Draw (void) f = 32; - if (serialAvailable) - { - p = Draw_CachePic ("gfx/netmen1.lmp"); - } - else - { -#ifdef _WIN32 - p = NULL; -#else - p = Draw_CachePic ("gfx/dim_modm.lmp"); -#endif - } - - if (p) - M_DrawPic (72, f, p); - - f += 19; - - if (serialAvailable) - { - p = Draw_CachePic ("gfx/netmen2.lmp"); - } - else - { -#ifdef _WIN32 - p = NULL; -#else - p = Draw_CachePic ("gfx/dim_drct.lmp"); -#endif - } - - if (p) - M_DrawPic (72, f, p); - - f += 19; if (ipxAvailable) p = Draw_CachePic ("gfx/netmen3.lmp"); else @@ -1188,8 +1181,6 @@ void M_Net_Draw (void) f += 8; M_Print (f, 142, net_helpMessage[m_net_cursor*4+0]); M_Print (f, 150, net_helpMessage[m_net_cursor*4+1]); - M_Print (f, 158, net_helpMessage[m_net_cursor*4+2]); - M_Print (f, 166, net_helpMessage[m_net_cursor*4+3]); f = (int)(host_time * 10)%6; M_DrawPic (54, 32 + m_net_cursor * 20,Draw_CachePic( va("gfx/menudot%i.lmp", f+1 ) ) ); @@ -1223,34 +1214,22 @@ again: switch (m_net_cursor) { case 0: - M_Menu_SerialConfig_f (); - break; - - case 1: - M_Menu_SerialConfig_f (); - break; - - case 2: M_Menu_LanConfig_f (); break; - case 3: + case 1: M_Menu_LanConfig_f (); break; - case 4: + case 2: // multiprotocol break; } } - if (m_net_cursor == 0 && !serialAvailable) - goto again; - if (m_net_cursor == 1 && !serialAvailable) + if (m_net_cursor == 0 && !ipxAvailable) goto again; - if (m_net_cursor == 2 && !ipxAvailable) - goto again; - if (m_net_cursor == 3 && !tcpipAvailable) + if (m_net_cursor == 1 && !tcpipAvailable) goto again; } @@ -1934,471 +1913,6 @@ void M_Quit_Draw (void) #endif } -//============================================================================= - -/* SERIAL CONFIG MENU */ - -int serialConfig_cursor; -int serialConfig_cursor_table[] = {48, 64, 80, 96, 112, 132}; -#define NUM_SERIALCONFIG_CMDS 6 - -static int ISA_uarts[] = {0x3f8,0x2f8,0x3e8,0x2e8}; -static int ISA_IRQs[] = {4,3,4,3}; -int serialConfig_baudrate[] = {9600,14400,19200,28800,38400,57600}; - -int serialConfig_comport; -int serialConfig_irq ; -int serialConfig_baud; -char serialConfig_phone[16]; - -void M_Menu_SerialConfig_f (void) -{ - int n; - int port; - int baudrate; - qboolean useModem; - - key_dest = key_menu; - m_state = m_serialconfig; - m_entersound = true; - if (JoiningGame && SerialConfig) - serialConfig_cursor = 4; - else - serialConfig_cursor = 5; - - (*GetComPortConfig) (0, &port, &serialConfig_irq, &baudrate, &useModem); - - // map uart's port to COMx - for (n = 0; n < 4; n++) - if (ISA_uarts[n] == port) - break; - if (n == 4) - { - n = 0; - serialConfig_irq = 4; - } - serialConfig_comport = n + 1; - - // map baudrate to index - for (n = 0; n < 6; n++) - if (serialConfig_baudrate[n] == baudrate) - break; - if (n == 6) - n = 5; - serialConfig_baud = n; - - m_return_onerror = false; - m_return_reason[0] = 0; -} - - -void M_SerialConfig_Draw (void) -{ - qpic_t *p; - int basex; - char *startJoin; - char *directModem; - - M_DrawPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") ); - p = Draw_CachePic ("gfx/p_multi.lmp"); - basex = (320-p->width)/2; - M_DrawPic (basex, 4, p); - - if (StartingGame) - startJoin = "New Game"; - else - startJoin = "Join Game"; - if (SerialConfig) - directModem = "Modem"; - else - directModem = "Direct Connect"; - M_Print (basex, 32, va ("%s - %s", startJoin, directModem)); - basex += 8; - - M_Print (basex, serialConfig_cursor_table[0], "Port"); - M_DrawTextBox (160, 40, 4, 1); - M_Print (168, serialConfig_cursor_table[0], va("COM%u", serialConfig_comport)); - - M_Print (basex, serialConfig_cursor_table[1], "IRQ"); - M_DrawTextBox (160, serialConfig_cursor_table[1]-8, 1, 1); - M_Print (168, serialConfig_cursor_table[1], va("%u", serialConfig_irq)); - - M_Print (basex, serialConfig_cursor_table[2], "Baud"); - M_DrawTextBox (160, serialConfig_cursor_table[2]-8, 5, 1); - M_Print (168, serialConfig_cursor_table[2], va("%u", serialConfig_baudrate[serialConfig_baud])); - - if (SerialConfig) - { - M_Print (basex, serialConfig_cursor_table[3], "Modem Setup..."); - if (JoiningGame) - { - M_Print (basex, serialConfig_cursor_table[4], "Phone number"); - M_DrawTextBox (160, serialConfig_cursor_table[4]-8, 16, 1); - M_Print (168, serialConfig_cursor_table[4], serialConfig_phone); - } - } - - if (JoiningGame) - { - M_DrawTextBox (basex, serialConfig_cursor_table[5]-8, 7, 1); - M_Print (basex+8, serialConfig_cursor_table[5], "Connect"); - } - else - { - M_DrawTextBox (basex, serialConfig_cursor_table[5]-8, 2, 1); - M_Print (basex+8, serialConfig_cursor_table[5], "OK"); - } - - M_DrawCharacter (basex-8, serialConfig_cursor_table [serialConfig_cursor], 12+((int)(realtime*4)&1)); - - if (serialConfig_cursor == 4) - M_DrawCharacter (168 + 8*strlen(serialConfig_phone), serialConfig_cursor_table [serialConfig_cursor], 10+((int)(realtime*4)&1)); - - if (*m_return_reason) - M_PrintWhite (basex, 148, m_return_reason); -} - - -void M_SerialConfig_Key (int key) -{ - int l; - - switch (key) - { - case K_ESCAPE: - M_Menu_Net_f (); - break; - - case K_UPARROW: - S_LocalSound ("misc/menu1.wav"); - serialConfig_cursor--; - if (serialConfig_cursor < 0) - serialConfig_cursor = NUM_SERIALCONFIG_CMDS-1; - break; - - case K_DOWNARROW: - S_LocalSound ("misc/menu1.wav"); - serialConfig_cursor++; - if (serialConfig_cursor >= NUM_SERIALCONFIG_CMDS) - serialConfig_cursor = 0; - break; - - case K_LEFTARROW: - if (serialConfig_cursor > 2) - break; - S_LocalSound ("misc/menu3.wav"); - - if (serialConfig_cursor == 0) - { - serialConfig_comport--; - if (serialConfig_comport == 0) - serialConfig_comport = 4; - serialConfig_irq = ISA_IRQs[serialConfig_comport-1]; - } - - if (serialConfig_cursor == 1) - { - serialConfig_irq--; - if (serialConfig_irq == 6) - serialConfig_irq = 5; - if (serialConfig_irq == 1) - serialConfig_irq = 7; - } - - if (serialConfig_cursor == 2) - { - serialConfig_baud--; - if (serialConfig_baud < 0) - serialConfig_baud = 5; - } - - break; - - case K_RIGHTARROW: - if (serialConfig_cursor > 2) - break; -forward: - S_LocalSound ("misc/menu3.wav"); - - if (serialConfig_cursor == 0) - { - serialConfig_comport++; - if (serialConfig_comport > 4) - serialConfig_comport = 1; - serialConfig_irq = ISA_IRQs[serialConfig_comport-1]; - } - - if (serialConfig_cursor == 1) - { - serialConfig_irq++; - if (serialConfig_irq == 6) - serialConfig_irq = 7; - if (serialConfig_irq == 8) - serialConfig_irq = 2; - } - - if (serialConfig_cursor == 2) - { - serialConfig_baud++; - if (serialConfig_baud > 5) - serialConfig_baud = 0; - } - - break; - - case K_ENTER: - if (serialConfig_cursor < 3) - goto forward; - - m_entersound = true; - - if (serialConfig_cursor == 3) - { - (*SetComPortConfig) (0, ISA_uarts[serialConfig_comport-1], serialConfig_irq, serialConfig_baudrate[serialConfig_baud], SerialConfig); - - M_Menu_ModemConfig_f (); - break; - } - - if (serialConfig_cursor == 4) - { - serialConfig_cursor = 5; - break; - } - - // serialConfig_cursor == 5 (OK/CONNECT) - (*SetComPortConfig) (0, ISA_uarts[serialConfig_comport-1], serialConfig_irq, serialConfig_baudrate[serialConfig_baud], SerialConfig); - - M_ConfigureNetSubsystem (); - - if (StartingGame) - { - M_Menu_GameOptions_f (); - break; - } - - m_return_state = m_state; - m_return_onerror = true; - key_dest = key_game; - m_state = m_none; - - if (SerialConfig) - Cbuf_AddText (va ("connect \"%s\"\n", serialConfig_phone)); - else - Cbuf_AddText ("connect\n"); - break; - - case K_BACKSPACE: - if (serialConfig_cursor == 4) - { - if (strlen(serialConfig_phone)) - serialConfig_phone[strlen(serialConfig_phone)-1] = 0; - } - break; - - default: - if (key < 32 || key > 127) - break; - if (serialConfig_cursor == 4) - { - l = strlen(serialConfig_phone); - if (l < 15) - { - serialConfig_phone[l+1] = 0; - serialConfig_phone[l] = key; - } - } - } - - if (DirectConfig && (serialConfig_cursor == 3 || serialConfig_cursor == 4)) - { - if (key == K_UPARROW) - serialConfig_cursor = 2; - else - serialConfig_cursor = 5; - } - - if (SerialConfig && StartingGame && serialConfig_cursor == 4) - { - if (key == K_UPARROW) - serialConfig_cursor = 3; - else - serialConfig_cursor = 5; - } -} - -//============================================================================= -/* MODEM CONFIG MENU */ - -int modemConfig_cursor; -int modemConfig_cursor_table [] = {40, 56, 88, 120, 156}; -#define NUM_MODEMCONFIG_CMDS 5 - -char modemConfig_dialing; -char modemConfig_clear [16]; -char modemConfig_init [32]; -char modemConfig_hangup [16]; - -void M_Menu_ModemConfig_f (void) -{ - key_dest = key_menu; - m_state = m_modemconfig; - m_entersound = true; - (*GetModemConfig) (0, &modemConfig_dialing, modemConfig_clear, modemConfig_init, modemConfig_hangup); -} - - -void M_ModemConfig_Draw (void) -{ - qpic_t *p; - int basex; - - M_DrawPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") ); - p = Draw_CachePic ("gfx/p_multi.lmp"); - basex = (320-p->width)/2; - M_DrawPic (basex, 4, p); - basex += 8; - - if (modemConfig_dialing == 'P') - M_Print (basex, modemConfig_cursor_table[0], "Pulse Dialing"); - else - M_Print (basex, modemConfig_cursor_table[0], "Touch Tone Dialing"); - - M_Print (basex, modemConfig_cursor_table[1], "Clear"); - M_DrawTextBox (basex, modemConfig_cursor_table[1]+4, 16, 1); - M_Print (basex+8, modemConfig_cursor_table[1]+12, modemConfig_clear); - if (modemConfig_cursor == 1) - M_DrawCharacter (basex+8 + 8*strlen(modemConfig_clear), modemConfig_cursor_table[1]+12, 10+((int)(realtime*4)&1)); - - M_Print (basex, modemConfig_cursor_table[2], "Init"); - M_DrawTextBox (basex, modemConfig_cursor_table[2]+4, 30, 1); - M_Print (basex+8, modemConfig_cursor_table[2]+12, modemConfig_init); - if (modemConfig_cursor == 2) - M_DrawCharacter (basex+8 + 8*strlen(modemConfig_init), modemConfig_cursor_table[2]+12, 10+((int)(realtime*4)&1)); - - M_Print (basex, modemConfig_cursor_table[3], "Hangup"); - M_DrawTextBox (basex, modemConfig_cursor_table[3]+4, 16, 1); - M_Print (basex+8, modemConfig_cursor_table[3]+12, modemConfig_hangup); - if (modemConfig_cursor == 3) - M_DrawCharacter (basex+8 + 8*strlen(modemConfig_hangup), modemConfig_cursor_table[3]+12, 10+((int)(realtime*4)&1)); - - M_DrawTextBox (basex, modemConfig_cursor_table[4]-8, 2, 1); - M_Print (basex+8, modemConfig_cursor_table[4], "OK"); - - M_DrawCharacter (basex-8, modemConfig_cursor_table [modemConfig_cursor], 12+((int)(realtime*4)&1)); -} - - -void M_ModemConfig_Key (int key) -{ - int l; - - switch (key) - { - case K_ESCAPE: - M_Menu_SerialConfig_f (); - break; - - case K_UPARROW: - S_LocalSound ("misc/menu1.wav"); - modemConfig_cursor--; - if (modemConfig_cursor < 0) - modemConfig_cursor = NUM_MODEMCONFIG_CMDS-1; - break; - - case K_DOWNARROW: - S_LocalSound ("misc/menu1.wav"); - modemConfig_cursor++; - if (modemConfig_cursor >= NUM_MODEMCONFIG_CMDS) - modemConfig_cursor = 0; - break; - - case K_LEFTARROW: - case K_RIGHTARROW: - if (modemConfig_cursor == 0) - { - if (modemConfig_dialing == 'P') - modemConfig_dialing = 'T'; - else - modemConfig_dialing = 'P'; - S_LocalSound ("misc/menu1.wav"); - } - break; - - case K_ENTER: - if (modemConfig_cursor == 0) - { - if (modemConfig_dialing == 'P') - modemConfig_dialing = 'T'; - else - modemConfig_dialing = 'P'; - m_entersound = true; - } - - if (modemConfig_cursor == 4) - { - (*SetModemConfig) (0, va ("%c", modemConfig_dialing), modemConfig_clear, modemConfig_init, modemConfig_hangup); - m_entersound = true; - M_Menu_SerialConfig_f (); - } - break; - - case K_BACKSPACE: - if (modemConfig_cursor == 1) - { - if (strlen(modemConfig_clear)) - modemConfig_clear[strlen(modemConfig_clear)-1] = 0; - } - - if (modemConfig_cursor == 2) - { - if (strlen(modemConfig_init)) - modemConfig_init[strlen(modemConfig_init)-1] = 0; - } - - if (modemConfig_cursor == 3) - { - if (strlen(modemConfig_hangup)) - modemConfig_hangup[strlen(modemConfig_hangup)-1] = 0; - } - break; - - default: - if (key < 32 || key > 127) - break; - - if (modemConfig_cursor == 1) - { - l = strlen(modemConfig_clear); - if (l < 15) - { - modemConfig_clear[l+1] = 0; - modemConfig_clear[l] = key; - } - } - - if (modemConfig_cursor == 2) - { - l = strlen(modemConfig_init); - if (l < 29) - { - modemConfig_init[l+1] = 0; - modemConfig_init[l] = key; - } - } - - if (modemConfig_cursor == 3) - { - l = strlen(modemConfig_hangup); - if (l < 15) - { - modemConfig_hangup[l+1] = 0; - modemConfig_hangup[l] = key; - } - } - } -} - //============================================================================= /* LAN CONFIG MENU */ @@ -3417,14 +2931,6 @@ void M_Draw (void) M_Quit_Draw (); break; - case m_serialconfig: - M_SerialConfig_Draw (); - break; - - case m_modemconfig: - M_ModemConfig_Draw (); - break; - case m_lanconfig: M_LanConfig_Draw (); break; @@ -3511,14 +3017,6 @@ void M_Keydown (int key) M_Quit_Key (key); return; - case m_serialconfig: - M_SerialConfig_Key (key); - return; - - case m_modemconfig: - M_ModemConfig_Key (key); - return; - case m_lanconfig: M_LanConfig_Key (key); return; @@ -3543,10 +3041,6 @@ void M_ConfigureNetSubsystem(void) // enable/disable net systems to match desired config Cbuf_AddText ("stopdemo\n"); - if (SerialConfig || DirectConfig) - { - Cbuf_AddText ("com1 enable\n"); - } if (IPXConfig || TCPIPConfig) net_hostport = lanConfig_port; diff --git a/net.h b/net.h index b41cadce..19362ce4 100644 --- a/net.h +++ b/net.h @@ -316,15 +316,10 @@ typedef struct _PollProcedure void SchedulePollProcedure(PollProcedure *pp, double timeOffset); -extern qboolean serialAvailable; extern qboolean ipxAvailable; extern qboolean tcpipAvailable; extern char my_ipx_address[NET_NAMELEN]; extern char my_tcpip_address[NET_NAMELEN]; -extern void (*GetComPortConfig) (int portNumber, int *port, int *irq, int *baud, qboolean *useModem); -extern void (*SetComPortConfig) (int portNumber, int port, int irq, int baud, qboolean useModem); -extern void (*GetModemConfig) (int portNumber, char *dialType, char *clear, char *init, char *hangup); -extern void (*SetModemConfig) (int portNumber, char *dialType, char *clear, char *init, char *hangup); extern qboolean slistInProgress; extern qboolean slistSilent; diff --git a/net_main.c b/net_main.c index 3fa471ce..39b57cca 100644 --- a/net_main.c +++ b/net_main.c @@ -25,7 +25,6 @@ qsocket_t *net_activeSockets = NULL; qsocket_t *net_freeSockets = NULL; int net_numsockets = 0; -qboolean serialAvailable = false; qboolean ipxAvailable = false; qboolean tcpipAvailable = false; @@ -35,11 +34,6 @@ int DEFAULTnet_hostport = 26000; char my_ipx_address[NET_NAMELEN]; char my_tcpip_address[NET_NAMELEN]; -void (*GetComPortConfig) (int portNumber, int *port, int *irq, int *baud, qboolean *useModem); -void (*SetComPortConfig) (int portNumber, int port, int irq, int baud, qboolean useModem); -void (*GetModemConfig) (int portNumber, char *dialType, char *clear, char *init, char *hangup); -void (*SetModemConfig) (int portNumber, char *dialType, char *clear, char *init, char *hangup); - static qboolean listening = false; qboolean slistInProgress = false; @@ -66,14 +60,6 @@ cvar_t net_messagetimeout = {"net_messagetimeout","300"}; cvar_t hostname = {"hostname", "UNNAMED"}; qboolean configRestored = false; -cvar_t config_com_port = {"_config_com_port", "0x3f8", true}; -cvar_t config_com_irq = {"_config_com_irq", "4", true}; -cvar_t config_com_baud = {"_config_com_baud", "57600", true}; -cvar_t config_com_modem = {"_config_com_modem", "1", true}; -cvar_t config_modem_dialtype = {"_config_modem_dialtype", "T", true}; -cvar_t config_modem_clear = {"_config_modem_clear", "ATZ", true}; -cvar_t config_modem_init = {"_config_modem_init", "", true}; -cvar_t config_modem_hangup = {"_config_modem_hangup", "AT H", true}; // these two macros are to make the code more readable #define sfunc net_drivers[sock->driver] @@ -747,14 +733,6 @@ void NET_Init (void) Cvar_RegisterVariable (&net_messagetimeout); Cvar_RegisterVariable (&hostname); - Cvar_RegisterVariable (&config_com_port); - Cvar_RegisterVariable (&config_com_irq); - Cvar_RegisterVariable (&config_com_baud); - Cvar_RegisterVariable (&config_com_modem); - Cvar_RegisterVariable (&config_modem_dialtype); - Cvar_RegisterVariable (&config_modem_clear); - Cvar_RegisterVariable (&config_modem_init); - Cvar_RegisterVariable (&config_modem_hangup); Cmd_AddCommand ("slist", NET_Slist_f); Cmd_AddCommand ("listen", NET_Listen_f); @@ -813,21 +791,9 @@ static PollProcedure *pollProcedureList = NULL; void NET_Poll(void) { PollProcedure *pp; - qboolean useModem; if (!configRestored) - { - if (serialAvailable) - { - if (config_com_modem.value == 1.0) - useModem = true; - else - useModem = false; - SetComPortConfig (0, (int)config_com_port.value, (int)config_com_irq.value, (int)config_com_baud.value, useModem); - SetModemConfig (0, config_modem_dialtype.string, config_modem_clear.string, config_modem_init.string, config_modem_hangup.string); - } configRestored = true; - } SetNetTime();