4 #include "blargg_common.h"
5 #include "blargg_source.h"
6 #include "blip_buffer.h"
11 enum opl_type_t
{ type_opll
= 0x10, type_msxmusic
= 0x11, type_smsfmunit
= 0x12,
12 type_vrc7
= 0x13, type_msxaudio
= 0x21 };
14 enum { opl_osc_count
= 1 };
17 struct Blip_Buffer
* output_
;
18 enum opl_type_t type_
;
20 blip_time_t next_time
;
28 struct Blip_Synth synth
;
34 unsigned char regs
[ 0x100 ];
35 unsigned char opl_memory
[ 32768 ];
38 blargg_err_t
Opl_init( struct Opl_Apu
* this, long clock
, long rate
, blip_time_t period
, enum opl_type_t type
);
40 void Opl_reset( struct Opl_Apu
* this );
41 static inline void Opl_volume( struct Opl_Apu
* this, double v
) { Synth_volume( &this->synth
, 1.0 / (4096 * 6) * v
); }
43 static inline void Opl_osc_output( struct Opl_Apu
* this, int i
, struct Blip_Buffer
* buf
)
48 assert( (unsigned) i
< opl_osc_count
);
52 static inline void Opl_set_output( struct Opl_Apu
* this, struct Blip_Buffer
* buf
) { Opl_osc_output( this, 0, buf
); }
53 void Opl_end_frame( struct Opl_Apu
* this, blip_time_t
) ICODE_ATTR
;
55 static inline void Opl_write_addr( struct Opl_Apu
* this, int data
) { this->addr
= data
; }
56 void Opl_write_data( struct Opl_Apu
* this, blip_time_t
, int data
) ICODE_ATTR
;
58 int Opl_read( struct Opl_Apu
* this, blip_time_t
, int port
) ICODE_ATTR
;
60 static inline bool Opl_supported( void ) { return true; }