Nuked: chan_t -> opl3_channel

This commit is contained in:
Jasmine Iwanek
2024-07-14 01:04:35 -04:00
parent e4ee5d2d01
commit e654d01bd0
2 changed files with 26 additions and 26 deletions

View File

@@ -83,7 +83,7 @@ typedef struct chan {
uint16_t chc; uint16_t chc;
uint16_t chd; uint16_t chd;
uint8_t ch_num; uint8_t ch_num;
} chan_t; } opl3_channel;
typedef struct wrbuf { typedef struct wrbuf {
uint64_t time; uint64_t time;
@@ -92,7 +92,7 @@ typedef struct wrbuf {
} wrbuf_t; } wrbuf_t;
typedef struct chip { typedef struct chip {
chan_t channel[18]; opl3_channel channel[18];
opl3_slot slot[36]; opl3_slot slot[36];
uint16_t timer; uint16_t timer;
uint64_t eg_timer; uint64_t eg_timer;

View File

@@ -695,14 +695,14 @@ slot_calc_fb(opl3_slot *slot)
// Channel // Channel
static void static void
channel_setup_alg(chan_t *channel); channel_setup_alg(opl3_channel *channel);
static void static void
channel_update_rhythm(opl3_chip *chip, uint8_t data) channel_update_rhythm(opl3_chip *chip, uint8_t data)
{ {
chan_t *channel6; opl3_channel *channel6;
chan_t *channel7; opl3_channel *channel7;
chan_t *channel8; opl3_channel *channel8;
uint8_t chnum; uint8_t chnum;
chip->rhy = data & 0x3f; chip->rhy = data & 0x3f;
@@ -774,7 +774,7 @@ channel_update_rhythm(opl3_chip *chip, uint8_t data)
} }
static void static void
channel_write_a0(chan_t *channel, uint8_t data) channel_write_a0(opl3_channel *channel, uint8_t data)
{ {
if (channel->chip->newm && channel->chtype == ch_4op2) if (channel->chip->newm && channel->chtype == ch_4op2)
return; return;
@@ -796,7 +796,7 @@ channel_write_a0(chan_t *channel, uint8_t data)
} }
static void static void
channel_write_b0(chan_t *channel, uint8_t data) channel_write_b0(opl3_channel *channel, uint8_t data)
{ {
if (channel->chip->newm && channel->chtype == ch_4op2) if (channel->chip->newm && channel->chtype == ch_4op2)
return; return;
@@ -820,7 +820,7 @@ channel_write_b0(chan_t *channel, uint8_t data)
} }
static void static void
channel_setup_alg(chan_t *channel) channel_setup_alg(opl3_channel *channel)
{ {
if (channel->chtype == ch_drum) { if (channel->chtype == ch_drum) {
if (channel->ch_num == 7 || channel->ch_num == 8) { if (channel->ch_num == 7 || channel->ch_num == 8) {
@@ -929,7 +929,7 @@ channel_setup_alg(chan_t *channel)
} }
static void static void
channel_update_alg(chan_t *channel) channel_update_alg(opl3_channel *channel)
{ {
channel->alg = channel->con; channel->alg = channel->con;
@@ -949,7 +949,7 @@ channel_update_alg(chan_t *channel)
} }
static void static void
channel_write_c0(chan_t *channel, uint8_t data) channel_write_c0(opl3_channel *channel, uint8_t data)
{ {
channel->fb = (data & 0x0e) >> 1; channel->fb = (data & 0x0e) >> 1;
channel->con = data & 0x01; channel->con = data & 0x01;
@@ -975,7 +975,7 @@ channel_write_c0(chan_t *channel, uint8_t data)
#if OPL_ENABLE_STEREOEXT #if OPL_ENABLE_STEREOEXT
static void static void
channel_write_d0(chan_t *channel, uint8_t data) channel_write_d0(opl3_channel *channel, uint8_t data)
{ {
if (channel->chip->stereoext) { if (channel->chip->stereoext) {
channel->leftpan = panpot_lut[data ^ 0xffu]; channel->leftpan = panpot_lut[data ^ 0xffu];
@@ -985,7 +985,7 @@ channel_write_d0(chan_t *channel, uint8_t data)
#endif #endif
static void static void
channel_key_on(chan_t *channel) channel_key_on(opl3_channel *channel)
{ {
if (channel->chip->newm) { if (channel->chip->newm) {
if (channel->chtype == ch_4op) { if (channel->chtype == ch_4op) {
@@ -1004,7 +1004,7 @@ channel_key_on(chan_t *channel)
} }
static void static void
channel_key_off(chan_t *channel) channel_key_off(opl3_channel *channel)
{ {
if (channel->chip->newm) { if (channel->chip->newm) {
if (channel->chtype == ch_4op) { if (channel->chtype == ch_4op) {
@@ -1058,14 +1058,14 @@ process_slot(opl3_slot *slot)
static inline void static inline void
nuked_generate_4ch(void *priv, int32_t *buf4) nuked_generate_4ch(void *priv, int32_t *buf4)
{ {
opl3_chip *chip = (opl3_chip *) priv; opl3_chip *chip = (opl3_chip *) priv;
chan_t *channel; opl3_channel *channel;
wrbuf_t *writebuf; wrbuf_t *writebuf;
int16_t **out; int16_t **out;
int32_t mix[2]; int32_t mix[2];
int16_t accm; int16_t accm;
int16_t shift = 0; int16_t shift = 0;
uint8_t i; uint8_t i;
buf4[1] = chip->mixbuff[1]; buf4[1] = chip->mixbuff[1];
buf4[3] = chip->mixbuff[3]; buf4[3] = chip->mixbuff[3];
@@ -1229,10 +1229,10 @@ nuked_generate_resampled(opl3_chip *chip, int32_t *buf4)
void void
nuked_init(opl3_chip *chip, uint32_t samplerate) nuked_init(opl3_chip *chip, uint32_t samplerate)
{ {
opl3_slot *slot; opl3_slot *slot;
chan_t *channel; opl3_channel *channel;
uint8_t i; uint8_t i;
uint8_t local_ch_slot; uint8_t local_ch_slot;
memset(chip, 0x00, sizeof(opl3_chip)); memset(chip, 0x00, sizeof(opl3_chip));