• Stars
    star
    1,210
  • Rank 38,721 (Top 0.8 %)
  • Language
    Python
  • License
    BSD 3-Clause "New...
  • Created over 12 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Python programming for Nintendo 8 bits

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

More Repositories

1

nodeNES

A 6502 Nintendo 8 bit compiler written in Javascript
JavaScript
145
star
2

inventwithpython

Book Invent With Python
Python
23
star
3

nesasm_py

NES Assembly Compiler in Python
Python
11
star
4

fast_queue

Simple Task Producer
Python
6
star
5

github-issue

Jenkins Github Issue Plugin
Java
5
star
6

NES_bankswitch_example

Databank switch example
Assembly
5
star
7

garoa-chrome

GaroaHC Chrome Extension
JavaScript
5
star
8

hellow_php

php msn lib: More than a Hello World!
PHP
5
star
9

neshack

Lua Scripts for FCEux
Lua
3
star
10

pyramid-oauthlib-demo

pyramid-oauthlib-demo
Python
2
star
11

gutomaia.github.com

GutoMaia's GitHub
HTML
2
star
12

hellow_java

java msn lib: More than a Hello World!
Java
2
star
13

jenkins_installer

Jenkins Installer for my server
Shell
2
star
14

pyNES_Standard_Library

pyNES Standard Library
Python
2
star
15

steamer-java

A Steam Comunity project form scratch
Java
2
star
16

hellow_js

javascript msn lib: More than a Hello World!
JavaScript
2
star
17

lexical_py

Simple Lexical Analyser
Python
2
star
18

hellow_arduino

hellow_arduino
C
1
star
19

hellow_as

actionscript msn lib: More than a Hello World!
ActionScript
1
star
20

steamer-js

A Steam Comunity project form scratch
JavaScript
1
star
21

pythonnordeste2014_nes

NES Cartridge for PythonNordeste2014
Assembly
1
star
22

hellow

1
star
23

hi_firefox

A XUL Msn Client for Firefox.
JavaScript
1
star
24

tictactoe

TicTacToe game
PHP
1
star
25

sourceloader

An example of a dynamic classloader that compiles and loads sourcefiles
Java
1
star
26

guruha

GURPS Rules Hacks
Java
1
star
27

trollcat_web_old

Trollcat Is Troll!
PHP
1
star
28

gameproto

A game prototype using pygames
Python
1
star
29

makery

Hot Makefiles daily updates as a bakery
Makefile
1
star
30

SNESpad

Arduino SNES pad
Makefile
1
star
31

tv_remote

LG tv remote script
Python
1
star
32

dojo_to

dojo_to
Python
1
star
33

TestPortletContainer

Portlets for container test
Java
1
star
34

steamer-php

A Steam Comunity project form scratch
PHP
1
star
35

eventex

Welcome to Django project
Python
1
star
36

steam-condenser-java

A java library for querying the Steam Community, Source, GoldSrc servers and Steam master servers
Java
1
star
37

steam-condenser-ruby

A ruby library for querying the Steam Community, Source, GoldSrc servers and Steam master servers
Ruby
1
star
38

hellow_cpp

c++ msn lib: More than a Hello World!
C
1
star
39

hellow_py

python msn lib: More than a Hello World!
Python
1
star
40

ASMminator

Learn 6502 ASM
Python
1
star
41

set_destiny_web

set_destiny_web
Python
1
star
42

lgudap

LG UDAP Protocol
Python
1
star
43

sentinel

Sentinel will help you find and track mutants!
Python
1
star
44

steamer-py

A Steam Comunity project form scratch
Python
1
star