Debian Codegraph @

BambooTracker/chip/c86ctl/c86ctl.h

raw
1 /***
2 c86ctl
3
4 Copyright (c) 2009-2012, honet. All rights reserved.
5 This software is licensed under the BSD license.
6
7 honet.kk(at)gmail.com
8 */
9
10
11 #ifndef _C86CTL_H
12 #define _C86CTL_H
13
14 #include <ObjBase.h>
15 #include "cbus_boardtype.h"
16
17 #ifdef __cplusplus
18 namespace c86ctl{
19 #endif
20
21 /*----------------------------------------------------------------------------*/
22 /* 定数定義 */
23 /*----------------------------------------------------------------------------*/
24 #define C86CTL_ERR_NONE 0
25 #define C86CTL_ERR_UNKNOWN -1
26 #define C86CTL_ERR_INVALID_PARAM -2
27 #define C86CTL_ERR_UNSUPPORTED -3
28 #define C86CTL_ERR_NODEVICE -1000
29 #define C86CTL_ERR_NOT_IMPLEMENTED -9999
30
31 enum ChipType {
32 CHIP_UNKNOWN = 0x0000,
33
34 CHIP_OPNA = 0x00001,
35 CHIP_YM2608 = 0x00001,
36 CHIP_YM2608NOADPCM = 0x10001,
37 CHIP_OPM = 0x00002,
38 CHIP_YM2151 = 0x00002,
39 CHIP_OPN3L = 0x00003,
40 CHIP_YMF288 = 0x00003,
41 CHIP_OPL3 = 0x00004,
42 CHIP_YMF262 = 0x00004,
43 CHIP_OPLL = 0x00005,
44 CHIP_YM2413 = 0x00005,
45
46 CHIP_SN76489 = 0x00006,
47 CHIP_SN76496 = 0x10006,
48 CHIP_AY38910 = 0x00007,
49 CHIP_YM2149 = 0x10007,
50 CHIP_YM2203 = 0x00008,
51 CHIP_YM2612 = 0x00009,
52 CHIP_YM3526 = 0x0000a,
53 CHIP_YM3812 = 0x0000b,
54 CHIP_YMF271 = 0x0000c,
55 CHIP_YMF278B = 0x0000d,
56 CHIP_YMZ280B = 0x0000e,
57 CHIP_YMF297 = 0x0000f,
58 CHIP_YMF297_OPN3L = 0x0000f,
59 CHIP_YMF297_OPL3 = 0x2000f,
60 CHIP_YM2610B = 0x00010,
61 CHIP_Y8950 = 0x00020,
62 CHIP_Y8950ADPCM = 0x10020,
63 CHIP_YM3438 = 0x00021,
64
65 CHIP_TMS3631RI104 = 0x00023,
66 };
67
68
69 /*----------------------------------------------------------------------------*/
70 /* 構造体定義 */
71 /*----------------------------------------------------------------------------*/
72 struct Devinfo{
73 char Devname[16];
74 char Rev;
75 char Serial[15];
76 };
77
78 /*----------------------------------------------------------------------------*/
79 /* Interface定義 */
80 /*----------------------------------------------------------------------------*/
81 // IRealChipBase {5C457918-E66D-4AC1-8CB5-B91C4704DF79}
82 static const GUID IID_IRealChipBase =
83 { 0x5c457918, 0xe66d, 0x4ac1, { 0x8c, 0xb5, 0xb9, 0x1c, 0x47, 0x4, 0xdf, 0x79 } };
84
85 interface IRealChipBase : public IUnknown
86 {
87 virtual int __stdcall initialize(void) = 0;
88 virtual int __stdcall deinitialize(void) = 0;
89 virtual int __stdcall getNumberOfChip(void) = 0;
90 virtual HRESULT __stdcall getChipInterface( int id, REFIID riid, void** ppi ) = 0;
91 };
92
93 // ---------------------------------------
94 // DEPRECATED. use IRealChip3 instead.
95 // IRealChip {F959C007-6B4D-46F3-BB60-9B0897C7E642}
96 static const GUID IID_IRealChip =
97 { 0xf959c007, 0x6b4d, 0x46f3, { 0xbb, 0x60, 0x9b, 0x8, 0x97, 0xc7, 0xe6, 0x42 } };
98 interface IRealChip : public IUnknown
99 {
100 public:
101 virtual int __stdcall reset(void) = 0;
102 virtual void __stdcall out(UINT addr, UCHAR data) = 0;
103 virtual UCHAR __stdcall in(UINT addr) = 0;
104 };
105
106 // DEPRECATED. use IRealChip3 instead.
107 // IRealChip2 {BEFA830A-0DF3-46E4-A79E-FABB78E80357}
108 static const GUID IID_IRealChip2 =
109 { 0xbefa830a, 0xdf3, 0x46e4, { 0xa7, 0x9e, 0xfa, 0xbb, 0x78, 0xe8, 0x3, 0x57 } };
110
111 interface IRealChip2 : public IRealChip
112 {
113 //IRealChipより継承
114 //public:
115 // virtual int __stdcall reset(void) = 0;
116 // virtual void __stdcall out(UINT addr, UCHAR data) = 0;
117 // virtual UCHAR __stdcall in(UINT addr) = 0;
118 public:
119 virtual int __stdcall getChipStatus(UINT addr, UCHAR* status) = 0;
120 virtual void __stdcall directOut(UINT addr, UCHAR data) = 0;
121 };
122
123 // IRealChip3 {761DB10B-2432-4747-AC75-0EA6D9336797}
124 static const GUID IID_IRealChip3 =
125 { 0x761db10b, 0x2432, 0x4747, { 0xac, 0x75, 0xe, 0xa6, 0xd9, 0x33, 0x67, 0x97 } };
126
127 interface IRealChip3 : public IRealChip2
128 {
129 //IRealChip2より継承
130 //public:
131 // virtual int __stdcall reset(void) = 0;
132 // virtual void __stdcall out(UINT addr, UCHAR data) = 0;
133 // virtual UCHAR __stdcall in(UINT addr) = 0;
134 //public:
135 // virtual int __stdcall getChipStatus(UINT addr, UCHAR *status) = 0;
136 // virtual void __stdcall directOut(UINT addr, UCHAR data) = 0;
137 public:
138 virtual int __stdcall getChipType(enum ChipType* type) = 0;
139 };
140
141
142 // ---------------------------------------
143 // DEPRECATED. use IGimic2 instead.
144 // IGimic {175C7DA0-8AA5-4173-96DA-BB43B8EB8F17}
145 static const GUID IID_IGimic =
146 { 0x175c7da0, 0x8aa5, 0x4173, { 0x96, 0xda, 0xbb, 0x43, 0xb8, 0xeb, 0x8f, 0x17 } };
147 interface IGimic : public IUnknown
148 {
149 virtual int __stdcall getFWVer(UINT* major, UINT* minor, UINT* revision, UINT* build) = 0;
150 virtual int __stdcall getMBInfo(struct Devinfo* info) = 0;
151 virtual int __stdcall getModuleInfo(struct Devinfo* info) = 0;
152 virtual int __stdcall setSSGVolume(UCHAR vol) = 0;
153 virtual int __stdcall getSSGVolume(UCHAR* vol) = 0;
154 virtual int __stdcall setPLLClock(UINT clock) = 0;
155 virtual int __stdcall getPLLClock(UINT* clock) = 0;
156 };
157
158 // IGimic2 {47141A01-15F5-4BF5-9554-CA7AACD54BB8}
159 static const GUID IID_IGimic2 =
160 { 0x47141a01, 0x15f5, 0x4bf5, { 0x95, 0x54, 0xca, 0x7a, 0xac, 0xd5, 0x4b, 0xb8 } };
161 interface IGimic2 : public IGimic
162 {
163 virtual int __stdcall getModuleType( enum ChipType *type ) = 0;
164 };
165
166
167 // ---------------------------------------
168 // 仮定義です。まだ使えません・・・ごめん。
169 // IC86Usb {312481E2-A93C-4A2F-87CA-CE3AC1096ED5}
170 static const GUID IID_IC86BOX =
171 { 0x312481e2, 0xa93c, 0x4a2f, { 0x87, 0xca, 0xce, 0x3a, 0xc1, 0x9, 0x6e, 0xd5 } };
172 interface IC86Box : public IUnknown
173 {
174 virtual int __stdcall getFWVer(UINT *major, UINT *minor, UINT *revision, UINT *build) = 0;
175 virtual int __stdcall getBoardType(CBUS_BOARD_TYPE *type) = 0;
176 virtual int __stdcall getSlotIndex() = 0;
177 virtual int __stdcall writeBoardControl(UINT index, UINT val) = 0;
178 };
179
180
181 /*----------------------------------------------------------------------------*/
182 /* 公開関数定義 */
183 /*----------------------------------------------------------------------------*/
184 #ifdef __cplusplus
185 extern "C" {
186 #endif
187
188 HRESULT WINAPI CreateInstance( REFIID riid, void** ppi );
189
190
191 int WINAPI c86ctl_initialize(void); // DEPRECATED
192 int WINAPI c86ctl_deinitialize(void); // DEPRECATED
193 int WINAPI c86ctl_reset(void); // DEPRECATED
194 void WINAPI c86ctl_out( UINT addr, UCHAR data ); // DEPRECATED
195 UCHAR WINAPI c86ctl_in( UINT addr ); // DEPRECATED
196
197
198
199 #ifdef __cplusplus
200 }
201 }
202 #endif
203
204 #endif