First Prev Contents Next Last
First - Prev - Contents - Next - Last
Deutsch Español Italiano
Deutsch - Español - Italiano

7. Built-In Programs

Power64 features several built-in programs. SMON and the NEW Magician are useful tools that come very handy when programming the C64. Block Out, Serpentine and Quadromania are fun games, that can be used for instant testing of the quality of the emulator.

Note that selecting one of there programs from the menu bar will load that program without respect to any application that might currently be executing.

7.1 SMON

SMON is one of the best (if not the best) machine language monitor for the Commodore 64. It features a wide range of functions to display and modify (including an assembler) the C64 memory. Furthermore it permits to trace trough programs in single step. There is even a small disk monitor included.

SMON requires 4 KByte of RAM for its program code and local variables. To provide greater flexibility Power64 supplies three versions of SMON, that differ only in terms of the memory range that they occupy in the C64 memory. SMON($C000) uses the memory from $C000 to $CFFF and must be started with SYS 49152. This part of the RAM is not used by BASIC, and is therefore the most popular (and recommended) place for tools like SMON. If you want to use SMON together with another tools that blocks this space you can use one of the two other versions of SMON, either SMON($9000) [SYS 36864] or SMON($8000) [SYS 32768]. Note that these versions use some of the memory (4 KByte for SMON($9000) and 8 KByte for SMON($8000)) that would otherwise be available for BASIC. The pointer to the top of the available RAM ($37/$38) is automatically adjusted when these versions of SMON are loaded, to prevent that BASIC overwrites SMON with variables.

SMON has been written by N.Mann and Dietrich Weineck in 1984/85 and has been released (in installments) to the public as a type-in listing in the German magazine "64'er". The listings and a detailed description of SMON can be found in issues 11/84, 12/84, 1/85 (p.69), 2/85 (p.72), 4/85 (p.64) and 12/85 (p.100). It has been included in Power64 with the friendly permission of Magna Media.

The magazine "64'er" has been published monthly until January 1997 by

MagnaMedia Verlag (formerly Markt&Technik Verlag AG)
Redaktion 64'er
Hans-Pinsel-Str. 2
85540 Haar bei München
http://www.magnamedia.de/64er (Link dead)

SMON supports the following commands:

A xxxx - Assemble
Assemble Code starting at xxxx. It is possible to use markers (a simple form of symbolic labels) in the form Mxx. A single X ends the assembly.
B xxxx yyyy - BASIC Data
Create BASIC Data lines for the memory contents from xxxx to yyyy. Note: Line-numbers start with 32000 (defined in ($C087/$C088). The maximal length of a created BASIC line is usually 80 character (the maximal length that can be edited with the C64 BASIC editor). If you want shorter lines (e.g. 72 characters, that are usually the limit for emails and news-postings) set $C9AE to the desired length -7 (e.g. 65 for 72 characters).
C xxxx yyyy zzzz aaaa bbbb - Convert Program
The memory block from xxxx to yyyy is moved to zzzz. All absolute addresses in the code between aaaa and bbbb that pointed into the moved range are adjusted.
D xxxx (yyyy) - Disassemble
Disassemble the program starting at xxxx (and ending at yyyy). Changes to the code are possible by overwriting the opcodes.
F aa bb cc ..., xxxx yyyy - Find Byte
Find all occurrences of the the Byte sequence aa bb cc ... in the memory range xxxx to yyyy. It is possible to specify some nybbles of the search pattern as don't-care by using the wild card '*'.
Note: Unlike most other SMON-commands the Find commands are very picky about syntax. There must be no space between the command name and the arguments to be found (exception: the Find Byte command requires exactly one space), and a comma before the range.
FAaaaa, xxxx yyyy - Find absolute Address
Find all references to the absolute address aaaa within the memory range xxxx to yyyy. Note that there is no space between FA and aaaa.
FRaaaa, xxxx yyyy - Find Relative
Find branch statements that point to address aaaa within the memory range xxxx to yyyy. Note that there is no space between FR and aaaa.
FTxxxx yyyy - Find Table
Find all tables in the memory range form xxxx to yyyy. SMON defines a table as any information, that can not be disassembled.
FZaa, xxxx yyyy - Find Zero-Page
Find all references to the zero-page address aa within the memory range xxxx to yyyy. Note that there is no space between FZ and aa.
FIaa, xxxx yyyy - Find Immediate
Find all statements in the memory range from xxxx to yyyy, that use aa as immediate operand. Note that there is no space between FI and aa.
G (xxxx) - Go
Execute the machine program at xxxx or the current PC. If the code ends with RTS, SMON is terminated. To jump back to SMON after the code is executed, the program must end with BRK.
I xx - I/O Device
Select the I/O Device for Load and Save. Common Values for xx are 01 for Tape and 08 to 0B for Floppy.
K xxxx (yyyy) - Kontrolle
Display the memory contents from xxxx to yyyy as ASCII-characters. Changes are possible by overwriting the characters.
L "filename" (xxxx) - Load
Load a file from the standard I/O device (see command I) at the standard address or xxxx.
M xxxx (yyyy) - Memory Dump
Display the memory contents from xxxx to yyyy as hex-values and ASCII-characters. Changes are possible by overwriting the hex-values.
O xxxx yyyy zz - Occupy
Fill the memory range xxxx to yyyy with the value zz.
P xx - Printer
Select the device number for the printer. Valid values for xx are 04 and 05. To send the output of a command to the printer, the mnemonic for that command must be written in upper case.
R - Register
Display the contents of the CPU registers. Changes are possible by overwriting the values.
S ("filename" xxxx yyyy) - Save
Save the memory contents from xxxx to yyyy to a file. If the file has been loaded using the command L then the parameters for save are optional.
TW (xxxx) - Trace Walk
Execute the code at xxxx (or current PC) in single step mode. After every executed command, the contents of the registers is displayed and the system is halted until a key is pressed. Subroutines can be executed in real time by pressing 'J'.
TB xxxx yy - Trace Break
A break-point is set at address xxxx. When the code is later executed with Trace Quick (see below) the execution will be switched to single step mode when the break-point is reached for the (yy+1)st time.
TQ (xxxx) - Trace Quick
Execute the code at xxxx (or current PC) in real time. When a break-point is encountered the execution is switched to single-step mode. (See TW - Trace Walk)
TS xxxx (yyyy) - Trace Stop
Executes the code at xxxx in real time. Execution stops, when the program reaches yyyy (Works only in RAM!).
V xxxx yyyy zzzz aaaa bbbb - Move Addresses
All absolute addresses in the code between aaaa and bbbb that pointed into the range xxxx to yyyy are adjusted to point into the range starting at zzzz.
W xxxx yyyy zzzz - Write
Copy the memory contents between xxxx and yyyy to zzzz. No address or other transformations are performed. Works correctly even if source and destination range overlap.
= xxxx yyyy - Check Equality
The memory ranges starting at xxxx and yyyy are compared for equality. The address of the first different Byte is displayed.
X - Exit SMON
# num - Convert Decimal
The decimal number num is converted to hexadecimal notation. If num is a 8 bit number, than the binary form is also displayed.
$ xxxx - Convert Hexadecimal
The hexadecimal number xxxx is converted to decimal notation. If xxxx is a 8 bit number, than the binary form is also displayed.
% xxxxxxxx - Convert Binary
The (8 Bit!) binary number xxxxxxxx is converted to decimal and hexadecimal notation.
? xxxx + yyyy - Hexadecimal Addition or Subtraction
Two 16 Bit hexadecimal numbers are added or subtracted.
Z - Start Disk Monitor (Equivalent Command: H)
SMON features a built in disk monitor for floppy disk #8. To avoid confusion in terms of command names, the disk monitor must be explicitly started and terminated. While SMON is in disk monitor mode, only the following commands are available.
Note: It is not possible to examine a device other than a floppy disk (i.e. e.g. not a folder of a Mac hard disk or a tape) mounted on drive #8.
R (tt ss) - Read Sector
Read track tt sector ss into memory. If tt and ss are missing the next logical (not physical!) sector is read.
W (tt ss) - Write Sector
Write track tt sector ss to disk. If tt and ss are missing the parameters from the last Read Sector command are used.
M - Memory Dump
Display the disk sector in memory on the screen. The Shift-keys can be used to interrupt/continue the display of data.
@ - Floppy Error Status
Displays the current Floppy Error Message. If no error occurred, than no message is printed, i.e. the message 00, OK,00,00 is suppressed.
X - Exit the Disk-Monitor / Return to SMON proper.

7.2 NEW Magician

The NEW Magician is a little program that will resurrect a BASIC program that has been killed by a Reset (or by accidentally executing the NEW command). Usage is very simple: Load the NEW Magical into RAM immediately after the Reset and start it with SYS 828.
Technical Note: When removing a BASIC program from RAM the C64 only sets a few pointers and overwrites the first 3 Bytes of the program. The rest is left untouched. Therefore it is quite easy to undo the removal if it is done at once. Unfortunately every variable that is defined at this point will overwrite the program code and destroy it, usually in a nonrecoverable fashion. Thus it is essential the the NEW Magician is used immediately after the program was lost.

The origin of the NEW Magician is unknown to me. It is at least 20 years old and I no longer remember whether I wrote it myself (likely), typed it in from some magazine or got it from a friend. There were so many tools for that purpose around....

7.3 Joystick Demo

Joystick Demo is a little tool, that shows the state of the two C64 joystick. It can be used to verify the the USB-joysticks are indeed queried by Power64, and their states made available to the emulated C64.

Some games will only work with a joystick in port 1, others require a joystick in port 2 and still others will work with a joystick in any port. If the joystick activity is visible in Joystick Demo, but your favorite game does not recognize your movements, try switching the joystick ports (Cmd-J). Since some games will fail if there is activity at the joystick port they do not use, it is generally not recommended to set up both joysticks to be both active and use the same inputs.
For more information on joystick configuration see chapter 5.5 Joysticks.

Joystick Demo was written in 2006 by Roland Lieger. It is Public-Domain Software that may be distributed freely without charge.

7.4 Block Out

Block Out is a fun game based on the arcade classic Break Out. The main goal of Block Out is to break down six rows blocks by hitting the blocks with a ball. The field is bounded on the sides and on the top by walls that will reflect the ball back. The bottom of the screen has no wall and it is the players task to move his small paddle to the right place at the right time to keep the ball in play. Points are scored for each broken block (1-3 points per block, depending on the color) and for completely clearing the level. The paddle is controlled with joystick #2.

Block Out was written in 1985 by Roland Lieger. It is now Public-Domain Software that may be distributed freely without charge. Block Out was also published as a type-in listing in the German magazine "64'er" issue 11/85 (p.84).

7.5 Serpentine

Serpentine is an action game, where snakes slither through a maze, trying to eat one another, and not be eaten.
At the beginning of the game our hero, the blue snake is a rather small, while the foe is large and red. Thus he can not attack the enemy head on, but the tail of a snake is defenseless. Slithering up from behind our hero can take a good bite at the other snakes, reducing their length with each mouthful. Once a foe is smaller than our hero, he will turn green with fear, for now a head on encounter with or hero will be deadly for the enemy. Success is such a bold confrontation will boost our heroes morale and cause extra growth. A foe can also be killed by biting away the entire tail, but such cowardly attack from behind does not boost morale.

From time to time a mouse will get lost in the maze. Snakes like mice very much (although the friendship may be somewhat single sided and short lived) and will grow when they eat one.

When a snake has grown to full size, and it is still well fed, than it is time to think of the next generation and lay an egg. Eggs will hatch at the end of each level, resulting in an extra foe or a bonus live respectively. Egg make excellent food for both mice and snakes, but there is of course no cannibalism.

Points are scored for each segment chewed off an enemy, each foe killed (extra for head on confrontations) as well as for each mouse or egg eaten. The serpent can be guided using either joystick #1 or #2.

Note the nice music that plays in the background.

The central idea of 'Serpentine' originates from the Brøderbund game of the same name. The original game did not feature any music, nor did it have the nice level editor.

Serpentine was written in 1985 by Roland Lieger. It is now Public-Domain Software that may be distributed freely without charge.

7.6 Quadromania

Quadromania is a brain-twister. It consists of a rectangular field of black and white stones, and a small rectangular stamp that can be used to invert the color of the stones (white stones will become black and black stones will become white). Originally all stones are white. Then the computer will randomly stamp to cause complete chaos. Your job is to undo the changes and restore the pristine white field, using as few moves as possible.

The game is controlled by the menu on the right side of the screen. An item is selected by moving the cursor over it and pressing fire. To play you will first select 'Autom. Erstellen' (automatically create). When enough inversions have take place, press fire again to stop the process and double click on 'Start' to begin the game. The pointer will automatically change to a stamp when it is moved onto the play field.
The stamp/pointer can be controlled with either joystick #1 or #2.

Note that you can also adjust the size of the play field and the stamp size. Furthermore it is possible have more than two colors. The stamp will then go through the color in a cyclic fashion (e.g white-red-blue-white-red-blue-...). For those that have only a black and white monitor there is also the option to play with numbers ('Ziffern') rather than colors ('Farben').
Quadromania will also display the time you needed to play, the number of moves that would have made the best solution, the number of moves that are still required from the current position and the number of moves made so far.
There is also the option to get a hint for a good move ('Zugvorschlag') or to take back a move ('Zuruecknehmen'). Note that taking back a move is also considered to be a move. (No cheating here!)

This is also a interesting puzzle to think about without the use of a computer. There is a rather simple algorithm that will solve any puzzle with the minimal number of moves. Try to find it!

The central idea for Quadromania comes from Christian Zwicker and was first published in "Happy Computer" issue 7/87 p.65.

Quadromania was written in 1987 by Roland Lieger. It is now Public-Domain Software that may be distributed freely without charge. Quadromania was also published as a type-in listing in the German magazine "Happy Computer" issue 2/88 (p.15 and p.113). "Happy Computer" is unfortunately no longer in print.

7.7 Adding Custom Programs

While the above programs are great tools and fun games, every C64 freak has his own set of essential software, that is nice to have at hand at all times. It is therefore possible to extend the program menu of Power64 with additional software. Please note that this feature is designed for 'essential' tools only . It is not suitable for managing a large collection of games.

To extend the collection of tools in the Power64 program menu requires just a few steps:

1) Create a folder called "Power64 Software" inside the Power64 folder
2) Place the desired tools in *.PRG/*.CBM or *.P00 format in the newly created "Power64 Software" folder. If the tools are currently stored on a disk or tape image the easiest way to transfer them to *.PRG or *.P00 format is to mount the source disk on drive #8 and mount the "Power64 Software" folder as drive #9. Now just copy the files using drag & drop.
Note that you can only add single-file tools to the program menu. If the program needs to load additional data (e.g. game levels) from a seperate file after starting, you must load it from a disk or tape drive.
Please also note that you can not use (ZIP/GZ/LHA) compressed files. You must use plain *.PRG or *.P00 files.
3) Using your favourite text editor (e.g. SimpleText, BBEdit, Alpha) create a plain text file (not a *.RTF, *.DOC or other wordprocessor file) called "Index.txt" inside the "Power64 Software" folder.
Each line in this file should contain four entries seperated by commas, describing the tools:
.) The first entry states the name of the C64-tool to be used in the program menu.
.) The second entry contains the MacOS-Filename of the *.PRG/*.P00 file
.) The third entry gives the command necessary to start the program (e.g. RUN or
SYS 12345) (max. 10 characters)
.) The fourth entry configures the joysticks for a game. Permitted values are:
"?" - Do not change joystick configuration
"-" - Turn both joystick ports off
"1" - Enable joystick port 1
"2" - Enable joystick port 2
"1+2" - Enable both joystick ports
"1/2" - Make sure that at least one joystick port is enabled.
4) The next time you start Power64, the program menu will be expanded.

If one of the entries is to contain a comma character, you must enclose that entry with
double quotes. Otherwise quotes are optional, but recommended.
It is possible to create submenus within the program menu. To do so give use a menu entry in the form of "submenu:menuitem". Even Subsubmenus are possible in the form "submenu:subsubmenu:menuitem". Deeper nesting levels are prohibited! If the menuitem consists of a single minus-sign (-), a seperator line is inserted in the (sub-) menu.
Lines beginning with a '#' are comments and are ignored just like empty lines.
If there is no "Index.txt" file in the "Power64 Software" folder, Power64 will simply add all files found in that folder to the progam menu (in alphabetical order).
4) At the next start of Power64 the program menu will be extended.

Example of a "Index.txt" file:

# Sample Software Collection for use with Power64

"C64 Wedge",           "C64Wedge.P00",     "RUN:",       "?"
"Tools:Simon's Basic", "SimonsBASIC.PRG",  "RUN:",       "?"
"Tools:Profi-Ass",     "ProfiAss.PRG",     "SYS 36864:", "?"
"Games:Arkanoid",      "Arkanoid.P00",     "RUN:",       "2"
"Games:Arkanoid 2",    "Arkanoid2.P00",    "RUN:",       "2"
"Games:Archon",        "Archon.P00",       "RUN:",      "1+2"
"Games:Pitstop II",    "PitstopII.PRG",    "RUN:",      "1+2"

Please remember that it is not permitted to distribute Power64 with pirated software.
If you are giving away copies of Power64, please do so without your customized "Power64 Software" folder. Even if the recipient has a valid license to that software (e.g. because you wrote it yourself, or it is public domain) this is required to keep a clear seperation of C64 software that is officially part of Power64 (and therefore supported) and (unsupported) personal additions.

Home First Prev Contents Next Last Top of Page

Source: http://www.infinite-loop.at/Power64/Documentation/Power64-ReadMe/07-BuiltIn_Programs.html
Power64 Homepage: http://www.infinite-loop.at and http://www.salto.at - EMail:
© Roland Lieger, Goethegasse 39, A-2340 Mödling, Austria - Europe
Last Changed: Feb. 29, 2008
Valid HTML 4.01!