Coder Social home page Coder Social logo

iq-scm / pynes Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gutomaia/pynes

0.0 0.0 0.0 652 KB

Python programming for Nintendo 8 bits

License: BSD 3-Clause "New" or "Revised" License

Python 79.70% Assembly 18.49% Makefile 1.62% NSIS 0.18%

pynes's Introduction

pyNES

Join the chat at https://gitter.im/gutomaia/pyNES

The Legend

There was a time when game cartridges were forged in the fire of mount doom itself. That great power was then trapped into a regular plastic shelf. Most of the secrets were sealed by fellowship of hardcore game programmers. Their names were concealed in end-game credits from games that were never supposed to be finished. Countless game lives were wasted in the first level, in fruitless attempts of unveiling their evil[1] spell.

That was what my curious and inventive mind believed for years, and still do so. As a kid, I used to play those games and always asked myself how they were done. I really wanted to experience some of the game design problems the pioneers once faced. Back then, they had to wage their own tools, hack the specs for game effects and layout the memory mapper circuits. I figured out, to reach mount doom as equal, first, I had to forge my own hammer. I've decided trail their footmarks therefore I built PyNES: A Python ASM compiler for Nintendo 8 bits.

However as I strum steps progresses, the anvil didn't sound the same. Knowledge weight has changed. Internet made it all available and communities are helpful. Also, computer power had grown and programming languages evolved. I must go a further in each step of their challenges. PyNES is turning into a high-level compiler which will allow Nintendo games to be written mostly in Python. This lecture will explain the several hacks and drawbacks of such approach. And I must say, trying to compile a such evolved language to a such limited processor as the c6502 it's MADNESS. It's pyNES!

The Untold Story

pyNES <http://gutomaia.net/pyNES> started as a regular 6502 assembler. However, writing games in ASM wasn't fun enough. Thus, using some AST hacks I tried to figure out a way of translating Python code into ASM.

Release notes

  • pyNES versions 0.1.x is released as a Proof of concept.

Installation

Clone this repo into your computer, then:

cd pyNES
sudo python setup.py install

Examples

Inside pynes/examples you'll find a set of examples. Compile them with:

pynes py pynes/examples/helloworld.py -o helloworld.nes

Now you can open helloworld.nes

[1] Read "That's not all" at the end

That's not all folks

** pyNES 0.1.x **

Despite all my efforts, the pyNES version 0.1.x had several limitations as it should as a proof of concept.

Tricky limitations:
  • Sprite collision
  • Scrolling Screen
  • Sprite animation
  • Better joystick support
  • Hard to extend

Being Hard to extend

** pyNES 0.2.x **

Therefore, pyNES version 0.2.x must overcome those limitations. And so far it is going great.

Project has been split into 4 projects:
  • lexical - just the lexical analyzer
  • nesasm_py - a 6502 ASM compiler based on NESASM
  • pyNES - This project, wich must restrict it's responsibility just to
  • pyNES_StdLib - Standard Library.
Mantras:
  • No more templating.
  • Less gaps between what you are writing and what the compiler is doing.
  • Easier to extend

Hi Level Functions are not templated anymore. However, th

Example of waitvblank function:

@asm_function
def waitvblank():
    BIT('$2002')
    BPL(waitvblank)
    RTS()

That must be translated to:

waitvblank:
BIT $2002
BPL waitvblank
RTS

pynes's People

Contributors

danilobellini avatar dependabot[bot] avatar ellisonleao avatar gabriel-ozeas avatar gitter-badger avatar gutomaia avatar kirkins avatar popmilo avatar rahulunair avatar

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.