Taipan! on the Arduino(s). Part 6.

July 5th, 2012

Small update tonight. The hollow book is now ready to be used as an enclosure.

IMG_2582_1 Book for enclosure.

I would put the dust jacket back on it but now the rear cover is glued to the pages you can’t! Need to think about that one.

I also finished adding in the sound effects in the appropriate place. I went through the original Apple 2 source and simply figured out where the sounds are played by looking for the calls to the assembly language code. As I had already done half the sounds already it was easy to match up what calls were what sound effects. If you are reading though the original Apple source the sounds are played via code such as: CALL 2518

I should have done it that way to start with!

After having done that I still had 900 bytes or so free program memory but unfortunately the game wouldn’t run. Once again I had run out of SRAM. I had less that 100 bytes free there. So once again I had to optimise somewhat. I went through the code and found any remaining large strings and put them into the program memory. So things like commands to clear parts of the screen or draw rectangles are now done in functions that pull the appropriate command strings from program space. Remember hard coded strings on the Arduino use up BOTH program space and SRAM unless you use tricks.

Doing that used a little more program memory (Binary sketch size: 31,644 bytes (of a 32,256 byte maximum)) but I now have 605 bytes of SRAM free so the game can run.

Still need to do some more play testing (especially around the throw cargo option) but we’re nearly there.

2 Responses to “Taipan! on the Arduino(s). Part 6.”

  1. doug pengelly Says:

    neat, i used to play taipan on my apple ][+
    I found a neat trick: if you paid off your loan to the bank with more money than you owed, it would accrue intrest to your account, at the loanshark rate it charged when you borrow.
    in the end you made more money in compound interest than in trading.
    gives a young mind insight into the real world…

  2. Simon Says:

    Yes, my version has the same ‘bug’. I made sure the behaviour is the same. It’s the load you get form Elder Brother Wu. There are a few other interesting things in there. When you get attacked by pirates how quickly you issue orders affects whether or not you get to fire the first shot or not. I always assumed the port didn’t make any difference to the prices but each port does have slightly different base values for things.