12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- #ifndef H_ADPLUG_KEMUOPL
- #define H_ADPLUG_KEMUOPL
- #include "opl.h"
- extern "C" {
- #include "adlibemu.h"
- }
- class CKemuopl: public Copl
- {
- public:
- CKemuopl(int rate, bool bit16, bool usestereo)
- : use16bit(bit16), stereo(usestereo)
- {
- adlibinit(rate, usestereo ? 2 : 1, bit16 ? 2 : 1);
- currType = TYPE_OPL2;
- };
- void update(short *buf, int samples)
- {
- if(use16bit) samples *= 2;
- if(stereo) samples *= 2;
- adlibgetsample(buf, samples);
- }
-
- void write(int reg, int val)
- {
- if(currChip == 0)
- adlib0(reg, val);
- };
- void init() {};
- private:
- bool use16bit,stereo;
- };
- #endif
|