Previous 15994 Revisions Next

r4629 Monday 4th May, 2009 at 12:59:53 UTC by Curt Coder
[CRVISION] Added support for stereo tapes.
[docs]messnew.txt
[src/emu/sound]sn76496.c wave.c
[src/mess/drivers]crvision.c

src/emu/sound/sn76496.c
r4628r4629
112112   stream_update(R->Channel);
113113
114114   /* set number of cycles until READY is active; this is always one 'sample', i.e. it equals the clock divider exactly; until the clock divider is fully supported, we delay until one sample has played */
115   R->CyclestoREADY = 4;
115   R->CyclestoREADY = 2;
116116
117117   if (data & 0x80)
118118   {
src/emu/sound/wave.c
r4628r4629
1919
2020#define ALWAYS_PLAY_SOUND   0
2121
22
23
2422static STREAM_UPDATE( wave_sound_update )
2523{
2624#ifdef MESS
r4628r4629
2927   cassette_state state;
3028   double time_index;
3129   double duration;
32   stream_sample_t *buffer = outputs[0];
30   stream_sample_t *left_buffer = outputs[0];
31   stream_sample_t *right_buffer = outputs[1];
3332   int i;
3433
3534   state = cassette_get_state(image);
3635
3736   state &= CASSETTE_MASK_UISTATE | CASSETTE_MASK_MOTOR | CASSETTE_MASK_SPEAKER;
37   
3838   if (image_exists(image) && (ALWAYS_PLAY_SOUND || (state == (CASSETTE_PLAY | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED))))
3939   {
4040      cassette = cassette_get_image(image);
4141      time_index = cassette_get_position(image);
4242      duration = ((double) samples) / image->machine->sample_rate;
4343
44      cassette_get_samples(cassette, 0, time_index, duration, samples, 2, buffer, CASSETTE_WAVEFORM_16BIT);
44      cassette_get_samples(cassette, 0, time_index, duration, samples, 2, left_buffer, CASSETTE_WAVEFORM_16BIT);
45      cassette_get_samples(cassette, 1, time_index, duration, samples, 2, right_buffer, CASSETTE_WAVEFORM_16BIT);
4546
46      for (i = samples-1; i >= 0; i--)
47         buffer[i] = ((INT16 *) buffer)[i];
47      for (i = samples - 1; i >= 0; i--)
48      {
49         left_buffer[i] = ((INT16 *) left_buffer)[i];
50         right_buffer[i] = ((INT16 *) right_buffer)[i];
51      }
4852   }
4953   else
5054   {
51      memset(buffer, 0, sizeof(*buffer) * samples);
55      memset(left_buffer, 0, sizeof(*left_buffer) * samples);
56      memset(right_buffer, 0, sizeof(*right_buffer) * samples);
5257   }
5358#endif
5459}
r4628r4629
6570#ifdef MESS
6671   image = devtag_get_device( device->machine, (const char *)device->static_config );
6772#endif
68   stream_create(device, 0, 1, device->machine->sample_rate, (void *)image, wave_sound_update);
73   stream_create(device, 0, 2, device->machine->sample_rate, (void *)image, wave_sound_update);
6974}
7075
7176
r4628r4629
8287      case DEVINFO_INT_TOKEN_BYTES:               info->i = 0;                         break;
8388
8489      /* --- the following bits of info are returned as pointers to data or functions --- */
85      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME( wave );      break;
90      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME( wave );   break;
8691      case DEVINFO_FCT_STOP:                     /* nothing */                        break;
8792      case DEVINFO_FCT_RESET:                     /* nothing */                        break;
8893
8994      /* --- the following bits of info are returned as NULL-terminated strings --- */
9095      case DEVINFO_STR_NAME:                     strcpy(info->s, "Cassette");            break;
91      case DEVINFO_STR_FAMILY:               strcpy(info->s, "Cassette");            break;
92      case DEVINFO_STR_VERSION:               strcpy(info->s, "1.0");                  break;
93      case DEVINFO_STR_SOURCE_FILE:                  strcpy(info->s, __FILE__);               break;
94      case DEVINFO_STR_CREDITS:               strcpy(info->s, "Copyright The MESS Team"); break;
96      case DEVINFO_STR_FAMILY:                  strcpy(info->s, "Cassette");            break;
97      case DEVINFO_STR_VERSION:                  strcpy(info->s, "1.0");                  break;
98      case DEVINFO_STR_SOURCE_FILE:               strcpy(info->s, __FILE__);               break;
99      case DEVINFO_STR_CREDITS:                  strcpy(info->s, "Copyright The MESS Team"); break;
95100   }
96101}
src/mess/drivers/crvision.c
r4628r4629
1313    TODO:
1414
1515   - BASIC v1,v2 numbers are invisible
16   - cassette left (data) / right (audio) track separation
1716    - proper keyboard emulation, need keyboard schematics
1817   - parallel I/O module
1918
r4628r4629
2625#include "devices/cassette.h"
2726#include "machine/6821pia.h"
2827#include "sound/sn76496.h"
28#include "sound/wave.h"
2929#include "video/tms9928a.h"
3030
3131static const device_config *cassette_device_image(running_machine *machine)
r4628r4629
506506   MDRV_SOUND_ADD(SN76489_TAG, SN76489, XTAL_2MHz)
507507   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
508508
509   MDRV_SOUND_WAVE_ADD("wave", "cassette")
510   MDRV_SOUND_ROUTE(1, "mono", 0.25)
511
509512   /* peripheral hardware */
510513   MDRV_PIA6821_ADD(PIA6821_TAG, crvision_pia_intf)
511514
docs/messnew.txt
r4628r4629
88
99System Driver Changes:
1010----------------------
11(none)
11- [CRVISION] Added support for stereo tapes. [Curt Coder]
1212
1313
1414
r4628r4629
2626
2727Source Changes:
2828----------------
29(none)
29- Converted the WAVE sound device to stereo. [Curt Coder]
3030
3131
3232

Previous 15994 Revisions Next


© 1998-2018 The MESS Team