Copy Link
Add to Bookmark
Report
Saxonia Issue 04 Part 026
Mysteries 3
By Rumrunner/VOID
l
b00340104void-272-104.raw
In issue two of Saxonia, I wrote two articles named (surprise, surprise)
Mysteries one and two. This time, I though that I should share one of my
mistakes with you so perhaps you wont use too much time sorting it out if
you do the same mistake.
It started when I coded the new Voidcharts. I had some textroutines and
mouse/keyboardroutines in place, and I wanted to add a logo to the top of
the screen. It just so happens that in an Amiga, you have the magnificent
blitterchip and I decided to use this to copy the logo to the screen.
Now, the logo was in two bitplanes, you know me, I'm no graphician and I
wanted to use the copper anyway so I didn't need any more colours. I made
a simple routine that blitted the first bitplane to the screen and it all
worked out well. I then blitted the second bitplane to the screen, and
all of a sudden, the code locked the computer.
Right, I checked all of the regular sources for error first, like
destination adress and modulo. It seemed that the blitter didn't overwrite
any important data, so the error had to be somewhere else. I then checked
the registers and the settings. There were no errors. When removing the
part of the routine which blitted the second bitplane to the screen, it
worked again. There were no errors in the routine.
Having messed back and forth with the registers and adresses for some while,
I took a peek longer up in my code. There, I saw what was going on. I did
a bsr to the logoblitter before turning on any blitterdma. Switching
blitterdma on first solved the problem, and the routine worked correctly.
However, I still haven't found out what made the routine blit one bitplane
without blitterdma switched on. Perhaps it's some sort of timing, as in the
dma wasn't yet switched off after having taken over the computer. Those who
have been involved in programming the cia-registers know that you need
some waitroutines here, as the chips need the signal to be steady for some
time. Perhaps it's the same with the dmacon-register. That's my best bet,
but, like said, I'm not sure. Perhaps it's something else causing this.
I haven't spent too much time thinking about whether this can be useful
in some manners or not, but for those who are interested, some small pieces
of code in order to check this out using other registers might be something
to spend a few evenings on.