Previous 15994 Revisions Next

r4381 Wednesday 4th March, 2009 at 00:01:50 UTC by Stefano Priore
[Tape Controls] Fixed counter rewinding to negative digits or f/forwarding past maximum length of the image
[src/mess]tapectrl.c

src/mess/tapectrl.c
r4380r4381
164164{
165165   tape_control_menu_state *menustate;
166166   const ui_menu_event *event;
167   double t0, t1;
167168
168169   /* if no state, allocate some */
169170   if (state == NULL)
r4380r4381
232233                  break;
233234
234235               case TAPECMD_REWIND:
235                  cassette_seek(menustate->device, -1, SEEK_CUR);
236                  t0 = cassette_get_position(menustate->device);
237                  cassette_seek(menustate->device, ((int) t0 > 0 ? -1 : 0), SEEK_CUR);
236238                  break;
237239
238240               case TAPECMD_FAST_FORWARD:
239                  cassette_seek(menustate->device, +1, SEEK_CUR);
241                  t0 = cassette_get_position(menustate->device);
242                  t1 = cassette_get_length(menustate->device);
243                  cassette_seek(menustate->device, ((int) t0 < (int) t1 ? +1 : 0), SEEK_CUR);
240244                  break;
241245            }
242246            break;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team