Introduction to C64 demo coding

ozone
.C:2101   A9 3A      LDA #$3A
.C:2103   CD 12 D0   CMP $D012
.C:2106   D0 FB      BNE $2103
.C:2108   A2 09      LDX #$09
.C:210a   CA         DEX
.C:210b   D0 FD      BNE $210A
.C:210d   A2 00      LDX #$00
.C:210f   BD 00 09   LDA $0900,X
.C:2112   8D 21 D0   STA $D021
.C:2115   8D 20 D0   STA $D020
.C:2118   BC 00 0A   LDY $0A00,X
.C:211b   88         DEY
.C:211c   10 FD      BPL $211B
.C:211e   E8         INX
.C:211f   E0 65      CPX #$65
.C:2121   D0 EC      BNE $210F
.C:2123   A2 01      LDX #$01
.C:2125   CA         DEX
.C:2126   D0 FD      BNE $2125
.C:2128   A9 00      LDA #$00
.C:212a   8D 20 D0   STA $D020
.C:212d   AD 21 D0   LDA $D021

So, who knows what’s happening above? Come on, it’ll come back to you if you look at the screenshot! I found a great tutorial on C64 demo coding. Unfortunately it’s a 404 now, but Google cached it and I downloaded it here for safe keeping: intro-to-programming-c64-demos.html
Look for the part on $d012

$d012 might be the most important address of them all, when it comes to demo programming on the C-64. $d012 has two different functions:

* When read, it returns the number of the current raster line.
* When written, it is used to set the number of the line where the next raster interrupt will occur.

We’ll get back to raster interrupts later. You need to know about $d012 to understand them, so pay attention to the stuff in this section! The first item above is interesting, but it may not be obvious why it is interesting.

The current raster line is the line that is currently being redrawn on your screen. The whole screen is redrawn 50 times per second. Each time it is redrawn from top to bottom, from the left to the right. So, if you want something to happen 50 times per second, all you have to do is to check the current value of $d012, and when it reaches a certain value, call the routine that performs the desired task. When finished, go back to checking $d012.

That blew me away when I found out about that. You could literally change the background colour of the screen halfway down the screen, have multiple text and graphics modes, use more than the default 8 hardware sprites. The PC was disappointing in comparison.

That code above is for Justin who reminded me that Vice has an ASM monitor!

It's so hard to sell a laptop on eBay

Sometimes blog posts take on a life of their own. Occasionally they attract the wrong sort of attention. I made a brief post called, Laptop for sale back in 2003 and ever since that post has been collecting comments from Nigerian scammers. It’s bizarre.

Last month one of them got smart. They subscribed. Here’s the email Tobi sent me when he got the confirmation email from Feedburner.

laptop email

Being curious, I checked the email headers. Luckily, Yahoo records the IP of the user who sent the email:

Received: from [83.229.91.53] by web58309.mail.re3.yahoo.com via HTTP; Fri, 14 Dec 2007 19:23:22 PST

Armed with that bit of information, I checked out 83.229.91.53 only to discover he wasn’t in the grand old US of A at all! I was shocked!

inetnum: 83.229.89.0 – 83.229.91.255
org: ORG-SA410-RIPE
netname: Supernet
descr: Supernet
country: NG
admin-c: TS3788-RIPE
…….
[clipped for brevity]
…….
address: 8th Fl 21 Mobolaji Bank Anthony way
address: Ikeja Lagos
address: Nigeria

I toyed with the idea of stringing him along but it was the run up to Christmas and I never got around to it. I had to dig up the email this evening because this was too good not to share.

Anyone remember the 419 Monty Python sketch from a while back?

The Irish Army are staying alive in Lebanon

Staying alive, staying alive, Ah, ha, ha, ha, stayin alive.

This video is being investigated by Irish Military Police. I heard on the radio this morning that it’s unlikely that prosecutions will follow. Hopefully, because these guys have a great sense of humour! It must be good for morale too, especially in the face of road side bombs and resulting injuries.

Military police are investigating an internet video which appears to show members of the Defence Forces playacting with rifles while on peacekeeping duty in Lebanon last year.

The video, posted on YouTube, shows three soldiers with rifles dismounting from a personnel carrier and proceeding to jive to the Bee Gees song Stayin’ Alive.

I have to admit, the British Army did a great job with “Show me the way to Amarillo” ..

Can the US Army top either of those?

ladyproblems.com

When Aunt Irma visits the IT Crowd office it can only mean hilarious consequences for all involved. Even Roy and Moss suffer from menstrual cycle symptoms and grow irritable, delicate and emotional. Not to mention the breast tenderness..

It all blows up when Moss emails everyone he knows in the IT world asking, “Do we have PMT?” describing the symptoms in detail. Riots are the result and a website, ladyproblems.com is created!

ladyproblems.com

The producers of the show did actually register that domain, but it’s a shame they didn’t do anything with it. Even putting up a landing page with that image above on it would have been better. At least Warner tried a bit harder with “2 and a Half Men”, charlieharpersucks.com actually exists! Oh well.

Registrant:
FremantleMedia Limited
1 Stephen Street
London, London W1T 1AL
UK

Watch this episode on Youtube: part 1, part 2, part 3. (Watch the previous episode too, The Haunting of Bill Crouse. That was so funny I almost hurt myself laughing..)

On to series 2 of The IT Crowd, I hope there’ll be a third one!

Facebook advertising on a shoestring

You’ve got an interesting project to advertise but your advertising budget is, nil, nada, nothing. An empty box of air is worth more than you can spend on getting the word out.

That’s sort of what Frank said when he asked me (and I presume a number of his friends, the Facebook email is generic) to help get the word out about the new play in the Granary Theatre, They Never Froze Walt Disney.

I was wondering if you would help me out with an experiment… you may have noticed I am trying to get the word out about ‘They Never Froze Walt Disney’ – and I would love your help!

Would you mind changing your status on Facebook to read:

<your name> is letting people know about They Never Froze Walt Disney. See theatremakers. net for more details!

Always eager to help friends if I can, I updated my Facebook status. Will it help? Does anyone look at my profile? I doubt it, but it can’t hurt.

The latest teaser trailer is really, err, strange. Can’t we see a bit more please? TBH, it looks depressing!

Here’s what Frank said before the original production last year in the summer:

Funny and poignant, dark and yet light hearted, the writing is really tight and the story unfolds beautifully. Also the two performers (Jody O’Neill and John McCarthy) are excellent actors, and though I personally haven’t seen Jack Healy direct before he is extremely well known in the Cork theatre scene, and I have a lot of respect for him from acting with him and attending his workshops.

Check out my photos from one of Frank’s previous shows, The Importance of Being Earnest. We really enjoyed that show, but getting out to the theatre is a little harder to do these days with a small baby around!

They Never Froze Walt Disney
The Granary Theatre, Cork
8th-12th January at 8pm (preview January 7th)
Bookings & Info: 021 490 4275

Phoar! What a spike!

I released WP Super Cache 0.5.3 on Friday last. From the stats it looks like people are upgrading which is good news!

This version has a number of fixes and improvements:

  • If your blog is installed in a sub-directory you’ll want to upgrade. This version fixes the mod_rewrite rules that search for the cached files. If upgrading, make sure you delete the Super Cache rules so they’ll be upgraded. (Thanks Otto42)
  • With a click of a link in the backend page you can view your mod_rewrite rules to check that they are ok. This may help the adventurous who want to upgrade those rules manually too.
  • The plugin now warns if your blog’s root directory is writeable. Most of the time there’s absolutely no reason for this so it’s good to be reminded to fix it.
  • Check that $mutex is set. This is really only useful if your server is borked and the filesystem is mounted read-only but it’s good to be complete.

Wondering about the title? Check out this traffic graph Scott Beale posted a few weeks ago and you’ll understand. One of his posts hit the front page of Digg (twice) then Slashdot.org, and was covered by lots of other blogs and media. Wow.

On December 12th our blog hit a record high of 222,523 views in one day.

Best Buy Cease & Desist Traffic Stats

Apple Store Promotion Code

So I was looking for a new battery for my Apple Macbook laptop and popped on over to the online Apple Store, picked up the battery, filled in my credit card details and then I was presented with this tempting textbox.

Apple Store Promotion Code

Hmm, could I save a few quid if I had a promotion code? I went searching for one as I’ve had luck elsewhere saving a bit of money online. Clicking on the first link appeared to be a forum thread. It quickly became obvious that lots of people were in the same boat, and judging by the 51 pages of posts by “macrumors newbie” status users they’re a lot more desperate than I am.

Oh well. The battery was €139, including €24 VAT which isn’t too bad. Should arrive in a few days time. I’m using Coconut Battery again to monitor battery usage, but this time I’ll try the battery calibration techniques on the new battery first.

PromoCode Needed!
I got some money for Xmas and i want to buy a macbook at the apple.com store.

Can somebody please send me a promocode ?? Fast?

Looks like someone was offering promotion codes to the first 2 to PM him.

Apple is folding it’s biz agent program at the end of 2007. As a going away present, I’m putting my last two codes out there for you, dear reader.

The fine print:

* They expire 12/28 (yeah, that’s tomorrow)
* They are NOT good in the ed store
* They are NOT good if your company already as a deal with Apple
* They ARE good for refurbs

Please don’t ask for it if you can’t use it. If you CAN make use of it, PM me and I’ll send it your way!

Who or what is Xeer?

I used to go by the handle, “Xeer”. It’s under that name that I coded Commodore 64 demos many years ago. There’s even an entry for me on the C64 Scene Database! Exciting times then, but I’ve often been asked where the name Xeer came from. Now I can reveal it’s very obscure origins.

You may have heard of a space trading game called Elite that was released in 1985. If you haven’t, then don’t worry. You’re a youngster aren’t you? It made serious waves in the games scene for many years and even spawned an awful sequel on the PC a couple of years ago.
Anyway, I came across the game a few years after, probably in 1988 or ’89 and was hooked! I have to be honest, I preferred the shoot-em-up parts to the dry and boring trading bits. Games never lasted very long but it made a lasting impression on me.

One thing led to another, and I became interested in the C64 demo scene, but I needed a handle. Luckily I came across a few cheats for Elite that gave me infinite fuel or some such other nonsense and went looking around the galaxy. Here’s what the galaxy looked like back in the late 80’s.

Elite Galactic Chart

While exploring, I came across the little planet under the cursor above. Can you guess what it’s called? Yup, Xeer. Here’s the info sheet on it.

The planet Xeer

I haven’t seen any large yellow bug-eyed frogs about anywhere but I expect they’ll show up sooner or later.

More Xeer trivia: The traditional Somali Constitution is called Xeer, although the linked page on combackalive.com makes little sense to me. Anyone from that region know more?
For the Elite fans: The Zzap64! review.

10 years of me

I’ve been writing online for 10 years. Well, strictly speaking it’s longer than that because my Geocities site was last modified in 1997 and it’s still alive. I might yet import that site into this blog at some stage. Thankfully I had enough of HTML frames after that. I created a simple site on indigo.ie in late 1997 but then moved everything to http://members.xoom.com/xeer/ which later became members.nbci.com and is now long gone. xoom.com is now quite a different site!

I called the site DemoNix. It never had permalinks, but I did update it with a Perl script that built static html pages with a basic theme and then FTPed them to xoom.com. That script and the build files are long gone but thanks to the Wayback Machine I recovered a fair portion of it. All the original content I could scrape together is now in the Demonix category on this blog. I generally wrote about Linux demoscene news, code tutorials, gossip and my first 2 GPLed projects: “Time Sheets for Networks” and “Install Sendmail”. TSN as I fondly called it doesn’t exist any more but it was my 4th year college project. It was terrible. Buy me a pint some day and I’ll reveal just how bad it was. I wrote Install Sendmail because Sendmail was such a bitch to configure in those days. It was wildly popular, even being linked from the Fetchmail homepage. It still exists although the download link is now broken. It’s a sign of the times that nobody has complained about that.

Dave Polaschek recently reminded me that the web was a much smaller place back then. It was much easier to be noticed and get to the top of the pile if you posted consistently and well. My DemoNix site was read by many and even linked from a Slashdot story about Bladeenc in 1998. I’m sure it’s a simple coincidence that members.xoom.com went offline around the same time for a day or so ..

I could write more, but it’s all contained in the archives of this site. Everything from enthusiastic exclamations about the latest demos or code snippets to the short announcement of my mother’s death in December 1998. I still remember the email Mark sent me after I made that post. There were no comments in those days.

Awareness of Reality As this is a self indulgent look into the past, grab a Commodore 64 emulator and download donnchac64.zip. It’s a collection of demos and bits and bobs I wrote (or co-wrote) on that machine from early 1992 to late 1993.
Emulating a Commodore 64 is not without it’s problems. “Awareness of Reality” doesn’t seem to load properly in Vice. The speed loader I used doesn’t like the emulator and I have yet to figure out what the “left arrow key” is on a PC keyboard. That key is used in AOR and “Ionsai on Gealach”, my award winning Galaxians mod! It’s great to hear those old tunes again though.

10 years down, many more to come I hope. I’m now a dad, married to my beautiful Jacinta and work at the cutting edge of blogging with the WordPress folks. Great times.

AOR disk listing

Lunch at the Blue Haven Hotel, Kinsale

Shih Tzu with ball on beach We’ve been busy calling to relatives and making our home baby proof over the last week, so we went down to Kinsale and Garrettstown this afternoon to get away from it all. Even though there was a strong cold wind blowing in off the sea Garrettstown Beach wasn’t deserted. People were out and about walking their dogs, some with kids, others with tiny babies. Oscar, our Shih Tzu, had lots of fun chasing after a tennis ball that seemingly had a mind of it’s own as it arced through the air!

Back in Kinsale we met a friend for lunch in the Blue Haven Hotel. The hotel has been there for years but recently underwent a facelift and is beautiful and luxurious inside. Despite the crush of post-Christmas punters looking for food and/or a drink staff were great and found us room for Adam and a baby seat. I ordered an open steak sandwich while Jacinta had fish and chips and Niamh ordered salmon linguini.

Service was a little slow but as the staff were run off their feet it’s understandable. Adam was fed and watered by the time we were served our food, and we made short work of it. My steak sandwich was nice, if a little on the small side. Chips were salty but tasty. The Christmas pudding I had for dessert filled me up nicely though!

So, I definitely recommend the Blue Haven Hotel for a meal. This was our second time there in the last month. The last time I had their burger. It’s a beautiful hotel, food is good, and it’s very baby friendly!

Blue Haven Kinsale Open steak sandwich

Blue Haven Receipt

Blue Haven Hotel Burger