Tuesday, June 30, 2009

"It's alive!"


Finished the complete SoC (system on chip) design for this 'ere project, which I think is quite impressive in only a couple of weeks given how complicated it all turned out to be.

I can see me using verilog in preference to VHDL in future, I've found it fairly nice to use. There was always something a little counter-intuitive about VHDL as far as I was concerned...

And now onward and downward - the application software for it.

Saturday, June 27, 2009

Standards? What are they, exactly?


I've got to design an SPI port; they have a clock line, a data in and a data out line. Oh, and a chip select line. Four lines, in all. Should be easy enough to knock one up.

Of course it's too much to expect that I'll have been given any documentation for the device that it needs to interface with so I'd better make the port flexible. How many variations can there be?

Turns out there are chips out there with every possible variation of those signals. The chip select can be active high or active low. The clock line can be active high or active low and the input data can be latched on the rising edge, or the falling edge... The output data can change before the leading or after the trailing edge of the clock. The clock may or may not run when the chip select isn't active. The number of bits in each transaction? You think it's a constant? Foolish twisted boy...

Standards? Simplicity? Who needs 'em...

[weeks later]

I didn't make it clear that the SPI port I was grumping about there was a slave port, designing the master end is easier (I'd designed a master port as well, both of the designs are published in the R3220 data so decide for youself)... The slave port's timing is at the mercy of the master port and I didn't have any documentation for their master port... Still, it all worked so I must have made a reasonable job of things...

Thursday, June 25, 2009

Facebook


Ok, I admit it. I'm on facebook. I gave in...

http://www.facebook.com/design.design

Monday, June 15, 2009

R3220 microprocessor


I've been busy designing some FPGA hardware recently, and part of it uses a lovely little 32-bit microprocessor I designed a while back. I've been meaning to publish the source for it for some time, but since the contract for this design means I have to provide the source to the customer and even [shudder] document the thing to some extent I may as well take the opportunity to publish it now.

I've called it the R3220, those of a technical nature can assume this name derives from the fact it's a 32-bit RISC with about 20 instructions (while being completely oblivious of the "saturday night special" connection, I suspect).

The performance is fairly respectable, I'm using it to replace an existing NIOS II based design because the NIOS based design wasn't anywhere near fast enough.

As a guide the R3220 CPU uses between 600 and 1700 LE's in a Cyclone II array, so a complete system with one CPU with several peripherals only takes up ~12% of a Cyclone II EP2C20.

For fun I put four of these processors in the array (quad-core, anyone?) and it took up about 30% of the available logic. Since they can share memory without losing any performance it's actually not a bad idea to think in terms of more than one CPU for some applications, though I don't think I need to do it for this one.

(To facilitate the use of dual-port memory, which is common in gate arrays, the reset vector is configurable, so you can have two processors using the same memory block but not executing the same part of it. This incurs no extra delay so both will run at full speed.)

The verilog source, an example SOC design including various peripherals, a simple SDRAM controller and the r32 assembler can be found here -http://www.desdes.com/products/r3220/index.htm - note that this is the first verilog I've written so the style across the sources is inconsistent, I'm still finding my feet with the language. I'm more used to using VHDL, though I have to say I'm finding it a lot easier to write in verilog than VHDL, there's something about the 'feel' of verilog that I prefer.

This isn't the first processor I've designed and hidden away inside a gate array, but most of them have been too dedicated to a specific task to be worth discussing. This one is a nice general-purpose device to programme (in assembler, that is. If you're stuck using C then pick one of the MIPS implementations) and given how little time it took to develop (about ten days) I have to say I'm very pleased with it - it's a shame that so many embedded designers are stuck in the whole turgid morass of the linux/gcc/c bloatware mindset and can't play about like this, they really don't know how much fun they're missing...

For those who care it's a fairly classic load/store risc with a couple of unusual features. I designed it to have lots of registers (128) so I can dedicate them to interrupt handlers, and it has a nice touch that allows for 7 or 14-bit immediate values in the single-cycle instructions but also a full 32-bit immediate value can be used for all operations with only a single cycle penalty - it achieves this by taking one of the 7-bit immediate values, (-64), and using it as a flag to request that the next instruction word be used as a 32-bit immediate instead.

It has a reasonable addressing mode set with all the usual pre and post inc/dec indexed operations. The address is formed by taking a pointer register, which can be any of the 128 registers (there is no distinction between them) and optionally adding a 7-bit signed offset value. This address can be written back to the index register if required (with no extra delay) which allows auto inc/dec modes. The fact that the memory address used can be the register address or the register+offset means that there is full support for auto inc and dec with pre inc/dec and post inc/dec addresses. So any sort of stack you like, basically.

Every instruction is conditional with an option to update the flags. Sounds like an ARM, I suppose, though I first designed a CPU that did this many years before the ARM appeared so saying I got the idea from ARM might just earn you a thick ear [grin]. In fact, the bit field layout in this instruction set is remarkably similar to one of my designs from the 70's, though I was trying to outdo the PDP-11 back then so the that design had a particularly gothic and slow addressing mode set. [shudder]

The condition codes operate by having a 4-bit field that selects individual flags in the status register and then determining if the instruction should be executed using the state of the selected flag.

Doing that uses 14 of the 16 possible condition codes to handle 7 status flag bits. Of the two remaining codes one is ALWAYS which means always execute, of course, and the last is interesting - I've called it 'LOCK' and it always executes the instruction, the same as ALWAYS, but it also prevents the instruction from being interrupted. Once the processor has been put into LOCK mode it remains in LOCK mode until it executes an instruction with the ALWAYS condition code. This allows sections of code to be made 'atomic' without any overhead, and those sections can include conditional code.

Lock mode also forces locked RMW bus cycles where the bus architecture supports them, which makes it beautiful for implementing semaphores, etc. It's all much nicer than having to either flip interrupt enable/disable flags around critical bits of code or use peculiar instructions.

Another use of LOCK is in function entry/exit code, to make the stacking/unstacking of link registers etc safe. This can be handled transparently by the development tools.

I designed it to be agile, so interrupts have to be entered and exited quickly, and to that end it supports multiple interrupt levels with priority encoding on each of those for multiple interrupt sources at each level. The CPU outputs acknowledge signals when taking an interrupt vector so there are no delays while the handler has to manage the interrupt controller.

For speed it uses dedicated link registers instead of stacking the return address/state during interrupt cycles, and cleverly uses the particular link register invoked by the 'return' instruction to signal the end of that interrupt level to the interrupt controller. This means interrupt handlers are exactly as fast as calls and yet don't require any special entry/exit instructions.

Something else that's nice, though obvious, is that because you can load/store values directly to the status register and the condition codes use single bit testing peripherals can to organise their status flags so it's meaningful for the device handler software to load the peripheral's status register directly into the CPU status register and then use conditional instruction execution to determine how the flow should proceed. ie:


ld status,uart_status[peripherals]

call s0t RxByteHandler ; The s0t means execute this if status register bit 0 is true.
call s1t TxByteHandler ; The s1t means execute this if status register bit 1 is true.

The s0t, s1t (etc) are aliases for the conditions C, Z, etc.


This process is helped by the fact that the handers can preserve the status flags (they're saved in the link register and can be loaded back or not as required when returning).

The assembler is pretty powerful, as well as all the usual stuff you'd expect it handles allocating link registers automatically so the user doesn't have to know or care what they are. Thanks are due to a certain Ste for making me do this with his damned "It can't be that difficult" and "I can't see the problem" attitude.

In summary it's a nice processor, amazingly nice considering how little time it took to design. I absolutely love being in a position where I can design stuff like this and get paid for doing it...



Sunday, June 14, 2009

Interesting times


"May you live with interesting timings" I remarked, innocently enough.

"What?"

"May you live with interesting timings... You know, like the olde curse - may you live in interesting times - but updated for poor sods like me stuck trying to get their bloody logic running fast enough in a sluggish array... "

"What old curse?"

"May you live in interesting times - it's Chinese or Celtic or summat. Quite clever really, it implies that interesting times are not ones you'd want to live in"

[ponder]

"Not much of a curse, is it?"

"What?"

"I just think it's a bit mild for a curse... It wouldn't spring naturally to mind when I wanted to tell someone to fuck right off is what I'm saying... It lacks something. Live in interesting times? Pah..."

"You have no subtlety, if it was you no doubt it'd be something along the lines of 'may you have diarrhea and piles and live in the bathroom!' Oh, just fuck off!"

"See? Much more satisfying..."

"You know, thinking about it, you're right..."

Friday, April 17, 2009

Doomsday


In the background while I'm writing this Sky are showing a film called "Doomsday", it's a sort of post-apocalypse mad-max rip-off set in scotland. Loonies on motorbikes, thunderdome type scenes.

I can't really imagine why they didn't just call it "Mad Mac's" and have done with it.

'snot really funny


Red and yellow and pink and green, orange and purple of hue
I can sneeze a rainbow, sneeze a rainbow, sneeze a... OK, you get the idea.

[sniff]

Friday, April 10, 2009

Another interesting problem at work today.

We make electronically controlled beds for hospitals, they have achieved a certain notoriety hereabouts for occasionally exploding (I say occasionally because they rarely do it twice. That would indeed be excessive. Once is hardly worth mentioning, I feel).

A recent batch of 25 turned out to have four failures, when moved up and down they would not remain flat, basically the actuator at the foot end of the bed was not being controlled correctly - it was not moving as far as the actuator at the head end, only about 60% of the distance. The four were so consistent (all showing nearly the same degree of tilt) that we decided it pretty well had to be a software issue, hard as that was to explain.

But it wasn't - let me digress back a few years to the start of the project:

When the first bed hardware (frame and actuators) arrived for us to design the control electronics it came with a example mattress. These medical mattresses are not as you might expect - designed with disease control in mind they are waterproof and made of materials that can survive being steam cleaned. Basically they're dense and covered with some polymer that resembles rubber. And they are supplied, as most things are, in a plastic cover.

I must stress that in the eternal war of man against mattress these may be regarded as special forces, highly trained and motivated opponents. If you are asking yourself "what war?" then you are either damned lucky or have not yet made love in an uncooperative bed. But that's another saga.

So, picture the scene - we have a dirty-great mattress standing up on end against a wall with a polythene cover that needs to be removed. Along comes an unsuspecting Leon, I guess he winds up doing this because he just happened to be tall enough to reach the top of the mattress. As the only other person involved who is tall enough to have done this I must now give thanks to the gods of laziness who were smiling upon me on this occasion, because Leon walked over to the mattress as I was getting to my feet, grabbed the polythene bag near the top of the mattress and tugged it off with a manly flourish.

It was probably the last manly flourish or tugging off he managed for some time, because as he did this the friction between the polythene and the mattress built up a massive static charge which then discharged between the centre of the mattress and the part of Leon that happened to be closest to it as he lent backwards... The flash was visible in a brightly lit room, and the crack, while not exactly thunder, certainly wasn't a tiny little "click!" either... Leon clutched at his groin, managed a strangled squeak and collapsed. The mattress then celebrated its victory over humanity by slowly collapsing on top of him, which was followed by a general collapse of everyone who'd witnessed this event...

"You... Bastards..." Leon managed to say, after some considerable time had elapsed. "Get this... this... THING... off me"

Well, actually he probably said it a few times before we noticed, we were far too busy trying to breathe. Excessive laughter can be dangerous...

Anyway, the upshot of this is that removing the bags from these bloody mattresses is deadly. You don't do it fast. Given the chance you don't do it at all, you give the mattress in its bag to some poor unsuspecting suckers and let them find out for themselves, as we did.

"Do you know what happens if you remove the bag quickly?" I asked the supplier.
"Don't" they said.

"You don't know?"
"No - don't remove the bag quickly"

[pause]

"Thanks. I'll tell Leon that."

Knowing this at the start I designed the electronics with more of an eye to static protection than is normal, and it was successful because we have built a fair number of these beds without further problems (though other equipment the beds take a dislike to has been destroyed by it, they don't always choose the kinetic energy weapon option).

So, what about these four failing beds? Well, yep - static damage. They'd been built, calibrated (to define the range of movement allowed, etc), and then the mattresses had been fitted, only this time they'd done four of them differently - someone had put the mattress on the bed before pulling the bag off and also done this in such a way (yet to be determined) that the discharge was through the same actuator of all four beds. This then overpowered and destroyed a filter component (ironically something that was only there to protect the rest of the electronics from this very static) and did so in almost the same way on all four beds. It went from looking like a ~10nF capacitance to resembling a ~25K resistance, with all four having more or less the same resistance when dead... This added resistance then loaded the actuator's position sense pot, destroying the linearity, so the bed control loop thought the beds were flat when they weren't.

This input protection laughs at human-body model static discharges, you understand. Eats them for breakfast, so gods alone know how much energy is involved with these combat mattresses.

I now suspect this is the real reason why nurses are forever warning people not to sit on the beds during hospital visits. They're trying to do us all a favour, they know the evil forces that lurk beneath that innocent looking exterior. Be afraid. Be very afraid...

Interesting, eh? What? Well I didn't say it was very interesting... Oh, well, suit yourselves...

PC audio hardware


The idea has occasionally wandered across my mind (leaving a messy trail) that the audio outputs of a modern PC should be capable of generating fairly high quality audio test signals, and further that if the PC audio inputs are up to scratch they could be used to digitise the results of stuffing these test signals through external equipment-under-test, so that with a bit of signal processing jiggery-pokery the PC should be capable of quickly providing THD readings, frequency response curves (for RIAA networks and the like) and so on and so forth, basically the sort of things I used to do (albeit crudely) in the seventies with test gear that cost monopoly money (to build, that is, couldn't just buy it. Or would have cost the earth if I'd had any money. I was making it up as I went along with bits and pieces I managed to beg, borrow or, um, liberate).

This is hardly original, I hear you think. "Well, it was when I first did it" I respond grumpily, "analysing audio output stages using boxcar sampling thirty years ago. All my own ideas, too. Were you even born? Huh?" And other suchlike grumping sounds that an olde dinosaur makes when challenged. Where was I? Oh, yes...

In fact, aside from electrical noise (hard to avoid inside a PC) I'd have thought that a modern audio DAC/ADC combination from even the cheap end of the PC market would comprehensively outperform the hardware I was using back then. Hah! Foolish crem...

So, tonight while I'm feeling a little under the weather (man flu setting off an opportunistic dental abscess) I decide to have a play with this idea rather than doing anything particularly demanding. A few minutes in Delphi generating an accurate sinewave (no - I'm not slowing down - you can generate an inaccurate sinewave in seconds, but doing it properly requires it to be generated with correct dithering (TPDF) applied to the fractional bits that would otherwise be truncated, and that needs a little thought) and lo - I'm sat here listening to a 1KHz sinewave. Sounds nice enough and everything's looking good for a quick and dirty THD test set until I look at the waveform on t'scope.

(A special hell is reserved for anyone even thinking about questioning the triangular dither. If you think it could be better using a shaped function then you need to brush up on dithering - shaped functions are only suitable for final output - you really don't want to skew the noise frequency distribution going in to the gear under test. Running error accumulation instead of dither? Just don't. Tie the dither generation into the ADC with synchronous correction in the readback? Good thinking but not with unknown systems inbetween... Besides, it's not always a sinewave and I'd hardly tell you what I'm intending to do with this eventually, would I? triangular it is then. Good...)

Now, I admit I was expecting a reasonably clean looking sinewave. Dumb, but I admit it. Oh, crem-the-eternal-pessimist was expecting noise, and hum, and mush of various kinds, but with a smooth sinewave hiding underneath it all none the less. A sinewave lurking behind the sort of noise and mush that will average out give enough signal processing, is the point. Hah! Idiot. I'm not feeling well, that's my excuse.

Here it is:





Magnified (x2.5 post sampling):



Well, it's a sinewave, I suppose, but at first sight it looks like a sinewave generated using a raw 8-bit DAC. Very reminiscent of the stepped waveforms I'd expect from a cheap embedded design that didn't care much, not a supposed high quality (hah) DAC system.

So, does this motherboard, which claimed good audio qualities, use short DACs? A moment of experimentation and it becomes clear - it's not a short DAC but the cheapskate designers of the motherboard haven't applied any analogue reconstruction filter to the output... Nada. Zip. Not even a token RC filter...

Same again, but at 10KHz:



I suppose we should be thankful that they've at least upsampled the digital data to 96KHz, so at least most of the shit they're throwing out is well outside the audio band. Mind you, I bet they did that so they can cut back on the DAC length/ADC input filters and then just didn't bother to fit either. Gah...

Oh, I know, I could always use off-board audio hardware but that's not the point; if this is the normal sort of performance the idea's useless. Gah.

My laptop does rather better, clean looking sinewaves at 1KHz and 10KHz, so filtered at least, though that might be just the headphone driver not keeping up with the edges ;)

[that lot was edited into some degree of coherence after some sleep]

Maybe I was being too picky anyway. Even for simple tests I'd probably use the stereo outputs to generate antiphase signals and then use a differential amplifier to get rid of as much common mode noise as possible, so it's no great bother to put a quick and dirty reconstruction filter in/in front of that stage... I wonder if it's worth doing the same sort of thing going back in; turn the signal into a differential pair for the stereo inputs and subtract them in software? Have to think about that, doubt it'd do that much good. Hmm...



Thursday, April 02, 2009

Wrong.


This is a packet of coffee, such as we use at work...



This is a packet of instant porridge.



And this is both of them carelessly placed on the same shelf at work.



'nuff said, I think...

Wednesday, March 11, 2009

More culls from cix


[23/01/2001 06:18:07]

Scientists warn of increasing global warming. . .

In a surprise move, the UK government doesn't blame the internet.


[13/10/2002 14:50:39]

[snip]

Sell the idea? Sell one of my children? One of my babies? Sell? Like for money? [pause]

Coo, can you do that?

[crem furtively eyes the room. It's full of ideas he's been nurturing for ages. He reaches out and grabs one as it scampers past; it is the idea for writing "The Story Of No" a tale of one man's complete failure to find submissive women. It looks adoringly into its father's eyes as he coldly weighs up the chances of selling the little bugger. He lets it go and reaches for another, then another. . .]

He reaches a decision: "Muhaha! It's time they paid for themselves! Sell zem! Sell zem all!"


[17/10/2002 02:40:01]

> We like you in grumpy bastard mode

Just as well since it seems to be happening more and more often ;)

Gah. Grump. Too much work. I need to change my life-style. Well, actually, I was thinking of getting a life to start with, then work on points for style later on. . . Hah. I should be so lucky. Oh, well, back to work.

[crem makes sure everyone else in the house is asleep. He furtively closes and locks the door to his room, switches on the computers and lowers the lighting. He settles down in a chair with a box of tissues. Aghast we watch as he opens up the secret directory containing files that decent people are afraid to discuss. Pornography? No, much, much worse, agh! unspeakable horror! My god - it's full of compilers! He cleans his glasses with a tissue and starts typing. . .]

Trunking


Speaking of the goings on at Des Des there was the time JCL found the hose from an old vacuum cleaner in the back yard and started wandering around using it like an elephant's trunk, holding one end of it between his teeth.

JCL: "Hey, look at this! Nuff, nuff, give us a bun!

(Don't ask me for details now but that was the punch line of a joke involving elephants)

Crem: "Ah, do you know why that tube is out here?"

JCL: "No... Should I?"

Crem: "Maybe... It was thrown through the toilet window after Graham had used it to unblock the toilet..."

JCL removes tube from mouth. JCL looks at brown stains on tube... JCL goes an interesting green colour...

The gunpowder plot...


[clip from cix]

Apropos of this, back in the early Design-Design days there used to be a long-running project to fire a felt-tip pen across the road, over a stream and into a nearby park. This project, you understand, would get invoked after our all-night drink and drugs sessions.

We never had all that much success with the felt-tip pen projectile project, though on one memorable occasion we stuffed rather too much shotgun-80 gunpowder into a steel tube cannon, aimed it out of Graham's bedroom window and managed to make the felt-tip pen disappear altogether, which was counted by some of us as a successful launch. It certainly crossed the road, bits of it might have landed in the park. I suspect the bulk of it is still in orbit.

Made a fantastic noise, anyway. A sort of cross between a bang and a long-drawn out "woosh-fooooommmmm!", probably because a lot of the gunpowder was thrown out of the cannon and ignited in the air. Just as bloody well, I expect; that project proved on more than one occasion that the gods protect the stoned.

I miss those days. Life is too serious now :(

Wednesday, January 21, 2009

Intelligent design


[snip]

This made me think; these religious types with their god created the universe in 6 days and all that bollocks, where did their god get his development gear from? Who calibrated it?

In the beginning was the word? Like hell. In the beginning was the RS order, or in the beginning was the AVO meter.

And God looked on the face of the meter and said "Fuck me, this isn't even a model 8..."

Ruminations : Invasion of the Body Snatchers


[copy of a recent email]

Many years ago, back in the dark ages of 8-bit games machines, there was a game called Invasion of the Body Snatchers

Here are my ruminations on all the high score changes in Invasion. When I can work up the energy I'll do the same for the other games.

First there was a list of various friends, etc.

"andym" is changed to "A.Machin"
Andrew Machin was a friend, and also author of the LERM tape copier. Met him through my brother, who was a teacher at the same school as Andrew. I wandered in there one day and was stuffed in front of a class and had to give an impromptu lecture in games design... Petty much my idea of hell ;)

"chewrubba" is changed to "The Thing"
I was occasionally called chewrubba. Reference to a hairy character from Star Wars and the Spectrum keyboard, as if anyone couldn't work that out.

"motty" is changed to "N.Pottingshed".
Reference to Neil Mottershead. I doubt he ever bothered to play it to find this...

"krdt" is changed to "K.R.D.Terry".
Keith Terry is one of my oldest friends, who probably hated the game ;)

"alanw" is changed to "A.Walker"
One of my earliest friends.

"rozzer" is changed to "R.Walker"
Rosalind Walker... Sigh. Alan's beautiful sister, the first girl I kissed seriously. God, I wanted her... Hell, I still want her ;)

"johnl" is changed to "J.Lawrence"
And another very old friend, who I have completely lost touch with...

"meb" is changed to "Hello Maria !"
MEB were the initials of Maria, Martin Horsley's girlfriend. Neil and I lusted after her as well... (Martin, Neil and I had previously written Halls of the Things).

"maria" is changed to "Programmers in general eh ?"
Maria again - I once asked her at a party if she was interested in Martin or just programmers in general. She said programmers in general, but she was only trying to fend off my drunken advances. Hang on... Sounds like she was encouraging them... Blast! Where's my bloody time-machine? [later-earlier-later again] Nope, fending off it was...

"mash" is changed to "Smart arse"
Mash was Martin Horsley's nom-de-high-score table. I suspect this entry has something to do with his relationship with Maria, the lucky bastard. Might also be a reference to "Rommel's Revenge", which he was developing at the time. I can't be sure now...

"dave" is changed to "The cardboard box !"
This is (a) a reference to comic sketches in one of Jasper Carrot's series. Googling will tell you more.But it's really intended as (b) a way to take the piss out of a friend of Neil's who was called Dave, surprisingly enough. Any other Daves are collateral damage and I apologise profusely...

"jdg" is changed to "Hi Jim !"
JDG were the initials of James Garside, another old friend. Jim and I had been sharing a flat while we were at university. It was where most of Halls was written.

"c.c.c" is changed to "Chrisipoos"
C.C.C. -> Christopher Charles Clark, I think. Chris was one of the founders of Crystal Computing. I'm not sure if we were getting on well at this point, a bunch of us were about to stage a revolution and set up our own software house (Design Design).

Then there are a few HHGTTG-ish references.

"whatisthe" is changed to "42 of course !"
"marvin" is changed to "Life don't ...."
"zaphod" is changed to "It's easier with three arms I suppose"


Then there are a few general references.


"kickaha" is changed to "P.J.Finnegan"
Kickaha is the name used by the character "P.J.Finnegan" in Philip Jose Farmer's World of Tiers series of fantasy books. But it's a reference to a reference, because "P.J.Finnegan" has the initials "PJF", the same as "Philip Jose Farmer", so Kickaha is a reference to Farmer as he'd like to be, as indeed would I. That series were and still are some of my favourite books... Kickaha was also the default name we used for the initial high-score in Halls of the Things, and I suspect there are other references to The World of Tiers series in the other games.

(Kickaha is a native american name for a trickster, to put it very loosely. A role I'd relish if I were only cunning enough ).

"cheesecake" is changed to "Greens Original"
Neil was officially the catering manager - this is true, we had one for some arcane reason or other - glomming free food, I'd imagine, and in this role he often made chicken curries to a recipe that his mother had given him. They were excellent. Afterwards, well frankly after any possible excuse, we would have a Greens Original cheesecake. In fact, I'm tempted to go and have one now... There were other references to these scattered about.

"6502" is changed to "Crappy processor"
Need I say any more? I have designed better processors in an afternoon. So have random CAD system crashes...

"darthvader" is changed to "Boring tit !"
God knows. I can only surmise that someone I've forgotten used to enter "darth vader" in high scores...

"xyzzy" is changed to "Wrong game !"
xyzzy was a magic word in one of the first text adventure games (Colossal Cave).

"blach" is changed to "Bells ring etc ."
I suspect this is a reference to a bug in the spectrum game "The Hobbit", but I couldn't swear to it now. I'd try entering it into The Hobbit and see if bells ring, etc...

"sex" is changed to "Yes please !"
"fuck" is changed to "Like too !"
Ah, the depressed innocence of youth. If only we'd known then what we know now. But don't get me started on sex ;)

"cheese" is changed to "Cheese ?"
This is obscure. The first version of the high-score table code, which few people ever saw, didn't recognise all these text entries and change them individually, it just recognised the word "cheese" followed by a number and then it outputted different messages. This is a reference to that early phase of the code. And to our, well, frankly our obsession with cheese. Ok, ok - my obsession with cheese. Cheese and sex, sex and cheese, how could this combination be improved upon? Very easily.

"lavinia" is changed to "She's moved to 061-205-6603"
In Halls there's a reference buried in the code (for hackers to find) to "Lavernia's Massage Parlour" which gave the telephone number of the flat I was living in (sharing with JDG) at the time it was written. There was no actual lavinia, but there were a couple of sisters living upstairs that we used to dream about. One was called Sylvia and I'm sorry but I forget the name of the other. For some reason Sylvia lent me her copy of "More Joy of Sex", which was an evil thing to do to a desperate virgin; almost, but not quite as evil as having her bloody bedroom right over mine and having a bed that squeaked. Gah... Somehow their flat became known as "Lavinia's Massage Parlour"... Ah, but they were far too sophisticated for the likes of us, penniless students as we were...Sylvia's boyfriend had a BMW, for gawd's sake. What chance did we have? Sob...
On one memorable drunken evening I'd rigged up my development machine so it would record audio and play it back backwards. (This was advanced stuff for 1982, or at least it seemed like it then) and Martin, Neil, Jim and I sat in my room thinking of things to say and trying to learn how to say them backwards. Don't ask me why but Martin came up with "Sylvia has big nipples" and then spent a good half an hour learning how to say it so that when it was reversed it was perfectly legible. What with this and the coke-bottle fights (the flat was full of 1.5-litre plastic coke bottles) where everyone took turns to throw coke bottles at everyone else let it not be said that we didn't know how to have a good time...

Where was I? Ah. Yes. Sorry.

"speakertoanimals" is changed to "Chmee"
A reference to a character from Larry Niven's Ringworld series. Some more of my/our favourite books.

"spectrum" is changed to "Ghastly rubber thing"
We didn't much like the Spectrum, in fact I probably like it more now than I did then - twenty more years of the computing industry have significantly lowered my expectations.

"crystal" is changed to "Design Design Software"
And very soon after this was published, it did..

"hott" is changed to "Halls"
I didn't particularly like "hott" as a name for "halls", it has grown on me, I suppose.

"tony" is changed to "A blaze of trumpets & singing angels"
This is a reference to the first published review of "Halls" which was probably the most accurate and interesting review we ever received for any of our games. Tony is Tony Hawks - the reviewer, if I remember correctly. He used the phrase in the review...

There are more jokes in there and it would be interesting (for vanishingly small values of interesting) to discuss the initial entries in the high-score tables, but that excitement will have to wait for another time. As you might be able to tell from the lousy text I'm not feeling particularly alert today...

Monday, October 13, 2008

Design Design source code


As I mentioned before I've published all the remaining source code for the Design Design 8-bit games. They can be found here:

http://www.desdes.com/products/oldfiles/

To make the sources useful I've written a reasonably competent Z80 cross-assembler and put that up there too - using it you can assemble the games sources to *.sxz files ready for loading into an emulator with a single click. Took months and months and... well, weeks. A week. Several days at least. OK, ok - a couple of sessions. I'm not that obsessive...

It also includes a fairly competent binary -> source code disassembler, for pulling other people's code to pieces and, ah, modifying it. Wet Set Jilly rides again...

Spectrum software development using it is almost as easy now as it used to be for us, so anyone with an interest in retro gaming should get up there and write some games... I may award a prize to anyone who can take the Forbidden Planet source and make something interesting out of it...

Have fun.

Thursday, September 18, 2008

Yet more culls from conferences...


[Talking about why things are always exploding on the bridge in Star-Trek...]

> The bridge should be just a room full of control surfaces, with all
> the dangerous stuff in engineering. Why does *anything* on
> the bridge need to explode?

It's the inevitable consequence of software evolution. Consider - programmers are lazy and everything they do requires more computing power than it should. This trend shows no sign of ending, already with current techniques it already takes a couple of billion instructions and GHZ of CPU to do something that would have used a few instructions on a slow 8-bit CPU in the 80's. Extrapolate this trend and you'll see that in the future display consoles will routinely require multi-multi THz processor farms consuming gigawatts of power just to flash the cursor - cover the bridge in control surfaces and it'd probably have a higher energy density than engineering; any disruption to the display cooling and...

> Let's hope they don't use screensavers.

They /couldn't/ use screensavers - the ship's engines would stall.

"I need more power Scotty! Another fish just swam onto the screen..."



[misc]

> You can't keep an old dog down

Depends how well it's cooked. . .


[misc]

> I doubt there'll be any software by then as people may have
> finally realised what a bad idea software was...

Don't you mean software will have finally realised what a bad idea people were?


[misc]

So, you expect us to believe that trees are made of wood, when any fule know that woods are made of trees ?


[misc (1995)]

Us veggies don't have this problem, everything we eat is so ashamed it stays down. . .


[a thread where someone said they liked Forbidden Planet (the game) (1995)]

Simon stared at Robs message. The possibility that anyone actually liked the damned game had not, until this moment, ever crossed his mind.

Simon felt lost, his world-picture shattered - not so much by the realisation that there was a mind warped enough to *like* FP, but rather by the crushing realisation that this mind was only a modem or two away, and furthermore it expected a reply - something that would be, *could only* be interpreted as complicity in the very existence of the damned game. . .

With a feeling of a vast, unknown, gulf opening up before him - a shadowy domain of unthinkable terrors - he poised himself ready to type, but alas, all was in vain - he couldn't think of anything suitable to write.

He swivelled, aimlessly, in his chair, drumming his fingers on the bottom of the keyboard, totally at a loss for a reply, until eventually, with an abrupt raising of his eyebrows, he turned back to the monitor and typed the first thing that came into his head. . . .


[misc]

A truck jackknifed spilling its load of parenthesis onto the M6 this evening. A spokesperson said they were unavailable for comment. . .


[misc]

I think that the Airbus and Windows are both cursed by arrogant and incompetent programmers, who seem unable to learn from experience :(

I'd prefer the airbus because it kills you quickly, it doesn't just grind you down and make your life into one long unproductive drudge ;)


[manned spaceflight (2004)]

What's interesting, at least to me, is that I don't know where I stand on the issue of manned spaceflight. As a kid I was all for it and very disappointed when Apollo was unceremoniously dumped, and even up to a decade or so ago I'd have agreed with Heinlein that "the earth is just too small and fragile a basket for the human race to keep all its eggs in" and argued that it's only a matter of time before we follow the dinosaurs into oblivion if we don't get at least a breeding colony off-planet, but now, well, I'm not sure it's going to matter for much longer.

Basically, I think we're too limited a life-form to aspire to the universe. I think we'd just make a mess of the place. I think the only meaningful role 'we' have is to give birth to AI's, assuming we're capable of this. Once we've done that we'll have effectively created a race of immortals that will be able to adapt and scale themselves in ways we can't imagine, and it will be practical for them to explore and use the universe in ways that fragile bags of water cannot begin to do. So, while manned spaceflight may well be of value to us as a spiritual exercise in the short term it's probably of no long-term benefit to intelligence.

When I've rambled along these lines before I'm occasionally accused of having a very depressing outlook, but I don't regard it as such - I just think "my species, right or wrong" is as silly a notion as "my country, right or wrong". What matters, if anything matters, is that intelligence continues and prospers. . .

Mind you, having now been awake and working since some time on Saturday [2 days] it's just possible that I'm writing complete bollocks. Ho hum, back to the, no, sod it - I'm off to bed ;)



[nasa returning to the moon (2006)]

> The full Exploration Systems Architecture Study which sets out
> the current thinking for the way back to the moon

Visions of everyone resisting the urge to say "Up", except (perhaps) those resisting the urge to say "why"...


[eXtreme Programming (2004)]

> Anyone use XP here?

Well, yes, we've used many of the techniques since the early 80's, though without any of us ever feeling the urge to invent such a silly name and claim such practices were anything other than the bleedin' obvious. It never ceases to amuse me how fickle programming is, work long enough in the industry and you'll see nearly everything once regarded as good practice go out of fashion, be reviled, then be rediscovered, rebranded and ultimately subverted. Every generation of programmers seems incapable of taking anything seriously until they've renamed it. Pitiful, really.


[Countering advocacy, again, again (2002)]

> where is C now compared to the speed and richness of Delphi?

Hmm. Hah! You can't fool me, I can see it there peeking out of 'richness', third letter from the left. . .

Sorry. Seriously? I doubt I'm alone in observing that programmers who worry excessively about language issues are rarely capable of writing anything worthwhile in any language. I think designers should strive to be flexible, so I think it's usually futile to adopt the position that any particular language is better or worse than the rest other than on a case by case basis. ISTM that in reality external factors usually dominate over language preferences, ie, particular project constraints and objectives, company preferences, experience, what example code exists, what libraries are handy, which tools are available, phase of the moon, etc, etc.

I'm here because I like Delphi and find it very productive, but today I've been designing using Delphi, C++, C, assembler, schematic capture and solder. All of them suited their particular part of the application, but I could have chosen alternatives. Would I choose the same ones again for a similar application? Maybe, maybe not, I get bored so I play about. Would I recommend this to anyone else? Maybe, but I'd probably assess their application, competence and background before advising them to do exactly what they were going to do anyway.


[lasers (1995)]

Actually that was my laser, unfortunately the testicles it once fried were also mine ;)

Take my word for it folks, don't coil the wire to a gas-laser in your lap unless you're *damn* sure there are no breaks in the insulation. . .

[cut]

But how can I tell the story behind the "Fried Testicles" of '83 without revealing my complicity in the "Red UFO Sightings in Clwyd" of '83, "UFO's - The Welsh Triangle" of '84 and '85 and even the sorry tale of the "Illuminated Police car in Garage Forecourt" of '86 ?

Is the world ready for the truth behind the young software house that drove around Northern England and N.Wales at night pointing lasers at road signs, pedestrians, into peoples bedrooms, across valleys at farmhouses and (occasionally) straight into occupied police cars ?

I think not.

And if, as the rumours have it, one night the insulation broke down on their laser PSU and it repeatedly stuffed 10KV spikes into the lap of the unfortunate bugger in the passenger seat while everyone else in the car had hysterics and were unable or unwilling to help, well, it could only be regarded as divine retribution. . .

(But how the memory lingers - pinhole burns, the smell of burnt pork, muscle spasms, frantic scrambling, pain, and over it all, the laughter, their damned, damned laughter)

Urgh, never again :)

Thursday, September 04, 2008

Old games sources...

As requested here are some more of the olde games source files. And a few other bits and pieces that fell off the disks while I was rummaging in the archives...


http://www.desdes.com/products/oldfiles/index.htm

Thursday, August 28, 2008

More culls from conferences

From cix (18 Apr 2003)

> hardly stressing the I/O on a mega128...

Yes, usually lots of I/O to go round on those. Mind you, that's no excuse for leaving it idle - I'm reminded of the time I had a 'phone call from some engineer who was practically incoherent with laughter having found my telephone number and a fairly raunchy message being output in morse on an unused output pin buried inside some embedded gear. . .




From cix (27 Mar 2005)

This reminds me (painfully) of a guy (Wookie) I used to work with back in the early 80's. He made serial ports that derived their timing from RC oscillators and was forever tweaking pots to get the damned things to work...

Back then we (Design Design) all lived and worked in a large victorian house in Manchester, and since Wookie was a radio ham, and I had various home-brew computers running noisily in the room next to him, we occasionally came into conflict - he was of the new-fangled opinion that computers shouldn't generate RFI, and I was of the old-fangled opinion that it was a minor miracle that the damned things ran at all, let alone that they should be expected to do so when enclosed in metal boxes.

The upshot of this was an uneasy compromise with Wook's aerials living in the attic and the attic floor and various walls of my room covered with aluminium foil.

On one memorable occasion Wookie had put some effort into designing some hardware/software to sit on the end of his comms receiver and decode morse transmissions, so that instead of learning morse you could just read the stuff in plaintext on a terminal. Why you should wish to do this at all is something that I never understood, but that's radio hams for you... Anyway, it occurred to me that some response was called for in honour of this, so while he was developing his morse decoder I quietly spent a few hours knocking up a piece of Z80 code to run on a small prototyping board and generate morse from text, and which would also drive a TTL port line up and down as fast as possible to generate enough electrical noise to transmit this signal... Generate a squarewave at several hundred KHz and there are bound to be harmonics all over the amateur bands, he's sure to stumble over one of them... Not expecting much success I left it repeatedly transmitting a loop of text.

The next day, with a few of us watching over his shoulder, he proudly tuned around the amateur bands hunting for morse signals and showing us his decoder locking onto them and decoding the morse. It was actually quite impressive, hand-sent morse can be a bugger to decode as the baud-rate varies so much. Eventually he happened across a very weak signal that faded in and out as we listened...

"Very weak, might be coming from the other side of the world" said Wook, "That'll be a good test!"

"Might be coming from the other side of the wall" thought crem...

Now, the message that *should* have been sent was [rummage in archived code]:

"CQ CQ CQ IF ANYBODY IS GOING TO ASDA I WILL COME ALONG TOO IF I TOLD THEM SHIT WAS GREEN THEY WOULD BELIEVE ME WHY DIDNT YOU TELL ME EARLIER YOU COULD HAVE HAD TEA AT MY HOUSE GW0OKI"

... which were phrases Wook had used the day before, plus a joke callsign, so I thought it wouldn't take him long to suss out they were from one of us. But I'd fucked up the lookup table in my code, so one of the letters was sent incorrectly. Add to this some errors from the decoder and gradually a confused message built up on screen.

"This is weird - sounds like someone I used to know, he used to say that about shit. Wish the signal was stronger, fading in and out like that means it must be coming from a long way away"

Frantic re-tuning from Wook. Frantic stifled giggling from crem.

"...Hmmmm. You know, I'm _sure_ I know this guy... he must have moved abroad... Hang on a second..."

A fair while passed, with Wook becoming more and more confused by this 'foreign' transmission and coming up with ever more bizarre explanations for its origin/purpose... Eventually, however, there was a dramatic pause as Wook started to realise he'd been had, which gave me enough of a head start to get away... Though it was touch and go - he was only a few feet behind after we'd descended three flights of stairs, nearly got me at the front door and would have caught me on the street if he'd been wearing shoes ;)

What's that got to do with pots, I hear you ask? My enduring memory of Wook is him standing over his prototype morse decoder and fiddling with various pots as he tried to decode this obscure foreign transmission.

( The original source code can be found near the bottom of this page: Source code )

From cix (7 June 2005)

And introducing crem's N+1'th law: "if you let someone else get involved with something simple, it will become complicated"...



From cix (22 Aug 2005)

We were warned - the people who introduced us to this application were fairly skeptical about putting anything technological in front of nurses.
Their opening remark was along the lines of:

"If you put a nurse in a locked room with two ball bearings she'd break one and lose the other"




From cix (8 Sep 2005)

This thread reminds me of the time I dragged myself out of bed and down to the kitchen at Des-Des towers (an otherwise unremarkable three-floor victorian dwelling in Manchester, where Design-Design used to lurk) and found a strange woman** sitting on a vibrating washing machine with a grin on her face. Being naive I asked her what was so enjoyable about the experience and was told more about internal sex aids than I needed to know... I decided against having eggs for breakfast.

Shortly after that one of the other guys arrived and, being even more callow than I was, offered to help redistribute the unbalanced load. This was not appreciated.


** I knew her very well - she was just strange.

Wednesday, August 27, 2008

Language fascists


I've been watching programmers parading their miserable ignorance again. The sort of playground squabble "My language is better than your language, my compiler's smarter than your compiler and my dad's bigger than your dad!" type of nonsense that would terminally embarrass a normal five year old, in other words the sort of reasoning few programmers ever advance beyond. Useless fuckers.

Grump. Snarl.

Think they'd understand if I show them allegorically how close their bigoted nastiness is to racism/sexism? No, it'd go wheeee-splat over their empty little heads. Tiresome pillocks... Gah...

[How about... Ponder...]



Heard the one about the programmer who loved and was fluent in C, the programmer who loved and was fluent in Pascal and the programmer who loved and was fluent in assembler?

When she wasn't writing software she was a pretty damned good hardware designer as well...



[Hmmm. Should I stop there? Would the target audience understand how much that exposes their stupid, narrow-minded prejudice? Would they even notice? Hmmm... Needs more...]


One day a stranger, a programmer of the modern ilk, who had travelled long weary years across the desert seeking enlightenment, laden down with objects and paradigms of the most exquisite kind, so wise in the ways of templates they were utterly incapable of actually writing code, arrived at her tent and, pausing unknowingly before the solution to all the questions he could possibly dream of having answered, saw only the dusky maiden; "Is your master about? And get me a drink could you, chop chop..."

And so the closest they came to enlightenment was the sound of one hand slapping...

[Too verbose. Far too verbose... Why do I waste my time on these people?]

** with that thought, crem is enlightened **