Lease this WebApp and get rid of the ads.
mike
Computers a bit but not that bad really
Sat Dec 2, 2017 13:10
108.26.74.221

Gentlemen, (Roger and Sarge) I know that this stuff isn't your thing so please feel free to ignore it if you wish. I find this message base a very good place to put the occasional essay because it'll be easier to find it here than a forgettable file name stored god knows where on who knows which USB chip or folder on the computer.


So please dont be offended. It is interesting though, no, really!....


Ironically its taken the modern PC's to get the most out of the old 8 bit machines like the Spectrum.


You see they allow one to use the very best software tools to analyze the chip circuitry to discover what are known as 'undocumented features' which means finding out that its possible to perform calculations or store data in ways the designers never planned for but which can be made to happen by ingenious manipulation of the various registers and instruction set.


For its time the Spectrum was, believe it or not, quite an advanced computer especially with its graphics capabilities and math routines that mean nothing to me, I dont know what 'floating point' means but apparently its good!


However its downfall was Clive Sinclairs obsession with building down to a price instead of up to a standard and frankly he was damn lucky with his choice of engineers who were really the ones responsible for persuading it to do so much for so little.


One of the machines drawbacks was 'colour clash' which I've mentioned before and you'd think that was an insurmountable obstacle but then you probably also think that a machine that offered 8 colours (WOW!) could hardly do more whereas nowadays thanks to the aforementioned mumbo jumbo you can persuade it to display 255 different colours. THAT really IS a WOW!


Some chap at WoS has just produced a rather beautiful plasma effect that allows a screen sized picture to appear as a steadily increasing sized plasma like display finally emerging as the screen shot - whatever it was. It appears to be technically impossible given the limitations of the machine but its really quite simple in execution though I would find it hard to describe.


All thse neat tricks are as a direct result of being able to run several dedicated pieces of software simulteneously on a PC so that what would have been an unbelievably slow, laborious, repetitive, piece meal series of operations if carried out on a Spectrum can be pipelined to run sequentially on a PC giving you a result in a fraction of the time necessary on a Spectrum assuming it could even manage to do it at all since you have to have enough memory not just for the program but for its final output. 48k isn't much room for this sort of work.


Those undocumented features might never have been discovered except maybe one or two by accident, using the original machine. No, its the emulated Spectrums on PC's that can be put through their paces at high speed to try every possible variation of machine code instructions to note what strange things happen when you step outside the box, so to speak.


For whatever reasons, good design, serendipity or just plain chance, the Zilog Z80 is a rather amazing little micro processor that still can surprise us with its capabilities even today. Of course its very relevant that probably no other micro processor has been so exhaustively studied for such a long time by such a concerted team of top drawer programmers.


Some of these guys earn astronomical salaries, half of them own their own businesses writing code for the Defense Establishment, NSA, Amazon and other huge companies requiring constantly modified programs for their websites and merchandising outlets and automated warehousing to name but a few examples. Most of them are really rather pleasant chaps, extremely helpful to bottom feeders like myself, not at all patronizing although often their explanations are so high level that I need to get them translated down a few layers so I can grasp what they're saying I should do.


They routinely forget that not everyone is familiar with assemblers and compilers and that us peasants dont understand that you cant type in their programs without first writing a Basic loader to allow the machine to use the code supplied! That one often causes frustration and using the correct compiler is as important as knowing to use one at all.


Some compilers dont like common hex mnemonics and all of them are very picky about punctuation marks. Some prefer semi-colons, some won't accept them, some require lines to be incrementally indented, some would rather do that themselves. You have to learn which compiler to use for which sort of program and the quirkiest of them all are often the best at producing really good code.


Consequently my desktop (on the PC) is absolutely cluttered up with dozens of different Spectrum software tools that I try to keep in some kind of logical order to help make it easier to find the right one for the job.


I only muck about with this stuff to keep my brain active, its not that I have an end product in mind. Some idea will occur to me to see if I can program it, like my current efforts to write a chess program in Basic. Some time I'll have a crack at producing a 'demo' which is the term used for a program whose sole purpose is to show what the machine can do.


My personal demo benchmark is the falling autumn leaves sequence from Disney's 'Fantasia'. I did it on my Amiga 1000 using DeLuxe Paint 2 animation and spent weeks dropping leaves to study their aerodynamic behaviour so that I could then draw the sequence frame by frame, finally using it as an animated brush to fill the screen with falling leaves in all their glorious colour.


Now having just seen the plasma effect referred to above, I am moved to consider attempting it on the Spectrum, except it'll be one leaf not many and the processor will be busting a gut to pull it off if it even can at 30 frames per second.


If this sounds like incipient insanity, you may be right but at least its harmless and keeps me happy! I spent all day yesterday laboriously plotting all the points that once joined up will become a leaf in outline. I do this on mini graph paper 8x8 squared specially made for the job. Then I enter in the X,Y, co-ordinates of said points and have then to program a DRAW routine that connects the dots. So far so good, I will eventually have a leaf drawn.


Now comes the hard part, doing it again (times 30) each time it must be redrawn slightly descending, slightly moved left to right, however this is where it gets a bit tricky. The computers memory isnt enough for 30 instruction sets like the first and even if it could hold them it would take too long to carry out even overclocking the chip to 7Mhz instead of its usual 3.5.


So the answer is to devise an algorithm that mathematically describes the changing position of each point and then to write a sub-routine to perform those calculations before returning to the drawing routine armed with the next co-ordinates. Easy peasy right?


I fell asleep several times whilst attempting to devise said algorithm! My recliner was surrounded with discarded notes with scribbled calculations on them but strangely enough I felt mentally invigorated even though my internal voice of doom keeps trying to persuade me to drop the whole idea because its way beyond me.


If I had gone to Heathers for Christmas I would have ended up like a poor mans Howard Hughes, locked in my hotel room, knee deep in failed calculations, quietly gibbering to myself or desperately searching the Web for someone, anyone to listen to me explaining the problem and its fascinating aspects!


So you got stuck with me instead. GRIN.

    • BASIC version of plasma effect - mike, Sun Dec 3 14:00
      WARNING! Clicking on the link may get unexpected results. With me it makes Firefox load Internet Explorer to see the GIF. I don't know why it can't show a GIF without having to ask for help!... more
      • I should hang it up - mike, Sun Dec 3 21:24
        Every time I go away from program writing for a few weeks I have to learn a lot of the stuff anew. Spent 4 hours trying to get what should have been a dead simple routine working and to no avail. Oh... more
        • My bad! Time for some humility... - mike, Mon Dec 4 11:16
          Today at WoS I posted the following:- Okay well thanks to you Arkannoyed - and so many others - I have just learnt a humbling lesson, several humbling lessons actually. Paramount is this:- Don't be a ... more
          • The cursor move routine that works! - mike, Mon Dec 4 19:27
            Submitted by the Colonel (yes, really) who lives in Charlottesville, Virginia and has always been a very helpful WoSser. It turns out that several people had a go at this with varying degrees of... more
  • Click here to receive daily updates