It is currently Sun Sep 15, 2019 7:56 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 63 posts ]  Go to page Previous  1, 2, 3, 4, 5
Author Message
PostPosted: Mon Feb 04, 2019 10:36 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 11412
Location: Rio de Janeiro - Brazil
halkun wrote:
For fun I was wondering if I could do some "race the beam" kind of things with the NES, but that is going to require real hardware. On the Atari 2600 you could count cycles and alter the scan line while it's drawing on the phosphor. Looks like on the NES you are not even allowed to monkey with the beam during HSYNC.

Pixel-level synchronization on the NES is notoriously tricky, and even in the best possible scenario you'll still get a couple pixels of jitter...

Quote:
I was contemplating if you could update the nametables during HSYNC and have it spit out a different pattern for that line. If you can update the nameable on each line, you can have a full screen bitmap. Like I said, I wouldn't even know how to detect when the beam is in HSYNC so I can play with the PPU while it's off.

To access VRAM during display time, you need to turn rendering off, and one side effect of that is that it compromises the sprites for one scanline. Also, the hblank period is so short, that there there's barely enough time to update a single byte in VRAM, since you need to turn rendering off, set the VRAM address, write the data, reset the scroll and turn rendering back on.

There are other kinds of raster effects that are much easier and safer to perform though, such as scroll changes, pattern swaps and color emphasis/grayscale.

A full screen bitmap can be achieved fairly easily in 1bpp (i.e. 2-color) with some palette trickery and a pattern table swap halfway down the screen. A regular 2bpp full screen bitmap will require more CHR memory, either RAM or ROM.


Top
 Profile  
 
PostPosted: Mon Feb 04, 2019 10:54 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 4208
Location: A world gone mad
You don't have much CPU time in HBlank. 6502 instructions average ~3 cycles each (consider: a ZP load followed by a PPU write takes 7 cycles). Switching CHR-ROM banks is certainly possible, or doing a couple PPU register tweaks, but that's about it. Usually this is only something considered if there are truly justified needs for it.

If your goal is to do text-based adventures, HBlank is the least of your concerns/worries right now -- not to tell you how to run your project or anything... HBlank effects are considered highly advanced material; I don't think many here on the forum have spent much time doing it either. On the flip side, demos like this are possible, but consider that entire piece of work is precisely-timed (read: cycle counting) and IIRC, really doesn't leave much CPU time for doing other things within reason.

I think as you get more and more into this project of yours, you're going to realise that understanding the design/model and specifications (plus implementation/usage model) of the NES is going to strongly dictate what you can accomplish. Don't forget: people like myself didn't enjoy Zork because of fancy graphics or effects.


Top
 Profile  
 
PostPosted: Mon Feb 04, 2019 11:07 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 11412
Location: Rio de Janeiro - Brazil
tokumaru wrote:
There are other kinds of raster effects that are much easier and safer to perform though, such as scroll changes, pattern swaps and color emphasis/grayscale.

Here are a few examples of cool effects on the NES that are possible with combinations of the techniques I mentioned before:

https://youtu.be/BegOGJFePv4?t=0 (title screen in F-FF)
https://youtu.be/XVbZAPBPwZY?t=998 (3D floor in Cosmic Epsilon)
https://youtu.be/dWHPNnrTmKs?t=2185 (overlapping background layers in Bucky O'Hare)
https://youtu.be/43pmwBwBoHs?t=32 (semi-transparent water in Noah's Ark)
https://youtu.be/_GSfLqJUcOM?t=60 (multiple parallax layers with overlap in Sword Master)
https://youtu.be/bukusPiWTmU?t=438 (perspective floor in Battletoads & Double Dragon)
https://youtu.be/V6ngD3ZC1z8?t=594 (roads with hills in Rad Racer)
https://youtu.be/nfY79-3AdGY?t=152 (psychedelic background in Recca)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 63 posts ]  Go to page Previous  1, 2, 3, 4, 5

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