Hardware requirements

You will need a "sufficiently fast" PC with a CPU that supports the RDTSC opcode. The slowest computer I have personally successfully tested with 1541EMU was equipped with a 166 MHz MMX-Pentium processor, but even a high-end 486 PC (120 or 133 MHz) might be good enough. For best results you should buy a PCI bus LPT port card. I can recommend the following product: Lava Parallel-PCI by Lava.

You'll also have to build (or buy) a small electrical circuit for connecting the LPT port of your PC to the Commodore serial bus. 1541EMU supports two types of cables: type 0 (original/complete) and type 1 (simplified).

The type 0 cable is electrically as compatible as possible with the Commodore serial bus. The type 1 cable is considerably easier to build as you don't even need a circuit board. It is recommended that you construct the type 1 cable.

There is a small utility program called testcabl.exe included in the archive. It can be used for testing the cable. More detailed instructions for this are available here.

Installation instructions

When you extract the zip file with make sure to restore the original directory structure. There are several subdirectories in the archive.

You can now edit the configuration file 1541EMU.INI if you want. There are four settings in it:

Usually it is recommended to choose device number 8 for the emulated disk drive, because this value is hardcoded into most Commodore 64 software. If you have other serial bus devices connected to your Commodore home computer the device number has to be chosen so that no conflicts arise. Values 8-11 are valid.

It is recommended to keep the global write protect setting enabled. If you feel adventurous, you can change the setting after you have made sure that the fastloader you are using is working flawlassly on your hardware configuration. Please notice that only 174848 byte long D64 files are currently writable.

The LPT port I/O tuning value tells your computer how many PC CPU clock cycles the LPT port output operations should be delayed in comparison to the corresponding input operations. For example, if you have a 400 MHz CPU, the optimal value might be in the range of -600 to +600. Stock serial bus protocol works without any tuning (0), but you'll have to experiment with different values to find the ideal setting for fastloaders on your hardware configuration. There is no need to edit this value manually. It can be conveniently adjusted while 1541EMU is running.

For copyright reasons the firmware of the Commodore 1541 disk drive is not distributed in the zip file. Here is a BASIC language utility program that can be used for copying the contents of the firmware ROM of a real disk drive into a file:

 10 open 15,8,15                           
 20 open 2,8,2,"@0:1541rom,s,w"            
 30 for ah=192 to 255                      
 40 for al=0 to 128 step 128               
 50 print#15,"m-r";chr$(al);chr$(ah);chr$(128) 
 60 for i=1 to 128					
 70 get#15,a$:if a$="" then a$=chr$(0)		 
 80 print#2,a$;                                
 90 next i: next al: next ah                   
100 close 2: close 15                         

1541EMU recognizes all official 1540, 1541, 1541C and 1541-II firmware versions. Also JiffyDOS 5.0 is supported.

However it is easier to get the required files from the Internet. Download the following files from ftp.funet.fi to your computer (NOTICE: You should use an FTP client and not a WWW browser for this):

Combine these files with the following command:

copy /b 1540-c000.325302-01.bin + 1541-e000.901229-05.bin 1541v5.rom

and copy the resulting file 1541v5.rom into the installation directory. You can use another name for this file, you'll just have to change the corresponding setting in the configuration file accordingly.

Usage

Boot your PC in real mode DOS without the EMM386.EXE memory manager. CD into the installation directory and enter command

1541emu [file1] [file2] [file3] ...

where file1 is the name of the disk image to be inserted into the emulated disk drive. You can enter up to ten filenames on the command line. UNIX style wildcards are also supported. Only the D64 disk image format is currently supported.



1541EMU 2002-07-21, Copyright (C) 2001-2002 Ville Muikkula <1541@surfeu.fi>
Device number of the emulated Commodore disk drive is 8.
Disk images are globally write-protected.
Detected PC CPU speed is 400 MHz.
Detected type 1 cable (0x378, IRQ 7, rising edge, 1.239356 us).
Drive ROM type is 1541 r5.

ESC = Quit, R = Reset, 1-0 = Set slot, O = Open disk image, N = New disk image
(,/.) = Adjust I/O tuning value: -150
--------------------------------------------------------------------------------
1rE:\C64\DEMOS\REFLEX\RADIONAP.D64
2
3
4
5
6
7
8
9
0
--------------------------------------------------------------------------------
                        LED:     Motor:     Track:  1.0

On the bottom of the screen there is a status line which includes the disk drive activity LED, information on the motor state and the location of the read/write head. You can change the currently active disk image slot by pressing a number key. You can reset the drive with the R key and quit to DOS with the ESC key.

Additional disk image files can be opened by choosing a disk image slot and pressing the O key. Please notice that accessing the file selector stops the emulation and resets the emulated disk drive. This means that multi-disk programs that have built-in fastloaders will fail if you do this while such a program is running on your Commodore computer. So make sure that you have all the necessary disk images open before you start such a program. Changing the disk by pressing a number key does not interrupt the emulation.

If there is a small 'r' character on the left side of a disk image filename in the user interface it means that the disk is write protected. You can create a new D64 disk image file by pressing the N key. Using this feature stops the emulation and resets the emulated disk drive, so what is written above about fastloaders and opening new disk images applies also here.

Compiling the source code

If you want to build 1541EMU from the source code, you'll have to install DJGPP, NASM and RHIDE (distributed with DJGPP).