@@ -41,7 +41,9 @@ static struct machine* oric = NULL;
41
41
42
42
#define CMD_BUF_SIZE 4
43
43
static Uint8 mdm_cmd_buf [CMD_BUF_SIZE ];
44
- static Uint64 mdm_time_buf [CMD_BUF_SIZE ];
44
+ // SDL_GetTicks() counts from 0 on SDL_Init, so overrun would only
45
+ // happen if you ran Oricutron for ~50 days solid
46
+ static Uint32 mdm_time_buf [CMD_BUF_SIZE ];
45
47
46
48
#define DATA_BUF_SIZE 4096
47
49
static int mdm_in = 0 ;
@@ -68,8 +70,6 @@ static int socket_write(int sock, const unsigned char* data, int len);
68
70
static int socket_read (int sock , unsigned char * data , int * len );
69
71
static int socket_close (int sock );
70
72
71
- static Uint64 time_getmillisec (void );
72
-
73
73
static char * trim (char * line )
74
74
{
75
75
if (line && * line )
@@ -361,7 +361,7 @@ static void mdm_escape(Uint8 data)
361
361
mdm_time_buf [0 ] = mdm_time_buf [1 ];
362
362
mdm_time_buf [1 ] = mdm_time_buf [2 ];
363
363
mdm_time_buf [2 ] = mdm_time_buf [3 ];
364
- mdm_time_buf [3 ] = time_getmillisec ();
364
+ mdm_time_buf [3 ] = SDL_GetTicks ();
365
365
366
366
if ( mdm_cmd_buf [1 ] == '+' && mdm_cmd_buf [2 ] == '+' && mdm_cmd_buf [3 ] == '+' )
367
367
{
@@ -436,7 +436,7 @@ SDL_bool acia_init_modem( struct acia* acia )
436
436
mdm_in_buf [0 ] = 0x00 ;
437
437
mdm_out_buf [0 ] = 0x00 ;
438
438
memset (mdm_cmd_buf , 0 , sizeof (Uint8 )* CMD_BUF_SIZE );
439
- memset (mdm_time_buf , 0 , sizeof (Uint64 )* CMD_BUF_SIZE );
439
+ memset (mdm_time_buf , 0 , sizeof (Uint32 )* CMD_BUF_SIZE );
440
440
441
441
acia -> done = modem_done ;
442
442
acia -> stat = modem_stat ;
@@ -764,21 +764,4 @@ int socket_close(int sock)
764
764
return 1 ;
765
765
}
766
766
767
- static Uint64 time_getmillisec (void )
768
- {
769
- #ifdef __LINUX__
770
- struct timespec ts ;
771
- clock_gettime (CLOCK_MONOTONIC , & ts );
772
- return ((ts .tv_sec * 1000000000 ) + ts .tv_nsec )/1000 ;
773
- #endif
774
- #if defined(__APPLE__ ) || defined(__amigaos4__ ) || defined(__MORPHOS__ )
775
- struct timeval ts ;
776
- gettimeofday (& ts , NULL );
777
- return ((ts .tv_sec * 1000000LL ) + ts .tv_usec )/1000LL ;
778
- #endif
779
- #ifdef WIN32
780
- return GetTickCount ();
781
- #endif
782
- }
783
-
784
767
#endif /* BACKEND_MODEM */
0 commit comments