Page 1 of 4

pyNES: writing NES games in Python

Posted: Mon Nov 26, 2012 1:06 pm
by claws
Hey people... i just wanted to share this amazing project i ended up finding. It's from the same author of nodeNES...

pyNES allows you to write NES games in Python. It is a full 6502 ASM compiler, aiming to make the development of NES games easier and much more fun.
http://gutomaia.net/pyNES/

Re: pyNES: writing NES games in Python

Posted: Mon Nov 26, 2012 1:59 pm
by Nioreh
Cool!

Re: pyNES: writing NES games in Python

Posted: Mon Nov 26, 2012 2:01 pm
by Shiru
I don't really understand the description. 'It is a full 6502 ASM compiler' means that it is a 6502 assembler written in Python, or a Python compiler that produces 6502 assembly code?

Re: pyNES: writing NES games in Python

Posted: Mon Nov 26, 2012 2:03 pm
by Bregalad
This has to be a fake, right ?

Re: pyNES: writing NES games in Python

Posted: Mon Nov 26, 2012 2:11 pm
by tokumaru
So now we can code NES programs in C, and also in Python? I'm interested in seeing how advanced the programs can be, as Python is a higher level language than C, so probably more complex to compile and more demanding of hardware resources. Also, seems it's using NESASM to assemble.

Re: pyNES: writing NES games in Python

Posted: Mon Nov 26, 2012 2:14 pm
by mic_
means that it is a 6502 assembler written in Python, or a Python compiler that produces 6502 assembly code?
The latter.
This has to be a fake, right ?
I don't see why it needs to be fake, especially if it only supports a small number of simple operations.

Re: pyNES: writing NES games in Python

Posted: Mon Nov 26, 2012 2:44 pm
by zzo38
They say they have wiki but it doesn't seem to have anything on there.

Another idea could be Haskell Famicom Maker, which would be a Haskell library for making games compile into iNES binary, .NSF, UNIF, ASM, raw ROM binary, and whatever format. (DotFami HDL is like this, but for hardware instead of software.) Such thing however would not be a Haskell compiler it would be a set of mathematical operators to describe them, and functions to make them combined and optimize and whatever.

Other possibility too, such as make a BLISS compiler for 6502, or Pascal or BASIC or whatever other programming languages you want.

Re: pyNES: writing NES games in Python

Posted: Mon Nov 26, 2012 4:29 pm
by haroldo-ok
Very cool project! :mrgreen:

It seems to have a small bug on directives.py on line 34: on my Windows 7 machine, python says that 'rw' is an invalid mode. Changing that to 'r+' fixed the problem for me.

Re: pyNES: writing NES games in Python

Posted: Mon Nov 26, 2012 5:06 pm
by rainwarrior
Good work! I hope this leads to some interesting homebrews.

Re: pyNES: writing NES games in Python

Posted: Mon Nov 26, 2012 5:45 pm
by cpow
rainwarrior wrote:Good work! I hope this leads to some interesting homebrews.
I'm still waiting for the definitive Brainf*ck game! :shock:

Re: pyNES: writing NES games in Python

Posted: Mon Nov 26, 2012 8:41 pm
by zzo38
cpow wrote:
rainwarrior wrote:Good work! I hope this leads to some interesting homebrews.
I'm still waiting for the definitive Brainf*ck game! :shock:
There is a computer game (called "Taking Over The World") written entirely in brainfuck actually. If it can be optimized and using ASCII set, together with a Famicom keyboard decoder into ASCII, then it might run on NES/Famicom too, but maybe slower, even if optimization is performed.

Re: pyNES: writing NES games in Python

Posted: Mon Nov 26, 2012 9:47 pm
by infiniteneslives
cpow wrote:I'm still waiting for the definitive Brainf*ck game! :shock:
Hasn't someone on here already done that?

Re: pyNES: writing NES games in Python

Posted: Mon Nov 26, 2012 10:59 pm
by tokumaru
infiniteneslives wrote:Hasn't someone on here already done that?
That's the point: the interpreter is there, we're just waiting for an awesome game that runs in it.

Re: pyNES: writing NES games in Python

Posted: Tue Nov 27, 2012 1:53 pm
by vicious
Very interesting project. Also on HN: http://news.ycombinator.com/item?id=4833860

Re: pyNES: writing NES games in Python

Posted: Wed Nov 28, 2012 4:23 pm
by strat
Has anyone tried using it yet? I checked __init__ for command line info and it still doesn't output anything.

python mario.py -a asmfile.asm

In any case, I hope there's a way to insert asm into the python code (Not too clear on that, looks like you just have to read the compiler code to figure anything out), otherwise this won't be as exciting as it should be.