39#ifndef AUDIO_SOFTSYNTH_OPL_NUKED_H
40#define AUDIO_SOFTSYNTH_OPL_NUKED_H
42#include "common/scummsys.h"
43#include "audio/fmopl.h"
45#ifndef DISABLE_NUKED_OPL
47#ifndef OPL_ENABLE_STEREOEXT
48#define OPL_ENABLE_STEREOEXT 0
51#ifndef OPL_QUIRK_CHANNELSAMPLEDELAY
52#define OPL_QUIRK_CHANNELSAMPLEDELAY (!OPL_ENABLE_STEREOEXT)
55#define OPL_WRITEBUF_SIZE 1024
56#define OPL_WRITEBUF_DELAY 2
61typedef struct _opl3_slot opl3_slot;
62typedef struct _opl3_channel opl3_channel;
63typedef struct _opl3_chip opl3_chip;
82 uint16_t pg_phase_out;
100 uint8_t eg_rate_hi[4];
101 uint8_t eg_rate_lo[4];
105 uint32_t pg_inc_vib[8];
113#if OPL_QUIRK_CHANNELSAMPLEDELAY
120 int16_t *out_left[4];
121 int16_t *out_right[4];
125#if OPL_ENABLE_STEREOEXT
164 uint8_t tremoloshift;
165 uint8_t tremolo_dirty;
180#if OPL_ENABLE_STEREOEXT
187 int16_t oldsamples[4];
190 uint64_t writebuf_samplecnt;
191 uint32_t writebuf_cur;
192 uint32_t writebuf_last;
193 uint64_t writebuf_lasttime;
197void OPL3_Generate(
opl3_chip *chip, int16_t *buf);
198void OPL3_GenerateResampled(
opl3_chip *chip, int16_t *buf);
199void OPL3_Reset(
opl3_chip *chip, uint32_t samplerate);
200void OPL3_WriteReg(
opl3_chip *chip, uint16_t reg, uint8_t v);
201void OPL3_WriteRegBuffered(
opl3_chip *chip, uint16_t reg, uint8_t v);
202void OPL3_GenerateStream(
opl3_chip *chip, int16_t *sndptr, uint32_t numsamples);
204void OPL3_Generate4Ch(
opl3_chip *chip, int16_t *buf4);
205void OPL3_Generate4ChResampled(
opl3_chip *chip, int16_t *buf4);
206void OPL3_Generate4ChStream(
opl3_chip *chip, int16_t *sndptr1, int16_t *sndptr2, uint32_t numsamples);
214 void dualWrite(uint8 index, uint8 reg, uint8 val);
OplType
Definition: fmopl.h:58
void writeReg(int r, int v) override
bool isStereo() const override
Definition: nuked.h:227
void write(int a, int v) override
void generateSamples(int16 *buffer, int length) override