mirror of
https://github.com/holub/mame
synced 2025-05-22 13:48:55 +03:00
Updated nes pcm dma to read data through the cpu address map.
This commit is contained in:
parent
a4059f19ad
commit
d64bda5e94
@ -377,7 +377,7 @@ static int8 apu_dpcm(struct nesapu_info *info, dpcm_t *chan)
|
||||
bit_pos = 7 - (chan->bits_left & 7);
|
||||
if (7 == bit_pos)
|
||||
{
|
||||
chan->cur_byte = chan->cpu_mem[chan->address];
|
||||
chan->cur_byte = program_read_byte(chan->address);
|
||||
chan->address++;
|
||||
chan->length--;
|
||||
}
|
||||
@ -600,6 +600,7 @@ INLINE void apu_update(struct nesapu_info *info, stream_sample_t *buffer16, int
|
||||
{
|
||||
int accum;
|
||||
|
||||
cpuintrf_push_context( info->APU.dpcm.cpu_num );
|
||||
while (samples--)
|
||||
{
|
||||
accum = apu_square(info, &info->APU.squ[0]);
|
||||
@ -616,6 +617,7 @@ INLINE void apu_update(struct nesapu_info *info, stream_sample_t *buffer16, int
|
||||
|
||||
*(buffer16++)=accum<<8;
|
||||
}
|
||||
cpuintrf_pop_context();
|
||||
}
|
||||
|
||||
/* READ VALUES FROM REGISTERS */
|
||||
@ -691,7 +693,7 @@ static void *nesapu_start(const char *tag, int sndindex, int clock, const void *
|
||||
info->buffer_size+=info->samps_per_sync;
|
||||
|
||||
/* Initialize individual chips */
|
||||
(info->APU.dpcm).cpu_mem=memory_region(Machine, intf->region);
|
||||
(info->APU.dpcm).cpu_num= mame_find_cpu_index(Machine, intf->cpu_tag);
|
||||
|
||||
info->stream = stream_create(0, 1, rate, info, nes_psg_update_sound);
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
||||
typedef struct _nes_interface nes_interface;
|
||||
struct _nes_interface
|
||||
{
|
||||
const char *region; /* DMC regions */
|
||||
const char *cpu_tag; /* CPU tag */
|
||||
};
|
||||
|
||||
READ8_HANDLER( nes_psg_0_r );
|
||||
|
@ -137,7 +137,7 @@ typedef struct dpcm_s
|
||||
uint8 cur_byte;
|
||||
boolean enabled;
|
||||
boolean irq_occurred;
|
||||
uint8 *cpu_mem;
|
||||
int cpu_num;
|
||||
signed char vol;
|
||||
} dpcm_t;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user