
PyNES: Write NES Games in Python - m_eiman
http://gutomaia.net/pyNES/
======
shrikant
Is the name a deliberate attempt to sound like "penis"? I'm asking because it
reminds me of the first NES emulator I ever used, which went by the name of
NESticle!

[https://en.wikipedia.org/wiki/NESticle](https://en.wikipedia.org/wiki/NESticle)

~~~
ConnorG
The name of that emulator coinciding with the word testicle was on purpose
right?

I'm just glad I wasn't the only one who thought this back then.

~~~
cobralibre
A Google Images search for "nesticle icon" should clear up any doubt.

------
trymas
[https://github.com/gutomaia/pyNES/wiki](https://github.com/gutomaia/pyNES/wiki)

Non existant docs.

IMHO one of the first steps of starting a project is to write a README.

Though, at least there are few examples:
[https://github.com/gutomaia/pyNES/tree/0.1.x/pynes/examples](https://github.com/gutomaia/pyNES/tree/0.1.x/pynes/examples)

~~~
PostOnce
Yes, lamentable, but we all know the fun part is writing the code, not the
docs, and obviously this was a for-fun project.

Maybe someone else can document it if the creator doesn't have time.

At any rate, I'm happy it exists, getting a toy game running on actual
hardware will be hilariously fun for me, if it works. I don't mind using the
code as the documentation for something this obscure if docs aren't available.
Better than having to spend time learning 6502 assembly just for screwing
around with NES games (or NES demoscene, hmm... it's probably cheating but
it'll be fun.)

~~~
gutomaia
Thanks. Sorry for the lack of documentation. The first version (Branch 0.1.x)
was more focused as a proof of concept. Despite the examples, after some time
I found several limitations. That lead to a branch (kill_the_baby), witch i've
restarted the project. Well, lack of documentation first started due the
constant changes over the time. pyNES 0.2.x will have a more mature API and a
DOC.

------
bhz
I was hoping this was an update to this project; bugfixes, or more examples,
or docs. Very cool that this exists though.

@emodendroket "Isn't the fun of writing NES software basically doing it like
guys would have done in the 80s?" \- I did stuff in the 80s, there was nothing
fun about having to leave comments out of your code for the lack of memory, or
using a clumsy compiler and/or editor. Cross-compiling is the way to go! Just
making these old systems do things is the point, and keeping them alive.

------
shultays
I semicompleted a game in NES in C, and even I was hitting walls constantly
when it comes program size or performance. I have my doubts for python.

Here is the library I used.
[http://shiru.untergrund.net/articles/programming_nes_games_i...](http://shiru.untergrund.net/articles/programming_nes_games_in_c.htm)
It is pretty simple but you will need some about how NES works.

~~~
bbayer
I think it uses Python as frontend and compiles 6502 assembler from the code.
Generated assembly can be easily edited to overcome problems.

~~~
gered
It could be edited yes, but I'd assume once you change some Python code and
recompile you'd lose your assembly tweaks. Not the end of the world I guess,
but annoying if you're really trying to tweak things for maximum performance.
All part of the trade off when using a high-level language for an extremely
resource limited system such as the NES I suppose.

------
Keyframe
I forgot what is the name of using one language like that to emit other (DSL
like). For example writing Lisp (or Python) to actually write C programs or
asm. I think GOAL was used like that? Any resources (existing projects) about
that? I'm not talking about 'compiling' from one language to another where you
get to handle the baggage of the originating language as well through extra
code, but more like fancy macro text processing.

~~~
aghillo
Are you thinking of (a version of) Metaprogramming? As opposed to Transpiling.

~~~
Keyframe
Indeed, albeit at compile time and not run time.

------
aninteger
There's also javagrinder
[https://www.mikekohn.net/micro/java_grinder.php](https://www.mikekohn.net/micro/java_grinder.php)
which can run some java code on the TI-99/4a, C64, and Sega Genesis by
translation of java class files to equivalent platform machine code.

------
m_eiman
I think is an amazingly absurd project, in a good way :)

~~~
ionforce
What is absurd about it?

~~~
monitron
Well, to start with, it targets a long-dead platform. It also skips multiple
steps, allowing a system that was always programmed in an extremely low level
language (assembler) to be programmed in one of the highest-level languages in
common use (Python).

For the record I love the idea.

~~~
chongli
Python may be high level in terms of relative distance to the hardware but
it's not particularly high level in terms of the abstractions available. If
you watch the video on the site linked you'll see that the programming style
is not all that different from what you'd see if you were programming the NES
in C.

~~~
gluelogic
The idea of programming the NES in C is still a little out there. People have
made plenty of efforts in that area but it never seems to "stick."

Seems to me like it makes the most sense to just go with 6502 if one is
serious about fooling around with the NES.

------
emodendroket
Isn't the fun of writing NES software basically doing it like guys would have
done in the 80s? If you want to do something modern why even target a platform
that hasn't been manufactured for decades?

~~~
gdulli
Getting stuff working in a low-level environment is one kind of fun and
working in a high-level language where you only have to think about the logic
is another kind of fun. Every programmer should get to experience both kinds
of fun in their career. And they can decide which one they like better and
want to focus on.

------
DarkTree
I would love this so much if I could figure it out. I'm a javascript
programmer, but haven't done much with Python. I'd like to write a small,
arcade-style game with python though. Does anyone know anything else like
this? Is PyGame fun to work with?

~~~
gluelogic
Pygame is very fun to work with and it's so easy. I stopped using it for game
development (switched to web-based HTML5 stuff) but it is still an amazing
wrapper over SDL. I recently used it to write a quick version of an image
evolver. (an example of what I'm talking about:
[http://alteredqualia.com/visualization/evolve/](http://alteredqualia.com/visualization/evolve/))

If I ever want to bust out a quick graphical/audio application I use Pygame.

------
acidx
The presentation gutomaia did on PyNES at PythonBrasil had a slide deck
written using this tool.

------
carlesfe
Thanks! I've always wanted to write a NES game and I guess it's easier to
begin once you have some code written. This is a nice first step for
beginners.

------
pjonesdotca
Obligatory Ruby cousin
[https://github.com/remore/burn](https://github.com/remore/burn)

------
stuaxo
Awesome, does it work in shedskin ?

I remember them using a C64 emulator as one of the examples.

------
salexkidd
It's so nice project!!

------
curiousjorge
wish I could do this for the original Sony Playstation 1

