Previous 199869 Revisions Next

r17755 Sunday 9th September, 2012 at 15:19:43 UTC by hap
add upd7756_device
[src/emu/sound]upd7759.c upd7759.h
[src/mame/drivers]homerun.c

trunk/src/mame/drivers/homerun.c
r17754r17755
335335   MCFG_SOUND_CONFIG(ym2203_config)
336336   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
337337
338   MCFG_SOUND_ADD("d7756c", UPD7759, UPD7759_STANDARD_CLOCK)
339   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
338   MCFG_SOUND_ADD("d7756c", UPD7756, UPD7759_STANDARD_CLOCK)
339   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
340340MACHINE_CONFIG_END
341341
342342static MACHINE_CONFIG_DERIVED( ganjaja, homerun )
r17754r17755
400400
401401GAME( 1988, homerun,  0, homerun, homerun,  driver_device, 0, ROT0, "Jaleco", "Moero Pro Yakyuu Homerun", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
402402GAME( 1988, dynashot, 0, homerun, dynashot, driver_device, 0, ROT0, "Jaleco", "Dynamic Shooting", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
403GAME( 1990, ganjaja,  0, ganjaja, ganjaja,  driver_device, 0, ROT0, "Jaleco", "Ganbare Jajamaru Saisho wa Goo / Ganbare Jajamaru Hop Step & Jump", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
403GAME( 1990, ganjaja,  0, ganjaja, ganjaja,  driver_device, 0, ROT0, "Jaleco", "Ganbare Jajamaru Saisho wa Goo / Ganbare Jajamaru Hop Step & Jump", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
trunk/src/emu/sound/upd7759.c
r17754r17755
149149   device_t *device;
150150   sound_stream *channel;               /* stream channel for playback */
151151
152   /* chip configuration */
153   UINT8      sample_offset_shift;      /* header sample address shift (access data > 0xffff) */
154   
152155   /* internal clock to output sample rate mapping */
153156   UINT32      pos;                  /* current output sample position */
154157   UINT32      step;                  /* step value per output sample */
r17754r17755
325328      /* Address MSB state: latch the MSB of the sample address and issue a request for the fourth byte */
326329      /* The expected response will be the LSB of the sample address */
327330      case STATE_ADDR_MSB:
328         chip->offset = (chip->rom ? chip->rom[chip->req_sample * 2 + 5] : chip->fifo_in) << 9;
329         if (DEBUG_STATES) DEBUG_METHOD("UPD7759: offset_hi = %02X, requesting offset_lo\n", chip->offset >> 9);
331         chip->offset = (chip->rom ? chip->rom[chip->req_sample * 2 + 5] : chip->fifo_in) << (8 + chip->sample_offset_shift);
332         if (DEBUG_STATES) DEBUG_METHOD("UPD7759: offset_hi = %02X, requesting offset_lo\n", chip->offset >> (8 + chip->sample_offset_shift));
330333         chip->drq = 1;
331334
332335         /* 44 cycles later, we will latch this value and request another byte */
r17754r17755
337340      /* Address LSB state: latch the LSB of the sample address and issue a request for the fifth byte */
338341      /* The expected response will be just a dummy */
339342      case STATE_ADDR_LSB:
340         chip->offset |= (chip->rom ? chip->rom[chip->req_sample * 2 + 6] : chip->fifo_in) << 1;
341         if (DEBUG_STATES) DEBUG_METHOD("UPD7759: offset_lo = %02X, requesting dummy 2\n", (chip->offset >> 1) & 0xff);
343         chip->offset |= (chip->rom ? chip->rom[chip->req_sample * 2 + 6] : chip->fifo_in) << chip->sample_offset_shift;
344         if (DEBUG_STATES) DEBUG_METHOD("UPD7759: offset_lo = %02X, requesting dummy 2\n", (chip->offset >> chip->sample_offset_shift) & 0xff);
342345         chip->drq = 1;
343346
344347         /* 36 cycles later, we will latch this value and request another byte */
r17754r17755
640643
641644   chip->device = device;
642645
646   /* chip configuration */
647   chip->sample_offset_shift = (device->type() == UPD7759) ? 1 : 0;
648   
643649   /* allocate a stream channel */
644650   chip->channel = device->machine().sound().stream_alloc(*device, 0, 1, device->clock()/4, chip, upd7759_update);
645651
r17754r17755
752758{
753759   m_token = global_alloc_array_clear(UINT8, sizeof(upd7759_state));
754760}
761upd7759_device::upd7759_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
762   : device_t(mconfig, type, name, tag, owner, clock),
763     device_sound_interface(mconfig, *this)
764{
765   m_token = global_alloc_array_clear(UINT8, sizeof(upd7759_state));
766}
755767
756768//-------------------------------------------------
757769//  device_config_complete - perform any
r17754r17755
792804}
793805
794806
807const device_type UPD7756 = &device_creator<upd7756_device>;
808
809upd7756_device::upd7756_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
810   : upd7759_device(mconfig, UPD7756, "UPD7756", tag, owner, clock)
811{
812}
813
814//-------------------------------------------------
815//  sound_stream_update - handle a stream update
816//-------------------------------------------------
817
818void upd7756_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
819{
820   // should never get here
821   fatalerror("sound_stream_update called; not applicable to legacy sound devices\n");
822}
trunk/src/emu/sound/upd7759.h
r17754r17755
3030{
3131public:
3232   upd7759_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
33   upd7759_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
3334   ~upd7759_device() { global_free(m_token); }
3435
3536   // access to legacy token
r17754r17755
4950
5051extern const device_type UPD7759;
5152
53class upd7756_device : public upd7759_device
54{
55public:
56   upd7756_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
5257
58   // sound stream update overrides
59   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
60};
61
62extern const device_type UPD7756;
63
64
5365#endif /* __UPD7759_H__ */

Previous 199869 Revisions Next


© 1997-2024 The MAME Team