Thursday, September 19, 2019

Kronos - The beginning

After my stint working as a contractor on the IBM + Raytheon project, a friend of mine I knew from church who happened to know I specialized in Smalltalk reached out to me and got me an interview at Kronos, Inc. where they made time and attendance products.  They hired me as a contractor.

Kronos was the market leader in this space and their breakthrough product was the combination of digital punch clocks with a magnetic card strip reader and an application developed in C to process all the data of employees coming and going.

Before I went there they had created a new version of their system called TimeKeeper C/S which was developed in Smalltalk.  The C/S part stood for Client/Server, so Smalltalk application used a SQL Server database as its backend.

My task on this contracting job was to develop an extension to their TimeKeeper C/S application.  Because they didn't have a database resource to work with me, I developed a dynamic object persistence system that was file based, and I also created a dynamic user interface mechanism to present application windows based on metadata.

It was an interesting project and the work paid well.  Later on the contacts I made would help me again and again.

After the contract period was finished I went back to working on Liberty BASIC again.

Fractals in one page of code - Redux

Some time back I blogged about how someone wrote a one page program in Just BASIC that draws a colorful fractal image.

And I quote (myself):

"What's great about BASIC and languages like it is that you don't have a write a lot of code that has nothing to do with what you're trying to create (like Java for example). It should be really easy to throw together a little code and play with graphics. Programming should be fun, not a burden.

Here is a thread that shows how to draw fractals in less than a page of BASIC."

But the link is now broken because the forum site shut down and we lost a lot of good stuff.

Here's where we make it right.  A few months ago I found a fractal example for the Apple II written in Applesoft BASIC.  I thought it was pretty cool, so I adapted it for Liberty BASIC.

startMS = time$("ms")
WindowHeight = 230
open "mandelbrot set" for graphics as #gr
#gr down()
#gr fill("black")
color$ = "red orange yellow green blue red orange yellow green black"
for x = 0 to 279
for y = 0 to 95
  x1 = x / 280 * 3 - 2 : y1 = y / 191 * 2 - 1
  i = 0:s = x1:t = y1
    while i < 20 AND s * s + t * t < 4
      s1 = s * s - t * t + x1
      t = 2 * s * t + y1:s = s1: i = i + 1
    wend
  c = i/2
  #gr color(word$(color$, c + 1))
  if c <> 0 then #gr set(x, y) : #gr set(x, 191-y)
next y
next x
print "done in "; time$("ms")-startMS; " milliseconds"

Note: This is written to run on Liberty BASIC v5 to be one of the example programs.  LB5 is as of the time of this writing is in alpha test.  Click to visit the Liberty BASIC v5 board in our forum.

Tuesday, November 20, 2018

The Java Propaganda Language

I recently posted the following reply to an article about how management failed when they made incompetent choices about an implementation technology simply because they wanted to use the popular tools instead of the right ones.

Back in the year 2000...
I worked for LingoMotors, a fantastic startup some years ago which had built an amazing AI system that would parse the English language. The whole thing was built using VisualWorks Smalltalk. We had more than a dozen doctorate level computational linguists, several of them famous in their community. The system was amazing, and it leveraged the strengths of Smalltalk in a great way. This was a way to tag information with real metadata about the meaning of the data, and our first customer was a large online bookseller.
When we needed another round of financing we kept on getting pressure from potential investors who agreed we had something great, but they wanted us to port the whole thing to Java before they would back us. They had no clue that doing this would have killed our competitive edge, and it was hard to secure more funding.
The choice of implementation technology had become an issue of political correctness, in a sense. A lot of really wonderful programming language products died when the Java juggernaut trampled the world with overhyped promises. Now it seems that Java is over the top of its S curve, and things are more relaxed. It could happen again.

Saturday, October 27, 2018

Jobs vs Woz - The Closed vs Open Hand

Most people know who Steve Jobs was.  He was the charismatic and visionary frontman for Apple for many years.  He even managed a friendly coup at Apple when he took back the company he was ousted from.  He was a controversial person.  He had his fans and his detractors.  I think he certainly had his good points, but I am really more of a fan of the other less well known Steve of Apple, Steve Wozniak affectionately known as Woz.

Woz was the designer of the original line of Apple II computers.  He had a vision of computers as computers, for everyone.  A hippy vision of computing?  ;-)

What appeals to me more about Woz is that he was generous and wanted to give people something great.  His ambition lay more in personal accomplishment and also in sharing his knowledge with others.  When he created the Apple II computer he wanted it to be open.  He provided a schematic so that users could understand the computer, and so that they could modify it.  People even wrote books about how to do this.  Another example of this is that Woz included expansion slots so that people could extent the computer in this way.

When you turn on an Apple II you can program it right away.  There is a built in machine language monitor.  Depending on the model you can either use Woz's Integer BASIC or you can run Applesoft BASIC.

This version of an Apple computer is a real computer, for computing, by programming.  A computer is a device for a computer user.

Enter the computer as appliance.  :-/

Steve Jobs had a vision of computer as appliance.  This is purely a business perspective.  Sell more computers by marketing to the fat middle of the bell curve.

Of course he is not the only one to think this way.  Somehow progress in computing tends towards reducing it down to a touchscreen and away from programming and true computer literacy.  The Macintosh was a step in this direction.  This has a certain irony because the form of the Mac user interface was inspired directly by the Smalltalk windowing user interface, a programming system.  In addition to the appliance-like format of the Mac software, the computer itself was meant to be closed unit.  You need a special screwdriver to open it, and there are no expansion slots.

So the Mac was a closed machine, and it pointed other systems in this direction (i.e. Microsoft Windows).  You could purchase programming software for the Mac, but unlike other computers on the market there was no direct path to programming when you turned on the machine.  Why was there no easy programming option on the desktop when you started the Mac OS?  For more on this issue see Why Johnny Can't Code which is a popularly referenced article on this topic.

HyperCard eventually was made available on the Mac as an easy and fun programming tool and it was included free of charge for some years, but now it is gone.

Microsoft followed suit with Windows and they too also did not include even a version of their famous BASIC as an icon on the desktop of their new system.  I wrote Liberty BASIC back in the early 1990s as a response to this.  Microsoft eventually provided Visual Basic, but I strongly suggest the this should have been included, for free, and an icon to start Visual Basic should have appeared on the Windows desktop on startup.

I'm not going to suggest that there is some sort of conspiracy to dumb down the computer.  What I will say is that this amounts to a stupid and harmful mistake.  The computer is so powerful and wonderful as a creative too.  These new computers as appliances are depriving people of so much by simply omitting an easy and friendly programming tool.  A desktop icon to entice the curious to try something simple enough for children and powerful enough for casual applications programming.

So, what is really better?  How do you define progress?  What of the early 6502 and Z80 computers when compared to what we have today?  The new computers dwarf these charming old timers, but they are less powerful in terms of the concepts they omit from the user.

Saturday, October 6, 2018

Raise Your Computer Literacy to Mastery

There are different levels of computer literacy.
  1. Beginner - You know how to turn on a computer, open a web browser, use email and a word processor, etc. and maybe how to copy files around.  If you have been using a computer for many years and this is what you know, you are still a beginner.
  2. Power User - In addition to what the Beginner knows you also know how to tweak operating system settings and how to type some commands in a terminal or command window.
  3. Master - You know all the above and you also understand programming concepts.  Without this knowledge you are really at the mercy of the computer and software providers.
I like to compare this to understanding something about cars and how they work.  People who drive cars without automotive literacy face big challenges when buying a car (especially a used car), when the car breaks down on the road, and when bringing the car to the mechanic for repair.  Understanding cars improves driving skills, personal safety, and saves you time and money.
When schools first started teaching young people about computers they had a high concept of literacy and they tried to teach programming using languages like Logo, and Pilot and BASIC and sometimes Pascal.  Over time this eroded and computer class became more about just teaching the Beginner skill set described above.
Adults now are wowed by how much young people know about computers, but this is usually just a knowledge of computer trivia and of surface details, and not a deep understanding of computers at all.  We must be careful not to be hoodwinked by the semblance of mastery.
Real mastery is achieved only if you understand programming and have learned to make the machine do what you want.  Otherwise your computer will only do what other people have programmed it to do, and is that really what a so called personal computer is supposed to be?  I am including phones and tablets when I use the word computer, because clearly these things are computers.
A non-obvious benefit of mastery of computer literacy is the personal growth that happens when you learn to program because of the way it sharpens the mind.  Programming teaches analytical thinking and problem solving skills, and it can also be great fun.
I hope that this article encourages you the reader to raise your level of computer literacy!

Sunday, September 23, 2018

Programming Inside the Lines

Why do people program computers?
  • Business - To automate a process or financial problem
  • Automation - To control homes, factories, machines
  • Research - Data mining, simulation, modeling
  • Communication - Email, telephony, broadcasting, journalism
  • Recreation - Games, movies, music
  • And for fun - Yes, programming is also an enjoyable recreational activity.
I was recently part of a social media thread where we were discussing, more or less, whether programming languages should remove all features that could lead to bad practices.  This was motivated by the perennial question, "Should GOTO be allowed in programming?"  GOTO is not bad.  GOTO is simply GOTO.  I'll leave it there, for now.

Let's compare programming to finger painting.  If you gave a child some finger paints and a sheet of paper and a smock, would you yell at the child for what was painted, or if the activity made a mess?

I started programming when I was 11 years old.  Nobody made me do it.  I sat down with my father's HP-67 calculator and the wonderful manual and I was hooked!  From that point forward I spent much less time on my electronics hobby and spent my energy programming.

So, what is fun about programming?  Here is a short list:
  • Programming involves learning, which lights up neurons all over and stimulates the feel good hormone dopamine.
  • Programming involves problem solving, which is also a kind of learning.
  • Programming is a creative activity, and people enjoy making things.
  • Programming is delightfully interactive.  Give to the computer and it gives back.
  • Programming as an enjoyable social activity, sharing/working/competing with others
I see people bashing programming languages because they have features that will "ruin the programming culture and practices of the masses".  Oh, please.  How many of us have enough experience to even begin to know what this means?  How we define 'ruin' in this context?  And why is it acceptable to 'prove' that something is good or bad by regurgitating some famous person's quote that says that it's so?  We should resist this sort of nearsighted ideology.

I learned programming using the so called bad languages, and I had a blast and nobody got hurt!  I learned a ton and nothing stopped me from learning the so called good languages later on.  I encourage everyone to learn new things but if you decide to only learn one programming language you have not committed a crime to society.  Don't let anyone ever tell you different.

I know that nobody needs my permission, but I'll give it to you anyway!  Go forth and have fun programming!  Color outside the lines and drum to your own beat!  Don't be afraid of the self appointed programming police!

Monday, September 17, 2018

Home Computers and Line Numbered BASIC Interpreters

If you're like me, you started using computers back in the early days when a computer was something you could hook up to your television set.  Turn it on and immediately it would greet you with something like:

Super Duper BASIC v2.02
28467 bytes free
Ready
_

This was the most typical way a computer would start up.  You are then in BASIC, ready to explore programming more or less instantly.  There was nothing to download or install.  There was no antivirus software to harass you before you could proceed, and you did not need to boot your computer from a hard disk, log in, and then use a menu system to launch your programming language.

Your computer came with a book (yes, really) that started you on your programming journey in friendly terms, and happy looking cartoons.

In a few minutes you could have a simple example program from the book typed in and then typed RUN to see it in action.  A couple of hours into the book and you were a budding programmer.

There was no need to learn large volumes of functions just to put anything on the screen.  Was it primitive?  You bet.  The good thing about it was that mastery was attainable without going to school.

With computers today?  Forget all that.  I guess you could say that only the most determined people will learn to program now because they have to go exploring into the expanses of the Internet to figure out how to start.

Home computers.  Yup, we called them that before the term personal computer became popular.

The built in BASIC language in these machines is like clay in your hands.
  • Turn on the computer and start coding in seconds.
  • Execute code without a program.  Just type some code by itself and press Enter.
  • Add code to your program one line at a time and just type RUN to try it.
  • Stop and restart a running program.  Change it and resume running.
  • Type a program in from one of many popular magazines.  Learn to program by changing the program to make it your own.  Copying and pasting code from the Internet is just not the same.
People like to say unkind things about that era and all the messy looking code that BASIC encouraged.  I say that interpreted BASIC was a natural fit for that time.  It probably would have been hard to do it any other way.

I think that there are lessons to be learned from all this.  The kinds of computer literacy that we have today is only enough to use the computer to consume.  We only think that we know how to use the computer, but we really only know enough to run apps.

How do we make the real power of computers accessible again?  How can we restore the immediacy and interactivity of a BASIC interpreter to the end user?

You know what?  You can go on ebay and just buy one of these computers.  Prepare to be charmed.  :-)

Sunday, September 16, 2018

Python - The Emperor's New Clothes

I recently posted a couple of examples of a starfield simulation written in BASIC.  One of these was written in Commodore BASIC for the VIC-20.  The other was written in Liberty BASIC for Windows.

BASIC gets a lot of flack from people with a certain kind of snob factor (yes, you know who you are).  And there is the infamous comment by Edsger Dijkstra, and BASIC has never lived it down.  Nowadays when you see people discussing what is the best first language I probably see Python mentioned most.  In these forum discussions someone always seems to snidely denounce BASIC as that old thing with the GOTO and the unreadable spaghetti code.  They don't seem to have a good reason to recommend Python, except that it isn't BASIC.

People also recommend C and it's derivatives such as C++ which also has GOTO.  So go figure.

Wait, here is something scandalous!  On the Python Software Foundation website, in their design and history FAQ page, they actually answer the question about why there is no GOTO in Python by encouraging people to use exception handling as a hack to simulate something like GOTO!  Ummmm.   See for yourself.  https://docs.python.org/3/faq/design.html#why-is-there-no-goto

Okay, getting back to the starfield simulation example.  If you look at the version of the starfield simulation written in Liberty BASIC, it addresses some of the things that BASIC is frowned on about.
  • GOTO - Uh oh, not really.  There is one GOTO, but in this case I'm not sure a WHILE/WEND forever loop is really better, so...  The Commodore BASIC version has three GOTOs.
  • Structure - The Liberty BASIC version uses control structures properly the way modern languages do.
  • Line numbers - Liberty BASIC programs do not require numbers.  You can give your routines meaningful names instead of numbers.
Okay, let's be frank.  Liberty BASIC was not the first version of BASIC to solve these problems.  There are many BASICs with modern features, and so it isn't fair to criticize BASIC as being a bad language for beginners.  BASIC has been a proper language for teaching good programming practices for a very long time now.

What do you think?  Comments welcome.  :-)


Tuesday, September 11, 2018

BASIC over at Rosetta Code

I was curious to see how many different BASIC dialects are represented over at rosettacode.org. Here is the list (excluding VB dialects) of languages with BASIC in the name. I also included RapidQ because I know that is a BASIC also.
Rosetta code is a really cool site.  If you're not familiar, it is a site showing how to solve many different kinds of problems in many programming languages, so if you like to solve problems you can help to add code to their site in your favorite BASIC.  :-)
If your favorite version of BASIC is not there, you might consider adding it!
My favorites are Liberty BASIC and Run BASIC because they are my own implementations of BASIC, but I am also a fan of Power BASIC and Commodore BASIC!
• Applesoft BASIC
• BASIC
• BASIC256
• BBC BASIC
• Commodore BASIC
• EhBASIC
• FreeBASIC
• FutureBasic
• FUZE BASIC
• GFA Basic
• GLBasic
• GW-BASIC
• Integer BASIC
• IWBASIC
• Liberty BASIC
• Locomotive Basic
• MSX Basic
• OxygenBasic
• PowerBASIC
• PureBasic
• QBasic
• Quite BASIC
• RapidQ
• REALbasic
• Run BASIC
• Script Basic
• Sinclair ZX81 BASIC
• Smart BASIC
• SmileBASIC
• Superbase BASIC
• TechBASIC
• TI-83 BASIC
• TI-89 BASIC
• True BASIC
• Yabasic
• ZX Spectrum Basic

Monday, September 10, 2018

Feels Like the First Time

I started soldering when was about 10 years old, and I have hundreds of hours of soldering experience under my belt.  Having said that, my first foray into surface mount soldering made me feel like a novice all over again.

The Final Expansion 3 cartridge (an SD card floppy drive emulator and RAM/flash memory card) build that I've started for use with my VIC-20 has several surface mount components, and two of these are capacitors so small that I was afraid I was going to lose them.  It's not an exaggeration to say they could be mistaken for salt crystals.  Perhaps the kit should have provided a spare or two just in case.  ;-)

Here are photos of my work.






What I found most difficult was holding the parts precisely in place while soldering them.  The way I tried was to flow solder onto the pads and then put a little flux on that and place the parts and touch them with the iron, reflowing the solder.  This was hard to do, and especially with the C6 and C7 capacitors.  They are so much smaller than I expected and it was very hard to center the parts over the pads.  Even with tweezers it was a task.  Notice in the photos above C7 is off center, but I checked it carefully with my meter and it seems okay so I decided to go with it.

Maybe pre-tinning the pads was a bad idea because it was hard to make the parts rest completely flat against the board.  Another idea might have been to use solder wick to remove excess solder before placing the parts, and then putting a tiny blob of solder on the tip of the iron and applying it to the capacitor?

So, if I'm going to become good at surface mount work I'm going to need a lot more practice but this project is mostly thru hole work.

Onward and upward!

Tuesday, September 4, 2018

The new 6502 Shack

I've create a new blog dedicated to the MOS 6502 microprocessor and the computers that are built on it, and also a new Facebook group for it.  Read more about it here.

Sunday, September 2, 2018

Taking Stock of the Final Expansion 3 Kit

I finally sat down yesterday and printed out the bill of materials for the Final Expansion 3 kit.  The assembly instructions can be found here.  https://www.lemon64.com/forum/viewtopic.php?p=767044

Note: This isn't a kit for the beginner, so if you are one you will have a better chance at success with help from someone with experience.  This is not a knock on the quality of the kit, which seems to be quite good.

So, I carefully examined each part on the bill of materials.  It was easy to identify most parts because they have markings that are listed.  There are three tiny parts without markings.  One is a crystal which is a tiny little metal can with two leads coming out of one end.  The other is a small white cardboard carrier with two tiny little rectangular dots.  These dots are two surface mount capacitors.

There are five surface mounted parts in this kit.  Assembling these is considered an advanced skill.  This will be my first time with surface mount components.  I am eager to give this a go.  YouTube videos showing how to do this are aplenty.

After carefully examining everything, I was able to account for all the parts in the kit.

Here is a photo of the unpopulated board.


I also posted a video about all this. 

Getting Ready to Build the Final Expansion 3 FE3 Kit for the VIC-20



Next stop - Assembly!  :-)

Thursday, August 30, 2018

Gakken Mini Blocks - Blink and You Miss It

I discovered sadly that Gakken made a cute little version of their EX system called Gakken Mini Blocks, but they stopped making them before I noticed.  I think this is so neat.  I blogged about my love of the Gakken Denshi Blocks a long time back.  See http://microcomputing.blogspot.com/2007/

Some people are selling these on ebay, but they are discontinued.  :-(  Too bad.

Here is a photo.


I also found a link to a video about it.  The presenter explains the product and assembles a simple computer circuit.



Wednesday, August 29, 2018

Upgrading to a Soldering Station

For some years now I have been using a cheap soldering iron with a 15W/30W switch that I purchased from Radio Shack (I miss them).  This has been just fine for the electric guitar modifications that I like to make, but I'm not comfortable using this iron for the Final Expansion 3 cartridge for my VIC-20.  I decided to purchase a soldering station with temperature control so I can tweak it while I'm doing my work.

Here is the station I bought on Amazon for about $30.

This is an AOYUE 469, which is a 60W iron.  It has a nice steel spring to keep the iron, which is much better than the cheap stamped stand I was using.  It has a place to put your spool of solder, and a place for a sponge (that's not a Post-it note!) to keep the iron tip clean.


Here you can see this does not let you specify a temperature.  The specifications provided state that the temperature is from 300F to 480F.  But, the dial goes to from 1 to 8 (not to 11)!


This is a photo of iron tip.  If you look carefully, it seems they have pre-tinned it for me.







Monday, August 27, 2018

Prelude to a Kit (Final Expansion 3)

Let me just show a few photos of what came in the Final Expansion 3 kit for the VIC-20 (that I ordered from SkydivinGirl over on the Atari Age forum) before I get down to beginning assembly, just so people can see what is in the box.

Here is how it came packaged.  I think this is fine because there is nothing in here that could be considered fragile, at least in the sense that glass is fragile.  ;-)


This is the bare board in a nice bright fire engine red.  You may notice there are a few spots where parts will need to be surface mounted, but its mostly thru-hole.  It should be a pretty easy build.  I used to do a lot of PCB assembly in my youth, so I'm comfortable with this.



The ICs came in this anti static bag. My understanding is that the ROMs are already programmed.


Here are the capacitors, resistors and other parts.


Finally it comes with two different kinds of stickers to choose from for the top of the cartridge case, which is not included.




I decided that I would not buy the optional case, which is more than $20 by itself.  Instead I decided to sacrifice an original VIC-20 Mole Attack! game to provide a cartridge.  I will need to cut some openings for the SIO ports that Final Expansion 3 uses to connect to the VIC-20 serial port and also out to another serial device such as a floppy drive.  Also openings for the SD card slot and for a bank of DIP switches will be needed.



Finally I'll note that the kit doesn't come with any assembly instructions, which surprised me.  Instead I needed to Google for them.  Save a tree?

Here's the link for the instructions.  They are for an older version of the board, but they should suffice.   http://www.lemon64.com/forum/viewtopic.php?p=767044

Saturday, August 25, 2018

Starfield Simulation in Liberty BASIC

Here is the starfield simulation that for the VIC-20 that I posted a few days ago, but ported as simply as possible to Windows using the Liberty BASIC language (http://www.libertybasic.com).  If you compare them side by side you can see that a lot of the original code is preserved across the translation.

Enjoy!

 dim st(9,1)  
 gosub [setup]  
 timer 20, [cycle]  
 [cycle]  
   for c=0 to n  
     xold=st(c,0)  
     yold=st(c,1)  
     st(c,0)=xold*1.23  
     st(c,1)=yold*1.23  
     x=int(st(c,0))  
     y=int(st(c,1))  
     if abs(x)<15 and abs(y)<15 then  
       gosub [clearStar]  
      else  
       if abs(x)>200 or abs(y)>200 then  
         st(c,0)=(rnd(1)-0.5)*3  
         st(c,1)=(rnd(1)-0.5)*3  
        else  
         gosub [drawStar]  
       end if  
     end if  
   next c  
   wait  
   goto [cycle]  
 [clearStar]  
   #starfield "color black ; place "; xCenter + xold; " "; yCenter + yold  
   #starfield "\."  
   return  
 [drawStar]  
   gosub [clearStar]  
   #starfield "color white ; place "; xCenter + x; " "; yCenter + y  
   #starfield "\."  
   return  
 [setup]  
   input"# stars (1-10)";n  
   n=n-1  
   for x=0 to n  
     st(x,0)=(rnd(1)-0.5)*200  
     st(x,1)=(rnd(1)-0.5)*200  
   next x  
   open "starfield" for graphics as #starfield  
   #starfield "home ; posxy xCenter yCenter"  
   #starfield "down ; fill black ; backcolor black"  
   #starfield "trapclose [quit]"  
   return  
 [quit]  
   close #starfield  
   end  
Here is a quick video I did to showcase my VIC-20 and my other 6502 computers including a Commodore 128, an Apple Iic, and an Atari 800XL.  Enjoy!


The next video will be about the Final Expansion 3 kit that I will be soldering together.

Wednesday, August 22, 2018

VIC-20 Final Expansion 3 kit

In order to get serious about doing anything on the Commodore VIC-20 you really need to be able to get files into and out of the real machine, in my humble opinion.  I have also started using the VICE emulator, but whatever you do should be tested on the real hardware, and ultimately that's where the fun is.  ;-)

So, I've looked at a few options and I've settled on the Final Expansion 3 (FE3) cartridge kit.  I'm very comfortable soldering things together, and it makes things more interesting.  I also purchased a budget temperature controlled soldering station because the cheap iron I've been using for years doesn't seem suitable to me for doing this project because there is a little bit of surface mount soldering involved.

Here are a couple of photos of the blank board.



One really cool feature of this board the serial ports that hang off the back.  I can plug my VIC-20 serial port into the FE3 and use it's 512K of flash RAM (or an inserted SD card) as a huge floppy disk, and I'm told that I can even plug my Commodore 128 into it while it is being powered by the VIC-20, and use it as a floppy drive for that machine too!  Very cool!

Tuesday, August 21, 2018

Starfield Simulation in Commodore BASIC

I posted a challenge in the VIC-20 group on Facebook.  The idea was to replicate the forward screen of the starship Enterprise from Star Trek.  This shows stars moving from the center of the screen to the edges, simulating forward motion.  It isn't meant to be an accurate 3D simulation.  ;-)

Here is my code of this.  One other person also submitted a version of it.  This could form the basis for a game.

[Update] --- I made a new version of this in Liberty BASIC!  Click to see the new version

 10 gosub 500  
 100 for c=0 to n  
 110 xold=st(c,0)  
 120 yold=st(c,1)  
 130 st(c,0)=xold*1.23  
 140 st(c,1)=yold*1.23  
 150 x=int(st(c,0))  
 160 y=int(st(c,1))  
 165 if abs(x)<2 and abs(y)<2 then 320  
 170 if abs(x)>10 or abs(y)>10 thenst(c,0)=(rnd(1)-.5)*3:st(c,1)=(rnd(1)-.5)*3:goto150  
 180 pstar=center+x+y*22  
 190 poke center+int(xold)+int(yold)*22,32  
 200 poke pstar,108  
 300 next c  
 310 goto 100  
 320 poke center+int(xold)+int(yold)*22,32  
 400 next c  
 410 goto 100  
 500 poke 36879,14  
 501 input"# stars (1-10)";n  
 502 n=n-1  
 505 print"{clrscrn}";  
 510 dim st(9,1)  
 520 for x=0 to n  
 530 st(x,0)=(rnd(1)-.5)*10  
 540 st(x,1)=(rnd(1)-.5)*10  
 550 next x  
 590 center=7932  
 600 return  

Monday, August 20, 2018

Introducing The Friendly Computer!

When Commodore introduced the VIC-20 they called it The Friendly Computer.  This is probably more because of the manual they included with it than because of anything else.  The book was really easy to understand.


Here is my own VIC-20.  This is an early one, with the squared off keys and the two-prong power plug.  I've got it plugged into a Sylvania TV using an RF modulator.

If you look closely at the screen it reports CBM BASIC V2, and 3583 BYTES FREE.  The computer comes with 5K RAM, but it uses some of that to map the screen, and some more for managing the BASIC interpreter.  If they had thought to provide 8K RAM this would have doubled the amount the programmer has access to.  This would have made the VIC-20 a lot more powerful.

Nowadays people wonder how anything could every be written with only 3.5K RAM, but we were so used to this back then.  You might be surprised how much can be done with a little ingenuity.  As a comparison, the original Atari 2600 VCS game console had only 128 bytes of RAM.  The VIC-20 has 28 times more RAM!  In addition, you could plug a RAM expansion cartridge into the VIC-20 to add more RAM.  Commodore made several sizes up to 16K RAM, and other companies made bigger ones.

I also have a Commodore C2N cassette drive.  I also had one of these in the 80's.  I have been using the tape drive to save some small programs.  This is nothing like a floppy drive, but you can save programs by name, and it sure beats retyping in programs every time you want to use them.

I also have a Commodore 1571 floppy drive.  These are great, but they don't make it possible to send and received programs to and from other people on the Internet because the disks have a format that can't be read on Macs or PCs.  I want to share what I'm doing, so I have purchased a kit to build my own SD flash memory adapter that will behave like a floppy drive and also let me use the SD card to copy files to other computers so I can share with others.  I'm very excited about that and I'll blog about it also.

Back to BASICs

Some time ago I began to assemble a small collection of vintage home computers in order to begin blogging about what makes these machines so appealing.  In particular, programming these computers in BASIC in my early years made a huge impression on me and my creation of Liberty BASIC was inspired by my love for BASIC.

I have obtained the following machines in working condition.

Apple //c
Commodore 128 (a Commodore 64 compatible machine which also has a Z80 processor)
Commodore VIC-20
Atari 800XL
TRS-80 Color Computer 2 (not sure I will actually use this one)
And a few less popular computers that might make guest appearances.

To begin with, I am focusing on the Commodore VIC-20.  I have some ideas about very simple and fun projects in BASIC, and some Forth.  Since most of these machine also have a 6502 processor, perhaps there will also be some posts about that.


Wednesday, July 13, 2016

Ziff Davis Interactive, Liberty BASIC, and Bill Gates

Robert Gerami, a close friend of mine worked for Ziff Davis (the owner of PC Magazine) in Cambridge, Massachusetts.  He was in charge of their free downloadable utilities.  They were particularly well known for their whimsical screensavers, including one where a cartoon of Bill Gates would smash your Windows 3 desktop to reveal a shiny new Windows 95 desktop which would then be eaten by bugs before your eyes.

Robert liked what he saw in Liberty BASIC and decided to offer me a chance to have it featured on their web site as a special edition.  But, before he was willing to do this he want it to support making API calls.

The best part of this arrangement was that Ziff Davis would pay me to do the development, and that the resulting work would still be owned by me.

This is one of the important features of what became Liberty BASIC v2.0.  This was promoted by Ziff Davis Interactive on their website for several years.

Thursday, January 21, 2016

DOOM and the raiders of the lost hours

My first PC compatible computer ran DOS and Windows, and OS/2 and... DOOM.

In between rounds of development work on Liberty BASIC I would take breaks playing DOOM.  By today's standards this is a crude looking game, but back then it was really groundbreaking.  Playing it in a dark room was a good way to scare yourself half to death.  Today I would surely consider it rather tame.  The only thing that really compared to it was a game called Ultima Underworld which was actually a smoother and more detailed real-time 3D game.

In the world of PC gaming it really was all DOS.  Running Windows or OS/2 sucked up too many resources from what was typically a 33MHz 80486 computer.  The game would not play well.  Even when running DOS you needed to use HIMEM and play all the tricks in the book for there to be enough memory.

Other games that wasted my time included Falcon 3.0 which is probably the perfect air combat simulator and a cool game called Theatre of War which was sort of a real time version of Chess, kinda.

Friday, January 15, 2016

When a bad sector error is not a drive problem

When I was working on my book for NRI Schools I was having a lot of bad sector errors and cross linked sector errors on my computer.  Stuff like that.  Every day.

I even continued to get these after I upgraded my hard drive so I began to smell a rat.  My 32MB of RAM tested good so it wasn't that.  If the processor cache RAM was bad this should also cause the main RAM test to fail, unless the algorithm for the memory test is too naive.  I decided to replace the cache RAM chips on my motherboard anyways.  I think this was 128K of chips in eight sockets on my motherboard.  I don't remember how much this was, but I don't think it was very expensive.

I'm sure I got the RAM chips from Metrowest Computers in Framingham, Massachusetts because that's where I bought the computer from.  I tore the machine down.  I was very careful not to static out anything.  Inserting those little DIP chips with their little legs requires some care or they get bent!

Got it all back together and crossed my fingers as I booted it up successfully.  :-)

I never got another sector error.  Mission accomplished.

Thursday, January 14, 2016

Murphy's Law of book publishing

Once the book was all proofed and the camera ready art produced, and once I had the color separation for the cover all produced I was ready to order the first run of books which was approximately 1000 copies.

NRI Schools sent me a check in advance for these books.  How can you beat that?  So I sent everything off to Whitehall Publishing and waited nervously.

A couple of weeks later several heavy boxes arrived.  So exciting!

I cracked open one of the boxes and grabbed one of the fresh books.  What a neat thing to hold the result of so much work in my hands.  This really looked just like a book that you would buy at the store.

And then... I opened the book to the first page and my heart sank.  The very page had a spelling mistake.  I misspelled the word congratulations.  :-/

It read Congradulations.   What?  How could I miss that?

Ah well, it was still a great day!  :-)