It is currently Sat Oct 21, 2017 8:51 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 13 posts ] 
Author Message
PostPosted: Tue Apr 19, 2016 9:13 am 
Offline
User avatar

Joined: Wed Nov 10, 2004 6:47 pm
Posts: 1845
So I sort of posted this in another thread, but it was pretty far buried and I don't think anyone will see it, so I've decided to post it in its own thread:

I'm trying to do some DMA tests with visual2a03. Though it seems the DMC is not fetching bytes as one would expect.

Here's a simple test program:
http://www.qmtpro.com/~nes/chipimages/v ... 20300010fe

Effectively:
Code:
lda #$4F  ; fastest speed + looping
sta $4010
lda #1     ; nonzero length
sta $4012
sta $4013
lda #$10
sta $4015
jsr some_routine_that_burns_cycles
bpl -2


I would expect this to perform the first DMA shortly after the 4015 write (which it does)
Followed by another DMA ~432 cycles afterwards. But even after 800 cycles, there's no sign of a 2nd DMA.

Can anyone explain why this is happening? Is my program wrong, or is this a bug with visual2a03?



Worse, I can't seem to run visual2a03 for more than 300 cycles before it starts slowing WAY down. And after 900 cycles it completely crashes and I need to reload the page. I assume this is because of memory consumption or something. Is this an issue with my browser? Are there any workarounds?

Thanks


Top
 Profile  
 
PostPosted: Tue Apr 19, 2016 1:58 pm 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2963
Location: Tampere, Finland
Disch wrote:
Worse, I can't seem to run visual2a03 for more than 300 cycles before it starts slowing WAY down. And after 900 cycles it completely crashes and I need to reload the page. I assume this is because of memory consumption or something. Is this an issue with my browser? Are there any workarounds?

Visual2A03/Visual6502 saves the entire state of the simulation on each cycle so that it can enable backwards stepping. Obviously this leads to huge memory consumption after a while. I don't think there's a way to turn this off without modifying the source.

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: kkfos.aspekt.fi


Top
 Profile  
 
PostPosted: Tue Apr 19, 2016 8:37 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 10:59 pm
Posts: 1389
thefox wrote:
Visual2A03/Visual6502 saves the entire state of the simulation on each cycle so that it can enable backwards stepping. Obviously this leads to huge memory consumption after a while. I don't think there's a way to turn this off without modifying the source.

Trace history has been disabled on Visual2A03 - it was as simple as commenting out a few lines of code (disabling the save-state code as well as the Back button). Visual2C02 never had it to begin with - I got rid of it when I added support for custom reset states, since I had to spend several hours simulating past the initialization frames.

_________________
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.


Top
 Profile  
 
PostPosted: Tue Apr 19, 2016 11:16 pm 
Offline
User avatar

Joined: Wed Nov 10, 2004 6:47 pm
Posts: 1845
Thanks Q

Any idea on the missing DMA? Is there like some kind of APU warmup that I have to wait through?


Top
 Profile  
 
PostPosted: Wed Apr 20, 2016 4:35 am 
Offline
User avatar

Joined: Sun Sep 19, 2004 10:59 pm
Posts: 1389
Disch wrote:
Any idea on the missing DMA? Is there like some kind of APU warmup that I have to wait through?

It's possible there's a bug in the simulation itself, though I'm not sure if I'll have the time to track it down.

_________________
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.


Top
 Profile  
 
PostPosted: Wed Apr 20, 2016 4:23 pm 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2963
Location: Tampere, Finland
I believe the problem is the LFSR counter (pcm_t) that they used to regulate the period. It generates a clock when the value is $100. However, it starts at 0 at powerup and doesn't get reloaded until it has reached $100. So, it will take around 1000 cycles for it to reach $100 for the first time, after which it's reloaded with $D5, and then starts generating clocks every 54 clocks as you'd expect. You can see pcm_bits changing (0->1) for the first time at cycle 1023, then 1->2 at cycle 1077, and so on. At cycle 1404..1405 after pcm_bits has reached 7 and rolled over to 0, you can see the second DMC fetch happening.

So I don't think there's a bug in the simulation.

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: kkfos.aspekt.fi


Top
 Profile  
 
PostPosted: Wed Apr 20, 2016 4:42 pm 
Offline
User avatar

Joined: Wed Nov 10, 2004 6:47 pm
Posts: 1845
AHA! Thanks, thefox.

So in a sense.... the warmup delay was sort of accurate? XD


EDIT:

So it's still crashing for me after ~860 cycles so I can't test that out for myself =/


Top
 Profile  
 
PostPosted: Wed Apr 20, 2016 5:44 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 10:59 pm
Posts: 1389
Disch wrote:
So it's still crashing for me after ~860 cycles so I can't test that out for myself =/

Try turning off the Trace log (i.e. click "Trace less" until all of the columns disappear) or periodically Clearing the trace log.

_________________
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.


Top
 Profile  
 
PostPosted: Wed Apr 20, 2016 6:47 pm 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2963
Location: Tampere, Finland
Also make sure to reload the page (Ctrl+R) to make sure you're not running a cached version. Chrome's Task Manager (Shift+Esc) is a good way to look at the memory usage.

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: kkfos.aspekt.fi


Top
 Profile  
 
PostPosted: Thu Apr 21, 2016 4:42 am 
Offline
User avatar

Joined: Sun Sep 19, 2004 10:59 pm
Posts: 1389
thefox wrote:
Also make sure to reload the page (Ctrl+R) to make sure you're not running a cached version.

A simple reload might not do it - most browsers have an additional means to forcibly reload and ignore cache, and I think Chrome uses Ctrl+Shift+F5 for that (in Firefox, hold Shift and press the Reload button in the toolbar).

_________________
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.


Top
 Profile  
 
PostPosted: Thu Apr 21, 2016 7:55 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19113
Location: NE Indiana, USA (NTSC)
Or in Firefox, press Ctrl+Shift+R to reload and ignore local cache. (It does not necessarily bypass caching performed by an MITM in an office or ISP.)

But don't reload that way too often, as Visual 2A03 is on a connection that's kind of slow.


Top
 Profile  
 
PostPosted: Thu Apr 21, 2016 7:58 am 
Offline
User avatar

Joined: Wed Nov 10, 2004 6:47 pm
Posts: 1845
Periodically clearing the log seems to be the most effective. So it looks like both my problems are addressed! I'll have some work to do this weekend.


Top
 Profile  
 
PostPosted: Thu Apr 21, 2016 11:52 am 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3192
Location: Mountain View, CA, USA
If using Chrome: in the Developer Tools (hit F12), you can actually disable the cache entirely with a checkbox: go to the Network tab, and check "Disable cache". This applies only while the Developer Tools pane remains is open.


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 4 guests


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:  
Powered by phpBB® Forum Software © phpBB Group