Giter VIP home page Giter VIP logo

pynes's Issues

Error on compile pynes/examples/helloworld.py

I write commands:

$ git clone https://github.com/gutomaia/pyNES
$ cd pyNES/
$ python3 setup.py install
$ pynes py pynes/examples/helloworld.py -o helloworld.nes

Output:

Traceback (most recent call last):
  File "/usr/local/bin/pynes", line 4, in <module>
    __import__('pkg_resources').run_script('pyNES==0.0.2', 'pynes')
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 667, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1463, in run_script
    exec(code, namespace, namespace)
  File "/usr/local/lib/python3.8/dist-packages/pyNES-0.0.2-py3.8.egg/EGG-INFO/scripts/pynes", line 7, in <module>
    main(sys.argv)
  File "/usr/local/lib/python3.8/dist-packages/pyNES-0.0.2-py3.8.egg/pynes/__init__.py", line 82, in main
    args.func(args)
  File "/usr/local/lib/python3.8/dist-packages/pyNES-0.0.2-py3.8.egg/pynes/__init__.py", line 86, in exec_py
    pynes.composer.compose_file(args.input, output=args.output,
  File "/usr/local/lib/python3.8/dist-packages/pyNES-0.0.2-py3.8.egg/pynes/composer.py", line 327, in compose_file
    game = compose(code)
  File "/usr/local/lib/python3.8/dist-packages/pyNES-0.0.2-py3.8.egg/pynes/composer.py", line 345, in compose
    builder.visit(python_land)
  File "/usr/lib/python3.8/ast.py", line 363, in visit
    return visitor(node)
  File "/usr/lib/python3.8/ast.py", line 439, in generic_visit
    value = self.visit(value)
  File "/usr/lib/python3.8/ast.py", line 363, in visit
    return visitor(node)
  File "/usr/lib/python3.8/ast.py", line 448, in generic_visit
    new_node = self.visit(old_value)
  File "/usr/lib/python3.8/ast.py", line 363, in visit
    return visitor(node)
  File "/usr/local/lib/python3.8/dist-packages/pyNES-0.0.2-py3.8.egg/pynes/composer.py", line 57, in visit_List
    expr = self.generic_visit(node)
  File "/usr/lib/python3.8/ast.py", line 439, in generic_visit
    value = self.visit(value)
  File "/usr/lib/python3.8/ast.py", line 363, in visit
    return visitor(node)
  File "/usr/lib/python3.8/ast.py", line 393, in visit_Constant
    return visitor(node)
  File "/usr/local/lib/python3.8/dist-packages/pyNES-0.0.2-py3.8.egg/pynes/composer.py", line 54, in visit_Num
    return Num(NesInt(node.n))
NameError: name 'Num' is not defined

Can anyone help me?

Python version: 3.8.5

more and better examples needed

i think that the examples are far not enough for figuring out the potential of pyNES, like developing more complex code, like what we can do on Boriel’s ZXBasic Compiler - where from can we find these examples? and would be great if this github account could host such examples as well - and thanks in advance! :)

Associate .asm file to pynes.exe on NSIS

Improve the NSIS instaler with:

Associate the .asm file to pynes.exe command on the local folder. The expected behavior should be. When the user has a folder with the whole asm project, when double clicks on the main.asm file, a new main.nes file should appear.

Added README.rst to the setup.py

When the project is listed on Python Index (pypi), usually it does have a small description. That usually come when refering the README.rst in setup.py and adding the file to wheel package.

Docs!

We need docs, really!

use Pillow instead of PIL

PIL as a graphic library is outdated and doomed. I should use Pillow from the beguining.

Context:

Sprite library uses PIL to import/export sprites from JPEG. However, PIL is outdated, we need to move on to Pillow. Basically, the change on library should only affect sprite tests.

  • remove PIL from the requirements.txt and also setup.py and put latest Pillow ilb
  • fix all the tests and make the pass

[OFF-TOPIC] Sobre o PyNES

Olá Guto, tudo bem?
Gostei muito do PyNES, é uma idéia sensacional e ficou muito bom o SDK kit.
Recentemente, eu estava pensando em uma idéia semelhante só que para Mega Drive, visto que existem outras SDKS para a plataforma mas em linguagens muito travadas como C ou BASIC. Atualmente prefiro fazer em puro assembly m68k do que usar elas.

Sem mais rodeios, gostaria de saber se tenho sua permissão para desenvolver baseado no PyNES, uma sdk para o Mega Drive.

Aguardo sua autorização, obrigado!

Support Python 3

Support for Python 3 is a must have, especially if you intent to use pyNES in a Raspberry PI. It came with Python 3 as a standard!

  • Create a task on Makefile using Tox to in order to test with multiple python environments
  • Assert that all tests works with Python 3 and make the appropriate changes
  • Added Python 3 to run on TravisCI, just add it on .travis.yml

Change analyser.py to use iterators

Actually pyNES deal with the process of compiling (lexical, syntax, semantic) in a serial form. I mean, I think, we will increase the performance and also the readable intention of the code if we use iterators.

That is an outstanding task, you will deal with the main spine of pyNES, however, there is nothing to be worried about that, the test coverage will guide you before any detour. Use them, "use the force Luke". Any doubt just ask.

If you are not sure how iterators work on python take a look on @ramalho presentation about it

https://speakerdeck.com/ramalho/iterators-and-generators-the-python-way
http://pyvideo.org/video/1709/iteration-generators-the-python-way

Goal:

  • change analyser.py to use iterators. For doing that, you will definitely perform a huge refactoring on the that file, and some slight changes on the syntax method.

ATTENTION:

  • I know that I should use iterator on syntax and semantic also. But let's do one step at the time. Focus only on changing the lexical analyzer.

Fix Readme issue

The sentence before the waitvblank function example is incomplete:

"Hi Level Functions are not templated anymore. However, th"

looks like it was cut off.

Does this even work on Windows 11?

Here's what i got:
C:\Users\smart>pynes
'pynes' is not recognized as an internal or external command, operable program or batch file.

Fix PNG support on Travis

Travis is breaking tests 'cause of the lack of PIL PNG on PIP.

Witch could be called the 3P problem (3Ps with 3 letters each, that is just Pain Phuck Parody).

Anyway. Just someone that could fix this:

91 --------------------------------------------------------------------
92 PIL 1.1.7 SETUP SUMMARY
93 --------------------------------------------------------------------
94 version 1.1.7
95 platform linux2 2.7.3 (default, Aug 1 2012, 05:16:07)
96 [GCC 4.6.3]
97 --------------------------------------------------------------------
98 *** TKINTER support not available
99 --- JPEG support available
100 *** ZLIB (PNG/ZIP) support not available
101 *** FREETYPE2 support not available
102 *** LITTLECMS support not available
103 --------------------------------------------------------------------
104

command line and readme broken

Can't get the readme example to work AND the output from the pynes executable isn't very helpful either.

here's the hello.py file I used:

import pynes
from pynes.bitbag import *

palette = [
    0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
    0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
    0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
]

chr_asset = import_chr('player.chr')

sprite = define_sprite(128, 128, 0, 3)

def reset():
    global palette, sprite
    wait_vblank()
    clearmem()
    wait_vblank()
    load_palette(palette)
    load_sprite(sprite, 0)

I grabbed a copy of player.chr from github then used this command line:

pynes -p hello.py -o hello.nes

unfortunately this doesn't work. It produces no error message other than an unhelpful help message. The tool runs though because it creates an empty hello.nes file.

so I'm stuck - I can't even get the basics working

any ideas?

I'm on mac os x 10.11.3. installed pynes using pip.

runtime error with pyNES

can you help me i got this error :

 Traceback (most recent call last):

File "C:/Users/User/PycharmProjects/marioNES/source.py", line 6, in
pynes.press_start()
File "C:\Python34\lib\site-packages\pynes__init__.py", line 18, in press_start
game = compose(code)
File "C:\Python34\lib\site-packages\pynes\composer.py", line 348, in compose
turist.visit(python_land)
File "C:\Python34\lib\ast.py", line 245, in visit
return visitor(node)
File "C:\Python34\lib\site-packages\pynes\composer.py", line 101, in generic_visit
self.visit(item)
File "C:\Python34\lib\ast.py", line 245, in visit
return visitor(node)
File "C:\Python34\lib\site-packages\pynes\composer.py", line 178, in visit_Assign
self.generic_visit(node)
File "C:\Python34\lib\site-packages\pynes\composer.py", line 103, in generic_visit
self.visit(value)
File "C:\Python34\lib\ast.py", line 245, in visit
return visitor(node)
File "C:\Python34\lib\site-packages\pynes\composer.py", line 245, in visit_Call
self.generic_visit(node.args)
File "C:\Python34\lib\site-packages\pynes\composer.py", line 90, in generic_visit
self.visit(n)
File "C:\Python34\lib\ast.py", line 245, in visit
return visitor(node)
File "C:\Python34\lib\site-packages\pynes\composer.py", line 293, in visit_Str
self.stack(NesString(node.s))
File "C:\Python34\lib\site-packages\pynes\nes_types.py", line 112, in init
str.init(self, string)
TypeError: object.init() takes no parameters

Documentation

Is there any documentation? The docs link currently directs here

Updated:

TODO to fullfill this issue!

  • Docs on kill the baby branch
  • Simple tutorial

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.