It is currently Wed May 22, 2019 3:55 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Mon Feb 18, 2019 10:01 pm 
Offline

Joined: Tue Apr 17, 2018 3:40 am
Posts: 20
On this page, it says that the effects of writing to $4017 (resetting the frame counter) occur after 3 or 4 CPU cycles, but on here, it says that it occurs after 2 or 3 cycles. And then, on the same page in the following sentence, it says that the effect is immediate.

Which one is correct or am I misinterpreting what the wiki means?


Top
 Profile  
 
PostPosted: Mon Feb 18, 2019 10:43 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 8367
Location: Seattle
Quickly looking Visual2A03, it looks like should start during the next apu_clk1 (t12848) and last until the subsequent one.

(apu_clk1 appears to be during φ1 of the CPU and the "read" phase of the APU. The frame counter either counts or restarts during apu_clk2, which is during φ1 and the "write" phase of the APU. Regardless of CPU-APU phase, "restart" is true for exactly one φ1)


Top
 Profile  
 
PostPosted: Mon Feb 18, 2019 11:53 pm 
Offline

Joined: Tue Apr 17, 2018 3:40 am
Posts: 20
Are APU "read" phases during the even CPU cycle? If so, does that mean there's either a 0 or 1 cycle delay between writing to $4017 and resetting the frame counter?


Top
 Profile  
 
PostPosted: Tue Feb 19, 2019 1:42 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 8367
Location: Seattle
I think "read" is "even", but I'm not particularly confident. I just personally find "read" and "write" easier to remember because that's how the 2A03's DMA timing is implemented.

The pattern should go either something like

Rφ1 -
Rφ2 write to $4017
Wφ1 transfer value in → reset
Wφ2 -
Rφ1 -
Rφ2 -
Wφ1 - count

or
Wφ1 - count
Wφ2 - write to $4017
Rφ1 - transfer value in
Rφ2 -
Wφ1 - reset
Wφ2 -
Rφ1 -
Rφ2 -
Wφ1 - count

Should be able to recreate this pretty easily in Visual2A03: just track "frm_restart" and "frm_count" (and maybe apu_clk1 and apu_clk2a) with two "STA $4017,y" in memory.


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 13 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