libsidplayfp  0.3.5
residfp-emu.h
1 /***************************************************************************
2  resid-emu.h - ReSid Emulation
3  -------------------
4  begin : Fri Apr 4 2001
5  copyright : (C) 2001 by Simon White
6  email : s_a_white@email.com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifdef HAVE_CONFIG_H
19 # include "config.h"
20 #endif
21 
22 #include "residfp/SID.h"
23 
24 #define RESID_NAMESPACE reSIDfp
25 
26 enum {
27  OUTPUTBUFFERSIZE = 5000 //32768
28 };
29 
30 class ReSIDfp: public sidemu
31 {
32 private:
33  EventContext *m_context;
34  event_phase_t m_phase;
35  class RESID_NAMESPACE::SID &m_sid;
36  event_clock_t m_accessClk;
37  const char *m_error;
38  bool m_status;
39  bool m_locked;
40  static char m_credit[250];
41 
42 public:
43  ReSIDfp (sidbuilder *builder);
44  ~ReSIDfp (void);
45 
46  // Standard component functions
47  const char *credits (void) {return m_credit;}
48  void reset () { sidemu::reset (); }
49  void reset (uint8_t volume);
50  uint8_t read (uint_least8_t addr);
51  void write (uint_least8_t addr, uint8_t data);
52  const char *error (void) {return m_error;}
53 
54  // Standard SID functions
55  void clock ();
56  void filter (bool enable);
57  void voice (uint_least8_t num, bool mute) { m_sid.mute(num, mute); }
58 
59  operator bool () { return m_status; }
60  static int devices (char *error);
61 
62  // Specific to resid
63  void sampling (float systemclock, float freq,
64  const sampling_method_t method, const bool fast);
65  //bool filter (const sid_filterfp_t *filter);
66  void filter6581Curve (const double filterCurve);
67  void filter8580Curve (const double filterCurve);
68  void model (sid2_model_t model);
69  // Must lock the SID before using the standard functions.
70  bool lock (c64env *env);
71 };