rip dreamcast sweet prince
This commit is contained in:
1 parent
f92a7582c6
commit
22bdf442d4
38 files changed
+66
-2019
No files matched your search
@@ -325,10 +325,8 @@ endif
|
||||
ifdef NOHW
|
||||
OPTS+=-DNOHW
|
||||
else
|
||||
ifndef DC
|
||||
#Hurdler: not really supported and not tested recently
|
||||
#OPTS+=-DUSE_PALETTED_TEXTURE
|
||||
endif
|
||||
OPTS+=-DHWRENDER
|
||||
OBJS+=$(OBJDIR)/hw_bsp.o $(OBJDIR)/hw_draw.o $(OBJDIR)/hw_light.o \
|
||||
$(OBJDIR)/hw_main.o $(OBJDIR)/hw_clip.o $(OBJDIR)/hw_md2.o $(OBJDIR)/hw_cache.o $(OBJDIR)/hw_trick.o \
|
||||
@@ -643,11 +641,6 @@ ifdef PSP
|
||||
all: pre-build $(BIN)/$(BINNAME) post-build
|
||||
endif
|
||||
|
||||
ifdef DC
|
||||
all: pre-build $(BIN)/$(BINNAME) post-build
|
||||
endif
|
||||
|
||||
ifndef DC
|
||||
ifndef PSP
|
||||
ifndef XBOX
|
||||
ifdef MINGW
|
||||
@@ -656,7 +649,6 @@ all: pre-build $(BIN)/$(EXENAME) dll
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef SDL
|
||||
all: pre-build $(BIN)/$(EXENAME)
|
||||
@@ -840,16 +832,6 @@ endif
|
||||
$(REMOVE) $(OBJDIR)/depend.ped
|
||||
@echo "Created dependency file, depend.dep"
|
||||
|
||||
ifdef DC
|
||||
$(OBJDIR)/v_video.o: v_video.c doomdef.h doomtype.h g_state.h m_swap.h r_local.h \
|
||||
tables.h m_fixed.h screen.h command.h m_bbox.h r_main.h d_player.h \
|
||||
p_pspr.h info.h d_think.h sounds.h p_mobj.h doomdata.h d_ticcmd.h \
|
||||
r_data.h r_defs.h r_state.h r_bsp.h r_segs.h r_plane.h r_sky.h \
|
||||
r_things.h r_draw.h v_video.h hu_stuff.h d_event.h w_wad.h console.h \
|
||||
i_video.h z_zone.h doomstat.h d_clisrv.h d_netcmd.h
|
||||
$(CC) $(CFLAGS) -fno-omit-frame-pointer $(WFLAGS) -c $< -o $@
|
||||
endif
|
||||
|
||||
ifdef VALGRIND
|
||||
$(OBJDIR)/z_zone.o: z_zone.c
|
||||
$(CC) $(CFLAGS) $(WFLAGS) -DHAVE_VALGRIND $(VALGRIND_CFLAGS) -c $< -o $@
|
||||
@@ -885,55 +867,6 @@ $(OBJDIR)/%.o: %.s
|
||||
$(OBJDIR)/SRB2.res: win32/Srb2win.rc win32/afxres.h win32/resource.h
|
||||
$(WINDRES) -i $< -O rc $(WINDRESFLAGS) --include-dir=win32 -o $@ -O coff
|
||||
|
||||
ifdef DC
|
||||
$(OBJDIR)/romdisk.img:
|
||||
$(KOS_GENROMFS) -f romdisk.img -d ../data -v
|
||||
|
||||
$(OBJDIR)/romdisk.o: romdisk.img
|
||||
$(KOS_BASE)/utils/bin2o/bin2o romdisk.img romdisk romdisk.o
|
||||
|
||||
$(OBJDIR)/dchelp.o: $(INTERFACE)/SRB2DC/dchelp.c
|
||||
$(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@
|
||||
|
||||
$(OBJDIR)/i_udp.o: $(INTERFACE)/SRB2DC/i_udp.c
|
||||
$(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@
|
||||
|
||||
$(BIN)/IP.BIN: $(INTERFACE)/SRB2DC/IP.BIN
|
||||
$(CP) $< $@
|
||||
|
||||
$(BIN)/SRB2DC.cdi.pass1: $(INTERFACE)/SRB2DC/SELFBOOT.BIN
|
||||
$(CP) $< $@
|
||||
|
||||
$(BIN)/$(BINNAME): $(BIN)/$(EXENAME)
|
||||
$(KOS_OBJCOPY) -R .stack -O binary $< $@
|
||||
|
||||
$(BIN)/1ST_READ.BIN: $(BIN)/$(BINNAME) $(BIN)/scramble
|
||||
$(BIN)/scramble $< $@
|
||||
|
||||
$(BIN)/scramble: $(INTERFACE)/SRB2DC/scramble.c
|
||||
-$(MKDIR) $(BIN)
|
||||
$(HOSTCC) $< -o $@
|
||||
|
||||
iso: $(BIN)/SRB2DC.iso
|
||||
cdi: $(BIN)/SRB2DC.cdi
|
||||
|
||||
$(BIN)/SRB2DC.iso.pass1: $(BIN)/1ST_READ.BIN $(BIN)/IP.BIN
|
||||
-$(MKDIR) $(BIN)/cdrom
|
||||
$(CP) $(BIN)/1ST_READ.BIN $(D_FILES) $(BIN)/cdrom
|
||||
$(MKISOFS) -l -r -o $@ $(BIN)/cdrom
|
||||
|
||||
$(BIN)/SRB2DC.iso.pass2: $(BIN)/SRB2DC.iso.pass1
|
||||
$(DD) if=$< of=$@ bs=2048 skip=16 status=noxfer
|
||||
|
||||
$(BIN)/SRB2DC.iso: $(BIN)/SRB2DC.iso.pass2 $(BIN)/IP.BIN
|
||||
@cat $(BIN)/IP.BIN $(BIN)/SRB2DC.iso.pass2 > $@
|
||||
|
||||
$(BIN)/SRB2DC.cdi: $(BIN)/SRB2DC.iso.pass2 $(BIN)/SRB2DC.cdi.pass1 $(BIN)/IP.BIN
|
||||
@cat $(BIN)/SRB2DC.cdi.pass1 $(BIN)/IP.BIN $(BIN)/SRB2DC.iso.pass2 > $@
|
||||
|
||||
post-build: $(BIN)/1ST_READ.BIN
|
||||
endif
|
||||
|
||||
ifdef XBOX
|
||||
$(OBJDIR)/xboxhelp.o: $(INTERFACE)/SRB2XBOX/xboxhelp.c
|
||||
$(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@
|
||||
|
||||
@@ -204,10 +204,6 @@ ifdef GCC295
|
||||
GCC29=1
|
||||
endif
|
||||
|
||||
ifdef DC
|
||||
NOCASTALIGNWARN=1
|
||||
endif
|
||||
|
||||
OLDWFLAGS:=$(WFLAGS)
|
||||
# -W -Wno-unused
|
||||
WFLAGS=-Wall
|
||||
@@ -347,7 +343,6 @@ endif
|
||||
ifndef WINCE
|
||||
ifndef XBOX
|
||||
ifndef PSP
|
||||
ifndef DC
|
||||
ifndef WII
|
||||
ifndef PS3N
|
||||
ifndef LINUX
|
||||
@@ -372,7 +367,6 @@ endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
#determine the interface directory (where you put all i_*.c)
|
||||
i_net_o=$(OBJDIR)/i_net.o
|
||||
@@ -495,15 +489,6 @@ ifdef PSP
|
||||
BIN:=$(BIN)/PSP
|
||||
NOUPX=1
|
||||
else
|
||||
ifdef DC
|
||||
INTERFACE=sdl12
|
||||
NONX86=1
|
||||
SDL=1
|
||||
SDL12=1
|
||||
OBJDIR:=$(OBJDIR)/DC
|
||||
BIN:=$(BIN)/DC
|
||||
NOUPX=1
|
||||
else
|
||||
ifdef WINCE
|
||||
INTERFACE=sdl12
|
||||
NONX86=1
|
||||
@@ -532,7 +517,6 @@ endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef GP2X
|
||||
ifdef SDL
|
||||
|
||||
@@ -1416,9 +1416,7 @@ void CONS_Printf(const char *fmt, ...)
|
||||
va_end(argptr);
|
||||
|
||||
// echo console prints to log file
|
||||
#ifndef _arch_dreamcast
|
||||
DEBFILE(txt);
|
||||
#endif
|
||||
|
||||
if (!con_started)
|
||||
{
|
||||
|
||||
+1
-18
@@ -154,13 +154,8 @@ INT32 debugload = 0;
|
||||
|
||||
char savegamename[256];
|
||||
|
||||
#ifdef _arch_dreamcast
|
||||
char srb2home[256] = "/cd";
|
||||
char srb2path[256] = "/cd";
|
||||
#else
|
||||
char srb2home[256] = ".";
|
||||
char srb2path[256] = ".";
|
||||
#endif
|
||||
boolean usehome = true;
|
||||
const char *pandf = "%s" PATHSEP "%s";
|
||||
|
||||
@@ -979,11 +974,7 @@ static void IdentifyVersion(void)
|
||||
else
|
||||
#endif
|
||||
{
|
||||
#ifdef _arch_dreamcast
|
||||
srb2waddir = "/cd";
|
||||
#else
|
||||
srb2waddir = srb2path;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1180,7 +1171,7 @@ void D_SRB2Main(void)
|
||||
|
||||
if (!userhome)
|
||||
{
|
||||
#if ((defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)) && !defined (__CYGWIN__) && !defined (DC) && !defined (PSP) && !defined(GP2X)
|
||||
#if ((defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)) && !defined (__CYGWIN__) && !defined (PSP) && !defined(GP2X)
|
||||
I_Error("Please set $HOME to your home directory\n");
|
||||
#elif defined (_WIN32_WCE) && 0
|
||||
if (dedicated)
|
||||
@@ -1243,10 +1234,6 @@ void D_SRB2Main(void)
|
||||
fclose(tmpfile);
|
||||
remove(testfile);
|
||||
}
|
||||
|
||||
#ifdef _arch_dreamcast
|
||||
strcpy(downloaddir, "/ram"); // the dreamcast's TMP
|
||||
#endif
|
||||
}
|
||||
|
||||
D_SetupProtocol();
|
||||
@@ -1765,10 +1752,6 @@ const char *D_Home(void)
|
||||
#ifdef ANDROID
|
||||
return "/data/data/org.srb2/";
|
||||
#endif
|
||||
#ifdef _arch_dreamcast
|
||||
char VMUHOME[] = "HOME=/vmu/a1";
|
||||
putenv(VMUHOME); //don't use I_PutEnv
|
||||
#endif
|
||||
|
||||
if (M_CheckParm("-home") && M_IsNextParm())
|
||||
userhome = M_GetNextParm();
|
||||
|
||||
@@ -1352,11 +1352,6 @@ boolean D_CheckNetGame(void)
|
||||
holepunchpacket = (holepunch_t *)(void *)&doomcom->data;
|
||||
|
||||
#ifdef DEBUGFILE
|
||||
#ifdef _arch_dreamcast
|
||||
//debugfile = stderr;
|
||||
if (debugfile)
|
||||
CONS_Printf(M_GetText("debug output to: %s\n"), "STDERR");
|
||||
#else
|
||||
if (M_CheckParm("-debugfile"))
|
||||
{
|
||||
char filename[21];
|
||||
@@ -1374,7 +1369,6 @@ boolean D_CheckNetGame(void)
|
||||
else
|
||||
CONS_Alert(CONS_WARNING, M_GetText("cannot debug output to file %s!\n"), va("%s" PATHSEP "%s", srb2home, filename));
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
D_ClientServerInit();
|
||||
|
||||
+1
-1
@@ -302,7 +302,7 @@ INT32 cv_debug;
|
||||
consvar_t cv_usemouse = {"use_mouse", "Off", CV_SAVE|CV_CALL,usemouse_cons_t, I_StartupMouse, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_usemouse2 = {"use_mouse2", "Off", CV_SAVE|CV_CALL,usemouse_cons_t, I_StartupMouse2, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
#if defined (DC) || defined (_XBOX) || defined (WMINPUT) || defined (_WII) || defined(HAVE_SDL) || defined(_WINDOWS) //joystick 1 and 2
|
||||
#if defined (_XBOX) || defined (WMINPUT) || defined (_WII) || defined(HAVE_SDL) || defined(_WINDOWS) //joystick 1 and 2
|
||||
consvar_t cv_usejoystick = {"use_joystick", "1", CV_SAVE|CV_CALL, usejoystick_cons_t,
|
||||
I_InitJoystick, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_usejoystick2 = {"use_joystick2", "2", CV_SAVE|CV_CALL, usejoystick_cons_t,
|
||||
|
||||
+1
-5
@@ -1142,7 +1142,7 @@ size_t nameonlylength(const char *s)
|
||||
|
||||
filestatus_t checkfilemd5(char *filename, const UINT8 *wantedmd5sum)
|
||||
{
|
||||
#if defined (NOMD5) || defined (_arch_dreamcast)
|
||||
#if defined (NOMD5)
|
||||
(void)wantedmd5sum;
|
||||
(void)filename;
|
||||
#else
|
||||
@@ -1194,11 +1194,7 @@ filestatus_t findfile(char *filename, const UINT8 *wantedmd5sum, boolean complet
|
||||
// if not found at all, just move on without doing anything
|
||||
|
||||
// finally check "." directory
|
||||
#ifdef _arch_dreamcast
|
||||
homecheck = filesearch(filename, "/cd", wantedmd5sum, completepath, 10);
|
||||
#else
|
||||
homecheck = filesearch(filename, ".", wantedmd5sum, completepath, 10);
|
||||
#endif
|
||||
|
||||
if (homecheck != FS_NOTFOUND) // if not found this time, fall back on the below return statement
|
||||
return homecheck; // otherwise return the result we got
|
||||
|
||||
+2
-2
@@ -28,7 +28,7 @@
|
||||
|
||||
// Use Mixer interface?
|
||||
#ifdef HAVE_MIXER
|
||||
//#if !defined(DC) && !defined(_WIN32_WCE) && !defined(_XBOX) && !defined(GP2X)
|
||||
//#if !defined(_WIN32_WCE) && !defined(_XBOX) && !defined(GP2X)
|
||||
#define SOUND SOUND_MIXER
|
||||
#ifdef HW3SOUND
|
||||
#undef HW3SOUND
|
||||
@@ -431,7 +431,7 @@ enum {
|
||||
};
|
||||
|
||||
// Name of local directory for config files and savegames
|
||||
#if !defined(_arch_dreamcast) && !defined(_WIN32_WCE) && !defined(GP2X) && !defined(_WII) && !defined(_PS3)
|
||||
#if !defined(_WIN32_WCE) && !defined(GP2X) && !defined(_WII) && !defined(_PS3)
|
||||
#if (((defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON)) && !defined (__CYGWIN__)) && !defined (__APPLE__)
|
||||
#define DEFAULTDIR ".srb2kart"
|
||||
#else
|
||||
|
||||
+1
-14
@@ -52,19 +52,6 @@ typedef long ssize_t;
|
||||
#define PDWORD_PTR PDWORD
|
||||
#endif
|
||||
#endif
|
||||
#elif defined (_arch_dreamcast) // KOS Dreamcast
|
||||
#include <arch/types.h>
|
||||
|
||||
#define UINT8 unsigned char
|
||||
#define SINT8 signed char
|
||||
|
||||
#define UINT16 uint16
|
||||
#define INT16 int16
|
||||
|
||||
#define INT32 int
|
||||
#define UINT32 unsigned int
|
||||
#define INT64 int64
|
||||
#define UINT64 uint64
|
||||
#elif defined (__DJGPP__)
|
||||
#define UINT8 unsigned char
|
||||
#define SINT8 signed char
|
||||
@@ -160,7 +147,7 @@ char *strcasestr(const char *in, const char *what);
|
||||
#endif
|
||||
#endif //macintosh
|
||||
|
||||
#if defined (PC_DOS) || defined (_WIN32) || defined (_WII) || defined (_PSP) || defined (_arch_dreamcast) || defined (__HAIKU__) || defined(_NDS) || defined(_PS3)
|
||||
#if defined (PC_DOS) || defined (_WIN32) || defined (_WII) || defined (_PSP) || defined (__HAIKU__) || defined(_NDS) || defined(_PS3)
|
||||
#define HAVE_DOSSTR_FUNCS
|
||||
#endif
|
||||
|
||||
|
||||
+1
-58
@@ -397,11 +397,7 @@ static CV_PossibleValue_t joyaxis_cons_t[] = {{0, "None"},
|
||||
#endif
|
||||
#else
|
||||
{1, "Left X"}, {2, "Left Y"}, {-1, "Left X-"}, {-2, "Left Y-"},
|
||||
#ifdef _arch_dreamcast
|
||||
{3, "R-Trig"}, {4, "L-Trig"}, {-3, "R-Trig-"}, {-4, "L-Trig-"},
|
||||
{5, "Alt X-Axis"}, {6, "Alt Y-Axis"}, {-5, "Alt X-Axis-"}, {-6, "Alt Y-Axis-"},
|
||||
{7, "Triggers"}, {-7,"Triggers-"},
|
||||
#elif defined (_XBOX)
|
||||
#ifdef _XBOX
|
||||
{3, "Alt X-Axis"}, {4, "Alt Y-Axis"}, {-3, "Alt X-Axis-"}, {-4, "Alt Y-Axis-"},
|
||||
#else
|
||||
#if JOYAXISSET > 1
|
||||
@@ -488,15 +484,10 @@ consvar_t cv_analog = {"analog", "Off", CV_CALL, CV_OnOff, Analog_OnChange, 0, N
|
||||
consvar_t cv_analog2 = {"analog2", "Off", CV_CALL, CV_OnOff, Analog2_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_analog3 = {"analog3", "Off", CV_CALL, CV_OnOff, Analog3_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_analog4 = {"analog4", "Off", CV_CALL, CV_OnOff, Analog4_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
#ifdef DC
|
||||
consvar_t cv_useranalog = {"useranalog", "On", CV_SAVE|CV_CALL, CV_OnOff, UserAnalog_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_useranalog2 = {"useranalog2", "On", CV_SAVE|CV_CALL, CV_OnOff, UserAnalog2_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
#else
|
||||
consvar_t cv_useranalog = {"useranalog", "Off", CV_SAVE|CV_CALL, CV_OnOff, UserAnalog_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_useranalog2 = {"useranalog2", "Off", CV_SAVE|CV_CALL, CV_OnOff, UserAnalog2_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_useranalog3 = {"useranalog3", "Off", CV_SAVE|CV_CALL, CV_OnOff, UserAnalog3_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_useranalog4 = {"useranalog4", "Off", CV_SAVE|CV_CALL, CV_OnOff, UserAnalog4_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
#endif
|
||||
|
||||
consvar_t cv_turnaxis = {"joyaxis_turn", "Left X", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_moveaxis = {"joyaxis_move", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
@@ -977,14 +968,6 @@ static INT32 Joy1Axis(axis_input_e axissel)
|
||||
axisval = -axisval;
|
||||
flp = true;
|
||||
}
|
||||
#ifdef _arch_dreamcast
|
||||
if (axisval == 7) // special case
|
||||
{
|
||||
retaxis = joyxmove[1] - joyymove[1];
|
||||
goto skipDC;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (axisval > JOYAXISSET*2 || axisval == 0) //not there in array or None
|
||||
return 0;
|
||||
|
||||
@@ -1027,10 +1010,6 @@ static INT32 Joy1Axis(axis_input_e axissel)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _arch_dreamcast
|
||||
skipDC:
|
||||
#endif
|
||||
|
||||
static INT32 Joy2Axis(axis_input_e axissel)
|
||||
{
|
||||
INT32 retaxis;
|
||||
@@ -1073,14 +1052,6 @@ static INT32 Joy2Axis(axis_input_e axissel)
|
||||
axisval = -axisval;
|
||||
flp = true;
|
||||
}
|
||||
#ifdef _arch_dreamcast
|
||||
if (axisval == 7) // special case
|
||||
{
|
||||
retaxis = joy2xmove[1] - joy2ymove[1];
|
||||
goto skipDC;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (axisval > JOYAXISSET*2 || axisval == 0) //not there in array or None
|
||||
return 0;
|
||||
|
||||
@@ -1125,10 +1096,6 @@ static INT32 Joy2Axis(axis_input_e axissel)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _arch_dreamcast
|
||||
skipDC:
|
||||
#endif
|
||||
|
||||
static INT32 Joy3Axis(axis_input_e axissel)
|
||||
{
|
||||
INT32 retaxis;
|
||||
@@ -1171,14 +1138,6 @@ static INT32 Joy3Axis(axis_input_e axissel)
|
||||
axisval = -axisval;
|
||||
flp = true;
|
||||
}
|
||||
#ifdef _arch_dreamcast
|
||||
if (axisval == 7) // special case
|
||||
{
|
||||
retaxis = joy3xmove[1] - joy3ymove[1];
|
||||
goto skipDC;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (axisval > JOYAXISSET*2 || axisval == 0) //not there in array or None
|
||||
return 0;
|
||||
|
||||
@@ -1223,10 +1182,6 @@ static INT32 Joy3Axis(axis_input_e axissel)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _arch_dreamcast
|
||||
skipDC:
|
||||
#endif
|
||||
|
||||
static INT32 Joy4Axis(axis_input_e axissel)
|
||||
{
|
||||
INT32 retaxis;
|
||||
@@ -1269,14 +1224,6 @@ static INT32 Joy4Axis(axis_input_e axissel)
|
||||
axisval = -axisval;
|
||||
flp = true;
|
||||
}
|
||||
#ifdef _arch_dreamcast
|
||||
if (axisval == 7) // special case
|
||||
{
|
||||
retaxis = joy4xmove[1] - joy4ymove[1];
|
||||
goto skipDC;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (axisval > JOYAXISSET*2 || axisval == 0) //not there in array or None
|
||||
return 0;
|
||||
|
||||
@@ -1321,10 +1268,6 @@ static INT32 Joy4Axis(axis_input_e axissel)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _arch_dreamcast
|
||||
skipDC:
|
||||
#endif
|
||||
|
||||
boolean InputDown(INT32 gc, UINT8 p)
|
||||
{
|
||||
switch (p)
|
||||
|
||||
+12
-58
@@ -243,11 +243,9 @@ static keyname_t keynames[] =
|
||||
{KEY_SCROLLLOCK, "SCROLLLOCK"},
|
||||
|
||||
// bill gates keys
|
||||
#ifndef _arch_dreamcast
|
||||
{KEY_LEFTWIN, "LEFTWIN"},
|
||||
{KEY_RIGHTWIN, "RIGHTWIN"},
|
||||
{KEY_MENU, "MENU"},
|
||||
#endif
|
||||
|
||||
{KEY_LSHIFT, "LSHIFT"},
|
||||
{KEY_RSHIFT, "RSHIFT"},
|
||||
@@ -309,7 +307,7 @@ static keyname_t keynames[] =
|
||||
{KEY_MOUSE1+0,"MOUSE1"},
|
||||
{KEY_MOUSE1+1,"MOUSE2"},
|
||||
{KEY_MOUSE1+2,"MOUSE3"},
|
||||
#if !defined (_arch_dreamcast) && !defined (_XBOX) && !defined (_PSP) && !defined (_WII)
|
||||
#if !defined (_XBOX) && !defined (_PSP) && !defined (_WII)
|
||||
{KEY_MOUSE1+3,"MOUSE4"},
|
||||
{KEY_MOUSE1+4,"MOUSE5"},
|
||||
{KEY_MOUSE1+5,"MOUSE6"},
|
||||
@@ -319,7 +317,7 @@ static keyname_t keynames[] =
|
||||
{KEY_2MOUSE1+0,"SEC_MOUSE2"}, // BP: sorry my mouse handler swap button 1 and 2
|
||||
{KEY_2MOUSE1+1,"SEC_MOUSE1"},
|
||||
{KEY_2MOUSE1+2,"SEC_MOUSE3"},
|
||||
#if !defined (_arch_dreamcast) && !defined (_XBOX) && !defined (_PSP) && !defined (_WII)
|
||||
#if !defined (_XBOX) && !defined (_PSP) && !defined (_WII)
|
||||
{KEY_2MOUSE1+3,"SEC_MOUSE4"},
|
||||
{KEY_2MOUSE1+4,"SEC_MOUSE5"},
|
||||
{KEY_2MOUSE1+5,"SEC_MOUSE6"},
|
||||
@@ -331,16 +329,7 @@ static keyname_t keynames[] =
|
||||
{KEY_2MOUSEWHEELUP, "Wheel 2 UP"},
|
||||
{KEY_2MOUSEWHEELDOWN, "Wheel 2 Down"},
|
||||
|
||||
#ifdef DC
|
||||
{KEY_JOY1+0, "JOYC"},
|
||||
{KEY_JOY1+1, "JOYB"},
|
||||
{KEY_JOY1+2, "JOYA"},
|
||||
{KEY_JOY1+3, "JOYS"},
|
||||
{KEY_JOY1+4, "JOYZ"},
|
||||
{KEY_JOY1+5, "JOYY"},
|
||||
{KEY_JOY1+6, "JOYX"},
|
||||
{KEY_JOY1+7, "JOYD"},
|
||||
#elif defined (_XBOX)
|
||||
#ifdef _XBOX
|
||||
{KEY_JOY1+0, "JOYA"},
|
||||
{KEY_JOY1+1, "JOYB"},
|
||||
{KEY_JOY1+2, "JOYX"},
|
||||
@@ -453,7 +442,7 @@ static keyname_t keynames[] =
|
||||
{KEY_JOY1+7, "JOY8"},
|
||||
{KEY_JOY1+8, "JOY9"},
|
||||
#endif
|
||||
#if !defined (_arch_dreamcast) && !defined (NOMOREJOYBTN_1S)
|
||||
#if !defined (NOMOREJOYBTN_1S)
|
||||
// we use up to 32 buttons in DirectInput
|
||||
{KEY_JOY1+9, "JOY10"},
|
||||
{KEY_JOY1+10, "JOY11"},
|
||||
@@ -489,7 +478,6 @@ static keyname_t keynames[] =
|
||||
{KEY_HAT1+5, "HATDOWN2"},
|
||||
{KEY_HAT1+6, "HATLEFT2"},
|
||||
{KEY_HAT1+7, "HATRIGHT2"},
|
||||
#ifndef _arch_dreamcast
|
||||
{KEY_HAT1+8, "HATUP3"},
|
||||
{KEY_HAT1+9, "HATDOWN3"},
|
||||
{KEY_HAT1+10, "HATLEFT3"},
|
||||
@@ -498,13 +486,12 @@ static keyname_t keynames[] =
|
||||
{KEY_HAT1+13, "HATDOWN4"},
|
||||
{KEY_HAT1+14, "HATLEFT4"},
|
||||
{KEY_HAT1+15, "HATRIGHT4"},
|
||||
#endif
|
||||
#endif
|
||||
|
||||
{KEY_DBLMOUSE1+0, "DBLMOUSE1"},
|
||||
{KEY_DBLMOUSE1+1, "DBLMOUSE2"},
|
||||
{KEY_DBLMOUSE1+2, "DBLMOUSE3"},
|
||||
#if !defined (_arch_dreamcast) && !defined (_XBOX) && !defined (_PSP) && !defined (_WII)
|
||||
#if !defined (_XBOX) && !defined (_PSP) && !defined (_WII)
|
||||
{KEY_DBLMOUSE1+3, "DBLMOUSE4"},
|
||||
{KEY_DBLMOUSE1+4, "DBLMOUSE5"},
|
||||
{KEY_DBLMOUSE1+5, "DBLMOUSE6"},
|
||||
@@ -514,7 +501,7 @@ static keyname_t keynames[] =
|
||||
{KEY_DBL2MOUSE1+0, "DBLSEC_MOUSE2"}, // BP: sorry my mouse handler swap button 1 and 2
|
||||
{KEY_DBL2MOUSE1+1, "DBLSEC_MOUSE1"},
|
||||
{KEY_DBL2MOUSE1+2, "DBLSEC_MOUSE3"},
|
||||
#if !defined (_arch_dreamcast) && !defined (_XBOX) && !defined (_PSP) && !defined (_WII)
|
||||
#if !defined (_XBOX) && !defined (_PSP) && !defined (_WII)
|
||||
{KEY_DBL2MOUSE1+3, "DBLSEC_MOUSE4"},
|
||||
{KEY_DBL2MOUSE1+4, "DBLSEC_MOUSE5"},
|
||||
{KEY_DBL2MOUSE1+5, "DBLSEC_MOUSE6"},
|
||||
@@ -522,16 +509,7 @@ static keyname_t keynames[] =
|
||||
{KEY_DBL2MOUSE1+7, "DBLSEC_MOUSE8"},
|
||||
#endif
|
||||
|
||||
#ifdef DC
|
||||
{KEY_DBLJOY1+0, "DBLJOYC"},
|
||||
{KEY_DBLJOY1+1, "DBLJOYB"},
|
||||
{KEY_DBLJOY1+2, "DBLJOYA"},
|
||||
{KEY_DBLJOY1+3, "DBLJOYS"},
|
||||
{KEY_DBLJOY1+4, "DBLJOYZ"},
|
||||
{KEY_DBLJOY1+5, "DBLJOYY"},
|
||||
{KEY_DBLJOY1+6, "DBLJOYX"},
|
||||
{KEY_DBLJOY1+7, "DBLJOYD"},
|
||||
#elif defined (_XBOX)
|
||||
#ifdef _XBOX
|
||||
{KEY_DBLJOY1+0, "DBLJOYA"},
|
||||
{KEY_DBLJOY1+1, "DBLJOYB"},
|
||||
{KEY_DBLJOY1+2, "DBLJOYX"},
|
||||
@@ -643,7 +621,7 @@ static keyname_t keynames[] =
|
||||
{KEY_DBLJOY1+6, "DBLJOY7"},
|
||||
{KEY_DBLJOY1+7, "DBLJOY8"},
|
||||
#endif
|
||||
#if !defined (_arch_dreamcast) && !defined (NOMOREJOYBTN_1DBL)
|
||||
#if !defined (NOMOREJOYBTN_1DBL)
|
||||
{KEY_DBLJOY1+8, "DBLJOY9"},
|
||||
{KEY_DBLJOY1+9, "DBLJOY10"},
|
||||
{KEY_DBLJOY1+10, "DBLJOY11"},
|
||||
@@ -678,7 +656,6 @@ static keyname_t keynames[] =
|
||||
{KEY_DBLHAT1+5, "DBLHATDOWN2"},
|
||||
{KEY_DBLHAT1+6, "DBLHATLEFT2"},
|
||||
{KEY_DBLHAT1+7, "DBLHATRIGHT2"},
|
||||
#ifndef _arch_dreamcast
|
||||
{KEY_DBLHAT1+8, "DBLHATUP3"},
|
||||
{KEY_DBLHAT1+9, "DBLHATDOWN3"},
|
||||
{KEY_DBLHAT1+10, "DBLHATLEFT3"},
|
||||
@@ -688,18 +665,8 @@ static keyname_t keynames[] =
|
||||
{KEY_DBLHAT1+14, "DBLHATLEFT4"},
|
||||
{KEY_DBLHAT1+15, "DBLHATRIGHT4"},
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef DC
|
||||
{KEY_2JOY1+0, "SEC_JOYC"},
|
||||
{KEY_2JOY1+1, "SEC_JOYB"},
|
||||
{KEY_2JOY1+2, "SEC_JOYA"},
|
||||
{KEY_2JOY1+3, "SEC_JOYS"},
|
||||
{KEY_2JOY1+4, "SEC_JOYZ"},
|
||||
{KEY_2JOY1+5, "SEC_JOYY"},
|
||||
{KEY_2JOY1+6, "SEC_JOYX"},
|
||||
{KEY_2JOY1+7, "SEC_JOYD"},
|
||||
#elif defined (_XBOX)
|
||||
#ifdef _XBOX
|
||||
{KEY_2JOY1+0, "SEC_JOYA"},
|
||||
{KEY_2JOY1+1, "SEC_JOYB"},
|
||||
{KEY_2JOY1+2, "SEC_JOYX"},
|
||||
@@ -791,7 +758,7 @@ static keyname_t keynames[] =
|
||||
{KEY_2JOY1+6, "SEC_JOY7"},
|
||||
{KEY_2JOY1+7, "SEC_JOY8"},
|
||||
#endif
|
||||
#if !defined (_arch_dreamcast) && !defined (NOMOREJOYBTN_2S)
|
||||
#if !defined (NOMOREJOYBTN_2S)
|
||||
// we use up to 32 buttons in DirectInput
|
||||
{KEY_2JOY1+8, "SEC_JOY9"},
|
||||
{KEY_2JOY1+9, "SEC_JOY10"},
|
||||
@@ -828,7 +795,6 @@ static keyname_t keynames[] =
|
||||
{KEY_2HAT1+5, "SEC_HATDOWN2"},
|
||||
{KEY_2HAT1+6, "SEC_HATLEFT2"},
|
||||
{KEY_2HAT1+7, "SEC_HATRIGHT2"},
|
||||
#ifndef _arch_dreamcast
|
||||
{KEY_2HAT1+8, "SEC_HATUP3"},
|
||||
{KEY_2HAT1+9, "SEC_HATDOWN3"},
|
||||
{KEY_2HAT1+10, "SEC_HATLEFT3"},
|
||||
@@ -838,18 +804,8 @@ static keyname_t keynames[] =
|
||||
{KEY_2HAT1+14, "SEC_HATLEFT4"},
|
||||
{KEY_2HAT1+15, "SEC_HATRIGHT4"},
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef DC
|
||||
{KEY_DBL2JOY1+0, "DBLSEC_JOYC"},
|
||||
{KEY_DBL2JOY1+1, "DBLSEC_JOYB"},
|
||||
{KEY_DBL2JOY1+2, "DBLSEC_JOYA"},
|
||||
{KEY_DBL2JOY1+3, "DBLSEC_JOYS"},
|
||||
{KEY_DBL2JOY1+4, "DBLSEC_JOYZ"},
|
||||
{KEY_DBL2JOY1+5, "DBLSEC_JOYY"},
|
||||
{KEY_DBL2JOY1+6, "DBLSEC_JOYX"},
|
||||
{KEY_DBL2JOY1+7, "DBLSEC_JOYD"},
|
||||
#elif defined (_XBOX)
|
||||
#ifdef _XBOX
|
||||
{KEY_DBL2JOY1+0, "DBLSEC_JOYA"},
|
||||
{KEY_DBL2JOY1+1, "DBLSEC_JOYB"},
|
||||
{KEY_DBL2JOY1+2, "DBLSEC_JOYX"},
|
||||
@@ -941,7 +897,7 @@ static keyname_t keynames[] =
|
||||
{KEY_DBL2JOY1+6, "DBLSEC_JOY7"},
|
||||
{KEY_DBL2JOY1+7, "DBLSEC_JOY8"},
|
||||
#endif
|
||||
#if !defined (_arch_dreamcast) && !defined (NOMOREJOYBTN_2DBL)
|
||||
#if !defined (NOMOREJOYBTN_2DBL)
|
||||
{KEY_DBL2JOY1+8, "DBLSEC_JOY9"},
|
||||
{KEY_DBL2JOY1+9, "DBLSEC_JOY10"},
|
||||
{KEY_DBL2JOY1+10, "DBLSEC_JOY11"},
|
||||
@@ -976,7 +932,6 @@ static keyname_t keynames[] =
|
||||
{KEY_DBL2HAT1+5, "DBLSEC_HATDOWN2"},
|
||||
{KEY_DBL2HAT1+6, "DBLSEC_HATLEFT2"},
|
||||
{KEY_DBL2HAT1+7, "DBLSEC_HATRIGHT2"},
|
||||
#ifndef _arch_dreamcast
|
||||
{KEY_DBL2HAT1+8, "DBLSEC_HATUP3"},
|
||||
{KEY_DBL2HAT1+9, "DBLSEC_HATDOWN3"},
|
||||
{KEY_DBL2HAT1+10, "DBLSEC_HATLEFT3"},
|
||||
@@ -986,7 +941,6 @@ static keyname_t keynames[] =
|
||||
{KEY_DBL2HAT1+14, "DBLSEC_HATLEFT4"},
|
||||
{KEY_DBL2HAT1+15, "DBLSEC_HATRIGHT4"},
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
{KEY_3JOY1+0, "TRD_JOY1"},
|
||||
|
||||
+1
-6
@@ -23,12 +23,7 @@
|
||||
#define NUMKEYS 256
|
||||
|
||||
|
||||
#ifdef _arch_dreamcast
|
||||
#define MOUSEBUTTONS 5
|
||||
#define JOYBUTTONS 8 // 8 buttons
|
||||
#define JOYHATS 2 // 2 hats
|
||||
#define JOYAXISSET 3 // 3 Sets of 2 axises
|
||||
#elif defined (_XBOX)
|
||||
#ifdef _XBOX
|
||||
#define MOUSEBUTTONS 5
|
||||
#define JOYBUTTONS 12 // 12 buttons
|
||||
#define JOYHATS 1 // 1 hat
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@
|
||||
#endif
|
||||
#ifdef _PS3
|
||||
#include <net/netdb.h>
|
||||
#elif ! defined (_arch_dreamcast)
|
||||
#else
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+5
-31
@@ -62,16 +62,11 @@
|
||||
#ifdef USE_WINSOCK1
|
||||
#include <winsock.h>
|
||||
#elif !defined (SCOUW2) && !defined (SCOUW7) && !defined (__OS2__)
|
||||
#ifdef HAVE_LWIP
|
||||
#include <lwip/inet.h>
|
||||
#elif !defined (USE_WINSOCK)
|
||||
#ifndef USE_WINSOCK
|
||||
#include <arpa/inet.h>
|
||||
#endif //normal BSD API
|
||||
|
||||
#ifdef HAVE_LWIP
|
||||
#include <lwip/sockets.h>
|
||||
#define ioctl lwip_ioctl
|
||||
#elif !defined (USE_WINSOCK) //!HAVE_LWIP
|
||||
#ifndef USE_WINSOCK
|
||||
#ifdef __APPLE_CC__
|
||||
#ifndef _BSD_SOCKLEN_T_
|
||||
#define _BSD_SOCKLEN_T_
|
||||
@@ -81,14 +76,10 @@
|
||||
#include <netinet/in.h>
|
||||
#endif //normal BSD API
|
||||
|
||||
#if defined(_arch_dreamcast) && !defined(HAVE_LWIP)
|
||||
#include <kos/net.h>
|
||||
#elif defined(HAVE_LWIP)
|
||||
#include <lwip/lwip.h>
|
||||
#elif defined (_PS3)
|
||||
#if defined (_PS3)
|
||||
#include <net/select.h>
|
||||
#include <net/net.h>
|
||||
#elif !defined(USE_WINSOCK) //!HAVE_LWIP
|
||||
#elif !defined(USE_WINSOCK)
|
||||
#include <netdb.h>
|
||||
#include <sys/ioctl.h>
|
||||
#endif //normal BSD API
|
||||
@@ -96,10 +87,6 @@
|
||||
#include <errno.h>
|
||||
#include <time.h>
|
||||
|
||||
#ifdef _arch_dreamcast
|
||||
#include "sdl12/SRB2DC/dchelp.h"
|
||||
#endif
|
||||
|
||||
#if (defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||
#include <sys/time.h>
|
||||
#endif // UNIXCOMMON
|
||||
@@ -207,9 +194,7 @@ static UINT8 UPNP_support = TRUE;
|
||||
#define SELECTTEST
|
||||
#endif
|
||||
|
||||
#elif defined(HAVE_LWIP)
|
||||
#define SELECTTEST
|
||||
#elif !defined( _arch_dreamcast)
|
||||
#else
|
||||
#define SELECTTEST
|
||||
#endif
|
||||
|
||||
@@ -1319,12 +1304,6 @@ boolean I_InitTcpDriver(void)
|
||||
CONS_Debug(DBG_NETPLAY, "WinSock description: %s\n",WSAData.szDescription);
|
||||
CONS_Debug(DBG_NETPLAY, "WinSock System Status: %s\n",WSAData.szSystemStatus);
|
||||
#endif
|
||||
#ifdef HAVE_LWIP
|
||||
lwip_kos_init();
|
||||
#elif defined(_arch_dreamcast)
|
||||
//return;
|
||||
net_init();
|
||||
#endif
|
||||
#ifdef __DJGPP__
|
||||
#ifdef WATTCP // Alam_GBC: survive bootp, dhcp, rarp and wattcp/pktdrv from failing to load
|
||||
survive_eth = 1; // would be needed to not exit if pkt_eth_init() fails
|
||||
@@ -1427,11 +1406,6 @@ void I_ShutdownTcpDriver(void)
|
||||
WS_addrinfocleanup();
|
||||
WSACleanup();
|
||||
#endif
|
||||
#ifdef HAVE_LWIP
|
||||
lwip_kos_shutdown();
|
||||
#elif defined(_arch_dreamcast)
|
||||
net_shutdown();
|
||||
#endif
|
||||
#ifdef __DJGPP__
|
||||
#ifdef WATTCP // wattcp
|
||||
//_outch = NULL;
|
||||
|
||||
+1
-1
@@ -174,7 +174,7 @@ void M_PushSpecialParameters(void)
|
||||
|
||||
/// \brief max args
|
||||
|
||||
#if defined (_arch_dreamcast) || defined (_XBOX) || defined (_WII)
|
||||
#if defined (_XBOX) || defined (_WII)
|
||||
#define MAXARGVS 1
|
||||
#else
|
||||
#define MAXARGVS 256
|
||||
|
||||
+1
-4
@@ -3059,7 +3059,6 @@ boolean M_Responder(event_t *ev)
|
||||
itemOn = 0;
|
||||
return true;
|
||||
|
||||
#ifndef DC
|
||||
case KEY_F5: // Video Mode
|
||||
if (modeattacking)
|
||||
return true;
|
||||
@@ -3067,7 +3066,6 @@ boolean M_Responder(event_t *ev)
|
||||
M_Options(0);
|
||||
M_VideoModeMenu(0);
|
||||
return true;
|
||||
#endif
|
||||
|
||||
case KEY_F6: // Empty
|
||||
return true;
|
||||
@@ -3758,9 +3756,8 @@ void M_ClearMenus(boolean callexitmenufunc)
|
||||
if (currentMenu->quitroutine && callexitmenufunc && !currentMenu->quitroutine())
|
||||
return; // we can't quit this menu (also used to set parameter from the menu)
|
||||
|
||||
#ifndef DC // Save the config file. I'm sick of crashing the game later and losing all my changes!
|
||||
// Save the config file. I'm sick of crashing the game later and losing all my changes!
|
||||
COM_BufAddText(va("saveconfig \"%s\" -silent\n", configfile));
|
||||
#endif //Alam: But not on the Dreamcast's VMUs
|
||||
|
||||
if (currentMenu == &MessageDef) // Oh sod off!
|
||||
currentMenu = &MainDef; // Not like it matters
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@ typedef off_t off64_t;
|
||||
#define PRIdS "u"
|
||||
#elif defined(_WIN32) && !defined(__MINGW64__)
|
||||
#define PRIdS "Iu"
|
||||
#elif defined (_PSP) || defined (_arch_dreamcast) || defined (DJGPP) || defined (_WII) || defined (_NDS) || defined (_PS3)
|
||||
#elif defined (_PSP) || defined (DJGPP) || defined (_WII) || defined (_NDS) || defined (_PS3)
|
||||
#define PRIdS "u"
|
||||
#else
|
||||
#define PRIdS "zu"
|
||||
|
||||
+1
-3
@@ -40,9 +40,7 @@ void M_SaveFrame(void);
|
||||
void M_StopMovie(void);
|
||||
|
||||
// the file where game vars and settings are saved
|
||||
#ifdef DC
|
||||
#define CONFIGFILENAME "srb2dc.cfg"
|
||||
#elif defined (PSP)
|
||||
#ifdef PSP
|
||||
#define CONFIGFILENAME "srb2psp.cfg"
|
||||
#else
|
||||
#define CONFIGFILENAME "kartconfig.cfg"
|
||||
|
||||
+3
-3
@@ -69,7 +69,7 @@ static void AmigaType_OnChange(void);
|
||||
#define SURROUND
|
||||
#endif
|
||||
|
||||
#if defined (_WIN32_WCE) || defined (DC) || defined(GP2X)
|
||||
#if defined (_WIN32_WCE) || defined(GP2X)
|
||||
consvar_t cv_samplerate = {"samplerate", "11025", 0, CV_Unsigned, NULL, 11025, NULL, NULL, 0, 0, NULL}; //Alam: For easy hacking?
|
||||
#elif defined(_PSP) || defined(_WINDOWS)
|
||||
consvar_t cv_samplerate = {"samplerate", "44100", 0, CV_Unsigned, NULL, 44100, NULL, NULL, 0, 0, NULL}; //Alam: For easy hacking?
|
||||
@@ -92,7 +92,7 @@ consvar_t cv_digmusicvolume = {"digmusicvolume", "18", CV_SAVE, soundvolume_cons
|
||||
consvar_t cv_midimusicvolume = {"midimusicvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
#endif
|
||||
// number of channels available
|
||||
#if defined (_WIN32_WCE) || defined (DC) || defined (PSP) || defined(GP2X)
|
||||
#if defined (_WIN32_WCE) || defined (PSP) || defined(GP2X)
|
||||
consvar_t cv_numChannels = {"snd_channels", "8", CV_SAVE|CV_CALL, CV_Unsigned, SetChannelsNum, 0, NULL, NULL, 0, 0, NULL};
|
||||
#else
|
||||
consvar_t cv_numChannels = {"snd_channels", "64", CV_SAVE|CV_CALL, CV_Unsigned, SetChannelsNum, 0, NULL, NULL, 0, 0, NULL};
|
||||
@@ -1737,7 +1737,7 @@ void S_ChangeMusicEx(const char *mmusic, UINT16 mflags, boolean looping, UINT32
|
||||
{
|
||||
char newmusic[7];
|
||||
|
||||
#if defined (DC) || defined (_WIN32_WCE) || defined (PSP) || defined(GP2X)
|
||||
#if defined (_WIN32_WCE) || defined (PSP) || defined(GP2X)
|
||||
S_ClearSfx();
|
||||
#endif
|
||||
|
||||
|
||||
+1
-1
@@ -142,7 +142,7 @@ void SCR_SetMode(void)
|
||||
}*/
|
||||
else
|
||||
I_Error("unknown bytes per pixel mode %d\n", vid.bpp);
|
||||
/*#if !defined (DC) && !defined (WII)
|
||||
/*#if !defined (WII)
|
||||
if (SCR_IsAspectCorrect(vid.width, vid.height))
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Resolution is not aspect-correct!\nUse a multiple of %dx%d\n"), BASEVIDWIDTH, BASEVIDHEIGHT);
|
||||
#endif*/
|
||||
|
||||
+2
-2
@@ -28,7 +28,7 @@
|
||||
#endif
|
||||
|
||||
// quickhack for V_Init()... to be cleaned up
|
||||
#if defined (DC) || defined (_WIN32_WCE) || defined (PSP) || defined (NOPOSTPROCESSING)
|
||||
#if defined (_WIN32_WCE) || defined (PSP) || defined (NOPOSTPROCESSING)
|
||||
#define NUMSCREENS 2
|
||||
#else
|
||||
#define NUMSCREENS 5
|
||||
@@ -43,7 +43,7 @@
|
||||
// we try to re-allocate a minimum of buffers for stability of the memory,
|
||||
// so all the small-enough tables based on screen size, are allocated once
|
||||
// and for all at the maximum size.
|
||||
#if defined (_WIN32_WCE) || defined (DC) || defined (_PSP) || defined (_NDS)
|
||||
#if defined (_WIN32_WCE) || defined (_PSP) || defined (_NDS)
|
||||
#define MAXVIDWIDTH 320
|
||||
#define MAXVIDHEIGHT 200
|
||||
#elif defined (GP2X)
|
||||
|
||||
@@ -14,10 +14,6 @@ ifdef PANDORA
|
||||
include sdl12/SRB2Pandora/Makefile.cfg
|
||||
endif #ifdef PANDORA
|
||||
|
||||
ifdef DC
|
||||
include sdl12/SRB2DC/Makefile.cfg
|
||||
endif #ifdef DC
|
||||
|
||||
ifdef PS3N
|
||||
include sdl12/SRB2PS3/Makefile.cfg
|
||||
endif #ifdef PS3N
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
/scramble
|
||||
Binary file not shown.
@@ -1,53 +0,0 @@
|
||||
#
|
||||
# Makefile.cfg for SRB2/Dreamcast
|
||||
#
|
||||
|
||||
#include $(KOS_BASE)/Makefile.rules
|
||||
|
||||
#
|
||||
#hmmm, the Dreamcast
|
||||
#
|
||||
|
||||
HOSTCC:=$(CC)
|
||||
CC=$(KOS_CC)
|
||||
PREFIX=$(KOS_CC_BASE)/bin/$(KOS_CC_PREFIX)
|
||||
OBJDUMP=$(PREFIX)-objdump
|
||||
OBJCOPY=$(PREFIX)-objcopy
|
||||
|
||||
#NOHW=1 #No working MiniGL right now
|
||||
NOHS=1 #No HWSound right now
|
||||
ifndef LWIP
|
||||
NONET=1 #No LWIP
|
||||
endif
|
||||
#i_net_o=$(OBJDIR)/i_udp.o #use KOS's UDP
|
||||
#NOMIXER=1 #Basic sound only
|
||||
NOIPX=1 #No IPX network code
|
||||
NOPNG=1 #No Screenshot
|
||||
|
||||
OPTS=$(KOS_CFLAGS) -DUNIXCOMMON -DDC
|
||||
ifndef NOHW
|
||||
OPTS+=-DSTATIC_OPENGL -DMINI_GL_COMPATIBILITY -DKOS_GL_COMPATIBILITY
|
||||
endif
|
||||
SDL_CFLAGS?=-I$(KOS_BASE)/addons/include/SDL
|
||||
SDL_LDFLAGS?=-lSDL
|
||||
LDFLAGS=$(KOS_LDFLAGS)
|
||||
LIBS:=$(KOS_LIBS) -lconio -lm
|
||||
ifndef NOMIXER
|
||||
LIBS:=-loggvorbisplay -lSDL $(LIBS)
|
||||
endif
|
||||
|
||||
ifdef LWIP
|
||||
OPTS+=-I$(KOS_BASE)/../kos-ports/lwip/kos/include -I$(KOS_BASE)/../kos-ports/lwip/lwip/src/include/ipv4 -I$(KOS_BASE)/../kos-ports/lwip/lwip/src/include -DIPv4
|
||||
LIBS:=-llwip4 -lkosutils $(LIBS)
|
||||
OPTS+=-DHAVE_LWIP
|
||||
endif
|
||||
ifndef NOHW
|
||||
LIBS+=-lgl
|
||||
endif
|
||||
|
||||
i_system_o+=$(OBJDIR)/dchelp.o
|
||||
i_main_o=$(KOS_START) $(OBJDIR)/i_main.o $(OBJEXTRA)
|
||||
|
||||
# name of the exefile
|
||||
EXENAME?=SRB2.elf
|
||||
BINNAME?=SRB2.BIN
|
||||
Binary file not shown.
@@ -1,19 +0,0 @@
|
||||
#define VMU_width 48
|
||||
#define VMU_height 32
|
||||
static unsigned char VMU_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00,
|
||||
0x00, 0x00, 0x58, 0x75, 0x00, 0x00, 0x00, 0x00, 0xee, 0xaa, 0x00, 0x00,
|
||||
0x00, 0x86, 0x55, 0x55, 0x01, 0x00, 0x00, 0xda, 0xc8, 0xaf, 0x00, 0x00,
|
||||
0x00, 0x62, 0x55, 0x54, 0x00, 0x00, 0x00, 0x32, 0xa2, 0x6c, 0x00, 0x00,
|
||||
0x00, 0x5c, 0x55, 0xfd, 0x01, 0x00, 0x00, 0xac, 0x88, 0xaa, 0x02, 0x00,
|
||||
0x00, 0x54, 0x75, 0x55, 0x05, 0x00, 0x00, 0xac, 0xbf, 0xaa, 0x0a, 0x00,
|
||||
0x00, 0xd6, 0x61, 0x55, 0x15, 0x00, 0x00, 0xe9, 0xc0, 0xaa, 0x2a, 0x00,
|
||||
0x00, 0x39, 0x40, 0x55, 0x55, 0x00, 0x00, 0x6d, 0xc0, 0xaa, 0xbe, 0x00,
|
||||
0x00, 0x6d, 0x40, 0xd5, 0xc3, 0x00, 0x00, 0x6d, 0xc0, 0xea, 0x00, 0x00,
|
||||
0x00, 0x29, 0x60, 0xf5, 0x00, 0x00, 0x00, 0x26, 0xe0, 0xfa, 0x00, 0x00,
|
||||
0x00, 0x58, 0xb8, 0xbd, 0x00, 0x00, 0x00, 0x84, 0x07, 0xdf, 0x00, 0x00,
|
||||
0x00, 0x08, 0x20, 0xae, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x5f, 0x01, 0x00,
|
||||
0x00, 0xc0, 0x3f, 0xb8, 0x01, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
@@ -1,134 +0,0 @@
|
||||
// Emacs style mode select -*- C++ -*-
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright (C) 2006-2018 by Sonic Team Jr.
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// stub and replacement "ANSI" C functions for use on Dreamcast/KOS
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
#include <kos/fs.h>
|
||||
#include <errno.h>
|
||||
#ifndef HAVE_LWIP
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#include "../../doomdef.h"
|
||||
#include "dchelp.h"
|
||||
|
||||
int access(const char *path, int amode)
|
||||
{
|
||||
file_t handle = FILEHND_INVALID;
|
||||
|
||||
if (amode == F_OK || amode == R_OK)
|
||||
handle=fs_open(path,O_RDONLY);
|
||||
else if (amode == (R_OK|W_OK))
|
||||
handle=fs_open(path,O_RDWR);
|
||||
else if (amode == W_OK)
|
||||
handle=fs_open(path,O_WRONLY);
|
||||
|
||||
if (handle != FILEHND_INVALID)
|
||||
{
|
||||
fs_close(handle);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
double hypot(double x, double y)
|
||||
{
|
||||
double ax, yx, yx2, yx1;
|
||||
if (abs(y) > abs(x)) // |y|>|x|
|
||||
{
|
||||
ax = abs(y); // |y| => ax
|
||||
yx = (x/y);
|
||||
}
|
||||
else // |x|>|y|
|
||||
{
|
||||
ax = abs(x); // |x| => ax
|
||||
yx = (x/y);
|
||||
}
|
||||
yx2 = yx*yx; // (x/y)^2
|
||||
yx1 = sqrt(1+yx2); // (1 + (x/y)^2)^1/2
|
||||
return ax*yx1; // |x|*((1 + (x/y)^2)^1/2)
|
||||
}
|
||||
|
||||
#if !(defined (NONET) || defined (NOMD5))
|
||||
#ifdef HAVE_LWIP
|
||||
|
||||
#include <lwip/lwip.h>
|
||||
|
||||
static uint8 ip[4];
|
||||
static char *h_addr_listtmp[2] = {ip, NULL};
|
||||
static struct hostent hostenttmp = {NULL, NULL, 0, 1, h_addr_listtmp};
|
||||
|
||||
struct hostent *gethostbyname(const char *name)
|
||||
{
|
||||
struct sockaddr_in dnssrv;
|
||||
dnssrv.sin_family = AF_INET;
|
||||
dnssrv.sin_port = htons(53);
|
||||
dnssrv.sin_addr.s_addr = htonl(0x0a030202); ///< what?
|
||||
if (lwip_gethostbyname(&dnssrv, name, ip) < 0)
|
||||
return NULL;
|
||||
else
|
||||
return &hostenttmp;
|
||||
}
|
||||
#else
|
||||
|
||||
struct hostent *gethostbyname(const char *name)
|
||||
{
|
||||
(void)name;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int ioctl(int s, long cmd, void *argp)
|
||||
{
|
||||
return fs_ioctl(s, argp, cmd); //FIONBIO?
|
||||
}
|
||||
|
||||
int select(int maxfdp1, void *readset, void *writeset, void *exceptset,
|
||||
void *timeout)
|
||||
{
|
||||
(void)maxfdp1;
|
||||
(void)readset;
|
||||
(void)writeset;
|
||||
(void)exceptset;
|
||||
(void)timeout;
|
||||
errno = EAFNOSUPPORT;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int getsockopt (int s, int level, int optname, void *optval, socklen_t *optlen)
|
||||
{
|
||||
(void)s;
|
||||
(void)level; //SOL_SOCKET
|
||||
(void)optname; //SO_RCVBUF, SO_ERROR
|
||||
(void)optval;
|
||||
(void)optlen;
|
||||
errno = EAFNOSUPPORT;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int setsockopt (int s, int level, int optname, void *optval, socklen_t optlen)
|
||||
{
|
||||
(void)s;
|
||||
(void)level; //SOL_SOCKET
|
||||
(void)optname; //SO_REUSEADDR, SO_BROADCAST, SO_RCVBUF
|
||||
(void)optval;
|
||||
(void)optlen;
|
||||
errno = EAFNOSUPPORT;
|
||||
return -1;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -1,51 +0,0 @@
|
||||
// Emacs style mode select -*- C++ -*-
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright (C) 2006-2018 by Sonic Team Jr.
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// stub and replacement "ANSI" C functions for use on Dreamcast/KOS
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef __I_DREAMCAST__
|
||||
#define __I_DREAMCAST__
|
||||
|
||||
struct hostent
|
||||
{
|
||||
char *h_name; /* Official name of host. */
|
||||
char **h_aliases; /* Alias list. */
|
||||
int h_addrtype; /* Host address type. */
|
||||
int h_length; /* Length of address. */
|
||||
char **h_addr_list; /* List of addresses from name server. */
|
||||
#define h_addr h_addr_list[0] /* Address, for backward compatibility. */
|
||||
};
|
||||
|
||||
struct hostent *gethostbyname(const char *name);
|
||||
|
||||
#ifndef HAVE_LWIP
|
||||
#define INADDR_NONE ((uint32) 0xffffffff)
|
||||
#define INADDR_LOOPBACK ((uint32) 0x7f000001)
|
||||
#define SOCK_STREAM 1
|
||||
#define FIONBIO 0
|
||||
#define SOL_SOCKET 0
|
||||
#define SO_ERROR 0
|
||||
#define SO_REUSEADDR 0
|
||||
#define SO_BROADCAST 0
|
||||
#define SO_RCVBUF 0
|
||||
int ioctl(int s, long cmd, void *argp);
|
||||
int select(int maxfdp1, void *readset, void *writeset, void *exceptset, void *timeout);
|
||||
int getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen);
|
||||
int setsockopt(int s, int level, int optname, void *optval, socklen_t optlen);
|
||||
#endif
|
||||
#endif
|
||||
@@ -1,455 +0,0 @@
|
||||
// Emacs style mode select -*- C++ -*-
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Portions Copyright (C) 2005-2018 by Sonic Team Jr.
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//-----------------------------------------------------------------------------
|
||||
/// \file
|
||||
/// \brief KOS UDP network interface
|
||||
|
||||
#include "../../doomdef.h"
|
||||
|
||||
#include "../../i_system.h"
|
||||
#include "../../d_event.h"
|
||||
#include "../../d_net.h"
|
||||
#include "../../m_argv.h"
|
||||
|
||||
#include "../../doomstat.h"
|
||||
|
||||
#include "../../i_net.h"
|
||||
|
||||
#include "../../z_zone.h"
|
||||
|
||||
#include "../../i_tcp.h"
|
||||
|
||||
#include <kos/net.h>
|
||||
//#include <net/net_ipv4.h>
|
||||
#define NET_NONE 0x00000000
|
||||
#define NET_LOCAL 0x0100007F
|
||||
#define NET_ANY 0xFFFFFFFF
|
||||
|
||||
#define MAXBANS 20
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32 host;
|
||||
uint16 port;
|
||||
} IPaddress;
|
||||
|
||||
static IPaddress clientaddress[MAXNETNODES+1];
|
||||
static boolean nodeconnected[MAXNETNODES+1];
|
||||
|
||||
static int mysocket = 0;
|
||||
static boolean init_KOSUDP_driver = false;
|
||||
|
||||
static size_t numbans = 0;
|
||||
static IPaddress banned[MAXBANS];
|
||||
static boolean KOSUDP_bannednode[MAXNETNODES+1]; /// \note do we really need the +1?
|
||||
|
||||
static inline int net_udp_sendto(int sock, const uint8 *data, int size, uint16 rem_port, uint32 rem_addr)
|
||||
{
|
||||
uint8 dst_ip[4] = {((uint8*)(&(rem_addr)))[0],
|
||||
((uint8*)(&(rem_addr)))[1],
|
||||
((uint8*)(&(rem_addr)))[2],
|
||||
((uint8*)(&(rem_addr)))[3]};
|
||||
return net_udp_send_raw(net_default_dev, clientaddress[0].port, rem_port, dst_ip, data, size);
|
||||
(void)sock;
|
||||
}
|
||||
|
||||
static inline int net_udp_recvfrom(int sock, uint8 *buf, int size, uint16 *rem_port, uint32 *rem_addr)
|
||||
{
|
||||
return net_udp_recv(sock, buf, size);
|
||||
(void)rem_port;
|
||||
(void)rem_addr;
|
||||
}
|
||||
|
||||
static const char *KOSUDP_AddrToStr(IPaddress* sk)
|
||||
{
|
||||
static char s[22]; // 255.255.255.255:65535
|
||||
sprintf(s,"%d.%d.%d.%d:%d",
|
||||
((uint8*)(&(sk->host)))[3],
|
||||
((uint8*)(&(sk->host)))[2],
|
||||
((uint8*)(&(sk->host)))[1],
|
||||
((uint8*)(&(sk->host)))[0],
|
||||
net_ntohs(sk->port));
|
||||
return s;
|
||||
}
|
||||
|
||||
static const char *KOSUDP_GetNodeAddress(int node)
|
||||
{
|
||||
if (!nodeconnected[node])
|
||||
return NULL;
|
||||
return KOSUDP_AddrToStr(&clientaddress[node]);
|
||||
}
|
||||
|
||||
static const char *KOSUDP_GetBanAddress(size_t ban)
|
||||
{
|
||||
if (ban > numbans)
|
||||
return NULL;
|
||||
return KOSUDP_AddrToStr(&banned[ban]);
|
||||
}
|
||||
|
||||
static boolean KOSUDP_cmpaddr(IPaddress* a, IPaddress* b)
|
||||
{
|
||||
return (a->host == b->host && (b->port == 0 || a->port == b->port));
|
||||
}
|
||||
|
||||
static SINT8 getfreenode(void)
|
||||
{
|
||||
SINT8 j;
|
||||
|
||||
for (j = 0; j < MAXNETNODES; j++)
|
||||
if (!nodeconnected[j])
|
||||
{
|
||||
nodeconnected[j] = true;
|
||||
return j;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void KOSUDP_Get(void)
|
||||
{
|
||||
int size;
|
||||
size_t i;
|
||||
SINT8 j;
|
||||
IPaddress temp = {clientaddress[BROADCASTADDR].host,clientaddress[BROADCASTADDR].port};
|
||||
|
||||
size = net_udp_recvfrom(mysocket,(char *)&doomcom->data, MAXPACKETLENGTH, &temp.port, &temp.host);
|
||||
if (size == 0)
|
||||
{
|
||||
doomcom->remotenode = -1; // no packet
|
||||
return;
|
||||
}
|
||||
|
||||
// find remote node number
|
||||
for (i = 0; i < MAXNETNODES; i++)
|
||||
if (KOSUDP_cmpaddr(&temp, &(clientaddress[i])))
|
||||
{
|
||||
doomcom->remotenode = (INT16)i; // good packet from a game player
|
||||
doomcom->datalength = (INT16)size;
|
||||
return;
|
||||
}
|
||||
|
||||
// not found
|
||||
|
||||
// find a free slot
|
||||
j = getfreenode();
|
||||
if (j > 0)
|
||||
{
|
||||
M_Memcpy(&clientaddress[j], &temp, sizeof (temp));
|
||||
DEBFILE(va("New node detected: node:%d address:%s\n", j,
|
||||
KOSUDP_GetNodeAddress(j)));
|
||||
doomcom->remotenode = (INT16)j; // good packet from a game player
|
||||
doomcom->datalength = (INT16)size;
|
||||
// check if it's a banned dude so we can send a refusal later
|
||||
for (i = 0; i < numbans; i++)
|
||||
if (KOSUDP_cmpaddr(&temp, &banned[i]))
|
||||
{
|
||||
KOSUDP_bannednode[j] = true;
|
||||
DEBFILE("This dude has been banned\n");
|
||||
break;
|
||||
}
|
||||
if (i == numbans)
|
||||
KOSUDP_bannednode[j] = false;
|
||||
return;
|
||||
}
|
||||
|
||||
DEBFILE("New node detected: No more free slots\n");
|
||||
doomcom->remotenode = -1; // no packet
|
||||
}
|
||||
|
||||
#if 0
|
||||
static boolean KOSUDP_CanSend(void)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void KOSUDP_Send(void)
|
||||
{
|
||||
const IPaddress *nodeinfo;
|
||||
|
||||
if (!doomcom->remotenode || !nodeconnected[doomcom->remotenode])
|
||||
return;
|
||||
|
||||
nodeinfo = clientaddress + doomcom->remotenode;
|
||||
|
||||
if (net_udp_sendto(mysocket, (char *)&doomcom->data, doomcom->datalength, nodeinfo->port, nodeinfo->host) == -1)
|
||||
{
|
||||
CONS_Printf("KOSUDP: error sending data\n");
|
||||
}
|
||||
}
|
||||
|
||||
static void KOSUDP_FreeNodenum(int numnode)
|
||||
{
|
||||
// can't disconnect from self :)
|
||||
if (!numnode)
|
||||
return;
|
||||
|
||||
DEBFILE(va("Free node %d (%s)\n", numnode, KOSUDP_GetNodeAddress(numnode)));
|
||||
|
||||
nodeconnected[numnode] = false;
|
||||
|
||||
memset(&clientaddress[numnode], 0, sizeof (IPaddress));
|
||||
}
|
||||
|
||||
static int KOSUDP_Socket(void)
|
||||
{
|
||||
int temp = 0;
|
||||
uint16 portnum = 0;
|
||||
const uint32 hostip = net_default_dev?net_ntohl(net_ipv4_address(net_default_dev->ip_addr)):NET_LOCAL;
|
||||
//Hurdler: I'd like to put a server and a client on the same computer
|
||||
//Logan: Me too
|
||||
//BP: in fact for client we can use any free port we want i have read
|
||||
// in some doc that connect in udp can do it for us...
|
||||
//Alam: where?
|
||||
if (M_CheckParm("-clientport"))
|
||||
{
|
||||
if (!M_IsNextParm())
|
||||
I_Error("syntax: -clientport <portnum>");
|
||||
portnum = net_ntohs(atoi(M_GetNextParm()));
|
||||
}
|
||||
else
|
||||
portnum = net_ntohs(sock_port);
|
||||
|
||||
temp = net_udp_sock_open(portnum, hostip, portnum, NET_NONE);
|
||||
if (temp)
|
||||
{
|
||||
int btemp = net_udp_sock_open(portnum, hostip, portnum, NET_ANY);
|
||||
clientaddress[0].port = portnum;
|
||||
clientaddress[0].host = NET_NONE;
|
||||
if (btemp)
|
||||
{
|
||||
clientaddress[BROADCASTADDR].port = net_ntohs(sock_port);
|
||||
clientaddress[BROADCASTADDR].host = NET_ANY;
|
||||
}
|
||||
else
|
||||
{
|
||||
CONS_Printf("KOSUDP: can't setup broadcast sock\n");
|
||||
net_udp_sock_close(temp);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CONS_Printf("KOSUDP: can't setup main sock\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
doomcom->extratics = 1; // internet is very high ping
|
||||
|
||||
return temp;
|
||||
}
|
||||
|
||||
static void I_ShutdownKOSUDPDriver(void)
|
||||
{
|
||||
//net_shutdown();
|
||||
init_KOSUDP_driver = false;
|
||||
}
|
||||
|
||||
static void I_InitKOSUDPDriver(void)
|
||||
{
|
||||
if (init_KOSUDP_driver)
|
||||
I_ShutdownKOSUDPDriver();
|
||||
else
|
||||
net_init();
|
||||
D_SetDoomcom();
|
||||
memset(&clientaddress,0,sizeof (clientaddress));
|
||||
init_KOSUDP_driver = true;
|
||||
}
|
||||
|
||||
static void KOSUDP_CloseSocket(void)
|
||||
{
|
||||
if (mysocket)
|
||||
net_udp_sock_close(mysocket);
|
||||
mysocket = 0;
|
||||
}
|
||||
|
||||
static SINT8 KOSUDP_NetMakeNodewPort(const char *hostname, const char* port)
|
||||
{
|
||||
SINT8 newnode;
|
||||
uint16 portnum = net_ntohs(sock_port);
|
||||
|
||||
if (port && !port[0])
|
||||
portnum = net_ntohs((UINT16)atoi(port));
|
||||
|
||||
newnode = getfreenode();
|
||||
if (newnode == -1)
|
||||
return -1;
|
||||
// find ip of the server
|
||||
clientaddress[newnode].port = portnum;
|
||||
clientaddress[newnode].host = inet_addr(hostname);
|
||||
|
||||
if (clientaddress[newnode].host == NET_NONE)
|
||||
{
|
||||
free(hostname);
|
||||
return -1;
|
||||
}
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static boolean KOSUDP_OpenSocket(void)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
memset(clientaddress, 0, sizeof (clientaddress));
|
||||
|
||||
for (i = 0; i < MAXNETNODES; i++)
|
||||
nodeconnected[i] = false;
|
||||
|
||||
//CONS_Printf("KOSUDP Code starting up\n");
|
||||
|
||||
nodeconnected[0] = true; // always connected to self
|
||||
nodeconnected[BROADCASTADDR] = true;
|
||||
I_NetSend = KOSUDP_Send;
|
||||
I_NetGet = KOSUDP_Get;
|
||||
I_NetCloseSocket = KOSUDP_CloseSocket;
|
||||
I_NetFreeNodenum = KOSUDP_FreeNodenum;
|
||||
I_NetMakeNodewPort = KOSUDP_NetMakeNodewPort;
|
||||
|
||||
//I_NetCanSend = KOSUDP_CanSend;
|
||||
|
||||
// build the socket but close it first
|
||||
KOSUDP_CloseSocket();
|
||||
mysocket = KOSUDP_Socket();
|
||||
|
||||
if (mysocket)
|
||||
{
|
||||
#if 0
|
||||
// for select
|
||||
myset = SDLNet_AllocSocketSet(1);
|
||||
if (!myset)
|
||||
{
|
||||
CONS_Printf("SDL_Net: %s",SDLNet_GetError());
|
||||
return false;
|
||||
}
|
||||
if (SDLNet_UDP_AddSocket(myset,mysocket) == -1)
|
||||
{
|
||||
CONS_Printf("SDL_Net: %s",SDLNet_GetError());
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static boolean KOSUDP_Ban(int node)
|
||||
{
|
||||
if (numbans == MAXBANS)
|
||||
return false;
|
||||
|
||||
M_Memcpy(&banned[numbans], &clientaddress[node], sizeof (IPaddress));
|
||||
banned[numbans].port = 0'
|
||||
numbans++;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void KOSUDP_ClearBans(void)
|
||||
{
|
||||
numbans = 0;
|
||||
}
|
||||
|
||||
//
|
||||
// I_InitNetwork
|
||||
// Only required for DOS, so this is more a dummy
|
||||
//
|
||||
boolean I_InitNetwork(void)
|
||||
{
|
||||
char serverhostname[255];
|
||||
boolean ret = false;
|
||||
//if (!M_CheckParm ("-kosnet"))
|
||||
// return false;
|
||||
// initilize the driver
|
||||
I_InitKOSUDPDriver();
|
||||
I_AddExitFunc(I_ShutdownKOSUDPDriver);
|
||||
if (!init_KOSUDP_driver)
|
||||
return false;
|
||||
|
||||
if (M_CheckParm("-udpport"))
|
||||
{
|
||||
if (M_IsNextParm())
|
||||
sock_port = (UINT16)atoi(M_GetNextParm());
|
||||
else
|
||||
sock_port = 0;
|
||||
}
|
||||
|
||||
// parse network game options,
|
||||
if (M_CheckParm("-server") || dedicated)
|
||||
{
|
||||
server = true;
|
||||
|
||||
// If a number of clients (i.e. nodes) is specified, the server will wait for the clients
|
||||
// to connect before starting.
|
||||
// If no number is specified here, the server starts with 1 client, and others can join
|
||||
// in-game.
|
||||
// Since Boris has implemented join in-game, there is no actual need for specifying a
|
||||
// particular number here.
|
||||
// FIXME: for dedicated server, numnodes needs to be set to 0 upon start
|
||||
/* if (M_IsNextParm())
|
||||
doomcom->numnodes = (INT16)atoi(M_GetNextParm());
|
||||
else */if (dedicated)
|
||||
doomcom->numnodes = 0;
|
||||
else
|
||||
doomcom->numnodes = 1;
|
||||
|
||||
if (doomcom->numnodes < 0)
|
||||
doomcom->numnodes = 0;
|
||||
if (doomcom->numnodes > MAXNETNODES)
|
||||
doomcom->numnodes = MAXNETNODES;
|
||||
|
||||
// server
|
||||
servernode = 0;
|
||||
// FIXME:
|
||||
// ??? and now ?
|
||||
// server on a big modem ??? 4*isdn
|
||||
net_bandwidth = 16000;
|
||||
hardware_MAXPACKETLENGTH = INETPACKETLENGTH;
|
||||
|
||||
ret = true;
|
||||
}
|
||||
else if (M_CheckParm("-connect"))
|
||||
{
|
||||
if (M_IsNextParm())
|
||||
strcpy(serverhostname, M_GetNextParm());
|
||||
else
|
||||
serverhostname[0] = 0; // assuming server in the LAN, use broadcast to detect it
|
||||
|
||||
// server address only in ip
|
||||
if (serverhostname[0])
|
||||
{
|
||||
COM_BufAddText("connect \"");
|
||||
COM_BufAddText(serverhostname);
|
||||
COM_BufAddText("\"\n");
|
||||
|
||||
// probably modem
|
||||
hardware_MAXPACKETLENGTH = INETPACKETLENGTH;
|
||||
}
|
||||
else
|
||||
{
|
||||
// so we're on a LAN
|
||||
COM_BufAddText("connect any\n");
|
||||
|
||||
net_bandwidth = 800000;
|
||||
hardware_MAXPACKETLENGTH = MAXPACKETLENGTH;
|
||||
}
|
||||
}
|
||||
|
||||
I_NetOpenSocket = KOSUDP_OpenSocket;
|
||||
I_Ban = KOSUDP_Ban;
|
||||
I_ClearBans = KOSUDP_ClearBans;
|
||||
I_GetNodeAddress = KOSUDP_GetNodeAddress;
|
||||
I_GetBanAddress = KOSUDP_GetBanAddress;
|
||||
bannednode = KOSUDP_bannednode;
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1,259 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define MAXCHUNK (2048*1024)
|
||||
|
||||
static unsigned int seed;
|
||||
|
||||
void my_srand(unsigned int n)
|
||||
{
|
||||
seed = n & 0xffff;
|
||||
}
|
||||
|
||||
unsigned int my_rand()
|
||||
{
|
||||
seed = (seed * 2109 + 9273) & 0x7fff;
|
||||
return (seed + 0xc000) & 0xffff;
|
||||
}
|
||||
|
||||
void load(FILE *fh, unsigned char *ptr, unsigned long sz)
|
||||
{
|
||||
if (fread(ptr, 1, sz, fh) != sz)
|
||||
{
|
||||
fprintf(stderr, "Read error!\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
void load_chunk(FILE *fh, unsigned char *ptr, unsigned long sz)
|
||||
{
|
||||
static int idx[MAXCHUNK/32];
|
||||
int i;
|
||||
|
||||
/* Convert chunk size to number of slices */
|
||||
sz /= 32;
|
||||
|
||||
/* Initialize index table with unity,
|
||||
so that each slice gets loaded exactly once */
|
||||
for (i = 0; i < sz; i++)
|
||||
idx[i] = i;
|
||||
|
||||
for (i = sz-1; i >= 0; --i)
|
||||
{
|
||||
/* Select a replacement index */
|
||||
int x = (my_rand() * i) >> 16;
|
||||
|
||||
/* Swap */
|
||||
int tmp = idx[i];
|
||||
idx[i] = idx[x];
|
||||
idx[x] = tmp;
|
||||
|
||||
/* Load resulting slice */
|
||||
load(fh, ptr+32*idx[i], 32);
|
||||
}
|
||||
}
|
||||
|
||||
void load_file(FILE *fh, unsigned char *ptr, unsigned long filesz)
|
||||
{
|
||||
unsigned long chunksz;
|
||||
|
||||
my_srand(filesz);
|
||||
|
||||
/* Descramble 2 meg blocks for as long as possible, then
|
||||
gradually reduce the window down to 32 bytes (1 slice) */
|
||||
for (chunksz = MAXCHUNK; chunksz >= 32; chunksz >>= 1)
|
||||
while (filesz >= chunksz)
|
||||
{
|
||||
load_chunk(fh, ptr, chunksz);
|
||||
filesz -= chunksz;
|
||||
ptr += chunksz;
|
||||
}
|
||||
|
||||
/* Load final incomplete slice */
|
||||
if (filesz)
|
||||
load(fh, ptr, filesz);
|
||||
}
|
||||
|
||||
void read_file(char *filename, unsigned char **ptr, unsigned long *sz)
|
||||
{
|
||||
FILE *fh = fopen(filename, "rb");
|
||||
if (fh == NULL)
|
||||
{
|
||||
fprintf(stderr, "Can't open \"%s\".\n", filename);
|
||||
exit(1);
|
||||
}
|
||||
if (fseek(fh, 0, SEEK_END)<0)
|
||||
{
|
||||
fprintf(stderr, "Seek error.\n");
|
||||
exit(1);
|
||||
}
|
||||
*sz = ftell(fh);
|
||||
*ptr = malloc(*sz);
|
||||
if ( *ptr == NULL )
|
||||
{
|
||||
fprintf(stderr, "Out of memory.\n");
|
||||
exit(1);
|
||||
}
|
||||
if (fseek(fh, 0, SEEK_SET)<0)
|
||||
{
|
||||
fprintf(stderr, "Seek error.\n");
|
||||
exit(1);
|
||||
}
|
||||
load_file(fh, *ptr, *sz);
|
||||
fclose(fh);
|
||||
}
|
||||
|
||||
void save(FILE *fh, unsigned char *ptr, unsigned long sz)
|
||||
{
|
||||
if (fwrite(ptr, 1, sz, fh) != sz)
|
||||
{
|
||||
fprintf(stderr, "Write error!\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
void save_chunk(FILE *fh, unsigned char *ptr, unsigned long sz)
|
||||
{
|
||||
static int idx[MAXCHUNK/32];
|
||||
int i;
|
||||
|
||||
/* Convert chunk size to number of slices */
|
||||
sz /= 32;
|
||||
|
||||
/* Initialize index table with unity,
|
||||
so that each slice gets saved exactly once */
|
||||
for (i = 0; i < sz; i++)
|
||||
idx[i] = i;
|
||||
|
||||
for (i = sz-1; i >= 0; --i)
|
||||
{
|
||||
/* Select a replacement index */
|
||||
int x = (my_rand() * i) >> 16;
|
||||
|
||||
/* Swap */
|
||||
int tmp = idx[i];
|
||||
idx[i] = idx[x];
|
||||
idx[x] = tmp;
|
||||
|
||||
/* Save resulting slice */
|
||||
save(fh, ptr+32*idx[i], 32);
|
||||
}
|
||||
}
|
||||
|
||||
void save_file(FILE *fh, unsigned char *ptr, unsigned long filesz)
|
||||
{
|
||||
unsigned long chunksz;
|
||||
|
||||
my_srand(filesz);
|
||||
|
||||
/* Descramble 2 meg blocks for as long as possible, then
|
||||
gradually reduce the window down to 32 bytes (1 slice) */
|
||||
for (chunksz = MAXCHUNK; chunksz >= 32; chunksz >>= 1)
|
||||
while (filesz >= chunksz)
|
||||
{
|
||||
save_chunk(fh, ptr, chunksz);
|
||||
filesz -= chunksz;
|
||||
ptr += chunksz;
|
||||
}
|
||||
|
||||
/* Save final incomplete slice */
|
||||
if (filesz)
|
||||
save(fh, ptr, filesz);
|
||||
}
|
||||
|
||||
void write_file(char *filename, unsigned char *ptr, unsigned long sz)
|
||||
{
|
||||
FILE *fh = fopen(filename, "wb");
|
||||
if (fh == NULL)
|
||||
{
|
||||
fprintf(stderr, "Can't open \"%s\".\n", filename);
|
||||
exit(1);
|
||||
}
|
||||
save_file(fh, ptr, sz);
|
||||
fclose(fh);
|
||||
}
|
||||
|
||||
void descramble(char *src, char *dst)
|
||||
{
|
||||
unsigned char *ptr = NULL;
|
||||
unsigned long sz = 0;
|
||||
FILE *fh;
|
||||
|
||||
read_file(src, &ptr, &sz);
|
||||
|
||||
fh = fopen(dst, "wb");
|
||||
if (fh == NULL)
|
||||
{
|
||||
fprintf(stderr, "Can't open \"%s\".\n", dst);
|
||||
exit(1);
|
||||
}
|
||||
if ( fwrite(ptr, 1, sz, fh) != sz )
|
||||
{
|
||||
fprintf(stderr, "Write error.\n");
|
||||
exit(1);
|
||||
}
|
||||
fclose(fh);
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
void scramble(char *src, char *dst)
|
||||
{
|
||||
unsigned char *ptr = NULL;
|
||||
unsigned long sz = 0;
|
||||
FILE *fh;
|
||||
|
||||
fh = fopen(src, "rb");
|
||||
if (fh == NULL)
|
||||
{
|
||||
fprintf(stderr, "Can't open \"%s\".\n", src);
|
||||
exit(1);
|
||||
}
|
||||
if (fseek(fh, 0, SEEK_END)<0)
|
||||
{
|
||||
fprintf(stderr, "Seek error.\n");
|
||||
exit(1);
|
||||
}
|
||||
sz = ftell(fh);
|
||||
ptr = malloc(sz);
|
||||
if ( ptr == NULL )
|
||||
{
|
||||
fprintf(stderr, "Out of memory.\n");
|
||||
exit(1);
|
||||
}
|
||||
if (fseek(fh, 0, SEEK_SET)<0)
|
||||
{
|
||||
fprintf(stderr, "Seek error.\n");
|
||||
exit(1);
|
||||
}
|
||||
if ( fread(ptr, 1, sz, fh) != sz )
|
||||
{
|
||||
fprintf(stderr, "Read error.\n");
|
||||
exit(1);
|
||||
}
|
||||
fclose(fh);
|
||||
|
||||
write_file(dst, ptr, sz);
|
||||
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int opt = 0;
|
||||
|
||||
if (argc > 1 && !strcmp(argv[1], "-d"))
|
||||
opt ++;
|
||||
|
||||
if (argc != 3+opt)
|
||||
{
|
||||
fprintf(stderr, "Usage: %s [-d] from to\n", argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (opt)
|
||||
descramble(argv[2], argv[3]);
|
||||
else
|
||||
scramble(argv[1], argv[2]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
+1
-1
@@ -33,7 +33,7 @@
|
||||
|
||||
void ShowEndTxt(void)
|
||||
{
|
||||
#if !(defined (_WIN32_WCE) || defined (_XBOX) || defined (_arch_dreamcast))
|
||||
#if !(defined (_WIN32_WCE) || defined (_XBOX))
|
||||
INT32 i;
|
||||
UINT16 j, att = 0;
|
||||
INT32 nlflag = 1;
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#pragma warning(default : 4214 4244)
|
||||
#endif
|
||||
|
||||
#if defined (_XBOX) || defined (_arch_dreamcast) || defined(GP2X)
|
||||
#if defined (_XBOX) || defined(GP2X)
|
||||
#define NOLOADSO
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,588 +0,0 @@
|
||||
// Emacs style mode select -*- C++ -*-
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//-----------------------------------------------------------------------------
|
||||
/// \file
|
||||
/// \brief cd music interface
|
||||
///
|
||||
|
||||
#ifdef HAVE_SDL
|
||||
|
||||
#if defined (DC) || defined (_WIN32_WCE) || defined(GP2X) || defined(_PS3)
|
||||
#define NOSDLCD
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#ifndef NOSDLCD
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable : 4214 4244)
|
||||
#endif
|
||||
|
||||
#include "SDL.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(default : 4214 4244)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#include "../doomtype.h"
|
||||
#include "../i_sound.h"
|
||||
#include "../command.h"
|
||||
#include "../m_argv.h"
|
||||
#include "../s_sound.h"
|
||||
|
||||
#define MAX_CD_TRACKS 256
|
||||
|
||||
#ifdef _XBOX
|
||||
INT32 SDL_SYS_CDInit(void)
|
||||
{
|
||||
return(0);
|
||||
}
|
||||
|
||||
void SDL_SYS_CDQuit(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
UINT8 cdaudio_started = 0; // for system startup/shutdown
|
||||
|
||||
consvar_t cd_volume = {"cd_volume","18",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cdUpdate = {"cd_update","1",CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
#ifndef NOSDLCD
|
||||
static SDL_bool cdValid = SDL_FALSE;
|
||||
static SDL_bool cdPlaying = SDL_FALSE;
|
||||
static SDL_bool wasPlaying = SDL_FALSE;
|
||||
static SDL_bool cdEnabled = SDL_FALSE;
|
||||
static SDL_bool playLooping = SDL_FALSE;
|
||||
static Uint8 playTrack = 0;
|
||||
static Uint8 maxTrack = MAX_CD_TRACKS-1;
|
||||
static Uint8 cdRemap[MAX_CD_TRACKS];
|
||||
static INT32 cdvolume = -1;
|
||||
static SDL_CD *cdrom = NULL;
|
||||
static CDstatus cdStatus = CD_ERROR;
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* function: CDAudio_GetAudioDiskInfo
|
||||
*
|
||||
* description:
|
||||
* set number of tracks if CD is available
|
||||
*
|
||||
**************************************************************************/
|
||||
static INT32 CDAudio_GetAudioDiskInfo(void)
|
||||
{
|
||||
cdValid = SDL_FALSE;
|
||||
maxTrack = 0;
|
||||
|
||||
if (!cdrom)
|
||||
return 0;//Alam: Lies!
|
||||
|
||||
cdStatus = SDL_CDStatus(cdrom);
|
||||
|
||||
if (!CD_INDRIVE(cdStatus))
|
||||
{
|
||||
CONS_Printf("%s", M_GetText("No CD in drive\n"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (cdStatus == CD_ERROR)
|
||||
{
|
||||
CONS_Printf(M_GetText("CD Error: %s\n"), SDL_GetError());
|
||||
return -1;
|
||||
}
|
||||
|
||||
cdValid = SDL_TRUE;
|
||||
maxTrack = (Uint8)cdrom->numtracks;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* function: I_EjectCD
|
||||
*
|
||||
* description:
|
||||
*
|
||||
*
|
||||
**************************************************************************/
|
||||
static void I_EjectCD(void)
|
||||
{
|
||||
if (!cdrom || !cdEnabled)
|
||||
return; // no cd init'd
|
||||
|
||||
I_StopCD();
|
||||
|
||||
if (SDL_CDEject(cdrom))
|
||||
CONS_Printf("%s", M_GetText("CD eject failed\n"));
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* function: Command_Cd_f
|
||||
*
|
||||
* description:
|
||||
* handles all CD commands from the console
|
||||
*
|
||||
**************************************************************************/
|
||||
static void Command_Cd_f (void)
|
||||
{
|
||||
const char *command;
|
||||
size_t ret, n;
|
||||
|
||||
if (!cdaudio_started)
|
||||
return;
|
||||
|
||||
if (COM_Argc() < 2)
|
||||
{
|
||||
CONS_Printf ("%s", M_GetText("cd [on] [off] [remap] [reset] [select]\n"
|
||||
" [open] [info] [play <track>] [resume]\n"
|
||||
" [stop] [pause] [loop <track>]\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
command = COM_Argv (1);
|
||||
|
||||
if (!strncmp(command, "on", 2))
|
||||
{
|
||||
cdEnabled = SDL_TRUE;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!strncmp(command, "off", 3))
|
||||
{
|
||||
I_StopCD();
|
||||
cdEnabled = SDL_FALSE;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!strncmp(command, "select", 6))
|
||||
{
|
||||
INT32 newcddrive;
|
||||
newcddrive = atoi(COM_Argv(2));
|
||||
command = SDL_CDName(newcddrive);
|
||||
I_StopCD();
|
||||
cdEnabled = SDL_FALSE;
|
||||
SDL_CDClose(cdrom);
|
||||
cdrom = SDL_CDOpen(newcddrive);
|
||||
if (cdrom)
|
||||
{
|
||||
cdEnabled = SDL_TRUE;
|
||||
CONS_Printf(M_GetText("Opened CD-ROM drive %s\n"), command ? command : COM_Argv(2));
|
||||
}
|
||||
else CONS_Printf(M_GetText("Couldn't open CD-ROM drive %s: %s\n"), command ? command : COM_Argv(2), SDL_GetError());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!strncmp(command, "remap", 5))
|
||||
{
|
||||
ret = COM_Argc() - 2;
|
||||
if (ret <= 0)
|
||||
{
|
||||
for (n = 1; n < MAX_CD_TRACKS; n++)
|
||||
{
|
||||
if (cdRemap[n] != n)
|
||||
CONS_Printf(" %s -> %u\n", sizeu1(n), cdRemap[n]);
|
||||
}
|
||||
return;
|
||||
}
|
||||
for (n = 1; n <= ret; n++)
|
||||
cdRemap[n] = (Uint8)atoi(COM_Argv (n+1));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!strncmp(command, "reset", 5))
|
||||
{
|
||||
if (!cdrom) return;
|
||||
cdEnabled = SDL_TRUE;
|
||||
I_StopCD();
|
||||
for (n = 0; n < MAX_CD_TRACKS; n++)
|
||||
cdRemap[n] = (Uint8)n;
|
||||
CDAudio_GetAudioDiskInfo();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!cdValid)
|
||||
{
|
||||
if (CDAudio_GetAudioDiskInfo()==-1 && !cdValid)
|
||||
{
|
||||
CONS_Printf("%s", M_GetText("No CD in drive\n"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!strncmp(command, "open", 4))
|
||||
{
|
||||
I_EjectCD();
|
||||
cdValid = SDL_FALSE;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!strncmp(command, "info", 4))
|
||||
{
|
||||
CONS_Printf(M_GetText("%u tracks\n"), maxTrack);
|
||||
if (cdPlaying)
|
||||
CONS_Printf(M_GetText("Currently %s track %u\n"), playLooping ? M_GetText("looping") : M_GetText("playing"), playTrack);
|
||||
else if (wasPlaying)
|
||||
CONS_Printf(M_GetText("Paused %s track %u\n"), playLooping ? M_GetText("looping") : M_GetText("playing"), playTrack);
|
||||
CONS_Printf(M_GetText("Volume is %d\n"), cdvolume);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!strncmp(command, "play", 4))
|
||||
{
|
||||
I_PlayCD((UINT8)atoi(COM_Argv (2)), SDL_FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!strncmp(command, "loop", 4))
|
||||
{
|
||||
I_PlayCD((UINT8)atoi(COM_Argv (2)), true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!strncmp(command, "stop", 4))
|
||||
{
|
||||
I_StopCD();
|
||||
return;
|
||||
}
|
||||
if (!strncmp(command, "pause", 5))
|
||||
{
|
||||
I_PauseCD();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!strncmp(command, "resume", 6))
|
||||
{
|
||||
I_ResumeCD();
|
||||
return;
|
||||
}
|
||||
|
||||
CONS_Printf(M_GetText("Invalid CD command \"CD %s\"\n"), COM_Argv(1));
|
||||
}
|
||||
#endif
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* function: StopCD
|
||||
*
|
||||
* description:
|
||||
*
|
||||
*
|
||||
**************************************************************************/
|
||||
void I_StopCD(void)
|
||||
{
|
||||
#ifndef NOSDLCD
|
||||
if (!cdrom || !cdEnabled)
|
||||
return;
|
||||
|
||||
if (!(cdPlaying || wasPlaying))
|
||||
return;
|
||||
|
||||
if (SDL_CDStop(cdrom))
|
||||
I_OutputMsg("cdromstop failed\n");
|
||||
|
||||
wasPlaying = SDL_FALSE;
|
||||
cdPlaying = SDL_FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* function: PauseCD
|
||||
*
|
||||
* description:
|
||||
*
|
||||
*
|
||||
**************************************************************************/
|
||||
void I_PauseCD (void)
|
||||
{
|
||||
#ifndef NOSDLCD
|
||||
if (!cdrom || !cdEnabled)
|
||||
return;
|
||||
|
||||
if (!cdPlaying)
|
||||
return;
|
||||
|
||||
if (SDL_CDPause(cdrom))
|
||||
I_OutputMsg("cdrompause failed\n");
|
||||
|
||||
wasPlaying = cdPlaying;
|
||||
cdPlaying = SDL_FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* function: ResumeCD
|
||||
*
|
||||
* description:
|
||||
*
|
||||
*
|
||||
**************************************************************************/
|
||||
// continue after a pause
|
||||
void I_ResumeCD (void)
|
||||
{
|
||||
#ifndef NOSDLCD
|
||||
if (!cdrom || !cdEnabled)
|
||||
return;
|
||||
|
||||
if (!cdValid)
|
||||
return;
|
||||
|
||||
if (!wasPlaying)
|
||||
return;
|
||||
|
||||
if (cd_volume.value == 0)
|
||||
return;
|
||||
|
||||
if (SDL_CDResume(cdrom))
|
||||
I_OutputMsg("cdromresume failed\n");
|
||||
|
||||
cdPlaying = SDL_TRUE;
|
||||
wasPlaying = SDL_FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* function: ShutdownCD
|
||||
*
|
||||
* description:
|
||||
*
|
||||
*
|
||||
**************************************************************************/
|
||||
void I_ShutdownCD (void)
|
||||
{
|
||||
#ifndef NOSDLCD
|
||||
if (!cdaudio_started)
|
||||
return;
|
||||
|
||||
I_StopCD();
|
||||
|
||||
CONS_Printf("I_ShutdownCD: ");
|
||||
SDL_CDClose(cdrom);
|
||||
cdrom = NULL;
|
||||
cdaudio_started = false;
|
||||
CONS_Printf("%s", M_GetText("shut down\n"));
|
||||
SDL_QuitSubSystem(SDL_INIT_CDROM);
|
||||
cdEnabled = SDL_FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* function: InitCD
|
||||
*
|
||||
* description:
|
||||
* Initialize the first CD drive SDL detects and add console command 'cd'
|
||||
*
|
||||
**************************************************************************/
|
||||
void I_InitCD (void)
|
||||
{
|
||||
#ifndef NOSDLCD
|
||||
INT32 i;
|
||||
|
||||
// Has been checked in d_main.c, but doesn't hurt here
|
||||
if (M_CheckParm ("-nocd"))
|
||||
return;
|
||||
|
||||
CONS_Printf("%s", M_GetText("I_InitCD: Init CD audio\n"));
|
||||
|
||||
// Initialize SDL first
|
||||
if (SDL_InitSubSystem(SDL_INIT_CDROM) < 0)
|
||||
{
|
||||
CONS_Printf(M_GetText("Couldn't initialize SDL CDROM: %s\n"), SDL_GetError());
|
||||
return;
|
||||
}
|
||||
|
||||
// Open drive
|
||||
cdrom = SDL_CDOpen(0);
|
||||
|
||||
if (!cdrom)
|
||||
{
|
||||
const char *cdName = SDL_CDName(0);
|
||||
if (!cdName)
|
||||
CONS_Printf(M_GetText("Couldn't open CD-ROM drive %s: %s\n"), "\b", SDL_GetError());
|
||||
else
|
||||
CONS_Printf(M_GetText("Couldn't open CD-ROM drive %s: %s\n"), cdName, SDL_GetError());
|
||||
//return;
|
||||
}
|
||||
|
||||
for (i = 0; i < MAX_CD_TRACKS; i++)
|
||||
cdRemap[i] = (Uint8)i;
|
||||
|
||||
cdaudio_started = true;
|
||||
if (cdrom) cdEnabled = SDL_TRUE;
|
||||
|
||||
if (CDAudio_GetAudioDiskInfo()==-1)
|
||||
{
|
||||
CONS_Printf("%s", M_GetText("No CD in drive\n"));
|
||||
cdValid = SDL_FALSE;
|
||||
}
|
||||
|
||||
COM_AddCommand ("cd", Command_Cd_f);
|
||||
|
||||
CONS_Printf("%s", M_GetText("CD audio Initialized\n"));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
/**************************************************************************
|
||||
*
|
||||
* function: UpdateCD
|
||||
*
|
||||
* description:
|
||||
* sets CD volume (may have changed) and initiates play evey 2 seconds
|
||||
* in case the song has elapsed
|
||||
*
|
||||
**************************************************************************/
|
||||
void I_UpdateCD (void)
|
||||
{
|
||||
#ifndef NOSDLCD
|
||||
static Uint32 lastchk = 0;
|
||||
|
||||
if (!cdEnabled || !cdrom)
|
||||
return;
|
||||
|
||||
I_SetVolumeCD(cd_volume.value);
|
||||
|
||||
if (cdPlaying && lastchk < SDL_GetTicks())
|
||||
{
|
||||
lastchk = SDL_GetTicks() + 2000; //two seconds between chks
|
||||
|
||||
if (CDAudio_GetAudioDiskInfo()==-1)
|
||||
{
|
||||
cdPlaying = SDL_FALSE;
|
||||
return;
|
||||
}
|
||||
|
||||
if (cdStatus != CD_PLAYING && cdStatus != CD_PAUSED)
|
||||
{
|
||||
cdPlaying = SDL_FALSE;
|
||||
if (playLooping)
|
||||
I_PlayCD(playTrack, true);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* function: PlayCD
|
||||
*
|
||||
* description:
|
||||
* play the requested track and set the looping flag
|
||||
* pauses the CD if volume is 0
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
void I_PlayCD (UINT8 track, UINT8 looping)
|
||||
{
|
||||
#ifdef NOSDLCD
|
||||
(void)track;
|
||||
(void)looping;
|
||||
#else
|
||||
if (!cdrom || !cdEnabled)
|
||||
return;
|
||||
|
||||
if (!cdValid)
|
||||
{
|
||||
CDAudio_GetAudioDiskInfo();
|
||||
if (!cdValid)
|
||||
return;
|
||||
}
|
||||
|
||||
track = cdRemap[track];
|
||||
|
||||
if (track < 1 || track > maxTrack)
|
||||
{
|
||||
CONS_Printf(M_GetText("Bad track number %u.\n"), track);
|
||||
return;
|
||||
}
|
||||
|
||||
// don't try to play a non-audio track
|
||||
if (cdrom->track[track].type == SDL_DATA_TRACK)
|
||||
{
|
||||
CONS_Printf(M_GetText("Track %u is not audio\n"), track);
|
||||
return;
|
||||
}
|
||||
|
||||
if (cdPlaying)
|
||||
{
|
||||
if (playTrack == track)
|
||||
return;
|
||||
I_StopCD();
|
||||
}
|
||||
|
||||
if (SDL_CDPlayTracks(cdrom, track, 0, 1, 0))
|
||||
{
|
||||
CONS_Printf(M_GetText("Error playing track %d: %s\n"), track, SDL_GetError());
|
||||
return;
|
||||
}
|
||||
|
||||
playLooping = looping;
|
||||
playTrack = (Uint8)track;
|
||||
cdPlaying = SDL_TRUE;
|
||||
|
||||
if (cd_volume.value == 0)
|
||||
I_PauseCD();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* function: SetVolumeCD
|
||||
*
|
||||
* description:
|
||||
* SDL does not support setting the CD volume
|
||||
* use pause instead and toggle between full and no music
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
boolean I_SetVolumeCD (INT32 volume)
|
||||
{
|
||||
#ifdef NOSDLCD
|
||||
(void)volume;
|
||||
#else
|
||||
if (volume != cdvolume)
|
||||
{
|
||||
if (volume > 0 && volume < 16)
|
||||
{
|
||||
CV_SetValue(&cd_volume, 31);
|
||||
cdvolume = 31;
|
||||
I_ResumeCD();
|
||||
}
|
||||
else if (volume > 15 && volume < 31)
|
||||
{
|
||||
CV_SetValue(&cd_volume, 0);
|
||||
cdvolume = 0;
|
||||
I_PauseCD();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -80,17 +80,6 @@ FILE *logstream = NULL;
|
||||
typedef BOOL (WINAPI *p_IsDebuggerPresent)(VOID);
|
||||
#endif
|
||||
|
||||
#ifdef _arch_dreamcast
|
||||
#include <arch/arch.h>
|
||||
KOS_INIT_FLAGS(INIT_DEFAULT
|
||||
//| INIT_NET
|
||||
//| INIT_MALLOCSTATS
|
||||
//| INIT_QUIET
|
||||
//| INIT_OCRAM
|
||||
//| INIT_NO_DCLOAD
|
||||
);
|
||||
#endif
|
||||
|
||||
#if defined (_WIN32) && !defined (_XBOX) && !defined (_WIN32_WCE)
|
||||
static inline VOID MakeCodeWritable(VOID)
|
||||
{
|
||||
|
||||
+15
-89
@@ -56,18 +56,10 @@ typedef BOOL (WINAPI *p_SetProcessAffinityMask) (HANDLE, DWORD_PTR);
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#ifdef _arch_dreamcast
|
||||
#include <arch/gdb.h>
|
||||
#include <arch/timer.h>
|
||||
#include <conio/conio.h>
|
||||
#include <dc/pvr.h>
|
||||
void __set_fpscr(long); // in libgcc / kernel's startup.s?
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#if defined (_WIN32) && !defined (_WIN32_WCE) && !defined (_XBOX)
|
||||
#include <conio.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable : 4214 4244)
|
||||
@@ -85,7 +77,7 @@ void __set_fpscr(long); // in libgcc / kernel's startup.s?
|
||||
#pragma warning(default : 4214 4244)
|
||||
#endif
|
||||
|
||||
#if SDL_VERSION_ATLEAST(1,2,7) && !defined (DC)
|
||||
#if SDL_VERSION_ATLEAST(1,2,7)
|
||||
#include "SDL_cpuinfo.h" // 1.2.7 or greater
|
||||
#define HAVE_SDLCPUINFO
|
||||
#endif
|
||||
@@ -93,7 +85,7 @@ void __set_fpscr(long); // in libgcc / kernel's startup.s?
|
||||
#ifdef _PSP
|
||||
//#include <pspiofilemgr.h>
|
||||
#elif !defined(_PS3)
|
||||
#if defined (__unix__) || defined(__APPLE__) || (defined (UNIXCOMMON) && !defined (_arch_dreamcast) && !defined (__HAIKU__) && !defined (_WII))
|
||||
#if defined (__unix__) || defined(__APPLE__) || (defined (UNIXCOMMON) && !defined (__HAIKU__) && !defined (_WII))
|
||||
#if defined (__linux__)
|
||||
#include <sys/vfs.h>
|
||||
#else
|
||||
@@ -111,7 +103,7 @@ void __set_fpscr(long); // in libgcc / kernel's startup.s?
|
||||
#endif
|
||||
|
||||
#ifndef _PS3
|
||||
#if defined (__linux__) || (defined (UNIXCOMMON) && !defined (_arch_dreamcast) && !defined (_PSP) && !defined (__HAIKU__) && !defined (_WII))
|
||||
#if defined (__linux__) || (defined (UNIXCOMMON) && !defined (_PSP) && !defined (__HAIKU__) && !defined (_WII))
|
||||
#ifndef NOTERMIOS
|
||||
#include <termios.h>
|
||||
#include <sys/ioctl.h> // ioctl
|
||||
@@ -146,14 +138,7 @@ void __set_fpscr(long); // in libgcc / kernel's startup.s?
|
||||
#endif
|
||||
|
||||
// Locations for searching the srb2.srb
|
||||
#ifdef _arch_dreamcast
|
||||
#define DEFAULTWADLOCATION1 "/cd"
|
||||
#define DEFAULTWADLOCATION2 "/pc"
|
||||
#define DEFAULTWADLOCATION3 "/pc/home/alam/srb2code/data"
|
||||
#define DEFAULTSEARCHPATH1 "/cd"
|
||||
#define DEFAULTSEARCHPATH2 "/pc"
|
||||
//#define DEFAULTSEARCHPATH3 "/pc/home/alam/srb2code/data"
|
||||
#elif defined (GP2X)
|
||||
#ifdef GP2X
|
||||
#define DEFAULTWADLOCATION1 "/mnt/sd"
|
||||
#define DEFAULTWADLOCATION2 "/mnt/sd/SRB2Kart"
|
||||
#define DEFAULTWADLOCATION3 "/tmp/mnt/sd"
|
||||
@@ -364,7 +349,7 @@ static void signal_handler(INT32 num)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined (NDEBUG) && !defined (DC) && !defined (_WIN32_WCE)
|
||||
#if defined (NDEBUG) && !defined (_WIN32_WCE)
|
||||
FUNCNORETURN static ATTRNORETURN void quit_handler(int num)
|
||||
{
|
||||
signal(num, SIG_DFL); //default signal action
|
||||
@@ -726,17 +711,6 @@ static inline void I_ShutdownConsole(void){}
|
||||
void I_GetConsoleEvents(void){}
|
||||
static inline void I_StartupConsole(void)
|
||||
{
|
||||
#ifdef _arch_dreamcast
|
||||
char title[] = "SRB2 for Dreamcast!\n";
|
||||
__set_fpscr(0x00040000); /* ignore FPU underflow */
|
||||
//printf("\nHello world!\n\n");
|
||||
pvr_init_defaults();
|
||||
conio_init(CONIO_TTY_PVR, CONIO_INPUT_LINE);
|
||||
conio_set_theme(CONIO_THEME_MATRIX);
|
||||
conio_clear();
|
||||
conio_putstr(title);
|
||||
//printf("\nHello world!\n\n");
|
||||
#endif
|
||||
#ifdef _DEBUG
|
||||
consolevent = !M_CheckParm("-noconsole");
|
||||
#else
|
||||
@@ -756,7 +730,7 @@ static inline void I_ShutdownConsole(void){}
|
||||
//
|
||||
void I_StartupKeyboard (void)
|
||||
{
|
||||
#if defined (NDEBUG) && !defined (DC)
|
||||
#if defined (NDEBUG)
|
||||
#ifdef SIGILL
|
||||
// signal(SIGILL , signal_handler);
|
||||
#endif
|
||||
@@ -787,10 +761,6 @@ void I_OutputMsg(const char *fmt, ...)
|
||||
XBOXSTATIC char txt[8192];
|
||||
va_list argptr;
|
||||
|
||||
#ifdef _arch_dreamcast
|
||||
if (!keyboard_started) conio_printf(fmt);
|
||||
#endif
|
||||
|
||||
va_start(argptr,fmt);
|
||||
vsprintf(txt, fmt, argptr);
|
||||
va_end(argptr);
|
||||
@@ -1126,13 +1096,9 @@ void I_GetJoystickEvents(void)
|
||||
axisy = SDL_JoystickGetAxis(JoyInfo.dev, i*2 + 1);
|
||||
else axisy = 0;
|
||||
|
||||
#ifdef _arch_dreamcast // -128 to 127
|
||||
axisx = axisx*8;
|
||||
axisy = axisy*8;
|
||||
#else // -32768 to 32767
|
||||
// -32768 to 32767
|
||||
axisx = axisx/32;
|
||||
axisy = axisy/32;
|
||||
#endif
|
||||
|
||||
if (Joystick.bGamepadStyle)
|
||||
{
|
||||
@@ -1251,15 +1217,11 @@ static int joy_open(const char *fname)
|
||||
if (JoyInfo.buttons > JOYBUTTONS)
|
||||
JoyInfo.buttons = JOYBUTTONS;
|
||||
|
||||
#ifdef DC
|
||||
JoyInfo.hats = 0;
|
||||
#else
|
||||
JoyInfo.hats = SDL_JoystickNumHats(JoyInfo.dev);
|
||||
if (JoyInfo.hats > JOYHATS)
|
||||
JoyInfo.hats = JOYHATS;
|
||||
|
||||
JoyInfo.balls = SDL_JoystickNumBalls(JoyInfo.dev);
|
||||
#endif
|
||||
|
||||
//Joystick.bGamepadStyle = !stricmp(SDL_JoystickName(SDL_JoystickIndex(JoyInfo.dev)), "pad");
|
||||
|
||||
@@ -1418,13 +1380,9 @@ void I_GetJoystick2Events(void)
|
||||
axisy = SDL_JoystickGetAxis(JoyInfo2.dev, i*2 + 1);
|
||||
else axisy = 0;
|
||||
|
||||
#ifdef _arch_dreamcast // -128 to 127
|
||||
axisx = axisx*8;
|
||||
axisy = axisy*8;
|
||||
#else // -32768 to 32767
|
||||
// -32768 to 32767
|
||||
axisx = axisx/32;
|
||||
axisy = axisy/32;
|
||||
#endif
|
||||
|
||||
if (Joystick2.bGamepadStyle)
|
||||
{
|
||||
@@ -1711,13 +1669,10 @@ void I_GetJoystick3Events(void)
|
||||
axisy = SDL_JoystickGetAxis(JoyInfo3.dev, i*2 + 1);
|
||||
else axisy = 0;
|
||||
|
||||
#ifdef _arch_dreamcast // -128 to 127
|
||||
axisx = axisx*8;
|
||||
axisy = axisy*8;
|
||||
#else // -32768 to 32767
|
||||
|
||||
// -32768 to 32767
|
||||
axisx = axisx/32;
|
||||
axisy = axisy/32;
|
||||
#endif
|
||||
|
||||
if (Joystick3.bGamepadStyle)
|
||||
{
|
||||
@@ -2004,13 +1959,9 @@ void I_GetJoystick4Events(void)
|
||||
axisy = SDL_JoystickGetAxis(JoyInfo4.dev, i*2 + 1);
|
||||
else axisy = 0;
|
||||
|
||||
#ifdef _arch_dreamcast // -128 to 127
|
||||
axisx = axisx*8;
|
||||
axisy = axisy*8;
|
||||
#else // -32768 to 32767
|
||||
// -32768 to 32767
|
||||
axisx = axisx/32;
|
||||
axisy = axisy/32;
|
||||
#endif
|
||||
|
||||
if (Joystick4.bGamepadStyle)
|
||||
{
|
||||
@@ -2857,13 +2808,8 @@ static void I_ShutdownTimer(void)
|
||||
//
|
||||
tic_t I_GetTime (void)
|
||||
{
|
||||
#ifdef _arch_dreamcast
|
||||
static Uint64 basetime = 0;
|
||||
Uint64 ticks = timer_ms_gettime64(); //using timer_ms_gettime64 instand of SDL_GetTicks for the Dreamcast
|
||||
#else
|
||||
static Uint32 basetime = 0;
|
||||
Uint32 ticks = SDL_GetTicks();
|
||||
#endif
|
||||
|
||||
if (!basetime)
|
||||
basetime = ticks;
|
||||
@@ -2903,7 +2849,7 @@ void I_StartupTimer(void)
|
||||
pfntimeGetTime = (p_timeGetTime)GetProcAddress(winmm, "timeGetTime");
|
||||
}
|
||||
I_AddExitFunc(I_ShutdownTimer);
|
||||
#elif 0 //#elif !defined (_arch_dreamcast) && !defined(GP2X) // the DC have it own timer and GP2X have broken pthreads?
|
||||
#elif 0 //#elif !defined(GP2X) // GP2X have broken pthreads?
|
||||
if (SDL_InitSubSystem(SDL_INIT_TIMER) < 0)
|
||||
I_Error("SRB2: Needs SDL_Timer, Error: %s", SDL_GetError());
|
||||
#endif
|
||||
@@ -2913,7 +2859,7 @@ void I_StartupTimer(void)
|
||||
|
||||
void I_Sleep(void)
|
||||
{
|
||||
#if !(defined (_arch_dreamcast) || defined (_XBOX))
|
||||
#if !(defined (_XBOX))
|
||||
if (cv_sleep.value > 0)
|
||||
SDL_Delay(cv_sleep.value);
|
||||
#endif
|
||||
@@ -2932,15 +2878,6 @@ INT32 I_StartupSystem(void)
|
||||
freopen("e:/Games/SRB2/stdout.txt", "w+", stdout);
|
||||
unlink("e:/Games/SRB2/stderr.txt");
|
||||
freopen("e:/Games/SRB2/stderr.txt", "w+", stderr);
|
||||
#endif
|
||||
#ifdef _arch_dreamcast
|
||||
#ifdef _DEBUG
|
||||
//gdb_init();
|
||||
#endif
|
||||
printf(__FILE__":%i\n",__LINE__);
|
||||
#ifdef _DEBUG
|
||||
//gdb_breakpoint();
|
||||
#endif
|
||||
#endif
|
||||
SDL_VERSION(&SDLcompiled)
|
||||
SDLlinked = SDL_Linked_Version();
|
||||
@@ -2995,9 +2932,7 @@ void I_Quit(void)
|
||||
I_ShutdownGraphics();
|
||||
I_ShutdownInput();
|
||||
I_ShutdownSystem();
|
||||
#ifndef _arch_dreamcast
|
||||
SDL_Quit();
|
||||
#endif
|
||||
/* if option -noendtxt is set, don't print the text */
|
||||
if (!M_CheckParm("-noendtxt") && W_CheckNumForName("ENDOOM") != LUMPERROR)
|
||||
{
|
||||
@@ -3066,10 +3001,8 @@ void I_Error(const char *error, ...)
|
||||
I_ShutdownInput();
|
||||
if (errorcount == 7)
|
||||
I_ShutdownSystem();
|
||||
#ifndef _arch_dreamcast
|
||||
if (errorcount == 8)
|
||||
SDL_Quit();
|
||||
#endif
|
||||
if (errorcount == 9)
|
||||
{
|
||||
M_SaveConfig(NULL);
|
||||
@@ -3153,9 +3086,7 @@ void I_Error(const char *error, ...)
|
||||
I_ShutdownGraphics();
|
||||
I_ShutdownInput();
|
||||
I_ShutdownSystem();
|
||||
#ifndef _arch_dreamcast
|
||||
SDL_Quit();
|
||||
#endif
|
||||
#ifdef MAC_ALERT
|
||||
va_start(argptr, error);
|
||||
vsprintf(buffer, error, argptr);
|
||||
@@ -3245,7 +3176,7 @@ void I_ShutdownSystem(void)
|
||||
|
||||
void I_GetDiskFreeSpace(INT64 *freespace)
|
||||
{
|
||||
#if defined (_arch_dreamcast) || defined (_PSP)
|
||||
#if defined (_PSP)
|
||||
*freespace = 0;
|
||||
#elif defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||
#if defined (SOLARIS) || defined (__HAIKU__) || defined (_WII) || defined (_PS3)
|
||||
@@ -3601,12 +3532,7 @@ const char *I_LocateWad(void)
|
||||
// quick fix for compil
|
||||
UINT32 I_GetFreeMem(UINT32 *total)
|
||||
{
|
||||
#if defined (_arch_dreamcast)
|
||||
//Dreamcast!
|
||||
if (total)
|
||||
*total = 16<<20;
|
||||
return 8<<20;
|
||||
#elif defined (_PSP)
|
||||
#if defined (_PSP)
|
||||
// PSP
|
||||
if (total)
|
||||
*total = 32<<20;
|
||||
|
||||
+8
-39
@@ -35,11 +35,6 @@
|
||||
#pragma warning(default : 4214 4244)
|
||||
#endif
|
||||
|
||||
#if SDL_VERSION_ATLEAST(1,2,9) && defined (_arch_dreamcast)
|
||||
#define HAVE_DCSDL
|
||||
#include "SDL_dreamcast.h"
|
||||
#endif
|
||||
|
||||
#if SDL_VERSION_ATLEAST(1,2,9) && defined (GP2X)
|
||||
#define HAVE_GP2XSDL
|
||||
#include "SDL_gp2x.h"
|
||||
@@ -59,7 +54,7 @@
|
||||
|
||||
#ifdef HAVE_IMAGE
|
||||
#include "SDL_image.h"
|
||||
#elseif !(defined (DC) || defined (_WIN32_WCE) || defined (PSP) || defined(GP2X))
|
||||
#elseif !(defined (_WIN32_WCE) || defined (PSP) || defined(GP2X))
|
||||
#define LOAD_XPM //I want XPM!
|
||||
#include "IMG_xpm.c" //Alam: I don't want to add SDL_Image.dll/so
|
||||
#define HAVE_IMAGE //I have SDL_Image, sortof
|
||||
@@ -75,16 +70,6 @@
|
||||
#include "SDL_syswm.h"
|
||||
#endif
|
||||
|
||||
#ifdef _arch_dreamcast
|
||||
#include <conio/conio.h>
|
||||
#include <dc/maple.h>
|
||||
#include <dc/maple/vmu.h>
|
||||
//#include "SRB2DC/VMU.xbm"
|
||||
//#include <dc/pvr.h>
|
||||
//#define malloc pvr_mem_malloc
|
||||
//#define free pvr_mem_free
|
||||
#endif
|
||||
|
||||
#if defined (_XBOX) && defined (__GNUC__)
|
||||
#include <openxdk/debug.h>
|
||||
#endif
|
||||
@@ -117,7 +102,7 @@
|
||||
#endif
|
||||
|
||||
// maximum number of windowed modes (see windowedModes[][])
|
||||
#if defined (_WIN32_WCE) || defined (DC) || defined (PSP) || defined(GP2X)
|
||||
#if defined (_WIN32_WCE) || defined (PSP) || defined(GP2X)
|
||||
#define MAXWINMODES (1)
|
||||
#elif defined (WII)
|
||||
#define MAXWINMODES (8)
|
||||
@@ -140,7 +125,7 @@ rendermode_t rendermode=render_soft;
|
||||
boolean highcolor = false;
|
||||
|
||||
// synchronize page flipping with screen refresh
|
||||
#if defined(DC) || (defined(GP2X) && !defined(HAVE_GP2XSDL))
|
||||
#if defined(GP2X) && !defined(HAVE_GP2XSDL)
|
||||
consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
#else
|
||||
consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
@@ -167,11 +152,7 @@ static SDL_Surface *bufSurface = NULL;
|
||||
static SDL_Surface *icoSurface = NULL;
|
||||
static SDL_Color localPalette[256];
|
||||
static SDL_Rect **modeList = NULL;
|
||||
#ifdef DC
|
||||
static Uint8 BitsPerPixel = 15;
|
||||
#else
|
||||
static Uint8 BitsPerPixel = 16;
|
||||
#endif
|
||||
static Uint16 realwidth = BASEVIDWIDTH;
|
||||
static Uint16 realheight = BASEVIDHEIGHT;
|
||||
#ifdef _WIN32_WCE
|
||||
@@ -186,7 +167,7 @@ static const Uint32 surfaceFlagsF = SDL_HWPALETTE|SDL_FULLSCREEN;
|
||||
#endif
|
||||
static SDL_bool mousegrabok = SDL_TRUE;
|
||||
#define HalfWarpMouse(x,y) SDL_WarpMouse((Uint16)(x/2),(Uint16)(y/2))
|
||||
#if defined (_WIN32_WCE) || defined (DC) || defined (PSP) || defined(GP2X)
|
||||
#if defined (_WIN32_WCE) || defined (PSP) || defined(GP2X)
|
||||
static SDL_bool videoblitok = SDL_TRUE;
|
||||
#else
|
||||
static SDL_bool videoblitok = SDL_FALSE;
|
||||
@@ -196,7 +177,7 @@ static SDL_bool exposevideo = SDL_FALSE;
|
||||
// windowed video modes from which to choose from.
|
||||
static INT32 windowedModes[MAXWINMODES][2] =
|
||||
{
|
||||
#if !(defined (_WIN32_WCE) || defined (DC) || defined (PSP) || defined (GP2X))
|
||||
#if !(defined (_WIN32_WCE) || defined (PSP) || defined (GP2X))
|
||||
#ifndef WII
|
||||
#ifndef _PS3
|
||||
{1920,1200}, // 1.60,6.00
|
||||
@@ -241,11 +222,6 @@ static void SDLSetMode(INT32 width, INT32 height, INT32 bpp, Uint32 flags)
|
||||
#ifdef _WII
|
||||
bpp = 16; // 8-bit mode poo
|
||||
#endif
|
||||
#ifdef DC
|
||||
if (bpp < 15)
|
||||
bpp = 15;
|
||||
height = 240;
|
||||
#endif
|
||||
#ifdef PSP
|
||||
bpp = 16;
|
||||
#endif
|
||||
@@ -491,7 +467,6 @@ static INT32 SDLatekey(SDLKey sym)
|
||||
rc = KEY_PLUSPAD;
|
||||
break;
|
||||
|
||||
#ifndef _arch_dreamcast
|
||||
case SDLK_LSUPER:
|
||||
#ifdef HAVE_SDLMETAKEYS
|
||||
case SDLK_LMETA:
|
||||
@@ -508,7 +483,6 @@ static INT32 SDLatekey(SDLKey sym)
|
||||
case SDLK_MENU:
|
||||
rc = KEY_MENU;
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
if (sym >= SDLK_SPACE && sym <= SDLK_DELETE)
|
||||
@@ -653,7 +627,7 @@ static void VID_Command_Info_f (void)
|
||||
|
||||
static void VID_Command_ModeList_f(void)
|
||||
{
|
||||
#if !defined (DC) && !defined (_WIN32_WCE) && !defined (_PSP) && !defined(GP2X)
|
||||
#if !defined (_WIN32_WCE) && !defined (_PSP) && !defined(GP2X)
|
||||
INT32 i;
|
||||
|
||||
modeList = SDL_ListModes(NULL, surfaceFlagsF|SDL_HWSURFACE); //Alam: At least hardware surface
|
||||
@@ -944,11 +918,8 @@ static inline void SDLJoyRemap(event_t *event)
|
||||
|
||||
static INT32 SDLJoyAxis(const Sint16 axis, evtype_t which)
|
||||
{
|
||||
#ifdef _arch_dreamcast // -128 to 127 SDL for DC have give us a smaller range
|
||||
INT32 raxis = axis*8;
|
||||
#else // -32768 to 32767
|
||||
// -32768 to 32767
|
||||
INT32 raxis = axis/32;
|
||||
#endif
|
||||
if (which == ev_joystick)
|
||||
{
|
||||
if (Joystick.bGamepadStyle)
|
||||
@@ -1285,7 +1256,7 @@ static inline boolean I_SkipFrame(void)
|
||||
|
||||
skip = !skip;
|
||||
|
||||
#if 0 //(defined (GP2X) || defined (PSP) || defined (_arch_dreamcast))
|
||||
#if 0 //(defined (GP2X) || defined (PSP))
|
||||
return skip;
|
||||
#endif
|
||||
|
||||
@@ -1976,9 +1947,7 @@ void I_ShutdownGraphics(void)
|
||||
#endif
|
||||
graphics_started = false;
|
||||
CONS_Printf("%s", M_GetText("shut down\n"));
|
||||
#ifndef _arch_dreamcast
|
||||
SDL_QuitSubSystem(SDL_INIT_VIDEO);
|
||||
#endif
|
||||
framebuffer = SDL_FALSE;
|
||||
}
|
||||
#endif
|
||||
+5
-14
@@ -85,7 +85,7 @@
|
||||
// mixing buffer, and the samplerate of the raw data.
|
||||
|
||||
// Needed for calling the actual sound output.
|
||||
#if defined (_WIN32_WCE) || defined (DC) || defined (PSP) || defined(GP2X)
|
||||
#if defined (_WIN32_WCE) || defined (PSP) || defined(GP2X)
|
||||
#define NUM_CHANNELS MIX_CHANNELS
|
||||
#else
|
||||
#define NUM_CHANNELS MIX_CHANNELS*4
|
||||
@@ -93,7 +93,7 @@
|
||||
|
||||
#define INDEXOFSFX(x) ((sfxinfo_t *)x - S_sfx)
|
||||
|
||||
#if defined (_WIN32_WCE) || defined (DC) || defined (PSP)
|
||||
#if defined (_WIN32_WCE) || defined (PSP)
|
||||
static Uint16 samplecount = 512; //Alam: .5KB samplecount at 11025hz is 46.439909297052154195011337868481ms of buffer
|
||||
#elif defined(GP2X)
|
||||
static Uint16 samplecount = 128;
|
||||
@@ -151,9 +151,7 @@ static SDL_bool musicStarted = SDL_FALSE;
|
||||
#ifdef HAVE_MIXER
|
||||
static SDL_mutex *Msc_Mutex = NULL;
|
||||
/* FIXME: Make this file instance-specific */
|
||||
#ifdef _arch_dreamcast
|
||||
#define MIDI_PATH "/ram"
|
||||
#elif defined(GP2X)
|
||||
#ifdef GP2X
|
||||
#define MIDI_PATH "/mnt/sd/srb2"
|
||||
#define MIDI_PATH2 "/tmp/mnt/sd/srb2"
|
||||
#else
|
||||
@@ -176,7 +174,7 @@ static SDL_bool canlooping = SDL_TRUE;
|
||||
|
||||
#if SDL_MIXER_VERSION_ATLEAST(1,2,7)
|
||||
#define USE_RWOPS // ok, USE_RWOPS is in here
|
||||
#if defined (DC) || defined (_WIN32_WCE) || defined (_XBOX) //|| defined(_WIN32) || defined(GP2X)
|
||||
#if defined (_WIN32_WCE) || defined (_XBOX) //|| defined(_WIN32) || defined(GP2X)
|
||||
#undef USE_RWOPS
|
||||
#endif
|
||||
#endif
|
||||
@@ -1190,13 +1188,6 @@ void I_StartupSound(void)
|
||||
#endif
|
||||
#ifndef HAVE_MIXER
|
||||
nomidimusic = nodigimusic = true;
|
||||
#endif
|
||||
#ifdef DC
|
||||
//nosound = true;
|
||||
#ifdef HAVE_MIXER
|
||||
nomidimusic = true;
|
||||
nodigimusic = true;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
memset(channels, 0, sizeof (channels)); //Alam: Clean it
|
||||
@@ -1523,7 +1514,7 @@ void I_InitMusic(void)
|
||||
#endif
|
||||
I_OutputMsg("Linked with SDL_mixer version: %d.%d.%d\n",
|
||||
MIXlinked->major, MIXlinked->minor, MIXlinked->patch);
|
||||
#if !(defined (DC) || defined (PSP) || defined(GP2X) || defined (WII))
|
||||
#if !(defined (PSP) || defined(GP2X) || defined (WII))
|
||||
if (audio.freq < 44100 && !M_CheckParm ("-freq")) //I want atleast 44Khz
|
||||
{
|
||||
audio.samples = (Uint16)(audio.samples*(INT32)(44100/audio.freq));
|
||||
|
||||
Reference in new issue
Block a user