summaryrefslogtreecommitdiffstats
path: root/src/devices/sound/c140.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/sound/c140.cpp')
-rw-r--r--src/devices/sound/c140.cpp68
1 files changed, 34 insertions, 34 deletions
diff --git a/src/devices/sound/c140.cpp b/src/devices/sound/c140.cpp
index 3e3efc193cb..b296dc2d57f 100644
--- a/src/devices/sound/c140.cpp
+++ b/src/devices/sound/c140.cpp
@@ -50,19 +50,19 @@ Unmapped registers:
struct voice_registers
{
- UINT8 volume_right;
- UINT8 volume_left;
- UINT8 frequency_msb;
- UINT8 frequency_lsb;
- UINT8 bank;
- UINT8 mode;
- UINT8 start_msb;
- UINT8 start_lsb;
- UINT8 end_msb;
- UINT8 end_lsb;
- UINT8 loop_msb;
- UINT8 loop_lsb;
- UINT8 reserved[4];
+ uint8_t volume_right;
+ uint8_t volume_left;
+ uint8_t frequency_msb;
+ uint8_t frequency_lsb;
+ uint8_t bank;
+ uint8_t mode;
+ uint8_t start_msb;
+ uint8_t start_lsb;
+ uint8_t end_msb;
+ uint8_t end_lsb;
+ uint8_t loop_msb;
+ uint8_t loop_lsb;
+ uint8_t reserved[4];
};
@@ -74,7 +74,7 @@ const device_type C140 = &device_creator<c140_device>;
// LIVE DEVICE
//**************************************************************************
-static inline int limit(INT32 in)
+static inline int limit(int32_t in)
{
if(in>0x7fff) return 0x7fff;
else if(in<-0x8000) return -0x8000;
@@ -86,7 +86,7 @@ static inline int limit(INT32 in)
// c140_device - constructor
//-------------------------------------------------
-c140_device::c140_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+c140_device::c140_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, C140, "C140", tag, owner, clock, "c140", __FILE__)
, device_sound_interface(mconfig, *this)
, m_sample_rate(0)
@@ -98,8 +98,8 @@ c140_device::c140_device(const machine_config &mconfig, const char *tag, device_
, m_rom_ptr(*this, DEVICE_SELF)
, m_pRom(nullptr)
{
- memset(m_REG, 0, sizeof(UINT8)*0x200);
- memset(m_pcmtbl, 0, sizeof(INT16)*8);
+ memset(m_REG, 0, sizeof(uint8_t)*0x200);
+ memset(m_pcmtbl, 0, sizeof(int16_t)*8);
}
@@ -119,7 +119,7 @@ void c140_device::device_start()
}
/* make decompress pcm table */ //2000.06.26 CAB
- INT32 segbase = 0;
+ int32_t segbase = 0;
for(int i = 0; i < 8; i++)
{
m_pcmtbl[i]=segbase; //segment base value
@@ -134,8 +134,8 @@ void c140_device::device_start()
}
/* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */
- m_mixer_buffer_left = std::make_unique<INT16[]>(m_sample_rate);
- m_mixer_buffer_right = std::make_unique<INT16[]>(m_sample_rate);;
+ m_mixer_buffer_left = std::make_unique<int16_t[]>(m_sample_rate);
+ m_mixer_buffer_right = std::make_unique<int16_t[]>(m_sample_rate);;
save_item(NAME(m_REG));
@@ -167,24 +167,24 @@ void c140_device::sound_stream_update(sound_stream &stream, stream_sample_t **in
{
int i,j;
- INT32 rvol,lvol;
- INT32 dt;
- INT32 sdt;
- INT32 st,ed,sz;
+ int32_t rvol,lvol;
+ int32_t dt;
+ int32_t sdt;
+ int32_t st,ed,sz;
- INT8 *pSampleData;
- INT32 frequency,delta,offset,pos;
- INT32 cnt, voicecnt;
- INT32 lastdt,prevdt,dltdt;
+ int8_t *pSampleData;
+ int32_t frequency,delta,offset,pos;
+ int32_t cnt, voicecnt;
+ int32_t lastdt,prevdt,dltdt;
float pbase=(float)m_baserate*2.0f / (float)m_sample_rate;
- INT16 *lmix, *rmix;
+ int16_t *lmix, *rmix;
if(samples>m_sample_rate) samples=m_sample_rate;
/* zap the contents of the mixer buffer */
- memset(m_mixer_buffer_left.get(), 0, samples * sizeof(INT16));
- memset(m_mixer_buffer_right.get(), 0, samples * sizeof(INT16));
+ memset(m_mixer_buffer_left.get(), 0, samples * sizeof(int16_t));
+ memset(m_mixer_buffer_right.get(), 0, samples * sizeof(int16_t));
/* get the number of voices to update */
voicecnt = (m_banking_type == C140_TYPE_ASIC219) ? 16 : 24;
@@ -351,7 +351,7 @@ void c140_device::sound_stream_update(sound_stream &stream, stream_sample_t **in
stream_sample_t *dest2 = outputs[1];
for (i = 0; i < samples; i++)
{
- INT32 val;
+ int32_t val;
val = 8 * (*lmix++);
*dest1++ = limit(val);
@@ -433,7 +433,7 @@ WRITE8_MEMBER( c140_device::c140_w )
void c140_device::set_base(void *base)
{
- m_pRom = (INT8 *)base;
+ m_pRom = (int8_t *)base;
}
@@ -464,7 +464,7 @@ long c140_device::find_sample(long adrs, long bank, int voice)
{
long newadr = 0;
- static const INT16 asic219banks[4] = { 0x1f7, 0x1f1, 0x1f3, 0x1f5 };
+ static const int16_t asic219banks[4] = { 0x1f7, 0x1f1, 0x1f3, 0x1f5 };
adrs=(bank<<16)+adrs;