mamedev / mame

MAME
https://www.mamedev.org/
Other
8.07k stars 2.01k forks source link

Watara Supervision: DMA sound corruption #3982

Open infval opened 6 years ago

infval commented 6 years ago

It exists in "Classic Casino" game. Video comparison between MESS 0.152 and MAME 0.201: https://www.youtube.com/watch?v=tF2R_fQQyO8

The bug is here https://github.com/mamedev/mame/blob/28fa8a1abe27e7a30f5bf7c37061ea5e7be84bd2/src/mame/audio/svis_snd.cpp#L137 m_cartrom->base() has to point to a start of a rom but something went wrong.

Dirty fix:

memory_region* m_cart_rom = memregion(":cartslot:cart:rom"); // ":cartslot" + GENERIC_ROM_REGION_TAG
sample = ((uint8_t*)m_cart_rom->base())[(addr & 0x3fff) | m_dma.ca14to16];

I don't know how to obtain the pointer to the start of a rom correctly.

angelosa commented 3 years ago

mame svision classcas Still happens as in 0.228 Current svis_snd.cpp, I'm sniffing several code smells here:

  1. a DMA transfer in a sound streaming update fn?
  2. Why it even need a boundary inside the device instead of the driver client feeding it thru callback?
  3. Why pos/step is in double like at all?