1.1 --- a/src/aica/aica.c Thu Mar 30 11:27:11 2006 +0000
1.2 +++ b/src/aica/aica.c Thu Dec 14 12:31:38 2006 +0000
1.5 - * $Id: aica.c,v 1.18 2006-03-30 11:27:11 nkeynes Exp $
1.6 + * $Id: aica.c,v 1.19 2006-06-27 11:04:03 nkeynes Exp $
1.8 * This is the core sound system (ie the bit which does the actual work)
1.11 aica_start, aica_run_slice, aica_stop,
1.12 aica_save_state, aica_load_state };
1.14 +/* 20 years in seconds */
1.15 +#define RTC_OFFSET 631152000
1.16 +unsigned int aica_time_of_day = 0;
1.19 * Initialize the AICA subsystem. Note requires that
1.23 void aica_reset( void )
1.25 + struct timeval tv;
1.27 aica_event(2); /* Pre-deliver a timer interrupt */
1.29 + // gettimeofday( &tv, NULL );
1.30 + // aica_time_of_day = tv.tv_sec + RTC_OFFSET;
1.31 + aica_time_of_day = 0x5bfc8900;
1.34 void aica_start( void )
1.36 if( nanosecs_done > 1000000000 ) {
1.37 samples_done -= AICA_SAMPLE_RATE;
1.38 nanosecs_done -= 1000000000;
1.39 + aica_time_of_day++;
1.43 @@ -220,26 +230,21 @@
1.47 -/* 20 years in seconds */
1.48 -#define RTC_OFFSET 631152000
1.50 int32_t mmio_region_AICARTC_read( uint32_t reg )
1.57 - if( gettimeofday( &tv, NULL ) == 0 ) {
1.58 - return ((uint32_t)(tv.tv_sec + RTC_OFFSET)) >> 16;
1.60 + rv = (aica_time_of_day >> 16) & 0xFFFF;
1.63 - if( gettimeofday( &tv, NULL ) == 0 ) {
1.64 - return ((uint32_t)(tv.tv_sec + RTC_OFFSET)) & 0xFFFF;
1.66 + rv = aica_time_of_day & 0xFFFF;
1.70 + DEBUG( "Read AICA RTC %d => %08X", reg, rv );
1.74 MMIO_REGION_WRITE_STUBFN( AICARTC )