Shop OBEX P1 Docs P2 Docs Learn Events
New Catalina External Memory Model - a TriBladeProp demo — Parallax Forums

New Catalina External Memory Model - a TriBladeProp demo

RossHRossH Posts: 5,513
edited 2009-09-14 04:00 in Propeller 1
Enclosed is "Super Star Trek" for the Propeller - a classic Retro computer game in it's own right - but also a demo of the new Catalina External Memory Model.

To run this particular demo you need to have a TriBladeProp - but the full release of Catalina supporting TriBladeProp, Hydra and Hybrid is not far off.

The new Catalina memory model allows for programs with code, data and heap sizes up to 16Mb, and stack size up to 32k. On the Prop II the stack size will be expanded to 256kb, but even 32kb of stack space is enough to run quite large real-world programs.

The previous memory model (i.e. code size of up to 16Mb, but a combined data, heap and stack size of only 32kb) will remain supported - and is faster for smaller programs. And of course the orignal memory model (32kb combined code, data, heap and stack size) is still supported for those Propeller platforms with no XMM hardware (and is faster still!).

I was worried that the Catalina code generator would be embarrasingly inefficient, but compared to gcc I believe it actually stands up reasonably well. When Super Star Trek is compiled using gcc for X86 (and then stripped, to remove symbolic information), the program size is 130kb. When the same program is compiled using Catalina for the Propeller the program size is 310kb (the actual file size is 375kb, but 32kb of that is just empty space which I will eliminate before I release the 'official' version, and another 32kb is the XMM loader). Considering the inherent inefficiencies in running a compiled stack-based language on the Propeller at all, I'm quite happy that the Catalina/Propeller version comes in only around twice as large as the gcc/X86 version. Optimization is expected to improve this further over time.

All the game source code is provided. No changes to the original game are needed to compile the program under Catalina, but there are about 20 lines of platform specific code provided in the file 'catalina.c'.

The Propeller binary version of the game provided ('sst.bin') can only be run on a TriBladeProp (on blade #2), which must have 1Mb of XMM RAM and an SD card installed. To run the program, the files 'sst.bin' and 'sst.doc' should be copied to a micro SD card, and then the binary needs to be loaded using the Catalina Generic SD Card Loader (binary for this also provided).

If you would like to compare the catalina version with the gcc version, I have provided a simple batch file (' build_sst.bat') that will build the program using gcc - but a compiled version for Windows is also provided ('sst.exe')

Since the game expects a full size (i.e. 80 character) terminal, the Propeller version uses the PC as the screen and keyboard - you can use either the Parallax Serial Terminal, or PropTerminal running in normal terminal mode and set for 80 characters - or in fact any standard PC terminal emulator package.

The game also uses the SD Card during game play as a file system - this is used to hold the game on-line help file, and also to store and load saved games. Be aware that the file system access is quite slow, and it can take 10-15 seconds to display help information.

For more information about the game, see the file 'sst.doc'.

Happy Retro-Trekking!

Ross

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
zip
216K
stt.zip 216.1K

Comments

Sign In or Register to comment.