← portwally.com

**** 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
The C64Can launcher on the Apple IIgs desktop: a list of disk images on the left, the chosen disk's directory in the C64's blue on the right, and the options below
The launcher under GS/OS. Left: your games. Right: the chosen disk’s directory, as a C64 shows it.

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

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.

The launcher's list showing five folders: disks A to G, disks H to W, cartridges, tapes and programs
Folders keep a large collection in order.

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.

OptionChoices
Load and runyes, no
Joystickport 2, port 1, or two joysticks
In that porta joystick, paddles, a 1351 mouse
Autofireoff, on
Soundon, off; the volume; both channels or one
Pictureframes left out when behind, never, every 2nd, every 4th
Coloursstandard, Colodore
Speedas a C64, or no limit
Disk writeskept, not kept
ROM filesthe standard ones, or others you put beside them
The options window with thirteen rows, from Load and run to Settings for all titles
The options window. A click or Return changes a row.

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.

The C64's start screen with its BASIC prompt, shown by the Apple IIgs
Where every C64 begins.
A loading picture of the game Devolution: a creature with a deer's skull beside a loading bar
Devolution, a homebrew game, loading from its disk.
The title screen of the game Veggies vs Undead: sunflowers on a lawn and a menu of Day, Night and Nightmare
Veggies vs Undead, another homebrew game.

70 REM What it needs

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.