Jonne -
That looks great! Thanks for trying it out. I’m happy to see the game running on the real hardware.
> How hard was it to port it?
Actually, I “cheated”: I was already working on an Intellivision port of this game, so I had already had all the level data in a programmer friendly format.
So, all I had to do was to read the Pico-8 Lua code to see how the game worked, and then implement the same logic on the Pokitto using C and the Pokitto Api.
When programming the Pokitto, I just did things in the most straightforward way I could think of, and it seems to have worked out. I used draw bitmap calls to draw each grid of the background, and used floating point for the sines and cosines and subpixel movement. By changing the starting point of my background drawing routine, I automatically got scrolling!
(I initially wrote the code to draw the whole 16 square by 16 square background, and relied on bitmap clipping to handle the bitmaps that were completely off screen. I finally went back and changed the code to not try and draw bitmaps that were completely off the screen - why waste the time?)
In the original game, the grid and squiddy are 8 by 8 pixels in size.
This looked a little small on the simulator screen, so I sized them up to 10 by 10.
I drew the map using fill rectangle instead of the draw bitmap calls.
At first I wasn’t sure how big the map should be, so I passed in a parameter for the rectangle size so I could experiment with different sizes… Later I realized I could change this size and zoom the map up to full size, for a nice transition.
Problems:
- Bitmap rotation didn’t work, so I had to animate the arrows in 4 different directions. Maybe it’s faster this way - there must be some overhead to rotating bittmaps.
- Bitmap flipping has clipping bugs (in the simulator), so I couldn’t use that.
- One version of drawBitmap has an animation frame field to select different animation frames, but I couldn’t figure out what format the bitmap data needs to be in to make this work.
- The simulator seemed to support a maximum 20 fps rate, so I went with that.
- I haven’t tried sound yet, but some people say it doesn’t work in the simulator.
So, overall, it was a fairly easy port, and I am happy to see it running smoothly on real hardware.
I still don’t have a feeling for what a 48mhz Arm M0 processor can handle, but I look forward to finding out…
Catsfolly