Re: [stella] Driving controller multitap

Subject: Re: [stella] Driving controller multitap
From: "Thomas Jentzsch" <tjentzsch@xxxxxx>
Date: Wed, 25 Feb 2004 14:46:36 +0100
KirkIsrael wrote:
> How much time does paddle reading take out of the kernal?  

Hard to say. Depends on how often you want to check (see below).
All you have to do is:
  read register (INPT0..INPT3)
  skip if (not) changed
  remember scanline counter

This will require at least 8 cycles if the scanline counter is already in a 
register and is updated anyway. If not, you will have to load and 
increment it, so you will need up to 16 cycles.


> How often do you have to check?  

Depends on the resolution you need. If you only need e.g. 10 different
values, you only have to check 10 times. For a game like Kaboom! with
single precision horizontal positioning, you have to poll ~160 times
each frame.

The time intervall between those checks should be (almost) identical, 
else the control will become "strange". Only because the kernel usually 
provides those constant time intervalls for a quite long time, the paddle 
checks are always(?) done inside the kernel. 

And for a game with multiple paddles you can e.g. check the paddles only
every 4th frame. This should work for almost all games, except maybe very
for very fast games like Kaboom! or SCSIcide.

But though you will have less checks inside the kernel, the check itself will
take longer then:
  load paddle index
  read register (INPT0,x)
  skip if (not) changed
  remember scanline counter

And since you need either X or Y and A (you can not use BIT anymore), this
will most likely have some more negative timing impact on your kernel.

> I guess there's no way to do it during VBLANK?

Only if you need only very few different values and are able to poll the 
hardware registers in constant intervalls. 

And the smaller the total polling intervall is, the smaller the corresponding 
paddle angle will become.

E.g. You could poll the paddle 50 times during just 500 cycles. Then you will 
get 50 different values (unless there are some hardware limitations I am 
unaware of), but it takes only a very small turn on the paddle to get from
0 to 50. And this area is on a fixed position, so left or right of that small
angle the paddle won't react at all. 

I have recently analyzed a few paddle games. Some where polling the paddle 
very often, others used the vertical separation blocks for just a few polls. 
Some polled always the same paddle, others polled each paddle every nth 
frame and then there was a game where all paddles where polled within
one frame. So it just depend on the game. :-)
 
Have?fun!
Thomas
_______________________________________________________
Thomas?Jentzsch?????????|?***?Every?bit?is?sacred?!?***
tjentzsch?at?web?dot?de?|



























______________________________________________________________________________
Extra-Konto: 2,50 %* Zinsen p. a. ab dem ersten Euro! Nur hier mit 25
Euro-Tankgutschein & ExtraPramie! https://extrakonto.web.de/?mc=021110

----------------------------------------------------------------------------------------------
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/


Current Thread