summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author arbee <rb6502@users.noreply.github.com>2026-02-19 21:22:31 -0500
committer arbee <rb6502@users.noreply.github.com>2026-02-19 21:22:31 -0500
commit52381aec1bdd01960019ba1acd1466d45b2f9d43 (patch)
tree2e533d61a7ca97db34557cf28ad34d0d626c451d
parente47c0f33c5be3ee286ff65bed13458c2920340d2 (diff)
apple/apple2gs.cpp: Use the Mega II font ROM extracted via its undocumented test registers. [R. Belmont, arekkusu42]
sound/es5503.cpp: Revert ill-advised changes from 0.285 and fix an older regression that caused a crash in Bard's Tale IIgs. (Github #14941) [R. Belmont]
-rw-r--r--src/devices/sound/es5503.cpp52
-rw-r--r--src/devices/sound/es5503.h2
-rw-r--r--src/mame/apple/apple2gs.cpp2
-rw-r--r--src/mame/apple/apple2video.cpp4
4 files changed, 28 insertions, 32 deletions
diff --git a/src/devices/sound/es5503.cpp b/src/devices/sound/es5503.cpp
index 9ce396df58b..e3bd2f55806 100644
--- a/src/devices/sound/es5503.cpp
+++ b/src/devices/sound/es5503.cpp
@@ -22,25 +22,25 @@
data at that point isn't 0x80 or very near it.
Changes:
- 0.2 (RB) - improved behavior for volumes > 127, fixes missing notes in Nucleus & missing voices in Thexder
- 0.3 (RB) - fixed extraneous clicking, improved timing behavior for e.g. Music Construction Set & Music Studio
- 0.4 (RB) - major fixes to IRQ semantics and end-of-sample handling.
- 0.5 (RB) - more flexible wave memory hookup (incl. banking) and save state support.
- 1.0 (RB) - properly respects the input clock
- 2.0 (RB) - C++ conversion, more accurate oscillator IRQ timing
- 2.1 (RB) - Corrected phase when looping; synthLAB, Arkanoid, and Arkanoid II no longer go out of tune
+ 0.2 (RB) - improved behavior for volumes > 127, fixes missing notes in Nucleus & missing voices in Thexder
+ 0.3 (RB) - fixed extraneous clicking, improved timing behavior for e.g. Music Construction Set & Music Studio
+ 0.4 (RB) - major fixes to IRQ semantics and end-of-sample handling.
+ 0.5 (RB) - more flexible wave memory hookup (incl. banking) and save state support.
+ 1.0 (RB) - properly respects the input clock
+ 2.0 (RB) - C++ conversion, more accurate oscillator IRQ timing
+ 2.1 (RB) - Corrected phase when looping; synthLAB, Arkanoid, and Arkanoid II no longer go out of tune
2.1.1 (RB) - Fixed issue introduced in 2.0 where IRQs were delayed
2.1.2 (RB) - Fixed SoundSmith POLY.SYNTH inst where one-shot on the even oscillator and swap on the odd should loop.
Conversely, the intro voice in FTA Delta Demo has swap on the even and one-shot on the odd and doesn't
want to loop.
2.1.3 (RB) - Fixed oscillator enable register off-by-1 which caused everything to be half a step sharp.
- 2.2 (RB) - More precise one-shot even/swap odd behavior from hardware observations with Ian Brumby's SWAPTEST.
- 2.3 (RB) - Sync & AM modes added, emulate the volume glitch for the highest-numbered enabled oscillator.
+ 2.2 (RB) - More precise one-shot even/swap odd behavior from hardware observations with Ian Brumby's SWAPTEST.
+ 2.3 (RB) - Sync & AM modes added, emulate the volume glitch for the highest-numbered enabled oscillator.
2.3.1 (RB) - Fixed thinko in the volume glitch emulation and minor cleanup.
- 2.4 (RB) - Halting an oscillator from the CPU behaves the same as halting it from the DOC itself.
+ 2.4 (RB) - Halting an oscillator from the CPU behaves the same as halting it from the DOC itself.
Skate or Die on the IIgs accidentally relies on this behavior.
- 2.4.1 (RB) - Fixed the phase preservation on looping samples, which was introducing a subtle (1 sample position)
- pitch error on each loop.
+ 2.4.1 (RB) - Fixed a bug where halting an oscillator from the CPU with IRQs disabled in the new mode would
+ fire the IRQ anyway. This caused Bard's Tale IIgs to crash after the intro screen.
*/
#include "emu.h"
@@ -95,7 +95,7 @@ void es5503_device::rom_bank_pre_change()
// halt_osc: handle halting an oscillator
// onum = oscillator #
// type = 1 for 0 found in sample data, 0 for hit end of table size
-void es5503_device::halt_osc(int onum, int type, uint32_t *accumulator, int resshift)
+void es5503_device::halt_osc(int onum, int type, uint32_t *accumulator, int resshift, uint8_t newCtrl)
{
ES5503Osc *pOsc = &m_oscillators[onum];
ES5503Osc *pPartner = &m_oscillators[onum^1];
@@ -126,18 +126,8 @@ void es5503_device::halt_osc(int onum, int type, uint32_t *accumulator, int ress
}
else // preserve the relative phase of the oscillator when looping
{
- const uint16_t wtsize = pOsc->wtsize;
- // For the ideal case, the accumulator is greater than or equal to the wave table size.
- // Unfortunately degenerate cases can occur on this chip (especially with SoundSmith on
- // the IIgs), so in those cases just zero the integer part of the accumulator.)
- if ((*accumulator >> resshift) < wtsize)
- {
- *accumulator -= ((*accumulator >> resshift) << resshift);
- }
- else // Ideal case. Just subtract the wave table size from the integer part.
- {
- *accumulator -= (wtsize << resshift);
- }
+ uint16_t wtsize = pOsc->wtsize - 1;
+ *accumulator -= (wtsize << resshift);
}
// if we're in swap mode, start the partner
@@ -163,6 +153,12 @@ void es5503_device::halt_osc(int onum, int type, uint32_t *accumulator, int ress
// IRQ enabled for this voice?
if (pOsc->control & 0x08)
{
+ // If the halt is coming from a CPU write, only trigger IRQ if the new control value has it set (need to test on h/w)
+ if ((type == 0) && !(newCtrl & 0x08))
+ {
+ return;
+ }
+
pOsc->irqpend = 1;
m_irq_func(1);
@@ -211,7 +207,7 @@ void es5503_device::sound_stream_update(sound_stream &stream)
if (read_byte(ramptr + wtptr) == 0x00)
{
- halt_osc(osc, 1, &acc, resshift);
+ halt_osc(osc, 1, &acc, resshift, pOsc->control);
}
else
{
@@ -252,7 +248,7 @@ void es5503_device::sound_stream_update(sound_stream &stream)
if (altram >= wtsize)
{
- halt_osc(osc, 0, &acc, resshift);
+ halt_osc(osc, 0, &acc, resshift, pOsc->control);
}
}
@@ -472,7 +468,7 @@ void es5503_device::write(offs_t offset, u8 data)
// In practice, this means in swap mode that we will also do the swap.
if (!(m_oscillators[osc].control & 1) && ((data & 1)) && ((data >> 1) & 1))
{
- halt_osc(osc, 0, &m_oscillators[osc].accumulator, resshifts[m_oscillators[osc].resolution]);
+ halt_osc(osc, 0, &m_oscillators[osc].accumulator, resshifts[m_oscillators[osc].resolution], data);
}
m_oscillators[osc].control = data;
break;
diff --git a/src/devices/sound/es5503.h b/src/devices/sound/es5503.h
index aa331cac792..d8c1154eded 100644
--- a/src/devices/sound/es5503.h
+++ b/src/devices/sound/es5503.h
@@ -87,7 +87,7 @@ private:
std::vector<int32_t> m_mix_buffer;
- void halt_osc(int onum, int type, uint32_t *accumulator, int resshift);
+ void halt_osc(int onum, int type, uint32_t *accumulator, int resshift, uint8_t newCtrl);
};
diff --git a/src/mame/apple/apple2gs.cpp b/src/mame/apple/apple2gs.cpp
index acf6617c6ec..22cc3c804d5 100644
--- a/src/mame/apple/apple2gs.cpp
+++ b/src/mame/apple/apple2gs.cpp
@@ -3901,7 +3901,7 @@ ROM_START(apple2gs)
ROM_LOAD( "341s0632-2.bin", 0x000000, 0x001000, CRC(e1c11fb0) SHA1(141d18c36a617ab9dce668445440d34354be0672) )
ROM_REGION(0x4000,"gfx1",0)
- ROM_LOAD ( "megaii.chr", 0x0000, 0x4000, BAD_DUMP CRC(ef0bfc11) SHA1(c068f3d02d442a8a38121d42318e9a962ee8913e)) /* need label/part number */
+ ROM_LOAD("344s0047.bin", 0x000000, 0x004000, CRC(2d541944) SHA1(5a5a77c8ec45632aea1a57cd9c9257f7f6e44668)) /* Mega II: 344S0047. Dumped from the test registers, verified identical on both ROM 1 and 3 */
ROM_REGION(0x80000,"maincpu",0)
// 341-0728 is the MASK rom version while 341-0737 is the EPROM version - SAME data.
diff --git a/src/mame/apple/apple2video.cpp b/src/mame/apple/apple2video.cpp
index c56889a618a..8a4117bcdec 100644
--- a/src/mame/apple/apple2video.cpp
+++ b/src/mame/apple/apple2video.cpp
@@ -954,7 +954,7 @@ uint32_t a2_video_device::screen_update_GS(screen_device &screen, bitmap_rgb32 &
if (beamy >= BORDER_TOP)
{
rectangle const new_cliprect(0, 559, cliprect.top() - BORDER_TOP, cliprect.bottom() - BORDER_TOP);
- screen_update<model::IIGS, false, false>(screen, *m_8bit_graphics, new_cliprect);
+ screen_update<model::IIGS, true, false>(screen, *m_8bit_graphics, new_cliprect);
}
if ((beamy < BORDER_TOP) || (beamy >= (192 + BORDER_TOP)))
@@ -1059,7 +1059,7 @@ template uint32_t a2_video_device::screen_update<a2_video_device::model::IIE, tr
template uint32_t a2_video_device::screen_update<a2_video_device::model::IIE, false, true>(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
template uint32_t a2_video_device::screen_update<a2_video_device::model::IIE, false, false>(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
template uint32_t a2_video_device::screen_update<a2_video_device::model::PRAVETZ_8C, false, false>(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
-template uint32_t a2_video_device::screen_update<a2_video_device::model::IIGS, false, false>(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+template uint32_t a2_video_device::screen_update<a2_video_device::model::IIGS, true, false>(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
template uint32_t a2_video_device::screen_update<a2_video_device::model::II_J_PLUS, true, true>(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
template uint32_t a2_video_device::screen_update<a2_video_device::model::IVEL_ULTRA, true, false>(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
template uint32_t a2_video_device::screen_update<a2_video_device::model::IVEL_ULTRA, false, true>(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);