Saturday, 11 March 2017

Black Eye HD macro

I got hold of a Black Eye HD macro lens for my battered iPhone 4S. The device is attached with a clip over the camera lens and off you go.

That's not the iPhone, sadly.
I'm interested in getting close-ups without having to set up a "real" camera, so the Black Eye lens is good for practical shots such as work documentation in micro-scale and the like.

And all right, some funny retro-detail shots of old machines. Boy are those old keyboards dirty...

Checking out the ZX Spectrum Recreated keyboard shows some manufacture quality issues...

The lens gives pretty nice results, considering my old 4S camera is not that great and the lighting was a bit poor for these shots.

When the scale is this small, the phone is pretty easy to set against other surfaces to reduce camera shake. Also, the iPhone camera focus adjust works here, although usually it's better to fiddle with the physical distance to get desired results.

The clip attachment is fine with the flat iPhones, showing that a rectangular form often makes sense in a primitive but clever object-ecosystemic way. I'm not too convinced the lens would fit as easily on "all cameraphones", as some have an inconvenient button or curvature near the camera lens.

You need to click on the images and open them in new tabs to get the larger versions, which are already 50% reduced.

Another pic of the Recreated

Tuesday, 28 February 2017

Saboteur II - The Avenging Angel remake

The saboteur, doing her sabotage.
After the excellent Saboteur remake for web browsers, Clive Townsend, the author of the Saboteur games, has released a similar treatment of Saboteur II - The Avenging Angel.

I waited for this release with mixed feelings. On 8-bit computers, Saboteur II from 1987 felt less good than the original. Slow, giant-size map with repeating rooms, difficult and random fighting. This type of opinion was also echoed around the 'net, so I never really found myself back with the the game.

Even then, I also felt that on certain points, the sequel was an improvement over the first Saboteur game. You can select your own entrance by dropping from the glider, and you can sneak a bit around the building and not only inside it. The jumping is much more fluid and there are no frustrating jump sections. The ninja can do a satisfying somersault which has more subtle uses than in the first game.

The Saboteur II remake

Enough of that, what's the new game like?

With the Saboteur 1 update, Clive had done an excellent job of enhancing the outcome without altering the game play inside the original game area. Here I was worried that the second game could not work without fundamental changes.

Now that the game is faster and there is more to see, I'm happy to say Saboteur II becomes much clearer and better without any real alterations to the game core. For example, now I finally see that the different missions encourage taking different routes within the complex, whereas Saboteur I was bounded to the one back-and-forth journey with variations.

An example of the kind of attention to detail that has been put in the new graphics.
There's more visual detail, locations and "intel" points and achievements where you learn about the background of the complex. Another nice added detail is the enemy energy bar, which is also shown alongside the player energy. Although it confused me a little at first, this makes the fighting rules more clear and a bit easier.

The missions and some game play aspects have been tweaked a bit. I see the items are no longer placed in "stashes" of multiple items, and the code locations don't have items in them. This is a reasonable streamlining as there was no real benefit from the stash system. A tiny difference is that the missions are now properly locked away, and you can't use a code from a magazine to unlock them :)

As with the previous remake, there are also added game screens and plot elements, which are here revealed in a more piecemeal fashion. After completing a few missions you'll discover there are doors that lead to new rooms... and yes, there's also a new section after all the effort and that's all I'm going to say for now. Let's just say I like the way the new narrative unfolds. Just take heed of all the intel and achievement notes and you'll get an idea what you might be missing. Also, the background in the loading screen is a map, too.

The Amstrad CPC style shows Nina as a redhead!
But it is a bit difficult at the very beginning! I died a dozen times in the first few screens when I started out, but after this initial frustration I took a deep breath and looked at what was wrong with my play style.

Some playing tips

For absolute beginners I'd recommend avoiding the androids, running away from them, or finding routes where you don't have to engage them. This way you can get a better feel of your way in, out and around the complex.

Eventually you have to learn to fight, ninja-style. Nina can do more fighting moves than her brother, but I'd suggest using the flying kick (run + fire) as the primary form of combat, as you can at the same time distance yourself from the androids and keep on fighting. A flying kick followed with a punch can be a devastating combo, but you need to get the rhythm of the fight correct. The crouching kicks are good for the pumas.

Serious moonlight!
The thrown items are as good as one kick, which can make the difference between life and death in some places. Ideally, throwing an item followed with flying kick+punch will destroy an android extremely fast. Got to appreciate the new splintering effect when throwing stuff at the androids!

Situations where two androids are close up can be dangerous. At places, you need to clear yourselves "home space" before climbing up or down a level, because you can't rest while on the ladders between two floors.

As in the original Saboteur 2, there are also some "silly" points where you can rest. These are spots the androids won't enter, despite what logic might say. Take note of such places.

The Avenging Angel

To me this release is just as good or better as the Saboteur! remake, but for slightly different reasons. I appreciate the way the game is able to enhance and finalize Saboteur II: The Avenging Angel in a way that makes me say this is the game it ought to have been, or always was in its heart. The added material, different graphic modes, various music tracks and other improvements here and there make it so much more. I can only hope Saboteur III will be made, combining the best elements from both games.

Get the game(s) from here

My thoughts on the Saboteur! remake here

Friday, 24 February 2017

8-bit journeys into pop culture

Again, some recent 8-bit images, added with musings and reflections. Funny how it all tends to go back to TV/Sci-fi/film themes...

Dallas (128x192 Texas Instruments 99/4A bitmap)

The first image is for the mega-demo Don't Mess with Texas by Desire, for the Texas Instruments 99/4A computer. The coders have done an amazing work in demonstrating the hidden capabilities of this very limited and idiosyncratic old computer. I had a small piece in the demo, a half-screen image which is shown for a couple of seconds of the eight-minute runtime.

I went with "Dallas", as it was one of the first things that came into my mind with that Texas-theme. It also fits nicely as Desire and Dallas have both a D and the same amount of letters.

I never really watched Dallas but in no way could the phenomenon be avoided
As the TI99/4A has the VDP chip, the graphics capabilities are nearly the same as in MSX. The TI community claims that the palette is at least somewhat different, so although I worked the image mostly in the MSX colors the end result is in an interpretation of the TI99 values.

I don't like to use references, but here I needed to use photographs of the actors. Even then these are not very directly worked from any one photograph, and the 8x1 colorspace really makes you reinvent the images anyway. Ok, the MAD Magazine parody "Dullus" opening shot probably influenced me more than I'd like to admit.

The aim was to showcase the color capabilities of the VDP/TI. So, superfluous horizontal color bars and candy-like coloring here and there. The pic is a bit rough in the details but I supposed that as the authentic target is a television tube, it would not matter so much.

Alien (160x200 Commodore 64 multicolor bitmap)

The second image was made to enhance a cracked C64 version of the game Alien (1984), based on the film. The Hokuto Force crack (Alien +6DG) enhances the original and I was asked for a xenomorph pic to accompany the release.

Somehow it reminds me of the Mortal Kombat logo?
I now examined some images of the Alien, going back to the original film props when possible. The more I looked at images of the actual suit that was used in the filming, the less impressive it became. Don't get me wrong, Giger's work is obviously a classic. It's simply that the way the prop/suit is used in the film does not reveal how humanoid-like the costume really was.

So, the mystique of the Alien is not only about showing it in very few scenes, but also revealing very little of the actual shape, the guy-in-a-suit nature of it. I wonder which then is the "correct" alien, the impression left by the film or the actual prop used?

However, these thoughts did not really impact the result that much. This is more a graphic emblem of the Alien than an impression. I changed the proportions a bit, exaggerating the tail size and shape to create a circular composition that is partly reinforced by semi-circular elements in the centre.

The game is pretty neat, I've played it on a ZX Spectrum a few times. It's a bit similar to the later Shadowfire in having multiple characters that are real-time icon controlled. According to World of Spectrum, John Heap has worked on both of them, so that maybe explains the similarity!

Info about the release at CSDb

Beam Us Up (16x23 characters PETSCII directory art)

The third image is my first attempt to make "dir art" for the Commodore 64. Directory Art refers to graphics made inside the directory portion of the disc filesystem. So instead of seeing the ordinary list of files via LOAD "$",8 there are logos and visuals instead. Crackers and demo groups used to embellish their releases with such graphics, and still do.

Screenshot of the directory, but LOAD "$",8 is the real way to experience them.
I made a very old-school PETSCII that fits the screen. My main motive was to include the " characters into the image, as these normally frame the filenames. I came up with this Star Trek themed pic, a little bit related to the non-standard PETSCII of Mr. Spock that I once made for the print magazine Skrolli (see below).

In my dir art the " characters work as edges for the transporter beam. Also, there is always some motion inherent to a directory listing so Spock and Kirk are sort of being "beamed". This could have been enhanced by having a longer dir list.

Once again I used Marq's PETSCII editor to create the image. The c1541 tool was used to generate a D64 disk image with a bunch of files with dummy names. With a hex editor I collected the offsets for the file names. I then modified the PETSCII editor to overwrite the D64 file using the offsets. The character encoding also needed to be changed for the directory environment. Afterwards the file identifiers were trashed in such a way that the first file could not be loaded, again with the hex editor.

The file at CSDb

The CSDb dir art compo

A "non-standard" PETSCII, for Skrolli magazine

Tuesday, 14 February 2017

Fort Django v1.1

I made a small update to my Commodore 64 game Fort Django. The most important changes are:

-A choice of a whole new map with new background graphics
-New enemy behavior (in the new map)
-Music and Sound FX and a choice between them

The old game mode (map1) should play almost identically as before.

Use joystick in port 2. Turn up and down in the title screen to select the map. Turn left and right to switch between sound fx and music. Fire starts the game.

As before, you shoot enemies and try to find the exit. Collecting bags gives extra bonus depending on how quickly you have moved from the last bag. (The bonus keeps decreasing from $900)

Internally, I changed a few things to make the new map fit. The memory use was extremely lazy in the old version. Many c variables and arrays are now changed to direct memory read/writes. I relocated these higher up, so the compiled code and data area have more room to breath.

I added a scanline interrupt for the music routine, which plays out the in-game music I created with Goattracker 2, using subtunes for different program sections. The main game tune can be turned off. The sound effects make use of the Goattracker sound fx routines which are simple but suitable for this type of game. If the music is off, there are more sounds, but one channel is always reserved for sound fx. I'd say overall the sounds are better than the old ones, even though I sort of miss the sharp gunshot sound. The tunes try hard to sound something between Rambo/Platoon but a Galway or Dunn I ain't.

The sprite updates are more rigorously done during the vblank so I have more time during the frame for doing other calculations, should they be needed. However the game pretty much runs during the vblank anyway.

The new map takes the player to a vaguely central american temple, giving the game some more of that Pitfall/Rick Dangerous vibe. The new map has a bit different play style too. The rooms are more open and there's more opportunities for platform game elements.

There's new enemy behavior in this new map. For example, the enemies only shoot when facing the player. The enemies can also crouch like the player, so the player can't use always the same trick when entering the screen. Some of the enemy behavior and timing is adjusted on a room-by-room basis, so the rooms can contain a small pre-defined "action puzzle".

Internally, the two enemies are switched occasionally. Inside the program logic only one of them does the shooting and crouching. But the switching gives an impression of both having the same freedom. This is not especially elegant but given how the two enemies have been programmed it's a nice fix.

The splash screen and ending have been adjusted, but I felt a weird respect toward the old map and did not alter the graphics there at all.

It was nice to revisit the program, but in the future, I'd probably prefer making something new than try to continue adding to Fort Django.

About the first version

Fort Django v1.1 at CSDb

Sunday, 18 December 2016

A few Commodore 64 images

Here's some Commodore 64 visuals I've been working on recently.


The two snake heads were laid out long time ago, but the detailing and background was done recently. The overall composition was in flux as I kept changing the position of the heads, adding the third blurred head relatively late in the process.

Never thought I'd say this but I feel c64 hires is easier than multicolor. Obviously, the resolution is higher, but importantly, the color choices are always local. With multicolor, you have to decide the overall background color at some point and that choice often has tricky consequences.

Page at CSDb

Lawless of the West:

Another hires. This is an obvious tribute to the Commodore 64 game Law of the West, but it also derives a little from Edvard Munch's Evening on Karl Johan, though not very consciously. Other references: Italian westerns and a bit of McCabe & Mrs. Miller too. The grouping of characters also reminds me of the Italian comic Gli Aristocratici.

I have wanted to use a vanishing point perspective in a C64 pic for some time, and it is quite challenging to both have a sense of space and human characters in the same pic. Even here the people are sort of pasted on front of the background.

Page at CSDb

Hokuto Force logo:

This is a PETSCII character art I made for the group Hokute Force for an Commodore 64 intro coded by Flavioweb. I went for a "metal band style" with some ninja-fic touches.

I'm quite happy how it turned out. Again, character art shows it's force: If this had been a multicolor bitmap, I might not have come up with the idea or been able to follow it through.

In hindsight as I look at the space between the F and the O, the gap should have been maybe a bit narrower... Oh, well.

The way the logo is presented in the intro is a bit different, the above is a compromise between the intended logo and how it works in the intro.

Page at CSDb

Saturday, 3 December 2016

6502 notes

I've been dabbling in 6502 machine code for a long time, but only recently started to get a hold of it. My initial touchpoint was the machine code monitor on the Action Replay VI module on the C64 and a battered copy of the Commodore 64 Programmer's Reference I found from a flea market in early 1990s.

Which I obviously still have.
These days, I know a bit more, but certain things are a bit difficult to remember. Here's some.

How the Carry (C) affects the ADC and SBC instructions (and the difference)

For the longest time I did not get this. For additions, carry is cleared (with CLC) and then becomes set if the addition crosses the 255 boundary. The C flag is then carried (duh) over to the next ADC instruction as a +1. With subtraction, it's the reverse: the carry is previously set and then becomes cleared if the subtraction crosses 0. When clear, the SBC #$00 performs a SBC #$01, for example. After this, 16-bit addition and subtraction became easier to understand.

;Incrementing a 16-bit value at $C000-$C001 with ADC

    CLC          ;Clear Carry
    LDA $C000
    ADC #$01     ;if $FF is crossed Carry becomes set
    STA $C000
    LDA $C001
    ADC #$00     ;is like 1 if Carry is set
    STA $C001

;Decrementing a 16-bit value at $C000-$C001 with SBC

    SEC          ;Set Carry
    LDA $C000
    SBC #$01     ;if $FF is crossed Carry becomes clear
    STA $C000
    LDA $C001
    SBC #$00     ;is like 1 if Carry is clear
    STA $C001

When is the Overflow (V) flag set?

This flag is not that useful to me, but I don't want to forget what it does.

As two bytes are added together with ADC, as above, the calculation is at the same time evaluated as unsigned and "signed". If the numbers as "signed" cross a boundary of (-127...128) the overflow will be set.

I've come across a misconception that says "if the 7th bit of the original value and the resulting calculation are different, then the overflow is set."

However, the following will not trigger the overflow flag, even though the 7th bit clearly changes:

    LDA #$FF     ; 0b11111111 (-1) is the original value
    ADC #$02     ; 0b00000010
                 ; 0b00000001 (+1) is the result

I won't go around doing the two's complement explanation, which frankly just makes it more difficult to understand for me. Let's just have a look at how the signed numbers work:

Positive values:

00000000 = 0
00000001 = 1
00000010 = 2
00000011 = 3
00000100 = 4
00001000 = 8
00010000 = 16
00100000 = 32
01000000 = 64
01111111 = 127

The negative numbers have their minus sign bit set:

11111111 = -1
11111110 = -2
11111101 = -3
11111100 = -4
11111011 = -5
11110111 = -9
11101111 = -17
11011111 = -33
10111111 = -65
10000000 = -128

There's no special "signed mode" for the ADC command. Simply, if within the above representation, you do a calculation that crosses over 127, or under -128, the V flag will be set. Just like the C will be used when crossing over 0...255 in the ordinary representation.

So what the above example does is -1+2, which does not cross this boundary any more than 1+2 would set the C flag.

The reformulated rule: "If values with a similar 7th bit are added together, and the 7th bit changes, the V flag is set."

For the most part I don't see the point of the signed-system, as I can usually pretend that 128 or 32768 is the zero point in an unsigned calculation.

Here, have a picture of a silly robot that makes it all easier to understand.

How the Indexed Indirect and Indirect Indexed addressing modes work

Most of these things have no place in fast code, hence I had not really looked at them.

Perhaps the funniest personal discovery was to see that it's possible to point to a 16-bit address using the indirect indexed addressing mode. I did not know the 6502 was capable of doing this so directly (relatively speaking). It's bit like z80's ld (de),a but not really. Because there is no 16-bit register as such, incrementing the address is a matter of using the ADC on the stored value as described in the first topic above.

Usually a memory fill is done effectively with something like this, which would fill the C64 default screen area with a "space".

    LDA #$20
    LDX #$FF
    STA $0400,X
    STA $0500,X
    STA $0600,X
    STA $0700,X
    BNE loop

We can write the start address to a location in a zero page and use the indexed indirect mode to write to the address, at the same time incrementing the stored value with a 16-bit addition.

Some have suggested that the zero-page works as a bunch of additional "registers" for the 6502 and this seems to validate that idea slightly.

(It is extremely slow, though)

    LDA #$04    ;high byte of start address $0400
    STA $11     ;store at zero page
    LDA #$00    ;low byte of start address $0400
    STA $10     ;store at zero page
    LDY #$00    ;we won't change the Y in the following
    LDA #$20    ;fill with ASCII space       
    STA ($10),Y ;write to address stored at zp $10-$11
    CLC         ;clear Carry
    LDA #$01    ;low byte of 16-bit addition
    ADC $10     ;add to low byte

    STA $10
    LDA #$00    ;high byte of 16-bit addition
    ADC $11     ;add to high byte (+Carry)
    STA $11
    CMP #$08    ;are we at $08xx?
    BEQ exit
    JMP loop

When to use BPL, BMI, BCS, BCC branching operations

Some of my earliest code tended to work with BEQ and BNE only. Quite a lot can be achieved with them. The classic loop already used above, works without comparison instructions at all. Besides this, it can make a big speed difference how the '0' is used in data/tables.

    LDX #$0B
    INC $d020
    BNE loop

My first instinct has been to use the BPL and BMI opcodes as they sounded nice and simple: Branch on PLus and Branch on MInus.

However, the BPL/BMI work with the signed interpretation discussed above. Parts of code might work as intended if the numbers happened to be in the +0...127 boundary, which probably confused me in the past.

So the BCC (Branch if Carry Clear) and BCS (Branch if Carry Set) are used instead when dealing with unsigned number comparisons, even if they sound less friendly.

    LDA #$20
    CMP #$21

    LDA #$20
    CMP #$20

    LDA #$20
    CMP #$1F

This ought to branch if the A value is lesser than the one it is compared to:

    LDA #$1F   ; $00-$1F will result in C=0
    CMP #$20
    BCC branch ; (branches in this case)

The next one branches if the A value is equal or greater than the one it is compared to:

    LDA #$20   ; $20-$FF will result in C=1
    CMP #$20
    BCS branch ; (branches in this case)

So, yeah.

Strangely enough many of the webpages and even books about 6502 are incomplete when it comes to explaining in detail what each of the commands do. Even the books might just state that a particular opcode "affects" a certain flag, but may not open up how exactly that flag is affected.

Friday, 18 November 2016

Saboteur! remake

How it all began...
I've always been a bit of a fan of this atmospheric ninja/industrial espionage game released in the 1980s on ZX Spectrum, Commodore 64 and various other platforms. Now I'm looking at the recent (2015) version of Saboteur! at, from none other than... Clive Townsend, the original author.

Based on Unity/WebGL, it runs happily on a modern browser.  Before I say anything, I'd urge anyone who finds the game working on their computer to simply go and pay the small fee for the full game. Especially all those naughty people who played the original Saboteur games for free back in the day :)

With remakes of old games, I often feel that any changes to the original seem "wrong". Nothing like that here. The original central gameplay is intact. There are simply visual and especially aural improvements that make the experience of revisiting Saboteur more interesting. The game has also been expanded greatly, which I'll discuss below.

There are various options that need some attention before playing seriously. You'll have to sign in to get the full game, but as a bonus you get to save your highscores, achievements and other progress to your online account. As for the options, the game was initially set as "fast", but I found the "normal" speed most satisfying at least for now. The QAOP keyboard controls are satisfactory. The ninja moves with arrow keys too but the QAOP gives a crisper response at least on my computer.

As the game replicates the original, the controls have not been updated in any way. Especially the jumping sections may put off people who are used to a bit more fluid, console-type games.

The menu graphics are all new, high resolution, but the game graphics are Spectrum-like, and boldly so. You can also select C64 colours if they are more to your taste. I wouldn't have blamed the author for changing the graphical style altogether, but it's good to have the ZX Spectrum style pixeling here.

Guess which mode?
Well, there are in fact more graphics modes than the ZX/C64, but they have to be found in-game and they only work in the original warehouse area. Making them work was not 100% obvious, so here goes: After you've found the different "VR goggles" in the expanded game, start a new game from the beginning, then press ESC to get to the expanded graphic mode options.

However, even the ZX and C64 modes are not identical to the originals: there are tiny updates and added detail here and there. The new grenade explosion is pretty mighty.

The New Story

Like many players, I didn't know that blowing up the bomb was not enough to truly complete the mission. The disk has to be retrieved, too. Then it gets interesting. After you think you've completed the mission, there's more to do but I won't say anything about it here in case someone is a newcomer.

...Well, ok. I have to say something. What unfolds is a completely new Saboteur adventure, which is more modern, storyboarded kind of game. There's more to read, for instance, as the ninja communicates with the radio dispatcher, Metal Gear style. The style stays true to the 8-bit limitations, it's just as if the Speccy had a huge amount of memory. Even if I suspect some scenes would not run on a standard Spectrum the effects never go overboard.

We're not in Ninja Kansas anymore
The new area deviates a bit from the "one item held" logic of the original, as you can now possess keys and other quest items. Also, the map is no longer strictly two-dimensional as you can enter from front and back of the screen to different sections of the map. There are quest-oriented sections and then time-based map areas that are more reminiscent of the original Saboteur game. There are also jumping areas that make me pull my hair out in frustration, like I was ten years old playing Jet Set Willy. Maybe I can blame the keyboard here!

There's now more to do, new enemy types and behavior, more switches, keys and moving mechanisms to set and reset. There's also a lot of detail and humor, such as winks and nods to 1980s pop culture, ninja schlock and earlier computer culture. What I appreciate is that all the references are from the period, no internet memes in sight! No doubt we'll get to learn some more about the Saboteur world and how the first game ties to the sequel, the Avenging Angel.

Maybe, just maybe, I would have preferred a bit more compartmentalized play experience, such as new missions instead of this longer quest. Yet, altogether the new sections are well organized and as you get further you're bound to be obsessed with seeing it all through. Obviously the new material in no way detracts from the original game, which is intact. As with the original, the difficulty levels alter the game experience and the map a bit, and I'm looking forward trying to complete the harder modes. If a true Saboteur III appears, this all certainly seems very promising for it!

The game is quite a perfect treat to those who liked the original, and I think those who grew with 8-bit games should find it interesting. More changes might have been needed to win over more new fans, but then again too many changes might have lost that Saboteur charm.

Saboteur at

My thoughts on the Saboteur II remake