It is currently Tue Dec 12, 2017 8:43 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: Forced vblank
PostPosted: Sun Nov 20, 2016 5:43 pm 
Offline

Joined: Thu Aug 28, 2008 1:17 am
Posts: 591
If you turn off the display early, and only have 192 active scanlines for the display - you should be able to transfer up to 1000 bytes to PPU port using lda #nn, sta port? And still have roughly 16 scanlines in vblank left over, right?

_________________
__________________________
http://pcedev.wordpress.com


Top
 Profile  
 
 Post subject: Re: Forced vblank
PostPosted: Sun Nov 20, 2016 5:47 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19335
Location: NE Indiana, USA (NTSC)
On NTSC NES, 192 active picture lines mean 70 blank lines, or 70*(341/3) = 7956 CPU cycles. The unrolled loop you describe transfers 1 byte of data per 6 cycles, or 1024 bytes in 6144 cycles or 6144/(341/3) = 54 lines. But where will you be storing this unrolled loop, at 5 bytes of code per 1 byte of data?


Top
 Profile  
 
 Post subject: Re: Forced vblank
PostPosted: Sun Nov 20, 2016 5:57 pm 
Online
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10164
Location: Rio de Janeiro - Brazil
tepples wrote:
But where will you be storing this unrolled loop, at 5 bytes of code per 1 byte of data?

In the 8KB of WRAM in the cartridge?


Top
 Profile  
 
 Post subject: Re: Forced vblank
PostPosted: Sun Nov 20, 2016 6:09 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19335
Location: NE Indiana, USA (NTSC)
During what fraction of the 192-line (21824-cycle) active picture time will the data in the 8 KiB of WRAM in the cartridge be filled, especially with the updates needing to be spaced five bytes apart? That's less than 22 cycles per byte.


Top
 Profile  
 
 Post subject: Re: Forced vblank
PostPosted: Sun Nov 20, 2016 6:31 pm 
Online
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10164
Location: Rio de Janeiro - Brazil
Indeed, that's the real question! :wink:

Since there's not much CPU time left to actually compute 1024 bytes of data and buffer them, could it be that this data is supposed to be generated by extra hardware in the cartridge?


Top
 Profile  
 
 Post subject: Re: Forced vblank
PostPosted: Sun Nov 20, 2016 6:48 pm 
Offline

Joined: Thu Aug 28, 2008 1:17 am
Posts: 591
Ahh.. but you guys are assuming the data being built to the buffer needs to happen in a single frame. I never said that :)

_________________
__________________________
http://pcedev.wordpress.com


Top
 Profile  
 
 Post subject: Re: Forced vblank
PostPosted: Sun Nov 20, 2016 7:42 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19335
Location: NE Indiana, USA (NTSC)
If the transfer into the buffer can happen over several frames, then why does a 1K transfer out of the buffer need to happen in a single frame? A moderately (16x) unrolled loop can achieve 9 cycles per byte using the 6502's aaaa,X addressing mode. This can move 1K in about 4 frames (or 6 with OAM DMA every frame) even without forced blank. If it's for a nametable, there's enough VRAM in the Control Deck to double-buffer that.

I'm just curious about the sort of game loop you'll be using this for, as a way of getting XY problems out of the way for your anticipated follow-up questions.


Top
 Profile  
 
 Post subject: Re: Forced vblank
PostPosted: Wed Nov 30, 2016 10:38 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2423
Maybe it's to load an entire tile map at once.


Top
 Profile  
 
 Post subject: Re: Forced vblank
PostPosted: Wed Nov 30, 2016 11:05 pm 
Offline

Joined: Thu Aug 28, 2008 1:17 am
Posts: 591
The reason of why, is kind of irrelevant. It's more, can I, and then later I'll find a reason to use it. And yes, it specifically concerns itself only with vblank one shot, and not how many other frames it takes "build it". At least, for some ideas. Form gives rise to function.

_________________
__________________________
http://pcedev.wordpress.com


Top
 Profile  
 
 Post subject: Re: Forced vblank
PostPosted: Thu Dec 01, 2016 5:44 am 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2423
Yes, you can.


Top
 Profile  
 
 Post subject: Re: Forced vblank
PostPosted: Sat Dec 03, 2016 2:07 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2423
I do wonder if any games actually do update the entire tile map every frame instead of just parts that need changing.


Top
 Profile  
 
 Post subject: Re: Forced vblank
PostPosted: Sat Dec 03, 2016 2:14 pm 
Online
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10164
Location: Rio de Janeiro - Brazil
psycopathicteen wrote:
I do wonder if any games actually do update the entire tile map every frame instead of just parts that need changing.

On the NES? With the exception of Hydlide, I doubt it. But anything using a TMS9918, which doesn't support hardware scrolling, direct have another option.


Top
 Profile  
 
 Post subject: Re: Forced vblank
PostPosted: Sat Dec 03, 2016 3:11 pm 
Offline
User avatar

Joined: Mon Oct 06, 2014 12:37 am
Posts: 187
tokumaru wrote:
psycopathicteen wrote:
I do wonder if any games actually do update the entire tile map every frame instead of just parts that need changing.

On the NES? With the exception of Hydlide, I doubt it. But anything using a TMS9918, which doesn't support hardware scrolling, direct have another option.

Speaking of Hydlide, what about updating every 6 frames? :P
The result is coarser, but far less "crawly" than Hydlide's scrolling.
Image


Top
 Profile  
 
 Post subject: Re: Forced vblank
PostPosted: Sat Dec 03, 2016 5:20 pm 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 3968
Alp wrote:
Speaking of Hydlide, what about updating every 6 frames? :P
The result is coarser, but far less "crawly" than Hydlide's scrolling.
Image

You could totally get smooth scrolling with CHR-RAM and a few sprites on the side.

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


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

All times are UTC - 7 hours


Who is online

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