10 ms·
Fixing bugs like it's 1988
- mixmastamyk 9y agoExcellent 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 9y agoI 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.
- kfkfkif 9y agoWe solved the line numbering issue with 100-increments
- danieltillett 9y agoI have a vague memory that there was a reason for not doing this - something about using more memory or hitting a ceiling of some sort. The major problem of course was not having anyone to tell you that this was a bad idea. I still remember trying to work out how to program in machine code by poking different values into memory. I had my own guide on what values to avoid and what values worked without having the slightest idea what I was doing.
- ams6110 9y agoI do recall there being a maximum limit on line numbers. I don't recall ever using a BASIC that couldn't renumber.
- bsder 9y agoLikely 65535. I can't imagine a computer in that era using more than 2 bytes for a line number.
- usernam 9y agoAbsolutely. BASIC on a Sharp 6000 pocket pc[1] for example was limited to (32k or) 64k lines of 256 characters each. Like in many other basic versions, there was no automatic renumbering. Discovered it the hard way. [1] https://duckduckgo.com/?q=sharp+pocket+pc&t=ffab&iar=images&iax=1&ia=images https://duckduckgo.com/?q=sharp+pocket+pc&t=ffab&iar=images&...
- laumars 9y agoI was never a big fan of Microsoft Basic. My prefered systems were BBC Basic (BBC Micro) and Locomotive BASIC (Amstrad CPC). Locomotive was larged based on BBC BASIC and both had a command called RENUM that would renumber your source for you. It was invaluable for smaller projects but I remember some of my larger projects I would have routines separated by thousands. eg 10 REM main routine 20 REM do stuff 1000 REM another routine 1010 REM do other stuff 2000 REM a 3rd routine Then have GOSUBs / GOTOs using the n*1000 as the entry point into that routine. RENUMing the source when you've got the aforementioned structure was not an option.
- tonyg 9y agoISTR that Locomotive's RENUM took optional arguments that let you renumber chunks of the program separately... yep! You could renumber starting from a given line number through the end of the program, so in principle you could do a whole-program RENUM and then restore the larger gaps to your GOSUBs: [1] [1] (what a horrible link) http://www.cpcwiki.eu/index.php/Locomotive_BASIC#RENUM_.5B.E2.80.B9newLine.E2.80.BA.5D.5B.2C.E2.80.B9oldLine.E2.80.BA_.7C_.2C.5B.E2.80.B9oldLine.E2.80.BA.5D.2C.E2.80.B9step.E2.80.BA.5D http://www.cpcwiki.eu/index.php/Locomotive_BASIC#RENUM_.5B.E...
- laumars 9y agoYeah but that was fiddly and scary when the only way to undo any mistakes was to reload your program from cassette.
- digi_owl 9y agoProgram on notebook first i guess?
- stevekemp 9y agoI had to do that when writing programs in z80 assembly language - then converted to HEX bytes for each instruction. It was always a pain because instruction-length varied and you had to account for the length when calculating the number of bytes to jump forwards/backwards. (I tended to prefer relative-jumps to absolute ones, but either way the same problem remained.)
- deleted 9y ago[deleted]
- cr0sh 9y agoI don't know what TRS-80 you used, but I do know that the Microsoft BASIC in the Color Computer had a re-number command (RENUM newline, startline, increment). It was actually a very sophisticated version of BASIC: http://www.colorcomputerarchive.com/coco/Documents/Manuals/Hardware/Color%20Computer%202%20Quick%20Reference%20Card%20(Tandy).pdf http://www.colorcomputerarchive.com/coco/Documents/Manuals/H... As a kid (and I still own them) I had a Color Computer 2 and 3 - I programmed a ton of things on them, which ultimately led me to where I am today as a software engineer.
- bsder 9y ago> 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 9y ago> 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.
- stevekemp 9y agoI wrote a blog post recently about my early memories doing similar things on a ZX Spectrum. One thing I remember fondly is the books I checked out of the local library, which were full of listings. Scrolling down to the bottom of this page you can find them online these days: https://usborne.com/browse-books/features/computer-and-coding-books/ https://usborne.com/browse-books/features/computer-and-codin... Just seeing the covers is enough to take me back ..
- markatkinson 9y agoI wonder what I will be saying to people in twenty years time that will include the phrase: 'it took 10 minutes or so kids'? "We used to have to write our own programs, like actually use buttons to type characters. It took a year or so kids."
- JustSomeNobody 9y agoThe keyboard is an efficient way of getting a program from one's head to the computer, so I don't see that changing.
- onion2k 9y agoThe inefficiency lies is in translating the business requirements of an application to something the computer understands via your brain and code syntax. There are plenty of ways that process can be optimised.
- pjmorris 9y agoThey've been optimizing that process since the 1950's. My hunch is that until they've built something sufficiently autonomous to accept blame when something is broken, humans will still be coding.
- JustSomeNobody 9y agoUntil you also get a computer to write the business requirements, they will remain so nebulous that ONLY a human can translate them.
- JadeNB 9y ago> The keyboard is an efficient way of getting a program from one's head to the computer, so I don't see that changing. This seems an awful lot like saying, in (let's say) the 18th century, "the horse is an efficient way of getting from one place to another, so I don't see that changing." The keyboard seems efficient now, but it, or, to be certain, some current and apparently perfectly satisfactory technology, certainly won't do so after the next big innovation.
- vanderZwan 9y agoThis 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 9y agoET wasn't as terrible as its commonly made to be even before the bug fixing.
- vanderZwan 9y agoI wasn't even born back then, so all I have to go by are the articles about it ;)
- SwellJoe 9y agoIt 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.
- ido 9y agowasn't saying it was 'good', just that the 'worst game in the history of gaming' reputation is overstated.
- scrame 9y agoI 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.
- pjmlp 9y agoThis surely brings back memories, nice article.
- tomsmeding 9y agoAwesome 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!
- martinlofgren 9y agoThis was great reading. Sure brings memories to life. My first encounter with computers was an old Spectravideo SVI-728 which I tried to program.
- activatedgeek 9y ago"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.
- jgrahamc 9y agoFun fact. Part of what's display in the HUD of The Terminator in the original film is the output from just such a program. In The Terminator it's from Key Perfect: https://1.bp.blogspot.com/-fcJIJVaOm7g/VCVjPqBFrSI/AAAAAAACCCI/SVIGhQfusQk/s1600/image50.png https://1.bp.blogspot.com/-fcJIJVaOm7g/VCVjPqBFrSI/AAAAAAACC... That was used for programs in Nibble Magazine: http://www.nibblemagazine.com/nibble_disks.htm http://www.nibblemagazine.com/nibble_disks.htm and I'm currently working on tracking down exactly which program the checksums came from for my YouTube channel "Behind The Screens": https://www.youtube.com/channel/UCzOc0EEdwWAlnwrWV-7sDbg https://www.youtube.com/channel/UCzOc0EEdwWAlnwrWV-7sDbg
- SwellJoe 9y agoThe fun part is you had to type in the checksum tool, too.
- striking 9y agoBut what if you got that wrong?
- JadeNB 9y agoNasal demons.
- mywittyname 9y agoLook at you, you're the checksum tool now.
- bluGill 9y agoyou often did get it wrong. However it didn't matter as when there was a mismatch you checked both the checksum and the line for errors. Generally you found errors in both, fix both go to the next line. Getting all the typos out took almost as long as typing it in in the first place. I don't think I ever successfully typed in a program longer than 1 page, I recall being on page 3 of one program I never finished though.
- ycombinete 9y agoI've seen a number of blogs with hex names like this. Where does this come from?
- pizza234 9y agoIn these cases, retro/rev blogs refer to special memory areas or APIs (interrupts, etc.). In this case, he's working on a Commodore 64, and $A000 is the beginning of the BASIC ROM/RAM (http://sta.c64.org/cbm64mem.html http://sta.c64.org/cbm64mem.html).
- tawayway 9y agoAlso the segment for VGA video memory on PCs IIRC
- ocfnash 9y ago0xA000 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 9y agoI 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 9y agoYes 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 :)
- catteneo 9y agoSo you did a "quick Google search" in 1988? hum...
- dghf 9y agoNo. 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!
- bahjoite 9y agoIs 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 9y agoAirbrushed? Tons of it in use there. And in the '80s in general.
- dirktheman 9y agoI 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 9y ago"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...
- gcb0 9y agobefore stereo, fm was pretty fine for that. but we mostly had zx games transmitted by the uni radio. zx I recall was more forgiving than c64
- strictfp 9y agoOk, "a few bits" error prone then :)
- pacoverdi 9y agoI remember the early games on Amstrad CPC464 were pretty easy to copy. Then game makers started compressing the signal heavily in order to shorten load time, which at the same time made cassettes much harder to copy due to increased sensitivity to errors. The sound was pretty different too. I still remember the sound of the Sorcery tape which was a lot more distorted than the early games :) Good times!
- skocznymroczny 9y agoLuckily, nowadays you can still get that suspenseful experience by attempting to flash BIOS/UEFI on your motherboard. Will it work? Or will my motherboard get bricked in less than two minutes?
- harel 9y agoI 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.
- stevekemp 9y agoI started programming because my ZX Spectrum had a dead tape-deck on arrival. Back in the 80s shops closed over Christmas, so there was no chance of returning/replacing it. I ended up reading the manual(s), this being back in the day when computer manuals had tutorials on BASIC, and even pictures of the circuit-layouts.
- cr0sh 9y agoThe 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...
- GlennS 9y agoThe 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.
- mrspeaker 9y agoThat'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!
- torstenvl 9y agoInteresting 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 9y agoIt 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.
- deleted 9y ago[deleted]
- torstenvl 9y agoBNE 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.
- bungie4 9y agoFlashback 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.
- chubot 9y agoThat's amazing! I wonder if that kind of thing was more prevalent in the days of simpler computers, or if people are still doing the same thing on Windows/Linux/Mac these days.
- cr0sh 9y agoGo on ebay, and search around for 386 motherboards, 5.25 floppy drives, and the like - for old DOS systems. Prices fluctuate, but on the whole some of those boards go for an insane amount of money (for what they are). A lot of this is "collectibility" bumping prices up; but a part of it is also the fact that there are more than a few companies in the world running CNC tooling that uses these machines as controllers. We're talking CNC machines that to replace entirely would cost hundreds of thousands of dollars (USD), if not more in some cases. So parts to repair and keep these machines running are in hot demand. There are, though, a few companies out there taking a different approach: Since most of these systems are DOS based, they work to reverse engineer the controllers, and build custom Linux or other embedded systems, running DOSbox or some other emulator, to keep these machines alive. In some cases, a complete reverse-engineering is done (both hardware and software). There is a demand for it, and very few providers of this kind of service (some machines have little or no documentation on how they worked or were controlled, some have manuals in a foreign language, software is highly proprietary and dongle-ized, etc). So for that case - for your question - yes, this is still done, and likely always will be. I'm sure there are other more "mundane" examples of people using old software on either new machines (say in a VM, or maybe if it runs, just on the new system) or using emulation. There are a few kinds of software where there is great trouble to be had trying to emulate it or such (either because of security dongles, or other custom hardware) - but if it can be done, it is likely to be done...
- w8rbt 9y agoSYS 64738... that will forever be burned in my brain. Loved the C-64. Awesome article too.
- dajt 9y agoMine too! Loved playing around at $C000.
- s_dev 9y agoWhy does Hacker News url preview suggest .com when site is .ie ? Is the author Irish?
- sbierwagen 9y agoBlogspot 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.