[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3829: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3247)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3831: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3247)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3832: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3247)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3833: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3247)
lxdream.org :: Forums :: View topic - Strange behaviour of arm_run slice
lxdream.org :: Forums :: View topic - Strange behaviour of arm_run slice
lxdream 0.9.1
released Jun 29
Download Now
It is currently Tue Jul 16, 2024 7:33 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Strange behaviour of arm_run slice
PostPosted: Mon Feb 28, 2011 6:49 am 
Offline

Joined: Mon Jan 31, 2011 3:56 am
Posts: 10
i used following code:

uint32_t arm_run_slice( uint32_t num_samples )
{

//JoeFix TODO:
//when the number of samples played surpass 32768 the program trips out
int i,j;
int k;
int val2=0;
if( !armr.running )
return num_samples;
joe_arm_counter++;
for( i=0; i<num_samples; i++ ) {
for( j=0; j < CYCLES_PER_SAMPLE; j++ ) {
armr.icount++;
if( !arm_execute_instruction() )
return i;
#ifdef ENABLE_DEBUG_MODE
for( k=0; k<arm_breakpoint_count; k++ ) {
if( arm_breakpoints[k].address == armr.r[15] ) {
dreamcast_stop();
if( arm_breakpoints[k].type == BREAK_ONESHOT )
arm_clear_breakpoint( armr.r[15], BREAK_ONESHOT );
return i;
}
}
#endif
}

k = MMIO_READ( AICA2, AICA_TCR );
uint8_t val = MMIO_READ( AICA2, AICA_TIMER );
val++;
if( val == 0 ) {
aica_event( AICA_EVENT_TIMER );
fprintf(stderr,"MMIO WRITE k%d i=%d j=%d cnt=%d\n",k,i,j,joe_arm_counter);
MMIO_WRITE( AICA2, AICA_TCR, k & ~0x40 );


}
MMIO_WRITE( AICA2, AICA_TIMER, val );
fprintf(stderr,"MMIO VAL=%d\n",val);

if( !dreamcast_is_running() )
break;
}

return i;
}

here the result
MMIO WRITE k1983 i=31 j=41 cnt=667
MMIO VAL=0
MMIO VAL=1
MMIO VAL=2
MMIO VAL=3
MMIO VAL=4
MMIO VAL=5
MMIO VAL=6
MMIO VAL=7
MMIO VAL=8
MMIO VAL=9
MMIO VAL=10
MMIO VAL=11
MMIO VAL=12
MMIO VAL=13
MMIO VAL=14
MMIO VAL=15
MMIO VAL=16
MMIO VAL=17
MMIO VAL=18
MMIO VAL=19
MMIO VAL=20
MMIO VAL=21
MMIO VAL=22
MMIO VAL=23
MMIO VAL=24
MMIO VAL=25
MMIO VAL=26
MMIO VAL=27
MMIO VAL=28
MMIO VAL=29
MMIO VAL=30
MMIO VAL=31
MMIO VAL=32
MMIO VAL=33
MMIO VAL=34
MMIO VAL=35
MMIO VAL=36
MMIO VAL=37
MMIO VAL=38
MMIO VAL=39
MMIO VAL=40
MMIO VAL=41
MMIO VAL=42
MMIO VAL=43
MMIO VAL=44
MMIO VAL=45
MMIO VAL=46
MMIO VAL=47
MMIO VAL=48
MMIO VAL=49
MMIO VAL=50
MMIO VAL=51
MMIO VAL=52
MMIO VAL=53
MMIO VAL=54
MMIO VAL=55
MMIO VAL=56
MMIO VAL=57
MMIO VAL=58
MMIO VAL=59
MMIO VAL=60
MMIO VAL=61
MMIO VAL=62
MMIO VAL=63
MMIO VAL=64
MMIO VAL=65
MMIO VAL=66
MMIO VAL=67
MMIO VAL=68
MMIO VAL=69
MMIO VAL=70
MMIO VAL=71
MMIO VAL=72
MMIO VAL=73
MMIO VAL=74
MMIO VAL=75
MMIO VAL=76
MMIO VAL=77
MMIO VAL=78
MMIO VAL=79
MMIO VAL=80
MMIO VAL=81
MMIO VAL=82
MMIO VAL=83
MMIO VAL=84
MMIO VAL=85
MMIO VAL=86
MMIO VAL=87
MMIO VAL=88
MMIO VAL=89
MMIO VAL=90
MMIO VAL=91
MMIO VAL=92
MMIO VAL=93
MMIO VAL=94
MMIO VAL=95
MMIO VAL=96
MMIO VAL=97
MMIO VAL=98
MMIO VAL=99
MMIO VAL=100
MMIO VAL=101
MMIO VAL=102
MMIO VAL=103
MMIO VAL=104
MMIO VAL=105
MMIO VAL=106
MMIO VAL=107
MMIO VAL=108
MMIO VAL=109
MMIO VAL=110
MMIO VAL=111
MMIO VAL=112
MMIO VAL=113
MMIO VAL=114
MMIO VAL=115
MMIO VAL=116
MMIO VAL=117
MMIO VAL=118
MMIO VAL=119
MMIO VAL=120
MMIO VAL=121
MMIO VAL=122
MMIO VAL=123
MMIO VAL=124
MMIO VAL=125
MMIO VAL=126
MMIO VAL=127
MMIO VAL=128
MMIO VAL=129
MMIO VAL=130
MMIO VAL=131
MMIO VAL=132
MMIO VAL=133
MMIO VAL=134
MMIO VAL=135
MMIO VAL=136
MMIO VAL=137
MMIO VAL=138
MMIO VAL=139
MMIO VAL=140
MMIO VAL=141
MMIO VAL=142
MMIO VAL=143
MMIO VAL=144
MMIO VAL=145
MMIO VAL=146
MMIO VAL=147
MMIO VAL=148
MMIO VAL=149
MMIO VAL=150
MMIO VAL=151
MMIO VAL=152
MMIO VAL=153
MMIO VAL=154
MMIO VAL=155
MMIO VAL=156
MMIO VAL=157
MMIO VAL=158
MMIO VAL=159
MMIO VAL=160
MMIO VAL=161
MMIO VAL=162
MMIO VAL=163
MMIO VAL=164
MMIO VAL=165
MMIO VAL=166
MMIO VAL=167
MMIO VAL=168
MMIO VAL=169
MMIO VAL=170
MMIO VAL=171
MMIO VAL=172
MMIO VAL=173
MMIO VAL=174
MMIO VAL=175
MMIO VAL=176
MMIO VAL=177
MMIO VAL=178
MMIO VAL=179
MMIO VAL=180
MMIO VAL=181
MMIO VAL=182
MMIO VAL=183
MMIO VAL=184
MMIO VAL=185
MMIO VAL=186
MMIO VAL=187
MMIO VAL=188
MMIO VAL=189
MMIO VAL=190
MMIO VAL=191
MMIO VAL=192
MMIO VAL=193
MMIO VAL=194
MMIO VAL=195
MMIO VAL=196
MMIO VAL=197
MMIO VAL=198
MMIO VAL=199
MMIO VAL=200
MMIO VAL=201
MMIO VAL=202
MMIO VAL=203
MMIO VAL=204
MMIO VAL=205
MMIO VAL=206
MMIO VAL=207
MMIO VAL=208
MMIO VAL=209
MMIO VAL=210
MMIO VAL=211
MMIO VAL=212
MMIO VAL=213
MMIO VAL=214
MMIO VAL=215
MMIO VAL=216
MMIO VAL=217
MMIO VAL=218
MMIO VAL=219
MMIO VAL=220
MMIO VAL=221
MMIO VAL=222
MMIO VAL=223
MMIO VAL=224
MMIO VAL=225
MMIO VAL=226
MMIO VAL=227
MMIO VAL=228
MMIO VAL=229
MMIO VAL=230
MMIO VAL=231
MMIO VAL=232
MMIO VAL=233
MMIO VAL=234
MMIO VAL=235
MMIO VAL=236
MMIO VAL=237
MMIO VAL=238
MMIO VAL=239
MMIO VAL=240
MMIO VAL=241
MMIO VAL=242
MMIO VAL=243
MMIO VAL=244
MMIO VAL=245
MMIO VAL=246
MMIO VAL=247
MMIO VAL=248
MMIO VAL=249
MMIO VAL=250
MMIO VAL=251
MMIO VAL=252
MMIO VAL=253
MMIO VAL=254
MMIO VAL=255
MMIO WRITE k1983 i=47 j=41 cnt=672
MMIO VAL=0
MMIO VAL=1
MMIO VAL=2
MMIO VAL=3
MMIO VAL=4
MMIO VAL=5
MMIO VAL=6
MMIO VAL=7
MMIO VAL=8
MMIO VAL=9
MMIO VAL=10
MMIO VAL=11
MMIO VAL=12
MMIO VAL=13
MMIO VAL=14
MMIO VAL=15
MMIO VAL=16
MMIO VAL=17
MMIO VAL=18
MMIO VAL=19
MMIO VAL=20
MMIO VAL=21
MMIO VAL=22
MMIO VAL=23
MMIO VAL=24
MMIO VAL=25
MMIO VAL=26
MMIO VAL=27
MMIO VAL=28
MMIO VAL=29
MMIO VAL=30
MMIO VAL=31
MMIO VAL=32
MMIO VAL=33
MMIO VAL=34
MMIO VAL=35
MMIO VAL=36
MMIO VAL=37
MMIO VAL=38
MMIO VAL=39
MMIO VAL=40
MMIO VAL=41
MMIO VAL=42
MMIO VAL=43
MMIO VAL=44
MMIO VAL=45
MMIO VAL=46
MMIO VAL=47
MMIO VAL=48
MMIO VAL=49
MMIO VAL=50
MMIO VAL=51
MMIO VAL=52
MMIO VAL=53
MMIO VAL=54
MMIO VAL=55
MMIO VAL=56
MMIO VAL=57
MMIO VAL=58
MMIO VAL=59
MMIO VAL=60
MMIO VAL=61
MMIO VAL=62
MMIO VAL=63
MMIO VAL=64
MMIO VAL=65
MMIO VAL=66
MMIO VAL=67
MMIO VAL=68
MMIO VAL=69
MMIO VAL=70
MMIO VAL=71
MMIO VAL=72
MMIO VAL=73
MMIO VAL=74
MMIO VAL=75
MMIO VAL=76
MMIO VAL=77
MMIO VAL=78
MMIO VAL=79
MMIO VAL=80
MMIO VAL=81
MMIO VAL=82
MMIO VAL=83
MMIO VAL=84
MMIO VAL=85
MMIO VAL=86
MMIO VAL=87
MMIO VAL=88
MMIO VAL=89
MMIO VAL=90
MMIO VAL=91
MMIO VAL=92
MMIO VAL=93
MMIO VAL=94
MMIO VAL=95
MMIO VAL=96
MMIO VAL=97
MMIO VAL=98
MMIO VAL=99
MMIO VAL=213
MMIO VAL=214
MMIO VAL=215
MMIO VAL=216
MMIO VAL=217
MMIO VAL=218
MMIO VAL=219
MMIO VAL=220
MMIO VAL=221
MMIO VAL=222
MMIO VAL=223
MMIO VAL=224
MMIO VAL=225
MMIO VAL=226
MMIO VAL=227
MMIO VAL=228
MMIO VAL=229
MMIO VAL=230
MMIO VAL=231
MMIO VAL=232
MMIO VAL=233
MMIO VAL=234
MMIO VAL=235
MMIO VAL=236
MMIO VAL=237
MMIO VAL=238
MMIO VAL=239
MMIO VAL=240
MMIO VAL=241
MMIO VAL=242
MMIO VAL=243
MMIO VAL=244
MMIO VAL=245
MMIO VAL=246
MMIO VAL=247
MMIO VAL=248
MMIO VAL=249
MMIO VAL=250
MMIO VAL=251
MMIO VAL=252
MMIO VAL=253
MMIO VAL=254
MMIO VAL=255
MMIO WRITE k72 i=46 j=41 cnt=675
HERE INSTEAD OF 0-255 only 212-255
MMIO VAL=0
MMIO VAL=213
MMIO VAL=214
MMIO VAL=215
MMIO VAL=216
MMIO VAL=217
MMIO VAL=218

i noticed that this may be reated to the fact that 675*48 very near to 32768 is so maybe a 16 bit problem
please note that cycles_per samples is set to 41 and num_samples to 48


Top
 Profile  
 
 Post subject: Re: Strange behaviour of arm_run slice
PostPosted: Tue Mar 01, 2011 12:43 am 
Offline
Admin

Joined: Mon Jun 26, 2006 9:47 pm
Posts: 293
Caveat: It's entirely possible that large chunks of the AICA implementation are completely wrong and based on me wildly misunderstanding how the chip is supposed to work. Having said that, as I understand it:

The register you're looking at is an 8-bit timer. It ticks up for each sample, and triggers an interrupt on overflow. The interrupt handler then normally resets the timer so it goes off again after an appropriate number of samples. 212 is likely to be common - it's 44 samples, or as close as the timer resolution can get to 1ms.

Cheers,
Nathan


Top
 Profile  
 
 Post subject: Re: Strange behaviour of arm_run slice
PostPosted: Tue Mar 01, 2011 4:42 pm 
Offline

Joined: Mon Jan 31, 2011 3:56 am
Posts: 10
I understand but should it be reset to 0 instead of 212 ?


Top
 Profile  
 
 Post subject: Re: Strange behaviour of arm_run slice
PostPosted: Wed Mar 02, 2011 2:03 am 
Offline
Admin

Joined: Mon Jun 26, 2006 9:47 pm
Posts: 293


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group