Monday, September 26, 2011

A little history of my coding adventure

  It was so long time ago, more than 20 years. I was only 12 then, but I still remember the very moment when on a quiet summer holiday day, I was a little bored so I started browsing my Dad's bookshelves. Especially two books have caught my eye, and they were both on ZX Spectrum programming. Both books written in the early 80s, were mostly about programming in Basic.

The very first programming books I've read.
  I've read them pretty quickly and I liked what I read so much I started craving for more. Dad bought me some other books, few were about computers in general, and few others were on ZX Spectrum Logo programming language. 

"Microprocessors, Microcomputers, Microsystems"
"Personal Computers"
  I remember that once I was caught by my teacher reading one of these books during a Polish language lesson. I had to beg my my teacher to give that book back to me. I think it was "Personal Computers". I just couldn't stop reading.

"Microcomputer at home and in the school" & "Microcomputer Meritum" 
  "Microcomputer at home and in the school" was written for ZX Spectrum which was very popular in Poland in the early 80s. It contained some interesting examples. Whereas "Microcomputer Meritum" was special in a way. Meritum was actually the only Polish computer that achieved any commercial success. Apparently there has been Meritum 1 and then Meritum 2, both with monochromatic graphics. And also there were some plans and project for Meritum 3 which was going to feature colour graphics but for some reason that computer has never happened. This book was quite extensive and included even electronic circuit diagram of the entire computer, probably in case if someone who's brave enough wanted to try and fix it.


Sinclair Spectrum Logo, part 1 - for the beginners
Sinclair Spectrum Logo, part 2 - for the advanced
  The Spectrum Logo and other programming books were quite interesting, but neither those nor the others I mentioned earlier could substitute for real programming and I started asking my Dad for a real computer. Finally it has happened and in Christmas 1989 I got my very first own computer, Atari 65XE.



  Let me give you just a brief overview of little Atari's specifications:
  • CPU: 8-bit 6502C at 1.77 MHz clock
  • RAM: 64 KB (that seemed to be a lot in comparison to 48 KB in ZX Spectrum)
  • ROM: 24 KB
  • Graphics: 40 × 24 max in text mode, 320 × 192 pixels in 2 colours, 160 × 192 pixels in 4 colours (and several other modes, 16 altogether), 256 maximum number of colours (16 colors with 16 intensity levels each)
  • Sound: 4 channels (mono), 3.5 octaves (4 × oscillators with noise mixing, or 2 × amplitude modulation digital)
  • Operating system: Atari 8-bit OS / Atari Basic



  My Atari looked a lot like the one you can see above, and was in exactly the same configuration, the computer itself, tape recorder, power supply, and joystick. I also got a few tapes (oh yes, tapes) with it so we could play games. We got it all set up, connected to a TV set and here came the first disappointment. Those tapes wouldn't load! Fortunately we found a friend who helped us with his tapes. But those were games, and mostly my sister enjoyed them. I needed something different, something more complex, challenging and absorbing. Soon I'd learnt one of my classmates had an Atari, too, and also a great textbook on programming in Atari basic. For several months that was hour programming "bible" and I often came to my classmate's place to copy some information from that book, which I later could try and practise at home. Some of those examples were quite practical, like for example title screens for my Dad's VHS tapes.


  Those were magic times. When I close my eyes I still can see and hear that simple software in action. Editors were not as sophisticated as nowadays (I would say they weren't sophisticated at all, and simply allowed to type in and run your code) and it was easy to make errors while typing in programs from magazines. The first screenshot looks pretty simple, but it also doesn't do a lot. Look at the other one and you'll see that it's mot easy to read or type in at all.





  Computer magazines at that time were a great source of practical knowledge. They provided young coders with working example programs along with explanations how they work. What one could want more? I only show you front pages of two titles, but there were several available at that time, some dedicated to particular platforms, and some were more general.


  At certain time (I cannot remember exactly when) someone came up with a clever idea how to make that typing in code a little easier and error free. It was quite simple, but great at the same time. A program which ran in the background (there was no multitasking on little Atari) summed up ASCII codes of all characters in each line of program and generated a unique two-capital-letters code, which was printed in front of that line. What needed to be done was to check whether the generated code was identical with that printed in the magazine from which program was taken. Look at those codes in front of each line number in the picture below.


  That was a great help. But little Atari (like all other 8-bit computers in the 80s) had tape recorder as standard storage and it was really slow, even considering the small amount of data being loaded into those machines. Often it took several minutes to load up a game (10 or even more minutes, sometimes even the length of the whole side of a tape, which is around 30 minutes). One needed to be very patient. It was absolutely forbidden to move during that process so not to shake the table on which the tape recorder was placed or the awaiting would start from the beginning.
  Finally I followed my friend's advice and "upgraded" my computer. My Dad took me to a company which installs turbo systems in Atari tape recorders. After all process the tape recorder itself looked actually unchanged, apart from an extra wire wound around the main cable and a cartridge with software supporting the turbo system. And, I think, there was also a switch on the back of the recorder allowing to turn the turbo on and off.



  That happened around 1991 and when I started using the turbo loader I thought it was the best upgrade I could ever dream of. Programs loaded up so much faster, it seemed like in no time. And no wonder. The transfer speed increased from about 600 bauds to, I guess, some 6000 bauds, which made it some 10 times faster. The difference in loading times could be felt right away, and the system also showed up to the end user on the screen in the form of specific menu.


  And then the screen also looked different (a little scary at first) when the programs were loading up. It resembled a little bit what could appear on a TV screen when a damaged VHS tape was played.


  For those who've never seen or heard any real 8-bit computer I've found some video on YouTube. It shows game "River Raid" by the legendary ActiVision being loaded with a standard speed on a real Atari 65XE. Enjoy!


  This video has been uploaded by FarEastOfTheBlues and this is the link where it can be watched in a better quality on YouTube:

http://www.youtube.com/watch?v=QyC1Ld19pq8


  Turbo system in Atari 65XE was a great thing and I did enjoy it. Although it featured much faster transfer in comparison to standard system, it still had the disadvantages of a tape cassette. Namely the tape itself needed to be manually rewinded, fast forwarded and so on, in order to find required program. A good help, practised by probably every single user, was writing down counter readings for each program (so called cassette index). That wasn't so bad, but what if one lost that piece of paper with contents of the cassette? And still, there was no real (logical or electronic) connection between contents of a cassette and what was written on the inlet. This is an example Atari tape cassette:


  My cassettes looked a little bit like this one, with a handwritten index of programs:


  That brings back old memories. Good times when people had lots of time to wait for their programs to be loaded up. Rewind... fast forward... little bit farther... too far. Let's rewind a little bit again...
...and finally load that "River Raid". Oops! Title screen. At last.

Thursday, September 8, 2011

Welcome everyone!

Hi! This is my new blog on computer science. In this place I'm going to publish results of my experiments, projects, and new experience. Or anything I manage to learn, which is related to computer programming. Few months ago I have completed a computer science course. I must admit I did quite well and have got 2:1 Bachelors of Science from Lancaster University, which is one of the best in the country. Although all programming we did on that course was almost solely in C# for general programming and XNA for game programming (maybe with the exception of Prolog in which we only wrote a couple of exercises for one module, Artificial Intelligence), I have already started learning Objective-C and intend to start writing my own apps for the iPhone and iPad in the near future. So, I've bought myself some books and will exercise thoroughly. And when I'm not doing that I'll publish a post here every now and then.