~ubuntu-branches/ubuntu/quantal/vice/quantal

1 by Zed Pobre
Import upstream version 1.8.0
1
/*
2
 * sid.h - MOS6581 (SID) emulation, hooks to actual implementation.
3
 *
4
 * Written by
5
 *  Dag Lem <resid@nimrod.no>
6
 *
7
 * This file is part of VICE, the Versatile Commodore Emulator.
8
 * See README for copyright notice.
9
 *
10
 *  This program is free software; you can redistribute it and/or modify
11
 *  it under the terms of the GNU General Public License as published by
12
 *  the Free Software Foundation; either version 2 of the License, or
13
 *  (at your option) any later version.
14
 *
15
 *  This program is distributed in the hope that it will be useful,
16
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 *  GNU General Public License for more details.
19
 *
20
 *  You should have received a copy of the GNU General Public License
21
 *  along with this program; if not, write to the Free Software
22
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
23
 *  02111-1307  USA.
24
 *
25
 */
26
1.2.2 by Laszlo Boszormenyi (GCS)
Import upstream version 2.1.dfsg
27
#ifndef VICE_SID_ENGINE_H
28
#define VICE_SID_ENGINE_H
1 by Zed Pobre
Import upstream version 1.8.0
29
30
#include "types.h"
1.1.5 by Laszlo Boszormenyi (GCS)
Import upstream version 1.22
31
#include "sound.h"
1.1.1 by Zed Pobre
Import upstream version 1.14
32
33
struct sound_s;
34
struct sid_snapshot_state_s;
35
36
#define SID_ENGINE_FASTSID        0
37
#define SID_ENGINE_RESID          1
38
#define SID_ENGINE_CATWEASELMKIII 2
39
#define SID_ENGINE_HARDSID        3
1.1.4 by Zed Pobre
Import upstream version 1.20
40
#define SID_ENGINE_PARSID_PORT1   4
41
#define SID_ENGINE_PARSID_PORT2   5
42
#define SID_ENGINE_PARSID_PORT3   6
1.2.2 by Laszlo Boszormenyi (GCS)
Import upstream version 2.1.dfsg
43
#define SID_ENGINE_RESID_FP       7
1.1.1 by Zed Pobre
Import upstream version 1.14
44
1.2.2 by Laszlo Boszormenyi (GCS)
Import upstream version 2.1.dfsg
45
#define SID_MODEL_6581           0
46
#define SID_MODEL_8580           1
47
#define SID_MODEL_8580D          2
48
#define SID_MODEL_6581R4         3
49
#define SID_MODEL_DTVSID         4
50
#define SID_MODEL_6581R3_4885    8
51
#define SID_MODEL_6581R3_0486S   9
52
#define SID_MODEL_6581R3_3984   10
53
#define SID_MODEL_6581R4AR_3789 11
54
#define SID_MODEL_6581R3_4485   12
55
#define SID_MODEL_6581R4_1986S  13
56
#define SID_MODEL_8580R5_3691   16
57
#define SID_MODEL_8580R5_3691D  17
58
#define SID_MODEL_8580R5_1489   18
59
#define SID_MODEL_8580R5_1489D  19
60
#define SID_MODEL_DEFAULT       99
1.1.1 by Zed Pobre
Import upstream version 1.14
61
62
extern BYTE REGPARM1 sid_read(WORD address);
63
extern BYTE REGPARM1 sid2_read(WORD address);
64
extern void REGPARM2 sid_store(WORD address, BYTE byte);
65
extern void REGPARM2 sid2_store(WORD address, BYTE byte);
66
extern void sid_reset(void);
67
68
extern void sid_set_machine_parameter(long clock_rate);
69
extern BYTE *sid_get_siddata(unsigned int channel);
70
extern int sid_engine_set(int engine);
71
extern void sid_state_read(unsigned int channel,
72
                           struct sid_snapshot_state_s *sid_state);
73
extern void sid_state_write(unsigned int channel,
74
                            struct sid_snapshot_state_s *sid_state);
1 by Zed Pobre
Import upstream version 1.8.0
75
76
struct sid_engine_s {
1.1.1 by Zed Pobre
Import upstream version 1.14
77
    struct sound_s *(*open)(BYTE *sidstate);
78
    int (*init)(struct sound_s *psid, int speed, int cycles_per_sec);
79
    void (*close)(struct sound_s *psid);
80
    BYTE (*read)(struct sound_s *psid, WORD addr);
81
    void (*store)(struct sound_s *psid, WORD addr, BYTE val);
82
    void (*reset)(struct sound_s *psid, CLOCK cpu_clk);
83
    int (*calculate_samples)(struct sound_s *psid, SWORD *pbuf, int nr,
84
                             int interleave, int *delta_t);
85
    void (*prevent_clk_overflow)(struct sound_s *psid, CLOCK sub);
86
    char *(*dump_state)(struct sound_s *psid);
87
    void (*state_read)(struct sound_s *psid,
88
                       struct sid_snapshot_state_s *sid_state);
89
    void (*state_write)(struct sound_s *psid,
90
                        struct sid_snapshot_state_s *sid_state);
1 by Zed Pobre
Import upstream version 1.8.0
91
};
92
typedef struct sid_engine_s sid_engine_t;
93
1.1.5 by Laszlo Boszormenyi (GCS)
Import upstream version 1.22
94
extern sound_t *sid_sound_machine_open(int chipno);
95
extern int sid_sound_machine_init(sound_t *psid, int speed, int cycles_per_sec);
96
extern void sid_sound_machine_close(sound_t *psid);
97
extern BYTE sid_sound_machine_read(sound_t *psid, WORD addr);
98
extern void sid_sound_machine_store(sound_t *psid, WORD addr, BYTE byte);
99
extern void sid_sound_machine_reset(sound_t *psid, CLOCK cpu_clk);
100
extern int sid_sound_machine_calculate_samples(sound_t *psid, SWORD *pbuf, 
101
int nr, int interleave, int *delta_t);
102
extern void sid_sound_machine_prevent_clk_overflow(sound_t *psid, CLOCK sub);
103
extern char *sid_sound_machine_dump_state(sound_t *psid);
104
extern int sid_sound_machine_cycle_based(void);
105
extern int sid_sound_machine_channels(void);
106
extern void sid_sound_machine_enable(int enable);
107
1.1.1 by Zed Pobre
Import upstream version 1.14
108
#endif