Re: A89: Trouble with grayscale graphics


[Prev][Next][Index][Thread]

Re: A89: Trouble with grayscale graphics




>This program is supposed to display a 16 pixel line in the upper
>left-hand corner of the screen.  Half of it should be black, the other
>half gray.  What I actually get is a 4 pixel long(I think) black line
>that is about 4 pixels to the right of the upper-left hand corner.  I
>also get a whole lot of garbage(random lines, old screens, etc.)
>displayed in gray.  The program was compiled with plusshell.  By the
>way, all I did to install plusshell was transfer the libraries(seems
>to work for tetris, nibbles, etc.).  Any help would be appreciated.

The garbage is probably due to the fact that you don't clear the 2nd bitplane.
The second problem is that you put #7 (so %00000111 in binary), so that
only 3 pixels are set.
Anyway, here is a corrected version of your program (for DoorsOS):
       include "doorsos.h"
	include "graphlib.h"
	include "userlib.h"
	xdef	_ti89
	xdef    _main

_main:
	jsr	graphlib::clr_scr
	jsr	graphlib::gray4	
	move.w	#1,graphlib::choosescreen	;set graphlib functions to use a1 as
video memory adress

       move.l  graphlib::plane1,a1	;loads adress of the 2nd bitplane in a1
	jsr	graphlib::clr_scr	;clears the 2nd bitplane
	

	move.l  graphlib::plane0,a0	;loads adress of the 1st bitplane in a1
	move.b	#$FF,(a0)	;
	move.w #$FF,(a1)	;cause low gray
	
	jsr	userlib::idle_loop
	clr.w	graphlib::choosescreen	;restore this var to 0
	jsr	graphlib::gray2		;grayscale off
	rts

	end

I didn't test this program but i think it should be what you wanted.

Hope this helps..




Xavier VASSOR
---The Doors Team
E-mail:xvassor@mail.dotcom.fr
Doors Homepage: http://doorshome.home.ml.org
ICQ:10241721


References: