Shop OBEX P1 Docs P2 Docs Learn Events
Son of Gear — Parallax Forums

Son of Gear

blittledblittled Posts: 681
edited 2010-03-03 17:16 in Propeller 1
I've been toying with the idea of coming up with another Propeller Emulator. I realize that there is already an excellent emulator, Gear. I do believe it is still maintained and the source code is available for it.

My goal is to try to make it cycle perfect with the Propeller at 80MHz. Since I am a C# programmer it will be written in C# like Gear. My approach is to launch each cog as a thread to emulate parallel processing. As soon as this goal is reached then single stepping would be added for debugging. Also outputs such as emulated NTSC and VGA screens would have to be created. It will be probably released as an open source project so it can be a community effort.

Some questions I have are:
1. Am I reinventing the wheel since Gear is an excellent emulator?
2. Is there enough interest to make it a worthwhile project?
3. Is C# fast enough, especially with graphics (could OpenGL or DirectX be used for speeding up the graphics)?
4. Is there anyone else doing this?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Will work for Propeller parts!

Comments

  • jazzedjazzed Posts: 11,803
    edited 2010-03-03 02:15
    One thing is clear: you will likely learn more than you ever wanted to know about PASM by doing this.

    Whether or not it will be good for others is TBD. People will probably use it if you add a fully functional Spin interpreter emulator (gear is deficient in this respect as I recall). You will hear lots of whining about .net [noparse]:)[/noparse]
  • heaterheater Posts: 3,370
    edited 2010-03-03 06:41
    Whine, moan, complain, about .net

    Emulators need performance. Emulators need portability, else what's the point. If you are going to put a lot of hours into a project with the aim of making it generally useful why limit your audience to Windows users.

    OpenGL of course, same reasoning as above.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • heaterheater Posts: 3,370
    edited 2010-03-03 08:25
    blittled: "My approach is to launch each cog as a thread to emulate parallel processing"

    I think using threads for this is totally pointless.

    If you want to make a cycle perfect simulation of a Prop (or any other hardware for that matter) then you will have a simulated "clock tick" some where. On this tick you want to evaluate the new state of all your hardware. All the COG's, all the timers, video shifters, I/O pins, HUB multiplexer etc etc. These things have to be in lock step so the is no point in doing them in threads which you then have to keep synchronized some how.

    Now you might argue that you want to use threads to be able to make use of the multiple cores of your PC's processor.
    Fair enough, but I wold be happy leave those cores occupied running the rest of my operating system, and surfing the Propeller forum[noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • hinvhinv Posts: 1,255
    edited 2010-03-03 12:34
    I, would like to see a cycle accurate prop emulator, but couldn't you pick a different platform?

    After reading this: www.infowars.com/bill-gates-use-vaccines-to-lower-population/, I am going to step up my efforts to avoid funding this Malthusian Megalomaniac.
    I don't use Windows, for technical and policy reasons, and many others don't either. And like jazzed hinted to, many of us don't even know how to deal with .net, much less want to.
    I, mostly use IRIX(runs on old SGI hardware that I doubt you will support), and openSUSE Linux. If you did it in any flavor of Linux, of which Ubuntu IIRC is the most popular among desktops, it would be a greater benefit to many of us.

    And for those who say I am being too political, I say this: think about how much "politics" has affected your life, and yes your hobbies. I dare say that if you thing "not much", you are deceiving yourself.


    Take Care,
    Doug
  • AleAle Posts: 2,363
    edited 2010-03-03 16:46
    You can also improve pPropellerSim. It is programmed in Java and then not limited to m$. It is somewhat cycle accurate (the clock tick is emulated), all cogs work but it needs improvement in the spin disassembler and emulation of timers.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Visit some of my articles at Propeller Wiki:
    MATH on the propeller propeller.wikispaces.com/MATH
    pPropQL: propeller.wikispaces.com/pPropQL
    pPropQL020: propeller.wikispaces.com/pPropQL020
    OMU for the pPropQL/020 propeller.wikispaces.com/OMU
    pPropellerSim - A propeller simulator for ASM development sourceforge.net/projects/ppropellersim
  • wjsteelewjsteele Posts: 697
    edited 2010-03-03 16:54
    Curious, Heater... why do you think .NET is Windows only? Did you know that the Mono project (from Novell) is an open implemenation of .NET. In fact, Microsoft released a project called "Rotor" several years ago (here: http://www.microsoft.com/downloads/details.aspx?FamilyId=3A1C93FA-7462-47D0-8E56-8DD34C6292F0) that contained the complete source code to the .NET Runtime and C# language It would work on Windows, Mac OSX as well as FreeBSD. It has since then been ratified as an ECMA standard. Silverlight is an implementation of that runtime that runs on Windows, OSX (from Microsoft themselves), Symbian OS (Novell) as well as Linux (via Moonlight.)

    C# can easily be fast enough if you know exactly what the compiler's output will be. There are several implementations of C# doing number crunching the rivals C++, especially if you fully understand the JIT process, etc. Games for the Zune/Windows/XBox are written on a "compact" version of the runtime via XNA and it's plenty fast enough to produce full screen graphics at 60 fps. With that capability, I'd think it would easily be fast enough to emulate the prop.

    Bill
  • jazzedjazzed Posts: 11,803
    edited 2010-03-03 17:16
    heater knows it's not just windows ... he just has other concerns [noparse]:)[/noparse] Mono happily runs any GUI .net 2.0 application (not using serial port) that I've written/tested. Now if I could get the serial port stuff to work, that would be great!
Sign In or Register to comment.