Dot draw on Amiga
Drawing dots is relative easy and there are multiple ways to do it on the Amiga. This is my dot-draw routine. Nothing fancy.
A1 has a list sums of nr_of_pixels/8 bytes multiplied by Y.
The reason why I pick the Y offset is that a mulu #40, d2 is more expensive to use as add d1,d1 and move (a1, d1.w), d1.
And for the add.w d1,d1 is because the data list of a1 consists of words.
** ------------------------------- **
** d0, d1 = X, Y
** a0 = Bitplanes
** a1 = MuluTable
** ------------------------------- **
DotDraw: move.l a0, a2
add.w d1,d1
move.w (a1,d1.w), d1
move.w d0, d2
asr.w #3, d2
add.w d2, d1
add.w d1, a2
and.w #$7, d0
move.b DotMask(pc,d0.w), d0
or.b d0, (a2)
rts
DotMask: dc.b 128,64,32,16,8,4,2,1
** -------------------------------
**
** ------------------------------- **
MakeMuluTable: lea MuluTable, a0
moveq #0,d0
move.w #screenHeight-1, d1
.0 move.w d0, (a0)+
add.w #screenWidth, d0
dbf d1, .0
rts
MuluTable: dcb.w screenHeight, 0
There maybe not the most clean version but this will do
0 Comments