Subject: Re: Spectrum Emulator for C64 [additonal translation]

From: [email-masked] (Spike)
Date: 11 Jun 1997 12:47:07 GMT

Jason ([email-masked]) wrote:
: We can assign a whole 2K (256 character) font to that purpose and, if need
: be, we can use multiple fonts.  There are 27 possible charsets available...

We can redesign every printable character as well, apart from special
tokens, like keywords.
(In other words, big deal, we don't get the full 256, but we could quite
easily set up multiple font tables and have the computer access all of them
when needed, and as each font only takes up about 800 bytes, we'd have a LOT
of space for a large font bank.....)

(It's just a matter of POKEing a couple of system variables that point to
the font)
-- 
|                          |What to do if you find yourself stuck in a crack|
[email-masked]|in the ground beneath a giant boulder, which you|
|                          |can't move, with no hope of rescue.             |
|Andrew Halliwell          |Consider how lucky you are that life has been   |
|Principal Subjects in:-   |good to you so far...                           |
|Comp Sci & Electronics    |   -The BOOK, Hitch-hiker's guide to the galaxy.|
-----------------------------------------------------------------------------
|GCv3.1 GCS/EL>$ d---(dpu) s+/- a- C++ U N++ o+ K- w-- M+/++ PS+++ PE- Y t+ |
|5++ X+/++ R+ tv+ b+ D G e>PhD h/h+ !r! !y-|I can't say F**K either now! :( |

---

From: Jason <[email-masked]>
Date: Sun, 22 Jun 97 15:57:36 GMT

The Starglider:
> You obviously haven't seen uridium on the spectrum then (SMOOOOOTH!).

Marc Walters:
> Hmmm, You obviously haven't seen Uridium on the C64 then (SMOOOOTHER!).

The Starglider:
> Erm, I have, and nope, it didn't look any different to me.

Have you considered an eye test?  If you really think there's no difference
between 17FPS and 50FPS I'll happily put together a little routine to
put both on the screen at once and show you... =-)
--
Jason  =-)
     _______________________________________________________________________
TMR /     /     /     /  /     /     /                                     /\
   /  /__/  /  /  /__/  /  /  /  /__/    Email: [email-masked]    / /
  /  /\_/  /  /__   /  /  /  /  __//          Cosine Homepage:           / /
 /  /__/  /  /  /  /  /  /  /  /  /    http://www.cosine.demon.co.uk    / /
/_____/_____/_____/__/__/__/_____/_____________________________________/ /
\_____\_____\_____\__\__\__\_____\_____________________________________\/

---

From: [email-masked] (Garry Lancaster)
Date: Sat, 21 Jun 97 01:39:23 GMT

> I bet I can say which one runs at 50 fps and which one runs at 25 fps.
> For things more complex I sure will not be able.
> 
I bet you can't - PAL TV runs interlaced, so although it goes at 50Hz
a full frame is only shown every 2 cycles, thus 25fps *not* 50fps.

-- 
Garry Lancaster
Z88 Forever! Homepage: http://www.netforward.com/deathsdoor/?dharkhig
Email: dharkhig at deathsdoor.com (replace " at " with "@")

---

From: Jason <[email-masked]>
Date: Mon, 23 Jun 97 20:00:06 GMT

> of space for a large font bank.....)

So do we if we're only using 100 characters.

> (It's just a matter of POKEing a couple of system variables that point to

Yeah, but if I do one POKE every single character on the screen can change
to the new font at the point that the command finishes executing.  We're
not just pointing to a new font, we're refreshing *all* of the stuff
displayed in the old font as well.
--
Jason  =-)
     _______________________________________________________________________
TMR /     /     /     /  /     /     /                                     /\
   /  /__/  /  /  /__/  /  /  /  /__/    Email: [email-masked]    / /
  /  /\_/  /  /__   /  /  /  /  __//          Cosine Homepage:           / /
 /  /__/  /  /  /  /  /  /  /  /  /    http://www.cosine.demon.co.uk    / /
/_____/_____/_____/__/__/__/_____/_____________________________________/ /
\_____\_____\_____\__\__\__\_____\_____________________________________\/

---

From: Jason <[email-masked]>
Date: Mon, 23 Jun 97 20:11:03 GMT

Jason =-)

The Starglider:
> I VERY much doubt that the C64 Uridium runs at 50 fps. I mean, with the
> VIC chip doing the sprites and the processor dealing with the rest,
> there is not enough processor power in a C64 to do all that at 50fps.

Now before I start to *really* take the piss are you sure you don't want
to take that back?

Okay, I can state now, with no doubts in my mind whatsoever that the C64
version of Uridium runs at a steady 50FPS.  Since Uridium is quite simple
compared to, say, Armalyte or IO (both of which better it for the number
of hardware and software sprites onscreen and still maintain full framerate)
it's a simple matter to get that kind of job going at 50FPS.  Any half
decent scroll routine can shuffle 1,000 bytes of data to the screen a
frame and that's enough to move the scrolling area Urid uses and a bit more
besides.  There are only eight hardware sprites in use (Manta, shadow,
five nasties and uridimine), the ship's bullets are chars, a little bit
of background definition is copied in and they're mapped over it and the
stars are just chars again.

Most C64 coders would be *laughed at* if their code dropped below full
framerate, it's something that (short of 3D stuff, which obviously takes
a little longer) is *expected* of us.  Despite your claims, the human eye
*is* perfectly capable of noting the difference between 17FPS, 25FPS and
50FPS and if you like I can happily put a little routine together that
scrolls the top twelve lines of the screen at 50FPS and the bottom at
25FPS to prove the point.
--
Jason  =-)
     _______________________________________________________________________
TMR /     /     /     /  /     /     /                                     /\
   /  /__/  /  /  /__/  /  /  /  /__/    Email: [email-masked]    / /
  /  /\_/  /  /__   /  /  /  /  __//          Cosine Homepage:           / /
 /  /__/  /  /  /  /  /  /  /  /  /    http://www.cosine.demon.co.uk    / /
/_____/_____/_____/__/__/__/_____/_____________________________________/ /
\_____\_____\_____\__\__\__\_____\_____________________________________\/

---

From: [email-masked] (Ojala Pasi 'Albert')
Date: 24 Jun 1997 13:22:34 GMT

>a full frame is only shown every 2 cycles, thus 25fps *not* 50fps.

C64 outputs non-interlaced video signal (composite or chroma-luma),
thus it is 50Hz progressive, *not* 25Hz interlaced.

In this case field==frame, because there is no interlacing, and you
get 'very' large black lines between active lines on the monitor/tv.
Well, actually *more* than twice as wide than on interlaced display.

-Pasi

-- 
"So, how did you find about all of this?"
"I'm .. a telepath. .. Work it out."
	-- Sheridan and Bester in Babylon 5:"Ship of Tears"

---

From: "Alvin R. Albrecht" <[email-masked]>
Date: Mon, 23 Jun 1997 17:39:48 -0600

On Mon, 23 Jun 1997, Robin Harbron wrote:

> I don't understand why you say "with the VIC chip doing the sprites"
> as if it slows down the machine... that is precisely why our machine
> can do games faster than your "faster" spectrum.  Sounds like for
> these sorts of games in particular, our machine is at least 3 times
> faster than your machine.  And 17 fps is a great achievement?  4 or
> 5 times faster then...

It kind of feels like words are being put in our mouths or else we have
been misunderstood.  The hardware gives the C64 a 50fps rate (and it must
do this to avoid flickering which would occur otherwise if a sprite were
drawn and then absent on alternating frames, for example) and it is done
independently of the processor, so of course it's "done for free" (though
not really as the VIC steals 50% of the 6502's cycles - the reason why
the C64 is clocked at an effective 1MHz rather than 2).

The frame rate is a flexible number on a Spectrum.  What your are going to
achieve depends on how many sprites you have, how big they will be and
whatever else is going on: it all depends on processor speed.  At 3.54MHz
with a 10fps target, you have 354000 cycles to play with.

Now, to get 8 sprites of 21x24 size moving around is easy in 354000
cycles.  To get 8 sprites + animated background is a little harder.  To
get 21x48 sprites (on C64, start doubling # sprites using scan line
interrupts) + animated background takes more cycles, etc. etc.  Eventually
you can't do more and maintain the 10fps target.

At a 50fps target, you have 70800 cycles.  You can still do things at a
50fps rate, but what can be done will be much reduced.

No one has ever claimed that the software sprites are done faster on a
Spectrum than they are done in hardware on the C64.  What has been the
claim is that the hardware was a substitute for processor speed on the C64
and the suggestion was the "faster" Spectrum could overcome the hardware
deficiency (ah I see the confusion: we are not claiming a 50fps rate
here).  There seems to be some contention here whether a 3.54MHz z80 is in
fact faster than a 1MHz 6502, but we have offered evidence of this in the 
case of some types of software: games where the graphics are not
necessarily amenable to the use of the C64 hardware and therefore must be
done in the same way as on the Spectrum, in software, plotting onto a
bitmap.  These were games like the 3d isometrics (Head over Heels, the
author of which has already posted here that it wasn't easy getting a C64
to do it), the filled polygon 1st person perspective ones which are
slower on the C64 or are not done in 3d at all (Carrier Command was 2d on
the C64: someone in the C64 camp did say that it was 3d on the C64, but I
have seen it in 2d running on a 64: load it up and try it: if you say it's
3d, I'll believe it) and the vector graphics ones (Starglider) - Stephen
has an interest in this last one and wants to see the z80 versions of fast
multiply and fast draw to validate this claim.

Alvin

---

From: [email-masked] (Ojala Pasi 'Albert')
Date: 24 Jun 1997 20:00:04 GMT

In article <[email-masked]>,
>the C64 is clocked at an effective 1MHz rather than 2).

Not exactly true. The 6510 on the C64 IS clocked at 1MHz, but it
only accesses memory on the latter cycle-half, thus VIC can access
the memory on the other cycle-half. I.e. the memory has 500ns
access time so that both VIC and 6510 can access it at 1MHz.
So, 6510 effective clock rate is the same as it's actual clock
rate, 1MHz.

However, VIC does steal cycles from the 6510 on occasions where
it needs more memory bandwidth than that. 40 cycles for each
character row (25 per frame) to fetch the character codes (and colors)
and 2 cycles for each sprite where it is displayed to fetch the
other two bytes of sprite data (data pointer and 1 byte of sprite
data are fetched on VIC's cycle-half).

There are very good documents about C64 on the net, so please
check before you write as a seemingly fact something you think
you heard 10 years ago. Unfortunately this is a problem with
a lot of the discussion here and there..

And please, write shorter paragraphs. It makes it much easier
to read your posts.

-Pasi

-- 
"Nothing. I saw .. nothing."
	-- Londo in Babylon 5:"The Fall of Night"

---

From: Repose/Style <[email-masked]>
Date: Mon, 23 Jun 1997 14:02:30 -0300

> What's the point? The human eye cannot only works at about 18-20 fps (if
> you can call it that) anyway, so there will be no advantage in doing
> anything faster.
> --
>              **************The Starglider****************
I must protest about all this misinformation on the human visual system
:)
There seems to be a popular myth that the eye can only see 30fps.  Well
that is just false, but like all myths, it does have a basis somewhere.
In textbooks you might read that your eye has a *persistence of vision*
of about 1/30th of a second.  So many people take this to mean you can
only see 30fps, but that is not what it means.
POV means that when light hits your eye, the chemicals in it take some
time to react to the stimulus.  It means that an image flashed on your
eye will remain visible after it is gone, as an aftereffect of the
chemicals reacting.  The image will remain for about 1/30th of a second
while it fades away and the chemicals react to the new scene (darkness,
or the next image.. whatever).
But there's a lot more to it than "meets the eye" :)).
You have two types of sensors in your eye, rods and cones.  Rods are
designed to be sensitive to motion and contrast, and only see in grey. 
They also see better in low light conditions.  They are quicker at
responding to light.  Cones come in several types which can see colors. 
They are less quick to sense.
And there is more to it than that.  Further up, in various phases of
vision processing, different elements are extracted at different
speeds.  For example, you can recognize the difference between a solid
circle and a doughnut or hollow circle if it's very bright when it's
flashed on your eye for only 1/1000th of a second!
On the slow side, you can recognize a letter or scene that is rotated
proportional to the amount that it is rotated, which can take up to
several 10ths of a second.
And about motion blur: it's created naturally by the lag of the
chemicals in your eye responding to light.  Say one frame is displayed,
sometime later, the image is registered in terms of chemical reactions
and electrical impulses.  Then the next frame comes; it is additive and
blends on top of the previous reactions, which causes a blurring effect.
One final proof that the myth is false.  How could a baseball player or
tennis player hit balls coming at 90mph when your eye could only seea
frame rate of 30fps??
The answer is the speed of motion detection in the rods.
In short, when considering computer animation, whatever looks good is
the answer.  It's generally accepted that 15fps looks ok to most people,
but of course it's a continuous scale and not fixed at all.  When I
watch films, which have 24fps I can see chopiness when the camera is
panning.  Btw, films also flicker at 72fps, that is, they open and close
the shutter 3 times for each frame.
I can see NTSC TV flicker as well, and the flicker you would notice is
30fps, caused by sharp contract between an even and odd line.
Finally, I can see a flourescent lamp flicker at 60fps.
Even the white on my computer screen now if flickering at 60fps.
An easy way to tell what your threshold animation rate is, is flashing a
light at a controlled speed, and panning your eye across the light.  If
you see the trail of dots then it's going too slow.
As your eye moves from left to right, the light flashes on different
spots on your eyeball, and you will see a trail of different lights.
Also try looking at your favorite IFLI graphic.  If you look at it with
your eyes steady, it doesn't flicker too much, but move your eyes
around, and it flickers much worse.

---

From: [email-masked] (Cookie)
Date: 24 Jun 1997 21:46:13 GMT

The Starglider ([email-masked]) wrote:
: What's the point? The human eye cannot only works at about 18-20 fps (if
: you can call it that) anyway, so there will be no advantage in doing
: anything faster.

Not completely true... look at a monitor or a TV out of the corner of your
eye -- you'll see flicker. Rods are more sensitive to motion than cones,
and appear to react faster...

...but of course, it's true enough for the purposes explained here.

BTW: For some reason, 50fps LOOKS smoother than 25fps. That is, on
systems which don't interlace the picture. Go figure.

Simon

---

From: [email-masked] (Stephen Judd)
Date: 24 Jun 1997 22:29:41 GMT

>been misunderstood.  The hardware gives the C64 a 50fps rate (and it must
...
>the C64 is clocked at an effective 1MHz rather than 2).

VIC does not steal half of the 6510's cycles.  This was explained some
time ago.  It is your choice whether to believe this or not.

...
>achieve depends on how many sprites you have, how big they will be and
...
>Now, to get 8 sprites of 21x24 size moving around is easy in 354000 cycles
...
>Spectrum than they are done in hardware on the C64.  What has been the
...
>and the suggestion was the "faster" Spectrum could overcome the hardware
...
>case of some types of software: games where the graphics are not
...

Less talk!  More code!

-S

---

From: [email-masked] (Damien Burke)
Date: Tue, 24 Jun 1997 19:19:54 GMT

>displayed in the old font as well.

What??! You mean you can only have one font onscreen? How awful!

:)
-- 
 //// Damien Burke (replace d.c.u in address with demon.co.uk if replying)
//// Spectrum pages: http://www.jetman.demon.co.uk/speccy/
//// New to this group? Read this: http://www.jetman.demon.co.uk/speccy/faq/

---

From: [email-masked] (Ian Collier)
Date: 25 Jun 1997 13:12:44 GMT

>a full frame is only shown every 2 cycles, thus 25fps *not* 50fps.

PAL TV in general runs interlaced, with 25 frames per second, or 50 fields
per second (two fields make a frame).  However, if the programme you are
watching was shot on video rather than on film (and hasn't had any silly
tricks done to it) then motion will usually occur between the fields, thus
giving the impression of 50 pictures per second.

The Spectrum does not output interlaced fields.  It outputs 50 identical
frames each second, each containing 312 lines (311 on the +3).  The TV does
not interlace them.  Hence we really are talking about 50fps for Spectrum
output.
-- 
---- Ian Collier : [email-masked] : WWW page (including Spectrum section):
------ http://www.comlab.ox.ac.uk/oucl/users/ian.collier/imc.html

---

From: [email-masked] (Ian Collier)
Date: 25 Jun 1997 13:16:36 GMT

In article <1997Jun24.183336@cantva>, [email-masked] wrote:
>Who's this person who claims the human eye only works at about 18-20 fps !?! 
>That's just plain wrong.  You need a frame-rate of close to 60 fps for the 
>human eye to perceive the motion as continuous.  

Funny, it looked OK last time I watched a film at 25 fps...
-- 
---- Ian Collier : [email-masked] : WWW page (including Spectrum section):
------ http://www.comlab.ox.ac.uk/oucl/users/ian.collier/imc.html

---

From: Robin Harbron <[email-masked]>
Date: Tue, 24 Jun 1997 16:24:11 -0400

> the C64 is clocked at an effective 1MHz rather than 2).

You're not as easily misunderstood as some of your cohorts :)
This business about the C64 running at 2Mhz is utterly false
tho... but the end result is similar to what you describe.
There are two phases to each clock tick... the VIC takes
the first, the 6510 takes the second.  A small percentage
of the time, the VIC steals some extra phases from the 6510,
to read some extra graphics data.
 
> with a 10fps target, you have 354000 cycles to play with.

The frame rate is also flexible on a 64... if doing some work
that is too much to fit in a single frame, we would double
buffer the display.  ie. draw one complete frame, display that
while the next is being drawn, then swap frames, then draw
the next frame in the "hidden" screen, then display that one...
 
> fact faster than a 1MHz 6502, but we have offered evidence of this in the

There have been very few solid examples of things truly running faster
on the Z80 than the 6510... the only one I recall seeing is that one
using the stack to clear out a large area of memory.  It seems the 3 or
4
to 1 cycle ratio is fairly accurate... in which case the throughput of
both processors is very close.  But then you add the bag of tricks
that the VIC adds to the 64, and you end up with a more powerful
machine... I'm willing to be convinced another way, if some proof
would show.  'cmon!  more example like the screen clear routine ;)

> author of which has already posted here that it wasn't easy getting a C64

Well, it sure turned out nice... was it ever easy doing it on a Speccy?
;)

> multiply and fast draw to validate this claim.

I haven't seen either of these programs - but I have seen Stephen's
various programs, and they sure run nice and fast... have you
checked them out yet?

Robin Harbron (Macbeth/PSW)
[email-masked]

---

From: [email-masked]
Date: 27 Jun 97 15:10:03 +1200

> Funny, it looked OK last time I watched a film at 25 fps...

Well, I've seen the difference between something animating at 25fps 
(in this case, it was a flight-simulator, running on an PAL-interlace 
(620x512) screen) and the same thing animating at 50fps, (the same 
flight-sim. running on a Double-PAL (640x512) screen.)  The difference 
was bloody amazing...  and actually something I hadn't expected.  

(Incidently, the difference is still noticable when I try it on 
NTSC-interlace (30fps) then DoubleNTSC (60fps) screenmodes too.)  

If you got the chance to see a film at 25fps, and the same film at 
50fps, (assuming you are correct in its frame-rate), I bet you'd be 
surprised too.  

As a side-note, if you had the chance to see one of you average modern 
hollywood-movies on the big screen.  And were then able to see one 
such as, for example "Laurence of Arabia" on the same big screen, 
you'd be able to better appreciate the low resolution of film they use 
these days too. 

Nathan. 
([email-masked])

---

From: Jason <[email-masked]>
Date: Wed, 25 Jun 97 20:23:49 GMT

> you can't do more and maintain the 10fps target.

I can scroll the screen in 48 rasterlines and process a thirty two sprite
multiplex in half a frame (three quarters if I don't use a presorter) and
*still* have time to play music, process game logic and so forth.  At 50FPS.
Armalyte (Thalamus) does 32 sprites, 40 soft sprites, full screen scrolling
and some of the most complex attack patterns I've ever seen.

> 50fps rate, but what can be done will be much reduced.

Only for the Speccy (see above).

> here).

Maybe *you're* not, but...

The Starglider [pulled from mail backlog, dated June 9th]:
> Fair enough. But the sprites doesn't enter into it, because (as you
> know) the spectrum can do those as well, and just as well.  

*He* seems to think so.

When C64 users talk about scrolling, moving sprites, bob routines, in
fact everything barring 3D linedrawing (and even then only sometimes) we
are talking 50FPS.  *Once again* I will repeat my challenge.  32 sprites,
over a picture, standard Speccy resolution, no colour clash and, since
you feel that the point should be made, *50FPS*.  The code took about
an hour (if memory serves, it was written three weeks ago).

For 3D stuff you have the advantage (well, on the games side of things,
there are some incredibly fast 3D routines in demos, Reflex's chessboard
zoomer (Radio Napalm) for example, Byterapers' plasma zoom (FTS3) or
Graham of Oxyron's texture mapping (Dawnfall) but after that...
--
Jason  =-)
     _______________________________________________________________________
TMR /     /     /     /  /     /     /                                     /\
   /  /__/  /  /  /__/  /  /  /  /__/    Email: [email-masked]    / /
  /  /\_/  /  /__   /  /  /  /  __//          Cosine Homepage:           / /
 /  /__/  /  /  /  /  /  /  /  /  /    http://www.cosine.demon.co.uk    / /
/_____/_____/_____/__/__/__/_____/_____________________________________/ /
\_____\_____\_____\__\__\__\_____\_____________________________________\/