How to convert a photo to NES format

A place for your artistic side. Discuss techniques and tools for pixel art on the NES, GBC, or similar platforms.

Moderator: Moderators

ccovell
Posts: 1045
Joined: Sun Mar 19, 2006 9:44 pm
Location: Japan
Contact:

Re: How to convert a photo to NES format

Post by ccovell »

Yes, Mixed...Remixed...Mixed...Remixed... it was hard to find.
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: How to convert a photo to NES format

Post by lidnariq »

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...
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: How to convert a photo to NES format

Post by tokumaru »

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.
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.
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: How to convert a photo to NES format

Post by tepples »

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.
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.
User avatar
dougeff
Posts: 3078
Joined: Fri May 08, 2015 7:17 pm

Re: How to convert a photo to NES format

Post by dougeff »

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.
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: How to convert a photo to NES format

Post by tokumaru »

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?
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: How to convert a photo to NES format

Post by tepples »

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.
User avatar
dougeff
Posts: 3078
Joined: Fri May 08, 2015 7:17 pm

Re: How to convert a photo to NES format

Post by dougeff »

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.
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
dougeff
Posts: 3078
Joined: Fri May 08, 2015 7:17 pm

Re: How to convert a photo to NES format

Post by dougeff »

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 6921 times
Fruit9.gif
Fruit9.gif (8.71 KiB) Viewed 6921 times
Fruit7.gif
Fruit7.gif (9.7 KiB) Viewed 6921 times
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
dougeff
Posts: 3078
Joined: Fri May 08, 2015 7:17 pm

Re: How to convert a photo to NES format

Post by dougeff »

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 283 times
Fruit5.gif
Fruit5.gif (9.61 KiB) Viewed 6921 times
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
dougeff
Posts: 3078
Joined: Fri May 08, 2015 7:17 pm

Re: How to convert a photo to NES format

Post by dougeff »

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 289 times
Fruit11.gif
Fruit11.gif (8.32 KiB) Viewed 6909 times
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
dougeff
Posts: 3078
Joined: Fri May 08, 2015 7:17 pm

Re: How to convert a photo to NES format

Post by dougeff »

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.
nesdoug.com -- blog/tutorial on programming for the NES
ccovell
Posts: 1045
Joined: Sun Mar 19, 2006 9:44 pm
Location: Japan
Contact:

Re: How to convert a photo to NES format

Post by ccovell »

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