From c2b6d57e5c966c1d5b986507e599d9919c0e2de7 Mon Sep 17 00:00:00 2001 From: AJR Date: Sat, 4 Jun 2022 15:39:51 -0400 Subject: stupid_git --- src/devices/cpu/mips/mips3.cpp | 10 +++++----- src/devices/video/mc6845.cpp | 6 +++++- src/devices/video/scn2674.cpp | 2 +- src/emu/sound.cpp | 34 +++++++++++++--------------------- src/mame/drivers/atarist.cpp | 37 ++++++++++++++++++++++--------------- src/mame/machine/ataristb.cpp | 2 +- src/mame/mame.lst | 3 +++ src/mame/video/atarist.cpp | 25 ++++++++++++------------- 8 files changed, 62 insertions(+), 57 deletions(-) diff --git a/src/devices/cpu/mips/mips3.cpp b/src/devices/cpu/mips/mips3.cpp index 08ea4197a34..62c20ef7eb4 100644 --- a/src/devices/cpu/mips/mips3.cpp +++ b/src/devices/cpu/mips/mips3.cpp @@ -2886,8 +2886,8 @@ inline void r5900le_device::handle_dmfc2(uint32_t op) { rtval[i] = reg[i]; } - m_core->r[rt] = ((uint64_t)rtval[1] << 32) | rtval[0]; - m_core->rh[rt] = ((uint64_t)rtval[3] << 32) | rtval[2]; + m_core->r[rt] = util::icat(rtval[1], rtval[0]); + m_core->rh[rt] = util::icat(rtval[3], rtval[2]); } inline void r5900le_device::handle_dmtc2(uint32_t op) @@ -3784,7 +3784,7 @@ void r5900le_device::handle_idt(uint32_t op) break; } } - m_core->r[rd] = ((uint64_t)count[1] << 32) | count[0]; + m_core->r[rd] = util::icat(count[1], count[0]); } break; case 0x08: /* MMI0 */ @@ -4271,8 +4271,8 @@ void r5900le_device::handle_mmi0(uint32_t op) uint64_t rsval = m_core->r[rs]; uint64_t rtval = m_core->r[rt]; uint32_t rdval[4] = { (uint32_t)rtval, (uint32_t)rsval, (uint32_t)(rtval >> 32), (uint32_t)(rsval >> 32) }; - m_core->r[rd] = (uint64_t)rdval[1] << 32 | rdval[0]; - m_core->rh[rd] = (uint64_t)rdval[3] << 32 | rdval[2]; + m_core->r[rd] = util::icat(rdval[1], rdval[0]); + m_core->rh[rd] = util::icat(rdval[3], rdval[2]); } break; } diff --git a/src/devices/video/mc6845.cpp b/src/devices/video/mc6845.cpp index c1e3ca971aa..dfa37d0f568 100644 --- a/src/devices/video/mc6845.cpp +++ b/src/devices/video/mc6845.cpp @@ -913,7 +913,11 @@ void mc6845_device::handle_line_timer() update_cursor_state(); if (has_screen()) - screen().reset_origin(); + { + // HACK: prevent asoccer from hanging MAME by repeatedly stalling VBLANK periods and attendant frame updates + if (!m_vsync || !new_vsync) + screen().reset_origin(); + } } else { diff --git a/src/devices/video/scn2674.cpp b/src/devices/video/scn2674.cpp index 96e1e7d3ca5..c5fe92250aa 100644 --- a/src/devices/video/scn2674.cpp +++ b/src/devices/video/scn2674.cpp @@ -14,7 +14,7 @@ #define LOG_COMMAND (1 << 1) #define LOG_INTR (1 << 2) #define LOG_READ (1 << 3) -#define VERBOSE (0) +#define VERBOSE (LOG_IR) #include "logmacro.h" diff --git a/src/emu/sound.cpp b/src/emu/sound.cpp index a4cb5041d8f..2c2087b7583 100644 --- a/src/emu/sound.cpp +++ b/src/emu/sound.cpp @@ -1523,7 +1523,7 @@ void sound_manager::update(int param) } #if (SOUND_DEBUG) - if (lscale != m_compressor_scale) + if (lscale != m_compressor_scale && m_compressor_enabled) printf("scale=%.5f\n", m_compressor_scale); #endif @@ -1541,35 +1541,27 @@ void sound_manager::update(int param) // ensure that changing the compression won't reverse direction to reduce "pops" stream_buffer::sample_t lsamp = m_leftmix[sampindex]; - if (lscale != m_compressor_scale && sample != m_finalmix_leftover) - lscale = adjust_toward_compressor_scale(lscale, lprev, lsamp); - - lprev = lsamp * lscale; if (m_compressor_enabled) - lsamp = lprev; + { + if (lscale != m_compressor_scale && sample != m_finalmix_leftover) + lscale = adjust_toward_compressor_scale(lscale, lprev, lsamp); + lprev = lsamp *= lscale; + } // clamp the left side - if (lsamp > 1.0) - lsamp = 1.0; - else if (lsamp < -1.0) - lsamp = -1.0; - finalmix[finalmix_offset++] = s16(lsamp * 32767.0); + finalmix[finalmix_offset++] = s16(std::clamp(lsamp, -1.0, 1.0) * 32767.0); // ensure that changing the compression won't reverse direction to reduce "pops" stream_buffer::sample_t rsamp = m_rightmix[sampindex]; - if (rscale != m_compressor_scale && sample != m_finalmix_leftover) - rscale = adjust_toward_compressor_scale(rscale, rprev, rsamp); - - rprev = rsamp * rscale; if (m_compressor_enabled) - rsamp = rprev; + { + if (rscale != m_compressor_scale && sample != m_finalmix_leftover) + rscale = adjust_toward_compressor_scale(rscale, rprev, rsamp); + rprev = rsamp *= rscale; + } // clamp the right side - if (rsamp > 1.0) - rsamp = 1.0; - else if (rsamp < -1.0) - rsamp = -1.0; - finalmix[finalmix_offset++] = s16(rsamp * 32767.0); + finalmix[finalmix_offset++] = s16(std::clamp(rsamp, -1.0, 1.0) * 32767.0); } m_finalmix_leftover = sample - m_samples_this_update * 1000; diff --git a/src/mame/drivers/atarist.cpp b/src/mame/drivers/atarist.cpp index c98a4877a92..a74b4136f46 100644 --- a/src/mame/drivers/atarist.cpp +++ b/src/mame/drivers/atarist.cpp @@ -58,7 +58,7 @@ // CONSTANTS / MACROS //************************************************************************** -#define LOG 0 +#define LOG 1 namespace { @@ -152,6 +152,7 @@ public: m_ikbd_mouse_py(IKBD_MOUSE_PHASE_STATIC), m_ikbd_mouse_pc(0), m_ikbd_joy(1), + m_psg_pa(0), m_monochrome(1), m_video(*this, "video"), m_screen(*this, "screen"), @@ -184,8 +185,8 @@ protected: void mouse_tick(); // driver - uint16_t fdc_data_r(offs_t offset); - void fdc_data_w(offs_t offset, uint16_t data); + uint16_t fdc_data_r(); + void fdc_data_w(uint16_t data); uint16_t dma_status_r(); void dma_mode_w(uint16_t data); uint8_t dma_counter_r(offs_t offset); @@ -243,6 +244,7 @@ protected: int m_fdc_fifo_msb = 0; int m_fdc_fifo_empty[2]{}; int m_fdc_dmabytes = 0; + uint8_t m_psg_pa; /* timers */ emu_timer *m_mouse_timer = nullptr; @@ -572,7 +574,7 @@ void st_state::fdc_dma_transfer() // fdc_data_r - //------------------------------------------------- -uint16_t st_state::fdc_data_r(offs_t offset) +uint16_t st_state::fdc_data_r() { uint8_t data = 0; @@ -604,7 +606,7 @@ uint16_t st_state::fdc_data_r(offs_t offset) // fdc_data_w - //------------------------------------------------- -void st_state::fdc_data_w(offs_t offset, uint16_t data) +void st_state::fdc_data_w(uint16_t data) { if (m_fdc_mode & DMA_MODE_SECTOR_COUNT) { @@ -1577,7 +1579,7 @@ void st_state::st_map(address_map &map) map(0xff8001, 0xff8001).rw(FUNC(st_state::mmu_r), FUNC(st_state::mmu_w)); map(0xff8200, 0xff8203).rw(m_video, FUNC(st_video_device::shifter_base_r), FUNC(st_video_device::shifter_base_w)).umask16(0x00ff); map(0xff8204, 0xff8209).r(m_video, FUNC(st_video_device::shifter_counter_r)).umask16(0x00ff); - map(0xff820a, 0xff820a).rw(m_video, FUNC(st_video_device::shifter_sync_r), FUNC(st_video_device::shifter_sync_w)); + map(0xff820a, 0xff820a).rw(m_video, FUNC(st_video_device::glue_sync_r), FUNC(st_video_device::glue_sync_w)); map(0xff8240, 0xff825f).rw(m_video, FUNC(st_video_device::shifter_palette_r), FUNC(st_video_device::shifter_palette_w)); map(0xff8260, 0xff8260).rw(m_video, FUNC(st_video_device::shifter_mode_r), FUNC(st_video_device::shifter_mode_w)); map(0xff8604, 0xff8605).rw(FUNC(st_state::fdc_data_r), FUNC(st_state::fdc_data_w)); @@ -1608,7 +1610,7 @@ void st_state::megast_map(address_map &map) map(0xff8001, 0xff8001).rw(FUNC(st_state::mmu_r), FUNC(st_state::mmu_w)); map(0xff8200, 0xff8203).rw(m_video, FUNC(st_video_device::shifter_base_r), FUNC(st_video_device::shifter_base_w)).umask16(0x00ff); map(0xff8204, 0xff8209).r(m_video, FUNC(st_video_device::shifter_counter_r)).umask16(0x00ff); - map(0xff820a, 0xff820a).rw(m_video, FUNC(st_video_device::shifter_sync_r), FUNC(st_video_device::shifter_sync_w)); + map(0xff820a, 0xff820a).rw(m_video, FUNC(st_video_device::glue_sync_r), FUNC(st_video_device::glue_sync_w)); map(0xff8240, 0xff825f).rw(m_video, FUNC(st_video_device::shifter_palette_r), FUNC(st_video_device::shifter_palette_w)); map(0xff8260, 0xff8260).rw(m_video, FUNC(st_video_device::shifter_mode_r), FUNC(st_video_device::shifter_mode_w)); map(0xff8604, 0xff8605).rw(FUNC(st_state::fdc_data_r), FUNC(st_state::fdc_data_w)); @@ -1708,14 +1710,14 @@ void stbook_state::stbook_map(address_map &map) map(0xfc0000, 0xfeffff).rom().region(M68000_TAG, 0); /* map(0xf00000, 0xf1ffff).rw(FUNC(stbook_state::stbook_ide_r), FUNC(stbook_state::stbook_ide_w)); map(0xff8000, 0xff8001).rw(FUNC(stbook_state::stbook_mmu_r), FUNC(stbook_state::stbook_mmu_w)); - map(0xff8200, 0xff8203).rw(m_video, FUNC(stbook_video_device::stbook_shifter_base_r), FUNC(stbook_video_device::stbook_shifter_base_w)); - map(0xff8204, 0xff8209).rw(m_video, FUNC(stbook_video_device::stbook_shifter_counter_r), FUNC(stbook_video_device::stbook_shifter_counter_w)); - map(0xff820a, 0xff820a).rw(m_video, FUNC(stbook_video_device::stbook_shifter_sync_r), FUNC(stbook_video_device::stbook_shifter_sync_w)); - map(0xff820c, 0xff820d).rw(m_video, FUNC(stbook_video_device::stbook_shifter_base_low_r), FUNC(stbook_video_device::stbook_shifter_base_low_w)); - map(0xff820e, 0xff820f).rw(m_video, FUNC(stbook_video_device::stbook_shifter_lineofs_r), FUNC(stbook_video_device::stbook_shifter_lineofs_w)); - map(0xff8240, 0xff8241).rw(m_video, FUNC(stbook_video_device::stbook_shifter_palette_r), FUNC(stbook_video_device::stbook_shifter_palette_w)); - map(0xff8260, 0xff8260).rw(m_video, FUNC(stbook_video_device::stbook_shifter_mode_r), FUNC(stbook_video_device::stbook_shifter_mode_w)); - map(0xff8264, 0xff8265).rw(m_video, FUNC(stbook_video_device::stbook_shifter_pixelofs_r), FUNC(stbook_video_device::stbook_shifter_pixelofs_w)); + map(0xff8200, 0xff8203).rw(m_video, FUNC(stbook_video_device::shifter_base_r), FUNC(stbook_video_device::shifter_base_w)); + map(0xff8204, 0xff8209).rw(m_video, FUNC(stbook_video_device::shifter_counter_r), FUNC(stbook_video_device::shifter_counter_w)); + map(0xff820a, 0xff820a).rw(m_video, FUNC(stbook_video_device::shifter_sync_r), FUNC(stbook_video_device::shifter_sync_w)); + map(0xff820c, 0xff820d).rw(m_video, FUNC(stbook_video_device::shifter_base_low_r), FUNC(stbook_video_device::shifter_base_low_w)); + map(0xff820e, 0xff820f).rw(m_video, FUNC(stbook_video_device::shifter_lineofs_r), FUNC(stbook_video_device::shifter_lineofs_w)); + map(0xff8240, 0xff8241).rw(m_video, FUNC(stbook_video_device::shifter_palette_r), FUNC(stbook_video_device::shifter_palette_w)); + map(0xff8260, 0xff8260).rw(m_video, FUNC(stbook_video_device::shifter_mode_r), FUNC(stbook_video_device::shifter_mode_w)); + map(0xff8264, 0xff8265).rw(m_video, FUNC(stbook_video_device::shifter_pixelofs_r), FUNC(stbook_video_device::shifter_pixelofs_w)); map(0xff827e, 0xff827f).w(m_video, FUNC(stbook_video_device::lcd_control_w));*/ map(0xff8800, 0xff8800).rw(YM3439_TAG, FUNC(ay8910_device::data_r), FUNC(ay8910_device::address_w)); map(0xff8802, 0xff8802).w(YM3439_TAG, FUNC(ay8910_device::data_w)); @@ -2073,6 +2075,8 @@ void st_state::psg_pa_w(uint8_t data) // centronics strobe m_centronics->write_strobe(BIT(data, 5)); + + m_psg_pa = data; } //------------------------------------------------- @@ -2181,6 +2185,7 @@ void st_state::state_save() save_item(NAME(m_fdc_mode)); save_item(NAME(m_fdc_sectors)); save_item(NAME(m_fdc_dmabytes)); + save_item(NAME(m_psg_pa)); save_item(NAME(m_ikbd_keylatch)); save_item(NAME(m_ikbd_mouse)); save_item(NAME(m_ikbd_mouse_x)); @@ -2353,6 +2358,7 @@ void st_state::common(machine_config &config) YM2149(config, m_ymsnd, Y2/16); m_ymsnd->set_flags(AY8910_SINGLE_OUTPUT); m_ymsnd->set_resistors_load(RES_K(1), 0, 0); + m_ymsnd->port_a_read_callback().set([this] { return m_psg_pa; }); m_ymsnd->port_a_write_callback().set(FUNC(st_state::psg_pa_w)); m_ymsnd->port_b_write_callback().set("cent_data_out", FUNC(output_latch_device::write)); @@ -2594,6 +2600,7 @@ void stbook_state::stbook(machine_config &config) ym3439_device &ym3439(YM3439(config, YM3439_TAG, U517/8)); ym3439.set_flags(AY8910_SINGLE_OUTPUT); ym3439.set_resistors_load(RES_K(1), 0, 0); + ym3439.port_a_read_callback().set([this] { return m_psg_pa; }); ym3439.port_a_write_callback().set(FUNC(stbook_state::psg_pa_w)); ym3439.port_b_write_callback().set("cent_data_out", FUNC(output_latch_device::write)); ym3439.add_route(ALL_OUTPUTS, "mono", 1.00); diff --git a/src/mame/machine/ataristb.cpp b/src/mame/machine/ataristb.cpp index 483a11f0410..3344260f313 100644 --- a/src/mame/machine/ataristb.cpp +++ b/src/mame/machine/ataristb.cpp @@ -10,7 +10,7 @@ // CONSTANTS / MACROS //************************************************************************** -DEFINE_DEVICE_TYPE(ST_BLITTER, st_blitter_device, "st_blitter", "Atari ST Blitter") +DEFINE_DEVICE_TYPE(ST_BLITTER, st_blitter_device, "st_blitter", "Atari ST BLiTTER") static const int BLITTER_NOPS[16][4] = { diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 06e9c39cc8f..2b752f47b25 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -34494,6 +34494,9 @@ pdp11ub // pdp11ub2 // sms1000 // +@source:pdp1145.cpp +pdp1145 // + @source:pdt3100.cpp pdt3100 // diff --git a/src/mame/video/atarist.cpp b/src/mame/video/atarist.cpp index 19ecad5aefa..312e17afaae 100644 --- a/src/mame/video/atarist.cpp +++ b/src/mame/video/atarist.cpp @@ -206,7 +206,7 @@ TIMER_CALLBACK_MEMBER(st_video_device::glue_tick) int v = (y >= m_shifter_y_start) && (y < m_shifter_y_end); int h = (x >= m_shifter_x_start) && (x < m_shifter_x_end); - if(m_shifter_mode == 1 && (m_shifter_sync & 0x02)) { + if(m_shifter_mode == 1 && (m_glue_sync & 0x02)) { int dt = 8; h = (x >= m_shifter_x_start-dt) && (x < m_shifter_x_end-dt); } @@ -295,7 +295,7 @@ TIMER_CALLBACK_MEMBER(st_video_device::glue_tick) void st_video_device::set_screen_parameters() { - if (m_shifter_sync & 0x02) + if (m_glue_sync & 0x02) { m_shifter_x_start = ATARIST_HBDEND_PAL*2; m_shifter_x_end = ATARIST_HBDSTART_PAL*2; @@ -388,23 +388,23 @@ uint8_t st_video_device::shifter_counter_r(offs_t offset) //------------------------------------------------- -// shifter_sync_r - +// glue_sync_r - //------------------------------------------------- -uint8_t st_video_device::shifter_sync_r() +uint8_t st_video_device::glue_sync_r() { - return m_shifter_sync; + return m_glue_sync; } //------------------------------------------------- -// shifter_sync_w - +// glue_sync_w - //------------------------------------------------- -void st_video_device::shifter_sync_w(uint8_t data) +void st_video_device::glue_sync_w(uint8_t data) { - m_shifter_sync = data; - logerror("SHIFTER Sync %x\n", m_shifter_sync); + m_glue_sync = data; + logerror("GLUE Sync %x\n", m_glue_sync); set_screen_parameters(); } @@ -636,7 +636,7 @@ void st_video_device::device_start() // register for state saving save_item(NAME(m_shifter_base)); save_item(NAME(m_shifter_ofs)); - save_item(NAME(m_shifter_sync)); + save_item(NAME(m_glue_sync)); save_item(NAME(m_shifter_mode)); save_item(NAME(m_shifter_palette)); save_item(NAME(m_shifter_rr)); @@ -650,8 +650,6 @@ void st_video_device::device_start() m_shifter_base = 0; m_shifter_ofs = 0; m_shifter_mode = 0; - - set_screen_parameters(); } void ste_video_device::device_start() @@ -666,7 +664,8 @@ void ste_video_device::device_start() void st_video_device::device_reset() { - // TODO: reset glue chip + m_glue_sync = 0; + set_screen_parameters(); } -- cgit v1.2.3