trunk/src/mame/drivers/homerun.c
| r17754 | r17755 | |
| 335 | 335 | MCFG_SOUND_CONFIG(ym2203_config) |
| 336 | 336 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 337 | 337 | |
| 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) |
| 340 | 340 | MACHINE_CONFIG_END |
| 341 | 341 | |
| 342 | 342 | static MACHINE_CONFIG_DERIVED( ganjaja, homerun ) |
| r17754 | r17755 | |
| 400 | 400 | |
| 401 | 401 | GAME( 1988, homerun, 0, homerun, homerun, driver_device, 0, ROT0, "Jaleco", "Moero Pro Yakyuu Homerun", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) |
| 402 | 402 | GAME( 1988, dynashot, 0, homerun, dynashot, driver_device, 0, ROT0, "Jaleco", "Dynamic Shooting", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) |
| 403 | | GAME( 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 ) |
| 403 | GAME( 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
| r17754 | r17755 | |
| 149 | 149 | device_t *device; |
| 150 | 150 | sound_stream *channel; /* stream channel for playback */ |
| 151 | 151 | |
| 152 | /* chip configuration */ |
| 153 | UINT8 sample_offset_shift; /* header sample address shift (access data > 0xffff) */ |
| 154 | |
| 152 | 155 | /* internal clock to output sample rate mapping */ |
| 153 | 156 | UINT32 pos; /* current output sample position */ |
| 154 | 157 | UINT32 step; /* step value per output sample */ |
| r17754 | r17755 | |
| 325 | 328 | /* Address MSB state: latch the MSB of the sample address and issue a request for the fourth byte */ |
| 326 | 329 | /* The expected response will be the LSB of the sample address */ |
| 327 | 330 | 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)); |
| 330 | 333 | chip->drq = 1; |
| 331 | 334 | |
| 332 | 335 | /* 44 cycles later, we will latch this value and request another byte */ |
| r17754 | r17755 | |
| 337 | 340 | /* Address LSB state: latch the LSB of the sample address and issue a request for the fifth byte */ |
| 338 | 341 | /* The expected response will be just a dummy */ |
| 339 | 342 | 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); |
| 342 | 345 | chip->drq = 1; |
| 343 | 346 | |
| 344 | 347 | /* 36 cycles later, we will latch this value and request another byte */ |
| r17754 | r17755 | |
| 640 | 643 | |
| 641 | 644 | chip->device = device; |
| 642 | 645 | |
| 646 | /* chip configuration */ |
| 647 | chip->sample_offset_shift = (device->type() == UPD7759) ? 1 : 0; |
| 648 | |
| 643 | 649 | /* allocate a stream channel */ |
| 644 | 650 | chip->channel = device->machine().sound().stream_alloc(*device, 0, 1, device->clock()/4, chip, upd7759_update); |
| 645 | 651 | |
| r17754 | r17755 | |
| 752 | 758 | { |
| 753 | 759 | m_token = global_alloc_array_clear(UINT8, sizeof(upd7759_state)); |
| 754 | 760 | } |
| 761 | upd7759_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 | } |
| 755 | 767 | |
| 756 | 768 | //------------------------------------------------- |
| 757 | 769 | // device_config_complete - perform any |
| r17754 | r17755 | |
| 792 | 804 | } |
| 793 | 805 | |
| 794 | 806 | |
| 807 | const device_type UPD7756 = &device_creator<upd7756_device>; |
| 808 | |
| 809 | upd7756_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 | |
| 818 | void 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
| r17754 | r17755 | |
| 30 | 30 | { |
| 31 | 31 | public: |
| 32 | 32 | 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); |
| 33 | 34 | ~upd7759_device() { global_free(m_token); } |
| 34 | 35 | |
| 35 | 36 | // access to legacy token |
| r17754 | r17755 | |
| 49 | 50 | |
| 50 | 51 | extern const device_type UPD7759; |
| 51 | 52 | |
| 53 | class upd7756_device : public upd7759_device |
| 54 | { |
| 55 | public: |
| 56 | upd7756_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 52 | 57 | |
| 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 | |
| 62 | extern const device_type UPD7756; |
| 63 | |
| 64 | |
| 53 | 65 | #endif /* __UPD7759_H__ */ |