The latest codebase runs on a MEGA2560 and reports: Sketch uses 32838 bytes (12%) of program storage space. Unfortunately, I couldn't quite get the game to fit into 32K. My goal of this little project was to hopefully get the Colossal Cave Adventure running on an Arduino UNO. I'm not sure that the same would be true in a terminal emulator at the moment as the serial handling code doesn't know what to do with the likes of the backspace/delete character. I've tested using the serial monitor in the IDE and things check out ok. You should now have all the files you need to begin exploring Colossal Cave. txt files copied onto your SD card: advent1.txt, advent2.txt, advent3.txt, advent4.txt & cave.txt.įinally, look in advent.h for SDCARD_CS_PIN and alter according to your setup. h files (advcave.h, advdec.h, avdef.h, advent.h, advtext.h, advword.h & proto.h) cpp files (database.cpp, english.cpp, itverb.cpp, turn.cpp & verb.cpp) + 7. In your sketch folder, create a new folder called advent. The code to run Colossal Cave on a MEGA2560 consists of 13 files. In my next post (hopefully post #2!) I will provide the files needed to run Colossal Cave on a MEGA2560 as well as the files that need to be copied onto an SD card. I’ve made no attempt to fix any bugs that may be lurking in the original code. Global variables use 2398 bytes (29%) of dynamic memory, leaving 5794 bytes for local variables.Īt this point, the game seems to run correctly as per the original in as far as I've ventured into the cave. Global variables use 8984 bytes (109%) of dynamic memory, leaving -792 bytes for local variables.Īfter even more tweaks to the way variables are stored as well as implementing a save and restore option, the latest attempt to run Colossal Cave on a MEGA2560 reported: Sketch uses 38508 bytes (15%) of program storage space. The compiler reported: Sketch uses 39314 bytes (15%) of program storage space. I moved the cave array into a text file called cave.txt and altered the code to use the text file as well as changing some variables from 16-bit integers to 8-bit integers. The text strings in advcave.h were first. So I moved away from the “all-in-one” option and looked into off loading game data onto the SD card. I had issues with that code as I discovered (after much searching) that storing data above the 64K barrier using PROGMEM was not advised as the C string handling routines didn't work on data above 64K. That resulted in 70-80K of downloadable code. The code used a pre-processor directive called BUILTIN to allow for a configuration where all the data was contained within the executable code. Global variables use 16256 bytes (198%) of dynamic memory, leaving -8064 bytes for local variables. Maximum is 253952 bytes.ĭata section exceeds available space in board I made some basic changes to read the game files from an SD card and disabled save and restore.Ī few tweaks and I got my first compilation without errors: Sketch uses 46488 bytes (18%) of program storage space. After some time I settled on the port that I found on Joachim Wiberg’s github page at GitHub - troglobit/advent4: Classic Colossal Cave Adventure I spent a bit of time searching for a port to C that would act as a suitable starting point for my attempt at an Arduino port. The original source code was written in ForTran of which I had a basic understanding of from my early days as a student. That got me thinking as to whether I could get Colossal Cave running on an Arduino. With the recent release of Colossal Cave 3D, it brought back memories of my early days in home computing and my first taste of interactive text adventures.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |