**** C64CAN FOR THE APPLE IIGS ****65816 ASSEMBLY 4 MB RAM SYSTEM
C64CAN
A Commodore 64 that runs on an Apple IIgs. Disks, cartridges and tapes, the three voices of the SID, and a launcher for your games.
Ready.
LOAD"C64CAN",8,1 The manual
10 REM What it is
Two machines shared the shop windows of the eighties, and their owners did not share much else. C64Can ends the quarrel late: it makes an Apple IIgs behave like a Commodore 64. The 6510 processor, the VIC’s sprites and raster tricks, the two CIAs with their timers and the SID are rebuilt in 65816 assembly, and the C64’s own programs run on them unchanged.
It is a program for the IIgs itself, not for the Mac or PC next to it. It starts from GS/OS or from a ProDOS disk and takes the whole machine over while it runs.
20 REM What it runs
- Disks D64 images in drive 8 and drive 9. What the C64 saves is kept in the image.
- Carts CRT files: 8K and 16K cartridges, Magic Desk and EasyFlash.
- Tapes T64 and TAP files.
- PRG Program files, put into memory and run directly.
- Sound The SID’s three voices, with their envelopes and the filter, on the Ensoniq chip.
- Sticks The keypad or a joystick in either port, two joysticks, paddles, the mouse as a 1351, autofire.
- States Three saved states for every title. Go on where you were.
- Picture Text, bitmaps, multicolour, sprites, raster splits and scrolling, on the Super Hi-Res screen.
30 REM The launcher
Under GS/OS a launcher lists your disk images, cartridges, tapes and programs. Put them in folders and the launcher shows the folders; a letter jumps to the next title that begins with it, and the Recent menu has the last five you started.
Choose a disk and its directory appears beside the list, in the C64’s own colours. Return starts the title, and it loads and runs by itself. If you want another file of the disk, choose it with Left and Right first.
A title can have a picture too: take one from inside the game, and the launcher shows it in the directory’s place the next time.

40 REM The options
One window has all settings. They hold for all titles, or for one title alone if it needs something else: its joystick in the other port, say, or no frame skipping.
| Option | Choices |
|---|---|
| Load and run | yes, no |
| Joystick | port 2, port 1, or two joysticks |
| In that port | a joystick, paddles, a 1351 mouse |
| Autofire | off, on |
| Sound | on, off; the volume; both channels or one |
| Picture | frames left out when behind, never, every 2nd, every 4th |
| Colours | standard, Colodore |
| Speed | as a C64, or no limit |
| Disk writes | kept, not kept |
| ROM files | the standard ones, or others you put beside them |

50 REM In a game
Tab stops the C64 and opens a menu. From there you put another disk into the drive for games on more than one, switch the sound or the frame skipping, save the state of the whole machine, or take the picture the launcher will show.
A saved state is the C64 exactly as it was: memory, processor, video and sound. Each title has three. In the launcher, choose “go on” and the game starts where you left it.
The function keys are Control with 1 to 8. The joystick is the numeric keypad, with Open-Apple or Option as fire, or a real one in the game port.
60 REM On the screen
Straight from the IIgs’s Super Hi-Res screen, 320 by 200 in sixteen colours a line.



70 REM What it needs
- Machine An Apple IIgs with an accelerator, 7 MHz or more. On a plain 2.8 MHz IIgs games run at a fraction of their speed.
- Memory 4 MB.
- System System 6 (GS/OS) for the launcher. From a ProDOS 8 disk it starts with a plain menu.
- ROMs The C64’s BASIC, KERNAL and character ROM. They are not part of C64Can.
- Or An emulator that runs the IIgs faster than a real one, such as EmuBuddy.
80 REM How it is made
C64Can is written in 65816 assembly with Merlin 32. The 65816 can run most 6502 code itself, so the C64’s programs are not interpreted one instruction at a time: they are translated, block by block as they run, into code the IIgs executes directly. What cannot be translated goes through an interpreter.
The picture is drawn only where it changed, and when the IIgs falls behind, frames are left out before the game is allowed to slow down. The SID’s waveforms are tables in the Ensoniq’s memory, with a second set that has been through the filter.
It is tested against Klaus Dormann’s 6502 test, which it passes, and Wolfgang Lorenz’s suite for the C64, of which 268 of 306 tests pass.
85 REM The manual
The User’s Guide has 41 pages: getting started, the launcher and its options, the keys and controllers, the menu in a game, disks, cartridges and tapes, and what to do when something goes wrong. It is a preliminary edition, as C64Can is.
LOAD"MANUAL",8 (PDF, 0.8 MB)90 REM How to get it
0 "C64CAN " 26 2A
0 "NOT OUT YET" PRG
0 "IN DEVELOPMENT" PRG
664 BLOCKS FREE.
C64Can is still being written. The disk image will be on this page when it is ready, and it will be free. The C64’s ROMs will not be on it: you bring your own.
99 REM More for the Apple IIgs
By Walter Tengler. All of it on one page.