Weekly Update – seg-faulty code

Welcome

This week is a bit weird for timing, so this update is sort of in the middle of my work cycle. As such, it’s going to be a short couple of updates.

Firstly, I want to update the diagram for sprites to reflect a more clear explanation of cycles within sprites:

And to make that diagram easier to understand, here’s a sketch of the memory arrangement for only cycles:

And if they still don’t make a ton of sense, that’s okay. They are not the most clearly defined structures. I should also note that for ScummVM I am skipping the extra indirection from the CycID indexing a pointer table to then index cycles. Instead I am using CycID as the direct index into CycHeap. This is simply to keep things more readable, as we no longer need to worry about being in 8bit mode when trying to access CycHeap.

One other thing worth noting in this in-progress update, is that I spent a while dealing with a segfault error today. The moral of the story is to always initialize primitive memory, even if you aren’t using it yet. I was not yet using the variable that gives _currentRoom its value when I created it. However I was now using _currentRoom to index the room list, and instead of 0-7, I was occasionally getting completely random numbers, running off the end of the table.

Otherwise, I’ve implemented cycles, lots of the room skeleton, and am almost finished implementing fset.GS, which are the torches. Progress is being made, but hopefully I will have another update within a few days, depending on my work schedule.

Thanks for reading this quick update!

Leave a comment

Your email address will not be published. Required fields are marked *