Copy Link
Add to Bookmark
Report
Saxonia Issue 04 Part 027
![eZine's profile picture](https://www.neperos.com/profile_images/710b67/eZine_pz94a41d548ccb10.jpg)
Yet more mysteries
By Rumrunner/VOID
l
When I coded the first issue of Versus, the chart made in cooperation
between us in Void and Nukleus, I came across a rather strange (or perhaps
not so strange) phenomenon.
Well, it all worked good until I added some music. What happened was that
once in a while, the computer crashed. I lost no code, as I'm used to save
everytime before running changed code, something every assemblycoder soon
learns to do. What was strange was that when adding some code, the mag
hung upon exit, even if the code wasn't run. Adding other code that did
run fixed it until yet more code was added and so on it went.
Well, I had to find out about this one before doing much else, since it
was almost impossible to work with the code. The mag ran fine, but the
crash and guru entered upon exiting.
Finally, after looking through my interrupts and whatever was run outside,
I finally found the bug. I use the old ciamusic.s Protrackerreplayer which
Lars "Zap" Hamre coded back in the good old days. It seems that this
player messes up some bytes after the module. It doesn't always occur,
that's what's strange. I haven't looked into the replaycode, but my best
bet is that perhaps some calculations fail when the module is not
longword-aligned (it's always word-aligned ofcourse). You know, it's always
fun to find solutions to a problem that takes less rastertime, and when
it works when you work with it, you don't think about such problems.
Since Versus is a production running from file, it can be allocated into
whatever memory the operating systems finds, ofcourse separated by
sections demanding certain types of memory (chip or fast), so my problem
should not happen all the time, since it's not very likely that it will be
loaded at the same position all the time. However, in my case, ofcourse
it was loaded at the same position, when the computer first hung, I loaded
the same programs again from the start, so the same memoryareas were free.
Well, the problem was easy to solve when I first found it, I didn't bother
looking into the replayerroutine, I really don't like to change code that
has been with us for so long. What I did was simply to reserve some bytes
right after the module, and this magically solved the problem.
Having found out that, I also found out that this was the very same thing
that caused the Christmas Intro I once released to hang sometimes. Strangely
enough, I have the feeling it doesn't happen so often there, but why wonder
when a simple blk.b (dcb.b if you prefer DevPac) solves it all?