Coder Social home page Coder Social logo

nes-bf's Introduction

Qalle's Brainfuck

A Brainfuck interpreter for the NES.

Table of contents:

List of files

  • *.bf: long Brainfuck programs
  • assemble.sh: a Linux script that assembles the program (warning: deletes files)
  • bf.asm: source code (assembles with ASM6)
  • bf.nes.gz: the assembled program (iNES format, gzip compressed)
  • chr.bin.gz: CHR ROM data (gzip compressed)
  • chr.png: CHR ROM data as an image (can be encoded with nes_chr_encode.py in my NES utilities)
  • examples.txt: short Brainfuck programs
  • movies.tar.gz: FCEUX movie files that enter a Brainfuck program into the NES program
  • snap*.png: screenshots
  • txt2fm2.py: a Python script that converts a Brainfuck program into an FCEUX movie file that enters the Brainfuck program into the NES program

Features

  • maximum program size: 239 (8×30−1) instructions
  • maximum output size: 240 (8×30) bytes
  • Brainfuck RAM size: 1,024 bytes
  • output speed: 1 character/frame

Technical info

  • mapper: NROM
  • PRG ROM: 16 KiB
  • CHR ROM: 8 KiB
  • name table mirroring: vertical
  • compatibility: NTSC & PAL

How to use

There are two modes.

Edit mode

edit mode

  • the program starts in this mode
  • the cursor (blinking square) is always on the program input area
  • note: the Brainfuck program won't run if brackets don't match

Run mode

run mode

  • there are three submodes:
    • if the cursor is on the output area: the Brainfuck program is running
    • if the cursor is on the virtual keyboard: the user is expected to enter a character
    • if the cursor is next to the B=exit text: the Brainfuck program has finished or the maximum output size has been reached
  • press B at any time to return to edit mode

Character set

  • output behavior:
    • byte 0x0a moves the cursor to the start of the next line
    • other bytes advance the cursor by one
  • output appearance:
    • bytes 0x20 to 0x7e: as in ASCII
    • some bytes from 0x7f on contain special characters
    • other bytes are blank
  • input (virtual keyboard):
    • newline symbol (↵ at bottom right) inserts byte 0x0a
    • other symbols insert bytes 0x20 to 0x7e

References

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.