nesdev.com
http://forums.nesdev.com/

How to convert a photo to NES format
http://forums.nesdev.com/viewtopic.php?f=21&t=13014
Page 3 of 3

Author:  ccovell [ Sat Jul 18, 2015 8:11 am ]
Post subject:  Re: How to convert a photo to NES format

Yes, Mixed...Remixed...Mixed...Remixed... it was hard to find.

Author:  lidnariq [ Sat Jul 18, 2015 9:39 am ]
Post subject:  Re: How to convert a photo to NES format

I made a simple ROM some time ago that bankswitched both nametables and CHR ROM (and emphasis...) on every scanline to get 16x1 pixel attribute zones: viewtopic.php?p=113253#p113253

Never got around to making the analyzer to actually produce palette data for it, though...

Author:  tokumaru [ Sat Jul 18, 2015 1:42 pm ]
Post subject:  Re: How to convert a photo to NES format

dougeff wrote:
I don't seem to be able to use scanline counting to switch nametables at every scanline

IIRC, the MMC3 can only generate IRQs every 2 scanlines.

Quote:
Is the timing something like this...wait for v_blank, wait till not v_blank, 114 cycles switch / 114 cycles switch / 113 cycles switch / repeat. ?

Yeah. But don't poll PPU_STATUS ($2002) for waiting for VBlank, always use NMIs. Detecting the end of VBlank isn't trivial either: one way is to use timed code from the start of VBlank, the other is to wait for the sprite 0 hit or sprite overflow flags (intentionally set during the previous frame) to be cleared.

Author:  tepples [ Sat Jul 18, 2015 2:00 pm ]
Post subject:  Re: How to convert a photo to NES format

tokumaru wrote:
dougeff wrote:
I don't seem to be able to use scanline counting to switch nametables at every scanline

IIRC, the MMC3 can only generate IRQs every 2 scanlines.

This is true of MMC3A and MMC3B. MMC3B S and MMC3C can do IRQs every line, but I wouldn't recommend it because latency.

Quote:
Detecting the end of VBlank isn't trivial either: one way is to use timed code from the start of VBlank, the other is to wait for the sprite 0 hit or sprite overflow flags (intentionally set during the previous frame) to be cleared.

A third, if you are using the MMC3 and not using forced blanking at the top, is when the MMC3 starts counting lines.

Author:  dougeff [ Sat Jul 18, 2015 2:28 pm ]
Post subject:  Re: How to convert a photo to NES format

Thanks for the suggestions. I think I'll try Tepples idea first. Won't have time till Monday, but I have in mind to do some more full color tests that switch nametables every scanline.

I was only able to get every 2 scanlines on my earlier tests with MMC3 counting irqs.

Author:  tokumaru [ Sat Jul 18, 2015 5:28 pm ]
Post subject:  Re: How to convert a photo to NES format

tepples wrote:
A third, if you are using the MMC3 and not using forced blanking at the top, is when the MMC3 starts counting lines.

What's the soonest an MMC3 IRQ can fire in the frame? I assume that memory fetches during the pre-render scanline clock it normally, right?

Author:  tepples [ Sat Jul 18, 2015 5:42 pm ]
Post subject:  Re: How to convert a photo to NES format

tokumaru wrote:
What's the soonest an MMC3 IRQ can fire in the frame? I assume that memory fetches during the pre-render scanline clock it normally, right?

If I remember correctly, Kick Master needs the MMC3 PIT to be clocked 241 times per frame: once on the pre-render line and once on each picture line.

Author:  dougeff [ Sat Jul 18, 2015 7:41 pm ]
Post subject:  Re: How to convert a photo to NES format

On my full name table test, I had to have the first count 1 more than the last two, which implies that it was counting the prerender line as a scanline. Of course this is on an emulator (FCEUX), not real hardware.

Author:  dougeff [ Mon Jul 20, 2015 11:32 am ]
Post subject:  Re: How to convert a photo to NES format

I gave it a good try, but mixing 2 nametables scanline by scanline does not make it more colorfull, as I hoped. Rather it blends the 2 colors, making the color more gray or just wrong. I think a better approach would be to layer sprites on top of the background, which actually would have the effect of adding more colors. The final product would be a max 64x64 pixels, though.

Here's some of my attempts at full color.

Attachments:
Fruit10.gif
Fruit10.gif [ 9.66 KiB | Viewed 1443 times ]
Fruit9.gif
Fruit9.gif [ 8.71 KiB | Viewed 1443 times ]
Fruit7.gif
Fruit7.gif [ 9.7 KiB | Viewed 1443 times ]

Author:  dougeff [ Mon Jul 20, 2015 11:35 am ]
Post subject:  Re: How to convert a photo to NES format

Here's my favorite, done by switching between 4 shades of gray and red, yellow, and green. Colors are a bit dull, but at least the right color.

And the NES file, which switches nametables every scanline.

Attachments:
scan5.nes [24.02 KiB]
Downloaded 59 times
Fruit5.gif
Fruit5.gif [ 9.61 KiB | Viewed 1443 times ]

Author:  dougeff [ Mon Jul 20, 2015 1:53 pm ]
Post subject:  Re: How to convert a photo to NES format

Just one more try. I started by seperating green on one palette and red/blue on another, but it looked wrong, and I just edited each palette color until it looked ok. Now the colors are almost right. And it only took 11 tries.

Attachments:
scan11.nes [24.02 KiB]
Downloaded 61 times
Fruit11.gif
Fruit11.gif [ 8.32 KiB | Viewed 1431 times ]

Author:  dougeff [ Sun Aug 02, 2015 12:41 am ]
Post subject:  Re: How to convert a photo to NES format

I started this thread with the complaint that I couldn't find a good tutorial on NES graphics...well, I found one today.

http://www.atelier-betoux.com/2015/07/1 ... hic-tools/

This guy lives in France, and is getting into NES homebrewing...and he's a web designer.

Author:  ccovell [ Sun Aug 02, 2015 2:09 am ]
Post subject:  Re: How to convert a photo to NES format

Yes, this is about the bare basics of tile editing... it's not really about photo conversion or colour reduction.

Page 3 of 3 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/