Categories
C64

A C64 Wall

Now, this is how I’d like to have a wall painted in my home-office, if it was large enough, and wasn’t already bulging with shelves and posters.

Patrick Nance posted this photo of his nerd room on this Commodore 64/128 group on Facebook recently, and it was very well received.

Categories
WordPress

Hide featured image if it’s in the post

I’ve been running a photoblog at inphotos.org since 2005 on WordPress. (And thanks to writing this I noticed it’s 15 years old today!)

In that time WordPress has changed dramatically. At first I used Flickr to host my images, but after a short time I hosted the images myself. (Good thing too since Flickr limited free user accounts to 1000 images, so I wrote a script to download the Flickr images I used in posts.)

For quite a long time I used the featured image instead of inserting the image into the post content, but then about two years ago I went back to inserting the photo into the post. Unfortunately that meant the photo was shown twice, once as a featured image, and once in the post content.

The last theme I used supported custom post types, one of which was a photo type that displayed the featured image but hid the post content. It was an ok compromise, but not perfect.

Recently I started using Twenty Twenty, but after 15 years I had a mixture of posts with:

  • Featured image with no image in the post.
  • Featured image with the same image in the post.

I knew I needed something more flexible. I wanted to hide the featured image if it also appeared in the post content. I procrastinated and never got around to it until this evening when I discovered it was actually quite easy.

Copy the following code into the function.php of your child theme and you’ll be all set! It relies on you having unique filenames for your images. If you don’t then remove the call to basename(), and that may help.

function maybe_remove_featured_image( $html ) {
        if ( $html == '' ) {
                return '';
        }
        $post = get_post();
        $post_thumbnail_id = get_post_thumbnail_id( $post );
        if ( ! $post_thumbnail_id ) {
                return $html;
        }

        $image_url = wp_get_attachment_image_src( $post_thumbnail_id );
        if ( ! $image_url ) {
                return $html;
        }

        $image_filename = basename( parse_url( $image_url[0], PHP_URL_PATH ) );
        if ( strpos( $post->post_content, $image_filename ) ) {
                return '';
        } else {
                return $html;
        }
}
add_filter( 'post_thumbnail_html', 'maybe_remove_featured_image' );

The post_thumbnail_html filter acts on the html generated to display the featured image. My code above gets the filename of the featured image, checks if it’s in the current post and if it is returns a blank string. Feedback welcome if you have a better way of doing this!

Categories
Music

James Last plays the Beatles

In the mid 80’s I found a cassette tape of Beatles music played by the James Last orchestra. While I sort of knew some of the music this was the first time I heard many of the songs and I preferred this orchestra version to the original!

The next time the Beatles would intrude on my life would be when I watch Red Storm for the first time in the early nineties.

I guess I have a thing for instrumental Beatles music. 🙂

Categories
C64

Solar Jetman on the C64

This is a game I’d forgotten about until recently when I saw someone playing it on Twitch. Solar Jetman came out on the NES in 1991, and conversions were made for the C64, Speccy, Amiga and Atari ST. Unfortunately due to poor sales of the NES original the conversions were never released.

Luckily the team at Games That Weren’t were contacted by Martin Holland, someone who knew about the game’s development.

GTW got to work and began to search for this elusive conversion, and started with Haydn Dalton, who sadly could not find anything of the game after some searching. Two years later, and a month or two after the site relaunch, efforts were made to find the game’s programmer, John Buckley as a last ditch effort. After tracing John down to PlaypoolUK, GTW got the news it dreaded.. John hadn’t got any of his old disks no longer…
But a week or two after almost giving up hope of finding the game, Haydn Dalton was one day searching through some things at home, when he stumbled upon a disk with the label missing. The label was in there too, and stated “Solar Jetman Disk 1”, and after a bit more digging, Haydn found the second disk.

GTW

It’s a fascinating story of digital archaeology and the game now be found in various places including the Solar Jetman page on GTW! You can play the original version on archive.org, but Triad released an excellent version that packed the game into one disk side, and trained it too.

The game itself is like Thrust or Lunar Lander, but it came later and is much better than both! Controls are easier and enemies are more varied so if you liked those games you need to try Solar Jetman.

The conversion is missing a few things present in the NES version, and apparently the maps are a little cut down from the original. I need to download the NES version and give it a spin too!

Blow the Cartridge

What do you see when the game ends? Vinny has the answer and posted it on the (old) C64 Game Endings site here.

I discovered an interview with John Buckley, the developer who worked on the C64 version.

What were your first and last ever productions on the C64?
The first thing I did on the C64 was called Jeep Command. I did this in my spare time including the graphics and sound FX. If you have seen it, you will know I ain’t no artist! I sent it off to Bug Byte I think, and they put some music on it and shipped it out. The last thing I did was Solar Jetman, which never got released… until now.

Out of all the games you have worked on, which were you most proud and disappointed with?
I can’t say I am disappointed with anything I worked on. Most of them were conversions, some I wish I hadn’t of worked on but such is life. I liked working on Solar Jetman on the C64 but overall I am most proud of PLOK on the SNES.

Interview with John Buckley on C64.com
Categories
C64

Before I knew about revision control

Going through some of my old C64 discs and I found a bunch of “work in progress” demo parts and routines I was playing with.

Back then I didn’t know about revision control but it was a pleasure to find these bits and pieces of code that I had completely forgotten about. Here’s a few screenshots from Vice, but it’s shocking the difference between Vice and real hardware. The cascading Ozone logo is very pale compared to what I see on another screen. Could it be the screen? Or is it the emulator?

These were found on disc 23, side 1. All those discs are littered with small files, chunks of code that I was working on before throwing them together in the Action Replay monitor.

Kids these days are spoiled with their fancy editors. 🙂

Categories
Humour Youtube

Did Somebody Mention Cork?

Regional accent discrimination? Foil Arms & Hog show are spot on with their accents!

Categories
Science

Rebooting the Apollo Guidance Computer

If you can’t get enough of the Apollo missions after my last post watch as the Apollo Guidance Computer (AGC) is booted up. See inside the machine at the ropes used to store information and marvel at all the little wires that made the landing on the Moon possible.

For more check out this playlist on Youtube.

If that’s not enough I highly recommend listening to episode 220 of The Oribital Podcast. It has an excellent interview with Ron Burkey that will have you enthralled (well, maybe, if you’re like me and find the archaeology of old software interesting!)

The episode show notes link to scans of the original source code and transcribed copies of the code on Github!

Find scans of the source code above on archive.org and the same code is on Github too!

Categories
C64

An Intro to 6502 Assembler

In the bad old days of the 80s and 90s computers weren’t as fast as they are now. You had to fill ’em up with leaded fuel and they were noisy and hot and you had to keep the windows open to let the fumes out.

Well, maybe not. They weren’t as fast as the handheld machines in our pockets now but I’ll bet that a larger percentage of users back then at least tried to code something. People had to because it wasn’t always easy to get games. You had to go down the shops and get out of the house to buy any new software! You had to open the manual to find out how to load anything!

So it was that I figured out that I’d rather be coding than playing games, and with the purchase of a book on assembly (that has sadly gone missing in the last year) I got busy and created a bunch of demos on the C64.

I wish I’d had this video to watch when I was starting out! If you’ve done any sort of assembly programming it won’t be anything new but it’s presented in an easy to understand manner and is worth watching if you’re at all curious about how computers work because a lot of the terminology is going to apply to other systems too.

I’m really looking forward to seeing the rest of this series. I want to get back to doing some assembly programming. There’s plenty of documentation out there but it’s a matter of finding the time and energy to do it.

Categories
C64

We Come in Peace Demo

This is just amazing. All done on a lowly C64 by Censor Design and Fairlight. Grab the demo from csdb. Unfortunately it doesn’t work in the SD2IEC because it has a fastloader. I should buy an Ultimate II+ or Ultimate 64 shouldn’t I?

Categories
C64

C64 Spotted in Cash Connectors

In Cash Connectors, North Main Street Cork. €119.99 for a C64, datasette and I think 4 games. No mention of whether it’s working or not or even if it comes with a power supply.

First time I’ve seen a C64 in a shop here in years. Last time might have been in Maddens on Princes Street some time in the early nineties.