home *** CD-ROM | disk | FTP | other *** search
- u
- A B O U T E M U L A T O R S I I
- by Professor Dredd
- aka Ken Kill, Jr
-
-
- IMAGE FILES
-
- You probably know that C-64 tapes,
- disks and cartridges don't work on a
- PC. To get C-64 data onto a PC hard
- drive, you need method of encoding the
- data. The emulator must be able to
- recognize and decode the data as a
- C-64 program. That's what images are
- all about.
-
- For the most part, an image is a
- byte-for-byte duplication of actual
- data taken from a piece of C-64 media.
- This media may be a C-64 tape, disk or
- cartridge or even a ROM chip from
- inside the computer. Some image files
- contain additional header data telling
- the emulator what's in the image and
- how its organized. The technical
- details of the various image formats
- and their respective header data can
- be found in the document "FORMATS.ZIP"
- by Peter Schepers. Obtain this file
- at:
-
- http://www.fairlight.to/
-
- The creation of image files and
- the process of transferring them
- between the C-64 and PC are topics
- worthy of their own articles. See your
- emulator docs as well as the above web
- site for some helpful info and tools.
- Also check out the newsgroup:
-
- comp . emulators . cbm
- http://groups.google.com
-
- Some image files are included with
- CCS64. These include:
-
- Kernal.rom - Binary image of the
- Commodore 64 KERNAL ROM taken from
- $E000-FFFF
-
- Basic.rom - Binary image of the
- Commodore BASIC 2.0 interpreter ROM
- taken from $A000-BFFF
-
- Char.rom - Binary image of the C-64
- character fonts taken from
- $D000-DFFF
-
- C1541.rom - Binary image of CBM DOS
- V2.6 1541 taken from $C000-FFFF of
- the 1541
-
- CCSMon.crt - This is a cartridge
- image. It contains a machine
- language monitor you can use with
- the emulated C-64. It behaves very
- similar to a HesMon cartridge
- plugged into a real C-64.
-
-
- ROM IMAGES
-
- You never have to worry about the
- KERNAL, BASIC and Character ROM's. As
- long as they're present in the CCS64
- folder, the emulator will function
- correctly. It is possible to replace
- these images with alternate ROM's, or
- even customize them yourself. You can
- download some alternate ROM sets from:
-
- ftp://arnold.c64.org/pub/ut ils/roms/
-
- You could write a new operating
- system for the C-64. If you assemble
- the OS and copy the binary (object or
- executable) code to a PC formatted
- disk and name it with a .ROM
- extension, you can use CCS64 to test
- it. If you want to run the new OS on a
- real C-64, burn it into EPROM and plug
- it in!
-
- Such a custom OS need not include
- a BASIC interpreter. You could create
- any sort of environment you like to
- compute in such as LINUX or CP/M! Of
- course, this would be an ambitious
- project indeed, and would require an
- extensive knowledge of the C-64
- hardware. I.E. you'll have to write
- all your own drivers for keyboard,
- video and disk/tape I/O. Then again,
- you can borrow as much of the original
- KERNAL as you like and make any
- necessary modifications as you go.
-
- Some simple customizations which
- don't require writing an entirely new
- OS might include:
-
- - new startup colors.
- - new character font sets
- - custom startup text (e.g. "WELCOME
- PROFESSOR, SHALL WE PLAY A GAME?")
- - enhanced BASIC functions for GET#,
- INPUT or other commands
- - added BASIC commands like MODulus,
- GRAPHIC, PLOT (ever wish "Simon's
- BASIC" didn't tie-up the cartridge
- port?)
- - fast I/O routines for disk/tape
- (most alternate ROM's include
- these)
- - built-in DOS wedge or BASIC
- 7.0-style DOS commands
- - C-128-style autobooting from drive
- #8
- - anything you can imagine!
-
-
- CARTRIDGE IMAGES
-
- CCS64 includes CCSMon.crt as a
- convenience for ML programmers. It can
- be handy for tweaking programs that
- don't fully function on the emulator,
- or for breaking into a game to add
- cheats (e.g. infinite lives,
- invincibility.) You can get other cart
- images from:
-
- ftp://arnold.c64.org/pub/games/
- Cartridges/
-
- Using a cartridge image with CCS64 is
- the equivalent of physically plugging
- a real cart into a real C-64, and you
- should think of it that way.
- Cartridges are supported by the
- current release CCS64 2.0b, but not
- on older versions. Check the manual
- accompanying your version for
- details.
-
- From the C-64 screen, hit ALT-C to
- go to the "Cartridge" menu. Here you
- see various functions which control
- the operation of the emulated
- cartridge port. Highlight "Insert
- Cartridge" and press F1. Now you see
- the "Insert Cartridge" file menu. PAY
- ATTENTION because all the file menus
- in CCS work the same!
-
- The first entry, ".." is used to
- go up one level in the directory
- hierarchy. Below that is a list of
- files in the current directory. At the
- bottom is a list of all drives
- currently active on your PC such as
- A:, C: and D:
-
- If you're not already inside the
- CCS64 folder (the one you unZIPped
- CCS64 into), you'll have to navigate
- there. On my own PC it is located in
- "C:{CBM--}Program Files{CBM--}CCS64{CBM-*}32". Hit ENTER
- on a directory name to go down into
- it. Hit ENTER on ".." to go up one
- directory level. Hit ENTER on a drive
- letter to change to a different active
- drive.
-
- Inside the CCS64 folder you'll see
- the image "CCSMon.crt". Highlight it
- and hit ENTER. Now CCS64 restarts the
- emulated C-64 with the cartridge
- inserted. You'll see the CCSMon
- startup screen.
-
- Now remove (un-insert) the
- cartridge by pressing ALT-C to return
- to the "Cartridge" menu. Use
- down-arrow to highlight "Cartridge
- Emulation" and right-arrow to select
- "Off". Press ESC to return to the
- emulated C-64. What the?!? The CCSMon
- screen is still displayed! Hit ALT-R
- to clear things up.
-
- ALT-R simulates a software reset
- like SYS 64738. You can do a
- hard-reset using ALT-SHIFT-R.
- ALT-SHIFT-R simulates a reset button.
- In most cases, just using ALT-R will
- work just fine.
-
-
- RAM EXPANSION
-
- From here on in I'll assume you're
- comfortable with how the CCS64 menus
- work and can select functions and
- sub-menus on your own. If you have
- difficulty, refer to the CCS64 manual.
-
- Another cool feature available
- from the "Cartridge" menu is the "RAM
- Expansion Unit". This simulates a
- Commodore 17xx REU. Here you can turn
- the REU on or off, which is the same
- as inserting or removing the REU. You
- can also set the size of the REU
- anywhere from 128 Kilobytes to 16
- Megabytes using the "Size" function.
- Imagine what you can do with a 16
- Megabyte Commodore 64!
-
- Additionally, the "File Enable"
- function allows you to preserve the
- contents of the virtual REU between
- sessions. When you quit CCS64 (ALT-Q)
- the contents will be saved in a file
- on your PC hard drive. The next time
- you start CCS64, the REU contents will
- automatically be reloaded (assuming
- you leave "RAM Expansion Unit" set to
- "On".)
-
- The cartridge port emulation of
- CCS64 is superior to the same port on
- a real C-64 in that you can keep the
- REU enabled even when using other
- cartridges (e.g. CCSMon.) You can
- think of this as having a switched
- dual cartridge port expander plugged
- into the C-64 (similar to the
- "Aprospand-64").
-
-
- TAPE IMAGES
-
- There are two types of tape images
- available for C-64 emulators. They use
- different principles, but you don't
- have to know the technical details
- since both work just as well on CCS.
- They are .T64 and .TAP files.
-
- From the CCS main menu (F10)
- select "Tape Device 1". Now use the
- file listing to navigate to the
- drive/directory containing the tape
- image file. Select the tape image you
- want and press F1 to "Examine" it. CCS
- has now inserted the tape into the
- virtual tape drive.
-
- Here is something new. Tape images
- can contain more than one C-64 program
- or data file (just like a real C-64
- tape.) The menu displayed at this
- point allows you to select a program
- from the virtual cassette to LOAD and
- RUN it. Highlight the desired program
- and press F1. CCS will now reset the
- emulated C-64. The command LOAD "",1
- will automatically be entered. In a
- short amount of time the program will
- have loaded and it will automatically
- RUN.
-
-
- PROGRAM IMAGES
-
- A program image is simply a C-64
- program as it exists in the C-64's
- memory. Typically this will be a BASIC
- program, or a machine language program
- with a BASIC startup (e.g. 10 SYS
- 2061.) These files are identified by
- their .PRG extension.
-
- You can make a .PRG image file by
- SAVEing a BASIC program to disk and
- copying the resulting file to a PC
- formatted disk. Then rename it with a
- .PRG extension. Note that this is the
- same procedure used to make a .ROM
- image file. The only difference is
- that .PRG files ALWAYS should have a
- LOAD address of $0801.
-
- You can LOAD and RUN .PRG images
- using the same procedure as for tape
- images, right from the "Tape Device 1"
- menu.
-
-
- DISK IMAGES
-
- Disk images are a byte for byte
- image of a 1541 floppy disk. They come
- in a few flavors, but the most common
- is .D64. You'll also run across .X64
- and .G64. The latter is a GCR image of
- the disk containing not only the data
- blocks but also the header block and
- low-level formatting info.
-
- From the C-64 screen, hit ALT-8 to
- go to the file select menu for "1541
- Device 8". Navigate to the
- drive/directory containing the disk
- image file you're interested in and
- highlight it. Press F1 to "Examine"
- the disk image and see it's directory.
- This is equivalent of LOAD "$",8 LIST.
- Now highlight a PRoGram file and hit
- ENTER to RUN it.
-
- Because many disk image files
- contain only one program and are
- mostly wasted space, they are often
- distributed in a compressed format.
- The two most common formats are
- PK-ZIPed (.ZIP) and "Zip-Coder 64"
- (.Z64)
-
- .ZIP files must be unpacked with
- PK-ZIP or WinZip before you can use
- them with your emulator. This is the
- preferred method of distribution for
- .D64 images.
-
- "Zip-Coder" is a C-64 program
- which has been around a LONG time. It
- was used to distribute copies of
- entire disk sides on the many
- Commodore bulletin boards of old.
- "Zip-Coder" files are NOT ALWAYS
- designated with the .Z64 extension.
- You can ALWAYS identify them by the
- form they take in the 1541 directory:
-
- 1!name.Z64 PRG
- 2!name.Z64 PRG
- 3!name.Z64 PRG
- 4!name.Z64 PRG
-
- "Zip-Coder" works by reading each
- block of a 1541 disk side. The blocks
- are lightly compressed using a simple
- RLE (Run-Length Encoding) algorithm
- and then divided into four zones. The
- zones are defined by the track range
- wherein each given block exists. The
- size of each of the 1! - 4! files
- depends on the number of used blocks
- in that zone.
-
- The four files should be
- distributed together. Sometimes they
- will be found further packed into
- PK-ZIP archives. This two-level
- archive means you only have to
- download one file, but it is NOT the
- best way. It is FAR LESS COMPLICATED
- to compress a .D64 image into a .ZIP
- archive with PK-ZIP/WinZip. This saves
- the user from having to unpack two
- levels of archives.
-
- Several versions of Zip-Coder are
- floating around. Most use the same
- pack/unpack algorithm and their output
- files are interchangeable. A good one
- can be gotten from:
-
- ftp://arnold.c64.org/pub/ut
- ils/c64apps/zippers/
-
- A good way to eliminate the
- complexities of dealing with archives
- (especially those nasty two-level
- archives) is by installing "Target
- D64" by Karlheinz Langguth. It can be
- gotten from :
-
- http://skyscraper.fortunecity.com/
- quadra/251/targetd64.html
-
- "Target D64" is a PC program which
- automatically unpacks the most common
- archives used with C-64 image files.
- It will start your emulator and
- hand-off the resultant image to it. I
- use "Target D64" to start .ZIP and
- .Z64 compressed images with its "Send
- To" context menu. Installing "Target
- D64" may require you to edit your PC's
- "AUTOEXEC.BAT" file, but all the
- details are thoroughly described in
- its instructions. Sorry but PC
- programs are not nearly as easy to
- install and operate as C-64 programs
- ;')
-
- Again, see "FORMATS.ZIP" by Peter
- Schepers for the details of the most
- common disk image and archive formats.
-
-
- JOYSTICKS
-
- Like the other hardware commonly
- found on C-64 systems, the joysticks
- must be emulated. The easiest joystick
- setup available under CCS64 is the
- predefined joystick keysets. They work
- by intercepting keypresses on the PC
- keyboard and passing them to the
- emulated C-64 as actions on a joystick
- connected to port 1 or port 2.
-
- Enter the "Input" menu with ALT-I.
- Highlight the "Control Port 1"
- function and use left-arrow/ right-
- arrow to select the "Joystick"
- setting. Notice that its also possible
- to connect a virtual mouse and virtual
- paddles to the emulated machine.
-
- For now, just select "Joystick".
- Now highlight the "Mode" function
- corresponding to "Control Port 1" and
- select the "Keyset 1" setting. Next,
- do the same operations for "Control
- Port 2" but select the "Keyset 2"
- setting for the "Control Port 2"
- "Mode" function.
-
- View the definitions for each
- keyset by highlighting the "Define
- Joystick Keyset" function and pressing
- right-arrow. Use the "Define Joystick
- Keyset" menu to view the key
- definitions for "Keyset 1" and "Keyset
- 2". Later you can re-define the
- keysets to your liking, but don't
- change them at this time. The default
- joystick keyset definitions are:
-
- Keyset 1
- Up = /
- Down = 5
- Left = 7
- Right = 9
- Fire = right ALT
-
- Keyset 2
- Up = 8
- Down = 2
- Left = 4
- Right = 6
- Fire = right CTRL
-
- These refer to the numeric keypad
- on the PC keyboard. You'll see that
- the default keysets are very intuitive
- as long as you have set the "Control
- Port 1" function to "Keyset 1" and the
- "Control Port 2" function to "Keyset
- 2". The default keysets don't work
- well for games requiring 2 joysticks
- and you'll want to use different
- "Mode" settings for these games.
-
- It is also possible to use a PC
- joystick or real C-64/Atari joystick
- which has been modified to connect to
- the PC. If you have such hardware,
- just select the corresponding Mode
- setting in the Control Port used by
- your game. The plans for such a hack
- may be found at:
-
- http://www.students.tut.fi/^kosolah
- /joyport/joyport-en.html
-
- K"PD"K
-
-
-