mirror of
https://github.com/holub/mame
synced 2025-05-19 12:18:56 +03:00
00993: sharrier: [debug] Crashes when a specific sample is being played during gameplay.
This commit is contained in:
parent
13d0f42a42
commit
662a0aafda
@ -14,6 +14,7 @@ struct _segapcm_state
|
||||
const UINT8 *rom;
|
||||
int bankshift;
|
||||
int bankmask;
|
||||
int rgnmask;
|
||||
sound_stream * stream;
|
||||
};
|
||||
|
||||
@ -29,6 +30,7 @@ INLINE segapcm_state *get_safe_token(running_device *device)
|
||||
static STREAM_UPDATE( SEGAPCM_update )
|
||||
{
|
||||
segapcm_state *spcm = (segapcm_state *)param;
|
||||
int rgnmask = spcm->rgnmask;
|
||||
int ch;
|
||||
|
||||
/* clear the buffers */
|
||||
@ -70,7 +72,7 @@ static STREAM_UPDATE( SEGAPCM_update )
|
||||
}
|
||||
|
||||
/* fetch the sample */
|
||||
v = rom[addr >> 8] - 0x80;
|
||||
v = rom[(addr >> 8) & rgnmask] - 0x80;
|
||||
|
||||
/* apply panning and advance */
|
||||
outputs[0][i] += v * voll;
|
||||
@ -103,7 +105,10 @@ static DEVICE_START( segapcm )
|
||||
mask = BANK_MASK7>>16;
|
||||
|
||||
len = device->region->bytes();
|
||||
spcm->rgnmask = len - 1;
|
||||
|
||||
for(rom_mask = 1; rom_mask < len; rom_mask *= 2);
|
||||
|
||||
rom_mask--;
|
||||
|
||||
spcm->bankmask = mask & (rom_mask >> spcm->bankshift);
|
||||
|
Loading…
Reference in New Issue
Block a user