summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/sound')
-rw-r--r--src/devices/sound/astrocde.cpp2
-rw-r--r--src/devices/sound/cdp1864.cpp2
-rw-r--r--src/devices/sound/cdp1869.cpp13
-rw-r--r--src/devices/sound/dac76.cpp2
-rw-r--r--src/devices/sound/discrete.cpp2
-rw-r--r--src/devices/sound/es5503.h1
-rw-r--r--src/devices/sound/fm.h2
-rw-r--r--src/devices/sound/fmopl.h2
-rw-r--r--src/devices/sound/ics2115.cpp2
-rw-r--r--src/devices/sound/k053260.cpp4
-rw-r--r--src/devices/sound/k053260.h2
-rw-r--r--src/devices/sound/mos6560.cpp79
-rw-r--r--src/devices/sound/mos7360.cpp159
-rw-r--r--src/devices/sound/nes_apu.cpp9
-rw-r--r--src/devices/sound/nes_apu.h2
-rw-r--r--src/devices/sound/nes_apu_vt.cpp28
-rw-r--r--src/devices/sound/nes_apu_vt.h26
-rw-r--r--src/devices/sound/s_dsp.cpp4
-rw-r--r--src/devices/sound/vgm_visualizer.cpp65
-rw-r--r--src/devices/sound/ymf262.h2
20 files changed, 228 insertions, 180 deletions
diff --git a/src/devices/sound/astrocde.cpp b/src/devices/sound/astrocde.cpp
index e0fab62505b..91d0fdc46b9 100644
--- a/src/devices/sound/astrocde.cpp
+++ b/src/devices/sound/astrocde.cpp
@@ -146,7 +146,7 @@ void astrocade_io_device::sound_stream_update(sound_stream &stream, std::vector<
constexpr stream_buffer::sample_t sample_scale = 1.0f / 60.0f;
for (int sampindex = 0; sampindex < dest.samples(); sampindex += samples_this_time)
{
- stream_sample_t cursample = 0;
+ s32 cursample = 0;
/* compute the number of cycles until the next master oscillator reset */
/* or until the next noise boundary */
diff --git a/src/devices/sound/cdp1864.cpp b/src/devices/sound/cdp1864.cpp
index e8168004811..f4a46748593 100644
--- a/src/devices/sound/cdp1864.cpp
+++ b/src/devices/sound/cdp1864.cpp
@@ -375,7 +375,7 @@ void cdp1864_device::dma_w(uint8_t data)
color = (gdata << 2) | (bdata << 1) | rdata;
}
- m_bitmap.pix32(y, sx + x) = m_palette[color];
+ m_bitmap.pix(y, sx + x) = m_palette[color];
data <<= 1;
}
diff --git a/src/devices/sound/cdp1869.cpp b/src/devices/sound/cdp1869.cpp
index 98580d7ae54..9e28aa4c048 100644
--- a/src/devices/sound/cdp1869.cpp
+++ b/src/devices/sound/cdp1869.cpp
@@ -574,29 +574,28 @@ void cdp1869_device::sound_stream_update(sound_stream &stream, std::vector<read_
void cdp1869_device::draw_line(bitmap_rgb32 &bitmap, const rectangle &rect, int x, int y, uint8_t data, int color)
{
- int i;
- pen_t fg = m_palette->pen(color);
+ pen_t const fg = m_palette->pen(color);
data <<= 2;
- for (i = 0; i < CH_WIDTH; i++)
+ for (int i = 0; i < CH_WIDTH; i++)
{
if (data & 0x80)
{
- bitmap.pix32(y, x) = fg;
+ bitmap.pix(y, x) = fg;
if (!m_fresvert)
{
- bitmap.pix32(y + 1, x) = fg;
+ bitmap.pix(y + 1, x) = fg;
}
if (!m_freshorz)
{
- bitmap.pix32(y, x + 1) = fg;
+ bitmap.pix(y, x + 1) = fg;
if (!m_fresvert)
{
- bitmap.pix32(y + 1, x + 1) = fg;
+ bitmap.pix(y + 1, x + 1) = fg;
}
}
}
diff --git a/src/devices/sound/dac76.cpp b/src/devices/sound/dac76.cpp
index bbeb5728577..1c73d7b02c1 100644
--- a/src/devices/sound/dac76.cpp
+++ b/src/devices/sound/dac76.cpp
@@ -79,7 +79,7 @@ void dac76_device::sound_stream_update(sound_stream &stream, std::vector<read_st
{
// get current output level
int step_size = (2 << m_chord);
- stream_sample_t vout = m_level[m_chord] + m_step * step_size;
+ s32 vout = m_level[m_chord] + m_step * step_size;
// apply sign bit
vout *= (m_sb ? +1 : -1);
diff --git a/src/devices/sound/discrete.cpp b/src/devices/sound/discrete.cpp
index 1d5647e45cd..7cec35b77fe 100644
--- a/src/devices/sound/discrete.cpp
+++ b/src/devices/sound/discrete.cpp
@@ -1026,7 +1026,7 @@ void discrete_sound_device::device_reset()
// discrete_device_process - process a number of
// samples.
//
-// input / output buffers are stream_sample_t
+// input / output buffers are s32
// to not to have to convert the buffers.
// a "discrete cpu" device will pass nullptr here
//-------------------------------------------------
diff --git a/src/devices/sound/es5503.h b/src/devices/sound/es5503.h
index 2d301f5c05e..2fd316aad8e 100644
--- a/src/devices/sound/es5503.h
+++ b/src/devices/sound/es5503.h
@@ -36,7 +36,6 @@ protected:
virtual void device_timer(emu_timer &timer, device_timer_id tid, int param, void *ptr) override;
// device_sound_interface overrides
- //virtual void sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples) override;
virtual void sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) override;
// device_rom_interface overrides
diff --git a/src/devices/sound/fm.h b/src/devices/sound/fm.h
index 32f768a824b..45381d7dda9 100644
--- a/src/devices/sound/fm.h
+++ b/src/devices/sound/fm.h
@@ -50,7 +50,7 @@ template <typename X> constexpr TIME_TYPE MULTIPLY_TIME_BY_INT(TIME_TYPE const &
#endif
-typedef stream_sample_t FMSAMPLE;
+typedef s32 FMSAMPLE;
/*
#if (FM_SAMPLE_BITS==16)
typedef int16_t FMSAMPLE;
diff --git a/src/devices/sound/fmopl.h b/src/devices/sound/fmopl.h
index b70c46f93e3..bb484b0e41b 100644
--- a/src/devices/sound/fmopl.h
+++ b/src/devices/sound/fmopl.h
@@ -16,7 +16,7 @@
/* select output bits size of output : 8 or 16 */
#define OPL_SAMPLE_BITS 16
-typedef stream_sample_t OPLSAMPLE;
+typedef s32 OPLSAMPLE;
/*
#if (OPL_SAMPLE_BITS==16)
typedef int16_t OPLSAMPLE;
diff --git a/src/devices/sound/ics2115.cpp b/src/devices/sound/ics2115.cpp
index 80e4aa9cd09..868bcb70bc4 100644
--- a/src/devices/sound/ics2115.cpp
+++ b/src/devices/sound/ics2115.cpp
@@ -443,7 +443,7 @@ void ics2115_device::sound_stream_update(sound_stream &stream, std::vector<read_
/*
#ifdef ICS2115_DEBUG
u32 curaddr = ((voice.osc.saddr << 20) & 0xffffff) | (voice.osc.acc >> 12);
- stream_sample_t sample = get_sample(voice);
+ s32 sample = get_sample(voice);
logerror("[%06x=%04x]", curaddr, (s16)sample);
#endif
*/
diff --git a/src/devices/sound/k053260.cpp b/src/devices/sound/k053260.cpp
index 0032d834df6..7337b0c8b91 100644
--- a/src/devices/sound/k053260.cpp
+++ b/src/devices/sound/k053260.cpp
@@ -311,7 +311,7 @@ void k053260_device::sound_stream_update(sound_stream &stream, std::vector<read_
{
for ( int j = 0; j < outputs[0].samples(); j++ )
{
- stream_sample_t buffer[2] = {0, 0};
+ s32 buffer[2] = {0, 0};
for (auto & voice : m_voice)
{
@@ -435,7 +435,7 @@ void k053260_device::KDSC_Voice::key_off()
m_playing = false;
}
-void k053260_device::KDSC_Voice::play(stream_sample_t *outputs)
+void k053260_device::KDSC_Voice::play(s32 *outputs)
{
m_counter += CLOCKS_PER_SAMPLE;
diff --git a/src/devices/sound/k053260.h b/src/devices/sound/k053260.h
index a50b8b9196e..ad14244ceb9 100644
--- a/src/devices/sound/k053260.h
+++ b/src/devices/sound/k053260.h
@@ -79,7 +79,7 @@ private:
inline void update_pan_volume();
inline void key_on();
inline void key_off();
- inline void play(stream_sample_t *outputs);
+ inline void play(s32 *outputs);
inline bool playing() { return m_playing; }
inline u8 read_rom(bool side_effects);
diff --git a/src/devices/sound/mos6560.cpp b/src/devices/sound/mos6560.cpp
index e551df0a93d..fadef01dd20 100644
--- a/src/devices/sound/mos6560.cpp
+++ b/src/devices/sound/mos6560.cpp
@@ -173,20 +173,18 @@ inline uint8_t mos6560_device::read_colorram(offs_t offset)
void mos6560_device::draw_character( int ybegin, int yend, int ch, int yoff, int xoff, uint16_t *color )
{
- int y, code;
-
- for (y = ybegin; y <= yend; y++)
+ for (int y = ybegin; y <= yend; y++)
{
- code = read_videoram((m_chargenaddr + ch * m_charheight + y) & 0x3fff);
-
- m_bitmap.pix32(y + yoff, xoff + 0) = PALETTE_MOS[color[code >> 7]];
- m_bitmap.pix32(y + yoff, xoff + 1) = PALETTE_MOS[color[(code >> 6) & 1]];
- m_bitmap.pix32(y + yoff, xoff + 2) = PALETTE_MOS[color[(code >> 5) & 1]];
- m_bitmap.pix32(y + yoff, xoff + 3) = PALETTE_MOS[color[(code >> 4) & 1]];
- m_bitmap.pix32(y + yoff, xoff + 4) = PALETTE_MOS[color[(code >> 3) & 1]];
- m_bitmap.pix32(y + yoff, xoff + 5) = PALETTE_MOS[color[(code >> 2) & 1]];
- m_bitmap.pix32(y + yoff, xoff + 6) = PALETTE_MOS[color[(code >> 1) & 1]];
- m_bitmap.pix32(y + yoff, xoff + 7) = PALETTE_MOS[color[code & 1]];
+ int code = read_videoram((m_chargenaddr + ch * m_charheight + y) & 0x3fff);
+
+ m_bitmap.pix(y + yoff, xoff + 0) = PALETTE_MOS[color[BIT(code, 7)]];
+ m_bitmap.pix(y + yoff, xoff + 1) = PALETTE_MOS[color[BIT(code, 6)]];
+ m_bitmap.pix(y + yoff, xoff + 2) = PALETTE_MOS[color[BIT(code, 5)]];
+ m_bitmap.pix(y + yoff, xoff + 3) = PALETTE_MOS[color[BIT(code, 4)]];
+ m_bitmap.pix(y + yoff, xoff + 4) = PALETTE_MOS[color[BIT(code, 3)]];
+ m_bitmap.pix(y + yoff, xoff + 5) = PALETTE_MOS[color[BIT(code, 2)]];
+ m_bitmap.pix(y + yoff, xoff + 6) = PALETTE_MOS[color[BIT(code, 1)]];
+ m_bitmap.pix(y + yoff, xoff + 7) = PALETTE_MOS[color[BIT(code, 0)]];
}
}
@@ -197,20 +195,18 @@ void mos6560_device::draw_character( int ybegin, int yend, int ch, int yoff, int
void mos6560_device::draw_character_multi( int ybegin, int yend, int ch, int yoff, int xoff, uint16_t *color )
{
- int y, code;
-
- for (y = ybegin; y <= yend; y++)
+ for (int y = ybegin; y <= yend; y++)
{
- code = read_videoram((m_chargenaddr + ch * m_charheight + y) & 0x3fff);
-
- m_bitmap.pix32(y + yoff, xoff + 0) =
- m_bitmap.pix32(y + yoff, xoff + 1) = PALETTE_MOS[color[code >> 6]];
- m_bitmap.pix32(y + yoff, xoff + 2) =
- m_bitmap.pix32(y + yoff, xoff + 3) = PALETTE_MOS[color[(code >> 4) & 3]];
- m_bitmap.pix32(y + yoff, xoff + 4) =
- m_bitmap.pix32(y + yoff, xoff + 5) = PALETTE_MOS[color[(code >> 2) & 3]];
- m_bitmap.pix32(y + yoff, xoff + 6) =
- m_bitmap.pix32(y + yoff, xoff + 7) = PALETTE_MOS[color[code & 3]];
+ int code = read_videoram((m_chargenaddr + ch * m_charheight + y) & 0x3fff);
+
+ m_bitmap.pix(y + yoff, xoff + 0) = m_bitmap.pix(y + yoff, xoff + 1) =
+ PALETTE_MOS[color[code >> 6]];
+ m_bitmap.pix(y + yoff, xoff + 2) = m_bitmap.pix(y + yoff, xoff + 3) =
+ PALETTE_MOS[color[(code >> 4) & 3]];
+ m_bitmap.pix(y + yoff, xoff + 4) = m_bitmap.pix(y + yoff, xoff + 5) =
+ PALETTE_MOS[color[(code >> 2) & 3]];
+ m_bitmap.pix(y + yoff, xoff + 6) = m_bitmap.pix(y + yoff, xoff + 7) =
+ PALETTE_MOS[color[code & 3]];
}
}
@@ -221,9 +217,7 @@ void mos6560_device::draw_character_multi( int ybegin, int yend, int ch, int yof
void mos6560_device::drawlines( int first, int last )
{
- int line, vline;
- int offs, yoff, xoff, ybegin, yend, i, j;
- int attr, ch;
+ int line;
m_lastline = last;
if (first >= last)
@@ -231,12 +225,13 @@ void mos6560_device::drawlines( int first, int last )
for (line = first; (line < m_ypos) && (line < last); line++)
{
- for (j = 0; j < m_total_xsize; j++)
- m_bitmap.pix32(line, j) = PALETTE_MOS[m_framecolor];
+ for (int j = 0; j < m_total_xsize; j++)
+ m_bitmap.pix(line, j) = PALETTE_MOS[m_framecolor];
}
- for (vline = line - m_ypos; (line < last) && (line < m_ypos + m_ysize);)
+ for (int vline = line - m_ypos; (line < last) && (line < m_ypos + m_ysize);)
{
+ int offs, yoff, xoff, ybegin, yend;
if (m_matrix8x16)
{
offs = (vline >> 4) * m_chars_x;
@@ -254,16 +249,16 @@ void mos6560_device::drawlines( int first, int last )
if (m_xpos > 0)
{
- for (i = ybegin; i <= yend; i++)
- for (j = 0; j < m_xpos; j++)
- m_bitmap.pix32(yoff + i, j) = PALETTE_MOS[m_framecolor];
+ for (int i = ybegin; i <= yend; i++)
+ for (int j = 0; j < m_xpos; j++)
+ m_bitmap.pix(yoff + i, j) = PALETTE_MOS[m_framecolor];
}
for (xoff = m_xpos; (xoff < m_xpos + m_xsize) && (xoff < m_total_xsize); xoff += 8, offs++)
{
- ch = read_videoram((m_videoaddr + offs) & 0x3fff);
+ int ch = read_videoram((m_videoaddr + offs) & 0x3fff);
- attr = (read_colorram((m_videoaddr + offs) & 0x3fff)) & 0xf;
+ int attr = (read_colorram((m_videoaddr + offs) & 0x3fff)) & 0xf;
if (m_variant == TYPE_ATTACK_UFO)
{
@@ -301,9 +296,9 @@ void mos6560_device::drawlines( int first, int last )
if (xoff < m_total_xsize)
{
- for (i = ybegin; i <= yend; i++)
- for (j = xoff; j < m_total_xsize; j++)
- m_bitmap.pix32(yoff + i, j) = PALETTE_MOS[m_framecolor];
+ for (int i = ybegin; i <= yend; i++)
+ for (int j = xoff; j < m_total_xsize; j++)
+ m_bitmap.pix(yoff + i, j) = PALETTE_MOS[m_framecolor];
}
if (m_matrix8x16)
@@ -319,8 +314,8 @@ void mos6560_device::drawlines( int first, int last )
}
for (; line < last; line++)
- for (j = 0; j < m_total_xsize; j++)
- m_bitmap.pix32(line, j) = PALETTE_MOS[m_framecolor];
+ for (int j = 0; j < m_total_xsize; j++)
+ m_bitmap.pix(line, j) = PALETTE_MOS[m_framecolor];
}
diff --git a/src/devices/sound/mos7360.cpp b/src/devices/sound/mos7360.cpp
index 993cade8ec2..aa9604b3a78 100644
--- a/src/devices/sound/mos7360.cpp
+++ b/src/devices/sound/mos7360.cpp
@@ -513,106 +513,93 @@ void mos7360_device::sound_stream_update(sound_stream &stream, std::vector<read_
void mos7360_device::draw_character(int ybegin, int yend, int ch, int yoff, int xoff, uint16_t *color)
{
- int y, code;
-
- for (y = ybegin; y <= yend; y++)
+ for (int y = ybegin; y <= yend; y++)
{
+ int code;
if (INROM)
code = read_rom(m_chargenaddr + ch * 8 + y);
else
code = read_ram(m_chargenaddr + ch * 8 + y);
- m_bitmap.pix32(y + yoff, 0 + xoff) = PALETTE_MOS[color[code >> 7]];
- m_bitmap.pix32(y + yoff, 1 + xoff) = PALETTE_MOS[color[(code >> 6) & 1]];
- m_bitmap.pix32(y + yoff, 2 + xoff) = PALETTE_MOS[color[(code >> 5) & 1]];
- m_bitmap.pix32(y + yoff, 3 + xoff) = PALETTE_MOS[color[(code >> 4) & 1]];
- m_bitmap.pix32(y + yoff, 4 + xoff) = PALETTE_MOS[color[(code >> 3) & 1]];
- m_bitmap.pix32(y + yoff, 5 + xoff) = PALETTE_MOS[color[(code >> 2) & 1]];
- m_bitmap.pix32(y + yoff, 6 + xoff) = PALETTE_MOS[color[(code >> 1) & 1]];
- m_bitmap.pix32(y + yoff, 7 + xoff) = PALETTE_MOS[color[code & 1]];
+ m_bitmap.pix(y + yoff, 0 + xoff) = PALETTE_MOS[color[BIT(code, 7)]];
+ m_bitmap.pix(y + yoff, 1 + xoff) = PALETTE_MOS[color[BIT(code, 6)]];
+ m_bitmap.pix(y + yoff, 2 + xoff) = PALETTE_MOS[color[BIT(code, 5)]];
+ m_bitmap.pix(y + yoff, 3 + xoff) = PALETTE_MOS[color[BIT(code, 4)]];
+ m_bitmap.pix(y + yoff, 4 + xoff) = PALETTE_MOS[color[BIT(code, 3)]];
+ m_bitmap.pix(y + yoff, 5 + xoff) = PALETTE_MOS[color[BIT(code, 2)]];
+ m_bitmap.pix(y + yoff, 6 + xoff) = PALETTE_MOS[color[BIT(code, 1)]];
+ m_bitmap.pix(y + yoff, 7 + xoff) = PALETTE_MOS[color[BIT(code, 0)]];
}
}
void mos7360_device::draw_character_multi(int ybegin, int yend, int ch, int yoff, int xoff)
{
- int y, code;
-
- for (y = ybegin; y <= yend; y++)
+ for (int y = ybegin; y <= yend; y++)
{
+ int code;
if (INROM)
code = read_rom(m_chargenaddr + ch * 8 + y);
else
code = read_ram(m_chargenaddr + ch * 8 + y);
- m_bitmap.pix32(y + yoff, 0 + xoff) =
- m_bitmap.pix32(y + yoff, 1 + xoff) = PALETTE_MOS[m_multi[code >> 6]];
- m_bitmap.pix32(y + yoff, 2 + xoff) =
- m_bitmap.pix32(y + yoff, 3 + xoff) = PALETTE_MOS[m_multi[(code >> 4) & 3]];
- m_bitmap.pix32(y + yoff, 4 + xoff) =
- m_bitmap.pix32(y + yoff, 5 + xoff) = PALETTE_MOS[m_multi[(code >> 2) & 3]];
- m_bitmap.pix32(y + yoff, 6 + xoff) =
- m_bitmap.pix32(y + yoff, 7 + xoff) = PALETTE_MOS[m_multi[code & 3]];
+ m_bitmap.pix(y + yoff, 0 + xoff) = m_bitmap.pix(y + yoff, 1 + xoff) =
+ PALETTE_MOS[m_multi[code >> 6]];
+ m_bitmap.pix(y + yoff, 2 + xoff) = m_bitmap.pix(y + yoff, 3 + xoff) =
+ PALETTE_MOS[m_multi[(code >> 4) & 3]];
+ m_bitmap.pix(y + yoff, 4 + xoff) = m_bitmap.pix(y + yoff, 5 + xoff) =
+ PALETTE_MOS[m_multi[(code >> 2) & 3]];
+ m_bitmap.pix(y + yoff, 6 + xoff) = m_bitmap.pix(y + yoff, 7 + xoff) =
+ PALETTE_MOS[m_multi[code & 3]];
}
}
void mos7360_device::draw_bitmap(int ybegin, int yend, int ch, int yoff, int xoff)
{
- int y, code;
-
- for (y = ybegin; y <= yend; y++)
+ for (int y = ybegin; y <= yend; y++)
{
- code = read_ram(m_bitmapaddr + ch * 8 + y);
-
- m_bitmap.pix32(y + yoff, 0 + xoff) = PALETTE_MOS[m_c16_bitmap[code >> 7]];
- m_bitmap.pix32(y + yoff, 1 + xoff) = PALETTE_MOS[m_c16_bitmap[(code >> 6) & 1]];
- m_bitmap.pix32(y + yoff, 2 + xoff) = PALETTE_MOS[m_c16_bitmap[(code >> 5) & 1]];
- m_bitmap.pix32(y + yoff, 3 + xoff) = PALETTE_MOS[m_c16_bitmap[(code >> 4) & 1]];
- m_bitmap.pix32(y + yoff, 4 + xoff) = PALETTE_MOS[m_c16_bitmap[(code >> 3) & 1]];
- m_bitmap.pix32(y + yoff, 5 + xoff) = PALETTE_MOS[m_c16_bitmap[(code >> 2) & 1]];
- m_bitmap.pix32(y + yoff, 6 + xoff) = PALETTE_MOS[m_c16_bitmap[(code >> 1) & 1]];
- m_bitmap.pix32(y + yoff, 7 + xoff) = PALETTE_MOS[m_c16_bitmap[code & 1]];
+ int code = read_ram(m_bitmapaddr + ch * 8 + y);
+
+ m_bitmap.pix(y + yoff, 0 + xoff) = PALETTE_MOS[m_c16_bitmap[BIT(code, 7)]];
+ m_bitmap.pix(y + yoff, 1 + xoff) = PALETTE_MOS[m_c16_bitmap[BIT(code, 6)]];
+ m_bitmap.pix(y + yoff, 2 + xoff) = PALETTE_MOS[m_c16_bitmap[BIT(code, 5)]];
+ m_bitmap.pix(y + yoff, 3 + xoff) = PALETTE_MOS[m_c16_bitmap[BIT(code, 4)]];
+ m_bitmap.pix(y + yoff, 4 + xoff) = PALETTE_MOS[m_c16_bitmap[BIT(code, 3)]];
+ m_bitmap.pix(y + yoff, 5 + xoff) = PALETTE_MOS[m_c16_bitmap[BIT(code, 2)]];
+ m_bitmap.pix(y + yoff, 6 + xoff) = PALETTE_MOS[m_c16_bitmap[BIT(code, 1)]];
+ m_bitmap.pix(y + yoff, 7 + xoff) = PALETTE_MOS[m_c16_bitmap[BIT(code, 0)]];
}
}
void mos7360_device::draw_bitmap_multi(int ybegin, int yend, int ch, int yoff, int xoff)
{
- int y, code;
-
- for (y = ybegin; y <= yend; y++)
+ for (int y = ybegin; y <= yend; y++)
{
- code = read_ram(m_bitmapaddr + ch * 8 + y);
-
- m_bitmap.pix32(y + yoff, 0 + xoff) =
- m_bitmap.pix32(y + yoff, 1 + xoff) = PALETTE_MOS[m_bitmapmulti[code >> 6]];
- m_bitmap.pix32(y + yoff, 2 + xoff) =
- m_bitmap.pix32(y + yoff, 3 + xoff) = PALETTE_MOS[m_bitmapmulti[(code >> 4) & 3]];
- m_bitmap.pix32(y + yoff, 4 + xoff) =
- m_bitmap.pix32(y + yoff, 5 + xoff) = PALETTE_MOS[m_bitmapmulti[(code >> 2) & 3]];
- m_bitmap.pix32(y + yoff, 6 + xoff) =
- m_bitmap.pix32(y + yoff, 7 + xoff) = PALETTE_MOS[m_bitmapmulti[code & 3]];
+ int code = read_ram(m_bitmapaddr + ch * 8 + y);
+
+ m_bitmap.pix(y + yoff, 0 + xoff) = m_bitmap.pix(y + yoff, 1 + xoff) =
+ PALETTE_MOS[m_bitmapmulti[code >> 6]];
+ m_bitmap.pix(y + yoff, 2 + xoff) = m_bitmap.pix(y + yoff, 3 + xoff) =
+ PALETTE_MOS[m_bitmapmulti[(code >> 4) & 3]];
+ m_bitmap.pix(y + yoff, 4 + xoff) = m_bitmap.pix(y + yoff, 5 + xoff) =
+ PALETTE_MOS[m_bitmapmulti[(code >> 2) & 3]];
+ m_bitmap.pix(y + yoff, 6 + xoff) = m_bitmap.pix(y + yoff, 7 + xoff) =
+ PALETTE_MOS[m_bitmapmulti[code & 3]];
}
}
void mos7360_device::draw_cursor(int ybegin, int yend, int yoff, int xoff, int color)
{
- int y;
-
- for (y = ybegin; y <= yend; y++)
+ for (int y = ybegin; y <= yend; y++)
{
for (int x = 0; x < 8; x++)
{
- m_bitmap.pix32(y + yoff, x + xoff) = PALETTE_MOS[color];
+ m_bitmap.pix(y + yoff, x + xoff) = PALETTE_MOS[color];
}
}
}
void mos7360_device::drawlines(int first, int last)
{
- int line, vline, end;
- int attr, ch, c1, c2, ecm;
- int offs, yoff, xoff, ybegin, yend, xbegin, xend;
- int i;
-
m_lastline = last;
/* top part of display not rastered */
@@ -625,34 +612,44 @@ void mos7360_device::drawlines(int first, int last)
if (!SCREENON)
{
- for (line = first; (line < last) && (line < m_bitmap.height()); line++)
+ for (int line = first; (line < last) && (line < m_bitmap.height()); line++)
{
for (int x = 0; x < m_bitmap.width(); x++)
{
- m_bitmap.pix32(line, x) = PALETTE_MOS[FRAMECOLOR];
+ m_bitmap.pix(line, x) = PALETTE_MOS[FRAMECOLOR];
}
}
return;
}
+ int xbegin, xend;
if (COLUMNS40)
- xbegin = XPOS, xend = xbegin + 320;
+ {
+ xbegin = XPOS;
+ xend = xbegin + 320;
+ }
else
- xbegin = XPOS + 7, xend = xbegin + 304;
+ {
+ xbegin = XPOS + 7;
+ xend = xbegin + 304;
+ }
+ int end;
if (last < m_y_begin)
end = last;
else
end = m_y_begin + YPOS;
+
+ int line;
+ for (line = first; line < end; line++)
{
- for (line = first; line < end; line++)
+ for (int x = 0; x < m_bitmap.width(); x++)
{
- for (int x = 0; x < m_bitmap.width(); x++)
- {
- m_bitmap.pix32(line, x) = PALETTE_MOS[FRAMECOLOR];
- }
+ m_bitmap.pix(line, x) = PALETTE_MOS[FRAMECOLOR];
}
}
+
+ int vline;
if (LINES25)
vline = line - m_y_begin - YPOS;
else
@@ -663,23 +660,23 @@ void mos7360_device::drawlines(int first, int last)
else
end = m_y_end + YPOS;
- for (; line < end; vline = (vline + 8) & ~7, line = line + 1 + yend - ybegin)
+ for (int ybegin, yend; line < end; vline = (vline + 8) & ~7, line = line + 1 + yend - ybegin)
{
- offs = (vline >> 3) * 40;
+ int offs = (vline >> 3) * 40;
ybegin = vline & 7;
- yoff = line - ybegin;
+ int yoff = line - ybegin;
yend = (yoff + 7 < end) ? 7 : (end - yoff - 1);
/* rendering 39 characters */
/* left and right borders are overwritten later */
- for (xoff = m_x_begin + XPOS; xoff < m_x_end + XPOS; xoff += 8, offs++)
+ for (int xoff = m_x_begin + XPOS; xoff < m_x_end + XPOS; xoff += 8, offs++)
{
if (HIRESON)
{
- ch = read_ram((m_videoaddr | 0x400) + offs);
- attr = read_ram(m_videoaddr + offs);
- c1 = ((ch >> 4) & 0xf) | (attr << 4);
- c2 = (ch & 0xf) | (attr & 0x70);
+ int ch = read_ram((m_videoaddr | 0x400) + offs);
+ int attr = read_ram(m_videoaddr + offs);
+ int c1 = ((ch >> 4) & 0xf) | (attr << 4);
+ int c2 = (ch & 0xf) | (attr & 0x70);
m_bitmapmulti[1] = m_c16_bitmap[1] = c1 & 0x7f;
m_bitmapmulti[2] = m_c16_bitmap[0] = c2 & 0x7f;
if (MULTICOLORON)
@@ -693,13 +690,13 @@ void mos7360_device::drawlines(int first, int last)
}
else
{
- ch = read_ram((m_videoaddr | 0x400) + offs);
- attr = read_ram(m_videoaddr + offs);
+ int ch = read_ram((m_videoaddr | 0x400) + offs);
+ int attr = read_ram(m_videoaddr + offs);
// levente harsfalvi's docu says cursor off in ecm and multicolor
if (ECMON)
{
// hardware reverse off
- ecm = ch >> 6;
+ int ecm = ch >> 6;
m_ecmcolor[0] = m_colors[ecm];
m_ecmcolor[1] = attr & 0x7f;
draw_character(ybegin, yend, ch & ~0xc0, yoff, xoff, m_ecmcolor);
@@ -741,16 +738,16 @@ void mos7360_device::drawlines(int first, int last)
}
}
- for (i = ybegin; i <= yend; i++)
+ for (int i = ybegin; i <= yend; i++)
{
for (int x = 0; x < xbegin; x++)
{
- m_bitmap.pix32(yoff + i, x) = PALETTE_MOS[FRAMECOLOR];
+ m_bitmap.pix(yoff + i, x) = PALETTE_MOS[FRAMECOLOR];
}
for (int x = xend; x < m_bitmap.width(); x++)
{
- m_bitmap.pix32(yoff + i, x) = PALETTE_MOS[FRAMECOLOR];
+ m_bitmap.pix(yoff + i, x) = PALETTE_MOS[FRAMECOLOR];
}
}
}
@@ -764,7 +761,7 @@ void mos7360_device::drawlines(int first, int last)
{
for (int x = 0; x < m_bitmap.width(); x++)
{
- m_bitmap.pix32(line, x) = PALETTE_MOS[FRAMECOLOR];
+ m_bitmap.pix(line, x) = PALETTE_MOS[FRAMECOLOR];
}
}
}
diff --git a/src/devices/sound/nes_apu.cpp b/src/devices/sound/nes_apu.cpp
index f7b4772ddb7..483b337475f 100644
--- a/src/devices/sound/nes_apu.cpp
+++ b/src/devices/sound/nes_apu.cpp
@@ -83,8 +83,8 @@ void nesapu_device::create_syncs(unsigned long sps)
DEFINE_DEVICE_TYPE(NES_APU, nesapu_device, "nesapu", "N2A03 APU")
-nesapu_device::nesapu_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
- : device_t(mconfig, NES_APU, tag, owner, clock)
+nesapu_device::nesapu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock)
+ : device_t(mconfig, type, tag, owner, clock)
, device_sound_interface(mconfig, *this)
, m_samps_per_sync(0)
, m_buffer_size(0)
@@ -108,6 +108,11 @@ nesapu_device::nesapu_device(const machine_config &mconfig, const char *tag, dev
}
}
+nesapu_device::nesapu_device(const machine_config& mconfig, const char* tag, device_t* owner, u32 clock)
+ : nesapu_device(mconfig, NES_APU, tag, owner, clock)
+{
+}
+
void nesapu_device::device_reset()
{
write(0x15, 0x00);
diff --git a/src/devices/sound/nes_apu.h b/src/devices/sound/nes_apu.h
index 1539f44beab..673c967fec7 100644
--- a/src/devices/sound/nes_apu.h
+++ b/src/devices/sound/nes_apu.h
@@ -56,6 +56,8 @@ public:
void write(offs_t offset, u8 data);
protected:
+ nesapu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
// device-level overrides
virtual void device_start() override;
diff --git a/src/devices/sound/nes_apu_vt.cpp b/src/devices/sound/nes_apu_vt.cpp
new file mode 100644
index 00000000000..f93c3203bac
--- /dev/null
+++ b/src/devices/sound/nes_apu_vt.cpp
@@ -0,0 +1,28 @@
+// license:BSD-3-Clause
+// copyright-holders:David Haywood
+
+// The XOP is the NES APU type found in VT platforms, it roughly doubles the functionality of the APU
+// but in ways that means simply installing 2 APU devices isn't entirely correct (registers on one
+// APU module having an effect on the other)
+
+// TODO: everything
+
+#include "emu.h"
+#include "sound/nes_apu_vt.h"
+
+DEFINE_DEVICE_TYPE(NES_APU_VT, nes_apu_vt_device, "nes_apu_vt", "XOP APU")
+
+nes_apu_vt_device::nes_apu_vt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : nesapu_device(mconfig, NES_APU_VT, tag, owner, clock)
+{
+}
+
+void nes_apu_vt_device::device_start()
+{
+ nesapu_device::device_start();
+}
+
+void nes_apu_vt_device::device_reset()
+{
+ nesapu_device::device_reset();
+}
diff --git a/src/devices/sound/nes_apu_vt.h b/src/devices/sound/nes_apu_vt.h
new file mode 100644
index 00000000000..f93616673fa
--- /dev/null
+++ b/src/devices/sound/nes_apu_vt.h
@@ -0,0 +1,26 @@
+// license:BSD-3-Clause
+// copyright-holders:David Haywood
+
+#ifndef MAME_AUDIO_NES_VT_APU_H
+#define MAME_AUDIO_NES_VT_APU_H
+
+#pragma once
+
+#include "sound/nes_apu.h"
+
+DECLARE_DEVICE_TYPE(NES_APU_VT, nes_apu_vt_device)
+
+class nes_apu_vt_device : public nesapu_device
+{
+public:
+ // construction/destruction
+ nes_apu_vt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ virtual void device_start() override;
+ virtual void device_reset() override;
+
+private:
+};
+
+#endif // MAME_AUDIO_NES_VT_APU_H
diff --git a/src/devices/sound/s_dsp.cpp b/src/devices/sound/s_dsp.cpp
index 52d255dbfc6..98cd204b503 100644
--- a/src/devices/sound/s_dsp.cpp
+++ b/src/devices/sound/s_dsp.cpp
@@ -1074,7 +1074,7 @@ void s_dsp_device::sound_stream_update(sound_stream &stream, std::vector<read_st
dsp_update(mix);
/* Update the buffers */
- outputs[0].put_int(i, (stream_sample_t)mix[0], 32768);
- outputs[1].put_int(i, (stream_sample_t)mix[1], 32768);
+ outputs[0].put_int(i, (s32)mix[0], 32768);
+ outputs[1].put_int(i, (s32)mix[1], 32768);
}
}
diff --git a/src/devices/sound/vgm_visualizer.cpp b/src/devices/sound/vgm_visualizer.cpp
index c1f438f2b2c..bab3c909ddf 100644
--- a/src/devices/sound/vgm_visualizer.cpp
+++ b/src/devices/sound/vgm_visualizer.cpp
@@ -158,7 +158,7 @@ void vgmviz_device::apply_fft()
void vgmviz_device::apply_waterfall()
{
- int total_bars = FFT_LENGTH / 2;
+ const int total_bars = FFT_LENGTH / 2;
WDL_FFT_COMPLEX* bins[2] = { (WDL_FFT_COMPLEX*)m_fft_buf[0], (WDL_FFT_COMPLEX*)m_fft_buf[1] };
for (int bar = 0; bar < std::min<int>(total_bars, SCREEN_HEIGHT); bar++)
{
@@ -555,7 +555,7 @@ template <int BarSize, int SpecMode> void vgmviz_device::draw_spectrogram(bitmap
m_clear_pending = false;
}
- const pen_t *pal = m_palette->pens();
+ pen_t const *const pal = m_palette->pens();
int width = SCREEN_WIDTH;
switch (SpecMode)
@@ -563,31 +563,26 @@ template <int BarSize, int SpecMode> void vgmviz_device::draw_spectrogram(bitmap
case SPEC_VIZ_PILLAR:
for (int y = 2; y < SCREEN_HEIGHT; y++)
{
- uint32_t *src = &m_bitmap.pix32(y);
- uint32_t *dst = &bitmap.pix32(y - 2);
+ uint32_t const *const src = &m_bitmap.pix(y);
+ uint32_t *const dst = &bitmap.pix(y - 2);
for (int x = SCREEN_WIDTH - 1; x >= 1; x--)
{
dst[x] = src[x - 1];
}
}
- width = (int)(SCREEN_WIDTH * 0.75f);
+ width = int(SCREEN_WIDTH * 0.75f);
break;
case SPEC_VIZ_TOP:
for (int y = 1; y < SCREEN_HEIGHT; y++)
{
- uint32_t *src = &m_bitmap.pix32(y);
- uint32_t *dst = &bitmap.pix32(y - 1);
- for (int x = 0; x < SCREEN_WIDTH; x++)
- {
- dst[x] = src[x];
- }
+ std::copy_n(&m_bitmap.pix(y), SCREEN_WIDTH, &bitmap.pix(y - 1));
}
break;
default:
break;
}
- int total_bars = FFT_LENGTH / 2;
+ const int total_bars = FFT_LENGTH / 2;
WDL_FFT_COMPLEX *bins[2] = { (WDL_FFT_COMPLEX *)m_fft_buf[0], (WDL_FFT_COMPLEX *)m_fft_buf[1] };
for (int bar = 2; bar < total_bars && bar < width; bar += BarSize)
@@ -614,8 +609,8 @@ template <int BarSize, int SpecMode> void vgmviz_device::draw_spectrogram(bitmap
}
for (int y = 0; y < SCREEN_HEIGHT; y++)
{
- int bar_y = SCREEN_HEIGHT - y;
- uint32_t *line = &bitmap.pix32(y);
+ const int bar_y = SCREEN_HEIGHT - y;
+ uint32_t *const line = &bitmap.pix(y);
for (int x = 0; x < BarSize; x++)
{
line[(bar - 2) + x] = bar_y <= level ? pal[256 + pal_index] : pal[black_index];
@@ -631,8 +626,8 @@ template <int BarSize, int SpecMode> void vgmviz_device::draw_spectrogram(bitmap
for (int y = 0; y < SCREEN_HEIGHT; y++)
{
- int bar_y = SCREEN_HEIGHT - y;
- uint32_t *line = &bitmap.pix32(y);
+ const int bar_y = SCREEN_HEIGHT - y;
+ uint32_t *const line = &bitmap.pix(y);
line[0] = 0;
if (bar_y > level)
{
@@ -643,9 +638,9 @@ template <int BarSize, int SpecMode> void vgmviz_device::draw_spectrogram(bitmap
{
if (bar_y < (level - 1))
{
- const uint8_t r = (uint8_t)(((entry >> 16) & 0xff) * 0.75f);
- const uint8_t g = (uint8_t)(((entry >> 8) & 0xff) * 0.75f);
- const uint8_t b = (uint8_t)(((entry >> 0) & 0xff) * 0.75f);
+ const uint8_t r = uint8_t(((entry >> 16) & 0xff) * 0.75f);
+ const uint8_t g = uint8_t(((entry >> 8) & 0xff) * 0.75f);
+ const uint8_t b = uint8_t(((entry >> 0) & 0xff) * 0.75f);
line[(bar - 2) + x] = 0xff000000 | (r << 16) | (g << 8) | b;
}
else
@@ -653,9 +648,9 @@ template <int BarSize, int SpecMode> void vgmviz_device::draw_spectrogram(bitmap
line[(bar - 2) + x] = pal[256 + pal_index];
}
}
- const uint8_t r = (uint8_t)(((entry >> 16) & 0xff) * 0.5f);
- const uint8_t g = (uint8_t)(((entry >> 8) & 0xff) * 0.5f);
- const uint8_t b = (uint8_t)(((entry >> 0) & 0xff) * 0.5f);
+ const uint8_t r = uint8_t(((entry >> 16) & 0xff) * 0.5f);
+ const uint8_t g = uint8_t(((entry >> 8) & 0xff) * 0.5f);
+ const uint8_t b = uint8_t(((entry >> 0) & 0xff) * 0.5f);
line[(bar - 2) + (BarSize - 1)] = 0xff000000 | (r << 16) | (g << 8) | b;
if (bar_y < level)
{
@@ -664,10 +659,11 @@ template <int BarSize, int SpecMode> void vgmviz_device::draw_spectrogram(bitmap
}
for (int x = 0; x < SCREEN_WIDTH; x++)
{
- bitmap.pix32(SCREEN_HEIGHT - 1, x) = 0;
- bitmap.pix32(SCREEN_HEIGHT - 2, x) = 0;
+ bitmap.pix(SCREEN_HEIGHT - 1, x) = 0;
+ bitmap.pix(SCREEN_HEIGHT - 2, x) = 0;
}
- memcpy(&m_bitmap.pix32(0), &bitmap.pix32(0), sizeof(uint32_t) * SCREEN_WIDTH * SCREEN_HEIGHT);
+ for (int y = 0; y < SCREEN_HEIGHT; y++)
+ std::copy_n(&bitmap.pix(y), SCREEN_WIDTH, &m_bitmap.pix(y));
break;
case SPEC_VIZ_TOP:
level = int(raw_level * 63.0f);
@@ -678,10 +674,11 @@ template <int BarSize, int SpecMode> void vgmviz_device::draw_spectrogram(bitmap
for (int x = 0; x < BarSize; x++)
{
- bitmap.pix32(SCREEN_HEIGHT - 1, (bar - 2) + x) = level > 0 ? pal[256 + pal_index] : pal[black_index];
+ bitmap.pix(SCREEN_HEIGHT - 1, (bar - 2) + x) = level > 0 ? pal[256 + pal_index] : pal[black_index];
}
- memcpy(&m_bitmap.pix32(0), &bitmap.pix32(0), sizeof(uint32_t) * SCREEN_WIDTH * SCREEN_HEIGHT);
+ for (int y = 0; y < SCREEN_HEIGHT; y++)
+ std::copy_n(&bitmap.pix(y), SCREEN_WIDTH, &m_bitmap.pix(y));
break;
}
}
@@ -700,7 +697,7 @@ void vgmviz_device::draw_waterfall(bitmap_rgb32 &bitmap)
const int v0_index = (int)v0h;
const int v1_index = (int)v1h;
const float interp = v0h - (float)v0_index;
- uint32_t* line = &bitmap.pix32(y);
+ uint32_t* line = &bitmap.pix(y);
for (int x = 0; x < SCREEN_WIDTH; x++)
{
if (m_waterfall_length < SCREEN_WIDTH)
@@ -736,8 +733,8 @@ void vgmviz_device::draw_waveform(bitmap_rgb32 &bitmap)
for (int x = 0; x < SCREEN_WIDTH; x++)
{
- bitmap.pix32(CHANNEL_CENTER, x) = MED_GRAY;
- bitmap.pix32(CHANNEL_HEIGHT + 1 + CHANNEL_CENTER, x) = MED_GRAY;
+ bitmap.pix(CHANNEL_CENTER, x) = MED_GRAY;
+ bitmap.pix(CHANNEL_HEIGHT + 1 + CHANNEL_CENTER, x) = MED_GRAY;
const float raw_l = m_audio_buf[1 - m_audio_fill_index][0][((int)m_history_length + 1 + x) % FFT_LENGTH];
const int sample_l = (int)((raw_l - 0.5f) * (CHANNEL_HEIGHT - 1));
@@ -746,7 +743,7 @@ void vgmviz_device::draw_waveform(bitmap_rgb32 &bitmap)
int y = endy_l - sample_l;
do
{
- bitmap.pix32(y, x) = LEFT_COLOR;
+ bitmap.pix(y, x) = LEFT_COLOR;
y += dy_l;
} while(y != endy_l);
@@ -757,11 +754,11 @@ void vgmviz_device::draw_waveform(bitmap_rgb32 &bitmap)
y = endy_r - sample_r;
do
{
- bitmap.pix32(y, x) = RIGHT_COLOR;
+ bitmap.pix(y, x) = RIGHT_COLOR;
y += dy_r;
} while(y != endy_r);
- bitmap.pix32(CHANNEL_HEIGHT, x) = WHITE;
- bitmap.pix32(CHANNEL_HEIGHT + 1, x) = WHITE;
+ bitmap.pix(CHANNEL_HEIGHT, x) = WHITE;
+ bitmap.pix(CHANNEL_HEIGHT + 1, x) = WHITE;
}
}
diff --git a/src/devices/sound/ymf262.h b/src/devices/sound/ymf262.h
index 3c02e0da16c..fe131169fcf 100644
--- a/src/devices/sound/ymf262.h
+++ b/src/devices/sound/ymf262.h
@@ -8,7 +8,7 @@
/* select number of output bits: 8 or 16 */
#define OPL3_SAMPLE_BITS 16
-typedef stream_sample_t OPL3SAMPLE;
+typedef s32 OPL3SAMPLE;
/*
#if (OPL3_SAMPLE_BITS==16)
typedef int16_t OPL3SAMPLE;