Catalina and the P2

1246

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

  • Seems like XMM should work for HyperRam & HyperFlash...
    Prop Info and Apps: http://www.rayslogic.com/
  • PublisonPublison Posts: 11,059
    edited 2019-04-06 - 17:43:52
    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: 4,498
    edited 2019-04-06 - 22:34:14
    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
    Catalina - a FREE ANSI C compiler for the Propeller.
    Download it from http://catalina-c.sourceforge.net/
  • RaymanRayman Posts: 9,906
    edited 2019-04-06 - 23:06:44
    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/
    Prop Info and Apps: http://www.rayslogic.com/
  • 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" :)
    Catalina - a FREE ANSI C compiler for the Propeller.
    Download it from http://catalina-c.sourceforge.net/
  • 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!
    Prop Info and Apps: http://www.rayslogic.com/
  • Cluso99Cluso99 Posts: 15,530
    edited 2019-04-07 - 03:03:41
    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:
    My Prop boards: P8XBlade2 , RamBlade , CpuBlade , TriBlade
    P1 Prop OS (also see Sphinx, PropDos, PropCmd, Spinix)
    Website: www.clusos.com
    P1: Tools (Index) , Emulators (Index) , ZiCog (Z80)
    P2: Tools & Code , Tricks & Traps
  • didn't run the first C compiler under CP/M on a Z80 emulator?

    Mike
    I am just another Code Monkey.
    A determined coder can write COBOL programs in any language. -- Author unknown.
    Press any key to continue, any other key to quit

    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this post are to be interpreted as described in RFC 2119.
  • 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" :)
    Catalina - a FREE ANSI C compiler for the Propeller.
    Download it from http://catalina-c.sourceforge.net/
  • 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.
    Catalina - a FREE ANSI C compiler for the Propeller.
    Download it from http://catalina-c.sourceforge.net/
  • 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?
  • 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!
    Catalina - a FREE ANSI C compiler for the Propeller.
    Download it from http://catalina-c.sourceforge.net/
  • 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!
    FlexGUI, a GUI for programming the P1 and P2 in Spin, PASM, BASIC, and C.
    Help support its development at Patreon or PayPal.
  • Will be nice in VGA over HDMI with USB KB & Mouse...

    I remember playing that game in junior high on TRS-80...
    Prop Info and Apps: http://www.rayslogic.com/
  • 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.
    FlexGUI, a GUI for programming the P1 and P2 in Spin, PASM, BASIC, and C.
    Help support its development at Patreon or PayPal.
  • 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! :)
    Catalina - a FREE ANSI C compiler for the Propeller.
    Download it from http://catalina-c.sourceforge.net/
  • Blast from the past!
    I recall spending hours(days?) on a DEC PDP/11 playing this game. :)
    Melbourne, Australia
  • 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

    Livermore, CA (50 miles SE of San Francisco)
  • 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?
    FlexGUI, a GUI for programming the P1 and P2 in Spin, PASM, BASIC, and C.
    Help support its development at Patreon or PayPal.
  • 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: 3,614
    edited 2019-04-15 - 03:21:29
    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? :)
    FlexGUI, a GUI for programming the P1 and P2 in Spin, PASM, BASIC, and C.
    Help support its development at Patreon or PayPal.
  • 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
    Livermore, CA (50 miles SE of San Francisco)
  • 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.
    Catalina - a FREE ANSI C compiler for the Propeller.
    Download it from http://catalina-c.sourceforge.net/
  • jmgjmg Posts: 14,088
    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.

  • 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.
    Catalina - a FREE ANSI C compiler for the Propeller.
    Download it from http://catalina-c.sourceforge.net/
  • jmgjmg Posts: 14,088
    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.
    FlexGUI, a GUI for programming the P1 and P2 in Spin, PASM, BASIC, and C.
    Help support its development at Patreon or PayPal.
Sign In or Register to comment.