It is currently Tue Oct 17, 2017 9:40 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: ppu pixel number
PostPosted: Wed Feb 23, 2005 3:15 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3064
Location: Brazil
One CPU cycle means 1 PPU pixel. Is incorrect to assume ppupixel = cpucycle % 342, plus its 'connection' with the scroll registers on line rendering? I mean, should I *really* increase the loopy's x_offset instead of taking cpucycle % 342?

_________________
Zepper
RockNES developer


Top
 Profile  
 
 Post subject: Re: ppu pixel number
PostPosted: Wed Feb 23, 2005 4:07 pm 
Offline
User avatar

Joined: Wed Nov 10, 2004 6:47 pm
Posts: 1845
Fx3 wrote:
One CPU cycle means 1 PPU pixel. Is incorrect to assume ppupixel = cpucycle % 342, plus its 'connection' with the scroll registers on line rendering?


You have it a little wrong. 1 pixel is rendered on each PPU cycle.... not each CPU cycle. So the current pixel being rendered is equal to the current PPU cycle of the scanline. 3 pixels are rendered for every 1 CPU cycle on an NTSC system.

Overview:

1 pixel rendered = 1 PPU cycle
3 PPU cycles = 1 CPU cycle (NTSC only)
341 PPU cycles = 1 scanline
113.666667 (341 / 3) CPU cycles = 1 scanline (NTSC only)

For PAL emulation, I believe it's actually 3.2 PPU cycles to every 1 CPU cycle... so 1 scanline is 106.5625 CPU cycles (341 / 3.2)

Fx3 wrote:
I mean, should I *really* increase the loopy's x_offset instead of taking cpucycle % 342?


Well... I doubt it will really make any difference in most games... however it really isn't difficult to update the scroll values on their proper cycles... and it likely will make a difference in games which do timing tricks.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 24, 2005 2:15 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3064
Location: Brazil
I forgot to write about my CPU cycles... I multiply them by 3! ;)

_________________
Zepper
RockNES developer


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 24, 2005 2:52 pm 
Offline
User avatar

Joined: Wed Nov 10, 2004 6:47 pm
Posts: 1845
Fx3 wrote:
I forgot to write about my CPU cycles... I multiply them by 3! ;)


As long as you're doing that... you should mutiply NTSC CPU cycles by 15, multiply PAL CPU cycles by 16, and multiply PPU cycles by 5. This way you get the proper CPU:PPU ratio in both NTSC/PAL modes ;)


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 10 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