Files
CydandClaude Fable 5 fdd9ac9d97 Initial import: Tesla Release 4.10 (Tesla:BattleTech & Tesla:Red Planet)
Archival snapshot of the Virtual World Entertainment Tesla cockpit
software, 1994-1996: MUNGA engine and L4 pod layer source (Borland
C++ 5.0), BT/RP game code, and game content (models, audio, maps,
gauges, Division renderer data). Includes third-party libraries:
Division dVS/DPL graphics, HMI SOS audio, WATTCP networking.

Files are preserved byte-for-byte (.gitattributes disables all
line-ending conversion). README.md documents the layout, target
hardware, and toolchain.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 13:21:58 -05:00

195 lines
5.5 KiB
C++

//===========================================================================//
// File: icom.hpp //
// Project: MUNGA Brick: Controls //
// Contents: Interface specification for intercom class //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 08/14/95 CPB Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1995, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#if !defined(L4ICOM_HPP)
# define L4ICOM_HPP
# if !defined(ICOM_HPP)
# include <icom.hpp>
# endif
# if !defined(L4CTRL_HPP)
# include <l4ctrl.hpp>
# endif
# if !defined(TIME_HPP)
# include <time.hpp>
# endif
//##########################################################################
//############################ L4Icom ################################
//##########################################################################
class L4Icom:
public Icom
{
friend class L4IcomManager;
public:
L4Icom(HostID host_id, int channel_offset);
~L4Icom(); // base destructor is virtual
Logical
TestInstance() const;
//--------------------------------------------------
// Channel offset accessor
//--------------------------------------------------
int
GetChannelOffset()
{
Check(this);
return channelOffset;
}
//--------------------------------------------------
// public data
//--------------------------------------------------
ControlsButton
pttButton;
enum
{
numberOfChannels=7
};
protected:
//--------------------------------------------------
// These methods are used to locally set the value
// for the channel, PTT, and PA status.
//
// The difference between these methods and the
// public methods defined in the base class is that
// these methods are called by both the base class
// public routines and the event receiver to actually
// set the values involved. Making them virtual
// allows derived classes to be notified of changes
// (but also requires that all derived classes
// explicitly call the overridden methods!)
//--------------------------------------------------
void
SetChannelValue(int new_channel); // base method is virtual
void
SetPTTStatusValue(Logical new_ptt); // base method is virtual
void
SetPACaptiveValue(Logical new_pa); // base method is virtual
//--------------------------------------------------
// Recalibrate hardware
//--------------------------------------------------
void
Recalibrate();
//--------------------------------------------------
// Hardware control method
//--------------------------------------------------
void
Update(Scalar delta_t);
private:
Logical
WaitedLongEnough(Scalar how_long);
void
IncrementChannel();
void
DecrementChannel();
void
ChannelStatusUpdate();
void
ChannelSelectState(Logical state);
//--------------------------------------------------
// Protected data
//--------------------------------------------------
protected:
LBE4ControlsManager
*controlsManager;
ControlsButton
homeSensor,
channelButton;
Scalar
timeAccumulator;
int
hardwareChannel,
previousChannel,
channelOffset,
seekCount;
int
previousPTTStatus;
Logical
channelSelectEnabled,
seekRequired;
enum
{
disabled = -2,
failed = -1,
seek40,
offChannel,
reachedChannel,
onChannel,
}
state;
};
//##########################################################################
//######################## L4IcomManager #############################
//##########################################################################
class L4IcomManager:
public IcomManager
{
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Shared data Support
//
public:
static Derivation ClassDerivations;
static SharedData DefaultData;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Construction and Destruction
//
public:
L4IcomManager(
SharedData &shared_data=DefaultData
);
~L4IcomManager(); // base destructor is virtual
Logical
TestInstance() const;
L4Icom *
MakeIcom(HostID host_id, int unit_number=0);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// LoadMission, Shutdown methods
// ...these are declared virtual in ICOM.HPP and must chain back to
// the previous methods.
//
public:
void
LoadMission(Mission *mission);
void
Shutdown();
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Periodic update function
//
void
Execute();
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// protected data
//
protected:
Time
previousUpdateTime;
SlotOf<L4Icom*>
localIcom;
};
#endif