Colossal Cave Adventure on AtMega2560

Hello Community,

wanted to show you this project. Its the port of this epic first text adventure for AtMega2560, without the use of a sd-card, i placed all the strings in (far pointer) prog mem. It has some bugs still, the earliest one is described as a issue, but the most of the work is done. I renamed also everything for better readability.
It is running with less then 1,5kB Ram, there is enough free Ram for improvements.

It is under Unlicense and everybody is welcomed to contribute.

If anybody find the reason for the bug, it would be very nice, maybe its only a simavr-bug, but i dont have a actual AtMega2560 at my hands atm. Maybe somebody will try with its own.

regards and have fun with this awesome game,
Ingmar

I also improved my small dwarfOS in the progress of porting. It's thought as separation of concerns. Management of far pointer string loading, a simple from 7 byte up to 240 dynamically resizing circular stdin input buffer with less as possible overhead, a clock modul,etc, this stuff goes there. And I will integrate unity to run the tests directly in simavr, so flashHelper will vanish, it was thought as a layer where I can insert a mock implementation that dont need the avr-gcc, for running tests on the desktop. But I have enough free ram for unity even on a atmega328p with this OS. Code is incredibly unreadable if you try to make cross compilation happens with a lot of #ifdef. The OS will get some cleaning in the near future. Look also into the DwarfOS, it's really small for its capabilities.

I looked more into the issue, but still didnt found the bug. From cave 1 with "s\n" i travel to 4 as expected, with "s\n", travel to 7 as expected, could still call getCave(8) in this moment, but i when i call getCave(7), travel to 8 as expected, and then try to get to 5 with "s\n", simavr crashes sadly when calling getCave(8), deep inside malloc or strcpy_pf. So the game itself acting as expected with the routing, its just a bug, maybe only in simavr.

EDIT:
"CORE: *** Invalid write address PC=17c34 SP=210e O=9381 Address 3632=63 out of r
am
avr_sadly_crashed"

The stackpointer is after 4 turns when calling getCave the 5th time near the upper boarder 2200 of the RAM, but between the turns i measure 6,5kb free Space between Stackpointer and Heap. It somehow consumes 6kB Ram when diving into this functions then or the simulator doesnt reset the stackpointer correctly when its coming back from functions?

Wont push this to a repo, but if you need a KISS idea for mocking the serial connection without the trouble to make the complete setup in simavr.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.