Vintage Palmtops Tips & Tricks

3Jul/110

Programming graphics on Portfolio, part 1

One of Atari Portfolio's weak points is the graphics. Not only has Portfolio very modest graphics capabilites (what can be understood), but also is hardly compatible with PCs. I think this is why there were so few games written for Pofo (Folidash and Phoenix are two of them).

There are two ways to display graphics on Portfolio: using interrupt 10h or sending data directly to the graphics controller. The former is very slow, so it's only intended to use when you want to introduce simple graphic elements (e.g. in board games), but its advantage is the compatibility - you'll be able to run your program on a PC. The latter is much faster - it's actually the only way to program animations - but your code will hang the PC.

Using int 10h is also much easier. If you want to draw an oblique line, you may type:

	mov ax, 4	; set graphics mode 4
	int 10h
	mov cx, 0	; initial X coordinate
	mov dx, 0	; initial Y
loop:	mov ax,0c01h	; set pixel
	mov bh, 0
	int 10h
	cmp cx, 63
	je end
	inc cx
	inc dx
	jmp loop
end:	mov ah, 1	; wait for a keypress
	int 21h
	mov ax, 7	; set graphics mode 7
	int 10h
	int 20h		; exit to DOS

 
Go to part 2