It is currently Wed Dec 12, 2018 8:36 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: How do I set up PyNES
PostPosted: Wed Aug 26, 2015 2:50 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2777
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.


Top
 Profile  
 
PostPosted: Wed Aug 26, 2015 2:56 pm 
Offline
Formerly Espozo
User avatar

Joined: Mon Sep 15, 2014 4:35 pm
Posts: 3404
Location: Richmond, Virginia
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?


Top
 Profile  
 
PostPosted: Wed Aug 26, 2015 3:42 pm 
Offline
User avatar

Joined: Mon Oct 01, 2012 3:47 pm
Posts: 157
Location: freemland (NTSC-U)
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.


Top
 Profile  
 
PostPosted: Wed Aug 26, 2015 4:23 pm 
Offline
Formerly Espozo
User avatar

Joined: Mon Sep 15, 2014 4:35 pm
Posts: 3404
Location: Richmond, Virginia
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.


Top
 Profile  
 
PostPosted: Wed Aug 26, 2015 5:58 pm 
Offline
User avatar

Joined: Sun May 27, 2012 8:43 pm
Posts: 1334
If it is generating 6502 assembly mnemonics, nothing prevents you from editing it by hand.


Top
 Profile  
 
PostPosted: Wed Aug 26, 2015 6:35 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 11011
Location: Rio de Janeiro - Brazil
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.


Top
 Profile  
 
PostPosted: Thu Aug 27, 2015 7:29 am 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2777
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.


Top
 Profile  
 
PostPosted: Sat Aug 29, 2015 9:20 am 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2777
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?


Top
 Profile  
 
PostPosted: Sat Aug 29, 2015 9:51 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 7014
Location: Canada
Espozo wrote:
What's the point then?


The point is not having to write assembly.


Top
 Profile  
 
PostPosted: Sun Aug 30, 2015 5:23 pm 
Offline

Joined: Thu May 02, 2013 10:04 pm
Posts: 3
Location: Gilbert, AZ
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group