nesdev.com
http://forums.nesdev.com/

How do I set up PyNES
http://forums.nesdev.com/viewtopic.php?f=2&t=13175
Page 1 of 1

Author:  psycopathicteen [ Wed Aug 26, 2015 2:50 pm ]
Post subject:  How do I set up PyNES

https://www.youtube.com/watch?v=Y-o3pJEhwD4

Like in this video. How do I get a black screen, with a window on the side for asm.

Author:  Drew Sebastino [ Wed Aug 26, 2015 2:56 pm ]
Post subject:  Re: How do I set up PyNES

What exactly is this? Is it like a compiler that shows you the code that you've been writing in whatever and what it did to turn it into assembly? Can you write in assembly and it would go the other way around?

Author:  freem [ Wed Aug 26, 2015 3:42 pm ]
Post subject:  Re: How do I set up PyNES

Espozo wrote:
What exactly is this?

A way to use the programming language Python to program NES games.

Espozo wrote:
Is it like a compiler that shows you the code that you've been writing in whatever and what it did to turn it into assembly?

as far as I can tell, it converts Python code to 6502 assembler, but I haven't really used it, so I couldn't say for sure.

Espozo wrote:
Can you write in assembly and it would go the other way around?

highly doubt it.

Author:  Drew Sebastino [ Wed Aug 26, 2015 4:23 pm ]
Post subject:  Re: How do I set up PyNES

freem wrote:
highly doubt it.

What's the point then? You wouldn't be able to correct any inefficiencies made by the compiler. Actually, I'm stupid, you could probably keep editing the python code in a certain way to where it makes exactly what you want, but I'd wonder if it would just turn up being even harder than just writing in assembly.

Author:  mikejmoffitt [ Wed Aug 26, 2015 5:58 pm ]
Post subject:  Re: How do I set up PyNES

If it is generating 6502 assembly mnemonics, nothing prevents you from editing it by hand.

Author:  tokumaru [ Wed Aug 26, 2015 6:35 pm ]
Post subject:  Re: How do I set up PyNES

Yes, but it's obvious that the changes won't be reflected in the python code. It's not like every piece of optimized assembly has a corresponding piece of optimized python (or other high level language) code, otherwise it would just be a matter of figuring out that optimized high-level code from the start, and nobody would ever use assembly. Expecting a program to be able to convert any arbitrary piece of assembly code into optimized high-level code is completely unreasonable.

Author:  psycopathicteen [ Thu Aug 27, 2015 7:29 am ]
Post subject:  Re: How do I set up PyNES

From the video, it looks pretty efficient. So far it doesn't do any of the typical slow-code things, like using a subroutine for stuff that could be done in an instruction, and using word sizes that are too big for the CPU to handle.

Author:  psycopathicteen [ Sat Aug 29, 2015 9:20 am ]
Post subject:  Re: How do I set up PyNES

I'm still waiting for a response. I believe the actual program is in the .spec file, but my computer doesn't run .spec files, so how do I run the program?

Author:  rainwarrior [ Sat Aug 29, 2015 9:51 am ]
Post subject:  Re: How do I set up PyNES

Espozo wrote:
What's the point then?


The point is not having to write assembly.

Author:  nrezinorn [ Sun Aug 30, 2015 5:23 pm ]
Post subject:  Re: How do I set up PyNES

psycopathicteen wrote:
I'm still waiting for a response. I believe the actual program is in the .spec file, but my computer doesn't run .spec files, so how do I run the program?


I was able to install this on linux doing the following:

clone the github repo:
https://github.com/gutomaia/pyNES.git

# switch to folder and run make (creates a python virtual env)
cd pyNES; make

# activate the python virtual env
source venv/bin/activate

# install pyNES module into venv
python setup.py install

# build examples
cd pynes/examples
pynes py helloworld.py -o helloworld.nes

Test is an emulator of choice by loading helloworld.nes

I'm going to play with this more and fumble my way through as there is next to no documentation right now for this. The above steps *should* work on OSX too. If you run windows you will need python installed, then you can run similar commands using windows command line syntax, and it should work all the same.

Edit: the makefile for OS X explodes. makefile works fine on Centos 7 (and probably any other Linux distro)

Apologies is this is confusing, but it's how "python" works :beer:

psycopathicteen wrote:
Like in this video. How do I get a black screen, with a window on the side for asm.

If you're on windows, what he is doing there won't work (or at least I don't know how to reproduce it). If you're on linux/mac , he has some save hook in his editor that updates the file in realtime, using his pynes command, and in his second window it's simply refreshing it with the "watch" command to display the raw ASM generated.

Page 1 of 1 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/