2 Copyright (C) 1996-1997 Id Software, Inc.
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 See the GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 #include <pspkernel.h>
28 #include <psputility.h>
31 extern cvar_t accesspoint
;
32 extern cvar_t r_wateralpha
;
33 extern cvar_t r_vsync
;
34 extern cvar_t r_mipmaps
;
35 extern cvar_t r_mipmaps_bias
;
36 extern cvar_t in_freelook_analog
;
37 extern cvar_t in_disable_analog
;
38 extern cvar_t in_analog_strafe
;
39 extern cvar_t lookspring
;
41 extern cvar_t in_x_axis_adjust
;
42 extern cvar_t in_y_axis_adjust
;
43 extern cvar_t r_dithering
;
44 extern cvar_t r_i_model_animation
;
45 extern cvar_t t_i_model_transform
;
46 extern cvar_t show_fps
;
50 ////////////////////////////////////////////////////////////////////
52 ////////////////////////////////////////////////////////////////////
54 int items_respawn
= 1;
76 extern qboolean bmg_type_changed
;
78 void (*vid_menudrawfn
)(void);
79 void (*vid_menukeyfn
)(int key
);
105 void M_Menu_Main_f (void);
106 void M_Menu_SinglePlayer_f (void);
107 void M_Menu_Load_f (void);
108 void M_Menu_Save_f (void);
109 void M_Menu_MultiPlayer_f (void);
110 void M_Menu_Setup_f (void);
111 void M_Menu_Net_f (void);
112 void M_Menu_Options_f (void);
113 void M_Menu_Keys_f (void);
114 void M_Menu_Video_f (void);
115 void M_Menu_Help_f (void);
116 void M_Menu_Quit_f (void);
117 void M_Menu_SerialConfig_f (void);
118 void M_Menu_ModemConfig_f (void);
119 void M_Menu_LanConfig_f (void);
120 void M_Menu_GameOptions_f (void);
121 void M_Menu_DOptions_f (void);
122 void M_Menu_Search_f (void);
123 void M_Menu_ServerList_f (void);
125 void M_Main_Draw (void);
126 void M_SinglePlayer_Draw (void);
127 void M_Load_Draw (void);
128 void M_Save_Draw (void);
129 void M_MultiPlayer_Draw (void);
130 void M_Setup_Draw (void);
131 void M_Net_Draw (void);
132 void M_Options_Draw (void);
133 void M_Keys_Draw (void);
134 void M_Video_Draw (void);
135 void M_Help_Draw (void);
136 void M_Quit_Draw (void);
137 void M_SerialConfig_Draw (void);
138 void M_ModemConfig_Draw (void);
139 void M_LanConfig_Draw (void);
140 void M_GameOptions_Draw (void);
141 void M_DOptions_Draw (void);
142 void M_Search_Draw (void);
143 void M_ServerList_Draw (void);
145 void M_Main_Key (int key
);
146 void M_SinglePlayer_Key (int key
);
147 void M_Load_Key (int key
);
148 void M_Save_Key (int key
);
149 void M_MultiPlayer_Key (int key
);
150 void M_Setup_Key (int key
);
151 void M_Net_Key (int key
);
152 void M_Options_Key (int key
);
153 void M_Keys_Key (int key
);
154 void M_Video_Key (int key
);
155 void M_Help_Key (int key
);
156 void M_Quit_Key (int key
);
157 void M_SerialConfig_Key (int key
);
158 void M_ModemConfig_Key (int key
);
159 void M_LanConfig_Key (int key
);
160 void M_GameOptions_Key (int key
);
161 void M_DOptions_Key (int key
);
162 void M_Search_Key (int key
);
163 void M_ServerList_Key (int key
);
165 void Con_SetOSKActive(qboolean active
);
166 void M_Menu_OSK_f (char *input
, char *output
, int outlen
);
169 qboolean m_entersound
; // play after drawing a frame, so caching
170 // won't disrupt the sound
171 qboolean m_recursiveDraw
;
177 qboolean m_return_onerror
;
178 char m_return_reason
[32];
180 #define StartingGame (m_multiplayer_cursor == 1)
181 #define JoiningGame (m_multiplayer_cursor == 0)
182 #define SerialConfig (m_net_cursor == 0)
183 #define DirectConfig (m_net_cursor == 1)
184 #define IPXConfig (m_net_cursor == 2)
185 #define TCPIPConfig (m_net_cursor == 3)
187 void M_ConfigureNetSubsystem(void);
193 Draws one solid graphics character
196 void M_DrawCharacter (int cx
, int line
, int num
)
198 Draw_Character ( cx
+ ((vid
.width
- 320)>>1), line
, num
);
201 void M_Print (int cx
, int cy
, char *str
)
205 M_DrawCharacter (cx
, cy
, (*str
)+128);
211 void M_PrintWhite (int cx
, int cy
, char *str
)
215 M_DrawCharacter (cx
, cy
, *str
);
221 void M_DrawTransPic (int x
, int y
, qpic_t
*pic
)
223 Draw_TransPic (x
+ ((vid
.width
- 320)>>1), y
, pic
);
226 void M_DrawPic (int x
, int y
, qpic_t
*pic
)
228 Draw_Pic (x
+ ((vid
.width
- 320)>>1), y
, pic
);
231 byte identityTable
[256];
232 byte translationTable
[256];
234 void M_BuildTranslationTable(int top
, int bottom
)
239 for (j
= 0; j
< 256; j
++)
240 identityTable
[j
] = j
;
241 dest
= translationTable
;
242 source
= identityTable
;
243 memcpy (dest
, source
, 256);
245 if (top
< 128) // the artists made some backwards ranges. sigh.
246 memcpy (dest
+ TOP_RANGE
, source
+ top
, 16);
248 for (j
=0 ; j
<16 ; j
++)
249 dest
[TOP_RANGE
+j
] = source
[top
+15-j
];
252 memcpy (dest
+ BOTTOM_RANGE
, source
+ bottom
, 16);
254 for (j
=0 ; j
<16 ; j
++)
255 dest
[BOTTOM_RANGE
+j
] = source
[bottom
+15-j
];
259 void M_DrawTransPicTranslate (int x
, int y
, qpic_t
*pic
)
261 Draw_TransPicTranslate (x
+ ((vid
.width
- 320)>>1), y
, pic
, translationTable
);
265 void M_DrawTextBox (int x
, int y
, int width
, int lines
)
274 p
= Draw_CachePic ("gfx/box_tl.lmp");
275 M_DrawTransPic (cx
, cy
, p
);
276 p
= Draw_CachePic ("gfx/box_ml.lmp");
277 for (n
= 0; n
< lines
; n
++)
280 M_DrawTransPic (cx
, cy
, p
);
282 p
= Draw_CachePic ("gfx/box_bl.lmp");
283 M_DrawTransPic (cx
, cy
+8, p
);
290 p
= Draw_CachePic ("gfx/box_tm.lmp");
291 M_DrawTransPic (cx
, cy
, p
);
292 p
= Draw_CachePic ("gfx/box_mm.lmp");
293 for (n
= 0; n
< lines
; n
++)
297 p
= Draw_CachePic ("gfx/box_mm2.lmp");
298 M_DrawTransPic (cx
, cy
, p
);
300 p
= Draw_CachePic ("gfx/box_bm.lmp");
301 M_DrawTransPic (cx
, cy
+8, p
);
308 p
= Draw_CachePic ("gfx/box_tr.lmp");
309 M_DrawTransPic (cx
, cy
, p
);
310 p
= Draw_CachePic ("gfx/box_mr.lmp");
311 for (n
= 0; n
< lines
; n
++)
314 M_DrawTransPic (cx
, cy
, p
);
316 p
= Draw_CachePic ("gfx/box_br.lmp");
317 M_DrawTransPic (cx
, cy
+8, p
);
320 void M_DrawCheckbox (int x
, int y
, int on
)
324 M_DrawCharacter (x
, y
, 131);
326 M_DrawCharacter (x
, y
, 129);
329 M_Print (x
, y
, "on");
331 M_Print (x
, y
, "off");
334 //=============================================================================
343 void M_ToggleMenu_f (void)
347 if (key_dest
== key_menu
)
349 if (m_state
!= m_main
)
358 if (key_dest
== key_console
)
360 Con_ToggleConsole_f ();
369 //=============================================================================
375 void M_Menu_Main_f (void)
377 if (key_dest
!= key_menu
)
379 m_save_demonum
= cls
.demonum
;
388 void M_Main_Draw (void)
391 qpic_t
*p
,*b
, *s
, *m
, *o
, *h
, *q
, *t
;
395 t
= Draw_CachePic ("gfx/menu/title.lmp");
396 M_DrawPic ((320-t
->width
)/2, 16, t
);
398 if (m_main_cursor
== 0)
399 s
= Draw_CachePic ("gfx/menu/single_1.lmp");
401 s
= Draw_CachePic ("gfx/menu/single_0.lmp");
402 M_DrawPic ((320-s
->width
)/2, 160, s
);
404 if (m_main_cursor
== 1)
405 m
= Draw_CachePic ("gfx/menu/multi_1.lmp");
407 m
= Draw_CachePic ("gfx/menu/multi_0.lmp");
408 M_DrawPic ((320-m
->width
)/2, 176, m
);
410 if (m_main_cursor
== 2)
411 o
= Draw_CachePic ("gfx/menu/option_1.lmp");
413 o
= Draw_CachePic ("gfx/menu/option_0.lmp");
414 M_DrawPic ((320-o
->width
)/2, 192, o
);
416 if (m_main_cursor
== 3)
417 h
= Draw_CachePic ("gfx/menu/help_1.lmp");
419 h
= Draw_CachePic ("gfx/menu/help_0.lmp");
420 M_DrawPic ((320-h
->width
)/2, 208, h
);
422 if (m_main_cursor
== 4)
423 q
= Draw_CachePic ("gfx/menu/quit_1.lmp");
425 q
= Draw_CachePic ("gfx/menu/quit_0.lmp");
426 M_DrawPic ((320-q
->width
)/2, 224, q
);
431 M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
433 p
= Draw_CachePic ("gfx/ttl_main.lmp");
434 M_DrawPic ( (320-p
->width
)/2, 4, p
);
435 M_DrawTransPic (72, 32, Draw_CachePic ("gfx/mainmenu.lmp") );
437 f
= (int)(host_time
* 10)%6;
438 M_DrawTransPic (54, 32 + m_main_cursor
* 20,Draw_CachePic( va("gfx/menudot%i.lmp", f
+1 ) ) );
441 b
= Draw_CachePic ("gfx/m_bttns.lmp");
442 M_DrawPic ( (320-b
->width
)/2, 248, b
);
444 M_Print (112, 0, va("Version %4.2f", (float) KUR_VERSION
));
448 void M_Main_Key (int key
)
455 cls
.demonum
= m_save_demonum
;
456 if (cls
.demonum
!= -1 && !cls
.demoplayback
&& cls
.state
!= ca_connected
)
461 S_LocalSound ("misc/menu1.wav");
462 if (++m_main_cursor
>= MAIN_ITEMS
)
467 S_LocalSound ("misc/menu1.wav");
468 if (--m_main_cursor
< 0)
469 m_main_cursor
= MAIN_ITEMS
- 1;
475 switch (m_main_cursor
)
478 M_Menu_SinglePlayer_f ();
482 M_Menu_MultiPlayer_f ();
503 //=============================================================================
504 /* SINGLE PLAYER MENU */
506 int m_singleplayer_cursor
;
507 #define SINGLEPLAYER_ITEMS 3
510 void M_Menu_SinglePlayer_f (void)
513 m_state
= m_singleplayer
;
518 void M_SinglePlayer_Draw (void)
521 qpic_t
*p
,*b
, *n
, *l
, *s
, *t
;
523 b
= Draw_CachePic ("gfx/m_bttns.lmp");
524 M_DrawPic ( (320-b
->width
)/2, 248, b
);
528 t
= Draw_CachePic ("gfx/menu/title.lmp");
529 M_DrawPic ((320-t
->width
)/2, 16, t
);
531 if (m_singleplayer_cursor
== 0)
532 n
= Draw_CachePic ("gfx/menu/sp/new_1.lmp");
534 n
= Draw_CachePic ("gfx/menu/sp/new_0.lmp");
535 M_DrawPic ((320-n
->width
)/2, 160, n
);
537 if (m_singleplayer_cursor
== 1)
538 l
= Draw_CachePic ("gfx/menu/sp/load_1.lmp");
540 l
= Draw_CachePic ("gfx/menu/sp/load_0.lmp");
541 M_DrawPic ((320-l
->width
)/2, 176, l
);
543 if (m_singleplayer_cursor
== 2)
544 s
= Draw_CachePic ("gfx/menu/sp/save_1.lmp");
546 s
= Draw_CachePic ("gfx/menu/sp/save_0.lmp");
547 M_DrawPic ((320-s
->width
)/2, 192, s
);
551 M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
552 p
= Draw_CachePic ("gfx/ttl_sgl.lmp");
553 M_DrawPic ( (320-p
->width
)/2, 4, p
);
554 M_DrawTransPic (72, 32, Draw_CachePic ("gfx/sp_menu.lmp") );
556 f
= (int)(host_time
* 10)%6;
558 M_DrawTransPic (54, 32 + m_singleplayer_cursor
* 20,Draw_CachePic( va("gfx/menudot%i.lmp", f
+1 ) ) );
563 void M_SinglePlayer_Key (int key
)
572 S_LocalSound ("misc/menu1.wav");
573 if (++m_singleplayer_cursor
>= SINGLEPLAYER_ITEMS
)
574 m_singleplayer_cursor
= 0;
578 S_LocalSound ("misc/menu1.wav");
579 if (--m_singleplayer_cursor
< 0)
580 m_singleplayer_cursor
= SINGLEPLAYER_ITEMS
- 1;
586 switch (m_singleplayer_cursor
)
591 if (!SCR_ModalMessage("Are you sure you want to\nstart a new game?\n"))
596 Cbuf_AddText ("disconnect\n");
597 Cbuf_AddText ("maxplayers 1\n");
600 Cbuf_AddText ("viewsize 120\n cl_gunpitch 0\n fov 90\n scr_ofsy 0\n cl_autoaim 1\n chase_active 0\n");
602 // If we were in a multiplayer game, reset all the deathmatch flags to 0;
622 Cbuf_AddText ("map start\n");
636 //=============================================================================
639 int load_cursor
; // 0 < load_cursor < MAX_SAVEGAMES
641 #define MAX_SAVEGAMES 12
642 char m_filenames
[MAX_SAVEGAMES
][SAVEGAME_COMMENT_LENGTH
+1];
643 int loadable
[MAX_SAVEGAMES
];
645 void M_ScanSaves (void)
648 char name
[MAX_OSPATH
];
652 for (i
=0 ; i
<MAX_SAVEGAMES
; i
++)
654 strcpy (m_filenames
[i
], "--- EMPTY SLOT ---");
656 sprintf (name
, "%s/s%i.sav", com_gamedir
, i
);
657 f
= fopen (name
, "r");
660 fscanf (f
, "%i\n", &version
);
661 fscanf (f
, "%79s\n", name
);
662 strncpy (m_filenames
[i
], name
, sizeof(m_filenames
[i
])-1);
664 // change _ back to space
665 for (j
=0 ; j
<SAVEGAME_COMMENT_LENGTH
; j
++)
666 if (m_filenames
[i
][j
] == '_')
667 m_filenames
[i
][j
] = ' ';
673 void M_Menu_Load_f (void)
682 void M_Menu_Save_f (void)
688 if (svs
.maxclients
!= 1)
697 void M_Load_Draw (void)
702 b
= Draw_CachePic ("gfx/m_bttns.lmp");
703 M_DrawPic ( (320-b
->width
)/2, 248, b
);
707 p
= Draw_CachePic ("gfx/menu/sp/load_0.lmp");
709 M_DrawCharacter (8, 32 + load_cursor
*8, 12+((int)(realtime
*30)&1));
713 p
= Draw_CachePic ("gfx/p_load.lmp");
715 M_DrawCharacter (8, 32 + load_cursor
*8, 12+((int)(realtime
*4)&1));
717 M_DrawPic ( (320-p
->width
)/2, 4, p
);
719 for (i
=0 ; i
< MAX_SAVEGAMES
; i
++)
720 M_Print (16, 32 + 8*i
, m_filenames
[i
]);
726 void M_Save_Draw (void)
731 b
= Draw_CachePic ("gfx/m_bttns.lmp");
732 M_DrawPic ( (320-b
->width
)/2, 248, b
);
736 p
= Draw_CachePic ("gfx/menu/sp/save_0.lmp");
738 M_DrawCharacter (8, 32 + load_cursor
*8, 12+((int)(realtime
*30)&1));
742 p
= Draw_CachePic ("gfx/p_save.lmp");
744 M_DrawCharacter (8, 32 + load_cursor
*8, 12+((int)(realtime
*4)&1));
746 M_DrawPic ( (320-p
->width
)/2, 4, p
);
748 for (i
=0 ; i
<MAX_SAVEGAMES
; i
++)
749 M_Print (16, 32 + 8*i
, m_filenames
[i
]);
753 void M_Load_Key (int k
)
758 M_Menu_SinglePlayer_f ();
762 S_LocalSound ("misc/menu2.wav");
763 if (!loadable
[load_cursor
])
768 // Host_Loadgame_f can't bring up the loading plaque because too much
769 // stack space has been used, so do it now
770 SCR_BeginLoadingPlaque ();
773 Cbuf_AddText ("viewsize 120\n cl_gunpitch 0\n fov 90\n scr_ofsy 0\n cl_autoaim 1\n chase_active 0\n");
775 // If we were in a multiplayer game, reset all the deathmatch flags to 0;
795 // issue the load command
796 Cbuf_AddText (va ("load s%i\n", load_cursor
) );
802 S_LocalSound ("misc/menu1.wav");
805 load_cursor
= MAX_SAVEGAMES
-1;
810 S_LocalSound ("misc/menu1.wav");
812 if (load_cursor
>= MAX_SAVEGAMES
)
819 void M_Save_Key (int k
)
824 M_Menu_SinglePlayer_f ();
830 Cbuf_AddText (va("save s%i\n", load_cursor
));
835 S_LocalSound ("misc/menu1.wav");
838 load_cursor
= MAX_SAVEGAMES
-1;
843 S_LocalSound ("misc/menu1.wav");
845 if (load_cursor
>= MAX_SAVEGAMES
)
851 //=============================================================================
852 /* MULTIPLAYER MENU */
854 int m_multiplayer_cursor
;
857 #define MULTIPLAYER_ITEMS 9
859 #define MULTIPLAYER_ITEMS 3
862 void M_Menu_MultiPlayer_f (void)
865 m_state
= m_multiplayer
;
870 void M_MultiPlayer_Draw (void)
874 qpic_t
*p
,*b
, *j
, *c
, *t
, *i
, *a
;
876 b
= Draw_CachePic ("gfx/m_bttns.lmp");
877 M_DrawPic ( (320-b
->width
)/2, 248, b
);
881 // M_DrawTransPic (72, 32, Draw_CachePic ("gfx/menu/multi_0.lmp") );
883 if (m_multiplayer_cursor
== 0)
884 j
= Draw_CachePic ("gfx/menu/mp/join_1.lmp");
886 j
= Draw_CachePic ("gfx/menu/mp/join_0.lmp");
887 M_DrawPic ((320-j
->width
)/2, 72, j
);
889 if (m_multiplayer_cursor
== 1)
890 c
= Draw_CachePic ("gfx/menu/mp/create_1.lmp");
892 c
= Draw_CachePic ("gfx/menu/mp/create_0.lmp");
893 M_DrawPic ((320-c
->width
)/2, 88, c
);
895 if (m_multiplayer_cursor
== 2)
896 t
= Draw_CachePic ("gfx/menu/mp/setup_1.lmp");
898 t
= Draw_CachePic ("gfx/menu/mp/setup_0.lmp");
899 M_DrawPic ((320-t
->width
)/2, 104, t
);
901 if (m_multiplayer_cursor
== 3)
902 i
= Draw_CachePic ("gfx/menu/mp/inf_1.lmp");
904 i
= Draw_CachePic ("gfx/menu/mp/inf_0.lmp");
905 M_DrawPic ((320-i
->width
)/2, 128, i
);
907 M_DrawCheckbox ((320/2) - ((3*8)/2), 144, tcpipAvailable
&& !tcpipAdhoc
);
909 if (m_multiplayer_cursor
== 4)
910 a
= Draw_CachePic ("gfx/menu/mp/adhoc_1.lmp");
912 a
= Draw_CachePic ("gfx/menu/mp/adhoc_0.lmp");
913 M_DrawPic ((320-a
->width
)/2, 152, a
);
915 M_DrawCheckbox ((320/2) - ((3*8)/2), 168, tcpipAvailable
&& tcpipAdhoc
);
917 if (m_multiplayer_cursor
== 5)
918 M_PrintWhite ((320/2) - ((8*8)/2), 184, "Add Bot");
920 M_Print ((320/2) - ((8*8)/2), 184, "Add Bot");
922 if (m_multiplayer_cursor
== 6)
923 M_PrintWhite ((320/2) - ((12*8)/2), 192, "Add Team Bot");
925 M_Print ((320/2) - ((12*8)/2), 192, "Add Team Bot");
927 if (m_multiplayer_cursor
== 7)
928 M_PrintWhite ((320/2) - ((10*8)/2), 200, "Remove Bot");
930 M_Print ((320/2) - ((10*8)/2), 200, "Remove Bot");
932 if (m_multiplayer_cursor
== 8)
933 M_PrintWhite ((320/2) - ((26*8)/2), 216, "Co-op Player Camera Change");
935 M_Print ((320/2) - ((26*8)/2), 216, "Co-op Player Camera Change");
937 if (serialAvailable
|| ipxAvailable
|| tcpipAvailable
)
939 M_PrintWhite ((320/2) - ((27*8)/2), 232, "No Communications Available");
943 M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
945 p
= Draw_CachePic ("gfx/p_multi.lmp");
946 M_DrawPic ( (320-p
->width
)/2, 4, p
);
948 M_DrawTransPic (72, 32, Draw_CachePic ("gfx/mp_menu.lmp") );
950 f
= (int)(host_time
* 10)%6;
952 M_DrawTransPic (54, 32 + m_multiplayer_cursor
* 20,Draw_CachePic( va("gfx/menudot%i.lmp", f
+1 ) ) );
955 M_Print (72, 97, "Infrastructure ");
956 M_DrawCheckbox (220, 97, tcpipAvailable
&& !tcpipAdhoc
);
958 M_Print (72, 117, "Adhoc ");
959 M_DrawCheckbox (220, 117, tcpipAvailable
&& tcpipAdhoc
);
962 M_Print (72, 137, "Add Bot ");
963 M_Print (72, 157, "Add Team Bot ");
964 M_Print (72, 177, "Remove Bot ");
965 M_Print (72, 197, "Co-op Player Camera Change");
967 if (serialAvailable
|| ipxAvailable
|| tcpipAvailable
)
969 M_PrintWhite ((320/2) - ((27*8)/2), 207, "No Communications Available");
975 void M_MultiPlayer_Key (int key
)
984 S_LocalSound ("misc/menu1.wav");
985 if (++m_multiplayer_cursor
>= MULTIPLAYER_ITEMS
)
986 m_multiplayer_cursor
= 0;
990 S_LocalSound ("misc/menu1.wav");
991 if (--m_multiplayer_cursor
< 0)
992 m_multiplayer_cursor
= MULTIPLAYER_ITEMS
- 1;
997 switch (m_multiplayer_cursor
)
1000 if (serialAvailable
|| ipxAvailable
|| tcpipAvailable
)
1001 M_Menu_LanConfig_f ();
1005 if (serialAvailable
|| ipxAvailable
|| tcpipAvailable
)
1006 M_Menu_LanConfig_f ();
1008 M_Menu_GameOptions_f ();
1017 Datagram_Shutdown();
1019 tcpipAvailable
= !tcpipAvailable
;
1021 if(tcpipAvailable
) {
1023 net_driver_to_use
= 0;
1030 Datagram_Shutdown();
1032 tcpipAvailable
= !tcpipAvailable
;
1034 if(tcpipAvailable
) {
1036 net_driver_to_use
= 1;
1043 Cbuf_AddText ("impulse 101\n");
1046 case 6: // add team bot
1047 Cbuf_AddText ("impulse 100\n");
1050 case 7: // remove bot
1051 Cbuf_AddText ("impulse 102\n");
1054 case 8: // player camera switch
1056 Cbuf_AddText ("impulse 103\n");
1064 //=============================================================================
1068 int setup_cursor
= 4;
1069 int setup_cursor_table
[] = {40, 56, 80, 104, 140};
1071 int setup_cursor
= 5;
1072 int setup_cursor_table
[] = {40, 56, 72, 96, 120, 156};
1075 char setup_hostname
[16];
1076 char setup_myname
[16];
1078 int setup_oldbottom
;
1083 #define NUM_SETUP_CMDS 5
1085 // Define PSP specific variables
1086 #define NUM_SETUP_CMDS 6
1087 extern int totalAccessPoints
;
1088 extern int accessPointNumber
[100];
1089 char setup_accesspoint
[64];
1092 void M_Menu_Setup_f (void)
1094 key_dest
= key_menu
;
1096 m_entersound
= true;
1097 Q_strcpy(setup_myname
, cl_name
.string
);
1098 Q_strcpy(setup_hostname
, hostname
.string
);
1099 setup_top
= setup_oldtop
= ((int)cl_color
.value
) >> 4;
1100 setup_bottom
= setup_oldbottom
= ((int)cl_color
.value
) & 15;
1103 if(totalAccessPoints
)
1105 sceUtilityGetNetParam(accessPointNumber
[(int)accesspoint
.value
], 0, (netData
*)setup_accesspoint
);
1110 int M_ColorForMap (int m
)
1112 return m
< 128 ? m
+ 8 : m
+ 8;
1115 void M_Setup_Draw (void)
1119 int top
, bottom
, tc
, bc
;
1123 if (setup_cursor
== 0+offset
)
1124 M_DrawCharacter (168 + 8*strlen(setup_hostname
), setup_cursor_table
[setup_cursor
], 10+((int)(realtime
*30)&1));
1126 if (setup_cursor
== 1+offset
)
1127 M_DrawCharacter (168 + 8*strlen(setup_myname
), setup_cursor_table
[setup_cursor
], 10+((int)(realtime
*30)&1));
1131 M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
1133 if (setup_cursor
== 0+offset
)
1134 M_DrawCharacter (168 + 8*strlen(setup_hostname
), setup_cursor_table
[setup_cursor
], 10+((int)(realtime
*4)&1));
1136 if (setup_cursor
== 1+offset
)
1137 M_DrawCharacter (168 + 8*strlen(setup_myname
), setup_cursor_table
[setup_cursor
], 10+((int)(realtime
*4)&1));
1139 b
= Draw_CachePic ("gfx/m_bttns.lmp");
1140 M_DrawPic ( (320-b
->width
)/2, 248, b
);
1141 p
= Draw_CachePic ("gfx/p_multi.lmp");
1142 M_DrawPic ( (320-p
->width
)/2, 4, p
);
1147 M_Print (64, 40, "Access Point");
1148 M_DrawTextBox (160, 32, 16, 1);
1149 M_Print (168, 40, setup_accesspoint
);
1152 M_Print (64, 40+offset
, "Host name");
1153 M_DrawTextBox (160, 32+offset
, 16, 1);
1154 M_Print (168, 56, setup_hostname
);
1156 M_Print (64, 56+offset
, "Player name");
1157 M_DrawTextBox (160, 48+offset
, 16, 1);
1158 M_Print (168, 56+offset
, setup_myname
);
1162 M_Print (64, 80+offset
, "Top color");
1163 M_Print (64, 104+offset
, "Bottom color");
1167 M_Print (64, 80+offset
, "Top color");
1168 M_Print (64, 104+offset
, "Team color");
1171 M_DrawTextBox (64, 140+offset
-8, 14, 1);
1172 M_Print (72, 140+offset
, "Accept Changes");
1174 p
= Draw_CachePic ("gfx/bigbox.lmp");
1175 M_DrawTransPic (160, 64+offset
, p
);
1177 tc
= (setup_top
& 15)<<4;
1178 bc
= (setup_bottom
& 15)<<4;
1179 top
= M_ColorForMap (tc
);
1180 bottom
= M_ColorForMap (bc
);
1182 Draw_Fill ( 248, 72+offset
, 56, 28, top
);
1183 Draw_Fill ( 248, 72+28+offset
, 56, 28, bottom
);
1187 p
= Draw_CachePic ("gfx/menuplyr.lmp");
1188 // M_BuildTranslationTable(setup_top*16, setup_bottom*16);
1189 // M_DrawTransPicTranslate (172, 72+offset, p);
1190 M_DrawTransPic (172, 72+offset
, p
);
1193 M_DrawCharacter (56, setup_cursor_table
[setup_cursor
], 12+((int)(realtime
*4)&1));
1203 void M_Setup_Key (int k
)
1211 M_Menu_MultiPlayer_f ();
1215 S_LocalSound ("misc/menu1.wav");
1217 if (setup_cursor
< 0)
1218 setup_cursor
= NUM_SETUP_CMDS
-1;
1222 S_LocalSound ("misc/menu1.wav");
1224 if (setup_cursor
>= NUM_SETUP_CMDS
)
1230 if (setup_cursor
== 0)
1232 S_LocalSound ("misc/menu3.wav");
1233 if(accesspoint
.value
> 1)
1235 Cvar_SetValue("accesspoint", accesspoint
.value
-1);
1236 sceUtilityGetNetParam(accessPointNumber
[(int)accesspoint
.value
], 0, (netData
*)setup_accesspoint
);
1241 if (setup_cursor
< 2+offset
)
1243 S_LocalSound ("misc/menu3.wav");
1244 if (setup_cursor
== 2+offset
)
1245 setup_top
= setup_top
- 1;
1246 if (setup_cursor
== 3+offset
)
1249 setup_bottom
= setup_bottom
- 1;
1257 if (setup_cursor
== 0)
1259 S_LocalSound ("misc/menu3.wav");
1260 if(accesspoint
.value
< totalAccessPoints
)
1262 Cvar_SetValue("accesspoint", accesspoint
.value
+1);
1263 sceUtilityGetNetParam(accessPointNumber
[(int)accesspoint
.value
], 0, (netData
*)setup_accesspoint
);
1270 if (setup_cursor
< 2+offset
)
1273 S_LocalSound ("misc/menu3.wav");
1274 if (setup_cursor
== 2+offset
)
1275 setup_top
= setup_top
+ 1;
1276 if (setup_cursor
== 3+offset
)
1279 setup_bottom
= setup_bottom
+ 1;
1290 if (setup_cursor
== 0+offset
)
1292 M_Menu_OSK_f(setup_hostname
, setup_hostname
, 16);
1296 if (setup_cursor
== 1+offset
)
1298 M_Menu_OSK_f(setup_myname
, setup_myname
,16);
1307 if (setup_cursor
== 0+offset
|| setup_cursor
== 1+offset
)
1310 if (setup_cursor
== 2+offset
|| setup_cursor
== 3+offset
)
1313 if (setup_cursor
< 4+offset
)
1316 // setup_cursor == 4 (OK)
1317 if (Q_strcmp(cl_name
.string
, setup_myname
) != 0)
1318 Cbuf_AddText ( va ("name \"%s\"\n", setup_myname
) );
1319 if (Q_strcmp(hostname
.string
, setup_hostname
) != 0)
1320 Cvar_Set("hostname", setup_hostname
);
1321 if (setup_top
!= setup_oldtop
|| setup_bottom
!= setup_oldbottom
)
1322 Cbuf_AddText( va ("color %i %i\n", setup_top
, setup_bottom
) );
1323 m_entersound
= true;
1324 M_Menu_MultiPlayer_f ();
1331 if (setup_cursor
== 0+offset
)
1333 if (strlen(setup_hostname
))
1334 setup_hostname
[strlen(setup_hostname
)-1] = 0;
1337 if (setup_cursor
== 1+offset
)
1339 if (strlen(setup_myname
))
1340 setup_myname
[strlen(setup_myname
)-1] = 0;
1345 if (k
< 32 || k
> 127)
1352 if (setup_cursor
== 0+offset
)
1354 l
= strlen(setup_hostname
);
1357 setup_hostname
[l
+1] = 0;
1358 setup_hostname
[l
] = k
;
1361 if (setup_cursor
== 1+offset
)
1363 l
= strlen(setup_myname
);
1366 setup_myname
[l
+1] = 0;
1367 setup_myname
[l
] = k
;
1376 if (setup_bottom
> 13)
1378 if (setup_bottom
< 0)
1382 //=============================================================================
1387 int m_net_saveHeight
;
1389 char *net_helpMessage
[] =
1391 /* .........1.........2.... */
1393 " Two computers connected",
1394 " through two modems. ",
1398 " Two computers connected",
1399 " by a null-modem cable. ",
1402 " Novell network LANs ",
1403 " or Windows 95 DOS-box. ",
1405 "(LAN=Local Area Network)",
1407 " Commonly used to play ",
1408 " over the Internet, but ",
1409 " also used on a Local ",
1413 void M_Menu_Net_f (void)
1415 key_dest
= key_menu
;
1417 m_entersound
= true;
1420 if (m_net_cursor
>= m_net_items
)
1423 M_Net_Key (K_DOWNARROW
);
1427 void M_Net_Draw (void)
1434 M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
1436 b
= Draw_CachePic ("gfx/m_bttns.lmp");
1437 M_DrawPic ( (320-b
->width
)/2, 248, b
);
1438 p
= Draw_CachePic ("gfx/p_multi.lmp");
1439 M_DrawPic ( (320-p
->width
)/2, 4, p
);
1443 if (serialAvailable
)
1445 p
= Draw_CachePic ("gfx/netmen1.lmp");
1452 p
= Draw_CachePic ("gfx/dim_modm.lmp");
1457 M_DrawTransPic (72, f
, p
);
1461 if (serialAvailable
)
1463 p
= Draw_CachePic ("gfx/netmen2.lmp");
1470 p
= Draw_CachePic ("gfx/dim_drct.lmp");
1475 M_DrawTransPic (72, f
, p
);
1479 p
= Draw_CachePic ("gfx/netmen3.lmp");
1481 p
= Draw_CachePic ("gfx/dim_ipx.lmp");
1482 M_DrawTransPic (72, f
, p
);
1486 p
= Draw_CachePic ("gfx/netmen4.lmp");
1488 p
= Draw_CachePic ("gfx/dim_tcp.lmp");
1489 M_DrawTransPic (72, f
, p
);
1491 if (m_net_items
== 5) // JDC, could just be removed
1494 p
= Draw_CachePic ("gfx/netmen5.lmp");
1495 M_DrawTransPic (72, f
, p
);
1499 M_DrawTextBox (f
, 134, 24, 4);
1501 M_Print (f
, 142, net_helpMessage
[m_net_cursor
*4+0]);
1502 M_Print (f
, 150, net_helpMessage
[m_net_cursor
*4+1]);
1503 M_Print (f
, 158, net_helpMessage
[m_net_cursor
*4+2]);
1504 M_Print (f
, 166, net_helpMessage
[m_net_cursor
*4+3]);
1506 f
= (int)(host_time
* 10)%6;
1507 M_DrawTransPic (54, 32 + m_net_cursor
* 20,Draw_CachePic( va("gfx/menudot%i.lmp", f
+1 ) ) );
1511 void M_Net_Key (int k
)
1517 M_Menu_MultiPlayer_f ();
1521 S_LocalSound ("misc/menu1.wav");
1522 if (++m_net_cursor
>= m_net_items
)
1527 S_LocalSound ("misc/menu1.wav");
1528 if (--m_net_cursor
< 0)
1529 m_net_cursor
= m_net_items
- 1;
1533 m_entersound
= true;
1535 switch (m_net_cursor
)
1538 M_Menu_SerialConfig_f ();
1542 M_Menu_SerialConfig_f ();
1546 M_Menu_LanConfig_f ();
1550 M_Menu_LanConfig_f ();
1559 if (m_net_cursor
== 0 && !serialAvailable
)
1561 if (m_net_cursor
== 1 && !serialAvailable
)
1563 if (m_net_cursor
== 2 && !ipxAvailable
)
1565 if (m_net_cursor
== 3 && !tcpipAvailable
)
1569 //=============================================================================
1571 #define SLIDER_RANGE 10
1572 #define NUM_SUBMENU 4
1573 #define KNUM_SUBMENU 4
1574 #ifdef PSP_HARDWARE_VIDEO
1589 OPT_SUBMENU_0
= OPT_SUBMENU
,
1599 OPT_IN_ACCELERATION
,
1608 OPT_SUBMENU_1
= OPT_SUBMENU
,
1614 OPT_MODEL_BRIGHTNESS
,
1625 OPT_SUBMENU_2
= OPT_SUBMENU
,
1637 OPT_SUBMENU_3
= OPT_SUBMENU
,
1650 OPT_SMOOTH_MOVEMENT
,
1665 OPT_SUBMENU_0
= OPT_SUBMENU
,
1678 OPT_SUBMENU_1
= OPT_SUBMENU
,
1683 OPT_IN_ACCELERATION
,
1697 void M_Menu_Options_f (void)
1699 key_dest
= key_menu
;
1700 m_state
= m_options
;
1701 m_entersound
= true;
1704 #ifdef PSP_HARDWARE_VIDEO
1705 extern int changeMp3Volume
;
1708 void M_AdjustSliders (int dir
)
1710 S_LocalSound ("misc/menu3.wav");
1712 switch (options_cursor
)
1718 if (m_submenu
> KNUM_SUBMENU
-1)
1720 else if (m_submenu
< 0)
1721 m_submenu
= KNUM_SUBMENU
-1;
1726 if (m_submenu
> NUM_SUBMENU
-1)
1728 else if (m_submenu
< 0)
1729 m_submenu
= NUM_SUBMENU
-1;
1736 switch (options_cursor
)
1738 case OPT_IN_SPEED
: // mouse speed
1739 in_sensitivity
.value
+= dir
* 1;
1740 if (in_sensitivity
.value
< 1)
1741 in_sensitivity
.value
= 1;
1742 if (in_sensitivity
.value
> 33)
1743 in_sensitivity
.value
= 33;
1744 Cvar_SetValue ("sensitivity", in_sensitivity
.value
);
1747 case OPT_IN_TOLERANCE
: // mouse tolerance
1748 in_tolerance
.value
+= dir
* 0.01;
1749 if (in_tolerance
.value
< 0)
1750 in_tolerance
.value
= 0;
1751 if (in_tolerance
.value
> 0.5)
1752 in_tolerance
.value
= 0.5;
1753 Cvar_SetValue ("tolerance", in_tolerance
.value
);
1756 case OPT_IN_ACCELERATION
: // mouse tolerance
1757 in_acceleration
.value
-= dir
* 0.25;
1758 if (in_acceleration
.value
< 0.5)
1759 in_acceleration
.value
= 0.5;
1760 if (in_acceleration
.value
> 2)
1761 in_acceleration
.value
= 2;
1762 Cvar_SetValue ("acceleration", in_acceleration
.value
);
1765 case OPT_IN_X_ADJUST
:
1766 in_x_axis_adjust
.value
+= dir
* 1;
1767 if (in_x_axis_adjust
.value
< 1)
1768 in_x_axis_adjust
.value
= 1;
1769 if (in_x_axis_adjust
.value
> 11)
1770 in_x_axis_adjust
.value
= 11;
1771 Cvar_SetValue ("in_x_axis_adjust", in_x_axis_adjust
.value
);
1774 case OPT_IN_Y_ADJUST
:
1775 in_y_axis_adjust
.value
+= dir
* 1;
1776 if (in_y_axis_adjust
.value
< 1)
1777 in_y_axis_adjust
.value
= 1;
1778 if (in_y_axis_adjust
.value
> 11)
1779 in_y_axis_adjust
.value
= 11;
1780 Cvar_SetValue ("in_y_axis_adjust", in_y_axis_adjust
.value
);
1783 case OPT_INVMOUSE
: // invert mouse
1784 Cvar_SetValue ("m_pitch", -m_pitch
.value
);
1787 case OPT_NOMOUSE
: // disable mouse
1788 Cvar_SetValue ("in_disable_analog", !in_disable_analog
.value
);
1791 case OPT_AUTOCENTER
: // auto center looking for digital keys
1792 Cvar_SetValue ("lookcenter", !lookcenter
.value
);
1795 case OPT_MOUSESTRAFE
:
1796 Cvar_SetValue ("in_analog_strafe", !in_analog_strafe
.value
);
1800 Cvar_SetValue ("in_freelook_analog", !in_freelook_analog
.value
);
1803 case OPT_ALWAYRUN
: // allways run
1806 if (cl_forwardspeed
.value
> 150)
1808 Cvar_SetValue ("cl_forwardspeed", 150);
1809 Cvar_SetValue ("cl_backspeed", 150);
1813 Cvar_SetValue ("cl_forwardspeed", 200);
1814 Cvar_SetValue ("cl_backspeed", 200);
1819 if (cl_forwardspeed
.value
> 200)
1821 Cvar_SetValue ("cl_forwardspeed", 200);
1822 Cvar_SetValue ("cl_backspeed", 200);
1826 Cvar_SetValue ("cl_forwardspeed", 400);
1827 Cvar_SetValue ("cl_backspeed", 400);
1833 else if (m_submenu
== 1)
1835 switch (options_cursor
)
1837 case OPT_GAMMA
: // gamma
1838 v_gamma
.value
-= dir
* 0.05;
1839 if (v_gamma
.value
< 0.5)
1840 v_gamma
.value
= 0.5;
1841 if (v_gamma
.value
> 1)
1843 Cvar_SetValue ("gamma", v_gamma
.value
);
1846 case OPT_MAXFPS
: // frame rate controller
1847 max_fps
.value
+= dir
* 5;
1848 if (max_fps
.value
< 30)
1850 if (max_fps
.value
> 65)
1852 Cvar_SetValue ("max_fps", max_fps
.value
);
1856 Cvar_SetValue ("r_vsync", !r_vsync
.value
);
1859 case OPT_MODEL_BRIGHTNESS
:
1860 Cvar_SetValue ("r_model_brightness", !r_model_brightness
.value
);
1864 Cvar_SetValue ("show_fps", !show_fps
.value
);
1868 Cvar_SetValue ("r_dynamic", !r_dynamic
.value
);
1870 #ifdef PSP_HARDWARE_VIDEO
1871 case OPT_SIMPLE_PART
:
1872 Cvar_SetValue ("r_particles_simple", !r_particles_simple
.value
);
1876 Cvar_SetValue ("r_antialias", !r_antialias
.value
);
1880 Cvar_SetValue ("r_mipmaps", !r_mipmaps
.value
);
1885 else if (m_submenu
== 2)
1887 switch (options_cursor
)
1890 case OPT_MUSICTRACK:
1896 Cvar_SetValue ("cd play", track);
1899 case OPT_MUSICVOL
: // music volume
1901 bgmvolume
.value
+= dir
* 1.0;
1903 bgmvolume
.value
+= dir
* 0.1;
1905 if (bgmvolume
.value
< 0)
1906 bgmvolume
.value
= 0;
1907 if (bgmvolume
.value
> 1)
1908 bgmvolume
.value
= 1;
1909 Cvar_SetValue ("bgmvolume", bgmvolume
.value
);
1910 #ifdef PSP_MP3HARDWARE_MP3LIB
1911 changeMp3Volume
= 1;
1915 case OPT_SNDVOL
: // sfx volume
1916 volume
.value
+= dir
* 0.1;
1917 if (volume
.value
< 0)
1919 if (volume
.value
> 1)
1921 Cvar_SetValue ("volume", volume
.value
);
1924 case OPT_MUSICTYPE: // bgm type
1925 if (strcmpi(bgmtype.string,"cd") == 0)
1927 Cvar_Set("bgmtype","none");
1928 bmg_type_changed = true;
1932 Cvar_Set("bgmtype","cd");
1933 bmg_type_changed = true;
1939 else if (m_submenu
== 3)
1941 switch (options_cursor
)
1943 case OPT_FOG_START
: // Fog start distance from viewpoint
1944 r_refdef
.fog_start
+= dir
* 100;
1945 if (r_refdef
.fog_start
< -5000)
1946 r_refdef
.fog_start
= -5000;
1947 if (r_refdef
.fog_start
> 5000)
1948 r_refdef
.fog_start
= 5000;
1951 case OPT_FOG_END
: // Fog end distance from viewpoint
1952 r_refdef
.fog_end
+= dir
* 100;
1953 if (r_refdef
.fog_end
< -5000)
1954 r_refdef
.fog_end
= -5000;
1955 if (r_refdef
.fog_end
> 5000)
1956 r_refdef
.fog_end
= 5000;
1959 case OPT_FOG_RED
: // Fog red
1960 r_refdef
.fog_red
+= dir
* 5;
1961 if (r_refdef
.fog_red
< 0)
1962 r_refdef
.fog_red
= 0;
1963 if (r_refdef
.fog_red
> 100)
1964 r_refdef
.fog_red
= 100;
1967 case OPT_FOG_GREEN
: // Fog green
1968 r_refdef
.fog_green
+= dir
* 5;
1969 if (r_refdef
.fog_green
< 0)
1970 r_refdef
.fog_green
= 0;
1971 if (r_refdef
.fog_green
> 100)
1972 r_refdef
.fog_green
= 100;
1975 case OPT_FOG_BLUE
: // Fog blue
1976 r_refdef
.fog_blue
+= dir
* 5;
1977 if (r_refdef
.fog_blue
< 0)
1978 r_refdef
.fog_blue
= 0;
1979 if (r_refdef
.fog_blue
> 100)
1980 r_refdef
.fog_blue
= 100;
1983 case OPT_SCRSIZE
: // screen size
1984 scr_viewsize
.value
+= dir
* 10;
1985 if (scr_viewsize
.value
< 30)
1986 scr_viewsize
.value
= 30;
1987 if (scr_viewsize
.value
> 130)
1988 scr_viewsize
.value
= 130;
1989 Cvar_SetValue ("viewsize", scr_viewsize
.value
);
1992 case OPT_WATERTRANS
: // wateralpha
1993 r_wateralpha
.value
+= dir
* 0.1;
1994 if (r_wateralpha
.value
< 0)
1995 r_wateralpha
.value
= 0;
1996 if (r_wateralpha
.value
> 1)
1997 r_wateralpha
.value
= 1;
1999 Cvar_SetValue ("r_wateralpha", r_wateralpha
.value
);
2002 case OPT_MIPMAP_BIAS
: // mipmapping bais
2003 r_mipmaps_bias
.value
+= dir
* 0.5;
2004 if (r_mipmaps_bias
.value
< -10)
2005 r_mipmaps_bias
.value
= -10;
2006 if (r_mipmaps_bias
.value
> 0)
2007 r_mipmaps_bias
.value
= 0;
2009 Cvar_SetValue ("r_mipmaps_bias", r_mipmaps_bias
.value
);
2012 case OPT_TEX_SCALEDOWN
:
2013 Cvar_SetValue ("r_tex_scale_down", !r_tex_scale_down
.value
);
2016 case OPT_SMOOTH_ANIMS
:
2017 Cvar_SetValue ("r_i_model_animation", !r_i_model_animation
.value
);
2020 case OPT_SMOOTH_MOVEMENT
:
2021 Cvar_SetValue ("r_i_model_transform", !r_i_model_transform
.value
);
2028 void M_DrawSlider (int x
, int y
, float range
)
2036 M_DrawCharacter (x
-8, y
, 128);
2037 for (i
=0 ; i
<SLIDER_RANGE
; i
++)
2038 M_DrawCharacter (x
+ i
*8, y
, 129);
2039 M_DrawCharacter (x
+i
*8, y
, 130);
2040 M_DrawCharacter (x
+ (SLIDER_RANGE
-1)*8 * range
, y
, 131);
2043 void M_Options_Draw (void)
2052 p
= Draw_CachePic ("gfx/menu/option_0.lmp");
2053 M_DrawPic ( (320-p
->width
)/2, 36, p
);
2056 M_DrawCharacter (200, offset
+ options_cursor
*8, 12+((int)(realtime
*30)&1));
2060 M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
2061 p
= Draw_CachePic ("gfx/p_option.lmp");
2062 M_DrawPic ( (320-p
->width
)/2, 4, p
);
2065 M_DrawCharacter (200, offset
+ options_cursor
*8, 12+((int)(realtime
*4)&1));
2068 b
= Draw_CachePic ("gfx/m_bttns.lmp");
2069 M_DrawPic ( (320-b
->width
)/2, 248, b
);
2071 M_Print (16, offset
+(OPT_CUSTOMIZE
*8), " Customize Buttons");
2072 M_Print (16, offset
+(OPT_CONSOLE
*8), " Go to console");
2074 M_Print (16, offset
+(OPT_DEFAULTS1
*8), " Load defaults");
2075 // M_Print (16, offset+(OPT_DEFAULTS2*8), " 'Golden' defaults");
2076 // M_Print (16, offset+(OPT_DEFAULTS3*8), " 'Digital' defaults");
2083 M_Print (16, offset
+(OPT_IN_SPEED
*8), " Analog Speed");
2085 M_Print (16, offset
+(OPT_IN_SPEED
*8), " Mouse Speed");
2087 r
= (in_sensitivity
.value
- 1)/33;
2088 M_DrawSlider (220, offset
+(OPT_IN_SPEED
*8), r
);
2090 M_Print (16, offset
+(OPT_IN_ACCELERATION
*8), " Analog Acceleration");
2091 r
= 1.0f
-((in_acceleration
.value
- 0.5f
)/1.5f
);
2092 M_DrawSlider (220, offset
+(OPT_IN_ACCELERATION
*8), r
);
2094 M_Print (16, offset
+(OPT_IN_TOLERANCE
*8), " Analog Tolerance");
2095 r
= (in_tolerance
.value
)/1.0f
;
2096 M_DrawSlider (220, offset
+(OPT_IN_TOLERANCE
*8), r
);
2098 M_Print (16, offset
+(OPT_IN_X_ADJUST
*8), " Analog Speed X Axis");
2099 r
= (in_x_axis_adjust
.value
- 1)/10;
2100 M_DrawSlider (220, offset
+(OPT_IN_X_ADJUST
*8), r
);
2102 M_Print (16, offset
+(OPT_IN_Y_ADJUST
*8), " Analog Speed Y Axis");
2103 r
= (in_y_axis_adjust
.value
- 1)/10;
2104 M_DrawSlider (220, offset
+(OPT_IN_Y_ADJUST
*8), r
);
2107 M_Print (16, offset
+(OPT_INVMOUSE
*8), " Invert Analog");
2109 M_Print (16, offset
+(OPT_INVMOUSE
*8), " Invert Mouse");
2111 M_DrawCheckbox (220, offset
+(OPT_INVMOUSE
*8), m_pitch
.value
< 0);
2113 M_Print (16, offset
+(OPT_MOUSELOOK
*8), " Analog Mode");
2114 if (in_freelook_analog
.value
== 1)
2115 M_Print (220, offset
+(OPT_MOUSELOOK
*8), "Look");
2117 M_Print (220, offset
+(OPT_MOUSELOOK
*8), "Move");
2119 M_Print (16, offset
+(OPT_NOMOUSE
*8), " Disable Analog");
2120 M_DrawCheckbox (220, offset
+(OPT_NOMOUSE
*8), in_disable_analog
.value
);
2122 M_Print (16, offset
+(OPT_AUTOCENTER
*8), "Autocenter Button Look");
2123 M_DrawCheckbox (220, offset
+(OPT_AUTOCENTER
*8), !lookcenter
.value
);
2125 M_Print (16, offset
+(OPT_MOUSESTRAFE
*8), " Analog Strafing");
2126 M_DrawCheckbox (220, offset
+(OPT_MOUSESTRAFE
*8), in_analog_strafe
.value
);
2128 M_Print (16, offset
+(OPT_ALWAYRUN
*8), " Always Run");
2130 M_DrawCheckbox (220, offset
+(OPT_ALWAYRUN
*8), cl_forwardspeed
.value
> 150);
2132 M_DrawCheckbox (220, offset
+(OPT_ALWAYRUN
*8), cl_forwardspeed
.value
> 200);
2138 M_Print (16, offset
+(OPT_GAMMA
*8), " Brightness");
2139 r
= (1.0 - v_gamma
.value
) / 0.5;
2140 M_DrawSlider (220, offset
+(OPT_GAMMA
*8), r
);
2142 M_Print (16, offset
+(OPT_VSYNC
*8), " VSync");
2143 M_DrawCheckbox (220, offset
+(OPT_VSYNC
*8), r_vsync
.value
);
2145 M_Print (16, offset
+(OPT_DYNAMIC
*8), " Dynamic Lighting");
2146 M_DrawCheckbox (220, offset
+(OPT_DYNAMIC
*8), r_dynamic
.value
);
2148 M_Print (16, offset
+(OPT_MODEL_BRIGHTNESS
*8), " Brighter Models");
2149 M_DrawCheckbox (220, offset
+(OPT_MODEL_BRIGHTNESS
*8), r_model_brightness
.value
);
2151 M_Print (16, offset
+(OPT_MAXFPS
*8), " Maximum Frame Rate");
2152 r
= (max_fps
.value
- 30) / (65 - 30);
2153 M_DrawSlider (220, offset
+(OPT_MAXFPS
*8), r
);
2155 M_Print (16, offset
+(OPT_FPS
*8), " Display Frame rate");
2156 M_DrawCheckbox (220, offset
+(OPT_FPS
*8), show_fps
.value
);
2158 #ifdef PSP_HARDWARE_VIDEO
2160 M_Print (16, offset
+(OPT_SIMPLE_PART
*8), " Simple Particles");
2161 M_DrawCheckbox (220, offset
+(OPT_SIMPLE_PART
*8), r_particles_simple
.value
);
2163 M_Print (16, offset
+(OPT_ANTIALIAS
*8), " Anti-Aliasing");
2164 M_DrawCheckbox (220, offset
+(OPT_ANTIALIAS
*8), r_antialias
.value
);
2166 M_Print (16, offset
+(OPT_MIPMAPS
*8), " MipMapping");
2167 M_DrawCheckbox (220, offset
+(OPT_MIPMAPS
*8), r_mipmaps
.value
);
2174 M_Print (16, offset+(OPT_MUSICTRACK*8), " Music Track");
2176 M_DrawSlider (220, offset+(OPT_MUSICTRACK*8), r);
2179 M_Print (16, offset
+(OPT_MUSICVOL
*8), " MP3 Music Volume");
2180 r
= bgmvolume
.value
;
2181 M_DrawSlider (220, offset
+(OPT_MUSICVOL
*8), r
);
2183 M_Print (16, offset
+(OPT_SNDVOL
*8), " Sound Volume");
2185 M_DrawSlider (220, offset
+(OPT_SNDVOL
*8), r
);
2187 M_Print (16, offset+(OPT_MUSICTYPE*8)," MP3 Playback");
2188 if (strcmpi(bgmtype.string,"cd") == 0)
2189 M_Print (220, offset+(OPT_MUSICTYPE*8), "On");
2191 M_Print (220, offset+(OPT_MUSICTYPE*8), "Off");
2197 M_Print (16, offset
+(OPT_FOG_START
*8), " Fog start distance");
2198 r
= (r_refdef
.fog_start
- (-5000)) / ((5000) - (-5000));
2199 M_DrawSlider (220, offset
+(OPT_FOG_START
*8), r
);
2201 M_Print (16, offset
+(OPT_FOG_END
*8), " Fog end distance");
2202 r
= (r_refdef
.fog_end
- (-5000)) / ((5000) - (-5000));
2203 M_DrawSlider (220, offset
+(OPT_FOG_END
*8), r
);
2205 M_Print (16, offset
+(OPT_FOG_RED
*8), " Fog red amount");
2206 r
= (r_refdef
.fog_red
) / 100;
2207 M_DrawSlider (220, offset
+(OPT_FOG_RED
*8), r
);
2209 M_Print (16, offset
+(OPT_FOG_GREEN
*8), " Fog green amount");
2210 r
= (r_refdef
.fog_green
) / 100;
2211 M_DrawSlider (220, offset
+(OPT_FOG_GREEN
*8), r
);
2213 M_Print (16, offset
+(OPT_FOG_BLUE
*8), " Fog blue amount");
2214 r
= (r_refdef
.fog_blue
) / 100;
2215 M_DrawSlider (220, offset
+(OPT_FOG_BLUE
*8), r
);
2217 M_Print (16, offset
+(OPT_SCRSIZE
*8), " Screen size");
2218 r
= (scr_viewsize
.value
- 30) / (130 - 30);
2219 M_DrawSlider (220, offset
+(OPT_SCRSIZE
*8), r
);
2221 M_Print (16, offset
+(OPT_WATERTRANS
*8), " Water tranparency");
2222 M_DrawSlider (220, offset
+(OPT_WATERTRANS
*8), r_wateralpha
.value
);
2224 M_Print (16, offset
+(OPT_MIPMAP_BIAS
*8), " MipMap Amount");
2225 r
= (r_mipmaps_bias
.value
+ 10) / 10;
2226 M_DrawSlider (220, offset
+(OPT_MIPMAP_BIAS
*8), r
);
2228 M_Print (16, offset
+(OPT_TEX_SCALEDOWN
*8), " Texture Scale Down");
2229 M_DrawCheckbox (220, offset
+(OPT_TEX_SCALEDOWN
*8), r_tex_scale_down
.value
);
2231 M_Print (16, offset
+(OPT_SMOOTH_ANIMS
*8), "Smooth Model Animation");
2232 M_DrawCheckbox (220, offset
+(OPT_SMOOTH_ANIMS
*8), r_i_model_animation
.value
);
2234 M_Print (16, offset
+(OPT_SMOOTH_MOVEMENT
*8), " Smooth Model Movement");
2235 M_DrawCheckbox (220, offset
+(OPT_SMOOTH_MOVEMENT
*8), r_i_model_transform
.value
);
2241 M_PrintWhite (16, offset
+(OPT_SUBMENU
*8), " Select Submenu");
2245 M_PrintWhite (220, offset
+(OPT_SUBMENU
*8), "Control Options");
2248 M_PrintWhite (220, offset
+(OPT_SUBMENU
*8), "Video Options");
2251 M_PrintWhite (220, offset
+(OPT_SUBMENU
*8), "Audio Options");
2254 M_PrintWhite (220, offset
+(OPT_SUBMENU
*8), "Misc. Options");
2262 void M_Options_Key (int k
)
2271 m_entersound
= true;
2272 switch (options_cursor
)
2279 Con_ToggleConsole_f ();
2282 Cbuf_AddText ("exec default.cfg\n");
2283 // Cbuf_AddText ("-klook\n");
2287 Cbuf_AddText ("exec default2.cfg\n");
2288 Cbuf_AddText ("+klook\n");
2291 Cbuf_AddText ("exec default3.cfg\n");
2292 Cbuf_AddText ("+klook\n");
2296 M_AdjustSliders (1);
2302 S_LocalSound ("misc/menu1.wav");
2305 if (options_cursor
== OPT_GAP
)
2306 options_cursor
= options_cursor
-1;
2308 if (options_cursor
== OPT_GAP1
)
2309 options_cursor
= options_cursor
-1;
2313 if (options_cursor
== OPT_GAP_0
)
2314 options_cursor
= options_cursor
-1;
2315 if (options_cursor
== OPT_GAP_0_1
)
2316 options_cursor
= options_cursor
-1;
2317 if (options_cursor
== OPT_GAP_0_2
)
2318 options_cursor
= options_cursor
-1;
2323 if (options_cursor
== OPT_GAP_1
)
2324 options_cursor
= options_cursor
-1;
2325 if (options_cursor
== OPT_GAP_1_1
)
2326 options_cursor
= options_cursor
-1;
2331 if (options_cursor
== OPT_GAP_2
)
2332 options_cursor
= options_cursor
-1;
2333 if (options_cursor
== OPT_GAP_2_1
)
2334 options_cursor
= options_cursor
-1;
2339 if (options_cursor
== OPT_GAP_3
)
2340 options_cursor
= options_cursor
-1;
2341 if (options_cursor
== OPT_GAP_3_1
)
2342 options_cursor
= options_cursor
-1;
2345 if (options_cursor
< 0) {
2347 options_cursor
= OPTIONS_ITEMS_0
-1;
2349 options_cursor
= OPTIONS_ITEMS_1
-1;
2351 options_cursor
= OPTIONS_ITEMS_2
-1;
2353 options_cursor
= OPTIONS_ITEMS_3
-1;
2358 S_LocalSound ("misc/menu1.wav");
2361 if (options_cursor
== OPT_GAP
)
2362 options_cursor
= options_cursor
+1;
2364 if (options_cursor
== OPT_GAP1
)
2365 options_cursor
= options_cursor
+1;
2369 if (options_cursor
>= OPTIONS_ITEMS_0
)
2371 if (options_cursor
== OPT_GAP_0
)
2372 options_cursor
= options_cursor
+1;
2373 if (options_cursor
== OPT_GAP_0_1
)
2374 options_cursor
= options_cursor
+1;
2375 if (options_cursor
== OPT_GAP_0_2
)
2376 options_cursor
= options_cursor
+1;
2380 if (options_cursor
>= OPTIONS_ITEMS_1
)
2382 if (options_cursor
== OPT_GAP_1
)
2383 options_cursor
= options_cursor
+1;
2384 if (options_cursor
== OPT_GAP_1_1
)
2385 options_cursor
= options_cursor
+1;
2389 if (options_cursor
>= OPTIONS_ITEMS_2
)
2391 if (options_cursor
== OPT_GAP_2
)
2392 options_cursor
= options_cursor
+1;
2393 if (options_cursor
== OPT_GAP_2_1
)
2394 options_cursor
= options_cursor
+1;
2398 if (options_cursor
>= OPTIONS_ITEMS_3
)
2400 if (options_cursor
== OPT_GAP_3
)
2401 options_cursor
= options_cursor
+1;
2402 if (options_cursor
== OPT_GAP_3_1
)
2403 options_cursor
= options_cursor
+1;
2408 M_AdjustSliders (-1);
2412 M_AdjustSliders (1);
2417 options_cursor
= OPT_SUBMENU
;
2424 options_cursor
= OPT_SUBMENU
;
2431 //=============================================================================
2434 char *bindnames
[][2] =
2436 {"+attack", "Attack"},
2437 {"impulse 10", "Next Weapon"},
2438 {"impulse 12", "Previous Weapon"},
2439 {"+jump", "Jump / Swim Up"},
2440 {"+forward", "Move Forward"},
2441 {"+back", "Move Backwards"},
2442 {"+moveleft", "Move Left"},
2443 {"+moveright", "Move Right"},
2444 {"+left", "Turn Left"},
2445 {"+right", "Turn Right"},
2446 {"+lookup", "Look up"},
2447 {"+lookdown", "Look down"},
2448 {"+moveup", "Swim Up"},
2449 {"+movedown", "Swim Down"},
2451 {"+strafe", "Sidestep"},
2452 {"centerview", "Center view"},
2454 {"+mlook", "Analog Nub Look"},
2455 {"+klook", "D-Pad Look"},
2457 {"+mlook", "Mouse Look"},
2458 {"+klook", "Keyboard Look"},
2460 {"+showscores", "Show Scores"},
2461 {"screenshot", "Screenshot"},
2462 {"toggleconsole", "Toggle Console"},
2465 char *kbindnames
[][2] =
2467 {"+attack", "Attack"},
2468 {"impulse 10", "Next Weapon"},
2469 {"impulse 12", "Previous Weapon"},
2470 {"impulse 13", "Reload / Secondary"},
2471 {"impulse 14", "Zoom"},
2472 {"+jump", "Jump / Swim Up"},
2473 {"+forward", "Move Forward"},
2474 {"+back", "Move Backwards"},
2475 {"+moveleft", "Move Left"},
2476 {"+moveright", "Move Right"},
2477 {"+left", "Turn Left"},
2478 {"+right", "Turn Right"},
2479 {"+lookup", "Look up"},
2480 {"+lookdown", "Look down"},
2481 {"+moveup", "Swim Up"},
2482 {"+movedown", "Swim Down"},
2484 {"+strafe", "Sidestep"},
2485 {"centerview", "Center view"},
2487 {"+mlook", "Analog Nub Look"},
2488 {"+klook", "D-Pad Look"},
2490 {"+mlook", "Mouse Look"},
2491 {"+klook", "Keyboard Look"},
2493 {"+showscores", "Show Scores"},
2494 {"screenshot", "Screenshot"},
2495 {"toggleconsole", "Toggle Console"},
2498 #define NUMCOMMANDS (sizeof(bindnames)/sizeof(bindnames[0]))
2499 #define KNUMCOMMANDS (sizeof(kbindnames)/sizeof(kbindnames[0]))
2504 void M_Menu_Keys_f (void)
2506 key_dest
= key_menu
;
2508 m_entersound
= true;
2512 void M_FindKeysForCommand (char *command
, int *twokeys
)
2519 twokeys
[0] = twokeys
[1] = -1;
2520 l
= strlen(command
);
2523 for (j
=0 ; j
<256 ; j
++)
2528 if (!strncmp (b
, command
, l
) )
2538 void M_UnbindCommand (char *command
)
2544 l
= strlen(command
);
2546 for (j
=0 ; j
<256 ; j
++)
2551 if (!strncmp (b
, command
, l
) )
2552 Key_SetBinding (j
, "");
2557 void M_Keys_Draw (void)
2565 p
= Draw_CachePic ("gfx/ttl_cstm.lmp");
2566 M_DrawPic ( (320-p
->width
)/2, 4, p
);
2568 b
= Draw_CachePic ("gfx/m_bttns.lmp");
2569 M_DrawPic ( (320-b
->width
)/2, 248, b
);
2573 M_Print (12, 32, "Press a button for this action");
2575 M_Print (18, 32, "Press CROSS to change, TRIANGLE to clear");
2578 M_Print (12, 32, "Press a key or button for this action");
2580 M_Print (18, 32, "Enter to change, backspace to clear");
2583 // search for known bindings
2587 M_DrawCharacter (170, 48 + keys_cursor
*8, '?');
2589 M_DrawCharacter (170, 48 + keys_cursor
*8, 12+((int)(realtime
*30)&1));
2591 for (i
=0 ; i
<KNUMCOMMANDS
; i
++)
2595 M_Print (16, y
, kbindnames
[i
][1]);
2597 l
= strlen (kbindnames
[i
][0]);
2599 M_FindKeysForCommand (kbindnames
[i
][0], keys
);
2603 M_Print (180, y
, "---");
2607 name
= Key_KeynumToString (keys
[0]);
2608 M_Print (180, y
, name
);
2609 x
= strlen(name
) * 8;
2612 M_Print (180 + x
+ 8, y
, "or");
2613 M_Print (180 + x
+ 32, y
, Key_KeynumToString (keys
[1]));
2621 M_DrawCharacter (130, 48 + keys_cursor
*8, '=');
2623 M_DrawCharacter (130, 48 + keys_cursor
*8, 12+((int)(realtime
*4)&1));
2625 for (i
=0 ; i
<NUMCOMMANDS
; i
++)
2629 M_Print (16, y
, bindnames
[i
][1]);
2631 l
= strlen (bindnames
[i
][0]);
2633 M_FindKeysForCommand (bindnames
[i
][0], keys
);
2637 M_Print (140, y
, "???");
2641 name
= Key_KeynumToString (keys
[0]);
2642 M_Print (140, y
, name
);
2643 x
= strlen(name
) * 8;
2646 M_Print (140 + x
+ 8, y
, "or");
2647 M_Print (140 + x
+ 32, y
, Key_KeynumToString (keys
[1]));
2655 void M_Keys_Key (int k
)
2662 S_LocalSound ("misc/menu1.wav");
2670 sprintf (cmd
, "bind \"%s\" \"%s\"\n", Key_KeynumToString (k
), kbindnames
[keys_cursor
][0]);
2672 sprintf (cmd
, "bind \"%s\" \"%s\"\n", Key_KeynumToString (k
), bindnames
[keys_cursor
][0]);
2673 Cbuf_InsertText (cmd
);
2683 M_Menu_Options_f ();
2688 S_LocalSound ("misc/menu1.wav");
2690 if (keys_cursor
< 0)
2693 keys_cursor
= KNUMCOMMANDS
-1;
2695 keys_cursor
= NUMCOMMANDS
-1;
2701 S_LocalSound ("misc/menu1.wav");
2705 if (keys_cursor
>= KNUMCOMMANDS
)
2710 if (keys_cursor
>= NUMCOMMANDS
)
2715 case K_ENTER
: // go into bind mode
2717 M_FindKeysForCommand (kbindnames
[keys_cursor
][0], keys
);
2719 M_FindKeysForCommand (bindnames
[keys_cursor
][0], keys
);
2720 S_LocalSound ("misc/menu2.wav");
2724 M_UnbindCommand (kbindnames
[keys_cursor
][0]);
2726 M_UnbindCommand (bindnames
[keys_cursor
][0]);
2731 case K_BACKSPACE
: // delete bindings
2732 case K_DEL
: // delete bindings
2733 S_LocalSound ("misc/menu2.wav");
2735 M_UnbindCommand (kbindnames
[keys_cursor
][0]);
2737 M_UnbindCommand (bindnames
[keys_cursor
][0]);
2742 //=============================================================================
2745 void M_Menu_Video_f (void)
2747 key_dest
= key_menu
;
2749 m_entersound
= true;
2753 void M_Video_Draw (void)
2755 (*vid_menudrawfn
) ();
2759 void M_Video_Key (int key
)
2761 (*vid_menukeyfn
) (key
);
2764 //=============================================================================
2768 #define NUM_HELP_PAGES 6
2769 #define KNUM_HELP_PAGES 2
2772 void M_Menu_Help_f (void)
2774 key_dest
= key_menu
;
2776 m_entersound
= true;
2782 void M_Help_Draw (void)
2785 M_DrawPic (vid
.width
- 560, 0, Draw_CachePic ( va("gfx/menu/hp/help%i.lmp", help_page
)) );
2787 M_DrawPic (0, 0, Draw_CachePic ( va("gfx/help%i.lmp", help_page
)) );
2791 void M_Help_Key (int key
)
2801 m_entersound
= true;
2804 if (++help_page
>= NUM_HELP_PAGES
)
2809 if (++help_page
>= KNUM_HELP_PAGES
)
2816 m_entersound
= true;
2819 if (--help_page
< 0)
2820 help_page
= NUM_HELP_PAGES
-1;
2824 if (--help_page
< 0)
2825 help_page
= KNUM_HELP_PAGES
-1;
2832 //=============================================================================
2836 int m_quit_prevstate
;
2837 qboolean wasInMenus
;
2840 char *quitMessage
[] =
2842 /* .........1.........2.... */
2843 " Are you gonna quit ",
2844 " this game just like ",
2845 " everything else? ",
2848 " Milord, methinks that ",
2849 " thou art a lowly ",
2850 " quitter. Is this true? ",
2853 " Do I need to bust your ",
2854 " face open for trying ",
2858 " Man, I oughta smack you",
2859 " for trying to quit! ",
2863 " Press Y to quit like a ",
2864 " big loser in life. ",
2865 " Press N to stay proud ",
2866 " and successful! ",
2868 " If you press Y to ",
2869 " quit, I will summon ",
2870 " Satan all over your ",
2873 " Um, Asmodeus dislikes ",
2874 " his children trying to ",
2875 " quit. Press Y to return",
2876 " to your Tinkertoys. ",
2878 " If you quit now, I'll ",
2879 " throw a blanket-party ",
2880 " for you next time! ",
2885 void M_Menu_Quit_f (void)
2887 if (m_state
== m_quit
)
2889 wasInMenus
= (key_dest
== key_menu
);
2890 key_dest
= key_menu
;
2891 m_quit_prevstate
= m_state
;
2893 m_entersound
= true;
2894 msgNumber
= rand()&7;
2898 void M_Quit_Key (int key
)
2907 m_state
= m_quit_prevstate
;
2908 m_entersound
= true;
2912 key_dest
= key_game
;
2922 key_dest
= key_console
;
2933 void M_Quit_Draw (void)
2937 m_state
= m_quit_prevstate
;
2938 m_recursiveDraw
= true;
2944 M_DrawTextBox (0, 0, 38, 23);
2945 M_PrintWhite (16, 12, " Quake version 1.09 by id Software\n\n");
2946 M_PrintWhite (16, 28, "Programming Art \n");
2947 M_Print (16, 36, " John Carmack Adrian Carmack\n");
2948 M_Print (16, 44, " Michael Abrash Kevin Cloud\n");
2949 M_Print (16, 52, " John Cash Paul Steed\n");
2950 M_Print (16, 60, " Dave 'Zoid' Kirsch\n");
2951 M_PrintWhite (16, 68, "Design Biz\n");
2952 M_Print (16, 76, " John Romero Jay Wilbur\n");
2953 M_Print (16, 84, " Sandy Petersen Mike Wilson\n");
2954 M_Print (16, 92, " American McGee Donna Jackson\n");
2955 M_Print (16, 100, " Tim Willits Todd Hollenshead\n");
2956 M_PrintWhite (16, 108, "Support Projects\n");
2957 M_Print (16, 116, " Barrett Alexander Shawn Green\n");
2958 M_PrintWhite (16, 124, "Sound Effects\n");
2959 M_Print (16, 132, " Trent Reznor and Nine Inch Nails\n\n");
2960 M_PrintWhite (16, 140, "Quake is a trademark of Id Software,\n");
2961 M_PrintWhite (16, 148, "inc., (c)1996 Id Software, inc. All\n");
2962 M_PrintWhite (16, 156, "rights reserved. NIN logo is a\n");
2963 M_PrintWhite (16, 164, "registered trademark licensed to\n");
2964 M_PrintWhite (16, 172, "Nothing Interactive, Inc. All rights\n");
2965 M_PrintWhite (16, 180, "reserved. Press y to exit\n");
2967 M_DrawTextBox (56, 76, 24, 4);
2968 M_Print (64, 84, " Really quit? ");
2969 M_Print (64, 92, " ");
2970 M_Print (64, 100, " Press CROSS to quit, ");
2971 M_Print (64, 108, " or CIRCLE to continue. ");
2973 M_DrawTextBox (56, 76, 24, 4);
2974 M_Print (64, 84, quitMessage
[msgNumber
*4+0]);
2975 M_Print (64, 92, quitMessage
[msgNumber
*4+1]);
2976 M_Print (64, 100, quitMessage
[msgNumber
*4+2]);
2977 M_Print (64, 108, quitMessage
[msgNumber
*4+3]);
2980 //=============================================================================
2981 /* OSK IMPLEMENTATION */
2986 #define MAX_CHAR_LINE 36
2992 int m_old_state
= 0;
2994 char* osk_out_buff
= NULL
;
2995 char osk_buffer
[128];
2999 " 1 2 3 4 5 6 7 8 9 0 - = ` ",
3000 " q w e r t y u i o p [ ] ",
3001 " a s d f g h j k l ; ' \\ ",
3002 " z x c v b n m , . / ",
3004 " ! @ # $ % ^ & * ( ) _ + ~ ",
3005 " Q W E R T Y U I O P { } ",
3006 " A S D F G H J K L : \" | ",
3007 " Z X C V B N M < > ? "
3023 void M_Menu_OSK_f (char *input
, char *output
, int outlen
)
3025 key_dest
= key_menu
;
3026 m_old_state
= m_state
;
3028 m_entersound
= false;
3030 strncpy(osk_buffer
,input
,max_len
);
3031 osk_buffer
[outlen
] = '\0';
3032 osk_out_buff
= output
;
3035 void Con_OSK_f (char *input
, char *output
, int outlen
)
3038 strncpy(osk_buffer
,input
,max_len
);
3039 osk_buffer
[outlen
] = '\0';
3040 osk_out_buff
= output
;
3044 void M_OSK_Draw (void)
3050 char *selected_line
= osk_text
[osk_pos_y
];
3051 char selected_char
[2];
3053 selected_char
[0] = selected_line
[1+(2*osk_pos_x
)];
3054 selected_char
[1] = '\0';
3055 if (selected_char
[0] == ' ' || selected_char
[0] == '\t')
3056 selected_char
[0] = 'X';
3061 M_DrawTextBox (10, 10, 26, 10);
3062 M_DrawTextBox (10+(26*CHAR_SIZE
), 10, 10, 10);
3063 M_DrawTextBox (10, 10+(10*CHAR_SIZE
),36, 3);
3065 for(i
=0;i
<=MAX_Y
;i
++)
3067 M_PrintWhite (x
, y
+(CHAR_SIZE
*i
), osk_text
[i
]);
3069 M_Print (x
+(27*CHAR_SIZE
), y
+(CHAR_SIZE
*i
), osk_help
[i
]);
3071 M_PrintWhite (x
+(27*CHAR_SIZE
), y
+(CHAR_SIZE
*i
), osk_help
[i
]);
3074 int text_len
= strlen(osk_buffer
);
3075 if (text_len
> MAX_CHAR_LINE
) {
3077 char oneline
[MAX_CHAR_LINE
+1];
3078 strncpy(oneline
,osk_buffer
,MAX_CHAR_LINE
);
3079 oneline
[MAX_CHAR_LINE
] = '\0';
3081 M_Print (x
+4, y
+4+(CHAR_SIZE
*(MAX_Y
+2)), oneline
);
3083 strncpy(oneline
,osk_buffer
+MAX_CHAR_LINE
, text_len
- MAX_CHAR_LINE
);
3084 oneline
[text_len
- MAX_CHAR_LINE
] = '\0';
3086 M_Print (x
+4, y
+4+(CHAR_SIZE
*(MAX_Y
+3)), oneline
);
3087 M_PrintWhite (x
+4+(CHAR_SIZE
*(text_len
- MAX_CHAR_LINE
)), y
+4+(CHAR_SIZE
*(MAX_Y
+3)),"_");
3090 M_Print (x
+4, y
+4+(CHAR_SIZE
*(MAX_Y
+2)), osk_buffer
);
3091 M_PrintWhite (x
+4+(CHAR_SIZE
*(text_len
)), y
+4+(CHAR_SIZE
*(MAX_Y
+2)),"_");
3093 M_Print (x
+((((osk_pos_x
)*2)+1)*CHAR_SIZE
), y
+(osk_pos_y
*CHAR_SIZE
), selected_char
);
3098 void M_OSK_Key (int key
)
3105 if (osk_pos_x
> MAX_X
)
3115 if (osk_pos_y
> MAX_Y
)
3124 if (max_len
> strlen(osk_buffer
)) {
3125 char *selected_line
= osk_text
[osk_pos_y
];
3126 char selected_char
[2];
3128 selected_char
[0] = selected_line
[1+(2*osk_pos_x
)];
3130 if (selected_char
[0] == '\t')
3131 selected_char
[0] = ' ';
3133 selected_char
[1] = '\0';
3134 strcat(osk_buffer
,selected_char
);
3138 if (strlen(osk_buffer
) > 0) {
3139 osk_buffer
[strlen(osk_buffer
)-1] = '\0';
3143 strncpy(osk_out_buff
,osk_buffer
,max_len
);
3145 m_state
= m_old_state
;
3148 m_state
= m_old_state
;
3156 void Con_OSK_Key (int key
)
3163 if (osk_pos_x
> MAX_X
)
3173 if (osk_pos_y
> MAX_Y
)
3182 if (max_len
> strlen(osk_buffer
)) {
3183 char *selected_line
= osk_text
[osk_pos_y
];
3184 char selected_char
[2];
3186 selected_char
[0] = selected_line
[1+(2*osk_pos_x
)];
3188 if (selected_char
[0] == '\t')
3189 selected_char
[0] = ' ';
3191 selected_char
[1] = '\0';
3192 strcat(osk_buffer
,selected_char
);
3196 if (strlen(osk_buffer
) > 0) {
3197 osk_buffer
[strlen(osk_buffer
)-1] = '\0';
3201 strncpy(osk_out_buff
,osk_buffer
,max_len
);
3202 Con_SetOSKActive(false);
3205 Con_SetOSKActive(false);
3213 //=============================================================================
3215 /* SERIAL CONFIG MENU */
3217 int serialConfig_cursor
;
3218 int serialConfig_cursor_table
[] = {48, 64, 80, 96, 112, 132};
3219 #define NUM_SERIALCONFIG_CMDS 6
3221 static int ISA_uarts
[] = {0x3f8,0x2f8,0x3e8,0x2e8};
3222 static int ISA_IRQs
[] = {4,3,4,3};
3223 int serialConfig_baudrate
[] = {9600,14400,19200,28800,38400,57600};
3225 int serialConfig_comport
;
3226 int serialConfig_irq
;
3227 int serialConfig_baud
;
3228 char serialConfig_phone
[16];
3230 void M_Menu_SerialConfig_f (void)
3237 key_dest
= key_menu
;
3238 m_state
= m_serialconfig
;
3239 m_entersound
= true;
3240 if (JoiningGame
&& SerialConfig
)
3241 serialConfig_cursor
= 4;
3243 serialConfig_cursor
= 5;
3245 (*GetComPortConfig
) (0, &port
, &serialConfig_irq
, &baudrate
, &useModem
);
3247 // map uart's port to COMx
3248 for (n
= 0; n
< 4; n
++)
3249 if (ISA_uarts
[n
] == port
)
3254 serialConfig_irq
= 4;
3256 serialConfig_comport
= n
+ 1;
3258 // map baudrate to index
3259 for (n
= 0; n
< 6; n
++)
3260 if (serialConfig_baudrate
[n
] == baudrate
)
3264 serialConfig_baud
= n
;
3266 m_return_onerror
= false;
3267 m_return_reason
[0] = 0;
3271 void M_SerialConfig_Draw (void)
3279 M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
3281 b
= Draw_CachePic ("gfx/m_bttns.lmp");
3282 M_DrawPic ( (320-b
->width
)/2, 248, b
);
3283 p
= Draw_CachePic ("gfx/p_multi.lmp");
3284 basex
= (320-p
->width
)/2;
3285 M_DrawPic (basex
, 4, p
);
3288 startJoin
= "New Game";
3290 startJoin
= "Join Game";
3292 directModem
= "Modem";
3294 directModem
= "Direct Connect";
3295 M_Print (basex
, 32, va ("%s - %s", startJoin
, directModem
));
3298 M_Print (basex
, serialConfig_cursor_table
[0], "Port");
3299 M_DrawTextBox (160, 40, 4, 1);
3300 M_Print (168, serialConfig_cursor_table
[0], va("COM%u", serialConfig_comport
));
3302 M_Print (basex
, serialConfig_cursor_table
[1], "IRQ");
3303 M_DrawTextBox (160, serialConfig_cursor_table
[1]-8, 1, 1);
3304 M_Print (168, serialConfig_cursor_table
[1], va("%u", serialConfig_irq
));
3306 M_Print (basex
, serialConfig_cursor_table
[2], "Baud");
3307 M_DrawTextBox (160, serialConfig_cursor_table
[2]-8, 5, 1);
3308 M_Print (168, serialConfig_cursor_table
[2], va("%u", serialConfig_baudrate
[serialConfig_baud
]));
3312 M_Print (basex
, serialConfig_cursor_table
[3], "Modem Setup...");
3315 M_Print (basex
, serialConfig_cursor_table
[4], "Phone number");
3316 M_DrawTextBox (160, serialConfig_cursor_table
[4]-8, 16, 1);
3317 M_Print (168, serialConfig_cursor_table
[4], serialConfig_phone
);
3323 M_DrawTextBox (basex
, serialConfig_cursor_table
[5]-8, 7, 1);
3324 M_Print (basex
+8, serialConfig_cursor_table
[5], "Connect");
3328 M_DrawTextBox (basex
, serialConfig_cursor_table
[5]-8, 2, 1);
3329 M_Print (basex
+8, serialConfig_cursor_table
[5], "OK");
3332 M_DrawCharacter (basex
-8, serialConfig_cursor_table
[serialConfig_cursor
], 12+((int)(realtime
*4)&1));
3334 if (serialConfig_cursor
== 4)
3335 M_DrawCharacter (168 + 8*strlen(serialConfig_phone
), serialConfig_cursor_table
[serialConfig_cursor
], 10+((int)(realtime
*4)&1));
3337 if (*m_return_reason
)
3338 M_PrintWhite (basex
, 148, m_return_reason
);
3342 void M_SerialConfig_Key (int key
)
3353 S_LocalSound ("misc/menu1.wav");
3354 serialConfig_cursor
--;
3355 if (serialConfig_cursor
< 0)
3356 serialConfig_cursor
= NUM_SERIALCONFIG_CMDS
-1;
3360 S_LocalSound ("misc/menu1.wav");
3361 serialConfig_cursor
++;
3362 if (serialConfig_cursor
>= NUM_SERIALCONFIG_CMDS
)
3363 serialConfig_cursor
= 0;
3367 if (serialConfig_cursor
> 2)
3369 S_LocalSound ("misc/menu3.wav");
3371 if (serialConfig_cursor
== 0)
3373 serialConfig_comport
--;
3374 if (serialConfig_comport
== 0)
3375 serialConfig_comport
= 4;
3376 serialConfig_irq
= ISA_IRQs
[serialConfig_comport
-1];
3379 if (serialConfig_cursor
== 1)
3382 if (serialConfig_irq
== 6)
3383 serialConfig_irq
= 5;
3384 if (serialConfig_irq
== 1)
3385 serialConfig_irq
= 7;
3388 if (serialConfig_cursor
== 2)
3390 serialConfig_baud
--;
3391 if (serialConfig_baud
< 0)
3392 serialConfig_baud
= 5;
3398 if (serialConfig_cursor
> 2)
3401 S_LocalSound ("misc/menu3.wav");
3403 if (serialConfig_cursor
== 0)
3405 serialConfig_comport
++;
3406 if (serialConfig_comport
> 4)
3407 serialConfig_comport
= 1;
3408 serialConfig_irq
= ISA_IRQs
[serialConfig_comport
-1];
3411 if (serialConfig_cursor
== 1)
3414 if (serialConfig_irq
== 6)
3415 serialConfig_irq
= 7;
3416 if (serialConfig_irq
== 8)
3417 serialConfig_irq
= 2;
3420 if (serialConfig_cursor
== 2)
3422 serialConfig_baud
++;
3423 if (serialConfig_baud
> 5)
3424 serialConfig_baud
= 0;
3430 if (serialConfig_cursor
< 3)
3433 m_entersound
= true;
3435 if (serialConfig_cursor
== 3)
3437 (*SetComPortConfig
) (0, ISA_uarts
[serialConfig_comport
-1], serialConfig_irq
, serialConfig_baudrate
[serialConfig_baud
], SerialConfig
);
3439 M_Menu_ModemConfig_f ();
3443 if (serialConfig_cursor
== 4)
3445 serialConfig_cursor
= 5;
3449 // serialConfig_cursor == 5 (OK/CONNECT)
3450 (*SetComPortConfig
) (0, ISA_uarts
[serialConfig_comport
-1], serialConfig_irq
, serialConfig_baudrate
[serialConfig_baud
], SerialConfig
);
3452 M_ConfigureNetSubsystem ();
3456 M_Menu_GameOptions_f ();
3460 m_return_state
= m_state
;
3461 m_return_onerror
= true;
3462 key_dest
= key_game
;
3465 // If we were in a multiplayer game, reset all the deathmatch flags to 0;
3487 Cbuf_AddText ("viewsize 120\n cl_gunpitch 0\n fov 90\n scr_ofsy 0\n cl_autoaim 1\n chase_active 0\n");
3488 Cbuf_AddText (va ("connect \"%s\"\n", serialConfig_phone
));
3492 Cbuf_AddText ("viewsize 120\n cl_gunpitch 0\n fov 90\n scr_ofsy 0\n cl_autoaim 1\n chase_active 0\n");
3493 Cbuf_AddText ("connect\n");
3498 if (serialConfig_cursor
== 4)
3500 if (strlen(serialConfig_phone
))
3501 serialConfig_phone
[strlen(serialConfig_phone
)-1] = 0;
3506 if (key
< 32 || key
> 127)
3508 if (serialConfig_cursor
== 4)
3510 l
= strlen(serialConfig_phone
);
3513 serialConfig_phone
[l
+1] = 0;
3514 serialConfig_phone
[l
] = key
;
3519 if (DirectConfig
&& (serialConfig_cursor
== 3 || serialConfig_cursor
== 4))
3521 if (key
== K_UPARROW
)
3522 serialConfig_cursor
= 2;
3524 serialConfig_cursor
= 5;
3526 if (SerialConfig
&& StartingGame
&& serialConfig_cursor
== 4)
3528 if (key
== K_UPARROW
)
3529 serialConfig_cursor
= 3;
3531 serialConfig_cursor
= 5;
3535 //=============================================================================
3536 /* MODEM CONFIG MENU */
3538 int modemConfig_cursor
;
3539 int modemConfig_cursor_table
[] = {40, 56, 88, 120, 156};
3540 #define NUM_MODEMCONFIG_CMDS 5
3542 char modemConfig_dialing
;
3543 char modemConfig_clear
[16];
3544 char modemConfig_init
[32];
3545 char modemConfig_hangup
[16];
3547 void M_Menu_ModemConfig_f (void)
3549 key_dest
= key_menu
;
3550 m_state
= m_modemconfig
;
3551 m_entersound
= true;
3552 (*GetModemConfig
) (0, &modemConfig_dialing
, modemConfig_clear
, modemConfig_init
, modemConfig_hangup
);
3556 void M_ModemConfig_Draw (void)
3562 M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
3564 b
= Draw_CachePic ("gfx/m_bttns.lmp");
3565 M_DrawPic ( (320-b
->width
)/2, 248, b
);
3566 p
= Draw_CachePic ("gfx/p_multi.lmp");
3567 basex
= (320-p
->width
)/2;
3568 M_DrawPic (basex
, 4, p
);
3571 if (modemConfig_dialing
== 'P')
3572 M_Print (basex
, modemConfig_cursor_table
[0], "Pulse Dialing");
3574 M_Print (basex
, modemConfig_cursor_table
[0], "Touch Tone Dialing");
3576 M_Print (basex
, modemConfig_cursor_table
[1], "Clear");
3577 M_DrawTextBox (basex
, modemConfig_cursor_table
[1]+4, 16, 1);
3578 M_Print (basex
+8, modemConfig_cursor_table
[1]+12, modemConfig_clear
);
3579 if (modemConfig_cursor
== 1)
3580 M_DrawCharacter (basex
+8 + 8*strlen(modemConfig_clear
), modemConfig_cursor_table
[1]+12, 10+((int)(realtime
*4)&1));
3582 M_Print (basex
, modemConfig_cursor_table
[2], "Init");
3583 M_DrawTextBox (basex
, modemConfig_cursor_table
[2]+4, 30, 1);
3584 M_Print (basex
+8, modemConfig_cursor_table
[2]+12, modemConfig_init
);
3585 if (modemConfig_cursor
== 2)
3586 M_DrawCharacter (basex
+8 + 8*strlen(modemConfig_init
), modemConfig_cursor_table
[2]+12, 10+((int)(realtime
*4)&1));
3588 M_Print (basex
, modemConfig_cursor_table
[3], "Hangup");
3589 M_DrawTextBox (basex
, modemConfig_cursor_table
[3]+4, 16, 1);
3590 M_Print (basex
+8, modemConfig_cursor_table
[3]+12, modemConfig_hangup
);
3591 if (modemConfig_cursor
== 3)
3592 M_DrawCharacter (basex
+8 + 8*strlen(modemConfig_hangup
), modemConfig_cursor_table
[3]+12, 10+((int)(realtime
*4)&1));
3594 M_DrawTextBox (basex
, modemConfig_cursor_table
[4]-8, 2, 1);
3595 M_Print (basex
+8, modemConfig_cursor_table
[4], "OK");
3597 M_DrawCharacter (basex
-8, modemConfig_cursor_table
[modemConfig_cursor
], 12+((int)(realtime
*4)&1));
3601 void M_ModemConfig_Key (int key
)
3608 M_Menu_SerialConfig_f ();
3612 S_LocalSound ("misc/menu1.wav");
3613 modemConfig_cursor
--;
3614 if (modemConfig_cursor
< 0)
3615 modemConfig_cursor
= NUM_MODEMCONFIG_CMDS
-1;
3619 S_LocalSound ("misc/menu1.wav");
3620 modemConfig_cursor
++;
3621 if (modemConfig_cursor
>= NUM_MODEMCONFIG_CMDS
)
3622 modemConfig_cursor
= 0;
3627 if (modemConfig_cursor
== 0)
3629 if (modemConfig_dialing
== 'P')
3630 modemConfig_dialing
= 'T';
3632 modemConfig_dialing
= 'P';
3633 S_LocalSound ("misc/menu1.wav");
3638 if (modemConfig_cursor
== 0)
3640 if (modemConfig_dialing
== 'P')
3641 modemConfig_dialing
= 'T';
3643 modemConfig_dialing
= 'P';
3644 m_entersound
= true;
3647 if (modemConfig_cursor
== 4)
3649 (*SetModemConfig
) (0, va ("%c", modemConfig_dialing
), modemConfig_clear
, modemConfig_init
, modemConfig_hangup
);
3650 m_entersound
= true;
3651 M_Menu_SerialConfig_f ();
3656 if (modemConfig_cursor
== 1)
3658 if (strlen(modemConfig_clear
))
3659 modemConfig_clear
[strlen(modemConfig_clear
)-1] = 0;
3662 if (modemConfig_cursor
== 2)
3664 if (strlen(modemConfig_init
))
3665 modemConfig_init
[strlen(modemConfig_init
)-1] = 0;
3668 if (modemConfig_cursor
== 3)
3670 if (strlen(modemConfig_hangup
))
3671 modemConfig_hangup
[strlen(modemConfig_hangup
)-1] = 0;
3676 if (key
< 32 || key
> 127)
3679 if (modemConfig_cursor
== 1)
3681 l
= strlen(modemConfig_clear
);
3684 modemConfig_clear
[l
+1] = 0;
3685 modemConfig_clear
[l
] = key
;
3689 if (modemConfig_cursor
== 2)
3691 l
= strlen(modemConfig_init
);
3694 modemConfig_init
[l
+1] = 0;
3695 modemConfig_init
[l
] = key
;
3699 if (modemConfig_cursor
== 3)
3701 l
= strlen(modemConfig_hangup
);
3704 modemConfig_hangup
[l
+1] = 0;
3705 modemConfig_hangup
[l
] = key
;
3711 //=============================================================================
3712 /* LAN CONFIG MENU */
3714 int lanConfig_cursor
= -1;
3715 int lanConfig_cursor_table
[] = {72, 92, 124};
3716 #define NUM_LANCONFIG_CMDS 3
3719 char lanConfig_portname
[6];
3720 char lanConfig_joinname
[22];
3722 void M_Menu_LanConfig_f (void)
3724 key_dest
= key_menu
;
3725 m_state
= m_lanconfig
;
3726 m_entersound
= true;
3727 if (lanConfig_cursor
== -1)
3729 if (JoiningGame
&& TCPIPConfig
)
3730 lanConfig_cursor
= 2;
3732 lanConfig_cursor
= 1;
3734 if (StartingGame
&& lanConfig_cursor
== 2)
3735 lanConfig_cursor
= 1;
3736 lanConfig_port
= DEFAULTnet_hostport
;
3737 sprintf(lanConfig_portname
, "%u", lanConfig_port
);
3739 m_return_onerror
= false;
3740 m_return_reason
[0] = 0;
3744 void M_LanConfig_Draw (void)
3752 M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
3754 b
= Draw_CachePic ("gfx/m_bttns.lmp");
3755 M_DrawPic ( (320-b
->width
)/2, 248, b
);
3756 p
= Draw_CachePic ("gfx/p_multi.lmp");
3757 basex
= (320-p
->width
)/2;
3758 M_DrawPic (basex
, 4, p
);
3761 startJoin
= "New Game";
3763 startJoin
= "Join Game";
3767 protocol
= "TCP/IP";
3768 M_PrintWhite (basex
, 32, va ("%s - %s", startJoin
, protocol
));
3771 M_PrintWhite (basex
, 52, "Address:");
3773 M_Print (basex
+9*8, 52, my_ipx_address
);
3775 M_Print (basex
+9*8, 52, my_tcpip_address
);
3777 M_PrintWhite (basex
, lanConfig_cursor_table
[0], "Port");
3778 M_DrawTextBox (basex
+8*8, lanConfig_cursor_table
[0]-8, 6, 1);
3779 M_PrintWhite (basex
+9*8, lanConfig_cursor_table
[0], lanConfig_portname
);
3783 M_PrintWhite (basex
, lanConfig_cursor_table
[1], "Search for local games...");
3784 M_PrintWhite (basex
, 108, "Join game at:");
3785 M_DrawTextBox (basex
+8, lanConfig_cursor_table
[2]-8, 22, 1);
3786 M_PrintWhite (basex
+16, lanConfig_cursor_table
[2], lanConfig_joinname
);
3790 M_DrawTextBox (basex
, lanConfig_cursor_table
[1]-8, 2, 1);
3791 M_PrintWhite (basex
+8, lanConfig_cursor_table
[1], "OK");
3794 if (*m_return_reason
)
3795 M_PrintWhite (basex
, 148, m_return_reason
);
3799 M_DrawCharacter (basex
-8, lanConfig_cursor_table
[lanConfig_cursor
], 12+((int)(realtime
*30)&1));
3801 if (lanConfig_cursor
== 0)
3802 M_DrawCharacter (basex
+9*8 + 8*strlen(lanConfig_portname
), lanConfig_cursor_table
[0], 10+((int)(realtime
*30)&1));
3804 if (lanConfig_cursor
== 2)
3805 M_DrawCharacter (basex
+16 + 8*strlen(lanConfig_joinname
), lanConfig_cursor_table
[2], 10+((int)(realtime
*30)&1));
3809 M_DrawCharacter (basex
-8, lanConfig_cursor_table
[lanConfig_cursor
], 12+((int)(realtime
*4)&1));
3811 if (lanConfig_cursor
== 0)
3812 M_DrawCharacter (basex
+9*8 + 8*strlen(lanConfig_portname
), lanConfig_cursor_table
[0], 10+((int)(realtime
*4)&1));
3814 if (lanConfig_cursor
== 2)
3815 M_DrawCharacter (basex
+16 + 8*strlen(lanConfig_joinname
), lanConfig_cursor_table
[2], 10+((int)(realtime
*4)&1));
3821 void M_LanConfig_Key (int key
)
3829 M_Menu_MultiPlayer_f ();
3833 S_LocalSound ("misc/menu1.wav");
3835 if (lanConfig_cursor
< 0)
3836 lanConfig_cursor
= NUM_LANCONFIG_CMDS
-1;
3840 S_LocalSound ("misc/menu1.wav");
3842 if (lanConfig_cursor
>= NUM_LANCONFIG_CMDS
)
3843 lanConfig_cursor
= 0;
3847 if (lanConfig_cursor
== 0)
3849 M_Menu_OSK_f(lanConfig_portname
, lanConfig_portname
, 6);
3853 if (lanConfig_cursor
== 2)
3855 M_Menu_OSK_f(lanConfig_joinname
, lanConfig_joinname
, 22);
3861 if (lanConfig_cursor
== 0)
3864 m_entersound
= true;
3866 M_ConfigureNetSubsystem ();
3868 if (lanConfig_cursor
== 1)
3872 M_Menu_GameOptions_f ();
3879 if (lanConfig_cursor
== 2)
3881 m_return_state
= m_state
;
3882 m_return_onerror
= true;
3883 key_dest
= key_game
;
3886 // If we were in a multiplayer game, reset all the deathmatch flags to 0;
3907 Cbuf_AddText ("viewsize 120\n cl_gunpitch 0\n fov 90\n scr_ofsy 0\n cl_autoaim 1\n chase_active 0\n");
3909 Cbuf_AddText ( va ("connect \"%s\"\n", lanConfig_joinname
) );
3916 if (lanConfig_cursor
== 0)
3918 if (strlen(lanConfig_portname
))
3919 lanConfig_portname
[strlen(lanConfig_portname
)-1] = 0;
3922 if (lanConfig_cursor
== 2)
3924 if (strlen(lanConfig_joinname
))
3925 lanConfig_joinname
[strlen(lanConfig_joinname
)-1] = 0;
3930 if (key
< 32 || key
> 127)
3933 if (lanConfig_cursor
== 2)
3935 l
= strlen(lanConfig_joinname
);
3938 lanConfig_joinname
[l
+1] = 0;
3939 lanConfig_joinname
[l
] = key
;
3943 if (key
< '0' || key
> '9')
3945 if (lanConfig_cursor
== 0)
3947 l
= strlen(lanConfig_portname
);
3950 lanConfig_portname
[l
+1] = 0;
3951 lanConfig_portname
[l
] = key
;
3956 if (StartingGame
&& lanConfig_cursor
== 2)
3958 if (key
== K_UPARROW
)
3959 lanConfig_cursor
= 1;
3961 lanConfig_cursor
= 0;
3964 l
= Q_atoi(lanConfig_portname
);
3969 sprintf(lanConfig_portname
, "%u", lanConfig_port
);
3972 //=============================================================================
3973 /* GAME OPTIONS MENU */
3983 {"start", "Entrance"}, // 0
3985 {"e1m1", "Slipgate Complex"}, // 1
3986 {"e1m2", "Castle of the Damned"},
3987 {"e1m3", "The Necropolis"},
3988 {"e1m4", "The Grisly Grotto"},
3989 {"e1m5", "Gloom Keep"},
3990 {"e1m6", "The Door To Chthon"},
3991 {"e1m7", "The House of Chthon"},
3992 {"e1m8", "Ziggurat Vertigo"},
3994 {"e2m1", "The Installation"}, // 9
3995 {"e2m2", "Ogre Citadel"},
3996 {"e2m3", "Crypt of Decay"},
3997 {"e2m4", "The Ebon Fortress"},
3998 {"e2m5", "The Wizard's Manse"},
3999 {"e2m6", "The Dismal Oubliette"},
4000 {"e2m7", "Underearth"},
4002 {"e3m1", "Termination Central"}, // 16
4003 {"e3m2", "The Vaults of Zin"},
4004 {"e3m3", "The Tomb of Terror"},
4005 {"e3m4", "Satan's Dark Delight"},
4006 {"e3m5", "Wind Tunnels"},
4007 {"e3m6", "Chambers of Torment"},
4008 {"e3m7", "The Haunted Halls"},
4010 {"e4m1", "The Sewage System"}, // 23
4011 {"e4m2", "The Tower of Despair"},
4012 {"e4m3", "The Elder God Shrine"},
4013 {"e4m4", "The Palace of Hate"},
4014 {"e4m5", "Hell's Atrium"},
4015 {"e4m6", "The Pain Maze"},
4016 {"e4m7", "Azure Agony"},
4017 {"e4m8", "The Nameless City"},
4019 {"end", "Shub-Niggurath's Pit"}, // 31
4021 {"dm1", "Place of Two Deaths"}, // 32
4022 {"dm2", "Claustrophobopolis"},
4023 {"dm3", "The Abandoned Base"},
4024 {"dm4", "The Bad Place"},
4025 {"dm5", "The Cistern"},
4026 {"dm6", "The Dark Zone"}
4029 level_t kuroklevels
[] =
4031 {"start", "Entrance"}, // 0
4032 {"e1m1", "Base Entrance"},
4034 {"e1m3", "Canyon Testing Grounds"},
4035 {"e1m4", "Cavern Testing Grounds"},
4036 {"e1m5", "Underground Base"},
4037 {"e1m6", "Experiment Rex"},
4040 {"kdm1", "Canyon Arena"}, // 8
4041 {"kdm2", "Base Arena"},
4042 {"kdm3", "Ruins Arena"},
4043 {"kdm4", "GE: Complex"},
4044 {"kdm5", "RF: Lobby"},
4045 {"kdm6", "HL:Crossfire"},
4046 {"kdm7", "PD: Area 52"}
4049 //MED 01/06/97 added hipnotic levels
4050 level_t hipnoticlevels
[] =
4052 {"start", "Command HQ"}, // 0
4054 {"hip1m1", "The Pumping Station"}, // 1
4055 {"hip1m2", "Storage Facility"},
4056 {"hip1m3", "The Lost Mine"},
4057 {"hip1m4", "Research Facility"},
4058 {"hip1m5", "Military Complex"},
4060 {"hip2m1", "Ancient Realms"}, // 6
4061 {"hip2m2", "The Black Cathedral"},
4062 {"hip2m3", "The Catacombs"},
4063 {"hip2m4", "The Crypt"},
4064 {"hip2m5", "Mortum's Keep"},
4065 {"hip2m6", "The Gremlin's Domain"},
4067 {"hip3m1", "Tur Torment"}, // 12
4068 {"hip3m2", "Pandemonium"},
4069 {"hip3m3", "Limbo"},
4070 {"hip3m4", "The Gauntlet"},
4072 {"hipend", "Armagon's Lair"}, // 16
4074 {"hipdm1", "The Edge of Oblivion"} // 17
4077 //PGM 01/07/97 added rogue levels
4078 //PGM 03/02/97 added dmatch level
4079 level_t roguelevels
[] =
4081 {"start", "Split Decision"},
4082 {"r1m1", "Deviant's Domain"},
4083 {"r1m2", "Dread Portal"},
4084 {"r1m3", "Judgement Call"},
4085 {"r1m4", "Cave of Death"},
4086 {"r1m5", "Towers of Wrath"},
4087 {"r1m6", "Temple of Pain"},
4088 {"r1m7", "Tomb of the Overlord"},
4089 {"r2m1", "Tempus Fugit"},
4090 {"r2m2", "Elemental Fury I"},
4091 {"r2m3", "Elemental Fury II"},
4092 {"r2m4", "Curse of Osiris"},
4093 {"r2m5", "Wizard's Keep"},
4094 {"r2m6", "Blood Sacrifice"},
4095 {"r2m7", "Last Bastion"},
4096 {"r2m8", "Source of Evil"},
4097 {"ctf1", "Division of Change"}
4107 episode_t episodes
[] =
4109 {"Welcome to Quake", 0, 1},
4110 {"Doomed Dimension", 1, 8},
4111 {"Realm of Black Magic", 9, 7},
4112 {"Netherworld", 16, 7},
4113 {"The Elder World", 23, 8},
4114 {"Final Level", 31, 1},
4115 {"Deathmatch Arena", 32, 6}
4118 episode_t kurokepisodes
[] =
4120 {"Kurok Hub", 0, 1},
4121 {"Jungle Base Chapter", 1, 7},
4122 {"Kurok Arena", 8, 7}
4125 //MED 01/06/97 added hipnotic episodes
4126 episode_t hipnoticepisodes
[] =
4128 {"Scourge of Armagon", 0, 1},
4129 {"Fortress of the Dead", 1, 5},
4130 {"Dominion of Darkness", 6, 6},
4131 {"The Rift", 12, 4},
4132 {"Final Level", 16, 1},
4133 {"Deathmatch Arena", 17, 1}
4136 //PGM 01/07/97 added rogue episodes
4137 //PGM 03/02/97 added dmatch episode
4138 episode_t rogueepisodes
[] =
4140 {"Introduction", 0, 1},
4141 {"Hell's Fortress", 1, 7},
4142 {"Corridors of Time", 8, 8},
4143 {"Deathmatch Arena", 16, 1}
4149 qboolean m_serverInfoMessage
= false;
4150 double m_serverInfoMessageTime
;
4152 void M_Menu_GameOptions_f (void)
4154 key_dest
= key_menu
;
4155 m_state
= m_gameoptions
;
4156 m_entersound
= true;
4157 if (maxplayers
== 0)
4158 maxplayers
= svs
.maxclients
;
4160 maxplayers
= svs
.maxclientslimit
;
4163 int gameoptions_cursor_table
[] = {40, 56, 64, 72, 80, 88, 96, 104, 112, 144, 152};
4164 int gameoptions_cursor_tablek
[] = {40, 56, 64, 72, 80, 88, 96, 104, 112, 128, 144, 152};
4165 #define NUM_GAMEOPTIONS 11
4166 #define NUM_KGAMEOPTIONS 12
4167 int gameoptions_cursor
;
4169 void M_GameOptions_Draw (void)
4177 M_DrawCharacter (144, gameoptions_cursor_tablek
[gameoptions_cursor
], 12+((int)(realtime
*30)&1));
4180 M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
4182 M_DrawCharacter (144, gameoptions_cursor_table
[gameoptions_cursor
], 12+((int)(realtime
*4)&1));
4185 b
= Draw_CachePic ("gfx/m_bttns.lmp");
4186 M_DrawPic ( (320-b
->width
)/2, 248, b
);
4187 p
= Draw_CachePic ("gfx/p_multi.lmp");
4188 M_DrawPic ( (320-p
->width
)/2, 4, p
);
4190 M_DrawTextBox (152, 32, 10, 1);
4191 M_PrintWhite (160, 40, "begin game");
4193 M_PrintWhite (0, 56, " Max players");
4194 M_Print (160, 56, va("%i", maxplayers
) );
4196 M_PrintWhite (0, 64, " Game Type");
4198 M_Print (160, 64, "Cooperative");
4200 M_Print (160, 64, "Deathmatch");
4202 M_PrintWhite (0, 72, " Teamplay");
4207 switch((int)teamplay
.value
)
4209 case 1: msg
= "No Friendly Fire"; break;
4210 case 2: msg
= "Friendly Fire"; break;
4211 case 3: msg
= "Tag"; break;
4212 case 4: msg
= "Capture the Flag"; break;
4213 case 5: msg
= "One Flag CTF"; break;
4214 case 6: msg
= "Three Team CTF"; break;
4215 default: msg
= "Off"; break;
4217 M_Print (160, 72, msg
);
4223 switch((int)teamplay
.value
)
4225 case 1: msg
= "No Friendly Fire"; break;
4226 case 2: msg
= "Friendly Fire"; break;
4227 default: msg
= "Off"; break;
4229 M_Print (160, 72, msg
);
4232 M_PrintWhite (0, 80, " Skill");
4233 if (skill
.value
== 0)
4234 M_Print (160, 80, "Easy difficulty");
4235 else if (skill
.value
== 1)
4236 M_Print (160, 80, "Normal difficulty");
4237 else if (skill
.value
== 2)
4238 M_Print (160, 80, "Hard difficulty");
4242 M_Print (160, 80, "Insane difficulty");
4244 M_Print (160, 80, "Nightmare difficulty");
4247 M_PrintWhite (0, 88, " Frag Limit");
4248 if (fraglimit
.value
== 0)
4249 M_Print (160, 88, "none");
4251 M_Print (160, 88, va("%i frags", (int)fraglimit
.value
));
4253 M_PrintWhite (0, 96, " Time Limit");
4254 if (timelimit
.value
== 0)
4255 M_Print (160, 96, "none");
4257 M_Print (160, 96, va("%i minutes", (int)timelimit
.value
));
4259 M_PrintWhite (0, 104, " Auto Aim");
4260 if (sv_aim
.value
== 1)
4261 M_Print (160, 104, "Off");
4263 M_Print (160, 104, "On");
4265 M_PrintWhite (0, 112, " Level Exits");
4266 if (noexit
.value
== 1)
4267 M_Print (160, 112, "Off");
4269 M_Print (160, 112, "On");
4273 M_DrawTextBox (152, 120, 18, 1);
4274 M_PrintWhite (160, 128, "Deathmatch Options");
4277 M_PrintWhite (0, 144, " Episode");
4278 //MED 01/06/97 added hipnotic episodes
4280 M_Print (160, 144, hipnoticepisodes
[startepisode
].description
);
4281 //PGM 01/07/97 added rogue episodes
4283 M_Print (160, 144, rogueepisodes
[startepisode
].description
);
4285 M_Print (160, 144, kurokepisodes
[startepisode
].description
);
4287 M_Print (160, 144, episodes
[startepisode
].description
);
4289 M_PrintWhite (0, 152, " Level");
4290 //MED 01/06/97 added hipnotic episodes
4293 M_Print (160, 152, hipnoticlevels
[hipnoticepisodes
[startepisode
].firstLevel
+ startlevel
].description
);
4294 M_Print (160, 160, hipnoticlevels
[hipnoticepisodes
[startepisode
].firstLevel
+ startlevel
].name
);
4296 //PGM 01/07/97 added rogue episodes
4299 M_Print (160, 152, roguelevels
[rogueepisodes
[startepisode
].firstLevel
+ startlevel
].description
);
4300 M_Print (160, 160, roguelevels
[rogueepisodes
[startepisode
].firstLevel
+ startlevel
].name
);
4304 M_Print (160, 152, kuroklevels
[kurokepisodes
[startepisode
].firstLevel
+ startlevel
].description
);
4305 M_Print (160, 160, kuroklevels
[kurokepisodes
[startepisode
].firstLevel
+ startlevel
].name
);
4309 M_Print (160, 152, levels
[episodes
[startepisode
].firstLevel
+ startlevel
].description
);
4310 M_Print (160, 160, levels
[episodes
[startepisode
].firstLevel
+ startlevel
].name
);
4313 if (m_serverInfoMessage
)
4315 if ((realtime
- m_serverInfoMessageTime
) < 5.0)
4318 M_DrawTextBox (x
, 138, 24, 4);
4320 M_Print (x
, 146, " More than 4 players ");
4321 M_Print (x
, 154, " requires using command ");
4322 M_Print (x
, 162, " line -listen. Use ");
4323 M_Print (x
, 170, " -listen 8 for example. ");
4327 m_serverInfoMessage
= false;
4333 void M_NetStart_Change (int dir
)
4337 switch (gameoptions_cursor
)
4341 if (maxplayers
> svs
.maxclientslimit
)
4343 maxplayers
= svs
.maxclientslimit
;
4344 m_serverInfoMessage
= true;
4345 m_serverInfoMessageTime
= realtime
;
4352 Cvar_SetValue ("coop", coop
.value
? 0 : 1);
4361 Cvar_SetValue ("teamplay", teamplay
.value
+ dir
);
4362 if (teamplay
.value
> count
)
4363 Cvar_SetValue ("teamplay", 0);
4364 else if (teamplay
.value
< 0)
4365 Cvar_SetValue ("teamplay", count
);
4369 Cvar_SetValue ("skill", skill
.value
+ dir
);
4370 if (skill
.value
> 3)
4371 Cvar_SetValue ("skill", 0);
4372 if (skill
.value
< 0)
4373 Cvar_SetValue ("skill", 3);
4377 Cvar_SetValue ("fraglimit", fraglimit
.value
+ dir
*10);
4378 if (fraglimit
.value
> 100)
4379 Cvar_SetValue ("fraglimit", 0);
4380 if (fraglimit
.value
< 0)
4381 Cvar_SetValue ("fraglimit", 100);
4385 Cvar_SetValue ("timelimit", timelimit
.value
+ dir
*5);
4386 if (timelimit
.value
> 60)
4387 Cvar_SetValue ("timelimit", 0);
4388 if (timelimit
.value
< 0)
4389 Cvar_SetValue ("timelimit", 60);
4393 Cvar_SetValue ("sv_aim", sv_aim
.value
+ dir
* 0.01);
4394 if (sv_aim
.value
> 1)
4395 Cvar_SetValue ("sv_aim", 0.99);
4396 if (sv_aim
.value
< 0.99)
4397 Cvar_SetValue ("sv_aim", 1);
4401 Cvar_SetValue ("noexit", noexit
.value
? 0 : 1);
4408 startepisode
+= dir
;
4409 //MED 01/06/97 added hipnotic count
4412 //PGM 01/07/97 added rogue count
4413 //PGM 03/02/97 added 1 for dmatch episode
4418 else if (registered
.value
)
4423 if (startepisode
< 0)
4424 startepisode
= count
- 1;
4426 if (startepisode
>= count
)
4435 startepisode
+= dir
;
4436 //MED 01/06/97 added hipnotic count
4439 //PGM 01/07/97 added rogue count
4440 //PGM 03/02/97 added 1 for dmatch episode
4445 else if (registered
.value
)
4450 if (startepisode
< 0)
4451 startepisode
= count
- 1;
4453 if (startepisode
>= count
)
4462 //MED 01/06/97 added hipnotic episodes
4464 count
= hipnoticepisodes
[startepisode
].levels
;
4465 //PGM 01/06/97 added hipnotic episodes
4467 count
= rogueepisodes
[startepisode
].levels
;
4469 count
= kurokepisodes
[startepisode
].levels
;
4471 count
= episodes
[startepisode
].levels
;
4474 startlevel
= count
- 1;
4476 if (startlevel
>= count
)
4482 //MED 01/06/97 added hipnotic episodes
4484 count
= hipnoticepisodes
[startepisode
].levels
;
4485 //PGM 01/06/97 added hipnotic episodes
4487 count
= rogueepisodes
[startepisode
].levels
;
4489 count
= kurokepisodes
[startepisode
].levels
;
4491 count
= episodes
[startepisode
].levels
;
4494 startlevel
= count
- 1;
4496 if (startlevel
>= count
)
4502 void M_GameOptions_Key (int key
)
4508 M_Menu_MultiPlayer_f ();
4512 S_LocalSound ("misc/menu1.wav");
4513 gameoptions_cursor
--;
4516 if (gameoptions_cursor
< 0)
4517 gameoptions_cursor
= NUM_KGAMEOPTIONS
-1;
4521 if (gameoptions_cursor
< 0)
4522 gameoptions_cursor
= NUM_GAMEOPTIONS
-1;
4527 S_LocalSound ("misc/menu1.wav");
4528 gameoptions_cursor
++;
4531 if (gameoptions_cursor
>= NUM_KGAMEOPTIONS
)
4532 gameoptions_cursor
= 0;
4536 if (gameoptions_cursor
>= NUM_GAMEOPTIONS
)
4537 gameoptions_cursor
= 0;
4544 if (gameoptions_cursor
== (0 || 9))
4549 if (gameoptions_cursor
== 0)
4552 S_LocalSound ("misc/menu3.wav");
4553 M_NetStart_Change (-1);
4559 if (gameoptions_cursor
== (0 || 9))
4564 if (gameoptions_cursor
== 0)
4567 S_LocalSound ("misc/menu3.wav");
4568 M_NetStart_Change (1);
4572 S_LocalSound ("misc/menu2.wav");
4573 if (gameoptions_cursor
== 0)
4576 Cbuf_AddText ("disconnect\n");
4577 Cbuf_AddText ("listen 0\n"); // so host_netport will be re-examined
4578 Cbuf_AddText ( va ("maxplayers %u\n", maxplayers
) );
4579 SCR_BeginLoadingPlaque ();
4582 Cbuf_AddText ("viewsize 120\n cl_gunpitch 0\n fov 90\n scr_ofsy 0\n cl_autoaim 1\n chase_active 0\n");
4585 Cbuf_AddText ( va ("map %s\n", hipnoticlevels
[hipnoticepisodes
[startepisode
].firstLevel
+ startlevel
].name
) );
4587 Cbuf_AddText ( va ("map %s\n", roguelevels
[rogueepisodes
[startepisode
].firstLevel
+ startlevel
].name
) );
4589 Cbuf_AddText ( va ("map %s\n", kuroklevels
[kurokepisodes
[startepisode
].firstLevel
+ startlevel
].name
) );
4591 Cbuf_AddText ( va ("map %s\n", levels
[episodes
[startepisode
].firstLevel
+ startlevel
].name
) );
4598 if (gameoptions_cursor
== 9)
4600 M_Menu_DOptions_f();
4605 M_NetStart_Change (1);
4612 ----------------------------------------------------------------------------------------------
4614 ----------------------------------------------------------------------------------------------
4618 int DM_WEAPONS_STAY
= 2;
4620 int DM_AUTOMATICS
= 8;
4621 int DM_SHOTGUNS
= 16;
4622 int DM_EXPLOSIVES
= 32;
4623 int DM_SNIPERS
= 64;
4624 int DM_EXIT_NON_FATAL
= 128;
4625 int DM_INFINITE_AMMO
= 256;
4626 int DM_ALL_WEAPONS
= 512;
4627 int DM_NO_RELOAD
= 1024;
4628 int DM_NO_ARMOR
= 2048;
4629 int DM_NO_HEALTH
= 4096;
4630 int DM_ARMOR_REGEN
= 8192;
4631 int DM_HEALTH_REGEN
= 16384;
4632 int DM_SAFE_SPAWN
= 32768;
4633 int DM_NO_BOTS
= 65536;
4635 qboolean m_dOptionsInfoMessage
= false;
4636 double m_dOptionsInfoMessageTime
;
4638 int doptions_cursor_table
[] = {40, 56, 64, 72, 80, 88, 96, 104, 112, 128, 136, 144, 152, 160, 168, 176, 184, 192};
4639 #define NUM_DOPTIONS 18
4640 int doptions_cursor
;
4642 void M_Menu_DOptions_f (void)
4644 key_dest
= key_menu
;
4645 m_state
= m_doptions
;
4646 m_entersound
= true;
4649 void M_AdjustDSliders (int dir
)
4651 S_LocalSound ("misc/menu3.wav");
4653 switch (doptions_cursor
)
4656 case 1: // Item Respawns
4657 if (deathmatch
.value
> 1)
4659 items_respawn
+= dir
* 1;
4661 if (items_respawn
< 0)
4666 if (items_respawn
> 1)
4672 if (items_respawn
== 0)
4673 deathmatch
.value
= deathmatch
.value
- DM_RESPAWN
;
4674 if (items_respawn
== 1)
4675 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
;
4677 Cvar_SetValue ("deathmatch", deathmatch
.value
);
4682 deathmatch
.value
= 1;
4683 Cvar_SetValue ("deathmatch", deathmatch
.value
);
4685 m_dOptionsInfoMessage
= true;
4686 m_dOptionsInfoMessageTime
= realtime
;
4690 case 2: // Weapon stays
4691 weapons_stay
+= dir
* 1;
4693 if (weapons_stay
< 0)
4698 if (weapons_stay
> 1)
4704 if (items_respawn
== 0 && (deathmatch
.value
<= DM_WEAPONS_STAY
&& weapons_stay
== 0))
4708 if (weapons_stay
== 0)
4709 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
- DM_WEAPONS_STAY
;
4710 if (weapons_stay
== 1)
4711 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
+ DM_WEAPONS_STAY
;
4712 Cvar_SetValue ("deathmatch", deathmatch
.value
);
4716 if (weapons_stay
== 0)
4717 deathmatch
.value
= deathmatch
.value
- DM_WEAPONS_STAY
;
4718 if (weapons_stay
== 1)
4719 deathmatch
.value
= deathmatch
.value
+ DM_WEAPONS_STAY
;
4721 Cvar_SetValue ("deathmatch", deathmatch
.value
);
4738 if (items_respawn
== 0 && (deathmatch
.value
<= DM_PISTOLS
&& pistols
== 0))
4743 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
- DM_PISTOLS
;
4745 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
+ DM_PISTOLS
;
4746 Cvar_SetValue ("deathmatch", deathmatch
.value
);
4751 deathmatch
.value
= deathmatch
.value
- DM_PISTOLS
;
4753 deathmatch
.value
= deathmatch
.value
+ DM_PISTOLS
;
4755 Cvar_SetValue ("deathmatch", deathmatch
.value
);
4758 case 4: // Automatics
4759 automatics
+= dir
* 1;
4772 if (items_respawn
== 0 && (deathmatch
.value
<= DM_AUTOMATICS
&& automatics
== 0))
4776 if (automatics
== 0)
4777 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
- DM_AUTOMATICS
;
4778 if (automatics
== 1)
4779 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
+ DM_AUTOMATICS
;
4780 Cvar_SetValue ("deathmatch", deathmatch
.value
);
4784 if (automatics
== 0)
4785 deathmatch
.value
= deathmatch
.value
- DM_AUTOMATICS
;
4786 if (automatics
== 1)
4787 deathmatch
.value
= deathmatch
.value
+ DM_AUTOMATICS
;
4789 Cvar_SetValue ("deathmatch", deathmatch
.value
);
4793 shotguns
+= dir
* 1;
4806 if (items_respawn
== 0 && (deathmatch
.value
<= DM_SHOTGUNS
&& shotguns
== 0))
4811 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
- DM_SHOTGUNS
;
4813 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
+ DM_SHOTGUNS
;
4814 Cvar_SetValue ("deathmatch", deathmatch
.value
);
4819 deathmatch
.value
= deathmatch
.value
- DM_SHOTGUNS
;
4821 deathmatch
.value
= deathmatch
.value
+ DM_SHOTGUNS
;
4823 Cvar_SetValue ("deathmatch", deathmatch
.value
);
4826 case 6: // Explosives
4827 explosives
+= dir
* 1;
4840 if (items_respawn
== 0 && (deathmatch
.value
<= DM_EXPLOSIVES
&& explosives
== 0))
4844 if (explosives
== 0)
4845 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
- DM_EXPLOSIVES
;
4846 if (explosives
== 1)
4847 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
+ DM_EXPLOSIVES
;
4848 Cvar_SetValue ("deathmatch", deathmatch
.value
);
4852 if (explosives
== 0)
4853 deathmatch
.value
= deathmatch
.value
- DM_EXPLOSIVES
;
4854 if (explosives
== 1)
4855 deathmatch
.value
= deathmatch
.value
+ DM_EXPLOSIVES
;
4857 Cvar_SetValue ("deathmatch", deathmatch
.value
);
4874 if (items_respawn
== 0 && (deathmatch
.value
<= DM_SNIPERS
&& snipers
== 0))
4879 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
- DM_SNIPERS
;
4881 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
+ DM_SNIPERS
;
4882 Cvar_SetValue ("deathmatch", deathmatch
.value
);
4887 deathmatch
.value
= deathmatch
.value
- DM_SNIPERS
;
4889 deathmatch
.value
= deathmatch
.value
+ DM_SNIPERS
;
4891 Cvar_SetValue ("deathmatch", deathmatch
.value
);
4894 case 8: // Exit non fatal
4895 exit_non_fatal
+= dir
* 1;
4897 if (exit_non_fatal
< 0)
4902 if (exit_non_fatal
> 1)
4908 if (items_respawn
== 0 && (deathmatch
.value
<= DM_EXIT_NON_FATAL
&& exit_non_fatal
== 0))
4912 if (exit_non_fatal
== 0)
4913 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
- DM_EXIT_NON_FATAL
;
4914 if (exit_non_fatal
== 1)
4915 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
+ DM_EXIT_NON_FATAL
;
4916 Cvar_SetValue ("deathmatch", deathmatch
.value
);
4920 if (exit_non_fatal
== 0)
4921 deathmatch
.value
= deathmatch
.value
- DM_EXIT_NON_FATAL
;
4922 if (exit_non_fatal
== 1)
4923 deathmatch
.value
= deathmatch
.value
+ DM_EXIT_NON_FATAL
;
4925 Cvar_SetValue ("deathmatch", deathmatch
.value
);
4928 case 9: // Infinite Ammo
4929 infinite_ammo
+= dir
* 1;
4931 if (infinite_ammo
< 0)
4936 if (infinite_ammo
> 1)
4942 if (items_respawn
== 0 && (deathmatch
.value
<= DM_INFINITE_AMMO
&& infinite_ammo
== 0))
4946 if (infinite_ammo
== 0)
4947 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
- DM_INFINITE_AMMO
;
4948 if (infinite_ammo
== 1)
4949 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
+ DM_INFINITE_AMMO
;
4950 Cvar_SetValue ("deathmatch", deathmatch
.value
);
4954 if (infinite_ammo
== 0)
4955 deathmatch
.value
= deathmatch
.value
- DM_INFINITE_AMMO
;
4956 if (infinite_ammo
== 1)
4957 deathmatch
.value
= deathmatch
.value
+ DM_INFINITE_AMMO
;
4959 Cvar_SetValue ("deathmatch", deathmatch
.value
);
4962 case 10: // All weapons
4963 all_weapons
+= dir
* 1;
4965 if (all_weapons
< 0)
4970 if (all_weapons
> 1)
4976 if (items_respawn
== 0 && (deathmatch
.value
<= DM_ALL_WEAPONS
&& all_weapons
== 0))
4980 if (all_weapons
== 0)
4981 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
- DM_ALL_WEAPONS
;
4982 if (all_weapons
== 1)
4983 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
+ DM_ALL_WEAPONS
;
4984 Cvar_SetValue ("deathmatch", deathmatch
.value
);
4988 if (all_weapons
== 0)
4989 deathmatch
.value
= deathmatch
.value
- DM_ALL_WEAPONS
;
4990 if (all_weapons
== 1)
4991 deathmatch
.value
= deathmatch
.value
+ DM_ALL_WEAPONS
;
4993 Cvar_SetValue ("deathmatch", deathmatch
.value
);
4996 case 11: // No reloading
4997 no_reload
+= dir
* 1;
5010 if (items_respawn
== 0 && (deathmatch
.value
<= DM_NO_RELOAD
&& no_reload
== 0))
5015 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
- DM_NO_RELOAD
;
5017 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
+ DM_NO_RELOAD
;
5018 Cvar_SetValue ("deathmatch", deathmatch
.value
);
5023 deathmatch
.value
= deathmatch
.value
- DM_NO_RELOAD
;
5025 deathmatch
.value
= deathmatch
.value
+ DM_NO_RELOAD
;
5027 Cvar_SetValue ("deathmatch", deathmatch
.value
);
5030 case 12: // No armor
5031 no_armor
+= dir
* 1;
5044 if (items_respawn
== 0 && (deathmatch
.value
<= DM_NO_ARMOR
&& no_armor
== 0))
5049 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
- DM_NO_ARMOR
;
5051 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
+ DM_NO_ARMOR
;
5052 Cvar_SetValue ("deathmatch", deathmatch
.value
);
5057 deathmatch
.value
= deathmatch
.value
- DM_NO_ARMOR
;
5059 deathmatch
.value
= deathmatch
.value
+ DM_NO_ARMOR
;
5061 Cvar_SetValue ("deathmatch", deathmatch
.value
);
5064 case 13: // No health
5065 no_health
+= dir
* 1;
5078 if (items_respawn
== 0 && (deathmatch
.value
<= DM_NO_HEALTH
&& no_health
== 0))
5083 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
- DM_NO_HEALTH
;
5085 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
+ DM_NO_HEALTH
;
5086 Cvar_SetValue ("deathmatch", deathmatch
.value
);
5091 deathmatch
.value
= deathmatch
.value
- DM_NO_HEALTH
;
5093 deathmatch
.value
= deathmatch
.value
+ DM_NO_HEALTH
;
5095 Cvar_SetValue ("deathmatch", deathmatch
.value
);
5098 case 14: // Armor regen
5099 armor_regen
+= dir
* 1;
5101 if (armor_regen
< 0)
5106 if (armor_regen
> 1)
5112 if (items_respawn
== 0 && (deathmatch
.value
<= DM_ARMOR_REGEN
&& armor_regen
== 0))
5116 if (armor_regen
== 0)
5117 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
- DM_ARMOR_REGEN
;
5118 if (armor_regen
== 1)
5119 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
+ DM_ARMOR_REGEN
;
5120 Cvar_SetValue ("deathmatch", deathmatch
.value
);
5124 if (armor_regen
== 0)
5125 deathmatch
.value
= deathmatch
.value
- DM_ARMOR_REGEN
;
5126 if (armor_regen
== 1)
5127 deathmatch
.value
= deathmatch
.value
+ DM_ARMOR_REGEN
;
5129 Cvar_SetValue ("deathmatch", deathmatch
.value
);
5132 case 15: // Health regen
5133 health_regen
+= dir
* 1;
5135 if (health_regen
< 0)
5140 if (health_regen
> 1)
5146 if (items_respawn
== 0 && (deathmatch
.value
<= DM_HEALTH_REGEN
&& health_regen
== 0))
5150 if (health_regen
== 0)
5151 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
- DM_HEALTH_REGEN
;
5152 if (health_regen
== 1)
5153 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
+ DM_HEALTH_REGEN
;
5154 Cvar_SetValue ("deathmatch", deathmatch
.value
);
5158 if (health_regen
== 0)
5159 deathmatch
.value
= deathmatch
.value
- DM_HEALTH_REGEN
;
5160 if (health_regen
== 1)
5161 deathmatch
.value
= deathmatch
.value
+ DM_HEALTH_REGEN
;
5163 Cvar_SetValue ("deathmatch", deathmatch
.value
);
5166 case 16: // Safe spawn
5167 safe_spawn
+= dir
* 1;
5180 if (items_respawn
== 0 && (deathmatch
.value
<= DM_SAFE_SPAWN
&& safe_spawn
== 0))
5184 if (safe_spawn
== 0)
5185 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
- DM_SAFE_SPAWN
;
5186 if (safe_spawn
== 1)
5187 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
+ DM_SAFE_SPAWN
;
5188 Cvar_SetValue ("deathmatch", deathmatch
.value
);
5192 if (safe_spawn
== 0)
5193 deathmatch
.value
= deathmatch
.value
- DM_SAFE_SPAWN
;
5194 if (safe_spawn
== 1)
5195 deathmatch
.value
= deathmatch
.value
+ DM_SAFE_SPAWN
;
5197 Cvar_SetValue ("deathmatch", deathmatch
.value
);
5214 if (items_respawn
== 0 && (deathmatch
.value
<= DM_NO_BOTS
&& no_bots
== 0))
5219 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
- DM_NO_BOTS
;
5221 deathmatch
.value
= deathmatch
.value
+ DM_RESPAWN
+ DM_NO_BOTS
;
5222 Cvar_SetValue ("deathmatch", deathmatch
.value
);
5227 deathmatch
.value
= deathmatch
.value
- DM_NO_BOTS
;
5229 deathmatch
.value
= deathmatch
.value
+ DM_NO_BOTS
;
5231 Cvar_SetValue ("deathmatch", deathmatch
.value
);
5236 void M_DOptions_Draw (void)
5242 M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
5243 p
= Draw_CachePic ("gfx/p_multi.lmp");
5244 M_DrawPic ( (320-p
->width
)/2, 4, p
);
5246 M_DrawTextBox (152, 32, 4, 1);
5247 M_PrintWhite (160, 40, "Back");
5249 M_PrintWhite (0, 56, " Item Respawn");
5250 M_DrawCheckbox (208, 56, items_respawn
== 1);
5252 M_PrintWhite (0, 64, " Weapons Stay");
5253 M_DrawCheckbox (208, 64, weapons_stay
== 1);
5255 M_PrintWhite (0, 72, " Pistols Only");
5256 M_DrawCheckbox (208, 72, pistols
== 1);
5258 M_PrintWhite (0, 80, " Automatics Only");
5259 M_DrawCheckbox (208, 80, automatics
== 1);
5261 M_PrintWhite (0, 88, " Shotguns Only");
5262 M_DrawCheckbox (208, 88, shotguns
== 1);
5264 M_PrintWhite (0, 96, " Explosives Only");
5265 M_DrawCheckbox (208, 96, explosives
== 1);
5267 M_PrintWhite (0, 104, " Snipers Only");
5268 M_DrawCheckbox (208, 104, snipers
== 1);
5270 M_PrintWhite (0, 112, " Exits don't kill");
5271 M_DrawCheckbox (208, 112, exit_non_fatal
== 1);
5273 M_PrintWhite (0, 128, " Infinite Ammo");
5274 M_DrawCheckbox (208, 128, infinite_ammo
== 1);
5276 M_PrintWhite (0, 136, " All Weapons");
5277 M_DrawCheckbox (208, 136, all_weapons
== 1);
5279 M_PrintWhite (0, 144, " No Reload");
5280 M_DrawCheckbox (208, 144, no_reload
== 1);
5282 M_PrintWhite (0, 152, " No Armor Items");
5283 M_DrawCheckbox (208, 152, no_armor
== 1);
5285 M_PrintWhite (0, 160, " No Health Items");
5286 M_DrawCheckbox (208, 160, no_health
== 1);
5288 M_PrintWhite (0, 168, " Armor Regenerates");
5289 M_DrawCheckbox (208, 168, armor_regen
== 1);
5291 M_PrintWhite (0, 176, " Health Regenerates");
5292 M_DrawCheckbox (208, 176, health_regen
== 1);
5294 M_PrintWhite (0, 184, " Safe Spawn");
5295 M_DrawCheckbox (208, 184, safe_spawn
== 1);
5297 M_PrintWhite (0, 192, " No Bots");
5298 M_DrawCheckbox (208, 192, no_bots
== 1);
5301 if(doptions_cursor
== 0)
5302 M_DrawCharacter (152, doptions_cursor_table
[doptions_cursor
], 12+((int)(realtime
*30)&1));
5304 M_DrawCharacter (192, doptions_cursor_table
[doptions_cursor
], 12+((int)(realtime
*30)&1));
5307 if (m_dOptionsInfoMessage
)
5309 if ((realtime
- m_dOptionsInfoMessageTime
) < 2.0)
5312 M_DrawTextBox (x
, 138, 24, 4);
5314 M_Print (x
, 146, " Cannot turn off ");
5315 M_Print (x
, 154, " item respawns if no ");
5316 M_Print (x
, 162, " no other deathmatch ");
5317 M_Print (x
, 170, " options are set! ");
5321 m_dOptionsInfoMessage
= false;
5326 void M_DOptions_Key (int key
)
5331 M_Menu_GameOptions_f();
5335 S_LocalSound ("misc/menu1.wav");
5338 if (doptions_cursor
< 0)
5339 doptions_cursor
= NUM_DOPTIONS
-1;
5344 S_LocalSound ("misc/menu1.wav");
5347 if (doptions_cursor
>= NUM_DOPTIONS
)
5348 doptions_cursor
= 0;
5353 if (doptions_cursor
== 0)
5355 M_AdjustDSliders (-1);
5359 if (doptions_cursor
== 0)
5361 M_AdjustDSliders (1);
5365 S_LocalSound ("misc/menu2.wav");
5366 if (doptions_cursor
== 0)
5368 M_Menu_GameOptions_f();
5371 M_AdjustDSliders (1);
5376 //=============================================================================
5379 qboolean searchComplete
= false;
5380 double searchCompleteTime
;
5382 void M_Menu_Search_f (void)
5384 key_dest
= key_menu
;
5386 m_entersound
= false;
5389 searchComplete
= false;
5395 void M_Search_Draw (void)
5400 p
= Draw_CachePic ("gfx/p_multi.lmp");
5401 M_DrawPic ( (320-p
->width
)/2, 4, p
);
5402 x
= (320/2) - ((12*8)/2) + 4;
5403 M_DrawTextBox (x
-8, 32, 12, 1);
5404 M_Print (x
, 40, "Searching...");
5412 if (! searchComplete
)
5414 searchComplete
= true;
5415 searchCompleteTime
= realtime
;
5420 M_Menu_ServerList_f ();
5426 M_PrintWhite ((320/2) - ((22*8)/2), 64, "No Kurok servers found");
5427 if ((realtime
- searchCompleteTime
) < 3.0)
5433 M_PrintWhite ((320/2) - ((22*8)/2), 64, "No servers found");
5434 if ((realtime
- searchCompleteTime
) < 3.0)
5438 M_Menu_LanConfig_f ();
5442 void M_Search_Key (int key
)
5446 //=============================================================================
5450 qboolean slist_sorted
;
5452 void M_Menu_ServerList_f (void)
5454 key_dest
= key_menu
;
5456 m_entersound
= true;
5458 m_return_onerror
= false;
5459 m_return_reason
[0] = 0;
5460 slist_sorted
= false;
5464 void M_ServerList_Draw (void)
5472 if (hostCacheCount
> 1)
5476 for (i
= 0; i
< hostCacheCount
; i
++)
5477 for (j
= i
+1; j
< hostCacheCount
; j
++)
5478 if (strcmp(hostcache
[j
].name
, hostcache
[i
].name
) < 0)
5480 Q_memcpy(&temp
, &hostcache
[j
], sizeof(hostcache_t
));
5481 Q_memcpy(&hostcache
[j
], &hostcache
[i
], sizeof(hostcache_t
));
5482 Q_memcpy(&hostcache
[i
], &temp
, sizeof(hostcache_t
));
5485 slist_sorted
= true;
5489 M_DrawCharacter (0, 32 + slist_cursor
*8, 12+((int)(realtime
*30)&1));
5491 M_DrawCharacter (0, 32 + slist_cursor
*8, 12+((int)(realtime
*4)&1));
5493 p
= Draw_CachePic ("gfx/p_multi.lmp");
5494 M_DrawPic ( (320-p
->width
)/2, 4, p
);
5495 for (n
= 0; n
< hostCacheCount
; n
++)
5497 if (hostcache
[n
].maxusers
)
5498 sprintf(string
, "%-15.15s %-15.15s %2u/%2u\n", hostcache
[n
].name
, hostcache
[n
].map
, hostcache
[n
].users
, hostcache
[n
].maxusers
);
5500 sprintf(string
, "%-15.15s %-15.15s\n", hostcache
[n
].name
, hostcache
[n
].map
);
5501 M_Print (16, 32 + 8*n
, string
);
5504 if (*m_return_reason
)
5505 M_PrintWhite (16, 148, m_return_reason
);
5509 void M_ServerList_Key (int k
)
5514 M_Menu_LanConfig_f ();
5523 S_LocalSound ("misc/menu1.wav");
5525 if (slist_cursor
< 0)
5526 slist_cursor
= hostCacheCount
- 1;
5531 S_LocalSound ("misc/menu1.wav");
5533 if (slist_cursor
>= hostCacheCount
)
5538 S_LocalSound ("misc/menu2.wav");
5539 m_return_state
= m_state
;
5540 m_return_onerror
= true;
5541 slist_sorted
= false;
5542 key_dest
= key_game
;
5545 // If we were in a multiplayer game, reset all the deathmatch flags to 0;
5566 Cbuf_AddText ("viewsize 120\n cl_gunpitch 0\n fov 90\n scr_ofsy 0\n cl_autoaim 1\n chase_active 0\n");
5568 Cbuf_AddText ( va ("connect \"%s\"\n", hostcache
[slist_cursor
].cname
) );
5577 //=============================================================================
5578 /* Menu Subsystem */
5583 Cmd_AddCommand ("togglemenu", M_ToggleMenu_f
);
5585 Cmd_AddCommand ("menu_main", M_Menu_Main_f
);
5586 Cmd_AddCommand ("menu_singleplayer", M_Menu_SinglePlayer_f
);
5587 Cmd_AddCommand ("menu_load", M_Menu_Load_f
);
5588 Cmd_AddCommand ("menu_save", M_Menu_Save_f
);
5589 Cmd_AddCommand ("menu_multiplayer", M_Menu_MultiPlayer_f
);
5590 Cmd_AddCommand ("menu_setup", M_Menu_Setup_f
);
5591 Cmd_AddCommand ("menu_options", M_Menu_Options_f
);
5592 Cmd_AddCommand ("menu_keys", M_Menu_Keys_f
);
5593 Cmd_AddCommand ("menu_video", M_Menu_Video_f
);
5594 Cmd_AddCommand ("help", M_Menu_Help_f
);
5595 Cmd_AddCommand ("menu_quit", M_Menu_Quit_f
);
5601 if (m_state
== m_none
|| key_dest
!= key_menu
)
5604 if (!m_recursiveDraw
)
5606 scr_copyeverything
= 1;
5608 if (scr_con_current
)
5610 Draw_ConsoleBackground (vid
.height
);
5611 VID_UnlockBuffer ();
5618 Draw_FadeScreen2 ();
5626 m_recursiveDraw
= false;
5638 case m_singleplayer
:
5639 M_SinglePlayer_Draw ();
5651 M_MultiPlayer_Draw ();
5682 case m_serialconfig
:
5683 M_SerialConfig_Draw ();
5687 M_ModemConfig_Draw ();
5691 M_LanConfig_Draw ();
5695 M_GameOptions_Draw ();
5707 M_ServerList_Draw ();
5717 S_LocalSound ("misc/menu2.wav");
5718 m_entersound
= false;
5721 VID_UnlockBuffer ();
5727 void M_Keydown (int key
)
5738 case m_singleplayer
:
5739 M_SinglePlayer_Key (key
);
5751 M_MultiPlayer_Key (key
);
5763 M_Options_Key (key
);
5782 case m_serialconfig
:
5783 M_SerialConfig_Key (key
);
5787 M_ModemConfig_Key (key
);
5791 M_LanConfig_Key (key
);
5795 M_GameOptions_Key (key
);
5799 M_DOptions_Key (key
);
5807 M_ServerList_Key (key
);
5816 void M_ConfigureNetSubsystem(void)
5818 // enable/disable net systems to match desired config
5820 Cbuf_AddText ("stopdemo\n");
5821 if (SerialConfig
|| DirectConfig
)
5823 Cbuf_AddText ("com1 enable\n");
5826 if (IPXConfig
|| TCPIPConfig
)
5827 net_hostport
= lanConfig_port
;