mirror of
https://github.com/holub/mame
synced 2025-04-21 07:52:35 +03:00
sblaster: support more playback commands (nw)
gus: active channels are numbered from 0 (nw) hp95lx: add DAC (nw)
This commit is contained in:
parent
536652387f
commit
8becbe6e2e
@ -592,7 +592,7 @@ READ8_MEMBER(gf1_device::global_reg_data_r)
|
||||
return m_voice[m_current_voice].vol_ramp_ctrl;
|
||||
case 0x8e: // Active voices (6 bits, high 2 bits are always 1)
|
||||
if(offset == 1)
|
||||
return m_active_voices | 0xc0;
|
||||
return (m_active_voices - 1) | 0xc0;
|
||||
case 0x8f: // IRQ source register
|
||||
if(offset == 1)
|
||||
{
|
||||
@ -738,15 +738,15 @@ WRITE8_MEMBER(gf1_device::global_reg_data_w)
|
||||
case 0x0e: // Active voices (6 bits, high 2 bits are always 1)
|
||||
if(offset == 1)
|
||||
{
|
||||
m_active_voices = data & 0x3f;
|
||||
if((data & 0x3f) < 14)
|
||||
m_active_voices = (data & 0x3f) + 1;
|
||||
if(m_active_voices < 14)
|
||||
m_active_voices = 14;
|
||||
if((data & 0x3f) > 32)
|
||||
if(m_active_voices > 32)
|
||||
m_active_voices = 32;
|
||||
m_stream->set_sample_rate(rate_table[m_active_voices]);
|
||||
m_voltimer->adjust(attotime::zero,0,attotime::from_usec(1000/(1.6*m_active_voices)));
|
||||
}
|
||||
logerror("GUS: Active Voices write %02x (%i Hz)\n", data, rate_table[m_active_voices]);
|
||||
logerror("GUS: Active Voices write %02x (%d voices at %u Hz)\n", data, m_active_voices, rate_table[m_active_voices]);
|
||||
break;
|
||||
case 0x41:
|
||||
/* bit 0 - Enable the DMA channel.
|
||||
@ -826,7 +826,7 @@ WRITE8_MEMBER(gf1_device::global_reg_data_w)
|
||||
{
|
||||
m_timer1_count = data;
|
||||
m_timer1_value = data;
|
||||
logerror("GUS: Timer 1 count write %02x\n",data);
|
||||
logerror("GUS: Timer 1 count write %02x (%d usec)\n",data,data*80);
|
||||
}
|
||||
break;
|
||||
case 0x47: // Timer 2 count
|
||||
@ -834,7 +834,7 @@ WRITE8_MEMBER(gf1_device::global_reg_data_w)
|
||||
{
|
||||
m_timer2_count = data;
|
||||
m_timer2_value = data;
|
||||
logerror("GUS: Timer 2 count write %02x\n",data);
|
||||
logerror("GUS: Timer 2 count write %02x (%d usec)\n",data,data*320);
|
||||
}
|
||||
break;
|
||||
case 0x48: // Sampling Frequency - 9878400/(16*(FREQ+2))
|
||||
|
@ -66,10 +66,10 @@ static const int m_cmd_fifo_length[256] =
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 6x */
|
||||
-1, -1, -1, -1, 3, 3, 3, 3, -1, -1, -1, -1, -1, 1, -1, 1, /* 7x */
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 8x */
|
||||
1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 9x */
|
||||
1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 9x */
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* Ax */
|
||||
4, -1, -1, -1, -1, -1, 4, -1, 4, -1, -1, -1, -1, -1, 4, -1, /* Bx */
|
||||
4, -1, -1, -1, -1, -1, 4, -1, 4, -1, -1, -1, -1, -1, 4, -1, /* Cx */
|
||||
4, -1, 4, -1, 4, -1, 4, -1, 4, -1, -1, -1, -1, -1, 4, -1, /* Bx */
|
||||
4, -1, 4, -1, 4, -1, 4, -1, 4, -1, -1, -1, -1, -1, 4, -1, /* Cx */
|
||||
1, 1, -1, 1, -1, 1, 1, -1, 1, 1, 1, -1, -1, -1, -1, -1, /* Dx */
|
||||
2, 1, 2, 1, 2, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, /* Ex */
|
||||
-1, -1, 1, -1, -1, -1, -1, -1, 1, -1, -1, -1, 1, -1, -1, -1 /* Fx */
|
||||
@ -331,6 +331,7 @@ void sb_device::process_fifo(uint8_t cmd)
|
||||
break;
|
||||
|
||||
case 0x14: // 8-bit DMA, no autoinit
|
||||
case 0x91: // 8-bit DMA, no autoinit, high speed. XXX only on DSP 3.xx
|
||||
m_dsp.dma_length = (m_dsp.fifo[1] + (m_dsp.fifo[2]<<8)) + 1;
|
||||
// printf("Start DMA (not autoinit, size = %x)\n", m_dsp.dma_length);
|
||||
m_dsp.dma_transferred = 0;
|
||||
@ -578,8 +579,12 @@ void sb_device::process_fifo(uint8_t cmd)
|
||||
m_dsp.dma_autoinit = 0;
|
||||
break;
|
||||
case 0xb0:
|
||||
case 0xb2:
|
||||
case 0xb4:
|
||||
case 0xb6:
|
||||
case 0xc0:
|
||||
case 0xc2:
|
||||
case 0xc4:
|
||||
case 0xc6:
|
||||
mode = m_dsp.fifo[1];
|
||||
m_dsp.flags = 0;
|
||||
|
@ -65,17 +65,20 @@
|
||||
#include "cpu/nec/nec.h"
|
||||
#include "machine/bankdev.h"
|
||||
#include "machine/ram.h"
|
||||
#include "sound/dac.h"
|
||||
#include "sound/volt_reg.h"
|
||||
|
||||
#include "screen.h"
|
||||
#include "emupal.h"
|
||||
#include "softlist.h"
|
||||
#include "speaker.h"
|
||||
|
||||
|
||||
//#define LOG_GENERAL (1U << 0) //defined in logmacro.h already
|
||||
#define LOG_KEYBOARD (1U << 1)
|
||||
#define LOG_DEBUG (1U << 2)
|
||||
|
||||
#define VERBOSE (LOG_DEBUG)
|
||||
//#define VERBOSE (LOG_GENERAL)
|
||||
//#define LOG_OUTPUT_FUNC printf
|
||||
#include "logmacro.h"
|
||||
|
||||
@ -103,6 +106,7 @@ public:
|
||||
, m_isabus(*this, "isa")
|
||||
, m_pic8259(*this, "pic8259")
|
||||
, m_pit8254(*this, "pit8254")
|
||||
, m_dac(*this, "dac")
|
||||
, m_screen(*this, "screen")
|
||||
, m_p_videoram(*this, "video")
|
||||
, m_p_chargen(*this, "gfx1")
|
||||
@ -133,6 +137,7 @@ protected:
|
||||
required_device<isa8_device> m_isabus;
|
||||
required_device<pic8259_device> m_pic8259;
|
||||
required_device<pit8254_device> m_pit8254;
|
||||
required_device<dac_8bit_r2r_device> m_dac;
|
||||
required_device<screen_device> m_screen;
|
||||
|
||||
private:
|
||||
@ -287,6 +292,8 @@ void hp95lx_state::machine_reset()
|
||||
m_kbit = 0;
|
||||
m_scancode = 0;
|
||||
m_kbdflag = 0;
|
||||
|
||||
m_dac->write(0x7f);
|
||||
}
|
||||
|
||||
|
||||
@ -356,6 +363,7 @@ WRITE8_MEMBER(hp95lx_state::e300_w)
|
||||
break;
|
||||
|
||||
case 5: // DAC out (per snd.c)
|
||||
m_dac->write(data);
|
||||
break;
|
||||
|
||||
case 9: // b1 = 'a2d power' (per snd.c)
|
||||
@ -746,6 +754,13 @@ void hp95lx_state::hp95lx(machine_config &config)
|
||||
NVRAM(config, "nvram2", nvram_device::DEFAULT_ALL_0); // RAM
|
||||
NVRAM(config, "nvram3", nvram_device::DEFAULT_ALL_0); // card slot
|
||||
|
||||
SPEAKER(config, "speaker").front_center();
|
||||
DAC_8BIT_R2R(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.5); // unknown DAC
|
||||
|
||||
voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0));
|
||||
vref.add_route(0, m_dac, 1.0, DAC_VREF_POS_INPUT);
|
||||
vref.add_route(0, m_dac, -1.0, DAC_VREF_NEG_INPUT);
|
||||
|
||||
// XXX When the AC adapter is plugged in, the LCD refresh rate is 73.14 Hz.
|
||||
// XXX When the AC adapter is not plugged in (ie, running off of batteries) the refresh rate is 56.8 Hz.
|
||||
SCREEN(config, m_screen, SCREEN_TYPE_LCD, rgb_t::white());
|
||||
|
Loading…
Reference in New Issue
Block a user