omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    NES Emulator?

    Pythonista
    nes game emulator nintendo
    9
    19
    10602
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • KnightExcalibur
      KnightExcalibur last edited by KnightExcalibur

      So I've been looking into how video game emulators work the past few days. Crazy stuff.
      I learned that there have been several nintendo emulators written in python, and while most of them use pygame (which I know you can't use with Pythonista), I was wondering if making an NES emulator would be possible in Pythonista? I figured if it can be done with pygame then it isn't completely insane to think it could be done in Pythonista right? Since emulators are not available in the apple store, this would be an awesome way around that.
      Of course, i'm just starting to develop my knowledge in python so writing an emulator would probably be a couple decades away for me. However, since emulators have already been written in python would someone be able to adapt it? I would love to hear if this is possible and if anyone else is interested in it.

      1 Reply Last reply Reply Quote 0
      • pulbrich
        pulbrich last edited by pulbrich

        Could you point me to any such emulator written in Python? Just for my curiosity. Thanks!

        1 Reply Last reply Reply Quote 0
        • KnightExcalibur
          KnightExcalibur last edited by

          A few nintendo emulators that were written in python that I came across:
          https://github.com/PyAndy/Py3NES
          https://github.com/wkcn/pyfcemu
          https://pypi.org/project/nes-py/

          This one is interesting:
          https://github.com/gutomaia/pyNES
          It isn't an emulator per se, but it finds the images in the rom so you can create custom visuals.

          1 Reply Last reply Reply Quote 0
          • Ti Leyon
            Ti Leyon last edited by

            I am very much into emulators although not of the video game kind. @JonB either wrote or forked a Python Apple ][ emulator that depends on Pygame. If he did not port it into Pythonista it is probably because this is very (if not extremely) hard. In fact, I saw him talk about that level of difficulty in a few posts in this forum. Anyway, if you want to experiment with emulation on IOS you should try “iDOS 2”. It masquerades as a collection of old video games but is in fact a full DOSBox emulator. If you can penetrate its sandbox (which is not that hard) you can run any DOS program you want including MS Windows 3.xx. You should check out “https://www.vogons.org/viewtopic.php?f=11&t=56790” which is a fairly good discussion of emulation under DOS and Windows 3.xx. It contains a few links to NES emulators for DOS and Windows 3.xx that you can “MOD” if you are into this kind of stuff (and can spare the time for it). I do not know how fast they will run under iDOS. However, I run Windows 3.11 from iDOS on a 2015 iPad mini at similar speed as on the typical 66 MHz computers of its time. If you are part of the crazy “update at all cost” crowd you are out of luck. “iDOS 2” has not been updated in a few years and it has no forum for endless whinnies. However, it works fine and is surprisingly stable. If you want to install Windows 3.xx I would suggest a “MOD” version that runs from a folder instead of a virtual drive. You may find it somewhere in the “vogons” site from the link above. Happy emulating!

            1 Reply Last reply Reply Quote 0
            • KnightExcalibur
              KnightExcalibur last edited by

              This is great information, thank you! I'll look into it and post thoughts/questions here once I've read up on it some.

              1 Reply Last reply Reply Quote 0
              • JonB
                JonB last edited by JonB

                Not sure about NES -- I took a shot at adapting an apple ii emulator some time ago. The original depended on pygame, or maybe some cocoa arrive, I forget.

                The difficulty you are likely to face is the lack of an easy direct screen buffer on iOS, making display very very slow. My original solution used an imageview and some numpy approaches:
                https://github.com/jsbain/applepy

                Later, in this thread, we worked out some efficient audio and iosurface methods:

                https://gist.github.com/jsbain/87d9292b238c8f7169f1f2dcffd170c8

                I should go back and update the applepy simulator.

                Something like that will probably be necessary-- I suspect an NES emulator will have screen buffers to deal with. Though as I read a little about NES, sounds like they sort of have a Sprite system which might be more directly implementable in the scene module.

                I have seen a few python emulators on GitHub for NES or Gameboy, but not sure how many of them are pure python, or truly finished.

                cvp 1 Reply Last reply Reply Quote 0
                • cvp
                  cvp @JonB last edited by

                  @JonB https://github.com/jsbain/applepy/blob/master gives 404

                  JonB 1 Reply Last reply Reply Quote 0
                  • JonB
                    JonB @cvp last edited by

                    @cvp sorry, fixed the link..

                    1 Reply Last reply Reply Quote 0
                    • Ti Leyon
                      Ti Leyon last edited by

                      @JonB I think it is an excellent idea to improve on "Applepy". I am currently investigating the interest of big IT (can't live without them) in RSA factorization. I found a quadratic sequence that can solve it in polynomial time. Therefore, I cannot entertain any project of that scale for now. I will probably try something simple (I think) that will take a couple hours (I think) like "Chip-8" or a "p-machine" a la Pascal. By the way, doesn't "Scene" implement some kind of frame buffer? I never really use it mainly because it will be costly (time wise) to build cross platform applications using it. I know most (if not all) of these type of environment implement screen buffering. Below is a screen shot of "iDOS 2" running "windows 3.11" on an iPad mini 4. It is smoother or as smooth as other "DOSBox" implementations I have used. It uses the screen area as a mousepad that is ultra responsive. Games and animations run as well as in the original 3.11 on the best computers of that era. I do not think the dev could have done it without screen buffering and switching. In case "Scene" does not offer screen buffering, could sprites the size of the screen area be used for this purpose? Anyway, it would be swell to have "Applepy" run on a skeuomorphic skin as does "iDOS". Am I dreaming aloud?
                      iDos Screenshot

                      1 Reply Last reply Reply Quote 0
                      • JonB
                        JonB last edited by

                        I am in the process of swapping out the screen code on applepy, and adding in kb support. While the screen drawing code is reasonably fast, the actual emu code is horrendously slow. So this isn't actually a viable solution for anything "real".

                        1 Reply Last reply Reply Quote 0
                        • Ti Leyon
                          Ti Leyon last edited by

                          Ok @JonB I understand. Just being able to emulate an Apple ii using Python on an iPhone or iPad is an extraordinary feat in itself. Chapeau bas (respect).

                          1 Reply Last reply Reply Quote 0
                          • JonB
                            JonB last edited by

                            The code isn't mine. I just adapted the speaker and screen support.

                            1 Reply Last reply Reply Quote 0
                            • Ti Leyon
                              Ti Leyon last edited by

                              Yes I know but adapting a Pygame project to the Pytonista environment deserves as much respect. I can run Tauber’s code in Android, being able to do so in IOS is a double treat.

                              1 Reply Last reply Reply Quote 0
                              • KnightExcalibur
                                KnightExcalibur last edited by KnightExcalibur

                                @JonB I believe you are correct that none of the video game emulators are pure python or quite finished. They all have several dependencies that are incompatible with Pythonista from what I saw. Emulation is a fascinating concept to me, but way over my head as I am just starting to dip my toes into programming.
                                I took a look at applepy and I am very impressed. I will try to learn more about emulation and hopefully be able to understand it a little better.
                                I’m also blown away that you were able to adapt a pygame project to Pythonista. It goes to show that the possibilities are endless!

                                @Ti Leyon I’ve been reading through that link you gave me, and it is an awesome reference. I will also have to give iDOS 2 a try, I wasn’t aware that a DOSbox emulator existed on iOS!

                                1 Reply Last reply Reply Quote 0
                                • AtomBombed
                                  AtomBombed last edited by

                                  Theoretically, you could write an interpreter for the ROM that then takes the data and displays it via the screen module. I know that's very vague, but if you had individually-addressed pixels that are handled and displayed through the screen module, you could then process and display all the data to those simulated "pixels" manually.

                                  1 Reply Last reply Reply Quote 0
                                  • ccc
                                    ccc last edited by

                                    Anyone hacked on Arcade? https://github.com/pvcraven/arcade

                                    1 Reply Last reply Reply Quote 0
                                    • Enrike.Churin
                                      Enrike.Churin last edited by

                                      This post is deleted!
                                      1 Reply Last reply Reply Quote 0
                                      • pome-ta
                                        pome-ta last edited by

                                        This is a bad implementation method.
                                        There is no operation or sound, but it will be implemented in the future.

                                        https://github.com/pome-ta/pystaNesForJS

                                        pome-ta 1 Reply Last reply Reply Quote 0
                                        • pome-ta
                                          pome-ta @pome-ta last edited by

                                          We are pleased to inform you that we have implemented a gamepad.

                                          Mostly implemented in JavaScript, but ...

                                          https://github.com/pome-ta/pystaNesForJS

                                          1 Reply Last reply Reply Quote 0
                                          • First post
                                            Last post
                                          Powered by NodeBB Forums | Contributors