ref: f66ee83d0938466f66eae07e21107455c13a8d9b
parent: 7747cc22938c8c9b767e0435605522ddacdc64c2
parent: 3c5ec3c8bb3853c5017463302b55c892961bccab
author: LTCHIPS <ltchips994@gmail.com>
date: Mon Jun 4 08:52:23 EDT 2018
Merge pull request #3 from marespiaut/master Removing unused variables and DOS code.
--- a/rott/_rt_swft.h
+++ b/rott/_rt_swft.h
@@ -20,90 +20,5 @@
#ifndef _rt_swift_private
#define _rt_swift_private
-#ifdef DOS
-//****************************************************************************
-//
-// Private header for RT_SWIFT.C.
-//
-//****************************************************************************
-
-
-
-//****************************************************************************
-//
-// DEFINES
-//
-//****************************************************************************
-
-#define DPMI_INT 0x31
-#define MOUSE_INT 0x33
-#define DOSMEMSIZE 64 // enough for any SWIFT structure
-
-//
-// device type codes, returned in deviceType field (SWIFT_StaticData)
-//
-#define SWIFT_DEV_NONE 0
-#define SWIFT_DEV_CYBERMAN 1
-
-//
-// Dynamic device data
-//
-#define SDD_EXTERNAL_POWER_CONNECTED 1
-#define SDD_EXTERNAL_POWER_TOO_HIGH 2
-
-#define AX(r) ((r).x.eax)
-#define BX(r) ((r).x.ebx)
-#define CX(r) ((r).x.ecx)
-#define DX(r) ((r).x.edx)
-#define SI(r) ((r).x.esi)
-#define DI(r) ((r).x.edi)
-
-
-//****************************************************************************
-//
-// TYPEDEFS
-//
-//****************************************************************************
-
-// Active flag:
-static int fActive; // TRUE after successful init
-// and before termination
-static int nAttached = SWIFT_DEV_NONE; // type of SWIFT device
-
-union REGS regs;
-struct SREGS sregs;
-
-short selector; // selector of DOS memory block
-short segment; // segment of DOS memory block
-void far *pdosmem; // pointer to DOS memory block
-
-// DPMI real mode interrupt structure
-static struct rminfo
-{
- long di;
- long si;
- long bp;
- long reserved_by_system;
- long bx;
- long dx;
- long cx;
- long ax;
- short flags;
- short es, ds, fs, gs, ip, cs, sp, ss;
-} RMI;
-
-
-//****************************************************************************
-//
-// PROTOTYPES
-//
-//****************************************************************************
-
-void MouseInt (struct rminfo *prmi);
-static void far *allocDOS (unsigned nbytes, short *pseg, short *psel);
-static void freeDOS (short sel);
-
-#endif
-
#endif
--- a/rott/_rt_util.h
+++ b/rott/_rt_util.h
@@ -20,13 +20,6 @@
#ifndef _rt_util_private
#define _rt_util_private
-#ifdef DOS
-#define PEL_WRITE_ADR 0x3c8
-#define PEL_READ_ADR 0x3c7
-#define PEL_DATA 0x3c9
-#define PEL_MASK 0x3c6
-#endif
-
#define ERRORROW 2
#define ERRORCOL 11
@@ -43,5 +36,4 @@
#define WeightR 3
#define WeightG 5
#define WeightB 2
-
#endif
--- a/rott/_w_wad.h
+++ b/rott/_w_wad.h
@@ -32,11 +32,7 @@
#elif ( LOWCOST == 1)
#define WADCHECKSUM (12185)
#else
-#ifdef DOS
-#define WADCHECKSUM (45677)
-#else
#define WADCHECKSUM (20567)
-#endif
#endif
#else
--- a/rott/audiolib/_multivc.h
+++ b/rott/audiolib/_multivc.h
@@ -219,31 +219,8 @@
static void MV_CalcVolume( int MaxLevel );
static void MV_CalcPanTable( void );
-#ifdef PLAT_DOS
-#define ATR_INDEX 0x3c0
-#define STATUS_REGISTER_1 0x3da
-
-#define SetBorderColor(color) \
- { \
- inp (STATUS_REGISTER_1); \
- outp (ATR_INDEX,0x31); \
- outp (ATR_INDEX,color); \
- }
-#endif
-
void ClearBuffer_DW( void *ptr, unsigned data, int length );
-#ifdef PLAT_DOS
-#pragma aux ClearBuffer_DW = \
- "cld", \
- "push es", \
- "push ds", \
- "pop es", \
- "rep stosd", \
- "pop es", \
-parm [ edi ] [ eax ] [ ecx ] modify exact [ ecx edi ];
-#endif
-
void MV_Mix8BitMono( unsigned long position, unsigned long rate,
const char *start, unsigned long length );
@@ -275,12 +252,5 @@
void MV_16BitReverbFast( const char *src, char *dest, int count, int shift );
void MV_8BitReverbFast( const signed char *src, signed char *dest, int count, int shift );
-
-#ifdef PLAT_DOS
-#pragma aux MV_16BitReverb parm [eax] [edx] [ebx] [ecx] modify exact [eax ebx ecx edx esi edi]
-#pragma aux MV_8BitReverb parm [eax] [edx] [ebx] [ecx] modify exact [eax ebx ecx edx esi edi]
-#pragma aux MV_16BitReverbFast parm [eax] [edx] [ebx] [ecx] modify exact [eax ebx ecx edx esi edi]
-#pragma aux MV_8BitReverbFast parm [eax] [edx] [ebx] [ecx] modify exact [eax ebx ecx edx esi edi]
-#endif
#endif
--- a/rott/audiolib/dpmi.h
+++ b/rott/audiolib/dpmi.h
@@ -75,28 +75,4 @@
#define DPMI_Unlock( variable ) \
( DPMI_UnlockMemory( (void *) &( variable ), sizeof( variable ) ) )
-#ifdef PLAT_DOS
-#pragma aux DPMI_GetDOSMemory = \
- "mov eax, 0100h", \
- "add ebx, 15", \
- "shr ebx, 4", \
- "int 31h", \
- "jc DPMI_Exit", \
- "movzx eax, ax", \
- "shl eax, 4", \
- "mov [ esi ], eax", \
- "mov [ edi ], edx", \
- "sub eax, eax", \
- "DPMI_Exit:", \
- parm [ esi ] [ edi ] [ ebx ] modify exact [ eax ebx edx ];
-
-#pragma aux DPMI_FreeDOSMemory = \
- "mov eax, 0101h", \
- "int 31h", \
- "jc DPMI_Exit", \
- "sub eax, eax", \
- "DPMI_Exit:", \
- parm [ edx ] modify exact [ eax ];
-#endif
-
#endif
--- a/rott/audiolib/dsl.c
+++ b/rott/audiolib/dsl.c
@@ -133,7 +133,6 @@
int MixMode, void ( *CallBackFunc )( void ) )
{
Uint16 format;
- Uint8 *tmp;
int channels;
int chunksize;
--- a/rott/audiolib/fx_man.c
+++ b/rott/audiolib/fx_man.c
@@ -33,15 +33,7 @@
#include "sndcards.h"
#include "multivoc.h"
-#ifdef PLAT_DOS
-#include "blaster.h"
-#include "pas16.h"
-#include "sndscape.h"
-#include "guswave.h"
-#include "sndsrc.h"
-#else
#include "dsl.h"
-#endif
#include "ll_man.h"
#include "user.h"
@@ -91,42 +83,8 @@
"(c) Copyright 1995 James R. Dose. All Rights Reserved.\n";
break;
-#ifdef PLAT_DOS
- case FX_BlasterError :
- ErrorString = BLASTER_ErrorString( BLASTER_Error );
- break;
-#endif
-
case FX_SoundCardError :
-#ifdef PLAT_DOS
- switch( FX_SoundDevice )
- {
- case SoundBlaster :
- case Awe32 :
- ErrorString = BLASTER_ErrorString( BLASTER_Error );
- break;
-
- case ProAudioSpectrum :
- case SoundMan16 :
- ErrorString = PAS_ErrorString( PAS_Error );
- break;
-
- case SoundScape :
- ErrorString = SOUNDSCAPE_ErrorString( SOUNDSCAPE_Error );
- break;
-
- case UltraSound :
- ErrorString = GUSWAVE_ErrorString( GUSWAVE_Error );
- break;
-
- case SoundSource :
- case TandySoundSource :
- ErrorString = SS_ErrorString( SS_Error );
- break;
- }
-#else
ErrorString = DSL_ErrorString( DSL_Error );
-#endif
break;
case FX_InvalidCard :
@@ -177,88 +135,6 @@
status = FX_Ok;
FX_SetErrorCode( FX_Ok );
-#ifdef PLAT_DOS
- switch( SoundCard )
- {
- case SoundBlaster :
- case Awe32 :
- DeviceStatus = BLASTER_Init();
- if ( DeviceStatus != BLASTER_Ok )
- {
- FX_SetErrorCode( FX_SoundCardError );
- status = FX_Error;
- break;
- }
-
- device->MaxVoices = 32;
- BLASTER_GetCardInfo( &device->MaxSampleBits, &device->MaxChannels );
- break;
-
- case ProAudioSpectrum :
- case SoundMan16 :
- DeviceStatus = PAS_Init();
- if ( DeviceStatus != PAS_Ok )
- {
- FX_SetErrorCode( FX_SoundCardError );
- status = FX_Error;
- break;
- }
-
- device->MaxVoices = 32;
- PAS_GetCardInfo( &device->MaxSampleBits, &device->MaxChannels );
- break;
-
- case GenMidi :
- case SoundCanvas :
- case WaveBlaster :
- device->MaxVoices = 0;
- device->MaxSampleBits = 0;
- device->MaxChannels = 0;
- break;
-
- case SoundScape :
- device->MaxVoices = 32;
- DeviceStatus = SOUNDSCAPE_GetCardInfo( &device->MaxSampleBits,
- &device->MaxChannels );
- if ( DeviceStatus != SOUNDSCAPE_Ok )
- {
- FX_SetErrorCode( FX_SoundCardError );
- status = FX_Error;
- }
- break;
-
- case UltraSound :
- if ( GUSWAVE_Init( 8 ) != GUSWAVE_Ok )
- {
- FX_SetErrorCode( FX_SoundCardError );
- status = FX_Error;
- break;
- }
-
- device->MaxVoices = 8;
- device->MaxSampleBits = 0;
- device->MaxChannels = 0;
- break;
-
- case SoundSource :
- case TandySoundSource :
- DeviceStatus = SS_Init( SoundCard );
- if ( DeviceStatus != SS_Ok )
- {
- FX_SetErrorCode( FX_SoundCardError );
- status = FX_Error;
- break;
- }
- SS_Shutdown();
- device->MaxVoices = 32;
- device->MaxSampleBits = 8;
- device->MaxChannels = 1;
- break;
- default :
- FX_SetErrorCode( FX_InvalidCard );
- status = FX_Error;
- }
-#else
DeviceStatus = DSL_Init();
if ( DeviceStatus != DSL_Ok )
{
@@ -271,7 +147,6 @@
device->MaxSampleBits = 0;
device->MaxChannels = 0;
}
-#endif
return( status );
}
@@ -289,28 +164,7 @@
)
{
-#ifdef PLAT_DOS
- int status;
- BLASTER_CONFIG Blaster;
- FX_SetErrorCode( FX_Ok );
-
- status = BLASTER_GetEnv( &Blaster );
- if ( status != BLASTER_Ok )
- {
- FX_SetErrorCode( FX_BlasterError );
- return( FX_Error );
- }
-
- blaster->Type = Blaster.Type;
- blaster->Address = Blaster.Address;
- blaster->Interrupt = Blaster.Interrupt;
- blaster->Dma8 = Blaster.Dma8;
- blaster->Dma16 = Blaster.Dma16;
- blaster->Midi = Blaster.Midi;
- blaster->Emu = Blaster.Emu;
-#endif
-
return( FX_Ok );
}
@@ -330,35 +184,7 @@
)
{
-#ifdef PLAT_DOS
- int DeviceStatus;
- BLASTER_CONFIG Blaster;
- FX_SetErrorCode( FX_Ok );
-
- FX_SoundDevice = SoundBlaster;
-
- Blaster.Type = blaster.Type;
- Blaster.Address = blaster.Address;
- Blaster.Interrupt = blaster.Interrupt;
- Blaster.Dma8 = blaster.Dma8;
- Blaster.Dma16 = blaster.Dma16;
- Blaster.Midi = blaster.Midi;
- Blaster.Emu = blaster.Emu;
-
- BLASTER_SetCardSettings( Blaster );
-
- DeviceStatus = BLASTER_Init();
- if ( DeviceStatus != BLASTER_Ok )
- {
- FX_SetErrorCode( FX_SoundCardError );
- return( FX_Error );
- }
-
- *MaxVoices = 8;
- BLASTER_GetCardInfo( MaxSampleBits, MaxChannels );
-#endif
-
return( FX_Ok );
}
@@ -541,53 +367,7 @@
)
{
- int status;
-
-#ifdef PLAT_DOS
- switch( FX_SoundDevice )
- {
- case SoundBlaster :
- case Awe32 :
- if ( BLASTER_CardHasMixer() )
- {
- BLASTER_SetVoiceVolume( volume );
- }
- else
- {
- MV_SetVolume( volume );
- }
- break;
-
- case ProAudioSpectrum :
- case SoundMan16 :
- status = PAS_SetPCMVolume( volume );
- if ( status != PAS_Ok )
- {
- MV_SetVolume( volume );
- }
- break;
-
- case GenMidi :
- case SoundCanvas :
- case WaveBlaster :
- break;
-
- case SoundScape :
- MV_SetVolume( volume );
- break;
-
- case UltraSound :
- GUSWAVE_SetVolume( volume );
- break;
-
- case SoundSource :
- case TandySoundSource :
- MV_SetVolume( volume );
- break;
- }
-#else
MV_SetVolume( volume );
-#endif
}
@@ -605,55 +385,7 @@
{
int volume;
-#ifdef PLAT_DOS
- switch( FX_SoundDevice )
- {
- case SoundBlaster :
- case Awe32 :
- if ( BLASTER_CardHasMixer() )
- {
- volume = BLASTER_GetVoiceVolume();
- }
- else
- {
- volume = MV_GetVolume();
- }
- break;
-
- case ProAudioSpectrum :
- case SoundMan16 :
- volume = PAS_GetPCMVolume();
- if ( volume == PAS_Error )
- {
- volume = MV_GetVolume();
- }
- break;
-
- case GenMidi :
- case SoundCanvas :
- case WaveBlaster :
- volume = 255;
- break;
-
- case SoundScape :
- volume = MV_GetVolume();
- break;
-
- case UltraSound :
- volume = GUSWAVE_GetVolume();
- break;
-
- case SoundSource :
- case TandySoundSource :
- volume = MV_GetVolume();
- break;
-
- default :
- volume = 0;
- }
-#else
volume = MV_GetVolume();
-#endif
return( volume );
}
@@ -1316,34 +1048,8 @@
{
int status;
-#ifdef PLAT_DOS
- switch( FX_SoundDevice )
- {
- case SoundBlaster :
- case Awe32 :
- case ProAudioSpectrum :
- case SoundMan16 :
- status = MV_StartRecording( MixRate, function );
- if ( status != MV_Ok )
- {
- FX_SetErrorCode( FX_MultiVocError );
- status = FX_Warning;
- }
- else
- {
- status = FX_Ok;
- }
- break;
-
- default :
- FX_SetErrorCode( FX_InvalidCard );
- status = FX_Warning;
- break;
- }
-#else
FX_SetErrorCode( FX_InvalidCard );
status = FX_Warning;
-#endif
return( status );
}
@@ -1361,16 +1067,4 @@
)
{
-#ifdef PLAT_DOS
- // Stop sound playback
- switch( FX_SoundDevice )
- {
- case SoundBlaster :
- case Awe32 :
- case ProAudioSpectrum :
- case SoundMan16 :
- MV_StopRecord();
- break;
- }
-#endif
}
--- a/rott/audiolib/interrup.h
+++ b/rott/audiolib/interrup.h
@@ -34,17 +34,4 @@
unsigned long DisableInterrupts( void );
void RestoreInterrupts( unsigned long flags );
-#ifdef PLAT_DOS
-#pragma aux DisableInterrupts = \
- "pushfd", \
- "pop eax", \
- "cli" \
- modify [ eax ];
-
-#pragma aux RestoreInterrupts = \
- "push eax", \
- "popfd" \
- parm [ eax ];
-#endif
-
#endif
--- a/rott/audiolib/multivoc.c
+++ b/rott/audiolib/multivoc.c
@@ -34,11 +34,6 @@
#include <string.h>
#include <time.h>
-#ifdef PLAT_DOS
-#include <dos.h>
-#include <conio.h>
-#endif
-
#include "util.h"
#include "dpmi.h"
#include "usrhooks.h"
@@ -47,15 +42,7 @@
#include "linklist.h"
#include "sndcards.h"
-#ifdef PLAT_DOS
-#include "blaster.h"
-#include "sndscape.h"
-#include "sndsrc.h"
-#include "pas16.h"
-#include "guswave.h"
-#else
#include "dsl.h"
-#endif
#include "pitch.h"
#include "multivoc.h"
@@ -186,26 +173,6 @@
ErrorString = "No voice with matching handle found.";
break;
-#ifdef PLAT_DOS
- case MV_BlasterError :
- ErrorString = BLASTER_ErrorString( BLASTER_Error );
- break;
-
- case MV_PasError :
- ErrorString = PAS_ErrorString( PAS_Error );
- break;
-
- case MV_SoundScapeError :
- ErrorString = SOUNDSCAPE_ErrorString( SOUNDSCAPE_Error );
- break;
-
- #ifndef SOUNDSOURCE_OFF
- case MV_SoundSourceError :
- ErrorString = SS_ErrorString( SS_Error );
- break;
- #endif
-#endif
-
case MV_DPMI_Error :
ErrorString = "DPMI Error in Multivoc.";
break;
@@ -418,18 +385,7 @@
{
VoiceNode *voice;
VoiceNode *next;
- char *buffer;
-#ifdef PLAT_DOS
- if ( MV_DMAChannel >= 0 )
- {
- // Get the currently playing buffer
- buffer = ( char * )DMA_GetCurrentPos( MV_DMAChannel );
- MV_MixPage = ( unsigned )( buffer - MV_MixBuffer[ 0 ] );
- MV_MixPage >>= MV_BuffShift;
- }
-#endif
-
// Toggle which buffer we'll mix next
MV_MixPage++;
if ( MV_MixPage >= MV_NumberOfBuffers )
@@ -1860,37 +1816,7 @@
mode |= SIXTEEN_BIT;
}
-#ifdef PLAT_DOS
- switch( MV_SoundCard )
- {
- case UltraSound :
- MV_MixMode = mode;
- break;
-
- case SoundBlaster :
- case Awe32 :
- MV_MixMode = BLASTER_SetMixMode( mode );
- break;
-
- case ProAudioSpectrum :
- case SoundMan16 :
- MV_MixMode = PAS_SetMixMode( mode );
- break;
-
- case SoundScape :
- MV_MixMode = SOUNDSCAPE_SetMixMode( mode );
- break;
-
- #ifndef SOUNDSOURCE_OFF
- case SoundSource :
- case TandySoundSource :
- MV_MixMode = SS_SetMixMode( mode );
- break;
- #endif
- }
-#else
MV_MixMode = mode;
-#endif
MV_Channels = 1;
if ( MV_MixMode & STEREO )
@@ -1967,95 +1893,6 @@
// return( MV_Ok );
// Start playback
-#ifdef PLAT_DOS
- switch( MV_SoundCard )
- {
- case SoundBlaster :
- case Awe32 :
- status = BLASTER_BeginBufferedPlayback( MV_MixBuffer[ 0 ],
- TotalBufferSize, MV_NumberOfBuffers,
- MV_RequestedMixRate, MV_MixMode, MV_ServiceVoc );
-
- if ( status != BLASTER_Ok )
- {
- MV_SetErrorCode( MV_BlasterError );
- return( MV_Error );
- }
-
- MV_MixRate = BLASTER_GetPlaybackRate();
- MV_DMAChannel = BLASTER_DMAChannel;
- break;
-
- case UltraSound :
-
- status = GUSWAVE_StartDemandFeedPlayback( MV_ServiceGus, 1,
- MV_Bits, MV_RequestedMixRate, 0, ( MV_Channels == 1 ) ?
- 0 : 24, 255, 0xffff, 0 );
- if ( status < GUSWAVE_Ok )
- {
- MV_SetErrorCode( MV_BlasterError );
- return( MV_Error );
- }
-
- if ( MV_Channels == 2 )
- {
- status = GUSWAVE_StartDemandFeedPlayback( MV_ServiceRightGus, 1,
- MV_Bits, MV_RequestedMixRate, 0, 8, 255, 0xffff, 0 );
- if ( status < GUSWAVE_Ok )
- {
- GUSWAVE_KillAllVoices();
- MV_SetErrorCode( MV_BlasterError );
- return( MV_Error );
- }
- }
-
- MV_MixRate = MV_RequestedMixRate;
- MV_DMAChannel = -1;
- break;
-
- case ProAudioSpectrum :
- case SoundMan16 :
- status = PAS_BeginBufferedPlayback( MV_MixBuffer[ 0 ],
- TotalBufferSize, MV_NumberOfBuffers,
- MV_RequestedMixRate, MV_MixMode, MV_ServiceVoc );
-
- if ( status != PAS_Ok )
- {
- MV_SetErrorCode( MV_PasError );
- return( MV_Error );
- }
-
- MV_MixRate = PAS_GetPlaybackRate();
- MV_DMAChannel = PAS_DMAChannel;
- break;
-
- case SoundScape :
- status = SOUNDSCAPE_BeginBufferedPlayback( MV_MixBuffer[ 0 ],
- TotalBufferSize, MV_NumberOfBuffers, MV_RequestedMixRate,
- MV_MixMode, MV_ServiceVoc );
-
- if ( status != SOUNDSCAPE_Ok )
- {
- MV_SetErrorCode( MV_SoundScapeError );
- return( MV_Error );
- }
-
- MV_MixRate = SOUNDSCAPE_GetPlaybackRate();
- MV_DMAChannel = SOUNDSCAPE_DMAChannel;
- break;
-
- #ifndef SOUNDSOURCE_OFF
- case SoundSource :
- case TandySoundSource :
- SS_BeginBufferedPlayback( MV_MixBuffer[ 0 ],
- TotalBufferSize, MV_NumberOfBuffers,
- MV_ServiceVoc );
- MV_MixRate = SS_SampleRate;
- MV_DMAChannel = -1;
- break;
- #endif
- }
-#else
status = DSL_BeginBufferedPlayback( MV_MixBuffer[ 0 ],
TotalBufferSize, MV_NumberOfBuffers,
MV_RequestedMixRate, MV_MixMode, MV_ServiceVoc );
@@ -2067,7 +1904,6 @@
}
MV_MixRate = DSL_GetPlaybackRate();
-#endif
return( MV_Ok );
}
@@ -2089,38 +1925,7 @@
VoiceNode *next;
unsigned flags;
-#ifdef PLAT_DOS
- // Stop sound playback
- switch( MV_SoundCard )
- {
- case SoundBlaster :
- case Awe32 :
- BLASTER_StopPlayback();
- break;
-
- case UltraSound :
- GUSWAVE_KillAllVoices();
- break;
-
- case ProAudioSpectrum :
- case SoundMan16 :
- PAS_StopPlayback();
- break;
-
- case SoundScape :
- SOUNDSCAPE_StopPlayback();
- break;
-
- #ifndef SOUNDSOURCE_OFF
- case SoundSource :
- case TandySoundSource :
- SS_StopPlayback();
- break;
- #endif
- }
-#else
DSL_StopPlayback();
-#endif
// Make sure all callbacks are done.
flags = DisableInterrupts();
@@ -2154,75 +1959,8 @@
)
{
-#ifdef PLAT_DOS
- int status;
-
- switch( MV_SoundCard )
- {
- case SoundBlaster :
- case Awe32 :
- case ProAudioSpectrum :
- case SoundMan16 :
- break;
-
- default :
- MV_SetErrorCode( MV_UnsupportedCard );
- return( MV_Error );
- break;
- }
-
- if ( function == NULL )
- {
- MV_SetErrorCode( MV_NullRecordFunction );
- return( MV_Error );
- }
-
- MV_StopPlayback();
-
- // Initialize the buffers
- ClearBuffer_DW( MV_MixBuffer[ 0 ], SILENCE_8BIT, TotalBufferSize >> 2 );
-
- // Set the mix buffer variables
- MV_MixPage = 0;
-
- MV_RecordFunc = function;
-
- // Start playback
- switch( MV_SoundCard )
- {
- case SoundBlaster :
- case Awe32 :
- status = BLASTER_BeginBufferedRecord( MV_MixBuffer[ 0 ],
- TotalBufferSize, NumberOfBuffers, MixRate, MONO_8BIT,
- MV_ServiceRecord );
-
- if ( status != BLASTER_Ok )
- {
- MV_SetErrorCode( MV_BlasterError );
- return( MV_Error );
- }
- break;
-
- case ProAudioSpectrum :
- case SoundMan16 :
- status = PAS_BeginBufferedRecord( MV_MixBuffer[ 0 ],
- TotalBufferSize, NumberOfBuffers, MixRate, MONO_8BIT,
- MV_ServiceRecord );
-
- if ( status != PAS_Ok )
- {
- MV_SetErrorCode( MV_PasError );
- return( MV_Error );
- }
- break;
- }
-
- MV_Recording = TRUE;
- return( MV_Ok );
-#else
MV_SetErrorCode( MV_UnsupportedCard );
return( MV_Error );
-#endif
}
@@ -2238,24 +1976,6 @@
)
{
-#ifdef PLAT_DOS
- // Stop sound playback
- switch( MV_SoundCard )
- {
- case SoundBlaster :
- case Awe32 :
- BLASTER_StopPlayback();
- break;
-
- case ProAudioSpectrum :
- case SoundMan16 :
- PAS_StopPlayback();
- break;
- }
-
- MV_Recording = FALSE;
- MV_StartPlayback();
-#endif
}
@@ -3018,91 +2738,7 @@
)
{
-#ifdef PLAT_DOS
- unsigned flags;
- long time;
- int start;
- int status;
- int pos;
-
- if ( MV_SoundCard == UltraSound )
- {
- return( MV_Ok );
- }
-
- flags = DisableInterrupts();
- _enable();
-
- status = MV_Error;
- start = MV_MixPage;
- time = clock() + CLOCKS_PER_SEC * 2;
-
- while( clock() < time )
- {
- if ( MV_MixPage != start )
- {
- status = MV_Ok;
- }
- }
-
- RestoreInterrupts( flags );
-
- if ( status != MV_Ok )
- {
- // Just in case an error doesn't get reported
- MV_SetErrorCode( MV_DMAFailure );
-
- switch( MV_SoundCard )
- {
- case SoundBlaster :
- case Awe32 :
- pos = BLASTER_GetCurrentPos();
- break;
-
- case ProAudioSpectrum :
- case SoundMan16 :
- pos = PAS_GetCurrentPos();
- break;
-
- case SoundScape :
- pos = SOUNDSCAPE_GetCurrentPos();
- break;
-
- #ifndef SOUNDSOURCE_OFF
- case SoundSource :
- case TandySoundSource :
- MV_SetErrorCode( MV_SoundSourceFailure );
- pos = -1;
- break;
- #endif
-
- default :
- MV_SetErrorCode( MV_UnsupportedCard );
- pos = -2;
- break;
- }
-
- if ( pos > 0 )
- {
- MV_SetErrorCode( MV_IrqFailure );
- }
- else if ( pos == 0 )
- {
- if ( MV_Bits == 16 )
- {
- MV_SetErrorCode( MV_DMA16Failure );
- }
- else
- {
- MV_SetErrorCode( MV_DMAFailure );
- }
- }
- }
-
- return( status );
-#else
return MV_Ok;
-#endif
}
@@ -3192,72 +2828,11 @@
MV_SetReverseStereo( FALSE );
// Initialize the sound card
-#ifdef PLAT_DOS
- switch( soundcard )
- {
- case UltraSound :
- status = GUSWAVE_Init( 2 );
- if ( status != GUSWAVE_Ok )
- {
- //JIM
- MV_SetErrorCode( MV_BlasterError );
- }
- break;
-
- case SoundBlaster :
- case Awe32 :
- status = BLASTER_Init();
- if ( status != BLASTER_Ok )
- {
- MV_SetErrorCode( MV_BlasterError );
- }
-
- if ( ( BLASTER_Config.Type == SBPro ) ||
- ( BLASTER_Config.Type == SBPro2 ) )
- {
- MV_SetReverseStereo( TRUE );
- }
- break;
-
- case ProAudioSpectrum :
- case SoundMan16 :
- status = PAS_Init();
- if ( status != PAS_Ok )
- {
- MV_SetErrorCode( MV_PasError );
- }
- break;
-
- case SoundScape :
- status = SOUNDSCAPE_Init();
- if ( status != SOUNDSCAPE_Ok )
- {
- MV_SetErrorCode( MV_SoundScapeError );
- }
- break;
-
- #ifndef SOUNDSOURCE_OFF
- case SoundSource :
- case TandySoundSource :
- status = SS_Init( soundcard );
- if ( status != SS_Ok )
- {
- MV_SetErrorCode( MV_SoundSourceError );
- }
- break;
- #endif
-
- default :
- MV_SetErrorCode( MV_UnsupportedCard );
- break;
- }
-#else
status = DSL_Init();
if ( status != DSL_Ok )
{
MV_SetErrorCode( MV_BlasterError );
}
-#endif
if ( MV_ErrorCode != MV_Ok )
{
@@ -3290,14 +2865,6 @@
MV_SetMixMode( numchannels, samplebits );
MV_ReverbDelay = MV_BufferSize * 3;
-#ifdef PLAT_DOS
- // Make sure we don't cross a physical page
- if ( ( ( unsigned long )ptr & 0xffff ) + TotalBufferSize > 0x10000 )
- {
- ptr = ( char * )( ( ( unsigned long )ptr & 0xff0000 ) + 0x10000 );
- }
-#endif
-
MV_MixBuffer[ MV_NumberOfBuffers ] = ptr;
for( buffer = 0; buffer < MV_NumberOfBuffers; buffer++ )
{
@@ -3369,37 +2936,7 @@
MV_StopPlayback();
// Shutdown the sound card
-#ifdef PLAT_DOS
- switch( MV_SoundCard )
- {
- case UltraSound :
- GUSWAVE_Shutdown();
- break;
-
- case SoundBlaster :
- case Awe32 :
- BLASTER_Shutdown();
- break;
-
- case ProAudioSpectrum :
- case SoundMan16 :
- PAS_Shutdown();
- break;
-
- case SoundScape :
- SOUNDSCAPE_Shutdown();
- break;
-
- #ifndef SOUNDSOURCE_OFF
- case SoundSource :
- case TandySoundSource :
- SS_Shutdown();
- break;
- #endif
- }
-#else
DSL_Shutdown();
-#endif
RestoreInterrupts( flags );
@@ -3551,7 +3088,6 @@
return( MV_Ok );
}
-#ifndef PLAT_DOS
void ClearBuffer_DW( void *ptr, unsigned data, int length )
{
unsigned *d = (unsigned *)ptr;
@@ -3562,4 +3098,3 @@
d++;
}
}
-#endif
--- a/rott/audiolib/music.h
+++ b/rott/audiolib/music.h
@@ -33,9 +33,7 @@
#include "sndcards.h"
-#ifndef PLAT_DOS
#define cdecl
-#endif
extern int MUSIC_ErrorCode;
--- a/rott/audiolib/platform.h
+++ b/rott/audiolib/platform.h
@@ -8,8 +8,6 @@
#include "win32_compat.h"
#elif (defined PLATFORM_UNIX)
#include "unix_compat.h"
-#elif (defined PLATFORM_DOS)
-#include "doscmpat.h"
#else
#error Define your platform!
#endif
--- a/rott/audiolib/user.c
+++ b/rott/audiolib/user.c
@@ -28,10 +28,6 @@
(c) Copyright 1994 James R. Dose. All Rights Reserved.
**********************************************************************/
-#ifdef PLAT_DOS
-#include <dos.h>
-#endif
-
#include <string.h>
#include "user.h"
@@ -38,11 +34,6 @@
#define TRUE ( 1 == 1 )
#define FALSE ( !TRUE )
-#ifdef PLAT_DOS
-extern int _argc;
-extern char **_argv;
-#endif
-
/*---------------------------------------------------------------------
Function: USER_CheckParameter
@@ -55,35 +46,7 @@
)
{
-#ifdef PLAT_DOS
- int i;
- int found;
- char *ptr;
-
- found = FALSE;
- i = 1;
- while( i < _argc )
- {
- ptr = _argv[ i ];
-
- // Only check parameters preceded by - or /
- if ( ( *ptr == '-' ) || ( *ptr == '/' ) )
- {
- ptr++;
- if ( stricmp( parameter, ptr ) == 0 )
- {
- found = TRUE;
- break;
- }
- }
-
- i++;
- }
-
- return( found );
-#else
return FALSE;
-#endif
}
@@ -100,34 +63,5 @@
)
{
-#ifdef PLAT_DOS
- int i;
- char *text;
- char *ptr;
-
- text = NULL;
- i = 1;
- while( i < _argc )
- {
- ptr = _argv[ i ];
-
- // Only check parameters preceded by - or /
- if ( ( *ptr == '-' ) || ( *ptr == '/' ) )
- {
- ptr++;
- if ( stricmp( parameter, ptr ) == 0 )
- {
- i++;
- text = _argv[ i ];
- break;
- }
- }
-
- i++;
- }
-
- return( text );
-#else
return NULL;
-#endif
}
--- a/rott/cin_main.c
+++ b/rott/cin_main.c
@@ -233,7 +233,6 @@
ShutdownCinematic ();
}
-#ifndef DOS
int cin_iscale;
byte *cin_source;
int cin_texturemid;
@@ -275,5 +274,4 @@
buf += linewidth;
}
}
-#endif
--- a/rott/dukemusc.c
+++ b/rott/dukemusc.c
@@ -19,11 +19,6 @@
#include "buildengine/cache1d.h"
#endif
-#if PLATFORM_DOS
-// Use the original Apogee Sound System libs instead. --ryan.
-#error you probably should not compile this.
-#endif
-
#if (defined __WATCOMC__)
// This is probably out of date. --ryan.
#include "dukesnd_watcom.h"
@@ -59,16 +54,8 @@
static char warningMessage[80];
static char errorMessage[80];
-static int fx_initialized = 0;
-static int numChannels = MIX_CHANNELS;
-static void (*callback)(unsigned long);
-static int reverseStereo = 0;
-static int reverbDelay = 256;
-static int reverbLevel = 0;
-static int fastReverb = 0;
static FILE *debug_file = NULL;
static int initialized_debugging = 0;
-static int mixerIsStereo = 1;
// This gets called all over the place for information and debugging messages.
// If the user set the DUKESND_DEBUG environment variable, the messages
--- a/rott/fx_man.h
+++ b/rott/fx_man.h
@@ -57,17 +57,6 @@
FX_DPMI_Error
};
-#ifdef DOS
-enum fx_BLASTER_Types
-{
- fx_SB = 1,
- fx_SBPro = 2,
- fx_SB20 = 3,
- fx_SBPro2 = 4,
- fx_SB16 = 6
-};
-#endif
-
char *FX_ErrorString( int ErrorNumber );
int FX_SetupCard( int SoundCard, fx_device *device );
--- a/rott/isr.c
+++ b/rott/isr.c
@@ -50,8 +50,6 @@
// Global Variables
-static volatile boolean ExtendedKeyFlag;
-
volatile int Keyboard[MAXKEYBOARDSCAN];
volatile int KeyboardQueue[KEYQMAX];
volatile int Keystate[MAXKEYBOARDSCAN];
--- a/rott/isr.h
+++ b/rott/isr.h
@@ -51,20 +51,10 @@
extern volatile int Keyboard[MAXKEYBOARDSCAN]; // Keyboard status array
extern volatile int Keystate[MAXKEYBOARDSCAN]; // Keyboard state array
-#ifdef DOS
-extern volatile int ticcount; // Current ticcount (usually 70Hz)
-extern volatile int fasttics;
-
-#define GetTicCount() ticcount
-#define GetFastTics() fasttics
-
-#define SetFastTics(a) {fasttics=a;}
-#else
int GetTicCount (void);
int GetFastTics (void);
void SetFastTics(int);
-#endif
extern int KeyboardStarted;
--- a/rott/modexlib.c
+++ b/rott/modexlib.c
@@ -472,8 +472,6 @@
void EnableScreenStretch(void)
{
- int i,offset;
-
if (iGLOBAL_SCREENWIDTH <= 320 || StretchScreen) return;
if (unstretch_sdl_surface == NULL)
@@ -663,4 +661,4 @@
{
return renderer;
-}
\ No newline at end of file
+}
--- a/rott/modexlib.h
+++ b/rott/modexlib.h
@@ -46,69 +46,6 @@
//
//***************************************************************************
-#ifdef DOS
-#define SC_INDEX 0x3C4
-#define SC_DATA 0x3C5
-#define SC_RESET 0
-#define SC_CLOCK 1
-#define SC_MAPMASK 2
-#define SC_CHARMAP 3
-#define SC_MEMMODE 4
-
-#define CRTC_INDEX 0x3D4
-#define CRTC_DATA 0x3D5
-#define CRTC_H_TOTAL 0
-#define CRTC_H_DISPEND 1
-#define CRTC_H_BLANK 2
-#define CRTC_H_ENDBLANK 3
-#define CRTC_H_RETRACE 4
-#define CRTC_H_ENDRETRACE 5
-#define CRTC_V_TOTAL 6
-#define CRTC_OVERFLOW 7
-#define CRTC_ROWSCAN 8
-#define CRTC_MAXSCANLINE 9
-#define CRTC_CURSORSTART 10
-#define CRTC_CURSOREND 11
-#define CRTC_STARTHIGH 12
-#define CRTC_STARTLOW 13
-#define CRTC_CURSORHIGH 14
-#define CRTC_CURSORLOW 15
-#define CRTC_V_RETRACE 16
-#define CRTC_V_ENDRETRACE 17
-#define CRTC_V_DISPEND 18
-#define CRTC_OFFSET 19
-#define CRTC_UNDERLINE 20
-#define CRTC_V_BLANK 21
-#define CRTC_V_ENDBLANK 22
-#define CRTC_MODE 23
-#define CRTC_LINECOMPARE 24
-
-#define GC_INDEX 0x3CE
-#define GC_DATA 0x3CF
-#define GC_SETRESET 0
-#define GC_ENABLESETRESET 1
-#define GC_COLORCOMPARE 2
-#define GC_DATAROTATE 3
-#define GC_READMAP 4
-#define GC_MODE 5
-#define GC_MISCELLANEOUS 6
-#define GC_COLORDONTCARE 7
-#define GC_BITMASK 8
-
-#define ATR_INDEX 0x3c0
-#define ATR_MODE 16
-#define ATR_OVERSCAN 17
-#define ATR_COLORPLANEENABLE 18
-#define ATR_PELPAN 19
-#define ATR_COLORSELECT 20
-
-#define STATUS_REGISTER_1 0x3da
-
-#define PEL_WRITE_ADR 0x3c8
-#define PEL_READ_ADR 0x3c7
-#define PEL_DATA 0x3c9
-#endif
-
extern boolean StretchScreen;//bn�++
//extern int ylookup[MAXSCREENHEIGHT]; // Table of row offsets
@@ -167,14 +104,8 @@
modify exact [eax edx]
#endif
-#ifdef DOS
-void VGAMAPMASK (int x);
-void VGAREADMAP (int x);
-void VGAWRITEMAP(int x);
-#else
#define VGAMAPMASK(a)
#define VGAREADMAP(a)
#define VGAWRITEMAP(a)
-#endif
#endif
--- a/rott/rottnet.h
+++ b/rott/rottnet.h
@@ -23,13 +23,6 @@
#include "develop.h"
-#ifdef DOS
-#define PEL_WRITE_ADR 0x3c8
-#define PEL_DATA 0x3c9
-
-#define I_ColorBlack(r,g,b) {outp(PEL_WRITE_ADR,0);outp(PEL_DATA,r);outp(PEL_DATA,g);outp(PEL_DATA,b);};
-#endif
-
#define MAXNETNODES 14 // max computers in a game
#if ( SHAREWARE == 1 )
--- a/rott/rt_actor.c
+++ b/rott/rt_actor.c
@@ -1665,14 +1665,8 @@
void BlitzBatAttack(objtype*ob, objtype*target)
{
- objtype *temp,*temp2;
//objtype *grenadetarget;
- statobj_t*tstat;
- int dx,dy,dz,angle,momx,momy,op,magangle;
- int tilexlow,tilexhigh;
- int tileylow,tileyhigh;
- int radius =0x10000;
- int x,y;
+ int dx,dy,dz,angle,momx,momy,op;
if (target->flags & FL_DYING)
return;
--- a/rott/rt_build.c
+++ b/rott/rt_build.c
@@ -232,7 +232,6 @@
char * buf;
byte * shape = NULL;
int lastwall=-2;
- int plane;
int i;
shadingtable=colormap+(16<<8);
--- a/rott/rt_cfg.c
+++ b/rott/rt_cfg.c
@@ -317,12 +317,9 @@
)
{
- int status;
-
//
// no config file, so select default values
//
-#if !defined(PLATFORM_DOS)
// icculus' SDL_mixer driver looks like a soundscape to us
MusicMode = 6;
FXMode = 6;
@@ -330,27 +327,6 @@
NumChannels = 2;
NumBits = 16;
stereoreversed = false;
-#else
- MusicMode = 0;
- FXMode = 0;
- NumVoices = 4;
- NumChannels = 1;
- NumBits = 8;
- MidiAddress = 0x330;
- stereoreversed = false;
-
- status = FX_GetBlasterSettings( &blaster );
- if ( status == FX_Ok )
- {
- SBSettings.Type = blaster.Type;
- SBSettings.Address = blaster.Address;
- SBSettings.Interrupt = blaster.Interrupt;
- SBSettings.Dma8 = blaster.Dma8;
- SBSettings.Dma16 = blaster.Dma16;
- SBSettings.Midi = blaster.Midi;
- SBSettings.Emu = blaster.Emu;
- }
-#endif
}
--- a/rott/rt_cfg.h
+++ b/rott/rt_cfg.h
@@ -51,9 +51,6 @@
extern int NumVoices;
extern int NumChannels;
extern int NumBits;
-#ifdef DOS
-extern int MidiAddress;
-#endif
extern boolean stereoreversed;
extern boolean cybermanenabled;
extern boolean assassinenabled;
@@ -67,11 +64,7 @@
extern int fandc;
extern int blanktime;
extern char CodeName[9];
-#ifdef DOS
-extern char *ApogeePath;
-#else
extern char ApogeePath[256];
-#endif
extern int DefaultDifficulty;
extern int DefaultPlayerCharacter;
--- a/rott/rt_com.c
+++ b/rott/rt_com.c
@@ -59,8 +59,6 @@
#ifdef PLATFORM_UNIX
-static int sock = -1;
-
static void ReadUDPPacket()
{
rottcom->remotenode = -1;
@@ -83,7 +81,6 @@
void InitROTTNET (void)
{
int netarg;
- long netaddress;
if (ComStarted==true)
return;
--- a/rott/rt_def.h
+++ b/rott/rt_def.h
@@ -50,7 +50,7 @@
#error please define your platform.
#endif
-#if PLATFORM_DOS || PLATFORM_WIN32
+#if PLATFORM_WIN32
#define PATH_SEP_CHAR '\\'
#define PATH_SEP_STR "\\"
#elif PLATFORM_UNIX
@@ -115,7 +115,6 @@
#define max(a, b) (((a) > (b)) ? (a) : (b))
#endif
-#if !PLATFORM_DOS
#if PLATFORM_WIN32
#define strcmpi(x, y) stricmp(x, y)
#define _fstricmp(x, y) stricmp(x, y)
@@ -150,7 +149,6 @@
#define far
#define cdecl
-#endif
//***************************************************************************
//
--- a/rott/rt_draw.c
+++ b/rott/rt_draw.c
@@ -2443,7 +2443,6 @@
byte * shape2;
byte * buf;
patch_t *p;
- int pl;
whereami=18;
dx=(plane->x2-plane->x1+1);
@@ -2532,7 +2531,6 @@
transpatch_t *p;
patch_t *p2;
patch_t *p3;
- int pl;
boolean drawbottom,drawmiddle,drawtop;
int topoffset;
@@ -2969,9 +2967,6 @@
// int Xres = 320;//org
// int Yres = 200;//org
- int Xres = iGLOBAL_SCREENWIDTH;
- int Yres = iGLOBAL_SCREENHEIGHT;
-
iG_masked = masked;
--- a/rott/rt_floor.c
+++ b/rott/rt_floor.c
@@ -138,7 +138,6 @@
byte * src;
int dest;
- int plane;
int ang;
int angle;
int ofs;
@@ -482,7 +481,6 @@
void DrawHLine (int xleft, int xright, int yp)
{
- int plane;
byte * buf;
byte * dest;
int startxfrac;
@@ -489,7 +487,6 @@
int startyfrac;
int height;
// int length;
- int ofs;
if (yp==centery)
return;
--- a/rott/rt_game.c
+++ b/rott/rt_game.c
@@ -2704,7 +2704,6 @@
byte *dest1, *dest2, *dest3, mask;
byte *screen1, *screen2, *screen3;
int plane;
- int w;
dest = ylookup[y]+x;
@@ -4774,11 +4773,9 @@
char filename[MAX_PATH];
byte * altbuffer;
int size;
- int avail;
int savehandle;
int crc;
int i;
- char letter;
int myticcount;
if (num > 15 || num < 0)
@@ -4804,40 +4801,6 @@
GetPathFromEnvironment( filename, ApogeePath, loadname );
-
-#if PLATFORM_DOS
- {
- struct diskfree_t dfree;
- // Determine available disk space
- letter = toupper(filename[0]);
- if (
- (letter >= 'A') &&
- (letter <= 'Q')
- )
- {
- if (_dos_getdiskfree ((letter-'A'+1), &dfree))
- Error ("Error in _dos_getdiskfree call\n");
- }
- else
- {
- if (_dos_getdiskfree (0, &dfree))
- Error ("Error in _dos_getdiskfree call\n");
- }
-
- avail = (int) dfree.avail_clusters *
- dfree.bytes_per_sector *
- dfree.sectors_per_cluster;
- avail -= 8192;
-
- // Check to see if we have enough
-
- if (avail < MAXSAVEDGAMESIZE)
- {
- CP_DisplayMsg ("There is not enough\nspace on your disk\nto Save Game!\nPress any key to continue", 13);
- return (false);
- }
- }
-#endif
// Open the savegame file
--- a/rott/rt_main.c
+++ b/rott/rt_main.c
@@ -163,7 +163,6 @@
int main (int argc, char *argv[])
{
- char *macwd;
extern char *BATTMAPS;
_argc = argc;
@@ -1639,7 +1638,6 @@
#else
byte *txtscn;
#endif
- int k;
MU_FadeOut(200);
while (MU_FadeActive())
@@ -3385,4 +3383,4 @@
break;
#endif
}
-}
\ No newline at end of file
+}
--- a/rott/rt_main.h
+++ b/rott/rt_main.h
@@ -169,9 +169,6 @@
extern boolean MAPSTATS;
extern boolean TILESTATS;
extern boolean HUD;
-#ifdef DOS
-extern boolean SOUNDSETUP;
-#endif
extern char CWD[40];
--- a/rott/rt_map.c
+++ b/rott/rt_map.c
@@ -145,7 +145,6 @@
void DrawMap_Wall (int x, int y, int tile)
{
byte * buf;
- int p;
byte * b;
byte * source;
byte * s;
@@ -195,7 +194,6 @@
void DrawMap_SkyTile (int x, int y)
{
byte * buf;
- int p;
byte * b;
byte * s;
int i;
--- a/rott/rt_menu.c
+++ b/rott/rt_menu.c
@@ -313,9 +313,6 @@
static int handlewhich;
static int CSTactive = 0;
static boolean INFXSETUP = false;
-static int MaxVoices;
-static int MaxBits;
-static int MaxChannels;
//
// MENU CURSOR SHAPES
@@ -1552,7 +1549,7 @@
// SEE WHICH SAVE GAME FILES ARE AVAILABLE & READ STRING IN
//
memset (&SaveGamesAvail[0], 0, sizeof (SaveGamesAvail));
-#if PLATFORM_DOS || PLATFORM_WIN32
+#if PLATFORM_WIN32
GetPathFromEnvironment( filename, ApogeePath, SaveName );
#else
strncpy (filename, SaveName, 256);
@@ -1582,7 +1579,7 @@
}
else
MainMenu[loadgame].active = CP_Inactive;
-#if ((!PLATFORM_DOS) && (!PLATFORM_WIN32))
+#if !PLATFORM_WIN32
chdir (pathsave);
free (pathsave);
#endif
--- a/rott/rt_menu.h
+++ b/rott/rt_menu.h
@@ -205,9 +205,6 @@
int HandleMultiPageCustomMenu( char **names, int amount, int curpos, char *title, void ( *routine )( int w ), void ( *redrawfunc )( void ), boolean exitonselect );
int CP_LevelSelectionMenu ( void );
int CP_EnterCodeNameMenu ( void );
-#ifdef DOS
-void CP_SoundSetup( void );
-#endif
void QuickSaveGame (void);
void UndoQuickSaveGame (void);
void CP_CaptureTheTriadError( void );
--- a/rott/rt_scale.c
+++ b/rott/rt_scale.c
@@ -423,7 +423,6 @@
int x1,x2;
int tx;
int size;
- int plane;
whereami=32;
shape=W_CacheLumpNum(sprite->shapenum,PU_CACHE, Cvt_patch_t, 1);
@@ -575,7 +574,6 @@
byte * b;
int startfrac;
int startx;
- int plane;
whereami=33;
shape=W_CacheLumpNum(sprite->shapenum,PU_CACHE, Cvt_transpatch_t, 1);
@@ -656,7 +654,6 @@
int x1,x2;
int tx;
int size;
- int plane;
byte * b;
int startfrac;
int startx;
@@ -736,7 +733,6 @@
byte * b;
int startfrac;
int startx;
- int plane;
whereami=35;
SetPlayerLightLevel();
@@ -810,7 +806,6 @@
byte * b;
int startfrac;
int startx;
- int plane;
whereami=36;
shadingtable=colormap+(shade<<8);
@@ -896,7 +891,6 @@
byte * b;
int startfrac;
int startx;
- int plane;
int size;
whereami=38;
@@ -1172,7 +1166,6 @@
int cnt;
byte *shape;
patch_t *p;
- int plane;
byte * b;
int startx;
@@ -1287,7 +1280,6 @@
void R_DrawSolidColumn (int color, byte * buf)
{
int count;
- int frac, fracstep;
byte *dest;
count = dc_yh - dc_yl + 1;
--- a/rott/rt_spbal.c
+++ b/rott/rt_spbal.c
@@ -48,439 +48,9 @@
#include "scriplib.h"
#include <stdlib.h>
-#ifdef DOS
-#include <conio.h>
-#include <io.h>
-#include <fcntl.h>
-#include <dos.h>
-#include <mem.h>
-#endif
//MED
#include "memcheck.h"
-#ifdef DOS
-/* This file and associated .h files and Spaceball libraries:
- Copyright 1995 Spacetec IMC Corporation
-*/
-//static char c[]="Copyright 1995 Spacetec IMC Corporation";
-
-
-#define MSGN(x) (((x)>0)?1:-1)
-#define MABS(x) ((x<0)?(-x):(x))
-
-#define FF(n) FLOAT_TO_FIXED(n)
-
-#define MAX_WARPS 1 // maximum number of ranges in all warps in defaultWarps
-static WarpRange defaultWarps[][MAX_WARPS]= {
- {{ 0, 511, FF(0.00013)}}, // Tx
- {{ 0, 511, FF(0.0075 )}}, // Ty
- {{ 0, 511, FF(0.0005 )}}, // Tz
- {{150, 511, FF(0.0075 )}}, // Rx
- {{ 0, 511, FF(0.15 )}} // Ry
-};
-
-#undef FF
-
-
-static WarpRecord defaultRecords[]= {
- {"Tx", defaultWarps[0], 1},
- {"Ty", defaultWarps[1], 1},
- {"Tz", defaultWarps[2], 1},
- {"Rx", defaultWarps[3], 1},
- {"Ry", defaultWarps[4], 1},
-};
-
-WarpRecord *WarpTx, *WarpTy, *WarpTz, *WarpRx, *WarpRy;
-
-static char *SpaceBallConfigName = "spwrott.cfg";
-static char *ApogeePath = "APOGEECD";
-
-#define TURBO_LIMIT 1000000
-static int turbo_increment = 500000,
- turbo_count = 0,
- turboFire = false;
-
-
-// sbbuttons mask: 00FE DCBA
-
-#define BUTTON_A 0x01
-#define BUTTON_B 0x02
-#define BUTTON_C 0x04
-#define BUTTON_D 0x08
-#define BUTTON_E 0x10
-#define BUTTON_F 0x20
-
-// All possible button assignment masks (with defaults)
-static
-short turboFireMask = BUTTON_A,
- attackMask = BUTTON_B,
- useMask = BUTTON_C,
- mapMask = 0,
- swapWeaponMask = BUTTON_D,
- singleAxisMask = 0,
- planarMask = 0,
- aimMask = BUTTON_E,
- pauseMask = BUTTON_F;
-
-// Array exists just to make sure two tasks are not assigned to same button
-static short *masks[6]= {&turboFireMask, &attackMask, &useMask,
- &swapWeaponMask, &aimMask, &pauseMask
- };
-
-
-
-//******************************************************************************
-//
-// ShiftTowardZero ()
-//
-//******************************************************************************
-
-static short
-ShiftTowardZero(short n, short amount)
-{
- if (MABS(n) >= amount)
- return n-((n>0)?amount:-amount);
- else
- return 0;
-}
-
-
-//******************************************************************************
-//
-// SPW_SingleAxisFilter
-//
-// Zeroes all but the largest (in absolute value) element in a RawPacket
-//
-// returns: nothing
-//
-//******************************************************************************
-
-static void
-SPW_SingleAxisFilter(SpwRawData *p)
-{
- short *array = &(p->tx), // hope the data are in contigous locations
- *largest = array,
- newabs, large, array_length = 6;
-
- large = MABS( *array );
- while (--array_length > 0) {
- ++array;
- newabs = MABS(*array);
- if (newabs > large) {
- *largest = 0;
- large = newabs;
- largest = array;
- } else
- *array = 0;
- }
-
-} /* end of SPW_SingleAxisFilter */
-
-
-
-//******************************************************************************
-//
-// HandleSpaceBallMotion ()
-//
-//******************************************************************************
-
-static void HandleSpaceBallMotion (SpwRawData * npacket, int controlbuf[])
-{
-
- int strafeAngle;
- short tx, ty, tz, rx, ry;
- long sbtx, sbty, sbtz, sbrx, sbry;
- static short ButtonState;
-
- // If they are really cranking on it, limit them to one axis at a time
- if ((MABS(npacket->tx) > 450) ||
- (MABS(npacket->ty) > 450) ||
- (MABS(npacket->tz) > 450) ||
- (MABS(npacket->rx) > 450) ||
- (MABS(npacket->ry) > 450)) SPW_SingleAxisFilter(npacket);
-
- // Don't want to lose the low end that the sb null_region calc is losing
- tx=ShiftTowardZero(npacket->tx,30); // range now approximately +/- 0-480
- ty=ShiftTowardZero(npacket->ty,30); // range now approximately +/- 0-480
- tz=ShiftTowardZero(npacket->tz,50); // range now approximately +/- 0-460
- rx=ShiftTowardZero(npacket->rx,60); // range now approximately +/- 0-450
- ry=ShiftTowardZero(npacket->ry,60); // range now approximately +/- 0-450
-
- sbtx = SbFxConfigWarp( WarpTx, tx );
- sbty = SbFxConfigWarp( WarpTy, ty );
- sbtz = SbFxConfigWarp( WarpTz, tz );
- sbrx = SbFxConfigWarp( WarpRx, rx );
- sbry = SbFxConfigWarp( WarpRy, ry );
-
- strafeAngle = (player->angle - FINEANGLES/4)&(FINEANGLES-1);
-
- // check for turboFire
- if (turboFire)
- {
- if (MABS(turbo_count) > TURBO_LIMIT)
- turbo_increment *= -1;
- turbo_count += turbo_increment;
- sbry += turbo_increment;
- }
-
- controlbuf[0] += -(FixedMul (sbtz, viewcos))+
- FixedMul (sbtx, costable[strafeAngle]);
-
- controlbuf[1] += FixedMul (sbtz, viewsin) -
- FixedMul (sbtx, sintable[strafeAngle]);
-
- controlbuf[2] += sbry;
-
-
-
- // Handle looking up and down ^ flying
-
- ButtonState=npacket->buttons.cur;
-
- // should the user be running?
- buttonpoll[bt_run] = true; //((MABS(tx)+MABS(tz)+MABS(ry)) > 320) ? true : false ;
-
-
- // TY does flying if the user has acquired the ability to fly.
- // Currently this is ^'ed with looking up and down
- if (player->flags & FL_FLEET)
- {
- if (sbty != 0)
- {
- if (sbty > 0)
- buttonpoll[bt_lookup ] = true;
- else
- buttonpoll[bt_lookdown] = true;
- }
- }
- else // Lookup/down || aim up/down ?
- {
- if ( sbrx != 0 )
- {
- if (sbrx > 0)
- {
- if (ButtonState & aimMask)
- buttonpoll[bt_horizonup] = true;
- else
- buttonpoll[bt_lookup] = true;
- }
- else
- {
- if (ButtonState & aimMask)
- buttonpoll[bt_horizondown] = true;
- else
- buttonpoll[bt_lookdown] = true;
- }
- }
- }
-
-
-}
-
-//******************************************************************************
-//
-// PollSpaceBall ()
-//
-//******************************************************************************
-
-void PollSpaceBall (void)
-{
- SpwRawData rawpacket;
- short buttonsChanged;
- static short buttonState=0;
- static int reusePacketNTimes=0;
- static SpwRawData lastPacket;
-
- memset(&rawpacket,0,sizeof(rawpacket));
- if (SpwSimpleGet(0,&rawpacket))
- {
- lastPacket=rawpacket;
- reusePacketNTimes=6;
- }
- else if (reusePacketNTimes > 0)
- {
- rawpacket=lastPacket;
- --reusePacketNTimes;
- }
- else if (buttonState) // did not get a packet but a button is down
- rawpacket.buttons.cur=lastPacket.buttons.cur;
- else
- return;
-
-
- buttonsChanged=buttonState ^ rawpacket.buttons.cur;
- buttonState=rawpacket.buttons.cur;
-
- buttonpoll[bt_attack] = (turboFire = (buttonState & turboFireMask) ? true : false );
-
- if (buttonState & mapMask) DoMap(player->tilex,player->tiley);
- if (buttonState & useMask) buttonpoll[bt_use] = true;
- if (buttonState & attackMask) buttonpoll[bt_attack] = true;
- if (buttonState & swapWeaponMask) buttonpoll[bt_swapweapon] = true;
- if (buttonState & singleAxisMask) SPW_SingleAxisFilter(&rawpacket);
- if (buttonState & planarMask) rawpacket.ty=rawpacket.rz=rawpacket.rx=0;
- if (buttonState & pauseMask) PausePressed=true;
- if (!PausePressed) HandleSpaceBallMotion(&rawpacket,controlbuf);
-}
-
-
-//******************************************************************************
-//
-// OpenSpaceBall ()
-//
-//******************************************************************************
-
-void OpenSpaceBall (void)
-{
- int btn;
- char filename[ 128 ];
-
- if (SpwSimpleOpen(0))
- {
- SpwRawData sp;
-
- SpaceBallPresent = true;
- printf("Test the Spaceball by moving the ball and/or pressing buttons.\n");
- printf("Exit test by pressing any keyboard key...\n");
- while(!kbhit())
- {
-
- if (SpwSimpleGet(0,&sp))
- printf("\r# tx: %4d ty: %4d tz: %4d # rx: %4d ry: %4d rz: %4d # b: %1c-%1c-%1c-%1c-%1c-%1c",
- sp.tx, sp.ty, sp.tz,
- sp.rx, sp.ry, sp.rz,
- sp.buttons.cur & 1 ? 'A':' ', sp.buttons.cur & 2 ? 'B':' ',
- sp.buttons.cur & 4 ? 'C':' ', sp.buttons.cur & 8 ? 'D':' ',
- sp.buttons.cur & 16 ? 'E':' ', sp.buttons.cur & 32 ? 'F':' ');
- }
-
- // Check for configuration file, set defaults if none
-
- GetPathFromEnvironment( filename, ApogeePath, SpaceBallConfigName );
-
- SbConfigParse(filename);
-
- // Check for warp records
- WarpTx = SbConfigGetWarpRange("Tx");
- WarpTy = SbConfigGetWarpRange("Ty");
- WarpTz = SbConfigGetWarpRange("Tz");
- WarpRx = SbConfigGetWarpRange("Rx");
- WarpRy = SbConfigGetWarpRange("Ry");
-
- if(!WarpTx) WarpTx = &defaultRecords[0];
- if(!WarpTy) WarpTy = &defaultRecords[1];
- if(!WarpTz) WarpTz = &defaultRecords[2];
- if(!WarpRx) WarpRx = &defaultRecords[3];
- if(!WarpRy) WarpRy = &defaultRecords[4];
-
- // Check for button assignments
- if((btn=SbConfigGetButtonNumber("TURBO_FIRE"))!=-1)
- {
- if (masks[btn])
- *(masks[btn]) = 0; // zero out mask previously assigned to button
- masks[btn]= &turboFireMask;
- turboFireMask=(short)(1<<btn);
- }
-
- if((btn=SbConfigGetButtonNumber("ATTACK"))!=-1)
- {
- if (masks[btn])
- *masks[btn] = 0; // zero out mask previously assigned to button
- masks[btn]= &attackMask;
- attackMask=(short)(1<<btn);
- }
-
- if((btn=SbConfigGetButtonNumber("USE"))!=-1)
- {
- if (masks[btn])
- *masks[btn] = 0; // zero out mask previously assigned to button
- masks[btn]= &useMask;
- useMask=(short)(1<<btn);
- }
-
- if((btn=SbConfigGetButtonNumber("MAP"))!=-1)
- {
- if (masks[btn])
- *masks[btn] = 0; // zero out mask previously assigned to button
- masks[btn]= &mapMask;
- mapMask=(short)(1<<btn);
- }
-
- if((btn=SbConfigGetButtonNumber("SWAP_WEAPON"))!=-1)
- {
- if (masks[btn])
- *masks[btn] = 0; // zero out mask previously assigned to button
- masks[btn]= &swapWeaponMask;
- swapWeaponMask=(short)(1<<btn);
- }
-
- if((btn=SbConfigGetButtonNumber("SINGLE_AXIS_FILTER"))!=-1)
- {
- if (masks[btn])
- *masks[btn] = 0; // zero out mask previously assigned to button
- masks[btn]= &singleAxisMask;
- singleAxisMask=(short)(1<<btn);
- }
-
- if((btn=SbConfigGetButtonNumber("PLANAR_FILTER"))!=-1)
- {
- if (masks[btn])
- *masks[btn] = 0; // zero out mask previously assigned to button
- masks[btn]= &planarMask;
- planarMask=(short)(1<<btn);
- }
-
- if((btn=SbConfigGetButtonNumber("AIM"))!=-1)
- {
- if (masks[btn])
- *masks[btn] = 0; // zero out mask previously assigned to button
- masks[btn]= &aimMask;
- aimMask=(short)(1<<btn);
- }
-
- if((btn=SbConfigGetButtonNumber("PAUSE"))!=-1)
- {
- if (masks[btn])
- *masks[btn] = 0; // zero out mask previously assigned to button
- masks[btn]= &pauseMask;
- pauseMask=(short)(1<<btn);
- }
- }
- else
- {
- SpaceBallPresent = false;
- }
-}
-
-//******************************************************************************
-//
-// CloseSpaceBall ()
-//
-//******************************************************************************
-
-void CloseSpaceBall (void)
-{
- if (SpaceBallPresent)
- {
- SpwSimpleClose(0);
- }
-}
-
-//******************************************************************************
-//
-// GetSpaceBallButtons ()
-//
-//******************************************************************************
-
-unsigned GetSpaceBallButtons (void)
-{
- SpwRawData sp;
-
- return ((SpwSimpleGet(0,&sp) & SPW_BUTTON_DOWN));
-}
-
-#else
-
/* This isn't of much use in Linux. */
void PollSpaceBall (void)
@@ -504,4 +74,3 @@
return 0;
}
-#endif
--- a/rott/rt_str.c
+++ b/rott/rt_str.c
@@ -171,7 +171,7 @@
byte pix;
int width,step,height,ht;
byte *source, *dest, *origdest;
- int ch,mask;
+ int ch;
ht = CurrentFont->height;
dest = origdest = (byte *)(bufferofs+ylookup[py]+px);
--- a/rott/rt_swift.c
+++ b/rott/rt_swift.c
@@ -37,359 +37,6 @@
#include "memcheck.h"
-#ifdef DOS
-
-//****************************************************************************
-//
-// SWIFT_Initialize ()
-//
-// Test for presence of SWIFT extensions and SWIFT device.
-// Returns 1 (TRUE) if SWIFT features are available, 0 otherwise.
-// Remember to call SWIFT_Terminate() if SWIFT_Initialize succeeds!
-//
-//****************************************************************************
-
-int SWIFT_Initialize (void)
-{
- SWIFT_StaticData sdBuf;
- int fSwift = 0;
-
- if (fActive) // SWIFT extensions already active
- {
-#ifdef DEGUB
- SoftError( "SWIFT_Initialize: Already active.\n");
- SoftError( "SWIFT_Initialize: returns TRUE\n");
-#endif
- return (1);
- }
-
- nAttached = SWIFT_DEV_NONE;
-
-
- if (_dos_getvect(0x33) == NULL) // No mouse driver loaded
- {
-#ifdef DBUG
- SoftError( "SWIFT_Initialize: No mouse driver loaded.\n");
- SoftError( "SWIFT_Initialize: returns FALSE\n");
-#endif
- return (0);
- }
-
-
- // Reset the mouse and driver
- AX (regs) = 0;
- int386( 0x33, ®s, ®s);
-
- if (AX (regs) == 0)
- { // no mouse
-#ifdef DBUG
- SoftError( "SWIFT_Initialize: No pointing device attached.\n");
- SoftError( "SWIFT_Initialize: returns FALSE\n");
-#endif
- return (0);
- }
-
-#ifdef DBUG
- AX (regs) = 36; // Get Mouse Information
- BX (regs) = 0xffff;
- CX (regs) = 0xffff;
- DX (regs) = 0xffff;
- int386 (0x33, ®s, ®s);
- SoftError( "SWIFT_Initialize: driver version %d.%02d\n", regs.h.bh, regs.h.bl);
- SoftError( "SWIFT_Initialize: %s mouse using IRQ %d\n",
- (regs.h.ch==1) ? "bus" :
- (regs.h.ch==2) ? "serial" :
- (regs.h.ch==3) ? "inport" :
- (regs.h.ch==4) ? "PS/2" :
- "unknown", regs.h.cl);
-#endif
-
-
- // allocate a DOS real-mode buffer
- pdosmem = allocDOS(DOSMEMSIZE, &segment, &selector);
- if (!pdosmem)
- {
-#ifdef DBUG
- SoftError( "SWIFT_Initialize: DOS Alloc failed!\n");
- SoftError( "SWIFT_Initialize: returns FALSE\n");
-#endif
- return (0);
- }
-
-//
-// SWIFT device supported and attached
-//
- if (SWIFT_GetStaticDeviceInfo (&sdBuf))
- fSwift = 1;
-
-
- if (!fSwift)
- { // SWIFT functions not present
-#ifdef DBUG
- SoftError( "SWIFT_Initialize: no SWIFT support in mouse driver.\n");
-#endif
- }
- else if (sdBuf.deviceType == SWIFT_DEV_NONE)
- {
-#ifdef DBUG
- SoftError( "SWIFT_Initialize: no SWIFT device connected.\n");
-#endif
- }
- else
- {
- nAttached = sdBuf.deviceType;
-#ifdef DBUG
- SoftError( "SWIFT_Initialize: ");
-
- switch (nAttached)
- {
- case SWIFT_DEV_CYBERMAN:
- SoftError( "CyberMan %d.%02d connected.\n",
- sdBuf.majorVersion, sdBuf.minorVersion);
- break;
-
- default:
- SoftError( "Unknown SWIFT device (type %d) connected.\n",
- nAttached);
- break;
- }
-#endif
- fActive = 1;
- }
-
- if (!fActive)
- { // activation of SWIFT module failed for some reason
- if (pdosmem)
- { // if DOS buffer was allocated, free it
- freeDOS(selector);
- pdosmem = 0;
- }
- }
-
-#ifdef DBUG
- SoftError( "SWIFT_Initialize: returns %s.\n", (fActive ? "TRUE" : "FALSE"));
-#endif
- return fActive;
-}
-
-
-
-//****************************************************************************
-//
-// SWIFT_Terminate ()
-//
-// Free resources required for SWIFT support. If SWIFT_Initialize has
-// not been called, or returned FALSE, this function does nothing.
-// SWIFT_Terminate should always be called at some time after a call to
-// SWIFT_Initialize has returned TRUE.
-//
-//****************************************************************************
-
-void SWIFT_Terminate (void)
-{
-#ifdef DBUG
- SoftError( "SWIFT_Terminate called.\n");
-#endif
-
- if (fActive)
- {
- // free DOS buffer
- if (pdosmem)
- {
- freeDOS(selector);
- pdosmem = 0;
- }
-
- fActive = 0;
- }
-}
-
-
-//****************************************************************************
-//
-// SWIFT_GetAttachedDevice ()
-//
-// Returns the device-type code for the attached SWIFT device, if any.
-//
-//****************************************************************************
-
-int SWIFT_GetAttachedDevice (void)
-{
- return (nAttached);
-}
-
-
-
-//****************************************************************************
-//
-// SWIFT_GetStaticDeviceInfo ()
-//
-// Reads static device data.
-//
-//****************************************************************************
-
-int SWIFT_GetStaticDeviceInfo (SWIFT_StaticData far *psd)
-{
- memset (&RMI, 0, sizeof (RMI));
- RMI.ax = 0x53C1; // SWIFT: Get Static Device Data
- RMI.es = segment; // DOS buffer real-mode segment
- RMI.dx = 0; // " " " " offset
- MouseInt (&RMI); // get data into DOS buffer
-
- *psd = *(SWIFT_StaticData *)pdosmem; // then copy into caller's buffer
- return (RMI.ax == 1); // return success
-}
-
-
-
-//****************************************************************************
-//
-// SWIFT_Get3DStatus ()
-//
-// Read the current input state of the device.
-//
-//****************************************************************************
-
-
-void SWIFT_Get3DStatus (SWIFT_3DStatus far *pstat)
-{
-#ifdef DBUG
- if (!fActive)
- {
- SoftError( "SWIFT_Get3DStatus: SWIFT module not active!\n");
- }
-#endif
-
- memset (&RMI, 0, sizeof (RMI));
- RMI.ax = 0x5301;
- RMI.es = segment;
- RMI.dx = 0;
- MouseInt(&RMI);
- *pstat = *(SWIFT_3DStatus *)pdosmem;
-}
-
-
-
-
-//****************************************************************************
-//
-// SWIFT_TactileFeedback ()
-//
-// Generates tactile feedback to user.
-// d = duration of tactile burst, in milliseconds.
-// on = motor on-time per cycle, in milliseconds.
-// off = motor off-time per cycle, in milliseconds.
-//
-//****************************************************************************
-
-void SWIFT_TactileFeedback (int d, int on, int off)
-{
- // Use DPMI call 300h to issue mouse interrupt
- memset (&RMI, 0, sizeof(RMI));
- RMI.ax = 0x5330; // SWIFT: Get Position & Buttons
- RMI.bx = (on / 5) << 8 + (off / 5);
- RMI.cx = d / 40;
- MouseInt (&RMI);
-
-#ifdef DBUG
- SoftError( "SWIFT_TactileFeedback (dur=%d ms, on=%d ms, off=%d ms)\n",
- d / 40 * 40, on/5*5, off/5*5);
-#endif
-}
-
-
-
-//****************************************************************************
-//
-// SWIFT_GetDynamicDeviceData ()
-//
-// Returns Dynamic Device Data word - see SDD_* above
-//
-//****************************************************************************
-
-unsigned SWIFT_GetDynamicDeviceData (void)
-{
- memset (&RMI, 0, sizeof(RMI));
- RMI.ax = 0x53C2; // SWIFT: Get Dynamic Device Data
- MouseInt (&RMI);
- return ((unsigned)RMI.ax);
-}
-
-
-//****************************************************************************
-//
-// MouseInt ()
-//
-// Generate a call to the mouse driver (interrupt 33h) in real mode,
-// using the DPMI function 'Simulate Real-Mode Interrupt'.
-//
-//****************************************************************************
-
-void MouseInt (struct rminfo *prmi)
-{
- memset (&sregs, 0, sizeof (sregs));
- AX (regs) = 0x0300; // DPMI: simulate interrupt
- BX (regs) = MOUSE_INT;
- CX (regs) = 0;
- DI (regs) = FP_OFF (prmi);
- sregs.es = FP_SEG (prmi);
- int386x( DPMI_INT, ®s, ®s, &sregs );
-}
-
-
-//****************************************************************************
-//
-// freeDOS ()
-//
-// Release real-mode DOS memory block via DPMI
-//
-//****************************************************************************
-
-void freeDOS (short sel)
-{
- AX(regs) = 0x0101; // DPMI free DOS memory
- DX(regs) = sel;
-
- int386( DPMI_INT, ®s, ®s);
-}
-
-
-//****************************************************************************
-//
-// allocDOS ()
-//
-// Allocate a real-mode DOS memory block via DPMI
-//
-//****************************************************************************
-
-void far *allocDOS (unsigned nbytes, short *pseg, short *psel)
-{
- unsigned npara = (nbytes + 15) / 16;
- void far *pprot;
- pprot = NULL;
- *pseg = 0; // assume will fail
- *psel = 0;
-
- // DPMI call 100h allocates DOS memory
- segread (&sregs);
- AX (regs) = 0x0100; // DPMI: Allocate DOS Memory
- BX (regs) = npara; // number of paragraphs to alloc
- int386( DPMI_INT, ®s, ®s);
-
- if (regs.w.cflag == 0)
- {
- *pseg = AX (regs); // the real-mode segment
- *psel = DX (regs); // equivalent protected-mode selector
- // pprot is the protected mode address of the same allocated block.
- // The Rational extender maps the 1 MB physical DOS memory into
- // the bottom of our virtual address space.
- pprot = (void far *) ((unsigned)*pseg << 4);
- }
- return pprot;
-}
-
-#else
-
/* This isn't of much use in Linux. */
int SWIFT_Initialize (void)
@@ -421,4 +68,3 @@
return 0;
}
-#endif
--- a/rott/rt_util.c
+++ b/rott/rt_util.c
@@ -316,15 +316,10 @@
{
char msgbuf[300];
va_list argptr;
- char i;
int size;
char * sptr;
- char buf[30];
- int handle;
- int x,y;
int level;
static int inerror = 0;
- char filename[ 128 ];
inerror++;
@@ -820,10 +815,7 @@
}
-#if PLATFORM_DOS
-/* no-op. */
-
-#elif PLATFORM_WIN32
+#if PLATFORM_WIN32
int _dos_findfirst(char *filename, int x, struct find_t *f)
{
long rc = _findfirst(filename, &f->data);
@@ -941,7 +933,6 @@
#endif
-#if !PLATFORM_DOS
void _dos_getdate(struct dosdate_t *date)
{
time_t curtime = time(NULL);
@@ -960,7 +951,6 @@
date->dayofweek = tm->tm_wday + 1;
}
}
-#endif
void GetPathFromEnvironment( char *fullname, const char *envname, const char *filename )
--- a/rott/rt_util.h
+++ b/rott/rt_util.h
@@ -127,14 +127,11 @@
int _dos_findfirst(char *filename, int x, struct find_t *f);
int _dos_findnext(struct find_t *f);
-#elif PLATFORM_DOS
-/* no-op */
#else
#error please define for your platform.
#endif
-#if !PLATFORM_DOS
struct dosdate_t
{
unsigned char day;
@@ -144,7 +141,6 @@
};
void _dos_getdate(struct dosdate_t *date);
-#endif
#if (SOFTERROR==1)
@@ -192,11 +188,7 @@
#endif
-#ifdef DOS
-void my_outp(int port, int data);
-#else
#define my_outp(a,b)
-#endif
#ifdef __WATCOMC__
#pragma aux my_outp = \
--- a/rott/rt_vid.c
+++ b/rott/rt_vid.c
@@ -60,18 +60,6 @@
//******************************************************************************
//
-// LOCALS
-//
-//******************************************************************************
-
-static byte pixmasks[4] = {1,2,4,8};
-static byte leftmasks[4] = {15,14,12,8};
-static byte rightmasks[4] = {1,3,7,15};
-
-
-
-//******************************************************************************
-//
// VL_MemToScreen ()
//
//******************************************************************************
@@ -176,7 +164,6 @@
int sourcey;
int sourcewidth;
int sourceheight;
- int mask;
int plane;
int planesize;
byte *start;
--- a/rott/sndcards.h
+++ b/rott/sndcards.h
@@ -38,22 +38,8 @@
{
// ASS_NoSound,
SoundBlaster,
-#ifdef DOS
- ProAudioSpectrum,
- SoundMan16,
- Adlib,
- GenMidi,
- SoundCanvas,
- Awe32,
- WaveBlaster,
-#endif
SoundScape,
UltraSound,
-#ifdef DOS
- SoundSource,
- TandySoundSource,
- PC,
-#endif
NumSoundCards
} soundcardnames;
--- a/rott/splib.h
+++ b/rott/splib.h
@@ -32,12 +32,6 @@
extern "C" {
#endif
-#if defined(_MSC_VER) || defined(__BORLANDC__)
-# if PLATFORM_DOS
-# define REALMODE
-# endif
-#endif
-
#if defined(REALMODE)
#define FAR __far
#else
--- a/rott/w_wad.c
+++ b/rott/w_wad.c
@@ -101,11 +101,7 @@
// read the entire file in
// FIXME: shared opens
-#ifdef PLATFORM_DOS
- if ( (handle = open (filename,O_RDWR | O_BINARY)) == -1)
-#else
if ( (handle = open (filename,O_RDONLY | O_BINARY)) == -1)
-#endif
return;
startlump = numlumps;
@@ -174,25 +170,7 @@
void W_CheckWADIntegrity ( void )
{
- int crc;
-
// CRC disabled because it's not very useful these days
-
-#ifdef DOS
- crc = CalculateCRC ((byte *)lumpinfo, numlumps*sizeof(lumpinfo_t) );
-
- if (crc != WADCHECKSUM)
- {
- printf("==============================================================================\n");
- printf("ATTENTION: This version of ROTT has been modified. If you would like to get\n");
- printf("a copy of the original game, call 1-800-APOGEE1 or run ROTTHELP.EXE.\n");
- printf(" You will not receive technical support for this modified version.\n");
-// printf(" Press any key to continue\n");
- printf("==============================================================================\n");
-// printf("crc=%ld\n",crc);
-// getch();
- }
-#endif
}
@@ -242,9 +220,6 @@
#if (DATACORRUPTIONTEST == 1)
lumpcheck=SafeMalloc(numlumps);
memset(lumpcheck,255,numlumps);
-#endif
-#ifdef DOS
- if (!SOUNDSETUP)
#endif
W_CheckWADIntegrity ();
}
--- a/rott/z_zone.c
+++ b/rott/z_zone.c
@@ -63,19 +63,6 @@
static memzone_t *mainzone;
static memzone_t *levelzone;
static int levelzonesize=LEVELZONESIZE;
-static struct meminfo
-{
- unsigned LargestBlockAvail;
- unsigned MaxUnlockedPage;
- unsigned LargestLockablePage;
- unsigned LinAddrSpace;
- unsigned NumFreePagesAvail;
- unsigned NumPhysicalPagesFree;
- unsigned TotalPhysicalPages;
- unsigned FreeLinAddrSpace;
- unsigned SizeOfPageFile;
- unsigned Reserved[3];
-} MemInfo;
/*
========================