Thursday, 25 March 2021

Lunchtime Coder #5 - Space Invaders Colour Emulator in Blitz3D / Blitz Basic



Having written a Space Invaders emulator based around an early and late version of the various romsets available, I decided to up the game and try some other similar romsets in my emulator to see how they ran.

The first different romset I tried was Super Earth Invasion, a UK bootleg/clone of Space Invaders with different graphics for the Invaders, houses instead of shields, and also some code changes that enabled motherships to drop super bombs on you, and for shot invaders to split and multiply. It was designed to run on the Space Invaders Deluxe hardware, and in some ways has more in common with this game than with the original Space Invaders.

There was some minor differences in the DIP switch settings and how they related to the processor input ports, but with a few tweaks and adjustments it ran perfectly.



I added some colour to simulate the coloured gel treated mirror
effect seen in Space Invaders upright cabinets.


On the back of this success, I went for the Space Invaders Colour (CV) romset fully expecting some heavy additional coding to be required, at least in the screen drawing routine.

I was surprised to find that the romset contained 4 x 2 kB roms (similar to the original Space Invaders romset), and when I ran them I got monochrome Space Invaders out of them.

Also included in this romset are 2 x 1 kB eprom images. A bit of on line investigation showed that these two eproms hold the colour maps for a Player 1 and Player 2 game screen. Essentially the 1-bit bitmap is generated in ram, and then the colour is added during the video processing stage of the hardware.

To be more accurate, the player 1 colour map is really everything but player 2 playing colour map. The player 2 colour map changes the colour of the bases and highlights the player two score in white. The rest of the colour map is the same as the 'Everything else' colour map.

I wrote a small program that read the bytes from these eprom images and arranged them in a 32 by 32 square that showed that each square had a value of between 0 and 7 representing one of 8 different colours (Black, Red, Green, Blue, Cyan, Magenta, Yellow and White).

Each byte corresponds to an 8 x 8 pixel square in the game remembering that the Space Invaders screen is rotated 90 degrees anticlockwise so the screen drawing starts from bottom left to top left and continues moving right across the screen.





A quick update of my emulator code to read the eprom map as it was drawing the bits gave me glorious colour-o-vision.

After playing Space Invaders Colour on MAME a few times, I noticed that when a base is hit by an invader bomb, all of the on screen graphics turn red for a short duration. This must mean that the colour video processing can turn the whole screen a single colour 'on the fly'. I also noticed that the player colour maps change pretty much spot on the player change.

Making the colour change to red when a base gets hit was pretty easy. I used Intel 8080 Output Port 3 bit 0x04. This is the trigger for the 'Base Hit' sound sample to play, but this bit is set for a specific duration, so it seems that when its set to 1, all of the on screen graphics are red.





To flip between player colour maps, I used the Intel 8080 Output Port 5, Bit 0x20 which is for tabletop cabinet screen flipping. By default it is set to 0, but when Player 2 is playing, it flips to 1. This means that it must be the trigger for both cocktail mode screen flipping, and for changing between player 1 and Player 2 colour maps.



Player 1 Colour Map
Player 2 Colour Map


Near perfect.. Well you cant have 100 % perfection without having the original arcade machine running in front of you...

Tuesday, 23 March 2021

Lunchtime Coder #4 - Space Invaders Emulator in Blitz3D / Blitz Basic






Have you ever wanted to take a trip down gaming nostalgia lane and relive the “good old days” of late 70s/early 80s arcade gaming?

No?

Me neither... but apparently there are some odd types around who miss the retroness of old skool arcade gaming in smoke filled germ ridden festering pits of arcadiness, and this led to the miracle of EMULATION !

But... Playing retro games using emulators is one thing... Writing an emulator? Now thats a tough old well done rump!

(BTW I kid... I bloody love emulators!)





I wrote this emulator as a two headed "Technical Demonstration":

1. I wanted to demonstrate that Blitz3D, despite being an older language, still has good capability and can still be used for some kuul coding projects.

2. I wanted to prove to myself that I could write an emulator...





I have provided a link above for the Blitz3D source code of my basic Space Invaders emulator.

The basic emulator includes support for the following:

1. Two romsets of the original Space Invaders monochrome game - an older and newer version with noticeable differences.

2. Adjustable dip switch settings and access to the diagnostic mode and the coin mechanism tilt switch function.

3. A cocktail flip screen mode.

4. A simulated colour overlay (the old skool red, green and white overlay).

5. Any other settings that existed in the original arcade Space Invaders.

There is also a lot of rambling comments / remarks to explain what each part of the emulator code does.

The emulator should run other 8080 based Taito Arcade games and bootlegs with a bit of adjustment on the memory array size, rom placing within the array and dipswitch / Input Port settings and assignments.

I have tried Lunar Rescue, Galaxy Wars and other Space Invaders variants / bootlegs and these seemed to run fine.





The full compiled release has additional support for Space Invaders Colour, Space Invaders Part II, Space Invaders Deluxe and Super Earth Invasion (Bootleg of Space Invaders).

I included Super Earth Invasion for one reason only. Its the version I remember playing as a kid back in the very early 80's.

It also includes a lot of "fluff" such as Bezels, Backgrounds and simulated colour cellophane overlays, and the whole thing runs from a select menu system making jumping between games a bit easier.





So what does the emulator contain?

1. Full Intel 8080 processor emulator including all opcodes and conditional flags.
2. Rom and ram area up to a maximum of 64 kB, the maximum that the 8080 with its 16-bit memory bus could address.
3. Emulated 16 bit Shift Register.
4. Video Display emulator including Interrupt generator.
5. Master and Secondary dip switch Input.
6. Inputs from Coin mechanism including Tilt Switch.
7. Inputs from Player Controls.
8. Sound Output simulator using sound samples.

I will follow this post up with some posts on the trickier aspects of the emulator, and how to overcome them.





Thursday, 26 November 2020

Space Invaders (Arcade Original) on the Sony PlayStation 2/ PSTwo / PS2

Almost everyone must have a Sony PS2 knocking around somewhere at home; in a cupboard or atic, maybe even a soft or hard modded one?

And almost everyone likes a good blat on an old arcade classic once in a while right?

So why not go grab it and get old skooling!

But first... Lets ask the question:

Question Can I play arcade original Space Invaders on my Sony PS2?

Answer Of course you bloody can! And in so many variants!

Taking into account that you can play Arcade Original Space Invaders on the PS1 (See Post Here), and that the PS2 is almost 100 % compatible with PS1 games, you can already blat away at the invading hoards without checking out what PS2 offerings there are out there.

That would make a bit of a boring post though, so lets take a look at what PS2 Space Invader options there are.

This post will cover: Commercial releases, Commercial Compilation Releases, Unlockables and Homebrew.



Commercial Release - Space Invaders Anniversary

I love Space Invaders so I should be really happy with this release, but I'm not. I will try and explain why in the shortest possible narative.

The PS1 had three commercial releases of Space Invaders in the NTSC-J regions:

  • Space Invaders (Not the same as the PAL and NTSC-U release of the same name. In Japan that was called Space Invaders X)
  • Space Invaders 2000
  • Simple 1500 Series - The Invaders

Each release contained the same 4 core variants of Space Invaders:

  • Monochrome table top
  • Colour Cellophane table top
  • Colour table top
  • Upright (The one with the moon style backdrop)

Each release also added an additional game to the list of playable Space Invaderness:

  • Space Invaders had a two player "VS Mode"
  • Space Invaders 2000 had VS mode and Timed Attack Mode
  • Simple 1500 The Invaders had VS Mode, Timed Attack Mode and 3D Space Invaders

So, what are we given on PS2 Space Invaders Anniversary?

The SAME four variants of the original Space Invaders... and another bloody Space Invaders 3D!

There is also a VS Mode... but at least its a different VS Mode than was included on the PS1 releases, and I guess to be fair the 3D mode has been reskinned to look different but is essentially still the same game.

As for original content, we have Space Invaders Part II (tabletop and Upright) and Space Invaders Doubles, a variant of Space Invaders colour but as a two player co-op game (May have been titled Space Invaders 2 in the arcades). Its not exactly piles of joy.

I know that I'm being a bit negative about this title, but Taito just could have done so much better with the content. Return Of The Invaders, Super Space Invaders 91 aka The Majestic 12, The parody from Space Invaders DX, Space Invaders 95.. Where are they all?

To make matters worse, most of the list of missing items above then rocked up on Taito Legends / Taito Memories a couple of years later.

As I mentioned earlier, Space Invaders 3D in Simple 1500 Series The Invaders is different graphically to Space Invaders 3D in the PS2 Anniversary collection, but why do I hear Alan Partridge saying "They Rebadged it you fool!".

3D Space Invaders on the PS1
3D Space Invaders on the PS2

Yes, it is arcade original Space Invaders on the PS2, but its also such a missed opportunity.

However..I do love this special edition NTSC-J release of Space Invaders Anniversary, complete with a mini table top arcade machine controller.



Compilation - Taito Legends I and II, Taito Memories Gekan and Jokan, Taito Memories 2 Gekan and Joukan.

Taito Legends I and II (72 games total) released in the PAL and NTSC-U regions, Taito Memories 1 and 2, Jokan and Gekan (100 Games Total) released in NTSC-J regions, and as It's Taito, some Space Invaders variants made their way into these collections.

Taito Legends

Space Invaders
Space Invaders Part II aka Space Invaders Deluxe
Return Of The Invaders

Taito Legends II

Super Space Invaders '91 aka Majestic Twelve: The Space Invaders Part IV
Space Invaders DX
Space Invaders '95

Taito Memories Jokan

Space Invaders Colour
Majestic Twelve: The Space Invaders Part IV aka Super Space Invaders '91
Space Invaders DX

Taito Memories Gekan

Space Invaders
Space Invaders Part II
Space Invaders '95

Taito Memories 2 Jokan

Return of the Invaders



Unlockable - Space Invaders Invasion Day (PAL) (NTSC-U) aka Space Raiders (NTSC-J)

An imaginitive Space Invaders remake, although the game itself doesn't quite live up to the overdone graphical introduction and cut scenes, but guess what?! Space Invaders Colour arcade original is unlockable by Holding L1+R1 and pressing X + O on the "Press START Button" screen.

The "Press START Button" will flash faster, then the screen will fade, and then... Arcade original Space Invaders Colour begins!



Homebrew - PS2 MAME

PS2 MAME will allow you to play a whole host of 8-bit Arcade Classics, including all of the 8-bit variants of Space Invaders.

It will however struggle with more advanced variants though e.g. Super Space Invaders '91, Space Invaders '95 etc, and it doesn't support sound samples so on the earlier variants, you will need to make your own sound effects (Puew! Puew!)

For further information on PS2 MAME, have a read of the post HERE!



And so..

That wraps up Space Invaders on the PS2. Plenty of options for the moral, immoral and amoral gamer.

Have I missed one? Probably.. Let me know and I will add it to the post.