revision 80:1d59b19eb505
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 80:1d59b19eb505 |
parent | 79:6d832137fdff |
child | 81:1c1d53584da4 |
author | nkeynes |
date | Mon Jan 16 11:23:28 2006 +0000 (18 years ago) |
Tweaks to timer to make sure it's actually a one-shot
1.1 --- a/src/aica/armcore.c Mon Jan 16 11:23:05 2006 +00001.2 +++ b/src/aica/armcore.c Mon Jan 16 11:23:28 2006 +00001.3 @@ -1,5 +1,5 @@1.4 /**1.5 - * $Id: armcore.c,v 1.17 2006-01-12 11:30:19 nkeynes Exp $1.6 + * $Id: armcore.c,v 1.18 2006-01-16 11:23:28 nkeynes Exp $1.7 *1.8 * ARM7TDMI CPU emulation core.1.9 *1.10 @@ -87,8 +87,6 @@1.11 return 0;1.12 }1.14 -#define IS_TIMER_ENABLED() (MMIO_READ( AICA2, AICA_TCR ) & 0x40)1.15 -1.16 uint32_t arm_run_slice( uint32_t num_samples )1.17 {1.18 int i,j,k;1.19 @@ -108,12 +106,15 @@1.20 }1.21 #endif1.22 }1.23 -1.24 - if( IS_TIMER_ENABLED() ) {1.25 +1.26 + k = MMIO_READ( AICA2, AICA_TCR );1.27 + if( k & 0x40 ) {1.28 uint8_t val = MMIO_READ( AICA2, AICA_TIMER );1.29 val++;1.30 - if( val == 0 )1.31 + if( val == 0 ) {1.32 aica_event( AICA_EVENT_TIMER );1.33 + MMIO_WRITE( AICA2, AICA_TCR, k & ~0x40 );1.34 + }1.35 MMIO_WRITE( AICA2, AICA_TIMER, val );1.36 }1.37 if( !dreamcast_is_running() )
.