Dot draw on Amiga

Amiga dots

Dot draw on Amiga

  • Nils Thiebosch
  • 15-02-2023 05:28:06
  • 0 Comments

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

relevant Stories

Focus Design - Monotit, lines and arrows

Drawing lines on an Amiga

  • Nils Thiebosch
  • 15-02-2023 12:21:13
  • 0 Comments

Drawing lines is, when you work with vector graphics, necesairy. But it is also an expansive routine. 

Amiga OS

Intro startup assembly code

  • Nils Thiebosch
  • 01-06-2023 04:51:56
  • 0 Comments

When starting an intro on the amiga you want that all processes belonging to the OS are frozen and stored away.