summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound/ymz280b.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/sound/ymz280b.h')
-rw-r--r--src/devices/sound/ymz280b.h96
1 files changed, 48 insertions, 48 deletions
diff --git a/src/devices/sound/ymz280b.h b/src/devices/sound/ymz280b.h
index 898d952c0d2..a375f4a7ed0 100644
--- a/src/devices/sound/ymz280b.h
+++ b/src/devices/sound/ymz280b.h
@@ -19,7 +19,7 @@
class ymz280b_device : public device_t, public device_sound_interface, public device_rom_interface<24>
{
public:
- ymz280b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ ymz280b_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
// configuration helpers
auto irq_handler() { return m_irq_handler.bind(); }
@@ -45,36 +45,36 @@ private:
/* struct describing a single playing ADPCM voice */
struct YMZ280BVoice
{
- uint8_t playing; /* 1 if we are actively playing */
- bool ended; /* indicate voice has ended in case samples_left is 0 */
-
- uint8_t keyon; /* 1 if the key is on */
- uint8_t looping; /* 1 if looping is enabled */
- uint8_t mode; /* current playback mode */
- uint16_t fnum; /* frequency */
- uint8_t level; /* output level */
- uint8_t pan; /* panning */
-
- uint32_t start; /* start address, in nibbles */
- uint32_t stop; /* stop address, in nibbles */
- uint32_t loop_start; /* loop start address, in nibbles */
- uint32_t loop_end; /* loop end address, in nibbles */
- uint32_t position; /* current position, in nibbles */
-
- int32_t signal; /* current ADPCM signal */
- int32_t step; /* current ADPCM step */
-
- int32_t loop_signal; /* signal at loop start */
- int32_t loop_step; /* step at loop start */
- uint32_t loop_count; /* number of loops so far */
-
- int32_t output_left; /* output volume (left) */
- int32_t output_right; /* output volume (right) */
- int32_t output_step; /* step value for frequency conversion */
- int32_t output_pos; /* current fractional position */
- int16_t last_sample; /* last sample output */
- int16_t curr_sample; /* current sample target */
- uint8_t irq_schedule; /* 1 if the IRQ state is updated by timer */
+ u8 playing; /* 1 if we are actively playing */
+ bool ended; /* indicate voice has ended in case samples_left is 0 */
+
+ u8 keyon; /* 1 if the key is on */
+ u8 looping; /* 1 if looping is enabled */
+ u8 mode; /* current playback mode */
+ u16 fnum; /* frequency */
+ u8 level; /* output level */
+ u8 pan; /* panning */
+
+ u32 start; /* start address, in nibbles */
+ u32 stop; /* stop address, in nibbles */
+ u32 loop_start; /* loop start address, in nibbles */
+ u32 loop_end; /* loop end address, in nibbles */
+ u32 position; /* current position, in nibbles */
+
+ s32 signal; /* current ADPCM signal */
+ s32 step; /* current ADPCM step */
+
+ s32 loop_signal; /* signal at loop start */
+ s32 loop_step; /* step at loop start */
+ u32 loop_count; /* number of loops so far */
+
+ s32 output_left; /* output volume (left) */
+ s32 output_right; /* output volume (right) */
+ s32 output_step; /* step value for frequency conversion */
+ s32 output_pos; /* current fractional position */
+ s16 last_sample; /* last sample output */
+ s16 curr_sample; /* current sample target */
+ u8 irq_schedule; /* 1 if the IRQ state is updated by timer */
emu_timer *timer;
};
@@ -83,31 +83,31 @@ private:
void update_step(struct YMZ280BVoice *voice);
void update_volumes(struct YMZ280BVoice *voice);
void update_irq_state_timer_common(int voicenum);
- int generate_adpcm(struct YMZ280BVoice *voice, int16_t *buffer, int samples);
- int generate_pcm8(struct YMZ280BVoice *voice, int16_t *buffer, int samples);
- int generate_pcm16(struct YMZ280BVoice *voice, int16_t *buffer, int samples);
+ int generate_adpcm(struct YMZ280BVoice *voice, s16 *buffer, int samples);
+ int generate_pcm8(struct YMZ280BVoice *voice, s16 *buffer, int samples);
+ int generate_pcm16(struct YMZ280BVoice *voice, s16 *buffer, int samples);
void write_to_register(int data);
int compute_status();
// internal state
struct YMZ280BVoice m_voice[8]; /* the 8 voices */
- uint8_t m_current_register; /* currently accessible register */
- uint8_t m_status_register; /* current status register */
- uint8_t m_irq_state; /* current IRQ state */
- uint8_t m_irq_mask; /* current IRQ mask */
- uint8_t m_irq_enable; /* current IRQ enable */
- uint8_t m_keyon_enable; /* key on enable */
- uint8_t m_ext_mem_enable; /* external memory enable */
- uint8_t m_ext_readlatch; /* external memory prefetched data */
- uint32_t m_ext_mem_address_hi;
- uint32_t m_ext_mem_address_mid;
- uint32_t m_ext_mem_address; /* where the CPU can read the ROM */
-
- devcb_write_line m_irq_handler; /* IRQ callback */
+ u8 m_current_register; /* currently accessible register */
+ u8 m_status_register; /* current status register */
+ u8 m_irq_state; /* current IRQ state */
+ u8 m_irq_mask; /* current IRQ mask */
+ u8 m_irq_enable; /* current IRQ enable */
+ u8 m_keyon_enable; /* key on enable */
+ u8 m_ext_mem_enable; /* external memory enable */
+ u8 m_ext_readlatch; /* external memory prefetched data */
+ u32 m_ext_mem_address_hi;
+ u32 m_ext_mem_address_mid;
+ u32 m_ext_mem_address; /* where the CPU can read the ROM */
+
+ devcb_write_line m_irq_handler; /* IRQ callback */
double m_master_clock; /* master clock frequency */
sound_stream *m_stream; /* which stream are we using */
- std::unique_ptr<int16_t[]> m_scratch;
+ std::unique_ptr<s16[]> m_scratch;
#if YMZ280B_MAKE_WAVS
void *m_wavresample; /* resampled waveform */
#endif