Previous 15994 Revisions Next

r8059 Monday 17th May, 2010 at 11:25:54 UTC by Robbbert
{CASSETTE] Changed rewind and fast forward to move 1 minute instead of 1 second. Changed play so that the tape stops itself at the end.
[src/mess/devices]cassette.c
[src/mess/osd/windows]menu.c

src/mess/devices/cassette.c
r8058r8059
7474static void cassette_update(running_device *device)
7575{
7676   dev_cassette_t   *cassette = get_safe_token( device );
77   double cur_time;
77   double cur_time = attotime_to_double(timer_get_time(device->machine));
7878
79   cur_time = attotime_to_double(timer_get_time(device->machine));
80
8179   if (cassette_is_motor_on(device))
8280   {
8381      double new_position = cassette->position + (cur_time - cassette->position_time);
r8058r8059
8987
9088      case CASSETTE_PLAY:
9189         if ( cassette->cassette )
90         {
9291            cassette_get_sample(cassette->cassette, 0, new_position, 0.0, &cassette->value);
92            /* See if reached end of tape */
93            double length = cassette_get_length(device);
94            if (new_position > length)
95            {
96               cassette->state = (cassette_state)(CASSETTE_MASK_DRVSTATE);
97               new_position = length;
98            }
99         }
93100         break;
94101      }
95102      cassette->position = new_position;
r8058r8059
204211{
205212   dev_cassette_t   *cassette = get_safe_token( device );
206213
214   double length;
215
207216   cassette_update(device);
208217
218   length = cassette_get_length(device);   
219
209220   switch(origin) {
210221   case SEEK_SET:
211222      break;
212223
213224   case SEEK_END:
214      time += cassette_get_length(device);
225      time += length;
215226      break;
216227
217228   case SEEK_CUR:
r8058r8059
220231   }
221232
222233   /* clip position into legal bounds */
234   if (time < 0)
235      time = 0;
236   else
237   if (time > length)
238      time = length;
239
223240   cassette->position = time;
224241}
225242
src/mess/osd/windows/menu.c
r8058r8059
15651565                  break;
15661566
15671567               case DEVOPTION_CASSETTE_REWIND:
1568                  cassette_seek(img, -1.0, SEEK_CUR);
1568                  cassette_seek(img, -60.0, SEEK_CUR);
15691569                  break;
15701570
15711571               case DEVOPTION_CASSETTE_FASTFORWARD:
1572                  cassette_seek(img, +1.0, SEEK_CUR);
1572                  cassette_seek(img, +60.0, SEEK_CUR);
15731573                  break;
15741574            }
15751575         }

Previous 15994 Revisions Next


© 1998-2018 The MESS Team