A Whole New Different

Commodore 128 Assembly Programming #23: Banking

Memory management (banking) in the C128 is unlike the C64 or other 8-bit Commodores, since it uses the MMU to switch blocks of ROM and RAM in and out of service. This can seem kind of complicated at first, but it’s essential to taking full advantage of the resources that the C128 provides, so I thought I’d do a whiteboard tutorial on how banking works and how to do it in assembly.

Commodore 128 Assembly Programming #22: Worm part 6

The Worm game is finished! It works pretty much how the BSD version does, which was the goal. It could be prettied up further than that with multiple colors and sounds or other new features, so if anyone wants to fork the source from the repository and do that, or use it in any other way, feel free. I’m ready to move on to something else, probably a more complex game with bitmap graphics, sprites, and sound.

Shazam? Ah, No, Never Mind

[Setting: A Hollywood conference room.] Suit #1: “Gentlemen, we have a problem. Our new movie is setting up to be a disaster. Test audiences hate it. They’re saying it makes no sense and that the lead actress has two modes, boring and bitchface. The editors say there isn’t enough good there to salvage. We’ve been promoting it hard, and now word is leaking out that it’s bad. How can we save our asses?

Loving Perl and Appreciating Python

So I learned Python the other day. Actually, that’s a joke. You can’t learn a programming language in a day. But if you already know several others, you can learn the basics: the syntax, looping constructs, how variables work, things like that. Enough to write simple scripts while checking the documentation for specifics on particular functions. Python has become ubiquitous enough that I figured I need to be familiar with it, if not expert, so I plowed through a tutorial.

Commodore 128 Assembly Programming #21: Worm part 5

In this session, we change the color scheme and show how to fill color RAM to set the foreground color for text characters. We add a delay between moves and change the keyboard routine so a key can be held down without repeating too fast, and also to put a time limit on moves. Next time we’ll be adding a final score display and a “play again” question, as well as a graceful exit back to BASIC.

Commodore 128 Assembly Programming #20: Understanding the 6502 Stack

There may be some stack pointer manipulation coming up in the next Worm video, so I thought I’d do a mid-week video explaining the 6502 stack in detail. This one goes over how to use it and demonstrates what happens under the hood, instruction by instruction, then how to manipulate the pointer manually if you need to. It also touches on the pitfalls in using the stack and what to watch out for.

Commodore 128 Assembly Programming #19: Worm part 4

It’s customary when making videos about 1980’s technology to wear a funny or ironic retro t-shirt. I have only one of those, so instead, enjoy one of my collection of local farmer hats. In this one we add code to keep the tail pointer-to-pointer (TAILP) updated, to handle collisions with digits on the screen, and to keep the worm at the proper length, growing it when it “eats” digits. All the worm functionality is finished now, so next time we’ll work on the end-game score display, and a better keyboard-entry routine.

Fixing a Monitor with an Identity Crisis

After today, I’m about ready for an old-man rant about the evils of modern technology. Instead I’ll write up the problem and solution I had today in case others come looking for it. I happened to brush against my computer today and the static caused it to freeze up. Okay, that’s annoying, but not the end of the world. Reboot and start things back up. But monitor #2 came back up in a weird resolution.

6502 Assembly Language #18: Indirect Addressing

I covered these addressing modes in video #14 on the addressing modes in general, but I’ve had a couple of questions about the indirect modes specifically. I thought it might help to draw out examples on the whiteboard, since they are more complicated than the other modes. Hopefully watching this along with the examples in #14 will make it clearer. Indirect addressing, especially the Y-indirect (indirect indexed), is a powerful mode that lets you setup pointers into memory that can be adjusted on the fly, as we do with HEADP and TAILP in the worm program.

6502 Assembly Language #17: Pointers to Pointers

While working on the Worm program in #16, I realized we need to use pointers to pointers, which is kind of a complicated concept. I didn’t think my impromptu explanation there was very clear, so I thought it’d work better to draw it out visually and walk through what happens. This method will allow us to keep track of the parts that make up the worm, in order from head to tail, so we can drop the tail characters as the worm moves along.