Friday 11 September 2009

First steps in 68000

During the late 80s/early 90s all the cool kids had an Amiga. Some pressed on with an ST but still they had their games. Then there was me. I rolled the dice once again and tried the time-tested 'It'll help me with my homework, dad!' line to get myself an Amiga.

He looked around the school computing room and came home with an Archimedes. Not the worst machine, but not exactly overflowing with games released on a weekly basis. Nevertheless it was a good machine for a coder - the ARM 2 wasn't bad, the 12mhz ARM250 was quite nice, the 256 colour palette was naff but it was a friendly machine to code for. And these days ARM is a pretty good skill to have all things considered - they're everywhere, just not that visible.

But coming from a commodore 64 with hardware sprites, rastersplits and videochip trickery I always longed for something with interesting hardware and a few tricks. So to occupy myself a little recently I decided to right the wrongs of the 1990s and jump in to starting out with 68000 assembler... More specifically the ST.

I started with the Atari because of the simpler architecture - A screenbuffer and... yup. That's about it really. It has a few things in common with the Amiga (planar graphics), the palette is only 16 colours and you don't have such fine control (unless you target the STe), no blitter (STe again) but I figured the less custom hardware to setup the less I could get wrong whilst learning the instruction set.

And here we have the generic 1980s logo and scroller. Bit rough codewise because although it runs at 50hz there's 86 out of 200 lines taken up with static logos and the remaining chessboar area takes about 60% of the CPU time.

The 1-bitplane scroller has to be manually rotated and is then copied into the screen buffer, using another 15-ish percent of the frametime. Not a problem though because the screen is controlled by 2 interrupts - one just below the first logo to set the palette for the 'effect area', and a second below it which swops the video pointers (this doesn't take effect until the next frame), calls the music player (which basically streams out YM soundlog format data) and sets the logo palettes. Not exactly awe-inspiring but not bad for a first attempt and kinda smooth.

There's a youtube video of it in all it's 'glory' stashed away here.

Now let's try the Amiga...


No comments:

Post a Comment