EasyManua.ls Logo

Mega 65 - Page 76

Mega 65
101 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
MEGA65 Welcome Guide
11.4.1 macOS: prepare the tool for use
Getting the downloadable binary to work on a Mac requires a few steps:
1. Download m65.osx.
2. Give the file execute permissions: chmod 755 m65.osx
3. Rename the file to remove the .osx extension: mv m65.osx m65
4. Locate the file in Finder. (open . will open the current working directory as a folder.)
5. Right-click on m65, then select Open. macOS will warn that the binary is not signed. Click the Open button.
This will attempt to run the command in a Terminal window, fail, then exit. (This is fine.)
You can now run the m65 command at a command prompt or in a script. (You can also rename it back to m65.osx if
you like.)
11.4.2 Determining the serial port
You need to tell m65 which device to use as the serial port that connects to the MEGA65. Unlike M65Connect, the tool
has no built-in way to scan for working ports.
The easiest way to do this is to run M65Connect and get it working, then open the Settings menu, Connection, and note
the configured value. (On a Mac, this is something like /dev/cu.usbserial...)
Be sure to close M65Connect afterward, so it frees the serial port for use by m65.
11.4.3 Running m65
The m65 command accepts a wide variety of options for each of its functions. Run m65 without arguments to see a list.
To specify the serial port, use the -l option: -l /dev/cu.usbserial...
The remaining arguments tell m65 what to do. For example, to get it to type ?TI$ followed by Return (this prints the
current Real-Time Clock value in BASIC):
./m65 -l /dev/cu.usbserial... -T "?ti$"
For uploading programs, m65 just takes the filename, and figures out what to do based on the filename extension. To
load a PRG file into memory:
./m65 -l /dev/cu.usbserial... myprogram.prg
Tip: The petcat command line tool included with the VICE emulator can convert a BASIC program listing in a text
file to a PRG that the MEGA65 can run. It supports PETSCII special characters as bracketed labels, such as {clr},
and it knows all about MEGA65 BASIC.
For example, say you have a BASIC program listing named myprogram.bas:
10 screen 320, 200, 5
20 for x=0 to 31
30 pen x
40 circle x*10+10, x*10+10, x*5
50 next x
60 sleep 3
(continues on next page)
72 Chapter 11. Using the JTAG connector

Table of Contents