fredag 25 november 2016

Measuring the pin-out of a Commodore 64 joystick.

Let's say your old C64 joysticks are worse for wear and you neither want to buy a brand new, over-priced Competition Pro, nor any second hand joystick. Then one option is to build a new one, but to do that, you need to know the pin-out of the Commodore DSUB9 joystick port.

Of course, this information is readily available on the Internet - just google it. However, isn't it more fun to measure it oneself?


Apart from a (preferably) working joystick (I'm using my beloved Slik Stik, the TAC-2's little sibling from the same company, Suncom - you can see that it is held together with duct tape, the screw holes gave up after all the times I've opened it to clean the conductive plates...). you need a multi-meter (although a battery, small light-bulb and some wire will also work) and either probes small enough to fit the holes of the joystick's female contact or, like I have, a lose male contact. With this one, it was easy to attach the joystick and test the pins even with my chubby multi-meter probes. Then the only thing you need is some patience as you systematically test the pins, two at a time, while sequentially engaging the stick in each direction and the fire buton (or you  do like me and just verify a pin-out pulled from the net to save some time). 

So I can add my own Commodore (Atari too, by the way) joystick DSUB9 pin-out to the Internet (and vouch for the authenticity of the others):

Up  Down  Left  Right   n/a
 1        2        3       4        5
      9        8        7       6
    n/a  Ground  n/a    Fire

måndag 11 april 2016

Making Inkscape-generated SVGs Visible in All Browsers (i.e., Internet Explorer...)

One of my many long-term, rarely worked on projects is the "Fotogenealogi" ("Photo-Genealogy") project, where me an my wife borrows old photos of our ancestors from relatives to let them be professionally scanned and sometimes a bit retouched if the original has a lot of wear and tear. By now, we have quite the collection, sometimes going back four generations to the second half of the Nineteenth century.

Recently, we processed a photo of the guests at my grandmother's brothers weeding (in which my father is a fresh teenager) and as most of the people was unknown to me, I had my father identify them for me. When trying to write a clear-to-follow caption, I realized that I needed a glossy-magazine-like silhouette version of the images, with numbered outlines of all the persons, to make the caption a breeze to write.

Thus, I loaded the high-res scanned original into Gimp, added a front layer with transparent background, painstakingly filled in the contours of each person with a broad brush (I first did it with a 1-pixel thin line, but that led to too many holes that created problems in the next step), saved just that layer as a png, ran Autotrace to vectorize the outlines into an esp, imported the esp into Inkscape to fiddle with the stroke width of the outlines, adding numbers to their heads, and differentiating the various nuclear families in the picture with different pastel fill-colours. As Inkscape nativly saves images as svg:s we're home free, since all browsers support them, right?

Wrong! It displayed just fine in Google Chrome and Firefox but in Internet Explorer, with a height-directive to the img-tag, they didn't display at all... Despair! However, after some searching, I found Triangular's illuminating blog entry https://triangle717.wordpress.com/2014/06/07/ie-inkscape-svg/ which provided me a way forward.

It's not enough to save the image as an default Inkscape svg but one need to save it as an Optimized SVG and click in "Enable Viewporting". Then it works as it should in Internet Explorer with img-tag re-scaling and all. Number 22 is my teenage father.

tisdag 5 januari 2016

Spotify on the Kitchen Media Centre

I've held on to the free Spotify account I've had since you got to have an invite to get one (2008/2009 or so) and never bothered to upgrade since the commercials hasn't been that annoying (the more recent daily cut-off is worse). However, for convenience, on our last trip abroad, we kind of needed the ability to access a large catalogue of music and play it uninterrupted, so I did go premium (enjoying their X-mas discount).

That, in turn, led to my wife becoming hooked on Spotify on the tablet which led her to once place the tablet playing songs off Spotify on the speakers of the kitchen media centre, in front of the kitchen media centre touchscreen...Well, we can't have that, can we? 

Some googling later, I pulled the zip-archive of SpotiMC off http://azkotoki.org/downloads/ and installed it. Works well, although playing the playlist in my account seems a bit buggy with tunes falling silent in mid-song and then, sometimes after minutes of silence, all of a sudden starting on the next - everything else (searches and playing the resulting hits) works as expected. 

Though one quirk is that there is no easy access to a touchscreen friendly volume control from within the SpotiMC interface - not until the screen-saver blackens the screen, after which, if you wake it, you are in the "normal" Kodi tune-playing window with the on-screen volume control bar. As they say, patience is a virtue.

UPDATE 2016-01-19: The problems with the playlists seems to have been some gremlins in the system, now it works just fine to use playlists. Also, I've discovered that if you tap the "now playing" area decisively, you're transported from the SpotiMC view to the regular OpenElec song-plaing view and can access the Re-Touched skin volume control bar as usual.