Shop OBEX P1 Docs P2 Docs Learn Events
Catalina and the P2 - Page 4 — Parallax Forums

Catalina and the P2

12467

Comments

  • I have never used Catalina or heard of it before. I have always used SimpleIDE.

    How compatible is Catalina to SimpleIDE? Is all the Andy code in it?

    Mike

  • RaymanRayman Posts: 14,646
    Seems like XMM should work for HyperRam & HyperFlash...
  • PublisonPublison Posts: 12,366
    edited 2019-04-06 17:43
    iseries wrote: »
    I have never used Catalina or heard of it before. I have always used SimpleIDE.

    How compatible is Catalina to SimpleIDE? Is all the Andy code in it?

    Mike

    Catalina has been around for over 10 years. It's been a while as Ross has taken some time off to pursue another endeavour, but it seems with the impending P2, he is back with his software magic. Here is a thread from 10 years ago:
    http://forums.parallax.com/discussion/116370/catalina-2-6-a-free-c-compiler-for-the-propeller-the-final-frontier/p1
  • RossHRossH Posts: 5,462
    edited 2019-04-06 22:34
    iseries wrote: »
    I have never used Catalina or heard of it before. I have always used SimpleIDE.

    How compatible is Catalina to SimpleIDE? Is all the Andy code in it?

    Mike

    I don't know what the "Andy code" is, but Catalina was originally a C compiler for the P1 - the first! - which came with an extensive library of "plugins" to support various external peripherals, and was the first to support many of the various memory models we had to use on the P1 to support programs of any significant size (CMM, LMM, XMM etc).

    It hadn't occurred to me that Catalina has been around for 10 years, but looking at some of the early dates, I realize I started work on it 12 years ago!

    Makes me feel old :(

    P.S. Here is the link to the last P1 release - https://forums.parallax.com/discussion/153750/catalina-3-13-2-smaller-and-faster-better-ide
  • RaymanRayman Posts: 14,646
    edited 2019-04-06 23:06
    I'm not sure about "first"... Catalina is great and free, but there was one you could buy before that, I think...

    This is it: https://imagecraft.com/blog/2008/08/parallax-propeller-and-the-propeller-c-compiler/
  • RossHRossH Posts: 5,462
    Rayman wrote: »
    I'm not sure about "first"... Catalina is great and free, but there was one you could buy before that, I think...

    This is it: https://imagecraft.com/blog/2008/08/parallax-propeller-and-the-propeller-c-compiler/

    You are correct. I was already working on Catalina (I started in 2006) when I found out about the ImageCraft compiler. I did have some correspondence with the ImageCraft people - I can't remember all the details, but I believe it was about them claiming to be ANSI compliant when they were not. In any case, the end result was that I decided to carry on with Catalina.

    So, you can amend my previous post to "the first ANSI-compliant C compiler" :)
  • RaymanRayman Posts: 14,646
    I do have a vague recollection about ANSI compliance and Imagecraft... That was a long time ago...

    Prop II really needs good C/C++ compilers. Wasn't really necessary for P1. Glad you're back on this!
  • Cluso99Cluso99 Posts: 18,069
    edited 2019-04-07 03:03
    FWIW I used Catalina in a commercial P1 product. While I didn’t actually write the C part, i wrote the interfaces and spin & pasm code. There were 3 x P1’s used in the product. The Catalina handled huge databases of stars, nebulae etc on an SD card, and would point a telescope at the selected object. The interface to Catalina was a pleasure to program. The C was loded and executed from external 512KB SRAM using my RamBlade design.
    Ross was extremely helpful so thanks Ross :smiley:
    And, nice to see you’re back :smiley:
  • didn't run the first C compiler under CP/M on a Z80 emulator?

    Mike
  • RossHRossH Posts: 5,462
    msrobots wrote: »
    didn't run the first C compiler under CP/M on a Z80 emulator?

    Mike

    I don't remember that one. But ok - amend my post above to "the first native ANSI-compliant C compiler" :)
  • RossHRossH Posts: 5,462
    Catalina now generates native code for the P2, and now also has its first supported plugin for the P2_EVAL board - a serial interface, based on msrobots "cogserial". No more simply blinking LEDS!

    To celebrate, attached is a blast from the past ...

    ... Super Star Trek, running natively on the P2!

    You can play the game using the Parallax Serial Terminal. Set your baud rate to 230400, and your terminal preferences to ignore linefeeds (ascii 10). The game will wait for you to press a key before starting.

    The code generator is still a long way from optimal, but it is now using many of the new P2 instructions.
  • cgraceycgracey Posts: 14,155
    That's great, RossH!

    "SUPER STARTREK - MAY 16, 1978 - REQUIRES 24K MEMORY"

    It looks like this was originally written in BASIC(?) for a DEC machine?
  • RossHRossH Posts: 5,462
    cgracey wrote: »
    That's great, RossH!

    "SUPER STARTREK - MAY 16, 1978 - REQUIRES 24K MEMORY"

    It looks like this was originally written in BASIC(?) for a DEC machine?

    That's right. I have fond memories of the original BASIC game. Someone (not me!) converted it to C in 1996. I always thought that with just a tiny bit more effort I could get it running on the P1, but I never quite made it (it ran, but it required a P1 with some form of external RAM).

    But now on the P2, we can all boldly go where no man (or woman) has gone before!
  • RossH wrote: »
    Catalina now generates native code for the P2, and now also has its first supported plugin for the P2_EVAL board - a serial interface, based on msrobots "cogserial". No more simply blinking LEDS!

    To celebrate, attached is a blast from the past ...

    ... Super Star Trek, running natively on the P2!

    Cool :). Looks like you're making great progress, Ross!
  • RaymanRayman Posts: 14,646
    Will be nice in VGA over HDMI with USB KB & Mouse...

    I remember playing that game in junior high on TRS-80...
  • RossH wrote: »
    cgracey wrote: »
    That's great, RossH!

    "SUPER STARTREK - MAY 16, 1978 - REQUIRES 24K MEMORY"

    It looks like this was originally written in BASIC(?) for a DEC machine?

    That's right. I have fond memories of the original BASIC game. Someone (not me!) converted it to C in 1996. I always thought that with just a tiny bit more effort I could get it running on the P1, but I never quite made it (it ran, but it required a P1 with some form of external RAM).

    But now on the P2, we can all boldly go where no man (or woman) has gone before!

    That reminds me that I need to restore the Catalina support in spin2cpp (it's still there, but likely bit-rotted while Catalina was on hiatus). fastspin/spin2cpp can compile BASIC, including old style Microsoft BASIC. With a bit of work I should be able to make spin2cpp into a basic2cpp, since the BASIC parser and C output code is all present, just not really tested.
  • RossHRossH Posts: 5,462
    ersmith wrote: »
    fastspin/spin2cpp can compile BASIC, including old style Microsoft BASIC. With a bit of work I should be able to make spin2cpp into a basic2cpp, since the BASIC parser and C output code is all present, just not really tested.

    Now who's showing their age! :)
  • Blast from the past!
    I recall spending hours(days?) on a DEC PDP/11 playing this game. :)
  • ozpropdev wrote: »
    Blast from the past!
    I recall spending hours(days?) on a DEC PDP/11 playing this game. :)

    Me too! I wasted boxes of green-bar paper using a DEC LA36 terminal :blush: What else was I to do on graveyard shift, while the PDP 11/04s we used were idle? And then, I got a copy of David Ahl's "BASIC Computer Games" text and that started my career in software!

    dgately

  • Ah yes, Ahl's "BASIC computer games", and "More BASIC computer games" were the start for my brother and I on an Osborne 1.
  • There are a bunch of classic BASIC computer games from Ahl's book at classicbasicgames.org/. Many of these can be compiled with fastspin to be played on P1 or P2, although sometimes a little tweaking is required. Often just adding
    #include "classic.bi"
    
    to the start of the file is enough to get it going, with some clean-up on the PRINT statements to make it prettier.

    Getting back to Catalina, I certainly could support making spin2cpp (fastspin's big brother) output Catalina compatible C code for these kinds of BASIC programs. The question is, would anyone use it?
  • ersmith wrote: »
    There are a bunch of classic BASIC computer games from Ahl's book at classicbasicgames.org/. Many of these can be compiled with fastspin to be played on P1 or P2, although sometimes a little tweaking is required. Often just adding
    #include "classic.bi"
    
    to the start of the file is enough to get it going, with some clean-up on the PRINT statements to make it prettier.

    Getting back to Catalina, I certainly could support making spin2cpp (fastspin's big brother) output Catalina compatible C code for these kinds of BASIC programs. The question is, would anyone use it?
    Does "Hunt the Wumpus" work? :smiley:

  • ersmithersmith Posts: 6,053
    edited 2019-04-15 03:21
    David Betz wrote: »
    ersmith wrote: »
    There are a bunch of classic BASIC computer games from Ahl's book at classicbasicgames.org/. Many of these can be compiled with fastspin to be played on P1 or P2, although sometimes a little tweaking is required. Often just adding
    #include "classic.bi"
    
    to the start of the file is enough to get it going, with some clean-up on the PRINT statements to make it prettier.

    Getting back to Catalina, I certainly could support making spin2cpp (fastspin's big brother) output Catalina compatible C code for these kinds of BASIC programs. The question is, would anyone use it?
    Does "Hunt the Wumpus" work? :smiley:

    classicbasicgames.org doesn't seem to have that. I found a version elsewhere online, but fastspin doesn't handle
      DEF FNA(X)=INT(X+N)
    
    for function definitions yet. There are several alternatives of course (fastspin already has multiple ways to define functions), so with a bit of work I think it'd be easy to port. Care to give it a try? :)
  • No, not the Dodecahedron.

    Mike
  • ersmith wrote: »
    Getting back to Catalina, I certainly could support making spin2cpp (fastspin's big brother) output Catalina compatible C code for these kinds of BASIC programs. The question is, would anyone use it?
    I don't think anyone would object :wink:
    I personally don't write new code in BASIC, but being able to use existing BASIC code could generate interest in running retro games (retro gaming appears to have a following... i.e. HackaDay articles on retro gaming & CPUs show up quite often).

    dgately
  • RossHRossH Posts: 5,462
    I may have missed it somewhere - but does the P2 Boot ROM have the sine, log and anti-log tables that used to be in the P1 ROM? I used them in Catalina's floating point support libraries.

    Failing that, does anyone have a dump of these tables as they existed on the P1? I can simply load them into Hub RAM on the P2.
  • jmgjmg Posts: 15,173
    RossH wrote: »
    I may have missed it somewhere - but does the P2 Boot ROM have the sine, log and anti-log tables that used to be in the P1 ROM?
    No, they need to be loaded or created.

  • RossHRossH Posts: 5,462
    jmg wrote: »
    RossH wrote: »
    I may have missed it somewhere - but does the P2 Boot ROM have the sine, log and anti-log tables that used to be in the P1 ROM?
    No, they need to be loaded or created.

    Ok - found a copy. Thanks.
  • jmgjmg Posts: 15,173
    RossH wrote: »
    jmg wrote: »
    RossH wrote: »
    I may have missed it somewhere - but does the P2 Boot ROM have the sine, log and anti-log tables that used to be in the P1 ROM?
    No, they need to be loaded or created.

    Ok - found a copy. Thanks.

    I think you can also calculate the Sine table using Cordic, if you want to save loading them ? (not sure about log / anti-log ?)

    https://forums.parallax.com/discussion/169097/overlapping-cordic-commands-to-maximize-throughput
  • Rather than use a lookup table you can use cordic instructions directly; you'll get more accuracy that way. Use qrotate for sin/cos, qexp for exp, qlog for log, and qsqrt for sqrt.
Sign In or Register to comment.