Chariots of Fire

23.07.2007 0:15

Chariots of Fire is a short (260 bytes) program for Galaksija that plays a part of "Chariots of Fire" track by Vangelis.

The music it produces resembles some of the more advanced beeper music from Sinclair Spectrum. I was always curious how people were able to reproduce anything else than simple tones on a 1-bit D/A converter and this small program was nice a opportunity to learn about it.

It turns out that the code implements two independently running loops with a slightly different frequency. Each one of them changes the state of the audio output on each iteration (from 1 to 0 or 0 to 1). Result is an oscillator that slowly changes its duty cycle from 0% to 100% and back again. Here's the waveform of one note:


The changing duty cycle periodically shifts the signal's energy from lower to higher frequencies and back again. Since the beeper (or whatever is between the audio output and your brain, including your ear) has a limited bandwidth, a lot of the higher frequencies get cut off. This means that the sound gets periodically stronger and weaker, which can be used to produce the illusion that the square wave signal has an envelope added to it.

Compare this with a simple square wave of the same frequency:


And here is the same square wave with an added envelope, roughly matching the changing duty cycle:


Posted by Tomaž | Categories: Code | Comments »

z80dasm in Debian

17.07.2007 11:57

z80dasm was accepted to Debian unstable yesterday.

Posted by Tomaž | Categories: Code | Comments »

Pretty pictures

16.07.2007 13:17

Some nice photographs of a circuit I have on my bench right now:



Really close

Posted by Tomaž | Categories: Life | Comments »

Dancing Demon on Galaksija

15.07.2007 16:04

Dancing Demon was a famous game for Tandy TRS-80 model I written by Leo Christopherson. I found out about it when I was researching the origins of Galaksija's operating system.

It turns out TRS-80 and Galaksija not only have very similar BASIC interpreters but also very similar graphics capabilities (which led me to believe Galaksija's ROM was based on Tandy's ROM, not Microsoft BASIC, but that is another story). To prove that, I ported Dancing Demon to Galaksija:

Dancing Demon on Galaksija

(Click to watch Dancing Demon on Galaksija video)

Of course, the whole program didn't fit into Galaksija's 6 kB of RAM (I believe the TRS-80 model on which the original Dancing Demon ran had 16 kB). I had to strip away the editor and basically everything else except the dancing animation (however you can still edit the dancing routine with BASIC editor in Galaksija's ROM). Melody playback also didn't make it (besides, Galaksija's software video would make that tricky), but I did manage to preserve the clicking sound (played back through Galaksija's cassette port, of course).

Source will be included in the next release of Galaksija development tools.

Posted by Tomaž | Categories: Code | Comments »

Googlebot gone crazy?

15.07.2007 1:09

Google's bot did more than a gigabyte of traffic on in a couple of days. What the hell is going on here?

37 different robots*HitsBandwidthLast visit
Yahoo Slurp13378+10797.60 MB14 Jul 2007 - 06:19
Najdi.si3981+157137.21 MB14 Jul 2007 - 06:19
Googlebot1967+261.23 GB14 Jul 2007 - 06:13
MSNBot926+34920.20 MB14 Jul 2007 - 06:08
Unknown robot (identified by 'crawl')804+68.09 MB13 Jul 2007 - 14:44
Feedfetcher-Google600550.31 KB14 Jul 2007 - 05:56
SBIder197+1991.29 MB14 Jul 2007 - 06:06
Yahoo-MMCrawler321+53.86 MB13 Jul 2007 - 18:25
MJ12bot317+33.30 MB04 Jul 2007 - 03:29
Nutch101+921.30 MB13 Jul 2007 - 17:42
Others226+1893.06 MB 

From the logs it appears that it has been downloading and re-downloading my Galaksija demonstration video. I'm moving it away for now.

Posted by Tomaž | Categories: Life | Comments »

Sony RDR-HX710

13.07.2007 17:33

Here's some assorted information about Sony RDR-HX710 DVD/hard disk recorder (because I like spoiling business for people that are selling trivial information like this on various forums for 10$ apiece):

  • To get into the service menu, turn the recorder off, simultaneously press REC, REC PAUSE and REC STOP on the front panel and while they are pressed turn the recorder back on with the ON/OFF button. You can then use the remote to navigate the service menus.
  • MIP3E7MY integrated circuit in the power supply can be replaced with MIP3E3SMY without any obvious side-effects. This is however only based on experimentation. I couldn't find datasheets for the original chip, so this replacement may not work to specifications. YMMV (by the way, while this looks like a transistor it really contains complete power supply control electronics and a high-voltage power MOSFET).
  • When removing the power supply from the case, be very careful and only touch it along the edges. When it's out, take a resistor and discharge all the big capacitors on it (even if you think those capacitors are already empty). Unless of course you would like to sport a couple of new burn marks on your hands. Fun fact: there are places on the circuit board for bleeder resistors, but they are empty. I guess marketing department won an argument there (this reminds me of a certain domestic computer).
  • Hard disk is a normal 160 GB Seagate with IDE interface. No partitions and no easily recognizable video streams.
Posted by Tomaž | Categories: Analog | Comments »


10.07.2007 14:11

When I was designing Galaksija's video amplifier I did some reading on the design of analogue (now called low-definition) TV systems. It's impressive how much science and research went into this.

The resolution of various components of the video stream (luminance, chrominance) for example was chosen on the basis of research into the capabilities of the human eye. Only some relatively minor design decisions were based on technology limitations of the time (like interlaced picture).

Now suddenly there appears to be a general opinion that these 40-years old specifications aren't good enough and that everyone should move to new HDTV standards. These new standards seem to be based on a race who will cram more pixels on the screen rather than some scientific method (it seems they can't even decide on a single picture format).

So I wonder: either the designers of the original TV missed something and the resolution of the analogue TV is really smaller than it should be or are HDTV systems designed only so that they look better in the shop when you're looking at them from a much shorter distance than usual and can actually see the difference in the resolution.

Posted by Tomaž | Categories: Ideas | Comments »