
Fixing bugs like it's 1988 - sohkamyung
https://0xa000.blogspot.com/2017/06/fixing-bugs-like-its-1988.html
======
dirktheman
I also started programming on a C64... good times! I also remember radio shows
about C64 programs (in Dutch!) that would discuss the program first, and then
transmit the source code over radio waves. Since the C64 had a cassette tape
as memory, you could record that part of the radio show on a cassette tape,
and play the tape back on your C64. It was a bit error prone, and I still have
the occasional nightmare from the strange sounds...

~~~
Radim
"A bit" error prone?

We copied the (100% pirated) cassettes very carefully in CZ, never mind
recording fancy radio waves. And it was still unreliable as hell!

The magnetic cassette loading was sometimes more suspenseful than the actual
loaded game :-) Gamified by live-tuning the cassette head with a
screwdriver...

~~~
strictfp
Ok, "a few bits" error prone then :)

------
mixmastamyk
Excellent work and a fun read. I've got fond memories of loading programs from
cassette tape on a Vic-20 in the early 80s (it took 10 minutes or so kids). I
tried typing in a game from a magazine and was unsuccessful too--it never
worked right, pre crc. Me and a few cousins had a ball though with a random
sentence generator program. We filled all the data statements with all the bad
words a group of 12 year olds could think up. Good times.

It was my first exposure to programming, and a bit too early perhaps. Other
than an occasional session on an ancient TRS-80 in high school, I didn't do
any real programming again until taking a Turbo Pascal course in the mid 90s
in college.

~~~
danieltillett
I have the opposite feeling. I used to write programs for the trash-80 with
hundreds of variable all named $A, $B, $C...$AA, $BB. To top this off the
inability to renumber lines meant that once you added 9 new lines you needed
to solve the problem with a goto to a sub-routine ultimately ending up with
spaghetti code of the worst kind.

Of course not having a printer meant the only way you could understand the now
totally tangled spaghetti code was to keep all of it in your youthful short-
term memory. Having nobody you could ask or learn from just added to the toxic
mix.

Even now thirty years later the thought of programming like this makes me feel
ill.

~~~
bsder
> I used to write programs for the trash-80 with hundreds of variable all
> named $A, $B, $C...$AA, $BB

Ummm, don't feel bad, you actually _needed_ to. Each character of those
variable names takes up RAM.

~~~
kbp
> Each character of those variable names takes up RAM.

Not to mention that at least on the C64, only the first two characters are
significant anyway, ie, 'abba', 'ab', and 'abcd' all refer to the same
variable.

------
bungie4
Flashback time!

I got a chuckle about your dad still running his C128 for financials. Their
was a local optometrist here who ran his entire practice on Tandy Color
Computers, networked together in a multi-tasking environment running OS9. Each
and every part of it was custom written by the doctor. I think he retired a
few years back, but I know it was still running his home brewed system then.

~~~
cr0sh
I doubt it was networked, as there was never a network card/cart/dongle or
anything like that available for the CoCo back in the day (I owned both a CoCo
2 and a CoCo 3 as a kid, and still have both in running condition) - not even
from 3rd parties, as far as I can remember.

There also was a system for the Model 4 (IIRC) running Xenix (?) with a serial
port expander option to allow multiple system communicate with this "server",
but that doesn't sound like what was done (?).

Radio Shack/Tandy sold a serial port switcher system that allowed you to
connect multiple machines together in some fashion. It was meant for an
educational setting (a teachers computer connected to multiple student
machines). I don't believe it was automated in any way - completely manual.
That doesn't sound like it was something that would work for an office
setting.

In theory, you could mount a multipak interface and drop three serial pak
cartridges in it, and maybe tweak the internal electronics to put them at
different addresses, leaving the fourth slot open for the floppy drive (or
maybe a hard drive). There would also be the bit-banger serial port available
- so that would allow you to hang four machines off of a central
"server"...third parties also created expanded multipak interfaces that
allowed for many more cartridges to be attached (I think up to 16 in some
cases).

Another way (which if this guy was doing this, he may have done) would be to
create a completely custom networking system; the simplest way would be to use
the bit-banger port and maybe the cassette port together (you might even be
able to do something with the joystick ports too!) - the cassette port, using
the relay latching, could toggle between "listen" (RX) and "send" (TX) modes,
and with some simple electronics, the voltage levels could be managed and
"collisions" detected, so you could do a "round robin" or even a "random"
communication protocol with collision detection. Or, some other kind of "one-
wire" communication system could be done. I also suppose someone really
ambitious could create a custom bit of electronics and multiplex several UARTs
together, linked to a single cartridge and controlled by the CoCo.

This is kinda fascinating; I wonder if he ever published anything about it. If
not, it seems like another small bit of CoCo history lost forever, which is a
shame.

~~~
bungie4
¯\\_(ツ)_/¯

I know for sure their was at least two computers 'networked', reception and
one in doctors office. It was likely some sort of an RS232 network.

I do recall studying a bit of OS/9 back in the day, and the doctor, who would
drop everything, to discuss it :D

------
activatedgeek
"At some point, magazines started publishing listings with a checksum added to
each line. They offered special tools that would compute the checksum of each
line you typed, and checked it against the checksum you typed in at the end of
the line."

This is just amazing.

~~~
flukus
This post made me wonder if this could be the origin of the checksum or
certain checksum algorithms. A few minutes googling haven't led to any dates,
so does anyone know what the history of the checksum is?

~~~
pjc50
The Luhn algorithm dates to 1960 and is still in use on credit cards:
[https://en.wikipedia.org/wiki/Luhn_algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm)

------
bahjoite
Is there a name for that style of magazine cover artwork? It seems to have
been common on 80s computer magazines. Some more:-

[http://www.acornelectron.co.uk/mags/eu/top_lvl.html](http://www.acornelectron.co.uk/mags/eu/top_lvl.html)

~~~
themodelplumber
Airbrushed? Tons of it in use there. And in the '80s in general.

------
mrspeaker
That's why the most important part of computer magazines was the "Errata"
section - and they could stretch across many months: "Reader Joe says last
month's errata was incorrect and line 1080 should be...". As a kid I started
to suspect some were doing it on purpose to make me buy the next magazine!

I loved doing type-in listings though. A while back I started making a game
"BASIC Instincts" that was going to be about finding clues and typing in
BASIC. I had a prototype working
([https://www.youtube.com/watch?v=GwBiJR_rj_w](https://www.youtube.com/watch?v=GwBiJR_rj_w))
but then "Else heart.break()" was released and took the wind out of my sails.
Might have to go back to it though!

------
tomsmeding
Awesome stuff! I'm really curious what kind of program your father uses on the
C128 (emulator) for finances; can't really imagine how that would be practical
today. Love to be surprised, though!

------
harel
I had to learn programming because I was given a VIC20 when the C64 was the
model du jour. And because I couldn't get any games for it, all I could do is
learn to make my own. 30 odd years later... Things might have been different
had i gotten the "right" model.

~~~
cr0sh
The bad part (and one could argue this being a "good" part as well) for the
VIC-20 and C64 was that if you wanted to do anything useful and reasonable in
BASIC on those machines, you almost HAD to delve into some deep areas; the
BASIC they used wasn't even as sophisticated as what was available on the
Apple IIe (which was pretty nice). The best versions of BASIC (in
microcomputer land - there were BASICs out there for business purposes on much
more sophisticated 16-bit machines of the time that were amazing) were on
Radio Shack's offerings (mainly because they were from Microsoft). Compare,
for instance, BASIC for the C64 and the Color Computer 2, and you'll see a
great difference (especially in the areas of sound and graphics generation).

That said, the C64 forced you to use either arcane commands to access internal
ROM routines for certain graphics or sound generation, or you had to resort to
machine code of some form or another. So you if you wanted to do something
beyond the "basics" (so to speak), you had to get down and dirty with the
hardware. This led to some amazing things being done by people with that
machine; it was much more popular than Radio Shack/Tandy's offerings - it was
much cheaper, plus it had built-in sound (SID) - whereas it's Radio Shack
competitor, the Color Computer line - everything was done by the CPU.

These tradeoffs had their own implications, of course - there wasn't much like
OS-9 available for the C64 (a multitasking, multiuser operating system for
8-bit machines of the time - which was ported very successfully to the Color
Computer, and still lives on in the open-source version called NitrOS9). But
the 6809 chip (which facilitate the OS-9 conversion, as that chip was also
used in a lot of embedded and industrial controllers, which was the primary
purpose for OS-9) was an expensive chip that, while really powerful compared
to what was in the C64, ate into the bottom line, and was part of the reason
why a sound chip wasn't included on the CoCo.

Radio Shack/Tandy later came out with expansion offerings for sound (the
Speech/Sound and Orchestra-90 cartridges), which could be plugged into a
multipak interface (MPI) along with the floppy drive controller, and give
great sound - but it was too little, too late, and both were expensive
upgrades (if you had a floppy drive, in order to keep everything you had to
spend several hundred dollars more just for better sound).

There were ways to get better sounds out of the Color Computer, but they
consumed a lot of the CPU resources, and so they were mainly only used for
music generation software (Musica and Lyra were two of the popular ones; the
Rainbow also published a long program to type in that gave a really
sophisticated "tracker" style four-voice system, where each voice could be
defined with an envelope and waveform). Some ML coders learned to combine some
sound generation realtime with graphics for some games, but it wasn't great,
though toward the end of the heyday of the CoCo it got better. Recently,
people have made greater strides with sound and music for games, graphics, etc
- heck, I think there is even a SID emulator for the Color Computer...

~~~
vardump
> That said, the C64 forced you to use either arcane commands to access
> internal ROM routines for certain graphics or sound generation

C64 ROM contains no graphics or sound generation commands. Unless you count
text mode scrolling as such.

Graphics and sound was either POKEs and PEEKs or 6510 machine language.

> These tradeoffs had their own implications, of course - there wasn't much
> like OS-9 available for the C64 (a multitasking, multiuser operating system
> for 8-bit machines of the time

Well, there was GEOS, although it wasn't a multiuser system. Or multitasking
for that matter.
[https://en.wikipedia.org/wiki/GEOS_(8-bit_operating_system)](https://en.wikipedia.org/wiki/GEOS_\(8-bit_operating_system\))

------
vanderZwan
This reminds me of the article about the ET game, where it turned out to be
not quite as terrible after some bugfixing.

It might be fun to see a blog dedicated to bugfixing retro-games in their
original (emulated) environments

~~~
ido
ET wasn't as terrible as its commonly made to be even before the bug fixing.

~~~
SwellJoe
It was a very frustrating game. A friend of mine got it for Christmas the year
it came out. We tried really hard for a lot of hours but we were completely
overwhelmed by it. I don't know if it was the bugs that made it impossible to
win (or even progress very far) or just the difficulty of the game, but we
moved onto playing other stuff after a while, even though we both loved ET
more than anything.

~~~
scrame
I agree, but my older brother figured it out. It was confusing because most
games were single screen with obvious objectives. ET had a larger map with
randomized items. You had to collect various objects to get home and bring
them back to a central base. Unfortunately, there were a lot of similar
looking maps and bad collision boxes, so you were constantly falling down
empty holes and having to lift yourself out.

Bugs aside, it was beatable, and you had to read the instructions a few times
to figure out what the hell was going on, and you would just ... lose
sometimes.

Deadly Towers on the NES gets a lot of hate for almost the exact same reasons:
random dungeons, unclear gameplay, and sometimes vindictive enemies.

The funny thing is, the current roguelike indie boom is built entirely around
those concepts, and the Dark Souls series is hailed for being a throwback to
the original zelda, where you just had to figure the game out.

ET wasn't a great game, but it was an ambitious game when home consoles were a
new thing and everyone just wanted asteroids and pac-man.

~~~
pjc50
> just had to figure the game out.

The environment is very different though - we have the internet, and can watch
the entire game played through by experts if we want. Back then if the average
player got stuck by not being able to figure something out, and didn't want to
call the expensive helpline, their enjoyment was over.

~~~
digi_owl
And this easy access to info can be a double edged sword.

For example, adventure games are basically dead because of how easy it is to
find a step by step guide on Gamefaqs or similar.

Similarly, MMORPGs used to foster an in-game (in-world?) community because so
much had to be discovered and shared via it. These days it is one part follow
the quest marker, and one part check the wiki.

~~~
sbov
MMORPGs had knowledge base websites dedicated to them almost the instant they
came out. The reason they don't foster community anymore is more by design
than anything else. That said, old MMORPGs fostered community via some pretty
unfun methods. I'm not sure if there's a good middle ground.

------
w8rbt
SYS 64738... that will forever be burned in my brain. Loved the C-64. Awesome
article too.

~~~
dajt
Mine too! Loved playing around at $C000.

------
ycombinete
I've seen a number of blogs with hex names like this. Where does this come
from?

~~~
ocfnash
0xA000 is also the address of the memory location that holds the contents of
the display in so-called "mode 13h" in the old IBM VGA displays.

Mode 13h was an extremely popular graphics mode, used by many PC games in the
early 90s (probably also late 80s). It gave a resolution of 320x200 pixels
with 8-bit colour palette.

After entering mode 13h, the way to plot a pixel is to poke the corresponding
8-bit memory address, where the 0th pixel (display top left) is 0xA000.

~~~
Someone
I think that's A000:0000 or, without the segments, 0xA0000 (one extra zero).

0xA000 would mean video memory started not after 640kB, but after 40kB. That
wasn't even enough for everybody when the IBM PC launched (the Apple II
already had been shipping with 48kB for a few years at that time)

~~~
ocfnash
Yes indeed, quite right!

0xA000 is the memory _segment_ and so the linear address is 0xA0000

I think I would have got this right first time ~20 years ago:
ftp://ftp.scene.org/mirrors/hornet/code/3d/systems/gsescher.zip :)

------
martinlofgren
This was great reading. Sure brings memories to life. My first encounter with
computers was an old Spectravideo SVI-728 which I tried to program.

------
GlennS
The premise for the game sounds really interesting and imaginative.

Reminds me vaguely of Bozo's Night Out, where the goal is to get home from the
pub.

------
s_dev
Why does Hacker News url preview suggest .com when site is .ie ? Is the author
Irish?

~~~
sbierwagen
Blogspot will redirect you to the country-specific domain based on your IP.
It's not that the author is Irish, but the _reader_ is Irish.

------
torstenvl
Interesting read, but frustrating at times. It felt inconsistent in its level
of explanation - not sure why I need it spelled out to me that 40 x 25 is
1000, but the reader is presumed to know C64 assembly.

~~~
Narishma
It looked fine to me. I've never done C64 programming but I had no trouble
following the code snippets in the article with the explanations provided.

~~~
torstenvl
BNE without a CMP threw me for a loop (ba dum tsss). I hadn't remembered that
BE/BNE typically operates based on the condition of the zero flag.

Even so, it seems odd to gloss over the assembly while explaining more trivial
things. If the author reads HN, that would be a suggestion to make his
otherwise excellent post a little easier to follow.

------
pjmlp
This surely brings back memories, nice article.

------
catteneo
So you did a "quick Google search" in 1988? hum...

~~~
dghf
No. 1988 was when he first tried to enter and run the game. Many years later,
after coming across a scan of the magazine with the code listing, he tried to
fix it.

> And that's that.... bug fixed after 29 years!

