This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

pyNES: writing NES games in Python

pyNES: writing NES games in Python
by on (#103513)
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
by on (#103514)
Cool!
Re: pyNES: writing NES games in Python
by on (#103515)
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
by on (#103516)
This has to be a fake, right ?
Re: pyNES: writing NES games in Python
by on (#103517)
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
by on (#103518)
Quote:
means that it is a 6502 assembler written in Python, or a Python compiler that produces 6502 assembly code?

The latter.

Quote:
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
by on (#103519)
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
by on (#103521)
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
by on (#103524)
Good work! I hope this leads to some interesting homebrews.
Re: pyNES: writing NES games in Python
by on (#103525)
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
by on (#103534)
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
by on (#103535)
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
by on (#103539)
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
by on (#103552)
Very interesting project. Also on HN: http://news.ycombinator.com/item?id=4833860
Re: pyNES: writing NES games in Python
by on (#103655)
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.
Re: pyNES: writing NES games in Python
by on (#103692)
Nice idea. Needs instructions. The requirements are two words: pil mock

No idea what that means.

I'd assume install some version of python then some version of pil then this mock thing..
Re: pyNES: writing NES games in Python
by on (#103694)
It's a nice experiment, but seems very limited, "specialized" and kind of gimmicky. But it should be a nice way for newbies to get started.
Re: pyNES: writing NES games in Python
by on (#103695)
Reminds me a lot of batari basic. It would be pretty limited without a lot of work, but yes maybe good for newbs to get interested.
Re: pyNES: writing NES games in Python
by on (#103698)
How come tepples isn't all over this thing? He's one of the biggest Python fans I know, I thought he would be interested in finding out what this compiler is capable of.
Re: pyNES: writing NES games in Python
by on (#103705)
tokumaru wrote:
How come tepples isn't all over this thing?

Honestly? The blank docs page.
Re: pyNES: writing NES games in Python
by on (#103706)
tepples wrote:
Honestly? The blank docs page.

Same here. Even though I'm not crazy about Python (and I doubt this tool is powerful enough to make something meaningful), I was mildly interested in this project, until I saw the blank docs page.
Re: pyNES: writing NES games in Python
by on (#103717)
Got it to work. He clearly expected everyone to read the Python code to figure out how his creation works (He said it himself, "the documentation is in another castle!").

This is what I had to do just to not get Python to bark an error:

-Install Python 2.7
-Install something called setuptools
http://pypi.python.org/pypi/setuptools
-Run setup.py install in the Pynes folder

And there was no command line problem at all. Here is what you have to do. Open one of the example programs. See that call to 'pynes.press_start()'? Place a 'True' in the call. Now it will output asm. Hardy har har.
Re: pyNES: writing NES games in Python
by on (#103726)
Thanks for the first steps strat! However, when I run setup.py it gives me this:

Code:
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>>

Traceback (most recent call last):
  File "C:\pyNES-master\setup.py", line 22, in <module>
    url = 'http://github.com/gutomaia/pyNES/',
  File "C:\Python27\lib\distutils\core.py", line 140, in setup
    raise SystemExit, gen_usage(dist.script_name) + "\nerror: %s" % msg
SystemExit: usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: no commands supplied
>>>


Is setup.py actually the compiler for the examples?
Re: pyNES: writing NES games in Python
by on (#103740)
I started something similar in ruby a few years ago. This appears to be a templating library that outputs asm or you could think of it as a meta-programming library that outputs a NES program instead of a python program. Tools like these are useful because among other things they reduce copy and paste of code fragments and can make code more succinct and readable.

When I was @ Intel working on their internal automated build system, they had ugly and huge (epic) build scripts written in XML. Every version of a driver had pages and pages of XML describing the build--it made your eyeballs bleed. The worse part was that each build script was about 98% similar to the rest so there was tons of duplication. And they were editing this stuff by hand! So I wrote a ruby library that could slurp up xml and produce ruby code and a DSL that emitted valid XML build scripts (the templating part like pyNES). This reduced code verbage by probably 75%. Some coworkers loved it and used it, others smiled and stuck with raw xml in notepad.

Moral of the story..........I forgot.
Re: pyNES: writing NES games in Python
by on (#103743)
dullahan wrote:
I started something similar in ruby a few years ago. This appears to be a templating library that outputs asm or you could think of it as a meta-programming library that outputs a NES program instead of a python program. Tools like these are useful because among other things they reduce copy and paste of code fragments and can make code more succinct and readable.

When I was @ Intel working on their internal automated build system, they had ugly and huge (epic) build scripts written in XML. Every version of a driver had pages and pages of XML describing the build--it made your eyeballs bleed. The worse part was that each build script was about 98% similar to the rest so there was tons of duplication. And they were editing this stuff by hand! So I wrote a ruby library that could slurp up xml and produce ruby code and a DSL that emitted valid XML build scripts (the templating part like pyNES). This reduced code verbage by probably 75%. Some coworkers loved it and used it, others smiled and stuck with raw xml in notepad.

Moral of the story..........I forgot.


Moral is that you're right. This is how every successful high level language tackles low resource hardware. batari BASIC, BasiEgaXorz, ZX Basic for SMS etc..
Re: pyNES: writing NES games in Python
by on (#103752)
You forgot to supply the install command.

python setup.py install

This is standard for installing Python packages; it just sends the Pynes stuff to the installed Python directory so an 'import' statement will find the code.

P.S. Now that I think about it, he may have had a brainfart coding the "press_start" routine and put False as the default args when he meant to put True. So you can find that in the __init__ file and change that as well.
Re: pyNES: writing NES games in Python
by on (#103757)
Thanks for the followup strat. Your advice worked to a tee!

Umn, I got mario.py to spit out a mario.py.asm but how does one compile THAT? I feel that after figuring out how to compile the .asm output file the only mystery is manually exploring his functions.
Re: pyNES: writing NES games in Python
by on (#103766)
The ASM syntax appears to be NESASM. Try putting NESASM in the same folder and making a .bat file with "nesasm whatever.asm" in it, and then double click it.
Re: pyNES: writing NES games in Python
by on (#103791)
NESASM3 seems to emit mario.fns files when I make a batch file with "NESASM3.EXE MARIO.ASM"

I put both the NESASM3.EXE and the mario.chr files in the same directory. Same result. Compiled a PONG1.ASM example from nespowerpak.com without issue.

Y'all know I have zero assembly skills but evidence points to not just no documentation but straight up broke. No offence to Guto Maia as I truly hope this project matures!
Re: pyNES: writing NES games in Python
by on (#103807)
FNS is just labels and such, while it should also make a .NES ROM file too. Add PAUSE to the line after those 2 commands and it'll tell you how any errors the file has.
Re: pyNES: writing NES games in Python
by on (#104032)
Hi guys, sorry for the delay. I'm the author of the project.

First, I really would like to thanks for sharing.

Second, No it's not fake. pyNES is meant to be a python compiler for NES. However it is being built in a different way.

Usually compilers are formal. Take the "C" compiler for example, it evolves along with the processor in their time. The number of instructions and the optimizations where really tight couple with the processor instructions of their launch. As the language, "C" programmers also evolved. Changing the static linking for dynamic link as more memory became available. That leads to GRASP patterns and then OOP and C++. 'Course, even C and C++ have stopped as a language it self, however the compiler didn't stop. Nowadays processors have multicore specific instructions and of course compilers must deal with those optimizations using some kind of pattern matching. That leads as to Virtual machines like JVM, .NET, pypy. Witch can deal of optimizations in layers using hotspot.

Therefore, why not use pattern matching for transitions from a highlevel language to a limited processor?

NES developers knows how developing for a such limited machine differs from actual highlevel programming. Most of the logic is decoded into the most simplest instructions. Complex structure types are hacked into address and ways of reading it.

At first pyNES was just an ASM compiler compatible with nesasm. However after nodeNES (a javascript IDE, not finish also). I need to go further with pyNES. Then, Klaus Silveira, a friend cames if a challenge to write nes games in python. Okay, at the start he was just kidding, but after some rounds in street fighter (witch Zangief beats him pile dive after pile diver), we imagine that it was possible.

Okay

That was the intention was the aim of pyNES. Write NES games in Python. However, I need to add some constrains. And there goes:

1) The approach:

- It's not a formal compiler. Structures are not pre-defined. Same goes for types
- TDD drives the format, at the end, the software will emerge.
- I must keep the hack felling! It must feels like a hack.

2) The Values:
- I must respect python, although it's not a full python compiler and it will only use a subset of python. That subset must be respected.
- I must respect NES developers. When I started my NES ASM research, I saw how clever and fantastic was developing for NES. The referenced python code must generate an ASM code that a NES developer would write. A code that could be found here.

3) The Goals:
The main goal is to build 3 NES games entire in python:
- A Sidescroller Plataform
- A TopDown Shooter
- A RPG

Okay, so much for the compiler introduction and for the project goals. Let me explain in the bits:

How to map the types?

For example, how to map an Int?
- if it is used but not assined the value could be directed assigned in the asm, like in a local scope
- If it is used and assigned but not changed, it could be a const.
- If it is assigned and changed it must be used as an .RS

And for a more complex type, like a List? I have to put some extra constrains here
- List cannot be changed after used by a bitpak.
- Lists can have constants or int, cannot have objects or strings
- Lists are a dataset of sequencial address in the bank 1

And a String? more constraints here, cause String works like a list.
- String cannot be changed after used by a bitpak.
- String are mapped by a String that defines the charset and also end String char. So it can use the assets on the CHR

What the hell are those bitpak?
- Highlevel languages dosent provide much of label instructions. Therefore there is no GOTO. Instructions like a WAITVBLANK, would be very strange.The correct would be a While loop, but that is not what happen at hardware level. So I created a way to gather a bunch of asm instructions in a single function.

How FOR would be made? In python, for usually uses dynamic loops with a list. Like "for a in [1,2,3,4]:"
- I told, i must respect python, so loops must keep that way, but nes dosent have ways to store that dynamic part. And that must be hacked.
- if the for is in a sequential series of arguments, it must be just use a comparison with the last value.
- if the for is in a list that is stored in the cart, like a String or List
- If the list is not stored and the cart has space, so why not store it :D.

Well, I'm still refactoring most of the hacks right now and starting the docs. Klaus Silveira help me out with the site. Gabriel Ozeas help me with some erros on travis CI. Docs are coming, more examples also.

Right now: THE DOCUMENTATION IS IN ANOTHER CASTLE!

There are more features related with image and direct conversion to the chr and nametables.

Anyone can contribute with the project. If you dont know how, just ask me. If you have a ASM example that does compile with NESASM, just send me. I will add it as a project fixture.

PS: if some guys could really help me with some ASM questions and specific nes stuff.
Re: pyNES: writing NES games in Python
by on (#104048)
Thanks for your work gutomaia! This sounds like a VERY exciting project.

The only way I can help is by being a very "beginner" user of pyNES. If you've read this topic you can see I already have problems compiling mario.py

We are just guessing the correct way to install pyNES right now. I hope installation instructions are the first documentation to emerge from the castle :)

Also, what should I know before using pyNES for the first time? Any good Python tutorials you would recommend?
Re: pyNES: writing NES games in Python
by on (#116172)
Wait... That's a sign!

If the NES could have one, other systems can!

The Atari, SNES, Playstation, Dreamcast, even N64!!!!!

:D The possibilities are just endless!!! :D

...Anyways, this is super cool!
Re: pyNES: writing NES games in Python
by on (#116177)
The last commit he made was from June 24, 2013 so it may not be dead. That said, the author hasn't posted here in quite awhile. No one really figured out how to install and get this working correctly either.
Re: pyNES: writing NES games in Python
by on (#116186)
I think some of us actually did; it's just not very interesting because it's all wrappers for pre-existing asm functions, not something that compiles python into asm code.
Re: pyNES: writing NES games in Python
by on (#119678)
I wish author would man up and write docs for its tool. I've started deciphering it and writing any findings to text file (mainly trial & error), but I've just learned about it few hours ago so I don't have much (i.e. none). Also bundled examples are uncompilable, because mario.chr file is missing from package (and also github repo).

Replaced it with some random chr (ripped from Super Mario Bros rom), but obviously it doesn't have proper graphics which makes further reverse-engineering difficult.

I'll try to do more research later and when I'm done documenting it, I'll distribute version with all fixes discussed earlier in this thread and proper installations instructions.

Note that aside of patching few things up and documenting stuff I'm in no position to actually maintain this as I don't know much about NES assembly (one of reasons I've seek tool like this) nor would be able to do compiler/assembler. So after I'm done someone with actual knowledge of python, writing custom compilers and NES assembly would need to take over.

I'm attaching file from my experiments (compiled version of mario.py with garbled graphics due to wrong CHR file which wasn't supplied by author). Can someone with access to flashcarts or things like that confirm if it run on real hardware?
Re: pyNES: writing NES games in Python
by on (#119698)
OK, I've found out that "heart" of this thing (i.e. commands you'll be putting when making your own game) is in pynes/bitbag.py. I'll start deciphering it now and will post any findings.
Re: pyNES: writing NES games in Python
by on (#119702)
Here is first rudimentary version of docs:
Attachment:
docs.txt [2.6 KiB]
Downloaded 126 times


Sadly, pyNES lacks any kind of sound-handling functions. Maybe someone with python and NES asm knowledge could write some functions that could load NSFs made with FamiTracker and play specific songs with ability of mixing some samples in? I'm unfortunately not up for the task.
Re: pyNES: writing NES games in Python
by on (#119715)
How to add own procedures/functions

OK, so I've figured out how code templates work in bitbag.py. It may be use for someone knowledgeable with NES assembly so we can make it somekind of forum project (so less knowledgeable people who would want to make NES games would be able to do so).

Each "function" you can use in your pyNES game is defined in bitbag.py as class. Example of one such class:

Code:
class define_sprite(BitPak):

    def __init__(self, game):
        BitPak.__init__(self, game)

    def __call__(self, x, y, tile, attrib=0x80):
        assert isinstance(x, int)
        assert isinstance(y, int)
        assert isinstance(tile, int) or isinstance(tile, NesArray)
        return NesSprite(x, y, tile, attrib)


It is definition for define_sprite(). __init__(self,game) is used for initialization of procedure. BitPak.__init__(self,game) is always present so it is important. There can be another initializations, like here (__init__ from load_sprite() function):

Code:
def __init__(self, game):
        BitPak.__init__(self, game)
        self.game.has_nmi = True  # TODO remove this
        self.game.ppu.sprite_enable = True
        self.game.ppu.nmi_enable = True


Now, I don't know yet how those interactions here exactly work, but in time I or someone else can figure it out. Though it seems name are self-explanatory.

Let's get back to our define_sprite class, shall we?
Code:
class define_sprite(BitPak):

    def __init__(self, game):
        BitPak.__init__(self, game)

    def __call__(self, x, y, tile, attrib=0x80):
        assert isinstance(x, int)
        assert isinstance(y, int)
        assert isinstance(tile, int) or isinstance(tile, NesArray)
        return NesSprite(x, y, tile, attrib)

__call__ is executed when you call function. 'self' always seems to need to be present, but isn't part of call when you write game. You can define any number of parameters afterwards or don't define at all, as it is case for e.g. wait_vblank, which __call__ is defined as __call__(self).

There are also two optional functions you can define in class, "asm(self)" and "procedure(self)". This is actually meat of code, it is what makes code execute in game as it is part of asm generation. You just write your function in assembly here so you will not have to write it again each time and instead use easy Python syntax for game ;).

asm(self) seems to be for pre-call initialization and jump to your procedure, while procedure(self) contains your code along with label, though it is probably just nomenclature and you could just dump your code in either.

Also bonus, here is (probably working, didn't test it) definition for function that will run custom ASM

Code:
class run_assembly(BitPak)
    def __init__(self, game):
        BitPak.__init__(self, game)
    def __call__(self,assembly):
       self.asm = assembly
    def asm(self)
       return self.asm


Note that assembly code should be written as in bitbag.py asm/procedure functions, i.e. no .org/etc directives, only pure opcodes delimited by new line (\n) character, with two spaces before actual opcode (though last one may be just for formatting sake and may not have influence over compiling it).
Re: pyNES: writing NES games in Python
by on (#119716)
darkhog wrote:
Maybe someone with python and NES asm knowledge could write some functions that could load NSFs made with FamiTracker and play specific songs with ability of mixing some samples in? I'm unfortunately not up for the task.

It does not really works this way, with loading and mixing NSFs. NSF format is not designed to share system resources with a program, i.e. a program has to work around whatever NSFs requires (could be anything), in terms of memory allocation etc. FamiTracker player is not designed to be used in games, it does not care about memory (RAM/ROM) and CPU time consumption too much, and does not have working sound effects support. Samples could not be 'mixed in' on the NES. So if you want to go easy way with music authoring, you pay for it with high resource use and necessity to write extra code for sound effects support. Alternative is to use one of existing sound engines that were created by various people exactly to be used in games, i.e. they trying to save resources and allow to play sound effects. However, they usually less easy in the authoring part, although FamiTracker is still an (existing or implementable) option as an authoring tool, just with limited subset of its features supported.
Re: pyNES: writing NES games in Python
by on (#119717)
Quote:
Samples could not be 'mixed in' on the NES


So why game like Mario, Megaman, etc. doesn't stop music when sound (jump, shoot, etc.) is played and play both simultaneously?

Anyway, I can live with using small subset of Famitracker's functionality (most of I can live without) and I've seen homebrew games with music made in FT so it is possible to make it work.

Also, Famitracker can export to BIN (raw music data) which can be then "interpreted" by pyNES compiler and incorporated in its own driver (when it will have one) or ASM source - from under File->Create a NSF... window, so it is not completely impossible to use it.
Re: pyNES: writing NES games in Python
by on (#119718)
It is not 'sample mixing', as there are no samples (waveform recordings) for sound effects in most NES games. Sound effects on NES is kind of a sub songs, sometimes interpreted by song player as one of channels, sometimes by its own separate player, in any case, using one of ways of channel replacement rather than actual mixing (addition).

If you look closer, homebrew games that has music played by actual FamiTracker player does not have sound effects. To play the BIN data that FamiTracker exports, you would need to use FamiTracker player, or create a substitute. If you want to just use FamiTracker as front end for your own player/format, a much easier and better way is to use text export (built-in in latest versions). That's how games that has music created in FamiTracker and sound effects usually works.
Re: pyNES: writing NES games in Python
by on (#119719)
The closest you get to a "mixer" in NES audio is a channel priority system. My sound player chooses which pulse channel ($4000 or $4004) to play an effect on based on which has less time left in the effect already playing. On each channel, it runs a musical instrument and a sound effect in parallel and chooses which to play on the PSG based on whatever is louder at the moment, allowing a loud note attack to overpower the tail end of a sound effect. And it treats drums as pairs of sound effects, allowing triangle kick to interrupt a bass line in a sane way.
Re: pyNES: writing NES games in Python
by on (#119720)
Cool, so anyone with good knowledge of both Python and NES assembly (I have only former, that's why I was able to do these docs, however rudimentary they may seem) would be able to do sound driver for pyNES along with some functions that would make possible to play melodies/sound effects based on what I've discovered about inner workings of pyNES?
Re: pyNES: writing NES games in Python
by on (#119727)
I've tweeted gutomaia about the subject. Seems alive, last tweet is from Sept 28th. Maybe he'll help fix up docs (they aren't in good state with many things I've just assumed and few things I had no idea what they do (and still don't). Also sent him a PM.

Well, I hope he'll be able to put some more details in the docs now most of it is written and fix invalid assumptions on my part.
Re: pyNES: writing NES games in Python
by on (#119733)
I appreciate the effort darkhog. I hope gutomaia realizes he has eager eyes on his project!
Re: pyNES: writing NES games in Python
by on (#119734)
Thanks, I hope too!
Re: pyNES: writing NES games in Python
by on (#119735)
A question in case Gutomaia decide to respond to this thread:

How nametables are handled here and how can I import nametable made in NES screen tool to my game? I need it for title screen, instructions and such.
Re: pyNES: writing NES games in Python
by on (#119891)
Hi guys,


Sorry for the huge delay. I got some problems. But now I'm putting this project back on it's track.

The project it self lacks not only documentation. But that are several features that are broken. And has some architectural problems.

Also I need a way to help people download and use pyNES.

So, tomorow I you find a very suitable windows executable.

I will keep this thread updated.

Thanks darkhog for document the project. I want to use that as the first oficial documentation. I will take a good look, and add it to github. Darkhog? do you have an github account?

thanks
Re: pyNES: writing NES games in Python
by on (#119892)
Yup, name same as here.
Re: pyNES: writing NES games in Python
by on (#119895)
As for what I want to achieve with pyNES, my ultimate goal is to port platformer I've made using Stencyl a while ago to actual NES rom (I already have chr with all sprites used there tucked away). It is already made with NES' limits (music was done in FamiTracker so I have ftm files) in mind so it probably will be easy to port once I'll know what I'm doing (and will take off every zig ;) ). But before that I'll need to learn many things and pynes will need to be developed further.
Re: pyNES: writing NES games in Python
by on (#120560)
Any news on the project?
Re: pyNES: writing NES games in Python
by on (#120565)
PyNES isn't going to be able to allow you to port an existing PyGame project to the NES. PyNES is a set of Python functions like read_controller() and move_sprite() that generate NES code to implement the named function. Think of it as a templating language for a NES game.
Re: pyNES: writing NES games in Python
by on (#120567)
I know that. And pyGame is bonkers on API side anyway.

I don't think anyone in the right mind would try to get straight pyGame port to nes with pyNES. I'm going to make original projects with it.

//edit: And if you are referring to my earlier post, by "port" I meant "rewrite whole thing from scratch for NES" using already made graphics.
Re: pyNES: writing NES games in Python
by on (#120572)
Yes!

We have news!

1) First, now I have windows and mac binaries. I mean, that would be easier for other platforms to install and test pyNES.

2) I've started to deattach the innerfunciton module. That way would be easier to write plugabble functions. Also would be easier to rewrite the whole logic part. I mean "ifs, loops"

Project is not dead!
Re: pyNES: writing NES games in Python
by on (#120577)
That's great news! Python is my favorite language, and the NES my favorite retro platform, so this project has always had a special place in my heart. And it seems to have been effective in at least a few instances of bringing folks into the NES Dev scene.
Re: pyNES: writing NES games in Python
by on (#120613)
qbradq wrote:
That's great news! Python is my favorite language, and the NES my favorite retro platform, so this project has always had a special place in my heart. And it seems to have been effective in at least a few instances of bringing folks into the NES Dev scene.


Yes, pretty much. Since I got interested into making NES games, I've looked into easy ways to make NES games and cc65 wasn't easy enough as I just plain hate C/C++ (not languages with C-like syntax as I love Java, C# and D, just C/C++) because you can shoot yourself in the foot so easily with it that you wouldn't even know that until some user, months after "tested" release (not RC, beta or anything, final one) reports segfault because he looked on app funny and it turns out some pointer went null when it shouldn't do that yet.
Re: pyNES: writing NES games in Python
by on (#120631)
darkhog wrote:
some user, months after "tested" release (not RC, beta or anything, final one) reports segfault because he looked on app funny and it turns out some pointer went null when it shouldn't do that yet.

There'd be one quick way to solve this particular problem: separate pointer types into a non-null pointer type, whose variables cannot be assigned null, and a nullable pointer type, which can't be dereferenced without an explicit "if null" block. This way the compiler can verify at compile time that a null pointer dereference will never happen. The Rust language has this, called an option type. Even SQL has NOT NULL column types. (SQL has pointers but calls them foreign keys.)
Re: pyNES: writing NES games in Python
by on (#120634)
Tell that to poor Turbo C I had to learn C on. Or cc65 for that matter.