Hare Basic for the Commodore 64

Our friend Robin at 8-Bit Show And Tell lets us know of this cool and free Commodore 64 BASIC 2.0 extension, of a sort, called Hare Basic. It’s a successor to an earlier version called Bunny Basic. Here’s the video, 48 minutes long. My comments on it follow below, which you can read either after having watched the video, or before, depending on of you have most of an hour to spare right now.

Here are the downloads, which are hosted on the creator’s Dropbox, so availability may fluctuate.

Commodore BASIC is, in many ways, the worst of all worlds. It’s a slow interpreted language, a variant of infamous Microsoft BASIC, and it has almost no machine-specific features, but it comes with the machine, and it’s burned into ROM. You can swap it out for extra RAM if you have a replacement OS or are running something in pure machine code.

I could go on for a long time about the problems with Commodore BASIC 2.0, a language I’m quite familiar with having spent much of my teens programming in it. Sometimes it feels like it was designed especially to run slowly. One example: it supports floating point math, which ordinarily would be a good thing, right? Use integer math for performance, and just use floats when you need decimals, right? But no: internally, Commodore BASIC converts integer variables into floats when doing any math with them, and converts them back to store as integers when it’s done. Wilberforce Trafalgar Franklin?! Why?! It does these unnecessary extra steps to do all arithmetic as floating point even when it doesn’t need do, and doesn’t offer a way to do performant integer math at all! Need I remind you that Microsoft BASIC is based upon software written by Bill Gates himself? I suspect that I don’t!

Hare Basic is a highly optimized subset of Commodore BASIC that can be switched on and off as needed. It has to be coded in a special way which might throw beginners for a loop: Hare Basic can’t abide whitespace, for example, only allows for variables of one letter in length, has no support for modifying strings, and contrary to Commodore BASIC can only do integer math. There’s lots of other differences too, and if you want to play around with it it’s essential that you study the manual.

But once you get used to it, it runs blazingly fast, sometimes as much as 10 times faster! And the best part is you don’t have to use it for everything. You can start out with a standard Commodore BASIC program, then enter into Hare Basic mode with a USR function call. You could write your whole program in Hare if you’re up for it, or just loops, or other places where performance is necessary.

Of course, this is ultimately an enhancement for a programming language that runs on a home computer made in 1984. It’s not what one might consider of universal interest. But it might be of interest to the kinds of people who read this site. It’s interesting to me, at least. Maybe I should dust off VICE and see what I can do with it? I haven’t coded on a ’64 in nearly three decades, maybe I should get back into that….

Wherefore Pac-Man’s Split Screen?

I did a search of the blog to make sure I haven’t posted this before. I’m really an obsessive tagger, and it didn’t show up under the tag pacman, so I think it hasn’t been seen here before. Let’s fix that now!

It’s a video from Retro Game Mechanics Explained from six years ago, and it’s 11 1/2 minutes:

Here’s a terse summary of the explanation, that leaves out a lot. Like a lot of 8-bit games (the arcade version uses a Z80 processor), Pac-Man stores the score in one byte, making the maximum it can count to 255. Since it doesn’t use signed arithmetic, it doesn’t use the high bit to signify a minus sign and so flip to negative at 128.

As an optimization, Pac-Man’s code uses the depiction of the maze in the video memory, itself, in the movement of both Pac-Man and the ghosts. If a spot has a maze wall tile, then Pac-Man can’t go there, and the ghosts won’t consider that direction when moving.

At the start of every level, the game performs some setup tasks. It draws the maze anew, including dots, Energizers and walls. One of these tasks is to update the fruit display in the bottom-right corner. It was a common design idiom at some arcade manufacturers, especially at Namco, at the time to depict the level number with icons in some way. Galaga shows rank insignia in the corner; Mappy has small and large balloons and mansions.

Pac-Man’s code shows the bonus fruit for each level, up to seven of them. If you finish more than seven levels, only the most recent seven are shown. If you get far enough eventually this will be just a line of Keys, the final “fruit.”

The code draws them from right to left. There’s three cases (the video goes into much more detail), but generally it starts from the fruit of six minus the current round number, draws it, counts up once and moves left two tiles, draws that one, and so on.

An interesting fact about Pac-Man’s graphics hardware is that the screen doesn’t map as you might expect to the screen! A lot of arcade games have weird screen mappings. Most consumer programmable hardware will map characters horizontally first vertically second, like a typewriter*.

In Pac-Man, the bottom area of the screen comes first in memory, starting at memory location hex $4000 (16384 decimal), and it doesn’t go forward like an English typewriter, but is mapped right to left. The first row of 32 tiles comes at $4000, and the second row is $4020. Then the playfield area is mapped completely differently, in vertical rows going down starting from the top-right of its region, then the next vertical row is the one to the left of that, and so forth to the left edge of the playfield. Then comes the score area at the top of the screen, which are two final rows mapped the same way as the bottom area, right to left.

From the video, this chart shows how Pac-Man’s screen memory is mapped.

When Pac-Man’s score counter overflows, it breaks the check for the limit for only drawing seven fruit, and causes it to draw 256 fruit. This is why the tops of keys are drawn beneath the upper-halves of the fruit at the bottom of the split screen. It also breaks the tile lookup for the fruit.

As it continues writing its missourced fruit tiles in memory, it goes back in memory each time to draw the next fruit, and after the fruit section of the display it keeps going to the left, into the area where Pac-Man’s lives are displayed, then it keeps going and overwrites half of the maze tiles. Then Pac-Man’s lives (and any empty spaces that indicate the lack of lives) are plotted, overwriting fruit after the first ones drawn and obscuring some of the memory corruption.

Since the game’s actors use that data to decide where to move, and where dots and Energizers are placed, it means they can move outside the bounds of the maze, and that there won’t be enough dots for Pac-Man to eat to complete the level. That’s what makes it a kill screen: if Pac-Man loses a life, a few dots will get placed in the maze as the fruit are redrawn, but it’s not enough to bring the dot-eaten count to 244, which triggers the level clear function.

If the fruit-drawing loop didn’t stop at 256 (another artifact of using 8-bit math for the loop), it’d go on to clobber the rest of the maze, the score area at the top of the screen, then color memory (which has already been clobbered by the palette-drawing portion of the loop). Then, going by a memory map of the arcade hardware, it’d hit the game logic RAM storage, which would probably crash the game, triggering the watchdog and resetting the machine.

The visual effect of the split screen is certainly distinctive, enough that since Bandai-Namco has capitalized on its appearance at least once, in the mobile (and Steam and consoles) game Pac-Man 256. I’ve played Pac-Man 256: it’s okay, but, eh. It’s really too F2P unlocky.

* Yes, I just used a typewriter’s operation as a metaphor for something a computer does. It didn’t feel acceptable to use another computer thing as the comparison, since ultimately the reason they do it that way is because typewriters did it that way too. I guess the fact that it’s English reading order would be better to use, but I’m really overthinking it at this point.

Sundry Sunday: Animation of a Splatoon 3 Song

Sundry Sunday is our weekly feature of fun gaming culture finds and videos, from across the years and even decades.

The Splatoon series has a lot of great music, usually composed along the lines of squishy voices shouting gibberish, which makes sense due to the singers being squid, or other forms of aquatic life.

One of the songs in Splatoon 3’s single-player campaign is Seep and Destroy, which has gotten the fan name of Bang Bing due to a specific frequently-heard vocalization within it.

nathors made an animation (2:46) that has no sea life at all, but fits really well. It imagines the song as backing a civilization of Easter Island heads, who get abducted by a planet of robots, and then they fight their way onto a spaceship and back home. It’s fun! It’s here:

Doing Weird Things To A Sega 32X

The Youtuber: MattKC Bytes
What he did: Unexpected things to Sega’s aborted Genesis/Mega Drive add-on.
The address: here.
The length: about seven minutes.

The explanation: Did you ever play around with a 32X? Evidently not a lot of people did. It was straaaange. Unexpectedly powerful! A bit misjudged! Hosted a port of DOOM! Had a port of Virtua Racing that compares favorably with the Saturn version! Had that crazy hard-to-play Knuckles game that gave us Vector the Crocodile!

Have you ever hooked one up though? Its hardware is odd. It’s like a completely separate console to itself. The Mega Drive wasn’t made to support add-on processors and chips like that, so Sega used a clever solution: the 32X has its own video output, and also a video input. You plug the Genesis’ output into the 32X, and then the 32X into your TV. The 32X mixes the Genesis’ signal into its own, as if it were chromakeyed. Since the 32X cartridge supplies the program running on the Genesis as well as itself and they can talk to each other, the two processors and graphics chips should be able to sync perfectly, if awkwardly.

But: because the Genesis’ video signal emerges from that console through this external wire before reentering the 32X, it’s possible to do things to it while in transit. The Genesis supplies video timing information that the 32X relies on, so you can’t get a signal from the add-on without the Genesis’ AV plugged into it, but the Genesis does produce a viewable video signal that you can see on its own.

All the details are in the video, which has been embedded below for your convenience and amusement.

HG 101 Forum Thread on Obscure Arcade Secrets

Today’s find somehow doesn’t involve a Youtube video! On the forums for Hardcore Gaming 101 there’s a thread, inspired by the lengths players must go through to reach the true ending of Bubble Bobble, about arcade games with super obscure secrets. I don’t even think I know what they’re talking about with the Rainbow Islands secret, involving playing through the game seven times doing a minor thing different each time. It sounds like a bit of a money sink to me, but this was the era of Tower of Druaga after all. The thread is here.

If you don’t know about the absurd secrets in Bubble Bobble, the best guide I know of to those is still the Bubble Bubble Info Pages, last changed in 1998 but still on the web after all these years!

Excellent Breakdown of Wii Music Capabilities

By that title, I don’t mean the capabilities of the Wii title called Wii Music*. The video below, from Dublincalif, is about the properties of the Wii’s sound system itself. It’s 24 minutes, but pretty interesting for all that, and it’s presented really well. It’s a model explainer video, and a great first effort in that style from its maker!

You might think that all the music on the Wii is just streamed, either from audio tracks or files, but it isn’t. The Wii has fairly little NAND storage, and music is a major consumer of storage space, so a lot of its music is sequenced, essentially MIDI files played with sample banks, with optional effects added. The video is a great overview of its features and capabilities.

* Of random interest: Wii Music’s data is amazingly small! Of that 4.7GB DVD it resides on, it uses less than 10 MB!

The Wii’s Music Is A Bit Complicated (Youtube, 24 minutes)

Farming Simulator eSports

The life of a farmer is a difficult one. Most people don’t know how difficult it is to succeed in agriculture. It’s not enough to harvest fields of wheat and bale hay. The first bale of hay collected in the barn, as it turns out, sets a multiplier! And any grain collected in the silo, and any hay harvested in the upper floor of a barn (but only the upper floor), is not only affected by that multiplier, but reduces the multiplier of rivals. I presume all of this is due to farm subsidies.

These are the idiosyncratic rules of Farminng Simulator eSport, a popular (in some circles) gaming competition, it seems, in Germany. Teams are sponsored by agricultural equipment manufacturers, and there’s a pick/ban system in place for tractor selection. Pro gamers compete to get bales into their barns (preferably by that magic window into the upper floor!) before their opponent does, and can raise and lower a bridge on the rival farm, in an effort to mess them up, all while real farmers share pints of lager and look on in confusion.

People Make Games looked into this scene and explains it over half an hour, here:

Inside the Peculiar World of Farming Simulator eSports (Youtube, 32 minutes)

JRPG Junkie’s Review of Skies of Arcadia

It’s not completely positive, as they point out the game’s high encounter rate and the slowness of battle, but gosh there’s a lot of awesome things in Skies of Arcadia that don’t seem to have ever been revisited in other games.

The main overworld is one in which you have an airship and fly around a world that has floating islands but no real ground. Sure, that’s been done by other people, and more than once, and fairly recently too, but SoA brought some really interesting nuance to it that gave players good reason to explore, like interesting optional subquests. You could find mysterious locations out in the world and sell them to the Explorer’s Guild for extra money, but only if you’re quick enough to stay ahead of rival ships also looking for them. There was also an alternate form of combat, ship-to-ship (and sometimes ship-to-huge-monster) battles, that played out very differently from the JRPG norm. All the extra things to do gave the game this weird veneer of simulationism, which I always find interesting, even if it was largely an illusion.

Skies of Arcadia was originally a Dreamcast release, one of only two substantive JRPGs made for that system (the other was Grandia II), and fell victim to the Dreamcast’s short life and subsequent exit from console manufacturing by Sega. It did get a remake for the Gamecube, but that was the last we’ve seen of Skies of Arcadia, other than character cameos in Sonic racing games.

JRPG Junkie: Back to the Backlog – Skies of Arcadia

Sundry Sunday: Bowser Explains Why He Turns His Castles Into Race Tracks

Sundry Sunday is our weekly feature of fun gaming culture finds and videos, from across the years and even decades.

Why does Bowser set up race track courses in his castles? Does he have that many to spare? It’s a question with a simple answer, that he answers in 50 seconds. It’s also pretty good animation on Bowser, done in Blender by GleanieBOI!

Ocarina of Time-r Bug

Here is a very short video from Seedy, only a minute long, explaining an interesting bug in The Legend of Zelda: Ocarina of Time.

OoT handles fiery environments without the Red Tunic, and being held underwater by wearing Iron Boots without the Blue Tunic, in an unusual away. You might expect them to return Link to the last safe place he had been, like when falling into a void, or else maybe kill him instantly, or at least cause periodic damage. Instead, for whatever reason, the designers chose a unique way to implement the danger Link is in.

While in hot places or stuck underwater without the proper tunic, the game starts a timer, with time relative to the amount of health that Link has. If Link leaves the area or puts on the right tunic before time runs out, the timer goes away and Link takes no damage regardless of how much time was left on it. However, if the timer expires before Link reaches safety, he just dies instantly, “getting a game over” in the clumsy parlance of video games. You’d think it’d be better just to inflict some damage on Link every few seconds, but that’s not how they chose to do it.

Link gets eight seconds on the clock for every full heart he has. Fractions of a heart grant proportional time. While the game only displays health in quarter-hearts, Ocarina of Time actually tracks hearts in 16ths (each full heart is effectively 16 hit points), and each 8th of a heart grants Link one second on the timer.

So, what happens if Link has exactly 1/16th of a heart? The display rounds up, so it looks like Link has a quarter of a heart left, but he’s considerably closer to kicking the bucket than that. He has less health than what’s needed to get a one-second timer. How does the game cope with that?

It does it by just not starting a timer at all! If Link is almost dead, paradoxically, he becomes immune to fire and drowning timers. He’s still in great danger, for any attack on him in this state will kill him immediately, but it makes tunic-less challenge runs a bit more interesting.

Break Timers With Low Health (Youtube, 1 minute)