PDA

View Full Version : Exceeding Longs



Komaru
03-21-2009, 07:33 AM
Once again, I'm fairly new to the Propeller Chip, but have been coding for quite a long time.
This time, I'm trying to develop a platformer game on the Hydra. (Ooh, scary.) But, I'm usually used to being able to code stuff in separate parts, but then combine everything in one file. This has sort of become a problem, because although I'm working with the largest chip Parallax offers, I'm still having problems with the file exceeding memory by x amount of longs.
The weirdest thing is that I would have one file that says has 3,000 or so longs available, yet when I add a single line of code, it says it exceeds it by say, 200 longs.
So, anyone know of any sort of larger chip or a way around this problem? This project is kinda big, and would help me tons with any other projects, so any help would be appreciated.
Thanks!

~Komaru

Mike Green
03-21-2009, 07:54 AM
1) There is only one size Propeller. There's a larger, faster one under development, but it's a long way off. There's no point in waiting for it to fix your problem.

2) There may be things you can do to reduce the amount of space your program uses. You'd need to post your program as an attachment to a message (Do Not Cut and Paste a large program into a Message!)

3) If your program can be split into several separate programs, you might be able to use an SD card or a large EEPROM to store what are essentially overlays.

Komaru
03-21-2009, 08:10 AM
Ah, thanks!
The EEPROM was what I was talking about, not the actual Propeller Chip. Sorry for the misunderstanding.
But I'll try out the SD card reader.
There's not really much to actually post of my program, as it's just some text and music in the background- Which is why I was confused about it running out of memory.
Well thanks again for your help, I'll make sure to keep a lookout for a larger EEPROM card.

Mike Green
03-21-2009, 09:02 AM
Actually, you can substitute a 128K EEPROM for the normal 32K EEPROM and get an extra 96K of space. You can even add additional EEPROMs to the same I/O pins (28 & 29) to get up to 512K of EEPROM space. The Propeller Tool won't see anything beyond the 1st 32K, but there are objects in the Object Exchange that you can use to store data in the extra EEPROM space or additional programs. I wrote what I called an operating system for the Propeller that could store programs in 32K "pages" in EEPROM, each with a name and you could execute them by name. There were utility functions for copying the contents of RAM or the 1st 32K of the EEPROM to other 32K "pages". The I/O routines could be called from your program if you wanted to use a 32K "page" for data.

There's another "propDOS" available that does the same sort of thing using files on an SD card. FemtoBasic and its derivatives can also run Spin or assembly programs from an SD card in addition to interpreting simple Basic programs.

Komaru
03-21-2009, 10:58 PM
Thanks, Mike.
I'm pretty sure I still have FemtoBasic somewhere, so I'll try that.