Paint program, Brainfuck interpreter, BMP converter

A place where you can keep others updated about your NES-related projects through screenshots, videos or information in general.

Moderator: Moderators

Post Reply
KHS
Posts: 6
Joined: Sun Jul 12, 2009 3:03 am
Location: Finland

Paint program, Brainfuck interpreter, BMP converter

Post by KHS »

Edit: the download links have stopped working. I haven't uploaded the programs again because I no longer have the same versions on my hard drive and the current versions aren't ready for release.

---

(Sorry, my English is not very good.) Here are some NES programs by me. All of them use NROM and include source code (NESASM, comments in Finnish). I have tested them on a PowerPak on an NTSC NES.

You can download them here (both links lead to the same file): link 1, link 2. Last update: 2012-03-26 22:50 UTC.

KHS-NES-Brainfuck

An interpreter for the Brainfuck programming language. Features: maximum program length 255 instructions; 256 bytes of RAM for the Brainfuck program (wraps around); maximum output size 256 characters; ASCII character set; on-screen keyboard; shows an error message if brackets don't match; Brainfuck program can be aborted while it is running. The interpreter cannot print more than one character per frame but executes other instructions faster. Source code is included.

Video

Two video clips (64*48 'pixels', 4 colors, 10 fps, 4 seconds) and a PHP script that converts BMP files into the format used by the NES program.

BMP to NES converter

A Windows program that converts a BMP image into an NES ROM. Requires VB40032.DLL. The BMP file must be in the following format: 256*240 pixels, 2-6 color palette, no RLE. There are some BMPs and ROMs in the 'Examples' folder.

If there are more than two colors in the image, it must not contain more than about 512 different tiles. The worse the quality setting, the more the image is simplified to reduce the number of different tiles.

If there are more than four colors in the image, there will be attribute clash (though the program tries to minimize it).

Gradient Demo

Shows rapidly moving colors and text that moves in a circle (using a sine look-up table). Warning: may give you a seizure.

Text Reader

Shows text that you can scroll with up/down arrows. Press start to change color palette. Includes a PHP script that converts text files (30 kilobytes or less) into the format used by the NES program.

24 Balls

Shows 24 16*16-pixel balls that bounce off walls. The balls don't flicker because there's never more than four of them (eight sprites) per scanline. (That's because there are no more than two balls per scanline at the beginning and all balls have the same vertical velocity.) The color palette changes every 8th frame.

Static Demo

Shows static (like an analog TV tuner). Making the static random enough so that patterns can't be seen in it was more difficult than I thought. The program uses two Pattern Tables, two Name Tables, and two palettes that show either the first or the second bitplane. It also scrolls the screen.

Color Squares

Shows 16*14 squares of 12 different colors (plus black). On each frame, two adjacent squares are swapped.

KHS-NES-Paint

A simple paint program. Features: 64*48 'pixels'; four colors at a time; palette editor; two brush sizes. Source code is included.

Buttons: arrows: move cursor; A: draw using selected color; B: select a color; start: change brush size; select: enter palette editor.
Buttons in palette editor: up/down arrow: select a color to edit; left/right arrow: change hue; B/A: change brightness; select: exit.

Clock

A digital seven-segment 24-hour clock. Set the time with arrows, toggle between NTSC and PAL with A button, toggle the visibility of unlit segments with B, and press start to start the clock. I tried to make the clock more accurate than exactly 50 (PAL) or 60 (NTSC) frames per second.

Controller Ports

Shows the status of the input pins of the controller ports.

---

You may host these programs on the NESdev site if you want.
Last edited by KHS on Fri Jul 06, 2012 7:13 pm, edited 8 times in total.
hcs
Posts: 31
Joined: Mon Nov 27, 2006 11:34 pm
Location: NYC
Contact:

Post by hcs »

Nice! I had a bit of fun plugging the Hello World! demo from Wikipedia.

Biggest issue I had was input, the select+D-pad commands require an awkward shift of the thumbs, they might be better as start+D-pad (and run moved to start+Up or something).

Oh man now I gotta do Logo with the line drawing stuff I've been working on...
KHS
Posts: 6
Joined: Sun Jul 12, 2009 3:03 am
Location: Finland

Post by KHS »

hcs wrote:Nice! I had a bit of fun plugging the Hello World! demo from Wikipedia.

Biggest issue I had was input, the select+D-pad commands require an awkward shift of the thumbs, they might be better as start+D-pad (and run moved to start+Up or something).
Thanks. I have uploaded a new version. Now start+right = space, start+left = backspace, and select+start = run.
KHS
Posts: 6
Joined: Sun Jul 12, 2009 3:03 am
Location: Finland

Post by KHS »

I have uploaded a new version of KHS-NES-Brainfuck. What's new:
- When a ',' instruction is encountered, an on-screen keyboard is used to enter the character.
- Two '+' instructions or two '-' instructions can be entered in the space of a single character.
- Line feed (\n, 0x0A) is supported.
- The error message about mismatched brackets distinguishes between "'[' without ']'" and "']' without '['".
- Source code is included. (NESASM syntax, comments in Finnish.)

Edit: I have also uploaded a new version of KHS-NES-Paint. Source code is now included.
KHS
Posts: 6
Joined: Sun Jul 12, 2009 3:03 am
Location: Finland

Post by KHS »

A new program: 24 Balls. See first post.
KHS
Posts: 6
Joined: Sun Jul 12, 2009 3:03 am
Location: Finland

Post by KHS »

I have uploaded new programs and updated the old ones. See first post.
Post Reply