Several weeks ago, Alessandro De Luca posted his SPIN port of the Gameduino driver object for the Propeller. Being written in SPIN these drivers were, of course, many times slower than the Arduino. (To be expceted comparing an interpreted program to a compiled program.)
At that time I took it upon myself to begin the task of writing PASM Gameduino drivers. This is my first big project in 100% PASM and I have learned an immeasurable ammount about the Propeller and PASM in the process. There were many times in the process when I was frustrated with the Propeller. But once I got the hang of it, it's now become addictive. Most of the frustration came from having to un-learn habits and misconceptions picked up from previous architectures. I've spent a shamefully large amount of time on this, but it was hopefully worth it.
I welcome those seasoned PASM coders to have a look at GD_ASM and offer any suggestions. It is being released now in BETA form along with many of the Gameduino demos and utilities ported to SPIN. The PASM driver uses most of a cog (482 longs) but I'm confident that could be shaved down some.
This version is missing the "assets" method which is used to load some on-bard images and sounds from the Gameduino's Flash. That is next on the to do list.
There may be only one person interested in these drivers at present. But hopefully this should draw some attention to the Propeller in general and the Propeller ASC in specific.
Below are some video demos of the Propeller driving the Gameduino's various functions. These videos aren't really any different than the ones already on YouTube. They only serve to prove.
GD_BoingBall.spin: This is the famous bouncing ball demo. You can see it's a little slower than the Arduino version, but I'm confident that could be sped up with a little work on the demo code.
GD_scroll.spin: Demonstrates drawing randomly placed background elements and scrolling them through the screen while waiting on the video blanking. The occasional stutter you see in the video is from the camera and encoding. The output is liquid smooth.
GD_player.spin: Shows off the Propeller sending commands to the Gameduino's 64 audio voices. This demo has a small bug in that when cnt
rolls over the playback skips/hangs. Since tempo is critical in this kind of app, a cog could be dedicated to keeping an accurate millis() count going. Then this tune could play for about 40 days before a glitch! (ears bleed)
GD_sprites256.spin: How about 256 sprites all on the screen at once? The Propeller barely breaks a sweat with this one.
GD_collision.spin: This one is my favorite. Parallax's awesome float32 object handles the complicated floating-point math (sin & cos) necessary to calculate trajectories and velocities of 40 sprites every frame. This one was also the most difficult to get working right. Take a look at that collide() function!
I added a function to GD_ASM specifically for the Propeller:
load_hub(adr, ptr, count)
This method quickly copies a section of Gameduino's hardware RAM to an array you define in hub ram.
is the point in Gameduino RAM to begin reading
is an address in hub RAM to begin copying to
is how many bytes to copy
example: will copy all 256 sprite's collision bytes to an array (col) in hub ram
GD.load_hub(GD#COLLISION, @coll, 256)
example: will copy sprite 56's collision byte to the var "onesprite"
GD.load_hub(GD#COLLISION+56, @onesprite, 1)