Remove some old compatibility cruft

This commit is contained in:
simon.kagstrom 2010-03-13 09:46:57 +00:00
parent 906887f85d
commit a7e9b707d0
3 changed files with 3 additions and 231 deletions

View File

@ -1,6 +1,8 @@
TODO: Add ability to select files to load from disks in
a menu
c64-network.org, v2:
* Automatically save game info on screenshot timeout
* Fix multiple bindings to the same key
* Fix joystick input on the virtual keyboard

110
Src/C64.h
View File

@ -20,24 +20,8 @@
#ifndef _C64_H
#define _C64_H
#if defined(HAVE_SDL)
#include "Network.h"
#include "Prefs.h"
#endif
#ifdef __BEOS__
#include <KernelKit.h>
#endif
#ifdef AMIGA
#include <devices/timer.h>
#include <devices/gameport.h>
#include <devices/inputevent.h>
#endif
#ifdef __riscos__
#include "ROlib.h"
#endif
/* Network connection type */
enum
@ -61,12 +45,6 @@ const size_t DRIVE_ROM_SIZE = 0x4000;
// false: Frodo, true: FrodoSC
extern bool IsFrodoSC;
#ifdef GEKKO
#define PREFS_PATH "/apps/frodo/frodorc"
#elif defined(HAVE_SDL)
#define PREFS_PATH "/home/ska/.frodorc"
#endif
class Prefs;
class C64Display;
class MOS6510;
@ -177,43 +155,7 @@ private:
uint8 orig_kernal_1d84, // Original contents of kernal locations $1d84 and $1d85
orig_kernal_1d85; // (for undoing the Fast Reset patch)
#ifdef __BEOS__
public:
void SoundSync(void);
private:
static long thread_invoc(void *obj);
void open_close_joystick(int port, int oldjoy, int newjoy);
void *joy[2]; // Joystick objects (BJoystick or BDigitalPort)
bool joy_geek_port[2]; // Flag: joystick on GeekPort?
thread_id the_thread;
sem_id pause_sem;
sem_id sound_sync_sem;
bigtime_t start_time;
#endif
#ifdef AMIGA
struct MsgPort *timer_port; // For speed limiter
struct timerequest *timer_io;
struct timeval start_time;
struct MsgPort *game_port; // For joystick
struct IOStdReq *game_io;
struct GamePortTrigger game_trigger;
struct InputEvent game_event;
UBYTE joy_state; // Current state of joystick
bool game_open, port_allocated; // Flags: gameport.device opened, game port allocated
#endif
#ifdef __unix
double speed_index;
public:
CmdPipe *gui;
#elif defined(GEKKO)
public:
double speed_index;
#endif
#ifdef HAVE_SDL
char server_hostname[255];
int server_port;
int network_connection_type;
@ -233,58 +175,6 @@ public:
void startFakeKeySequence(const char *str);
void run_fake_key_sequence();
void pushKeyCode(int kc, bool up);
#endif
#ifdef WIN32
private:
void CheckTimerChange();
void StartTimer();
void StopTimer();
static void CALLBACK StaticTimeProc(UINT uID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2);
void TimeProc(UINT id);
#ifdef FRODO_SC
void EmulateCyclesWith1541();
void EmulateCyclesWithout1541();
#endif
DWORD ref_time; // when frame count was reset
int skipped_frames; // number of skipped frames
int timer_every; // frequency of timer in frames
HANDLE timer_semaphore; // Timer semaphore for synch
MMRESULT timer_id; // Timer identifier
int frame; // current frame number
uint8 joy_state; // Current state of joystick
bool state_change;
#endif
#ifdef __riscos__
public:
void RequestSnapshot(void);
bool LoadOldSnapshot(FILE *f);
void LoadSystemConfig(const char *filename); // loads timing vals and keyboard joys
void SaveSystemConfig(const char *filename); // saves timing vals and keyboard joys
void ReadTimings(int *poll_after, int *speed_after, int *sound_after);
void WriteTimings(int poll_after, int speed_after, int sound_after);
WIMP *TheWIMP;
int PollAfter; // centiseconds before polling
int SpeedAfter; // centiseconds before updating speedometer
int PollSoundAfter; // *rasterlines* after which DigitalRenderer is polled
int HostVolume; // sound volume of host machine
private:
bool make_a_snapshot;
uint8 joykey2; // two keyboard joysticks possible here
uint8 joystate[2]; // Joystick state
bool Poll; // TRUE if polling should take place
int LastPoll, LastFrame, LastSpeed; // time of last poll / last frame / speedom (cs)
int FramesSince;
int laststate; // last keyboard state (-> scroll lock)
int lastptr; // last mouse pointer shape
bool SingleTasking;
#endif
};

View File

@ -32,32 +32,6 @@
#include "Prefs.h"
#include "Network.h"
#ifdef __BEOS__
#include <media/SoundPlayer.h>
#endif
#ifdef AMIGA
#include <exec/types.h>
#include <utility/hooks.h>
#include <devices/ahi.h>
#define USE_FIXPOINT_MATHS
#define FIXPOINT_PREC 16 // number of fractional bits used in fixpoint representation
#define PRECOMPUTE_RESONANCE
#define ldSINTAB 9 // size of sinus table (0 to 90 degrees)
#endif
#ifdef SUN
extern "C" {
#include <sys/audioio.h>
}
#endif
#ifdef __hpux
extern "C" {
#include <sys/audio.h>
}
#endif
#ifdef __mac__
#include <Sound.h>
#define M_PI 3.14159265358979323846
@ -67,17 +41,6 @@ extern "C" {
class DigitalPlayer;
#endif
#ifdef __riscos__
#include "ROLib.h"
# ifndef M_PI
# define M_PI 3.14159265358979323846
# endif
#define USE_FIXPOINT_MATHS
#define FIXPOINT_PREC 16 // number of fractional bits used in fixpoint representation
#define PRECOMPUTE_RESONANCE
#define ldSINTAB 9 // size of sinus table (0 to 90 degrees)
#endif
#ifdef USE_FIXPOINT_MATHS
#include "FixPoint.h"
@ -277,11 +240,7 @@ void MOS6581::SetState(MOS6581State *ss)
** Renderer for digital SID emulation (SIDTYPE_DIGITAL)
**/
#if defined(AMIGA) || defined(__riscos__)
const uint32 SAMPLE_FREQ = 22050; // Sample output frequency in Hz
#else
const uint32 SAMPLE_FREQ = 32000; // Sample output frequency in Hz
#endif
const uint32 SID_FREQ = 985248; // SID frequency in Hz
const uint32 CALC_FREQ = 50; // Frequency at which calc_buffer is called in Hz (should be 50Hz)
const uint32 SID_CYCLES = SID_FREQ/SAMPLE_FREQ; // # of SID clocks per sample frame
@ -355,11 +314,7 @@ struct DRVoice {
// Renderer class
class DigitalRenderer : public SIDRenderer {
public:
#if defined(__BEOS__) || defined(__riscos__)
DigitalRenderer(C64 *c64);
#else
DigitalRenderer();
#endif
virtual ~DigitalRenderer();
virtual void Reset(void);
@ -373,11 +328,7 @@ public:
private:
void init_sound(void);
void calc_filter(void);
#ifdef __riscos__
void calc_buffer(uint8 *buf, long count);
#else
void calc_buffer(int16 *buf, long count);
#endif
bool ready; // Flag: Renderer has initialized and is ready
uint8 volume; // Master volume
@ -418,49 +369,11 @@ private:
uint8 sample_buf[SAMPLE_BUF_SIZE]; // Buffer for sampled voice
int sample_in_ptr; // Index in sample_buf for writing
#ifdef __BEOS__
static void buffer_proc(void *cookie, void *buffer, size_t size, const media_raw_audio_format &format);
C64 *the_c64; // Pointer to C64 object
BSoundPlayer *the_player; // Pointer to sound player
bool player_stopped; // Flag: player stopped
#endif
#ifdef AMIGA
static void sub_invoc(void); // Sound sub-process
void sub_func(void);
struct Process *sound_process;
int quit_sig, pause_sig,
resume_sig, ahi_sig; // Sub-process signals
struct Task *main_task; // Main task
int main_sig; // Main task signals
static ULONG sound_func(void); // AHI callback
struct MsgPort *ahi_port; // Port and IORequest for AHI
struct AHIRequest *ahi_io;
struct AHIAudioCtrl *ahi_ctrl; // AHI control structure
struct AHISampleInfo sample[2]; // SampleInfos for double buffering
struct Hook sf_hook; // Hook for callback function
int play_buf; // Number of buffer currently playing
#endif
#if defined(__linux__) || defined(GEKKO)
int devfd, sndbufsize, buffer_rate;
int16 *sound_buffer;
#endif
#ifdef SUN
int fd;
audio_info status;
uint_t sent_samples,delta_samples;
int16 *sound_calc_buf;
#endif
#ifdef __hpux
int fd;
audio_status status;
int16 *sound_calc_buf;
int linecnt;
#endif
#ifdef __mac__
SndChannelPtr chan1;
SndDoubleBufferHeader myDblHeader;
@ -489,12 +402,6 @@ private:
int *lead;
int lead_pos;
#endif
#ifdef __riscos__
int linecnt, sndbufsize;
uint8 *sound_buffer;
C64 *the_c64;
#endif
};
// Static data members
@ -1219,11 +1126,7 @@ void DigitalRenderer::calc_filter(void)
* Fill one audio buffer with calculated SID sound
*/
#ifdef __riscos__
void DigitalRenderer::calc_buffer(uint8 *buf, long count)
#else
void DigitalRenderer::calc_buffer(int16 *buf, long count)
#endif
{
// Get filter coefficients, so the emulator won't change
// them in the middle of our calculations
@ -1235,18 +1138,10 @@ void DigitalRenderer::calc_buffer(int16 *buf, long count)
float cd1 = d1, cd2 = d2, cg1 = g1, cg2 = g2;
#endif
#ifdef __riscos__
uint8 *LinToLog, *LogScale;
#endif
// Index in sample_buf for reading, 16.16 fixed
uint32 sample_count = (sample_in_ptr + SAMPLE_BUF_SIZE/2) << 16;
#ifdef __riscos__ // on RISC OS we have 8 bit logarithmic sound
DigitalRenderer_GetTables(&LinToLog, &LogScale); // get translation tables
#else
count >>= 1; // 16 bit mono output, count is in bytes
#endif
while (count--) {
// Get current master volume from sample buffer,
// calculate sampled voice
@ -1385,30 +1280,15 @@ void DigitalRenderer::calc_buffer(int16 *buf, long count)
// Manufacturer independent sound is still just a dream...
#if defined(__BEOS__)
#include "SID_Be.h"
#elif defined(AMIGA)
#include "SID_Amiga.h"
#elif defined(__linux__)
#if defined(__linux__)
#include "SID_linux.h"
#elif defined(SUN)
#include "SID_sun.h"
#elif defined(__hpux)
#include "SID_hp.h"
#elif defined(__mac__)
#include "SID_mac.h"
#elif defined(WIN32)
#include "SID_WIN32.h"
#elif defined(__riscos__)
#include "SID_Acorn.h"
#elif defined(GEKKO)
#include "SID_wii.h"