Page 2 of 4
Re: pyNES: writing NES games in Python
Posted: Thu Nov 29, 2012 12:31 pm
by slobu
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
Posted: Thu Nov 29, 2012 1:11 pm
by thefox
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
Posted: Thu Nov 29, 2012 3:29 pm
by Movax12
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
Posted: Thu Nov 29, 2012 5:00 pm
by tokumaru
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
Posted: Thu Nov 29, 2012 6:52 pm
by tepples
tokumaru wrote:How come tepples isn't all over this thing?
Honestly? The blank docs page.
Re: pyNES: writing NES games in Python
Posted: Thu Nov 29, 2012 6:59 pm
by tokumaru
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
Posted: Thu Nov 29, 2012 11:42 pm
by strat
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
Posted: Fri Nov 30, 2012 8:33 am
by slobu
Thanks for the first steps strat! However, when I run setup.py it gives me this:
Code: Select all
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
Posted: Fri Nov 30, 2012 10:59 am
by dullahan
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
Posted: Fri Nov 30, 2012 11:28 am
by slobu
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
Posted: Fri Nov 30, 2012 1:32 pm
by strat
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
Posted: Fri Nov 30, 2012 3:10 pm
by slobu
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
Posted: Fri Nov 30, 2012 7:51 pm
by tokumaru
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
Posted: Sat Dec 01, 2012 8:31 am
by slobu
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
Posted: Sat Dec 01, 2012 1:19 pm
by 3gengames
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.