First Prev Contents Next Last
First - Prev - Contents - Next - Last

5. Devices

5.1 MOS 6502 Processor and Emulator Speed

The speed of the Emulator can be controlled using the menu item Options/Emulator Speed.

Reference Clock - PAL vs. NTSC:
PAL and NTSC are two major standards for television signals. While PAL used in most west European countries (except France), NTSC is the common standard in North America. A PAL signal consists of 625 scanlines (including scanlines for vertical blank, leaving a usable resolution of 768x576 pixels) that are displayed at a nominal refresh rate of 50Hz. NTSC on the other hand uses only 525 that are redisplayed at 60Hz. Note that both systems use interleaving, i.e. during each screen refresh, only every other scanline gets redrawn, thus the entire image is only redrawn at 25Hz(PAL) or 30Hz(NTSC).
When a Commodore VIC-20 is connected to the TV the standards are interpreted in a slightly different manner. The central image of a VIC-20 screen has (usually, this can be changed by software) a resolution of 176x184 pixels . Each pixel is about twice as wide as it is high making the ratio about 352x184 square dots. Around this area there is a frame, that covers the rest of the TV-screen. To make a full TV signal all pixels are displayed at half the regular TV pixel rate, with the effect, that they are scaled in horizontal direction. Furthermore both half images are then same, resulting in stretched image in vertical direction. Depending on the video mode the internal clock of the VIC-20 is driven at either 1.108MHz (=624*71*50/2 PAL) or 1.018MHz (=522*65*60/2 NTSC). Some VIC-20 programs will work fine in both modes, others will produce queer results if run in the wrong mode (usually the image is shifted into a corner of the screen). If the program works in either mode, than PAL is advantageous, as it produces less strain on the Mac CPU.

System Clock:
Depending on the choice of video mode the reference clock of the emulated VIC-20 is driven at either 1.108MHz (PAL) or 1.018MHz (NTSC). This frequency is used to drive the CPU and VIAs (Timers) (but not the VIC). You can increase the System Clock rate to obtain a faster VIC-20 while maintaining the speed ratio between CPU and VIA. Note that compatibility will still suffer if you select a value different from 100%.

CPU Clock:
In addition to adjustments to the System Clock it is also possible to accelerate the CPU alone. If you have a CPU intensive program, that you want executed as fast as possible, than this is the parameter to adjust. Note so, that compatibility for games will suffer if you select a value different from 100%.

Screen Redraw Rate:
Redrawing the screen puts a lot of stress on the Macintosh CPU, especially if there is a lot of action on the screen, generally more than emulating the remaining VIC-20.
Frames per Screen Redraw selects how often the screen gets redrawn. A setting of 1:1 means that the screen is recomputed/redraw 50(PAL) or 60(NTSC) times a second. 1:n indicates that the screen is redrawn only on every n-th frame. Choosing Auto causes Power20 to select the speed that best fits the VIC-20 game and Macintosh used. Thus Auto is the recommended setting for Screen Redraw Rate. To display the actual number of frames per second enable the menu item Options/Display CPU Load (see below).

Inactive Windows:
When an emulator window is not the active (focused) window, the emulator is usually suspended until its window becomes active again. Stopping the emulation gives other applications the full power of the Mac CPU. On the other hand it is possible to keep the emulation running either with or without sound. This way you can use sound-demos to make your work more pleasurable. Be aware so, that this consumes significant CPU power, so your other applications are slowed down.

Speed Display:
The current performance of the emulator can be displayed in the top right corner of the emulator window. Power20 can display the the speed of the virtual M6502 CPU of the emulated VIC-20 (in MHz) This should be 1.10 of PAL-mode (preferred) and 1.02 in NTSC mode. Furthermore Power20 will display how much load is puts on the Mac CPU (in %). For smooth sound and video emulation the Mac-CPU should not be loaded more than 90%. If the second line Power20 displays the number of frames that are displayed per second as well as the number of frames that a real VIC-20 would display.
Use the Speed Display option to indicate which data Power20 should display. If is also possible to turn the display off altogether with Options/Display CPU-Load (Cmd-I). Use Opt-Cmd-I to apply this change to all windows.

After adjusting the preferences use Set Global to make the set of options valid for all emulator windows currently open as well as newly opened. Clicking Ok will only change the options for the current window.

Turbo Boost (Cmd-B):
To speed up the VIC-20 during long LOADs with Full Floppy Emulation, or to make a chess program think faster without decreased compatibility, use the Turbo Boost mode. Turbo boost mode deactivates the speed control logic of Power20, and makes the VIC-20 go as fast as the Mac CPU will take it. To gain even more speed Turbo Boost mode furthermore deactivates the sound (which otherwise would be Mickey-Mouse style) and sets the number of Screen Redraws to 1:12. The System Clock and CPU Clock settings are NOT modified, even so additional speed could have been obtained there. Only the Macintosh side of Emulation is affected, while the VIC-20 side remains unchanged. Therefore activating Turbo Boost mode, does NOT decrease compatibility.

5.2 Video Options

Many aspects of how the VIC-20 image is displayed on the Macintosh screen can be controlled by the user via Options/Video Setup.

Video Draw Mode:
Power20 maintains the screen in two steps. In a first step it creates an image of the VIC-20 screen in an internal buffer. This image is compared to the one last computed and only if a change is detected then the changed parts are copied to the Macintosh screen. This second step can be done using several methods. One way is to use the original Macintosh Quickdraw routines, that are provide optimal compatibility but are very slow and should be used only if absolutly necessary. Using Power20's custom drawing code offers better performance and is compatible with almost all video hardware. If your Mac is equipped with OpenGL compatible hardware you can also use that to draw to the VIC-20 image. Using OpenGL makes it possible to scale the image to any desired size (even non-integer multiples of the original size).

Skip Every Other Scanline:
If Skip Every Other Scanline is enabled in Double Screen Size mode Power20 will render each VIC-20 pixel by only 4x1 (rather than 4x2) Macintosh pixels and fills the gap with a black line, effectively drawing only every other scanline. This does reduce the jagged look of the zoomed image, but unfortunately also causes a rather dimmed look. Note that skipping every other scanline does NOT significantly increase emulation speed. If you need to free CPU time, switch to single size video!

Black Frame for Zoomed Window:
When a window size other than 1:1 is selected Power20 can automatically center the emulated VIC-20 on the Macintosh screen and draw a black frame around it to cover any other windows that are on the screen. This is not Macintosh like, but gives more VIC-20 feeling. To hide the menu bar too, see the next point.

Hide Menubar for Black Frame:
To gain optimal VIC-20-like feeling it is possible to switch off the menu bar when the emulator is in full screen mode. Thus the screen looks like you would find it on a real VIC-20, nothing reminds of a Macintosh. If this option is selected, the menubar will be hidden after the VIC-20 ran for two seconds in full screen mode. Moving the mouse or pressing the option key brings the menubar back on the screen.

Use Color on Color Screens:
Power20 can display the VIC-20 screen in original colors or as a black and white image. Select Use Color on Color Screens to see original colors on color Macintosh screens. Enabling this option is definitely recommended.

Maintain Aspect Ratio:
OpenGL makes it possible to change the emulation windows width and height freely. It is e.g. possible to make the window very wide but not tall, producing a strange squished look. Usually it is desireable to limit the freedom of window scaling and enforce that the window's width and height are always scaled with by same factor.

Zoom Out (Cmd -):
Reduce the zoom factor of the current VIC-20 window by one.
Use the Option key to make the new size apply to all open windows.

Zoom In (Cmd-+):
Increase the zoom factor of the current VIC-20 window by one.
Use the Option key to make the new size apply to all open windows.

Black Window:
Power20 is a well-behaved Macintosh application, that runs in regular windows. Outside the Power20 windows the Finder and other applications' windows are visible. To create a more VIC-20-like feeling Power20 has the ability to draw a big black window over the entire screen, that hides all other applications. If you also want to hide the menu bar check "Hide Menubar for Black Frame" above.

5.3 Sound Options

Sound Sample Rate and Sample Size control the sound quality for immediate playback. Higher sample rates produce better sounds, but also create more Mac CPU load. For optimal results the sample rate selected for Power20 should match the sample rate selected in the Sound Control Panel (up to MacOS X 10.2) or be set to 44100Hz (MacOS X 10.3 and later, where the sample rate is no longer configurable in the control panel). Any extra samples created by Power20 will be discarded by the Sound Manager, missing sample will be interpolated (at additional CPU cost).
In addition to this you should make sure that the sample rate for MIDI playback is configured to at most 48000Hz. Use the program Audio MIDI Setup (in /Applications/Utilities) and set the Audio Output setting to 44100Hz. This value is sometimes changes by external audio interface (like the Griffin iMic or other USB audio interfaces) or their drivers (that remain in the system even after the hardware has been unplugged!) You should check that the setting is correct both with the hardware plugged in and unplugged. If the MIDI sample rates are too high Power20 might run much too fast and/or might remain mute. This is not a Power20 specific problem. Other applications (like Quicktime) suffer from the same problem. For more details see: http://docs.info.apple.com/article.html?artnum=300832.
Power20 will always create Samples in 16 bit. The 8 bit option simply discards the least significant 8 bit. This does NOT save time or space, and is intended only for estimating the achievable quality of a 8 bit recording.

Sound Volume:
Selects the active Sound Volume in the range from 0% to 120% of the maximum.
Note that values above 100% can cause sounds to be clipped under certain conditions (all 4 voices reach peak amplitude at the same time). Fortunately these conditions are extremely rare during normal music playback, and it is quite safe to set the volume slightly above 100%.
Note that while a Volume setting of 0% does not produce an audible sound, the SID is still fully emulated and recordings are still possible. To turn of SID emulation completely (and reduce Mac CPU load) select Mute (Cmd-M) (see below).

Sound Recording:
Power20 also offers the possibility to record the sound played by VIC-20 games to a AIFF sound file that can be played e.g. with the Simple Player for Quicktime.

Recording Sample Rate and Sample Size control the sound quality of the recording. A high sampling rate and large sample size give good quality, but unfortunately also large sound files. Technical Note: Power20 creates its sound at the chosen Sound Sample Rate (see above), 16 bit, Mono and produces the other sample rates/sizes by discarding or duplicating part of that information. It is not advisable to select a high Recording Sample Rate than Sound Sample Rate, because the extra samples are added by duplication of the computed samples. Thus the 'useful' sample rate of the recording is just that of the Sound Sample Rate, while the disk space occupied will correspond to the higher Recording Sample Rate, combining the disadvantages of both high and low sample rates.

Pause Recording during Silence:
Power20 can automatically stop sound recording when there is not tune to record. Enabling this feature causes Power20 to delay any recording until the music starts and eliminate silence after the end of the music. Furthermore any intermission that lasts longer than 1/2 second is truncated to 1/2 second. This is a very useful feature as you can start the recording before running the game without causing useless stretches of silence in the AIFF file. Unfortunately some games produce sound with lots of intermissions, that sound queer if these intermissions are truncated. For such games it is useful to turn off the Pause Recording feature.

Sound File Folder:
The recorded VIC-20 sounds are stored in a file called 'VIC-20 Sound - dd.mm.yyyy (x)' in the Sound File folder. Click on Select Sound File Folder to choose the folder in which these files are to be stored. Please be aware that a sound file can easily become quite large and make sure that there is enough space on the selected volume. A 22050 Hz 16 bit recording requires 43 KByte/sec or 2.5MByte/min. Also note that recording take place in real time; This requires a sufficiently quick storage device such as a hard disk or ZIP drive. The 3.5" floppy disk drive is NOT fast enough and writing sound files to it will cause incomplete recordings!

Options/Mute (Opt-Cmd-M):
Disable the SID emulation. As the SID emulator requires a significant amount of processing time, turning off the sound will give a performance boost to games that would otherwise be to slow to run at full speed. Even with SID emulation off SID[$1B] can still used as a random number generator.

Options/Volume Up (Cmd->) and Options/Volume Down (Cmd-<):
Increase and decrease the sound playback volume. Decreasing the volume when it is already at its minimum, will disable sound emulation. Increasing the volume again will turn it back on.

Pressing the Option key while selecting a new mode for the SID emulation will cause all open Power20 windows to adopt this mode.

Record Sound as AIFF (Cmd-*):
To start or stop sound recording press Cmd-*. There is also the possibility to select Options/Record Sound as AIFF but it is much harder to select this item at a precise moment. The sounds will be recorded at the sample rate and size chosen in the Sound Options dialog to a file called 'VIC-20 Sound - dd.mm.yyyy (x)' (where dd.mm.yyyy is the current date and x is a counter) in the Sound File folder (see above).

5.4 Keyboard

Power20 supports two keyboard modes - Macintosh Keyboard mode and VIC-20 Keyboard mapping. It is possible to select a Keyboard Mode using the menu items Options/Mac Keyboard and Options/VIC-20 Keyboard. Usually this effects only the active emulator window. If the Option Key is pressed when selecting a new Keyboard mode, than this mode is activated in all emulators.

In Macintosh Keyboard mode the translation between pressed Macintosh keys and logical VIC-20 keys is based on the character that is usually associated with a particular key. i.e. Pressing the key (or key combination) that will create a '*' in any Mac word processor will also create a '*' in Power20. This is very handy if you have not used your VIC-20 very much recently and are no longer familiar with its keyboard layout. On the other hand, some keys that require just a single keystroke on a VIC-20 might require the use of Shift/Option+Key on the Macintosh or might not be reachable at all. This might cause problems with programs that require these keys.

As an alternative there exists the VIC-20 Keyboard mode. In this mode the Macintosh Keyboard behaves just like a VIC-20 Keyboard i.e. Key mapping is based on the relative (physical) position of the keys on the keyboard. The character that is associated with a key in other Macintosh applications (and that is usually printed on the keycap) is irrelevant in this mode. This offers the advantage that all VIC-20 keys are accessible for the emulator, but it might cause some typos for experienced users on the Macintosh Keyboard.

Macintosh Keyboard mode makes it easy to type (plain) text, as you don't have to think twice (or correct typo's afterwards) whether you are in a Macintosh window or an Power20 window - the keyboard is always the same.

Commodore VIC-20 Keyboard mode is better when you need fine grain emulation. It will enable you to access all the graphic characters available on the Commodore VIC-20. Furthermore those games that use the keyboard to control their hero usually select the action keys in a way that provides convenient access on a Commodore VIC-20 keyboard. On a local keyboard the keys might be shuffled around and impossible to reach.

Note: If you have a US-keyboard on your Macintosh there is very little difference between the two keyboard modes. You will probably want to use Commodore VIC-20 keyboard mode, as it offers higher compatibility.

The VIC-20 keyboard features some special keys that have been mapped to the Macintosh keyboard by Power20:

Run/Stop Escape
Restore Cmd-R (includes Run/Stop)
(or Menu: File/Restore)
Reset Cmd-K (Press Option-Cmd-K for Hard Reset)
(or Menu: File/Reset)
Commodore Option
Control Control
Shift (left Shift (left&right)
Shift (right) End or F12
Shift Lock Caps Lock
Insert/Delete Insert/Help
Backspace Backspace or Delete
Clear/Home Home or F9
F1 F1 or Cmd-1
F2 (=Shift-F1) F2 or Cmd-2 or Shift-F1
F3-F8 like F1/F2
Cursor Right Cursor Right
Shift Cursor Right Cursor Left or Shift Cursor Right
Cursor Down Cursor Down
Shift Cursor Down Cursor Up or Shift Cursor Down
Left Arrow Underscore('_')
Up Arrow Circumflex('^') or F10 or Page-Up
Pound Sign ('£') Page-Down or F11 or '£'
Pi Symbol ('π') Shift-Page-Up or 'π' (Mac keyboard: Opt-p)

The numeric keypad on a Macintosh keyboard can be used in just like the regular numeric keys in the top row of the keyboard in Power20.

Choose File/Key Caps to see the current mapping (taking into account the state of the modifier keys) of VIC-20 keys to your Macintosh keyboard.

Below are some pictures of the VIC-20 keyboard layout, to help locate all the many graphics characters.
Without any modifier keys the VIC-20 keyboard is very similar to the standard US Macintosh keyboard.

VIC-20 Keyboard Layout

Abbreviations: C/H…Clear/Home - I/D…Insert/Delete
RST…Restore - R/S…Run/Stop - LCK…Shift Lock

When SHIFT is pressed (or SHIFT LOCK is active) the following characters can be accessed:

VIC-20 Keyboard Layout with Pressed Shift Key

Finally the following characters can be accessed by using the Commodore (Macintosh: Option) modifier key:

VIC-20 Keyboard Layout with Pressed Commodore Key

Text colors are available by pressing CTRL-1..CTRL-8. Use CTRL-9 and CTRL-0 to turn reverse printing on and off.

5.5 Joystick

Power20 directly supports USB joysticks, and can also use the Macintosh keyboard to simulate joysticks with optional auto-fire for the game port of the VIC-20.

To customize the joystick simulation select the menu item Options/Joystick. Here you can define the keys that are to be used for every direction of joystick movement and the fire button. You can define either 4 or 8 directional keys for the joystick.
If you define just 4 keys, than diagonal movements require two keys to be pressed at once. If you want to fire diagonally (making it a total of 3 keys), this can cause problems, as the Mac keyboard has difficulty decoding certain combinations of 3 or more keys.

Power20 will map the axis and buttons of the USB-joystick to movements of the VIC-20 joystick. Usually Power20 will find a smart mapping, but sometimes it is better to adjust the configuration by hand (using the "USB Joystick Configuration" button.
Note: Sometimes MacOS will suddenly display an extreme increase in CPU load when the joystick as been wildly moved. The CPU load will even remain high after the joystick has come to a rest again. The reason for this has not been fully investigated, but I assume that Apple's HID-Manager is to blame.

Even so the original VIC-20 joystick has just one fire-button, Power20 provides an additional auto-fire button. Internally both buttons (fire and auto-fire) drive the same (virtual) line on the VIC-20, but using two buttons it is easy to trigger both single shots and unleash bursts of bullets.

It is not possible to connect an original VIC-20 joystick to the Mac without additional hardware, since the interfaces are just to different (passive 9 pin connector on the VIC-20 joystick - active USB bus interface with its protocol on the Mac).

Fortunatly the company Speed-Link (www.speed-link.com) was for some time building the classical Competition Pro Joysticks (complete with original, high quality micro switches) with a USB interface for easy use with modern Macs (Product Code SL-6602 (classic black/red) or SL-6602-TBE (transparent blue/silver)). Unfortunatly this product has been discontinued and is no longer available from their site, however various vendors still have it in stock and/or you should be able to find used ones on ebay.

If you do not want to purchase an entire joystick or want to use your original old joysticks, interfaces that will perform the translation of protocols are available from several sources:

The VIC-20 uses the same set of I/O Pins of the VIAs to detect both keyboard activity and joystick movement. Due to this hardware design some joystick movements cause the VIC-20 to believe that keyboard activity has taken place. Therefore it is sometimes useful to deactivate a joystick.

Most keys that are accessible on the Macintosh keyboard have an equivalent on the VIC-20 keyboard. Yet it is not desirable that every movement of the virtual joystick (caused by pressing a key on the Mac keyboard) indicates a pressed key to the VIC-20. Therefore it is usually advisable to hide those keys that are used to simulate a joystick from the emulated VIC-20. On the other hand care should be taken not to eliminate any 'important' keys. Usually it is a clever to choose the joystick keys from the numeric keypad, and keep them hidden from the emulated VIC-20.
This is particularly important if you choose the Shift-, Option- or Control keys to control your joystick. Power20 supports these keys too, but unless you are using a PowerBook (and thus have no numeric keypad) their use is definitely not recommended.

You can quickly enable or disable the joystick by pressing Cmd-J. Pressing the Option-key when selecting this menu item will cause the joysticks to be en-/disabled in all active emulators.

5.6 Mouse, Paddles & Light Pen

Power20 can use the mouse to emulate a Commodore 1351 mouse. The C1351 is a two button mouse. The left button is simulated using by the Mac mouse button, the right button can be accessed by holding down Shift while clicking. If your Mac mouse has two (or more) buttons, the second button of the Mac mouse will be directly used to emulate the second button of the VIC-20 mouse (OS X only).
Unfortunately both the VIC-20 and the Macintosh mouse pointer are simultaneously visible on the screen. This can cause some confusion, but is unfortunately unavoidable, because it is (in general) impossible for Power20 to determine the location of the VIC-20 mouse, and to hide the Mac mouse pointer accordingly. This problem can be alleviated by choosing Black Frame in the Video Options. Then the stray clicks of the Mac mouse do at least not cause any unexpected actions in the MacOS.
The mouse movement is transmitted using analog values and the paddle connectors. Therefore it is impossible to use both the mouse and paddles at the same time.

Alternately Power20 can use the mouse to simulate a pair of paddles. Each paddle can be controlled by the horizontal or vertical position of the mouse on the Macintosh screen.

Power20 can also use also use the mouse to simulate a lightpen. As there are few VIC-20 applications that support a lightpen this feature is not activated by default. Use Options/ Mouse, Paddles&Light pen to enable the lightpen.

Note that it is not possible to select an area of the virtual screen for copying (Edit/Cut or Edit/Copy) while the Mac mouse is used to simulate a VIC-20 mouse, paddles or a lightpen.

5.7 Floppy Disk

Power20 can simulate up to four Commodore 1541 single sided floppy disk drives on each simulated Commodore VIC-20. You can use common *.D64 and the technically superior, but rarely used *.X64 file format as well as ZipCoded files (see Appendix E.3, E.4 and E.5 for details on the file formats). Power20 can read disk image files, even if they are compressed using ZIP, GZ or LHA. There is no need to expand the archives before reading the disk. This saves Macintosh hard disk space and makes CD-ROMs with ZIP-coded *.D64 very convenient to use. Please note that Power20 can only write non-compressed or GZ-compressed files but not ZIP/LHA archives. Therefore all disk images that were loaded from a compressed ZIP/LHA file are write protected. Use Devices/Disk Drive #x/Change Disk Image Type to create a writable, uncompressed copy. Alternately you can click on the lock icon in the directory window to make the disk writable. Power20 will ask for a new filename when the disk is unmounted.

The original C1541 is a very intelligent device, that features its own MOS 6502 CPU, 16KByte of ROM, 2KByte RAM and some I/O circuitry to control the floppy drive hardware. Most of the time the M6502 just sits idle and waits for a new command. When a command finally comes, some ROM code is executed and the M6502 sits idle again. It is rather inefficient to spend lots of Macintosh CPU time to fully simulate the M6502 on the other hand it is necessary for best compatibility.
Therefore Power20 offers two modes of Floppy emulation: A ROM level emulation that is fast, but does not support some special tricks and a CPU level emulation that is extremely compatible, but this compatibility does of course include the original 1541 speed. To switch between these two modes of emulation use Devices/Disk Drive #x/Complete Floppy 1541 Emulation.
To reduce the Macintosh CPU load, CPU level emulation is only available for the first two of the possible four drives (devices #8 and #9).

Using the ROM level disk emulation Power20 replaces the ROM routines of a 1541 with PowerPC code that display the same behavior, but can be executed much faster. The supported ROM routines include both LOAD and SAVE for programs and access to sequential, relative and random access files. Power20 also supports all the common floppy commands, such as NEW, COPY, RENAME, SCRATCH, VALIDATE, INITIALIZE, POSITION, MEMORY-READ/WRITE, BLOCK-READ/WRITE, BUFFER-POINTER, BLOCK-ALLOCATE/FREE, U1, U2, UI and UJ. Only the commands MEMORY/BLOCK-EXECUTE are not supported, as these would require a the true emulation of the M6502. Of course there is also a channel for error messages.

The original Commodore VIC-20 used a rather inefficient serial protocol to transfer data to and from the disk drive, and thus achieved a transfer rate of about 256 Byte/sec. In ROM level emulation mode Power20 does not emulate this protocol, but rather simulates the transfer at a byte level. Thus it achieves a speed of 250 KByte/sec making it possible to load a large game without having to go for a coffee break. The drawback of this approach is that all programs that implement their own fast-loader routines will fail.
Most games will work using the ROM level disk emulation. Only if a game crashes in this mode or the error message 'COMMAND NOT EMULATED' appears in that disks directory window should you switch to Complete 1541 Floppy Emulation.

Using CPU level floppy emulation Power20 completely simulates the floppy disk drive. This makes it possible to run custom programs (such as fast loaders, copy protection or any program that wishes to use the extra CPU for parallel processing) on the floppys M6502 CPU or transmit data to the VIC-20 using a custom protocol. While this gives a significant boost to compatibility, it unfortunately also faithfully emulates the extended coffee breaks necessary for loading any larger program.

Beware: If you use the same disk simultaneously on several simulated Commodore VIC_20, then each VIC-20 will use its private copy of the disk. If you write a new file with one VIC-20 it will not appear on the other VIC-20. When both VIC-20 write to the their copy of the disk, then the changes of that VIC-20 whose window was closed first will be lost when the second VIC-20 unmounts its disk. There is no concurrency control!

It is not yet possible to connect the Macintosh to a real 1541 disk drive. I would like to encourage dedicated Mac programmers and hardware freaks to try their skill on this problem.

Power20 offers powerful tools for the manipulation of files on a D64 image. Please read section 4.3 File Management for details.

5.8 Hard Disk

In addition to the regular C1541 floppy disk drive Power20 can use a folder of the Macintosh hard disk as a virtual disk drive for the VIC-20. You can use both common file formats *.P00 and *.PRG (see Appendix E.1 and E.2 for details on the file format).
Power20 can also read files *.P00 and *.C64 files that where compressed using ZIP or GZ.

The hard disk is designed to mimic a C1541 floppy disk drive. You can LOAD and SAVE programs and view the directory. Yet it is obvious that a hard disk is technically quite different from a 1541. Therefore all tricks, that rely on details of the 1541 construction, such as block level access are not possible with a simulated hard disk. Even so it would technically be feasible the author has chosen not to implement any commands to copy, rename or delete files as this can easily be done using the Macintosh Finder and protects the Mac harddisk against wild VIC-20 programs.

Power20 offers powerful tools for the manipulation of VIC-20 files. Please read section 4.3 File Management for details.

5.9 VIC-20 Programs in a ZIP Archive

Storing lots of VIC-20 programs in a Mac folder can easily lead to clutter. Lots of small files also eat a lot of space one the hard disk (especially on HFS-formatted disks and CD-ROMs). Therefore it is sometimes advisable to collect all these files in a ZIP Archive to gain a clearer perspective and save space. Power20 can read files from a ZIP archive just like from a folder of a Mac hard disk. Write access to a ZIP archive is not available in Power20.
If you plan to create your own ZIP archives please take care that your ZIP program (e.g. ZipIt) does not attempt to wrap your VIC-20 programs in MacBinary (or AppleSingle, AppleDouble, HQX etc.) or trys to 'fix' the 'linefeeds' of the binary (not text!!) VIC-20 program (thereby definitely breaking it for good). If you use ZipIt make sure that both the MB (MacBinary) and the LF (LineFeed) option are turned off.

5.10 Tape & Lynx Files in a Tape Drive

Power20 supports Tape Image Files in the common *.T64 and Lynx file format (see Appendix E.6/E.7 for details of the file formats). While the original Datasette tape drive used with the Commodore VIC-20 was extremely slow (about 50 Byte/sec), the tape emulation is the fastest way to get a file into the emulated Commodore VIC-20 (about 30 MByte/sec once the tape is mounted).
Power20 can read tape image files, even if they are compressed using ZIP, GZ or LHA. There is no need to expand the archives before reading the tape. Please note that Power20 can only write non-compressed and GZ-compressed files, but not ZIP/LHA archives. Therefore all tape images that were loaded from a ZIP/LHA compressed file are write protected. Use Devices/Tape Drive/Change Tape Image Type to create a writable copy. Alternately you can click on the lock icon to make the tape image writable. Power20 will ask for a new filename when the tape is ejected.

The tape emulation of Power20 supports both LOAD and SAVE for programs as well as readings and writing sequential data files. New files are added at the end of the tape. If a file of that name already existed, the old file is only overwritten if Duplicate Filenames on Tapes are not permitted in the Options/Device Option dialog. Otherwise two files with the same name coexist (just like on a real tape)

On an original Commodore VIC-20 you need to press Play/Record to read/write data from/to a tape. This is done automatically by Power20 as soon as a tape is mounted.

There is also no need to rewind a tape. Whenever the end of tape has been reached Power20 will automatically rewind to the beginning.

If you are no longer sure what files are stored on a tape, you can use LOAD"$",1 to load the directory of the tape. This is a special feature of Power20 that is not found on a real Commodore VIC-20. Power20 implements the directory as a special file that it dynamically creates at the end of the tape image. Thus when the emulated Commodore VIC-20 searches for the file "$" it will first find all other files stored on the tape and print their names in order to inform you of the progress of the search. Thus you will in fact see the directory twice; once as the Commodore VIC-20 reports the progress of its search, and once when you list the loaded file.

When the *.T64 file format was new, there was no documentation about its internal workings. This lead many programmers to guess what the file format might look like, and write their own converter tools. Unfortunately many of them made some errors which leads to the fact that many *.T64 files in circulation have an erroneous format. When Power20 detects such a file it will automatically fix the problem and display a dialog box informing you of the problem.

On a real Commodore VIC-20 the key combination Shift/Run could be used to simulate the key sequence "LOAD <Enter> RUN <Enter>" and load the first file on a tape. This will not always work in Power20. Power20 permits you to select a default device for LOAD and SAVE other than device 1 (the tape) (see 5.11 Disk & Tape Options for details). If the default device is set to a floppy disk (or hard disk), then typing LOAD will attempt to load from there, which in turn will report a missing filename error. To load the first file from a tape you will then need to type LOAD"",1.

As mentioned above, the tape drive was extremely slow on the real VIC-20. Therefore, some programs used their private tape access code to accelerate loading from tape. As the simulation of the tape in Power20 is based on the system-ROM functions for tape access, these programs are likely to crash on Power20.

Beware: If you use the same tape simultaneously on several simulated Commodore VIC-20, then each VIC-20 will use its private copy of the tape. If you write a new file with one VIC-20 it will not appear on the other VIC-20. When both VIC-20 write to the their copy of the tape, then the changes of that VIC-20 whose window was closed first will be lost when the second VIC-20 unmounts its tape. There is no concurrency control!

It is not yet possible to connect the Macintosh to a real tape drive (e.g. via the audio input). I would like to encourage dedicated Mac programmers to try their skill on this problem.

Power20 offers powerful tools for the manipulation of files on a D64 image. Please read section 4.3 File Management for details.

5.11 Tape & Lynx Files in a Disk Drive

Power20 also offers the possibility to use *.T64 or Lynx files in a disk drive. While this might seem queer at a first glance, some games that can be found in a Lynx file expect to be loaded from disk.

The tape disk is designed to mimic a C1541 floppy disk drive. You can LOAD and SAVE programs and view the directory. Even some of the basic 1541 Commands such as NEW, VALIDATE, SCRATCH, COPY or RENAME are available when for T64 or Lynx files are mounted on a disk drive, making it a good platform for maintenance work. Yet it is obvious that a tape disk is quite different from a 1541, and therefore all tricks, that rely on details of the 1541 construction, such as block level access are not possible with a simulated tape disk.

5.12 TAP Tape files in a Tape Drive

In addition too T64 and Lynx tape images Power20 also supports raw tape images using the T64 file format (see Appendix E.10). Using TAP files, many fine details of the tape drive can be emulated, including the various kinds of turbo-tape algorithms. Power20 can read tape image files, even if they are compressed using ZIP, GZ or LHA. There is no need to expand the archives before reading the tape.

Technically there is no fixed internal structure to a TAP image file, but Power20 uses some smart heuristics to detect those chunks of data that were written using the original VIC-20 ROM routines, and to distinguish data areas and empty places on the rest of the tape. Those areas, that Power20 can interpret can be loaded instantly like from T64 images. Data stored in a propriatary format has to be interpreted by a suitable VIC-20 program. This is in general faster than loading data stored in original VIC-20 format (about 110 byte/seconds peak, due to extensive error correction about 50 byte/second average), but will hardly exceed 200-500 bytes/second (depending on the algorithm used). Loading a game will therefore usually take several minutes. Use Power20's Turbo-Boost feature to accelerate the VIC-20 while loading (Options/Turbo-Boost - Cmd-B).

TAP images are completely write protected. This write protection can not be removed by Power20.In addition to that it is not possible to use drag & drop to copy files from a TAP image to a different drive (or vice versa).

On a real tape drive it is necessary to press the Play key before data can be read. Power20 will automatically do that as necessary. In addition to that it is possible to manually fast forward or rewind the tape using buttons in the bottom row of the directory window. Clicking on an entry in the directory will wind the tape to a position two seconds before that entry, so that the read head of the tape drive will be at the correct position for reading after the tape-motor has brought the tape to full tape-access speed (skipping some tape in the process of accelerating).

5.13 Disk & Tape Options

Default Device for Load and Save:
On an original VIC-20 the default mass storage device is the cassette tape drive (device #1). On the other hand, most games for emulators come in D64 disk format. Thus it can be advantageous, to choose a different device (e.g. the primary disk drive - device #8) as the default device. This eliminates the need to type the device number after every LOAD or SAVE statement.
Generally it is best to use the setting 1-8-9. With this setting Power20 will first check the tape drive (device #1) for an inserted tape. If it finds one, Power20 will attempt to load from/save to the tape. Otherwise it will check the primary disk drive (device #8) and the secondary disk drive (device #9) for inserted disks. Since the tape and disk drive are rarely used at the same time, Power20 will generally find the correct device automatically. The setting 8-9-1 is the same as 1-8-9 with the exception that the disk drives are checked first and the tape drive second.

Show Warning for Full Floppy 1541 Emulation:
VIC-20 Software that requires complete Floppy 1541 Emulation will generally crash without a useable error message when it is run in Power20 with fast floppy emulation. To make it easier to spot the source of such trouble, Power20 can display a warning message when a VIC-20 program attempts to use the 1541 in a way that is not supported by the fast 1541 emulation. It is then up to the user to either ignore this warning and continue loading with fast floppy emulation (hoping for the best) or the reset the VIC-20 and restart the loading process with full floppy emulation enabled.

Intelligent Floppy 1541 Emulation:
Games that require a complete Floppy 1541 emulation usually do not use the floppy CPU all the time. Rather they load some data with their built in fastloaders and than the floppy sits idle again. Power20 can attempt to determine when the floppy is idle and suspend the emulation for such times. While the algorithm, that determines when the floppy is unused is indeed quite smart, it is still possible to fool it with the correct piece of software, so it might be necessary to turn if off for certain games.
While the algorithm, that determines when the floppy is unused is indeed quite smart, it is still possible to fool it with the correct piece of software, so it might be necessary to turn if off for certain games.

Mount Tapes/Lynx on Disk Drives:
Power20 can mount T64 and Lynx files both on tape and disk drives. Logically (and for reasons of authenticity) these file types belong to the tape drive. On the other hand some Lynx (rarely T64) files will only work if they are mounted on a disk drive. Depending on this option Power20 will mount a tape image file either on the tape drive or a disk drive. This setting applies only when the file is loaded via Drag&Drop or Cmd-T. It is always possible to specify a different drive by mounting the tape image by selecting the Mount Tape command for the appropriate device.

All Files on a Tape are of Type 'PRG':
Unfortunately many T64 games that are available from the internet are damaged. Power20 attempts to fix the file as good as possible. In particular Power20 has to guess the type of all files on the tape image. Use this feature to override Power20's logic and cause all files to be 'PRG'. This is by far the most common file type and therefore a good guess. While a file must be of type 'PRG' to load it by double clicking in the directory it is still possible to load a file of a different type by manually typing the required load command.

Show a Warning for Damaged T64 files:
When Power20 mounts a damaged T64 file it can display a warning message to the user. Fortunately Power20 features a rather intelligent repair algorithm that manages to fix almost all problems, so you if you consider this alert a nuisance rather than useful information you might as well turn it off.

Permit Duplicate Filenames on Tapes:
On an original VIC-20 tape there is no central directory structure. Data is simply stored at the current tape position and it is the users job to wind the tape to a location wisely so that no two files overlap. Thus there is no problem if two files bear the same name. Power20 can simulate this behaviour and simply add each newly saved VIC-20 file to the end of T64 or Lynx file, or it can check if a file of the same name already exists, and if so delete the old file automatically.

Intelligent Datasette Emulation:
The data on a TAP image is usually (at least in part) stored in standard VIC-20 tape format, that is read and written by the original VIC-20 ROM routines, while others might be stored in a more efficient proprietary format. Power20 can read the data that was stored in standard format, and, after a LOAD command, place it in the VIC-20s RAM immediately, rather than executing the slow VIC-20 code to read the tape. This drastically improves performance without hampering compatibility and is therefore strongly recommended.

Write Enable all Disk/Tape Images:
When Power20 reads a disk/tape image, that can not be written back to the place that it was read from (e.g. from a CD-ROM, a write protected floppy or from a ZIP archive), Power20 will automatically write protect the disk/tape. This write protection can be removed by clicking on the lock icon in the drives directory window, or can be removed from the start by selecting 'Write Enable all Disk/Tape Images'. When such a modified disk/tape is removed its drive, Power20 will ask for a new filename to store it to.

Adjust Type/Creator to Power20:
Every file on the Macintosh has a Type and Creator. This information is used by the Finder to decide which application to launch when the user opens a document. If you mount a tape or disk image that has no Type/Creator information, Power20 can add it. This is useful when the you've downloaded lots of ZIP encoded files from the Internet that have no notion of Type/Creator and substitute useless information. On the other hand, it is not proper Mac style to mess with the Type/Creator codes. Therefore, Power20 can be configured to add the information, ask first, or not do it at all. Power20 distinguishes between files that have been configured for other VIC-20 emulators and files that have not been configured for any known emulator.

Use Type/Creator for File Type Classification:
To determine the type of a file Power64 always attempts to look into the file first. If it can not detect a known header (some file formats unfortunatly do not provide an identifyable header), it can base its judgement either on the file name and the extensions or on the MacOS Type/Creator information. Using Type/Creator is good practice for MacOS and therefore recommended, but some sources (e.g. DOS CD-ROMs) do not provide Type/Creator information and looking at the filename is necessary (but not good style on the MacOS, that generally permits the user 100% freedom in the choice of a filename).

Drive Status LEDs:
To keep an eye on the floppy disk (and hard disk) activity of a VIC-20 select Devices/Drive Status LEDs (Cmd-L; Use Opt-Cmd-L to display the LEDs in all VIC-20 windows). This will cause Power20 to display two symbols per enabled disk drive in the bottom left corner. The first symbols stands for the floppy LED. If it is off (gray) the floppy drive is idle. A green LED indicates a read access, a red LED a write access and a yellow LED stands of an open file without read or write activity. The second symbol indicates the floppy error status; a green check means Ok, a red cross indicates an error.

5.14 Directory Options

Automatically Open Directory when...:
When a device is connected to Power20 it can automatically open a window to display the directory of the device. By double-clicking on a program it can automatically be loaded and/or run. See the next paragraph for details.
Note: Even when these options are not selected they can be enforced by holding down the Option-Key when attaching the device.

Double-Click on Directory executes:
Power20 can automatically load and run a game when the user clicks on the program file in the directory window. Choose if you want to load or load and run the game. Pressing the Option Key while double-clicking on a filename will always produce Load"File",8 no matter what option has been selected. Note: Power20 simulates the keypresses for the necessary commands. This will produce the desired effect if the emulated VIC-20 waits for key input at the BASIC prompt. If a different program is already running when the user clicks on the filename, this program will receive and process the keyboard, possibly causing interesting effects.

Mount Harddisk on every New VIC-20:
Power20 can mount a standard hard disk on device #8 and/or #9 whenever it created a new VIC-20 emulator window. This is makes it especially convenient to load a game from a collection of CBM/P00 games. It also gives every VIC-20 application a drive to write data to. If a hard disk is mounted on a new VIC-20 Power20 can also automatically display the directory. This is independent from the Automatically Open Directory when… described above.

5.15 Printer

Power20 supports up to two virtual printers per emulated VIC-20. The data written to each VIC-20 printer is not printed on the Macintosh printer, but redirected to a Macintosh file. From there it can easily be read into any Macintosh program for postprocessing, reading and possibly printing.

Power20 supports three printer modes:
In Text Only mode Power20 translates all printed characters from the CBM character set to the Macintosh character set. If no translation exists, the corresponding character is simply dropped. In Text with Hex-Graphics mode Power20 substitutes those characters that represent graphic bitmaps by their hexadecimal number. In Binary mode, no translation takes place at all. A byte from the VIC-20 is directly stored in the file.

The printer files are called 'VIC-20 Printer - dd.mm.yyyy (x)' where dd.mm.yyyy is the current date and x is a counter. Click on Select Print-File Folder to choose the folder in which these files are to be stored.

To get better performance Power20 maintains internal buffers for the printer output. These buffers are flushed when the emulator window is closed. If you want to use the printer files without having to close the emulator window, use Devices/Reset Printer #x to flush these buffers at any time. Any new data sent to that printer will then be written to a new file.

5.16 System ROM Patches

Some features built into the system ROMs of the original Commodore VIC-20 are not useful with an emulator or may not be to some peoples liking. Using the ROM Patches dialog (via the menu item Options/ROM Patches) you can adjust the following features:

Fast Reset (Skip RAM Test):
A real Commodore VIC-20 executes thorough RAM test on power up and at every reset. This is used to find hardware RAM errors, and to determine to the amount of RAM available for BASIC. Unfortunately this test takes up to about 3 seconds. On an emulated Commodore VIC-20 there is no need to check the RAM for errors as the Macintosh has already done so at its power up, and the amount of BASIC RAM is known a-priori, thus the RAM test can be skipped without any harm, saving the 3 seconds.

Honor Cartridge-ID on Reset:
The Commodore VIC-20 ROM can be expanded by the use of ROM cartridges. This was used for games, as well as tools. The cartridge ROM is usually mapped into the memory area $A000-$AFFF (4 KByte cartridge) or $A000-$BFFF (8 KByte).
During the reset routine the Commodore VIC-20 checks for the magic string "a0CBM" at the address $A004-$A008. If the magic string is present the Commodore VIC-20 concludes that there is a cartridge present, and performs a jump to ($A000). Thus the code in the cartridge always gets the chance to start its game or run whatever initialization the tool requires. On the other hand this feature can be used to write programs that can not be terminated even by reset.
When the Honor Cartridge-ID on Reset box is check the emulator will check for the magic string just like on a real Commodore VIC-20. If the box is not checked, the magic string will never be found (even if it is present in memory). Note that some games require that the string be found, thus it is not recommended to turn this feature off. To force a Hard-Reset it is possible to override the Honor Cartridge-ID on Reset using the Option-Key. If this key is pressed while the reset routine is executed the Cartridge ID will never be honored.

Honor Cartridge-ID on NMI (Non Maskable Interrupts):
The same magic string that enables the code in a cartridge to take over during reset (see above) also permits the cartridge to control the effect of NMIs. Thus the Restore key can be used for special purposes by the cartridge.
When the Honor Cartridge-ID on NMI box is check the emulator will check for the magic string just like on a real Commodore VIC-20. If the box is not checked, the magic string will never be found (even if it is present in memory). Note that some games require that the string be found, thus it is not recommended to turn this feature off.

Enable Emulator Detection:
Based on Wolfgang Lorenz's emulator detection standard for C64 emulators, I developed a method that makes it possible for VIC-20 software to determine whether it is running on a real Commodore VIC-20 or an emulator. On a conforming emulator the value of $9FFF is either $55 or $AA and is toggled between these two values at every write access. For more details on this topic see the program 'Where Am I' listed in Appendix F. Checking the Emulator Detection box will make Power20 conform to the emulator detection standard.

Font ROM:
The VIC-20 offers a nice, slim character set that is usually also used for Power20. If you want you can also use the (significantly bolder) C64 character set either in it's original version or with two bugfixes (characters #101 and #103). Note that not only the characters, but also the graphic symbols are bolder on a C64. This can cause some games, that employ character graphics, to look queer.

Default Colors: (Text / Background / Frame)
On a real Commodore VIC-20 text is usually displayed in dark blue on a white screen surrounded by a cyan frame. Some people might disapprove of these colors, so there is a possibility to select a different set of default colors. Note that the Text and Background colors must be different to produce a readable image.

Home First Prev Contents Next Last Top of Page

Source: http://www.infinite-loop.at/Power20/Documentation/Power20-ReadMe/05-Commodore_VIC-20.html
Power20 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!