Re: A89: 7-level Grayscale


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

Re: A89: 7-level Grayscale



Thank you for your help!!  But I still can't get it to work.  Although the
program now runs with all of the code assembled, it won't do 7 grey bars
like it's programmed to... it only displays 4...  I don't expect you to
reply, but I would like to listen to any advice that anyone is willing to
give.

-Miles Raymond      EML: m_rayman@bigfoot.com
ICQ: 13217756       IRC: Killer2        AIM: MRayMan
http://www.bigfoot.com/~m_rayman/

-----Original Message-----
From: philippe gervaise <Philippe.Gervaise@epita.fr>
To: assembly-89@lists.ticalc.org <assembly-89@lists.ticalc.org>
Date: Tuesday, February 02, 1999 3:48 AM
Subject: Re: A89: 7-level Grayscale


>According to Miles Raymond:
>
>> Can someone try to help me understand grayscale (greyscale?) with the =
>> attached file??  I've been trying at this simple program all day...
>>
>> -Miles Raymond      EML: m_rayman@bigfoot.com
>> ICQ: 13217756       IRC: Killer2        AIM: MRayMan
>> http://www.bigfoot.com/~m_rayman/
>>
*CLIP*
>
>CandyMan
>
>http://www.i-france.com/candyman
>candyman@I-france.com
	include "doorsos.h"
	include "graphlib.h"
	include "userlib.h"
	xdef    _ti89
	xdef    _comment
	xdef    _main
_main:
	jsr	graphlib::gray7		;switches to 7 grayscale mode
	move.w	#1,graphlib::choosescreen	;set all graphlib functions to grayscale

	move.l	graphlib::plane0,a1	;address of the 1st bitplane (plane0)
	jsr	graphlib::clr_scr	;clears the first bitplane (main screen)
	move.l	graphlib::plane1,a1	;address of the 2nd bitplane (plane1)
	jsr	graphlib::clr_scr	;clears the second bitplane
	move.l	graphlib::plane2,a1	;address of the 3rd bitplane (plane2)
	jsr	graphlib::clr_scr	;clears the third bitplane

	move.l	graphlib::plane0,a0	;address of the 1st bitplane
	lea	1500(a0),a0		;50th line (50 * 30 = 1500)
	move.w	#374,d0			;why 374???
\loop1	move.l	#$FFFFFFFF,(a0)+	;why #$FFFFFFFF and not #$FFFF?
	dbra	d0,\loop1		;374 times?  why?

	move.l	graphlib::plane1,a0	;address of the 2nd bitplane
	lea	750(a0),a0		;25th line (25 * 30 = 750)
	move.w	#374,d0
\loop2	move.w	#$FFFF,(a0)+		;put black over the next 25 lines
	dbra	d0,\loop2

	move.l	graphlib::plane1,a0	;address of the 2nd bitplane
	lea	2250(a0),a0		;75th line (75 * 30 = 2250)
	move.w	#374,d0
\loop3	move.w	#$FFFF,(a0)+		;put black over the next 25 lines
	dbra	d0,\loop3

	move.l	graphlib::plane2,a0	;address of the 3rd bitplane
	lea	360(a0),a0		;12th line (12 * 30 = 360)
	move.w	#374,d0
\loop4	move.b	#$FF,(a0)+		;put black over the next 12 lines
	dbra	d0,\loop4

	move.l	graphlib::plane2,a0	;address of the 3rd bitplane
	lea	1110(a0),a0		;37th line (37 * 30 = 1110)
	move.w	#374,d0
\loop5	move.b	#$FF,(a0)+		;put black over the next 12 lines
	dbra	d0,\loop5

	move.l	graphlib::plane2,a0	;address of the 3rd bitplane
	lea	1860(a0),a0		;62th line (62 * 30 = 1860)
	move.w	#374,d0
\loop6	move.b	#$FF,(a0)+		;put black over the next 12 lines
	dbra	d0,\loop6

	move.l	graphlib::plane2,a0	;address of the 3rd bitplane
	lea	2610(a0),a0		;87th line (87 * 30 = 2610)
	move.w	#374,d0
\loop7	move.b	#$FF,(a0)+		;put black over the next 12 lines
	dbra	d0,\loop7

; planes:	 0 1 2
		;0 0 0
		;0 0 1
		;0 1 0
		;0 1 1
		;1 0 0
		;1 0 1
		;1 1 0
		;1 1 1

	clr.w	graphlib::choosescreen	;set all graphlib functions to Black and White mode
	jsr	userlib::idle_loop	;waits for a key
	jsr	graphlib::gray2		;restores Black and White mode
	rts


_comment   dc.b    "Gray7 test",0
        end

Follow-Ups: