Shop OBEX P1 Docs P2 Docs Learn Events
Prop Emulator? — Parallax Forums

Prop Emulator?

prof_brainoprof_braino Posts: 4,313
edited 2013-06-26 10:09 in General Discussion
OK, I game developer asked me about a prop emulator.

We were talking about making a "video game" about programming.

The idea is to program a virtual prop in virtual bot, and make it react to a virtual world in the video game engine.

And then use the same program in a physical bot.

Yes, its a little ways out there.

Any thoughts on a prop emulator?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2013-06-25 07:38
    It's been done already (see here for GEAR and pPropellerSim).
  • Dave HeinDave Hein Posts: 6,347
    edited 2013-06-25 07:54
    There is also spinsim, which is posted at the PropGCC Google code site. It can run Spin programs at about the same speed as a Prop.
  • Martin_HMartin_H Posts: 4,051
    edited 2013-06-25 08:01
    About a year ago I had a crazy idea for cross platform Forth development. The idea was PropForth on the Propeller, and PropForth in an emulator on the PC. The emulator I tried (pretty sure it was Gear) was able to load and run PropForth, But I couldn't interact with the it via a serial terminal. So that pretty much pulled the rug right out from under me. But it might be more useful for purely VGA based programs, because that visualization is already built in.
  • prof_brainoprof_braino Posts: 4,313
    edited 2013-06-25 09:26
    Thanks guys!

    I think gear is what the game - guy is looking for.

    Martin_H: I also have the a similar crazy idea of running propforth in the emulator. Do you have any notes or instructions? Care to work on this again? Emulators and using them are out of my skill set, but if I can ask intelligent questions, Sal can try to answer them. I just have to avoid asking him to do all the work, as we'd all prefer PF6 to come out sooner, and that's taking all his time.

    FYI - the general idea is to simulate propforth running on a simulated LittleRobot using the Unity engine.
  • Martin_HMartin_H Posts: 4,051
    edited 2013-06-25 10:34
    Martin_H: I also have the a similar crazy idea of running propforth in the emulator. Do you have any notes or instructions? Care to work on this again? Emulators and using them are out of my skill set, but if I can ask intelligent questions, Sal can try to answer them. I just have to avoid asking him to do all the work, as we'd all prefer PF6 to come out sooner, and that's taking all his time.

    I can try it again if I get some free time tonight. As I recall I downloaded and installed the emulator, I used the Propeller tool to create a hex file of PropForth, I then loaded the hex file into Gears. At that point Gears starts running PropForth so I can see the cogs starting up and the rx and tx pins changing their state as if they're trying to talk to a non-existent serial terminal.
  • Martin_HMartin_H Posts: 4,051
    edited 2013-06-25 18:05
    Running PropForth 5.5 under Gears is pretty uneventful. You do exactly asI said above and the program runs, cog 0 stops, then cog 6 runs in a tight loop. It sure looks like it is waiting for input from a terminal that's not there.
  • MJBMJB Posts: 1,235
    edited 2013-06-26 07:15
    There is a Gear Plus version dated 10/26/2009 with some Plugins.
    One is this: (this Plus version - not from the original author - is in the GEAR thread - unfortunately I don't have the link right here)
    SerialIO v0.3
    //    A Plugin to the Gear Propeller Simulator that allows connecting
    //    to a FullDuplexSerial object running on the propeller chip.
    //
    // CHANGELOG
    // v0.2 - Adds a scrollbar and automatically scrolls down as text comes in.
    // v0.2 - Fixes a bug in handling receiving a 0 byte.
    // v0.1 - Initial release.
    //
    // 2009 Ben Levitt
    //
    

    this might help.
    Gear is written in .NET I think, but I didn't see the source.
    But I think it is around there.
  • jazzedjazzed Posts: 11,803
    edited 2013-06-26 08:38
    Martin_H wrote: »
    Running PropForth 5.5 under Gears is pretty uneventful. You do exactly asI said above and the program runs, cog 0 stops, then cog 6 runs in a tight loop. It sure looks like it is waiting for input from a terminal that's not there.

    Dave Hein's spinsim is in Propeller-GCC packages. No problem with console-IO.
    Spinsim was used for developing the propeller gcc compiler.
    ''
    '' Hello World
    ''
    con
      _clkmode = xtal1 + pll16x
      _clkfreq = 80_000_000
    
    obj
      pst : "Parallax Serial Terminal"
    
    pub main | n
    '' program main entry point
      pst.start(115200)
      repeat
        waitcnt(CLKFREQ/5+cnt)
        pst.str(string("Hello world "))
        pst.char(10)
    
    {
    '' compile with Roy's spin compiler
    C:\>spin hello.spin
    '' run with spinsim
    C:\>spinsim -b hello.binary
    Hello world
    Hello world
    Hello world
    ^C
    C:\>
    }
    
  • Martin_HMartin_H Posts: 4,051
    edited 2013-06-26 09:50
    jazzed wrote: »
    Dave Hein's spinsim is in Propeller-GCC packages. No problem with console-IO.
    Spinsim was used for developing the propeller gcc compiler.

    Wow, I thought spinsim was only for Spin bytecodes, but in reading the thread it sounds like they added PASM emulation.
  • Dave HeinDave Hein Posts: 6,347
    edited 2013-06-26 10:09
    The original goal of spinsim was to run Spin programs on something other than a Prop. I provided special commands that could be used to do serial I/O and file access through a memory-mapped mailbox at $1234000x. However, it became clear that PASM support was needed also, so I added that later on.
Sign In or Register to comment.