Saturday, March 29, 2008

Parallax finished - well....kinda


Most of last week was spent busy at work - trying to get enough ahead so I don't bust a braincell when I go back in a weeks time... So, after the list of 'honey-do's' and other household things are taken care of - I'll be able to make some solid progress on EVA.

Nearly all the programming time I've slipped in has been with bug hunting. The change over to ECS showed a couple of sloppy mistakes that took some time to find - I'm keeping my eyes open and constantly revising the code.

Progress was made though - tonight I finished the parallax scroll routines and incorporated a version of a scoreboard. There's a lot of copper stuff going on - more copperlist than program.

Enough progress has been made to give it a 'checkmark' in the notebook - but more tweaks can be done:

Varying the color palette on each 'strip' - and separate each strip into its own graphic (currently they are all in one 'picture')

By making various frames for each strip - it's possible to animate the background graphics with little processor overhead - just change some bitplane pointers and I could have the lava bubbling as it scrolls by.

I'll wait on these until I feel like having another 3 day 'graphics binge' - for now I need a break from scrolling backgrounds and DPaint - and I have just the challenge:

Foreground main ship object and animation system.. the next 'check-mark' entry...

Sunday, March 23, 2008

Minor Setbacks - Visible progress....

Well the upgrade to ECS threw some spanners into the code I'd been working on - A day of debugging and thinking brought it all back into line again..

Piru's setup - as I expected - worked flawlessly, and I narrowed the problem down to a few differences that I'm glad surfaced... first was the way I was setting the DMA, fine under OCS, but didn't take into account other bits that would be used later - this was a major one as it caused it to crash. The other minor issue was my checking for the vertical blank period - once I narrowed both down to test/change exactly what I needed, everything worked fine. I should have payed closer attention rather than 'do it till it works'.

The upside was that this gave me time to work on some graphics above and beyond 'test drawings' (which are usually a handfull of one color shapes to see if something works) - so once I got the everything up and running, I had some pretty pictures to work with.
Graphics aren't my strongest hand, but being a one-man-band at the moment gives me time to improve - on my side I have patience, as I'm usually doing the graphics while I either think or have the machine tied up doing something else.

Now I have to start the lengthy weekly back up of the Amiga to the PC, and work tomorrow. So over this coming week I'll run it through the emulator and get some screen shots of what little I have going so far.

I have some much needed vacation time coming up soon - so progress should accelerate through that time.

Saturday, March 22, 2008

Caught Up and the Trials of Hardware!

So this brings us to the present - from March 10th till today.

We've gone from a black and white only Amiga with no development software and no working floppies to a halfway decent dev setup... but there's more to do.

As you read I'm running a classic OCS Amiga - with 1/2 meg chip ram, and thanks to a good deal on Ebay, 4megs of fast ram and an 030 accelerator.

Today the last of some hardware bits came in so I'm going to delve in and open the box again:

4 gig HD - alas it has a different SCSI connector on it! So this gets put to the side - 80megs is enough for now anyways.

Fatter Agnus Chip - able to handle 1meg of chip ram
Super Denise - handling screen modes and finishing out the ECS setup for the 2000
1 chinon floppy drive.

Hardware at this level makes me nervous - I'd already cut off the battery and resoldered a lithium watch battery and holder into this box, and I was sweating like a whore in church.
Discussing all this on Amiga.Org didn't make me feel better as I heard tales of brittle chip sockets - shorting out chips - breaking and bending pins off legs....

As it was - the operation went very smoothly - so what follows is what to do if you want to update a A2000 rev 4.5 motherboard to the ECS chipset:

1. In my case I went from 2 floppies that didn't work to one - so Jumper 301 (next to the floppy cable) is set to open (so DF1 will appear on external if I add one later) - the drive is jumpered to DS0 and connected to the 'twisted' end of the cable.

2. Ground yourself by touching the powersupply - put on a static wrist band.... now WITH A PLCC EXTRACTION TOOL (can't stress that enough - it only costs 4 bucks!) take out the old Agnus chip (labled FAT LADY on the board) - note it's orientation - one corner of the chip will be 'ground down' - take the new Agnus and carefully put it in the socket and gently press it down to seat it - make sure it's seated well.

3. Using the tool of your choice (mine is a jewellers flathead screwdriver with some anti static foam around it) lift the DENISE chip up - note the orientation (there's a little depression in one end that's easy to spot) - line up the new chip and seat it - be careful to avoid bent pins!

4. Locate Jumper 101 - it's near the power supply socket. Set it to the pins closest the power socket.

if you test as you go along - because like me you're paranoid - your ami will boot up until step 4. You won't notice anything new unless you look in Sysinfo - but when you do step 4 it will stop booting until you do the next (and final step)

5. (And this is the fun one!) Locate J500 near the CIA chips - it's a jumper trace (2 solder pads and a fine connection between them) - with a sharp exacto knife or other tool of choice, cut/scrape/break that connection between them.

Then reassemble and boot - voila - 1 meg chip ram!

Code Shell

The first thing to do is write a code-shell, or skeleton. A framework that handles all the tedious setup and exit that can be reused and expanded upon for all future projects.

There's several ways to do this - you can save all the relevant bits and peices such as DMA, interrupts, copperlists ect. then shut everything off and do as you please. Most demos did this - and a lot of demos don't run very well across the board on all Amigas.

Another way is to set yourself up as a proper process, do all the system relevant setup, then set yourself at a very high priority and run your code - and do system friendly cleanup. This is a lot more work - especially if you no longer have all the Rom Kernel Manuals.

The latter is my approach.

A lucky find, all the RKM's in a nice web friendly format : right here

After an afternoon of pouring over exec libraries, process structures, trial - error, and slow going I decided to take a break, have a coffee, and do some stress relief Googling. Back in the day a good friend, Colin Bell - aka Ziggy (to my Siggy) helped me make the leap from demo-style hardware banging to system friendly, nearly C like assembly programming. One of the most gifted Amiga Assembly programmers I've ever met.

A quick Google found his article in the Amiga Text Mag; HowToCode7
(His is the article on reading C)
And voila - what do we find? Some startup code!
It's quite nice and fairly complete - some of the assembly options balked a little my other code - but getting the whole package from Aminet also yields a nice CIA timed mod player.

It's nice - it has some features I need - but it is around 11 years old. Its fine for someone writing a straight forward demo, but will need some reorganising, reformatting, and other bits to fit into my project.

Part of coding is putting your ego aside and accepting that somewhere someone has done it better than you - sometimes better than you can ever do. When that happens you should take what you can and study it in hopes of bettering your own skills.

My search brought me around to a usual haunt, Amiga.org - I did a quick forum search and came up with Piru's Startup - this guy has rewritten exec, he knows his stuff, and this was just what I wanted - more thorough than the former code and needing very little change (only changing some library call formatting to use Devpac 3 system macros - because I find them orderly and neat).

With the system takeover sorted, I did some quick copperlist and bitplane setups - made a chunk of memory for the test screen, a mouse click test and a wait for the vertical blank... and all ready to go!

We can setup and leave the system nice and cleanly - and have enough tests that it should work on all classic Amigas.

Friday, March 21, 2008

Project #1 - EVA

The good thing about setting up this computer is that it gives me time to think - I've pretty much automated the task of importing ADF's from the PC and unpacking them to virutal floppies - and copying directories full of files are now just a drag 'n drop from my PC.  This gives me plenty of time to think about stuff, like where I've gone astray in the past.

Idea's are a dime a dozen for me - I literally have notebooks full of them.  Getting them to completion has been the problem.

Some ideas are too big, you get lost in the 'big picture' when you start planning it - or when you actually work on it there is never an end in sight.
Sometimes there's no 'end' to reach - I programmed a MUD for nearly 4 years, there was always just 'one more idea' to put in before I run it.
The project that's too ambitious - you get bogged down in too many problems to solve and eventually give up.

Starting from scratch there are a lot of problems to solve - a lot of things to set up - that will be used again in future projects.  So best to do them as well as I can the first time and work on something that will be interesting and challenging, but at the same time introduce the least amount of 'new problems' to the mix.

To this end I've decided to start with the last project I had on the Amiga 11 years ago - a variation on 'Moon Patrol' called EVA.  I no longer have any of my original code, or graphics, but I had already solved many of the problems before I sold up and moved to the US.

It's going to be a simple one directional scrolling game.
- Only one direction to worry about, but it will be parallax and variable speed.

-To simplify scrolling and collision detection I'll be using dual playfields - which on the OCS chipset I currently have will be 8 colors in the foreground and 8 in the background.

- I'll be making a very simple mapping system to plot rocks, craters, and aliens. A very simple path system for aliens to follow. And a simple 'set and forget' animation system for objects (since each object will follow a looped animation that won't change).

The main object of this game will be the basics - setting up a system friendly coding environment that's compatible with as many Amigas as possible - basic screen manipulation routines - basic blitter routines - and simple joystick input.

To this end I'll be giving myself a 1 year deadline to finish EVA.  It sounds doable.  So, time to start coding.

Starting Point

Ok, so these posts are pretty much 'catch up info' - and not on the days (nor times) they actually happened... But seeing as I don't expect folks to read this anyways, and this is totally a motivational exercise for me - it doesn't matter.

At this point we have most the software needed installed - HiSoft's Devac3, Deluxe Paint IV, Protracker, and a handfull of IFF/RAW converteres from Aminet - none of these does EVERYTHING that I want it too, but I lack the info to write one myself at this point - so they'll do for now.

Everything you need to start writing a game, albeit a basic one, right there.

So why go to all this trouble? I could just as easily do this in WinUAE - or UAE and Linux - Amithlon - or some other much easier way. Why don't I just set up AROS and do something for a developing operating system, or screw it - why not do something on the PC for Windows or Linux?
Like I said in the first post - it's not about the outcome, it's about the journey. The object isn't REALLY to write a game - the object is to reclaim a little of the fun I remember. That fun wasn't found writing for Linux, certainly not for Windows, it was found programming 68k Assembly on the Amiga.. that being said, WinUAE doesn't recapture the 'experience' for me totally either - Amithlon or UAE under Linux came close - but not entirely. The only way to 100% capture that is to go back to roots and go 'old school'.
Besides - if I'm going to make something for the Amiga, then shouldn't that be 100% compatible for it? What better way than to develop on the real machine?

So - with the machine in place and running, software at the ready, the next question is..... what to write?

The woes of software

No floppy drives, no CD rom, and a ton of software to upgrade before I can even get the project on the starting block....  I could wait for the new stuff to arrive, but knowing ebay and shipments from Canada that could be weeks.

 By this stage I'd received my Kickstart 3.1 rom and installed it.

No way to network - I have no network card in it, and to put one in would cost over a hundred bucks.

No terminal software - so not even xmodem or kermit can help me out.  
Amiga Explorer looked like a likely solution - an extension of Windows Explorer that lets you browse, drag - drop copy files to your Amiga over a null modem cable.  It can do quite a bit more too - but most importantly you can set it up on the Amiga side by using just a few DOS commands.

Well and good - but with wb1.3 I couldn't get it working beyond step-2 of the setup.  Could be something with the software - could be something with the setup left behind on this machine. Maybe something to do with the new rom and the old WB software.
I'll have no way of knowing.   Mind you it did give me enough insight into the process to work out what it was trying to do - and with a bit of fudging and googling I came across another method.

ADF-Sender is a similar program (though less featurefull) for sending files, and more importantly it goes into the methods and problems you might have... So after some messing around with it, I managed to get AREXX across to the new machine - and with something to actually PROGRAM with, a few hours later I was able to send the new WB disks and virtual floppy utilities across - Install the new Workbench software, setup Amiga Explorer and start transferring files - all the software I'd been accumulating and testing on WinUAE to begin the project!

Sure I could have waited a few weeks, but from past experience I know that if I set a project aside for a while, the enthusiasm wanes until it becomes a project I'll 'get around to' - and some projects, like replacing my old Amiga - can sit around for 11 years before I get back to them...

Thursday, March 20, 2008

Ack Pfffft!

I think Bill the Cat would have been proud of the noises that came out of me while cleaning out the 'beige box' - a thick layer of 10 year old dust was so deep I had to use 2 cans of compressed air just to find half the screws to dissasemble the beastie.

When all was said and done, I was able to take stock in what I had.

Rev 4.5 motherboard - OSC chipset.  The battery hadn't leaked, which seems to be the common demise of these systems -- several critical traces lie just under the old nicad battery.  I'd lucked out,  the corrosion of the old battery hadn't made it down the stems to the board yet.. a quick 'snip snip' and now it never will.

I grabbed my trusty soldering iron and put a new style lithium battery in there and did a good clean of the board with air and some alchohol swipes.

Tested the Floppy drives, they are pretty much shot.  DF1 reads occasionally with errors, DF0 refuses see disks, on the 1 in 6 occasion that it actually realises it HAS a disk shoved in it....

A crappy old bridgeboard got taken out, as well as a 5 1/4 drive - I mean why would I emulate a xt on a 10 year old Amiga when I can emulate an Amiga on my PC?  Replaced the old SCSI controller with a G-Force 030 that has 4 megs of ram on it.

My wife laughed at that figure... a whopping 4 megs!  Her machine having 2 gigs, and mine having 4.. it does seem funny, but when I start to explain the differences in program size - machine layouts - design paradigms - her eyes glaze over and you can nearly see the 'other thoughts' bubble appear over her head... She has as much interest in that stuff as my dog has in comic books.

A quick look up Google and a trip to Ebay and all missing components are on their way, hopefully soon.  ECS chipset is pretty much a requirement, that 1 meg of chip ram makes developing easier.

Besides, half of this is about re-creating the fun I used to have, and the first step in that is re-creating the old machine...

In the beginning........

My wife is looking at me strangely as I carefully lift the 'beige box' out of it's packing. It's seen better days, but the 'new to me' Amiga 2000 is pretty much just how I remembered it. I set it up on the kitchen table and powered it up - no monitor cable so it's in black and white - neither disk drive will boot up - and it's sporting the uber-old Workbench 1.3 logo. It's gonna need some TLC.

So... why? Why buy a computer that's probably 20 years old and barely working?

Nostalgia I guess - I'm at a point in life when I keep looking back at how much fun I used to have messing around with computers - and how now it's just a functional part of my life.. my life being where I go to work - edit commercials all day long, come home, eat, check the web, watch TV and then sleep.

The last huge creative rush I felt was when I first hit up Second Life, probably 4 years ago (this is the EARLY Second Life - not the realm of scam artists, hucksters, and sexual deviants it is now). Linux had it's rush back in the late 90's - but thats faded, and so I look back to the first computer I got really passionate about programming.....

And there it is in a nutshell.

So what am I going to do with it? What I always enjoyed doing - creating and programming. Which brings us here - Somewhere I can post my journey, and hopefully keep myself a little motivated for the (hopefully) long journey ahead... In SubGenius terms, I'm trying to take back a little slack in my life - reclaim a little fun and productivity that's been missing for a while.

More to come..... for now, Cheers!