Logo

Retro computing with a touch of modern and the home for all things, retroCombs (aka Steven Combs).

Disclosure Statement: When you click on links to various merchants on this site and make a purchase, this can result in this site earning a commission. Affiliate programs and affiliations include, but are not limited to Amazon, the eBay Partner Network, and/or others.

20 May 2024

MEGA65 User’s Guide Chapter 3

by Steven B. Combs, Ph.D.

Welcome to the retroCombs MEGA65 User’s Guide series. In this blog post and companion video, I continue our journey with Chapter 3 - Getting Started! We finally get hands-on with the MEGA65! We’ll explore the keyboard, learn basic operations, and I have a bonus not found in the manual, a fun BASIC program to showcase the MEGA65’s color and graphics capabilities. If you’ve not checked out chapters 1 and 2, please do that first before proceeding. It will help you better understand your MEGA65.

MEGA≡65 User’s Guide Series Page

TABLE OF CONTENTS:

Below are the links you need to help you get the most out of your MEGA65.

MEGA≡65 Accessories

SUPPORT THE BLOG AND CHANNEL

Check out the supporters page to learn about my amazing supporters and how you can join our community.

COMPANION YOUTUBE VIDEO

Title: MEGA65 Keyboard, Editor & Freezer: The Basics (User’s Guide Ch. 3)

VIDEO ERRATA

None as of 2024-05-20.

KEYBOARD

Let’s begin the chapter and get acquainted with the MEGA65 keyboard which has a classic Commodore computer feel but with some cool extras. By the way, if you want an even deeper dive into this keyboard, check out my Master the MEGA65 with these Keyboard Shortcuts? and Addendum: Power Up Your MEGA65 with These Keyboard Shortcuts! videos. In these videos I take an exhaustive look at all keyboard functions and features. You’ll need some time. Together, these videos are about 90 minutes of amazing MEGA65 tips and tricks.

SPECIAL KEYS

The MEGA65 includes keys you’ll find on modern keyboards, those found on our favorite Commodore computers, and even a few special keys found only on the MEGA≡65. Let’s begin with the RETURN key.

RETURN - Enters the information you have typed into the MEGA≡65 memory. The late great Jim Butterfield characterized the pressing of the RETURN key with the words, “DO IT” and after you do it, the MEGA≡65 will either execute the command, store information into memory, or display an error message.

SHIFT - There are two SHIFT keys, one on the left and one on the right. These keystrokes are called Shifted Codes and, while similar to their modern counterparts, they have MEGA65 specific functions. Holding the SHIFT key and tapping a key with two front graphics will produce the right graphic. When the MEGA65 is in lowercase mode, holding SHIFT and an alpha character displays the uppercase version. You can switch between upper and lowercase mode by holding shift and tapping the MEGA key (More on this key later.). Holding SHIFT and a numeric/symbol key will produce the alternate character displayed on the key. As an example, to press F2, hold SHIFT + F1. Here are examples in the default uppercase mode using the keys A-S-Z-X-J-Q-W (♠-♥-♣-♠-●-○). Experiment with other keys and you’ll find you can create some interesting and fun drawings using just PETSCII characters.

What’s PETSCII? According to Wikipedia: PETSCII or, PET Standard Code of Information Interchange, is the character set used in Commodore Business Machines’ 8-bit home computers. This character set was first used by the PET from 1977, and was later used by the CBM-IIVIC-20Commodore 64Commodore 16Commodore 116Plus/4, and Commodore 128. Modern computers still contain some, but not all, of these characters as part of their American Standard Code for Information Interchange, or ASCII, character set.

SHIFT-LOCK - The MEGA65 includes a SHIFT LOCK key with an embedded LED and locking switch. Press SHIFT LOCK when it is necessary to type many uppercase characters. While active, you no longer have to press the SHIFT key to activate shifted characters. This includes graphic characters.

The CTRL key is a modifier key and these keystrokes are called Control Codes. Holding the CTRL key and tapping a key will produce a specific result. Holding down CTRL and press number 1 to 8 will change the cursor and character colors. CTRL with 9 and 0 switches reverse-text mode on and off. We’ll look at more Control Codes in Appendix C and we’ll see additional examples when we talk about the Screen Editor. Hold CTRL and press the * key will enter the Matrix Mode Debugger. This debugger is not covered in the MEGA≡65 User’s Guide; however, if you want me to cover other guides in the MEGA≡65 library. Drop a comment below and add your vote.

RUN/STOP Tap the RUN/STOP key to exit a running BASIC program. Some programs, especially assembly language programs, disable RUN/STOP. SHIFT + RUN/STOP will load the first program found on a floppy disk or attached disk image. Press and hold RUN/STOP while resetting the MEGA65 will enter the Machine Code Monitor. You can also use the MONITOR command.

RESTORE - Press and hold RUN/STOP and then tap RESTORE to restore the computer to a “clean state” without clearing the contents of memory. Programs can disable this feature and it rarely works with assembly language programs. Press and hold the RESTORE key for about a second and release when the screen border flickers. The Freezer will display. We’ll spend more time in the Freezer later.

CURSOR KEYS - On the bottom right-hand side of the keyboard, unlike the Commodore VIC-20 and C64, but like the Plus/4 and C128, there are four cursor keys. The cursor keys move the cursor in the direction they point; either , , , or . No need to keep tapping a cursor key to move it into multiple spaces; hold a key down instead. If your Commodore computer muscle memory is stuck on the two cursor configuration, you can use SHIFT + to move the cursor up and SHIFT + to move the cursor left. Holding down these keys (including the SHIFT combinations) will move the cursor until you stop pressing them.

ARROW KEYS - The MEGA65 keyboard includes two arrow keys (don’t confuse these with cursor movements)); next to RESTORE and next to 1. To distinguish them, I will use (↑) and (←). Use (↑) to raise a number to a power. For instance, the immediate command: PRINT 2(↑)3 will display the number 8. Use (←) as a shortcut to SAVE a program to a disk or disk image as shown in the example:(←) "SUB TRACK SYS

Later I will show how to use these keys with Escape Codes.

TIP: A closing quotation is not a required after commands such as LOAD or SAVE. More about those commands in later chapters.

INSert/DELete - Press INST/DEL to delete a character to the left of the cursor and move all remaining characters on the line to the left one position. Press SHIFT + INST/DEL to move all characters to the right one position, leaving a blank space, as needed, or to insert another character. Holding either key combination will continue to insert and delete until you stop pressing them.

CLeaR/HOME - Press CLR/HOME to place the cursor at the top left-hand position on the MEGA65 screen. Press SHIFT + CLR/HOME to clear the entire screen and place the cursor at the top left-hand position on the MEGA65 screen. If you accidentally press CLR/HOME, you can return the cursor to the original position by tapping ESC followed by the CLR/HOME. Super handy and a nice quality of life addition from you friendly neighborhood MEGA65 developers.

Commodore to MEGA65 Logo

The MEGA key is a modifier key. These keystrokes are called MEGA Codes. Holding the MEGA key and tapping a key with two front graphics or a single graphic symbol will produce the left graphic or single symbol. As mentioned earlier, holding SHIFT and tapping the MEGA key toggles between lower and uppercase character modes. Holding the MEGA key and tapping a number switches the color to the second color range, or the number key’s bottom color listing. Holding the MEGA key and tapping the TAB key activates the Matrix Mode Debugger.

TIP: While I don’t cover the functions available in the Matrix Mode Debugger, one handy tip is that this is a quick way to know which core is in use.

For long program listings, MEGA after using the LIST command to slow down the program listing a single line at a time. We’ll look at the LIST command in future chapters. Finally,

Holding the MEGA key while turning on or resetting the MEGA65 will boot to GO64 mode, or Commodore 64 mode. More on this mode later.

NO SCROLL - When you LIST a program, press NO SCROLL to toggle listing. This key does not work in GO64 mode.

FUNCTION KEYS - Software developers can program the MEGA65 function keys; however, many have native functions that we’ll cover later. To use odd number function keys, tap them. For even number function keys, hold SHIFT + a function key. Only function keys F1F8 are available in GO64 mode.

HELP - The HELP key can serve as function keys F15 and F16; however, it also has a programmer function. If you run into a syntax error when you run a BASIC program, press the HELP key and BASIC 65 will display the first line of code with an error.

ALT - The ALT key is a modifier key that software developers can use to add functionality to their software. Press and hold ALT while booting the MEGA65 to enter the MEGA65 Utility Menu. With this menu you can configure the MEGA65, format and prepare an SD card, and perform a keyboard test. This key is not available in GO64 mode.

CAPS LOCK - This key is similar to SHIFT LOCK but only works with alpha keys. CAPS LOCK a superpower. Press and hold the CAPS LOCK to force the processor to run at 40 MHz. While this is default speed in MEGA65 mode, GO64 mode defaults to the original 1 Mhz. Hold down CAPS LOCK while in GO64 will speed up loading from the SD card, a program de-pack process (you know, the flashing borders!), and slow program execution such as fractal generation.

THE SCREEN EDITOR

At the end of the last chapter, I teased that the joy of any Commodore computer, the MEGA65 included, is the wonder of what’s next when you power on the MEGA65 computer and are presented with the blue background and information found on the screen editor. It starts with the color bars in the top left-hand corner of the screen. They are not only attractive, but you can use them to calibrate the colors on your display. The screen editor also displays the MEGA65 title, copyright information for MEGA, Commodore, and Microsoft, the BASIC 65 label followed by the installed ROM version (we’ll learn what that means later), and the date and time of the internal RTC which we talked about in the last chapter. And then, where all the magic happens, the READY prompt with a flashing cursor below. Let’s look at basic, NOT BASIC, screen editor functions.

TIP: I used this technique to create my MEGA65 Colors BASIC program.

Those bars you typed early, while pretty, will cause an error code if you hit the DO IT! key, or RETURN. But if you type SHIFT and RETURN, the MEGA65 will not parse the line as code and move the cursor to the beginning of the next line. You can use this technique to draw on the screen.

Now let’s chat about two screen editor functions that confuse new Commodore users; quote and insert modes. These modes are features of BASIC 65 and will be used while programming.

Quote Mode

Let’s look at a line of BASIC programming.

10 PRINT "HELLO WORLD"

I won’t discuss the details of this BASIC code, YET!. However, you can probably determine what this line of code will do when you RUN the program. You enter quote mode when you type the first quotation mark of the line of code. Let’s try an example of quote mode without creating a line of BASIC code.

  1. Hit the return key to move to a new line. You will get an error message. Ignore it.
  2. On the new line, type the " key.
  3. Now tap the CLR/HOME key. You probably expected the cursor to move to the top left-hand corner of the screen. Instead, BASIC 65 displays a character after the " symbol.
  4. Turn off quote mode by ending the line with another " character.

If you include this quoted code behind a line number and the PRINT command, BASIC 65 will see that symbol and “press” the CLR/HOME key, or clear the screen and move the cursor to the top left-hand corner of the screen.

Insert Mode

By default, typing on the MEGA65 “overwrites” characters and spaces as you type. But what if you want to insert characters between others? That’s where Insert mode comes in. Press and hold SHIFT, followed by the INS/DEL, will provide a space, or spaces, for new characters and shift existing characters to the right. Quote mode is also in effect. Like quote mode, you can return to regular editing mode by tapping ESC + O.

Functions

During this chapter I’ve touched on the following keyboard functions:

We take a deeper dive into these functions in Appendix C; however, let’s look at a few quality of life improvements we use with Escape Sequences.

ESC Sequences

As mentioned early, Escape Sequences differ from the other functions because you don’t hold down the ESC key; but you tap the ESC key and then tap the next key. Here’s a handy example:

EDITOR FUNCTIONALITY

The MEGA65 editor has several ways to move the cursor around the screen.

CTRL/HOME - Send the cursor to the home position or the top-left corner of the screen

CTRL + W - Moves the cursor to the next word, or printable character, in a line (known as the Word Advance Function)

CTRL + I - Moves to the next tab location 8 positions to the right (known as the Forward Tab Function)

TAB - Same as CTRL + I

NOTE: Unlike modern computers, SHIFT + TAB or SHIFT + CTRL + I does not execute a Backward Tab Function. But you can use CTRL + Z` instead.

If you need different tab stops, you can set those using CTRL + X. Let’s try an example:

You have added two new tab stops to the default tab stops. You can remove these new tab or default tab stops by positioning the cursor and using CTRL + X.

Creating a Window

A window on the MEGA65 is similar to what you are thinking of, but doesn’t include a window frame or controls found in modern operating systems. Let me explain with this Escape Sequence example.

  1. Reset the MEGA65
  2. Move the cursor on top of the B of BASIC 65 on the MEGA65 start screen
  3. Tap ESC and then tap T
  4. Use the cursor keys and move down 10 rows and to the right 15 columns
  5. Tap ESC and then tap B

Everything you type, or program you RUN and LIST, is now contained within that window. To clear the window, press CLR/HOME twice. The cursor will move back to the home position and remove the window but the previous contents of the window will remain on the screen.

Additional ASCII Characters

The MEGA65, unlike its older siblings, can create ASCII characters that are not part of the PETSCII character set. You can see these characters on the front of the corresponding MEGA65 keys but here’s a helpful table:

KEY PETSCII ASCII
Pound £ \
Up Arrow ^
Left Arrow _
MEGA + : {
MEGA + . |
MEGA + \; | }
MEGA + \, π ~

To use ASCII characters, you have be in lower case mode and enter the FONT command followed by one of the following flags:

Let’s look at an example:

  1. Reset the MEGA65.
  2. Tap ESC + 4 to switch to 40 column (this will make the characters easier to see).
  3. Type FONT A and press RETURN, the READY prompt will return and it will look like nothing has changed.
  4. Use MEGA + SHIFT to switch to lowercase mode.
  5. Hold down the MEGA key and tap the : + ; + , + . keys and ASCII characters will appear instead of PETSCII characters.
  6. Type FONT C and the ASCII characters will be replaced by PETSCII characters.

TIP: FONT options D, E, and F eliminate the need to switch to lowercase because lowercase mode is their default option.

Uppercase and Lowercase

Although we’ve already covered it several times in this chapter, to stay with the flow of the manual, I’ll mention again that you switch between upper and lowercase modes by holding down MEGA and tapping the SHIFT keyboard combination. If nothing else, you should have this one memorized by now!

THE FREEZER MENU

Chapter three is full of features that were a part of the original Commodore 65 design and some new improvements by the MEGA65 team. The Freezer Menu is an example of a tool that is entirely the work of the MEGA65 team and gives the MEGA65 a huge usability boost.

To display the Freezer Menu, press and hold the RESTORE key for about a second. The MEGA65 will freeze its current state (don’t worry, everything is still in memory), the border will flash and the Freezer Menu will appear. This menu has many options. I’ll cover the disk options in Chapter 6 and the MEGA65 Information Utility in Chapter 5, but here are three options to get you started:

Now let’s talk about the magic that is the Freezer Menu. Not only does this menu freeze the MEGA65 contents, but it can save the state of computer even if you power off the MEGA65! And it’s super simple:

  1. Press the cursor key to find an unused freeze slot
  2. Press F7 and the MEGA65 border will blink to show it is saving the state
  3. Press F3 to resume using the MEGA65
  4. Press RESTORE for a second to return to the Freezer Menu
  5. Use the and cursor keys to locate a preferred state
  6. Press F3 to select the state, load, and use it

TIP: The Freezer Menu works in both MEGA65 and GO64 modes. The images even change to their respective computer compatibility to make it easier to determine which mode has been saved and will be loaded.

RUNNING COMMODORE 64 SOFTWARE (GO64 MODE)

A feature of the abandoned Commodore 64DX (or C65) was the ability to play Commodore 64 titles like its 8-bit predecessor, the Commodore 128. It does this using an emulation feature calledGO64 mode. Since the MEGA65 seeks to copy all Commodore 65 functionality, it too includes GO64 mode, but because the brain of the MEGA65 is an FPGA, the community can create a custom core that “rewires and replaces the internal circuitry” to convert the MEGA65 into a Commodore 64 rather than just emulating one. Let’s look at both options.

GO64 Mode

The MEGA65, and the original C65, use a different processor than a Commodore 64. Unlike GO64 mode on the C128, the MEGA65 is not nearly as compatible with all Commodore 64 software. I’ve found the MEGA65 does well with cracked games (elimination of copy protection), but often fails with utilities that exploit the hardware. Maybe someone in the community will one day create a compatibility chart for us? Is that someone you? Let me know in the comments below.

To use Commodore 64 emulation mode on the MEGA65, type GO64 or GO 64. When prompted type Y followed by RETURN. The MEGA65 will switch to the familiar Commodore 64 boot screen color but has a custom start screen title: **** MEGA65 GO64 BASIC V2 ****

There are two other ways you can boot into GO64 Mode:

  1. Hold the MEGA key and power on or reset the computer.
  2. Turn off the MEGA65. Plug in a Commodore 64 cartridge. Turn on the MEGA65. It will boot directly into GO64 mode and load the cartridge, if it is compatible.

As a reminder, in GO64 mode, the Freezer Menu is still available. This means you can use it to mount .D81 disk images. .D81 files are currently the only image files compatible with the Freezer Menu but you can plug in a 1541 drive to access real floppy disks. Alternatively you, you can plug in an SD2IEC or Pi1541 to read .D64 images. Remember, a stock MEGA65 does not include a tape drive port. Many SD2IEC devices require this port.

The C64 For MEGA65 FPGA Core

If you want a highly compatible Commodore 64 experience that reads .d64 disk images by default, you want to install the C64 For MEGA65 Core by MJoergen and sy2002. We’ll learn how to download and install cores in Chapter 5. If you’d like a preview of the latest version, check out the link below:

https://github.com/MJoergen/C64MEGA65

The core is a complete replacement for the MEGA65 hardware and features. It even includes its own menu (the MEGA65 Freezer Menu is no longer available) to make hardware modifications and to access .d64 images. I’ve found this core to be highly compatible and a wonderful addition to the MEGA65. Before you ask, YES! There are cores for other computers. But that’s for another chapter.

CONCLUSION

Want to ask questions, make suggestions, and get additional insights? Visit my Buy Me A Coffee page so you can learn how to join my Discord. I’ve created a separate channel for this series so the conversation can continue. The only way you have access, and to keep our nasty SPAMbots, is to support the channel. You can get access to the Discord by joining at the Commodore VIC-20 level for only $2/month. Of course, I have other Commodore-inspired levels with additional perks, like the MEGA65 level!

See you next time, retroCombs, OUT!