Hacker News new | past | comments | ask | show | jobs | submit login

Somewhat related trivia: Sid Meier's Pirates! for the Commodore 64 is written mostly in BASIC, coupled with assembly for parts requiring snappier performance (for example the full-screen scrolling while sailing).



I still cannot wrap my head around this. I was schooled about this fact by one of the C64 experts who frequent HN, and I'm still amazed.

C64 BASIC was terrible even for its time. Due to licensing issues, its capabilities lagged behind those of other BASICs from home computers of the same era. Everything cool you could do with it was basically cheating: PEEK and POKE. As a child, this frustrated me to no end. Even my friend with his Speccy had access to a better BASIC.

And still... Pirates! was made with Commodore BASIC.


It had to be a horrible experience for him since for sure he was familiar with other BASICs. One example: Prior to Pirates!, in 1982, Sid Meir made a game called Chopper Rescue in Atari 800 BASIC:

https://www.mobygames.com/game/41499/chopper-rescue/

https://www.youtube.com/watch?v=rUyebYD5UO0

C64 BASIC had to be a step back, but that's where the sales were to be made. For example, in Atari 800 BASIC variables were not limited to two characters.

C64 BASIC was really PET basic from ~1976, very close to Microsoft's Altair BASIC.


I programmed in PET basic in 1977/78 on my PET 2001 computer with a tape drive. Oh, the memories! And trying to explain to my mom and dad what the large thing on my desk was, and what could you do with it. Dad would bring up Colossus:The Forbin Project (the 1970 movie, which I saw a few years before buying my PET used for $832 in NYC).


C-64 BASIC V2 has all of the same important fundamentals that other BASICs of that era had. What mainly set it aside was the lack of dedicated graphical functions. What was available on the other home computers was on one hand too slow (or too limited) to be useful for pretty much any type of game development - forcing those platforms, too, to "cheat" by interacting with the hardware by POKEing around - but on the other hand fun and educational to explore graphics programming with. The exception would be the very capable BASIC of the Sharp MZ-700 which was of an entirely different class. For the C-64 there were plenty of third-party options.


Well, the C64 itself was a capable machine, so it's no surprise extensions to BASIC had cool capabilities. The issue is that the provided BASIC sucked, no if or buts about it. I remember missing a simple LOCATE statement for placing text (text! not even graphics) that the Speccy's BASIC had, if I remember correctly.

To me, missing dedicated graphical functions (or cool text functions like LOCATE) was a big miss precisely because the C64 was a multimedia computer. As a kid I wanted to do cool stuff with my C64 and had to resort to obscure (to me) POKE commands. "POKE" is not really BASIC, it's a cheat.

I remember when I finally got my PC-XT clone, loaded with GW-BASIC. It had a DRAW statement! I could draw pixels with easy to understand commands, no POKE! My mind was blown. I could even forget I was using a monochrome CRT... I wouldn't get my colors back until a few years later.


My opinion from having written so much in all kinds of BASICs back then is that it is convenience more than unlocking doors. Learning, for example, the two memory addresses to POKE to on the C-64 to move the cursor to a fixed position is a tool one learned no different than learning the more convenient alternatives of "PRINTAT" and "LOCATE". But I do agree that drawing lines etc. directly in BASIC provided a lot of fun. BASIC, by its nature, was the real limitation.

> "POKE" is not really BASIC, it's a cheat.

I don't understand why you don't consider it BASIC, or why it's cheating. Practically every BASIC out there from that era allows for direct interaction with the computer's memory. It's fundamental functionality of the lowest level possible, and the diametrical opposite of cheating.


It's because POKE in C64 felt to me like an excuse not to implement the actual command, "we give up, here's how you interact directly with the hardware". It feels the wrong level of abstraction. I now understand why they went this route (a combination of a poor licensing deal and the need to keep the BASIC implementation small enough to fit in memory), but it still left a bad taste.

And I'm speaking as 10-year old me, who didn't yet understand programming languages: Commodore BASIC felt incomplete.


Spectrum BASIC had PRINT AT (which is probably what you're thinking of). The C64 would probably have to use control characters to achieve the same thing in BASIC if it's anything like PET BASIC (inverted playing card suit characters etc.).


Ah, yes! PRINT AT. I didn't know PETSCII had control characters to place the cursor, but in any case, I think everyone will agree that's more obscure than a nice high-level PRINT AT statement.

(Still, I'd love to go back in time and tell my young self that I could use control characters instead!)

PS: pretty sure there was at least one BASIC that had a LOCATE command, or am I confusing programming languages?

PPS: well, duh! It was GW-BASIC that had LOCATE. No wonder I remembered the command, GW-BASIC was my first true love and the first language with which I actually programmed games.


Yep, stringing together control characters, or setting the cursor position in the screen editor's memory with two POKEs.


Only the 8 bit BASIC fundamentals.

Original BASIC was actually developed with a JIT compiler, only the 8 bit home versions were purely interpreted, and mainframe BASIC already supported structured programming and AOT compilation by the time 8 bit home computers were taking over, e.g. VAX BASIC.

I think many of us that started on 8 bit as kids, and eventually used something else on 16 bit computers aren't aware of this.


The Apple IIgs BASIC files end with this nugget to save themselves during development:

63999 F$ = "TOWN": PRINT "Saving "F$"...": PRINT "UNLOCK"F$: PRINT "SAVE"F$: PRINT "LOCK"F$: PRINT "DELETE/PIRATES/"F$: PRINT "SAVE/PIRATES/"F$: PRINT 27648 - ( PEEK (176) * 256 + PEEK (175))" bytes free": END

(The print strings actually have an embedded control-D / 0x04 so they're executed as commands rather than printed)


That was a pretty common mix, I know mostly from the CPC, but it was the same in (another) green, basically.

Been a kid at that time, I run into performance issues with the BASIC-only approach pretty quick. Sadly I had no good books about assembly or knew someone knowledgeable about it.


You could at least access and control interrupts directly from Locomotive BASIC on the CPC.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: