Article 71192 of comp.sys.cbm:
Path: news.acns.nwu.edu!newsfeed.acns.nwu.edu!news.ece.nwu.edu!news.cse.psu.edu!uwm.edu!vixen.cso.uiuc.edu!howland.erols.net!europa.clark.net!news-feed.inet.tele.dk!uninett.no!news.uni-c.dk!diku.dk!alstrup
From: alstrup@diku.dk (Asger K. Alstrup Nielsen)
Newsgroups: comp.sys.cbm,comp.sys.sinclair
Subject: Re: Elite line routine (was Re: spectrum faster in 3D)
Date: 9 Jul 1997 12:43:23 GMT
Organization: Department of Computer Science, U of Copenhagen
Lines: 49
Sender: alstrup@tyr.diku.dk
Message-ID: <5q011b$m0p@vidar.diku.dk>
References: <33A9DD07.153E@skynet.be> <5pmm0e$1cm2@ds2.acs.ucalgary.ca> <5prb65$6i1@news.acns.nwu.edu> <33C21416.41C6@wi.leidenuniv.nl> <5pu309$96o@news.acns.nwu.edu>
NNTP-Posting-Host: tyr.diku.dk
X-Newsreader: NN version 6.5.0 #13
Xref: news.acns.nwu.edu comp.sys.cbm:71192 comp.sys.sinclair:41085

judd@merle.acns.nwu.edu (Stephen Judd) writes:

>The weirdest line idea I ever heard was to use an interrupt to step
>the pointer in the y-direction.

>Anyways, I look forwards to your routines!

It's not ridiculous to use the SID as line-plotter. In effect, the frequency
modulator works with the Bresenham algorithm, and the triangle waveform
is well suited for up to 8-bit precision lines. The problem is to map
the slope to a frequency, but it should be workable. You'll get the best
speed-up with a character-map, because the address-calculation is constant
time with the right setup (i.e. just an .y index).

So, in effect the line routine would be:

	set-up SID
	ldy $d41b ; or is it $d41c
	lda #$80
	ora charmap,y
	sta charmap,y
	ldy $d41b
	lda #$40
	ora charmap,y
	sta charmap,y
	ldy $d41b
	lda #$20
	ora charmap,y
	sta charmap,y
	...
	ldy $d41b
	lda #$01
	ora charmap,y
	sta charmap,y

	ldy $d41b
	lda #$80
	ora charmap+$80,y
	sta charmap+$80,y

	...

which works with a standard 16x16 character layout.

This method takes 4+2+5(?)+5 = 16 cycles per pixel, regardless of slope.

Greets,

Asger Alstrup


Article 71223 of comp.sys.cbm:
Path: news.acns.nwu.edu!merle!judd
From: judd@merle.acns.nwu.edu (Stephen Judd)
Newsgroups: comp.sys.cbm,comp.sys.sinclair
Subject: Re: Elite line routine (was Re: spectrum faster in 3D)
Date: 10 Jul 1997 02:27:13 GMT
Organization: Northwestern University, Evanston, IL
Lines: 22
Message-ID: <5q1ha1$spl@news.acns.nwu.edu>
References: <33A9DD07.153E@skynet.be> <33C21416.41C6@wi.leidenuniv.nl> <5pu309$96o@news.acns.nwu.edu> <5q011b$m0p@vidar.diku.dk>
Reply-To: sjudd@nwu.edu (Stephen Judd)
NNTP-Posting-Host: merle.acns.nwu.edu
Xref: news.acns.nwu.edu comp.sys.cbm:71223 comp.sys.sinclair:41120

In article <5q011b$m0p@vidar.diku.dk>,
Asger K. Alstrup Nielsen <alstrup@diku.dk> wrote:
>judd@merle.acns.nwu.edu (Stephen Judd) writes:
>
>>The weirdest line idea I ever heard was to use an interrupt to step
>>the pointer in the y-direction.
>
>It's not ridiculous to use the SID as line-plotter. In effect, the frequency

An intriguing idea.

>So, in effect the line routine would be:
>
>	set-up SID

How does one initialize the voice 3 waveform register?

-S

>Asger Alstrup




Article 71334 of comp.sys.cbm:
From: =?ISO-8859-1?Q?Marko_M=E4kel=E4?= <root+hates+spammers@warez.blackdown.org>
Newsgroups: comp.sys.cbm
Subject: Re: Elite line routine (was Re: spectrum faster in 3D)
Date: 11 Jul 1997 00:28:33 +0300
Organization: Helsinki University of Technology, CS lab
Distribution: world
Message-ID: <87u3i2vbpa.fsf@sranje.tky.hut.fi>
References: <33A9DD07.153E@skynet.be> <33C21416.41C6@wi.leidenuniv.nl>
	<5pu309$96o@news.acns.nwu.edu> <5q011b$m0p@vidar.diku.dk>
	<5q1ha1$spl@news.acns.nwu.edu>
NNTP-Posting-Host: sranje.tky.hut.fi
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Original-Sender: postmaster@[127.0.0.1]
X-Newsreader: Gnus v5.3/Emacs 19.34
Path: news.acns.nwu.edu!newsfeed.acns.nwu.edu!news.luc.edu!chi-news.cic.net!newsrelay.netins.net!mr.net!europa.clark.net!dispatch.news.demon.net!demon!bullseye.news.demon.net!demon!news2.euro.net!news.euro.net!news3.euro.net!news.bru.tfi.be!nntp.inet.fi!news.funet.fi!news.cs.hut.fi!not-for-mail
Lines: 19

>>>>> "Steve" == Stephen Judd <judd@merle.acns.nwu.edu> writes:

Steve> How does one initialize the voice 3 waveform register?

Hmm, I think that I have an example of that somewhere (how to write a
desired value to the OSC3 register by starting the sawtooth waveform
and turning the frequency to 0 when the correct value is reached), but
I can't find it.  Anyway, you have to set the waveform register of
voice 3 to $20 (or $21, the gate bit shouldn't matter).  That's it!
You don't need to set the ADSR or anything, since you don't need (or
want) to hear any sound.

Anyway, I think that this idea that Asger presented is very cool.  Was
it actually used in any demo or game?

	Marko
-- 
Marko Mäkelä < Marko.Makela @ HUT.FI >, http://www.hut.fi/~msmakela/
Helsinki University of Technology, dept. of Computer Science


Article 71369 of comp.sys.cbm:
Path: news.acns.nwu.edu!merle!judd
From: judd@merle.acns.nwu.edu (Stephen Judd)
Newsgroups: comp.sys.cbm
Subject: Re: Elite line routine (was Re: spectrum faster in 3D)
Date: 12 Jul 1997 21:02:31 GMT
Organization: Northwestern University, Evanston, IL
Lines: 30
Message-ID: <5q8rd7$k01@news.acns.nwu.edu>
References: <33A9DD07.153E@skynet.be> <5q011b$m0p@vidar.diku.dk> <5q1ha1$spl@news.acns.nwu.edu> <87u3i2vbpa.fsf@sranje.tky.hut.fi>
Reply-To: sjudd@nwu.edu (Stephen Judd)
NNTP-Posting-Host: merle.acns.nwu.edu

In article <87u3i2vbpa.fsf@sranje.tky.hut.fi>,
=?ISO-8859-1?Q?Marko_M=E4kel=E4?=  <root+hates+spammers@warez.blackdown.org> wrote:
>>>>>> "Steve" == Stephen Judd <judd@merle.acns.nwu.edu> writes:
>
>Steve> How does one initialize the voice 3 waveform register?
>
>Hmm, I think that I have an example of that somewhere (how to write a
>desired value to the OSC3 register by starting the sawtooth waveform
>and turning the frequency to 0 when the correct value is reached), but

That's what I was thinking -- busy-loop wait until the correct value
appears, and pray.  Any idea on how long one would have to wait?

Also, is it at all clear that any line slope can be computed in this
way?  That is, if each "loop iteration" (LDA #$40 STA blah,y) takes
six cycles, doesn't that limit the slopes to some factor of six?

Or, to put it another way, it seems to me that each cycle the waveform
counter increases by a certain amount, x

	c=c+x

So after every six cycles we've increased by 6x, so a very specific
family of sequences is generated.

Also, clearly a different method is needed for lines which move in
the y-direction (i.e. slopes >1).

-S



Article 71370 of comp.sys.cbm:
Path: news.acns.nwu.edu!merle!judd
From: judd@merle.acns.nwu.edu (Stephen Judd)
Newsgroups: comp.sys.cbm,comp.sys.sinclair
Subject: Re: Line routine in hardware
Date: 12 Jul 1997 21:18:56 GMT
Organization: Northwestern University, Evanston, IL
Lines: 45
Message-ID: <5q8sc0$kc8@news.acns.nwu.edu>
References: <33A9DD07.153E@skynet.be> <5q011b$m0p@vidar.diku.dk> <5q1ha1$spl@news.acns.nwu.edu> <33C6849F.4D9A@chebucto.ns.ca>
Reply-To: sjudd@nwu.edu (Stephen Judd)
NNTP-Posting-Host: merle.acns.nwu.edu
Xref: news.acns.nwu.edu comp.sys.cbm:71370 comp.sys.sinclair:41295

In article <33C6849F.4D9A@chebucto.ns.ca>,
George Taylor  <aa601@chebucto.ns.ca> wrote:
>> >judd@merle.acns.nwu.edu (Stephen Judd) writes:
>> >
>> >>The weirdest line idea I ever heard was to use an interrupt to step
>> >>the pointer in the y-direction.
>> >
>> >It's not ridiculous to use the SID as line-plotter. In effect, the frequency
>(Asger alstrup comments:)
>> An intriguing idea.
>> 
>> >So, in effect the line routine would be:
>> >
>> >       set-up SID
>> 
>> How does one initialize the voice 3 waveform register?
>> 
>> -S
>> 
>> >Asger Alstrup
>Stephen Judd is referring to an idea I have mentioned to him,
>about using hardware tricks to draw lines.

Quite right.  But, I have a simple policy concerning ideas: until I see
an implementation, I assume they don't work.

:)

>And finally, in terms of elite line routines, take a look

Actually the title is "Elite line routine", i.e. originally it was the
routine from "Elite", not 3l1+3 lines -- just wanted to get that straight :).

>at the last traktor III.  In the vector part, there is a line
>routine which takes 21/24 cycles.  There is a big unrolled loop,

Does it handle all lines or only lines of particular slopes, and how
much memory does it use?

BTW, I just finished up my new polygon renderer, and man oh maneschewitz
is it cool (and only 5k, too) -- it might even be faster now than the
polygonamy renderer.  It draws to the bitmap and can render full-screen,
off-screen, ice-cream... sssssssmokin'!

-S


Article 71418 of comp.sys.cbm:
Path: news.acns.nwu.edu!newsfeed.acns.nwu.edu!news.ece.nwu.edu!news.cse.psu.edu!rutgers!news.sgi.com!newsfeed.nacamar.de!news.apfel.de!fu-berlin.de!cs.tu-berlin.de!uni-duisburg.de!RRZ.Uni-Koeln.DE!news.rhrz.uni-bonn.de!usenet
From: klee@sunrise.informatik.uni-bonn.de (Oliver Klee)
Newsgroups: comp.sys.cbm,comp.sys.sinclair
Subject: Re: Line routine in hardware
Date: Sun, 13 Jul 1997 19:22:40 GMT
Organization: RHRZ - University of Bonn (Germany)
Lines: 25
Message-ID: <33c921c5.5900464@news.informatik.uni-bonn.de>
References: <33A9DD07.153E@skynet.be> <33C21416.41C6@wi.leidenuniv.nl> <5pu309$96o@news.acns.nwu.edu> <5q011b$m0p@vidar.diku.dk> <5q1ha1$spl@news.acns.nwu.edu> <33C6849F.4D9A@chebucto.ns.ca>
NNTP-Posting-Host: rhrz-isdn2-p24.rhrz.uni-bonn.de
X-Newsreader: Forte Free Agent 1.1/32.230
Xref: news.acns.nwu.edu comp.sys.cbm:71418 comp.sys.sinclair:41351

On Fri, 11 Jul 1997 16:08:15 -0300, George Taylor
<aa601@chebucto.ns.ca> wrote:

>I also thought of using the sid waveform registers to do lines,
>once you set the correct frequency, which is synchronized
>to the line routine, simply lda waveform3 and no need to
>increment a register.  However, this isn't useful either,
>because there are better routines.

Another problem would be the following:

a) You need a very exact timing for the routine, and it shouldn't get
interrupted.

b) The VIC takes 40 cycles at each char line when it's on.

c) To have the drawn lines visible, the VIC has to be turned on.

So this routine only works outside the screen or between the memory
accesses by the VIC.

.    Oliver Klee / Master's Design Group
..                 musician, journalist & programmer
...  klee"AT"sunrise.informatik.uni-bonn.de
....      ^^ (replace with "@")


