Hacker News new | past | comments | ask | show | jobs | submit login
PyNES: Write NES Games in Python (gutomaia.net)
233 points by m_eiman on Sept 18, 2015 | hide | past | favorite | 39 comments



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


If it does pronounce that way in your language, it was just coincidence. By the way, NESticle was a great emulator back then. Wroted in assembly and used to run flawless on my 486!


Do you pronounce Py as 'pee'? If so that's interesting. Py is pronounced 'pie' in my head and when I occasionally say it aloud.


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.


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


I doubt it, lots of python projects stick 'Py' on the front. PyGame, Pyglet, PyQT, etc.


yes, and "Pyglet" shows that the Py preface does not always follow the hard Y sound of Python.

so we can get pretty close, we might be able to pronounce it "pinnis".


Yeah, you can pronounce it that way if you want, and you could say "pie-glet," too--it doesn't mean it was a 'deliberate attempt.'


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


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.)


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.


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.


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... It is pretty simple but you will need some about how NES works.


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


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.


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.


Sometimes it's called code generation but I don't know if there's one official term for it.


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


Indeed, albeit at compile time and not run time.


There's also javagrinder 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.


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


What is absurd about it?


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.


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.


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.


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?


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.


I haven't looked over the project extensively but I'm thinking it may bridge the gap for programmers or newcomers who are not familiar with assembly. You could of course just program a modern game in Python but then you're probably looking at a tech stack. I think this type of game design could be a great starting point as all you need exists in the given environment. I've recently been mulling the idea of an NES programming environment in the browser.


To me the most fun thing about this project is that it looks like a terrific tool for learning and understanding how to write (this particular) assembly language.


You could argue that you want to play your games on this

http://www.analogueinteractive.com/products/analogue-nt-info...


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?


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/)

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


I used PyGame ten years ago. Was fun back then.


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


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.


Obligatory Ruby cousin https://github.com/remore/burn


Awesome, does it work in shedskin ?

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


It's so nice project!!


wish I could do this for the original Sony Playstation 1




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: