COMP.EMULATORS.CBM: Emulation FAQ for Commodore 8bit Computers (3/4) Archive-name: 8bit-emulation-faq/part3 Comp-answers-archive-name: commodore/8bit-emulation-faq/part3 News-answers-archive-name: commodore/8bit-emulation-faq/part3 Comp-emulators-cbm-archive-name: 8bit-emulation-faq/part3 Posting-Frequency: twice a month (monthly to news.answers) Version: 3.5 CBM EMULATION FAQ - (Version 3.5, 4 November 1996) ================= This FAQ is usually posted twice a month on the 4th and 19th to comp.emulators.cbm. Since comp.emulators.cbm was set up to remove the emulator discussion from comp.sys.cbm, this FAQ will not be posted there. Lines preceeded by a '+' have been added or modified since the last version was posted. The FAQ is in four parts due to its size. Part 1 is general information and a list of available emulators. Part 2 is questions and answers. Part 3 is mostly data. Part 4 is basically reviews of various emulators. --------------------------------------------------------------------------- 3.5 How-to... (moved from Appendix B). 1. Playing multi-disk-image games with C64S 1.0C 2. Using VIC-EMU. 3. Running certain games. 4. Converting between different file formats. ========================================================== 1. Playing multi-disk-image games with C64S 1.0C [Note that v1.1b of C64S allows multi-disk games without hassle. I include this since some people may not like the time limit in the shareware version of C64S 1.1b/c. -tsr] J. Kevin Wells - nstn1297@fox.nstn.ca writes: There is a method of playing multi-disk-image games with C64S 1.0C shareware. The method is a bit cumbersome and works best with games that involve infrequent disk changes. 1. Copy the first disk-image file as TESTDISK.D64. 2. Start C64S. 3. Load and play the game until you are prompted for a new disk. 4. Press F9 to bring up the utility options. Press Alt-T to enter the tape-image section and press enter on TESTTAPE.T64. 5. Press F to select the Freeze option and type in a file name. Your game will be saved to the tape drive. If the tape drive is full, delete a file you do not need. 6. Press ESC to exit to the C64 emulator. 7. Press CTRL-BREAK to quit C64S and exit to DOS. 8. If the game has altered the disk-image in any way (saved your game to the disk, for example), copy TESTDISK.D64 back to its original file name from step 1. 9. Copy the requested disk-image file (usually Disk 2) to TESTDISK.D64 10. Start C64S again. 11. Press F9. Press Alt-T to enter the tape-image section and press enter on TESTTAPE.T64. 12. Select the file you froze in step 5. Press ESC to exit to the emulator. 13. Press Shift-TAB to load and run the frozen program. The game should be at the point where it is requesting the disk change. Follow the program's instruction for signaling that you've changed the disk. 14. When prompted for another disk, repeat the process at Step 4. One thing to keep in mind is that the Frozen program is kept on the tape drive until you delete it. You might want to delete the frozen file when you're finished playing the game, or between disk swaps. Remember that you can use this frozen file to restore your game at the point it was frozen again and again. The Freeze option is a very powerful feature, similar to the Snapshot cartridge on the original C64. You can use it to save virtually any program at any point - even games that don't have a save function. I haven't tested this method of using multiple disks with every game out there, but the ones I did try seemed to work. Try the method out with a particular game, if possible, before getting into any heavy gaming sessions. [note, again, that none of this stuff needs to be done with C64S 1.1b, since it allows multi-disk games without hassle. The information is included just in case you find the ten-minute timer on C64S 1.1b annoying.] --------------------------------------------------------------------------- 3. Using VIC-EMU. Question: Hi, I'm currently trying to use Peiter van Leuven's VIC-EMU to run some VIC-20 software on my AMIGA. I have some VIC files on Amiga Formatted floppy's as well, but the documentation doesn't say how to run it with the emulator! It does suggest that you have to use memory addresses, but how do us non-programmers know what memory addresses to use for a binary file or a BASIC file? I've had no success. The command structure is like this; vic-00 $???? filename What is the proper address for ???? in order to get a program to run? ------- Answer 1: Well, you might be asking about at what position Basic starts on the VIC. On an unexpanded machine, it starts at $1000 (and load file at $1001). On a +3k machine (as the emulator default), it starts at $0400 ($0401) On a +8k machine and more, Basic starts at $1200. (load at $1201) Binary files normally load with LOAD "name",device,1 and you have to find out where to load it yourself. (I know there's a method by looking at the first bytes of the file, but I don't know how). BTW: The version of VIC-EMU doesn't seem to load files inside the emulator very well (e.g the load-command hangs, and there's no RESTORE key). ------- Answer 2: Well, Pieter sent me a message letting me know how to load a BASIC or disk image file into the VIC-EMU. There is a way to find out what position a file starts at, you look at the first four bytes of the file and then switch them around, or something to that effect. Once you have done that you use that number as the memory address: vic-20 $1000 filename Then from the VIC emulator screen you type LOAD "filename",8 and it will load it. However, my problem is that from the CLI command, I'm not clear on what filename I'm supposed to include! The filename for the program I want to load or what? The emulator won't activate unless you include a filename in the CLI command, but putting the filename for the disk-image file you want doesn't seem to do anything, you still have to load it the old fashioned way (LOAD "",8) to get it to show up. I guess my question is; how do I just make the emulator activate (i.e. just like a vic after power up) without having it run a program, etc --------------------------------------------------------------------------- 4. Getting certain games to work. a. Racing Destruction Set Oh, I bet I know what your Racing Destruction Set problem is. It's the one that the game tells you to flip to side two, but it never tells you to flip to side one. It's understood that you flip back to side one at every significant pause in disk acess. In particular, if you modify a car, then flip the disk back to side one before you leave the car modification menu. After loading a track from side two, when you want to return to the menu, flip back to side one BEFORE telling it to go back, because it will hapilly try and load the menu from side two and crash. From: Chuck Cochems (zaphod@camelot.bradley.edu) b. Mail Order Monsters This is a hint that works wonders on the 64 version of the game: Copy your original disk (obviously not necessary for the emulators) and change the disk name and ID (with a disk editor or utility program) to "ownerdisk,ea" This makes your master disk an owner disk (there's ~100 blocks free on the original, each owner takes ~1 block of Commie disk space, so you'll probably not have to worry about running out of disk space.) I have about 9 owners on a copy of the disk, and we have a lot of fun with this game. Just keep hitting RETURN when it wants a disk. Enjoy. From: Michael Miller (mmiller3@gac.edu) c. Bruce Lee Actually, I have yet to find a version of this game which doesn't crash on a real C64 (NTSC or PAL). So, my advice is to reset and try again if the game crashes on you. 4. Converting between different file formats. Q: How can I convert the ZipCode files (1!..,2!..etc.) found on various ftp-sites to a format usable by the emulators? A: Grab the file zip2d64.arj on any of the emulator ftp-sites. The syntax for conversion is: zip2d64 zip.gam zipgame.d64 to convert the files 1!zip.gam 2!zip.gam 3!zip.gam 4!zip.gam to the file zipgame.d64. Alternatively, several C64 transfer utilities (64Copy and Star Commander) have built-in utils for ZipCode conversion. Q: OK, but what about Lynx files (*.lnx)? A: On the emulator ftp-sites there is also a DOS executable that extracts files from a Lynx archive. Alternatively, you can down- load the C64 utility "Omega-Q" from the /utils directory at frodo etc. Put the .lnx file into a .d64 file, run Omega-Q and unlynx the files directly to a .d64 quickly and easily. The C64 transfer utilities 64Copy and Star Commander also are able to convert Lynx files to a usable format. 4. A list of ftp sites where emulation programs can be obtained. ---------------------------------------------------------------- Some of the emulation programs are duplicated at other sites. I have not listed every site that has a certain emulator, although I may have listed more than one site that has that emulator. If you would like to more about other cbm ftp sites then read the ftp list which is posted to comp.sys.cbm regularly by Howard Herman (72560.3467@CompuServe.COM). Any site maintainer who wishes their site listed here only needs to send me mail advising me of that fact! Format for listing: Site.Name /Directory MACHINE - program name 4.0.1 Site Maintainers. If you have any questions about specific emulator sites, then please contact the person named below. Site: ----- ftp.funet.fi cbm-adm@ftp.funet.fi ftp.seattlelab.com ds@seattlelab.com (Derek Smith) ftp.giga.or.at Guenther.Bauer@giga.or.at (Guenther Bauer) arnold.hiof.no jonko@arnold.hiof.no 4.0.2 Site IP addresses. Site: ----- frodo.hiof.no 158.36.33.4 ftp.seattlelab.com 204.250.145.1 4.0.3 WWW Info. With the rapid proliferation of Web sites having CBM info., it seems fitting that they have their own section. http://www.hut.fi/~msmakela/cbm stekt.oulu.fi:/~jopi/x64.html">http://stekt.oulu.fi:/~jopi/x64.html x64 emulator documents and links to distribution sites. 4.1.6 C64 Emulators for BeBox. ftp.funet.fi /pub/CBM/emulation BEBOX - FrodoV3_0.tar.gz 4.2 VIC20 Emulators. ftp.hrz.uni-kassel.de /pub/machines/vic-20/vic-emulator AMIGA - vic-emu.lha src.doc.ic.ac.uk /packages/aminet/misc/emu AMIGA - vic-emu.lha ccnga.uwaterloo.ca /pub/cbm/util64 C64 - vic-emulatorC64.lnx 4.3 C128 Emulators. See section 4.1.5. X128 comes with the X64 emulator. 4.4 PET Emulators. No sites known. 4.5 SID Emulators. frodo.hiof.no /pub/c64/sidmusic IBM PC - sidpl???.zip AMIGA - playsid3.lha delisid.lha ATARI ST - mmm226.lzh cnam.cnam.fr /pub/Amiga/mus/play AMIGA - PlaySID2.2.lha ftp.germany.eu.net /pub/comp/amiga/music AMIGA - PlaySID2.1.dms ftp.uni-hamburg.de /pub/dos/incoming IBM PC - sidpl???.zip ftp.funet.fi /pub/amiga/audio/apps/playback AMIGA - PlaySID-2.0.lha ftp.uni-paderborn.de /pub/pc-demos/music/programs/players IBM PC - sidpl???.zip 4.7 Other utilities & files. 4.7.1 Utilities frodo.hiof.no /pub/c64/utils IBM PC - disk64e.arj c64uti5.zip maketape.arj copy2d64.arj zip2d64.arj d64util.zip d64_10.zip d64zipcode.c tr64_114.zip tr_src11.zip and many, many others.. AMIGA - maketape.arj unt.lzh ftp.funet.fi /pub/msdos/utilities/diskutil IBM PC - copy2d64.arj zip2d64.arj ftp.funet.fi /pub/cbm/emulation AMIGA - d64.lha IBM PC - dir_d64.zip cnam.cnam.fr /pub2/Amiga/emu AMIGA - d64.lha ccnga.uwaterloo.ca IBM PC - tr64_114.zip tr_src11.zip 64copy20.zip 4.7.2 Data files. If you are searching for games, then I would recommend two places: arnold.hiof.no, and utopia.hacktic.nl. The files in the latter site are in the original C64 format, and will require some conversion to use in an emulator. The site rush.uwaterloo.ca is down permanently due to excess load on the FTP machine. nic.funet.fi /pub/amiga/audio/misc/sid-tunes AMIGA - C64MusicShow-1.lha (for use with PlaySID/sidplay) C64MusicShow-2.lha Addition.lha ftp.cnam.fr /pub2/Amiga/mods/PlaySid AMIGA - C64MusicShow-1.lha (for use with PlaySID/sidplay) C64MusicShow-2.lha Addition.lha ftp.cs.tu-berlin.de /pub/amiga/audio/mods-c64 AMIGA - C64Sounds.lha (for use with PlaySid/sidplay) ftp://ftp.wustl.edu/systems/amiga/aminet/mods/chip/ ftp://src.doc.ic.ac.uk/packages/aminet/mods/chip/ AMIGA - NemeSIDs-* (collection of C64 music) - note: these at just some of the aminet sites where the files should be available. frodo.hiof.no /pub/c64/sidmusic AMIGA or IBM PC - NemeSIDs*.lha (The biggest collection so far) rippoff5.zip (New tunes not included anywhere else) demo_new.lha -"- game_new.lha -"- Also take a look at the SIDPLAY FAQ covering a list of Ami-Net FTP servers and sidtunes related information. ===================================================================== 5. Emulator File Formats. ------------------------- As there are several emulators for different platforms, they all cannot be made directly usable by other emulators, unless the author has provided that facility. Utilities to convert back into CBM binary generally exist fortunately. 5.1 C64 Emulators standard files - overview. This section shows the "normal" files used by each emulator. Program File type Identification Contents (name or method) c64.zip (PC) disk image VC1541.000 683 pcs 256-byte sectors tape image - not used C64S (PC) basic rom } contains binary data for: kernel rom }- romcode.c64 VC1541 (16384 bytes), chargen chargen rom } (4096),basic (8192) and kernel disk drive rom} (8192) = total 36864 bytes program - not used disk image 09c *.d64 683 pcs 256-byte sectors 09a,b testdisk.d64 tape image *.t64 ? Note: the kernel part is modified. c64sally.zip basic rom A000BFFF.64F 8194 bytes of binary data (1) (PC) kernel rom D000DFFF.64P 8194 bytes of binary data (1) chargen rom E000FFFF.64P 4098 bytes of binary data (1) disk drive rom - not used program *.64P C64 program with load address also SEQ files via *.64S disk image - not used tape image - not used Frodo (Amiga/ basic rom Basic ROM 8192 bytes of binary data BeBox/Unix) kernel rom Kernal ROM 8192 bytes of binary data chargen rom Char ROM 4096 bytes of binary data disk drive rom 1541 ROM 16384 bytes of binary data program - C64 program with load address disk image - 683 pcs 256-byte sectors disk image magic header 64 byte magic header and 683 pcs 256-byte sectors pc64*.zip basic rom *.64B 8192 bytes of binary data (PC) kernel rom *.64K 8192 bytes of binary data chargen rom *.64C 4096 bytes of binary data module at $8000 *.64M 8192 or 16384 bytes of binary data (8K at $A000 = *.64B) disk drive rom VC1541.64D 16384 bytes of binary data program *.P00 C64 program with load address preceded by 24 byte header. SEQ data file *.S00 same as *.P00 with different USR data file *.U00 | extensions. The 00 can be DEL data file *.D00 | any numbers if the 16-to-8 REL data file *.R00 | mapping leads to duplicates. disk image *.D64 683 pcs 256-byte sectors, plus optionally 683 bytes error info tape image - not used c64.lzh (ST) basic rom c64/_basic 8192 bytes of binary data kernel rom c64/_kernal 8192 bytes of binary data chargen rom c64/_font 4096 bytes of binary data disk drive rom - not used program - C64 program with load address disk image - not used tape image - not used x64 (UNIX) basic rom basic 8192 bytes of binary data (2) kernel rom kernel 8192 bytes of binary data (2) chargen rom - not used disk drive rom - not used program - C64 program with load address disk image magic header 64 byte magic header and 683 pcs 256-byte sectors tape image - not used rom module filename 8192 or 16384 byte cartridge, stored in binary format ram image ram RAMSIZE + 4103 (x64 will load a ram image, eg. "the contents of RAM as in warm start" at startup, if one exists) Only the RAM is loaded at startup. CPU registers and I/O are loaded only via 'undump' in the monitor. (That way it won't keep crashing all the time.) (1) Includes load address. (2) Default load address allowed. 5.2 Table of supported file formats. This section shows which emulators and utilities can access which file formats. This is now a little more complete, thanks to Jouko Valta (again :> ). Legend used in table: x = yes, fully supported, c = convertor provided, r = read-only, - = no, and empty = unknown. 1. Emulators x64dsk d64 t64 p00 CBM x64 0.3.1 x c c c x PC64 1.10 - x c x c C64S 1.1A - x x c c C64Alive 0.9ah - - - - x MagiC64 - x x x x Frodo V2.x r r - - x Frodo V3.x x x - - x VICE x c c x x + Power64 0.8 x x x x x 2. Transfer utils x64dsk d64 t64 p00 CBM Transfer type Star Commander - x x - x normal/fast Trans64 x x x x normal x1541 (old) - - - - x normal x1541 (new) - - - - x normal 64Copy x x x x x n/a UnD64 - x - - x n/a 3. Other utils x64dsk d64 t64 p00 CBM ascii fvcbm x x x x x - c1541 x c c x x - petcat - - - x x x TOK64 - - - - x x 5.3 Standard data files - internal formats. This section shows the internal format used by each filetype. Most of it was taken from the compatibility section of the x64 manual, and was provided by Jouko 'Jopi' Valta. That section is based on the information acquired from news articles written by: blohm@mathematik.uni-ulm.de (Guntram Blohm) kbrisley@tsegw.tse.com (Kevin Brisley) File: ram (x64) Total Size: RAMSIZE + 4013 --------------------------------------------------- Offset Bytes Description 0 RAMSIZE contents of the RAM The following data is not included yet: RAMSIZE 4096 I/O area with shadows 7 CPU Registers: PC (LO/HI), AC, XR, YR, PS, SP File: x64 Disk File Total Size: 174912 ------------------------------------------ Offset Bytes Description 0 4 Magic header: 'C',0x15, 0x41, 0x64 4 4 Header Version: C1541 Version Major C1541 Version Minor Device Type: 0 = 1541 Max Tracks: 35 (from disks v1.2 upwards) 64 256 byte sectors File: *.d64 disk image Total Size: 174878 ------------------------------------------ D64 file contains all sectors as they appear on the 1541 formatted disk. Each sector is 256 bytes long. Error information (1 byte per sector) can be added in the end of file. __________________________________ File types currently supported 174848 bytes = 35 tracks 175531 bytes = 35 tracks + 683 bytes error information 196608 bytes = 40 tracks 197376 bytes = 40 tracks + 768 bytes error information _______________ Track sizes Tracks, size 1-17 21 sectors * 256 bytes 18-24 19 sectors * 256 bytes 25-30 18 sectors * 256 bytes 31-35 17 sectors * 256 bytes *36-40* 17 sectors * 256 bytes Tracks 36-40 are non-standard. ____________________________________ Actual layout for 35 track image Offset, size, description 0*256, 256 track 1, sector 0 1*256, 256 track 1, sector 1 ... 20*256, 256 track 1, sector 20 21*256, 256 track 2, sector 0 ... 682*256, 256 track 35, sector 16 683*256, 683 error info (byte per sector in the same order) Sectors are 256 bytes. Sector 0 is at offset $00000 in the .d64 file. Sector 1 is at offset $00100 in the .d64 file, and so on. A normal 1541-format disk is divided into 4 'zones' - zone 1 = tracks 1-17 with 21 sectors (numbered 0-20) zone 2 = tracks 18-24 with 19 sectors (numbered 0-18) zone 3 = tracks 25-30 with 18 sectors (numbered 0-17) zone 4 = tracks 31-35 with 17 sectors (numbered 0-16) The directory lies on track 18. The following info is for track 18 - sector 0 = Block Availability Map (bytes 00-8f, bitmapped) bytes 90-9f = disk name (16 chars, space padded) The first 2 bytes are track and sector to the first directory block. Usually the first directory block is the very next block on the disk directory blocks: byte 0 = track of next directory block byte 1 = sector of next directory block bytes 2-31 = file entry #1 bytes 32-33 = unused (should be 0) bytes 34-63 = file entry #2 bytes 64-65 = unused, etc etc The first byte of a file entry is the type of file ($82 = PRG, $81 = SEQ, $83 = USR, $80 = DEL, $84 = REL). The next two bytes point to the track & sector of the first sector of the file. The next 16 bytes is the filename (padded). The last two bytes (i.e. bytes 30 & 31) gives the block count of the file (in low byte/high byte format). Each file block has 254 bytes of data, unless it is the last block. The first 2 bytes of each block are the track and sector of the next block. If the track is zero then this is the last block, and the sector # really tells the number of bytes used out of the 254 possible. The use count is the number of bytes used plus 1--so if the sector # has a $05, then really only $04 bytes were used out of the last block. The directory is at offset $16500 in the .d64 files. Tracks references start at 1. Sector references start at 0. So if the first 2 bytes of a block are $06 04, the absolute location is at 5 * $1500 + 4 * $100. (5 because that's $06 minus 1. $1500 because at track $06 there are 21 sectors per track, or $1500 bytes. 4 because that is the sector number, and $100 because that's the number of bytes in a sector.) The disk has a total of 35 tracks. There are 17 trachs with 21 sectors (357 sectors total), 7 tracks with 19 sectors (133 sectors total), 6 tracks with 18 sectors (108 sectors total), and 5 tracks with 17 sectors (85 sectors total). So total sectors per disk (or .d64 image) is 357+133+108+85 = 683 total, or 174,848 bytes total, which is the exact size of the .d64 files. File: *.t64 tape image Total Size: Varies ------------------------------------------ Offset Bytes Description 0 64 Tape Record: 0 32 Tape description + EOF (for type) 32 2 Tape version: $0100 34 2 Max number of files, in LO/HI 36 2 Number of existing files, in LO/HI 38 2 - 40 24 User description, as displayed in file menu 64 32*n File Record(s) for each of n files: +0 1 Slot allocation flag: 00 = free entry 01 = normal tape file 03 = memory snapshot v0.9, uncompressed 02..FF = reserved for memory snapshots +1 1 File type +2 2 Start address in C64 memory, in LO/HI +4 2 End address in C64 memory, in LO/HI +6 2 - +8 4 File start address on the image, in LO/HI +12 4 - +16 16 C64 filename 64+32*n ??? File contents. Wolfgang Lorenz (author of PC64) posted the following in an open letter to Miha Peternel (author of C64S). AFAIK there's been no reply. There is some ambiguity in the T64 file format. Could you please make a statement if the following assumptions are correct? Tape Record Offset, size, description 0, 32 DOS tape description, ASCII charset, contains either "C64S tape file",13,10,"Demo tape",26,"......" (no 0!) or "C64S tape image file",0,0,0,0,0,0,0,0,0,0,0,0 or "C64 tape image file",13,10,0,0,0,0,0,0,0,0,0,0,0 To identify a T64 file, search for the sub-strings "C64" and "tape". 32, 2 tape version, currently $0100 or $0101 34, 2 number of directory entries, mostly $001E 36, 2 number of used entries (0 for unknown) 38, 2 free 40, 24 user description as displayed in tape menu, CBM charset, padded with space File Record Offset, size, description 0, 1 entry type 0 = free entry 1 = normal tape file 3 = memory snapshot v0.9, uncompressed 2..255 reserved (for memory snapshots...) 1, 1 C64 secondary address, mostly 1 2, 2 start address 4, 2 end address 6, 2 free 8, 4 offset of file contents start within T64 file 12, 4 free 16, 16 C64 file name, CBM charset, padded with space Example Structure Definitions for C and C++ struct { char acTag[32]; word wVersion; word wEntries; word wUsedEntries; word wReserved; byte abName[24]; } T64Header; struct { byte bType; byte bSecAdr; word wStartAdr; word wEndAdr; word wReserved; long lOffset; long lReserved; byte abName[16]; } T64Entry; File: CBM Files Total Size: Varies --------------------------------------- Offset Bytes Description 0 2 Load address in LO/HI format. File: *.p00 file image Total Size: Varies ------------------------------------------ Offset Bytes Description 0 8 String "C64File" terminated by 00. + 9 17 Original C64 Filename. + 25 1 Record size for REL files. 26 Original file 5.4 Converting between file formats. Instructions on how to interconvert between all of the formats used by the various C64 emulators. One thing to keep in mind is that there are some 'all in one' conversion programs which convert from any format to another; 64Copy is an example. Formats: 1) .d64 - Disk image used by C64s 2) .t64 - Tape image used by C64s 3) .p00 - image format used by PC64 Conversions: 1) .p00 to .t64 a) Start PC64 b) First get a "Manager" window up c) Place the cursor on the *.P00 file you want converted d) Then use "Manager/Export" (ALT-M-E). This will save it as a *.PRG. e) Then use MAKETAPE.EXE to make a *.t64 file. 2) .t64 to .p00 Use t64top00.exe, which comes with PC64 and creates p00 copies of all the t64 files in a directory tree. 6. How to extract the Rom images required by the emulators. ----------------------------------------------------------- Type in the following files on your C64 and run them to get the rom image files. Then transfer those files onto the machine that you require. See the comp.sys.cbm FAQ section 7 for some details on transfers. Alternatively, You could get TheA64Package.lha and extract the file called TheA64Package/64Prgs/SaveROMs. This will extract the basic and kernal roms from a C64. Note that this stuff is only required if your emulator doesn't come with ROMs. Both C64S and PC64 come with ROMS, so don't worry about that. 6.1 C64 roms - Basic, Kernal & Charset. C64 BASIC ROM extractor: 10 OPEN 5,8,2,"64BASIC,P,W" 20 FOR X=40960 TO 49151:PRINT#2,CHR$(PEEK(X));:NEXT 30 CLOSE 5 C64 KERNEL ROM extractor: 10 OPEN 5,8,2,"64KERNEL,P,W" 20 FOR X=57344 TO 65535:PRINT#2,CHR$(PEEK(X));:NEXT 30 CLOSE 5 C64 BASIC and Kernal ROM extractor: 10 OPEN5,8,5,"0:C64ROM,S,W" 20 FOR X=40960 TO 49151 30 A$=CHR$(PEEK(X)) 40 PRINT#5,A$;:NEXT 50 FOR X=57344 TO 65535 60 A$=CHR$(PEEK(X)) 70 PRINT#5,A$;:NEXT 90 CLOSE5 C64 Character ROM extractor: 10 POKE 56334,0:POKE 1,51 20 FOR X=16384 TO 20479:POKE X,PEEK(X+36864):NEXT 30 POKE 1,55:POKE 56334,1 40 OPEN 5,8,5,"64CHARGEN,P,W" 50 FOR X=16384 TO 20479 60 PRINT#5,CHR$(PEEK(X));:NEXT 70 CLOSE 5 6.2 VIC20 roms - Basic, Kernel & Charset. VIC20 BASIC ROM extractor: 10 OPEN 5,8,2,"V20BASIC,P,W" 20 FOR X=49152 TO 57343:PRINT#5,CHR$(PEEK(X));:NEXT 30 CLOSE 5 VIC20 KERNEL ROM extractor: 10 OPEN 5,8,2,"V20KERNEL,P,W" 20 FOR X=57344 TO 65535:PRINT#5,CHR$(PEEK(X));:NEXT 30 CLOSE 5 VIC20 Character ROM extractor: 10 OPEN 5,8,2,"V20CHARGEN,P,W" 20 FOR X=32768 TO 36863:PRINT#5,CHR$(PEEK(X));:NEXT 30 CLOSE 5 6.3 1541 rom. C1541 ROM extractor: Extract area $C000-$FFFF 100 B=16384:I=B 110 OPEN 15,8,15 120 FOR H=192 TO 255:PRINT H; 130 FOR L=0 TO 255 140 PRINT#15,"M-R";CHR$(L);CHR$(H) 150 GET#15,A$ 160 Z=FRE(0) 170 POKE I,ASC(A$+CHR$(0)) 180 I=I+1:NEXT L 190 NEXT H 200 CLOSE 15 210 OPEN 5,8,5,"0:C1541ROM,P,W" 220 FOR X=B TO I-1:PRINT#5,CHR$(PEEK(X));:NEXT 230 CLOSE 5 7. Other information. --------------------- 7.1 Newsgroups worth reading. If you want to ask a question about an emulator or read what other people are saying, then I recommend that you read comp.emulators.cbm :) Another good group to read for general info about Commodore 8bit machines is comp.sys.cbm. 7.2 Emulator benchmarks. Some people are interested in the relative speed of the emulators with respect to the actual machine it's emulating. So far, only the following simple test program has been used in benchmarking emulators. More tests and more machines are needed! Benchmark test #1. 10 a = ti 20 print "[clr/home]" 30 for i = 1 to 1000 40 print "[up][up]"; i ; i * i 50 next 60 print "[down][down] time = "; ti -a Results: "Machine" "Config" "Software" "Score" C64 PAL CBM BASIC 1508 C128 64 mode CBM BASIC 1590 C128 40 col CBM BASIC 2226 C128 40 col fast CBM BASIC 1071 (1) C128 80 col CBM BASIC 4072 C128 80 col fast CBM BASIC 2062 Sun SPARC IPC 8Mb RAM x64-0.2.2 1452 (2) Osborne 486 DX2/50 16Mb RAM c64hercules 286 Osborne 486 DX2/50 16Mb RAM c64sally 234 Osborne 486 DX2/50 16Mb RAM c64s10cd 1486 Osborne 486 DX2/50 16Mb RAM c64neu 2985 Osborne 486 DX2/50 16Mb RAM c64alive --- (3) Amiga 3000/25 6Mb RAM A64v2 788 Amiga 4000/060-50 20Mb RAM Frodo V2.3 1463 Amiga 4000/060-50 20Mb RAM Frodo SC V2.3 1508 Atari 1040 STfm Hi-res c64.tos 3567 (58 s real) Atari 1040 STfm Low-res c64.tos 3624 (58 s real) + Power Macintosh 6100/60 Power64 1510 (4) Notes: (1) Screen automatically blanked during test. (2) "ti" clock doesn't necessarilly keep real time in x64. In x64 the ti clock is relative to the virtual speed, not the wall clock time. (3) c64alive wouldn't run on the test machine. Doh. + (4) Emulator speed set to 100%; Other speeds selectable 7.3 Emulator detection. Writers of software on the C64 or emulators may wish to know whether the "machine" their code is executing on is a real C64, or not. A small BASIC program was written by Wolfgang Lorenz, and posted by Paul David Doherty, which tests this. Critical addresses for the PIA expansion The critical addresses of the device are 57216--57343 ($DF80--$DFFF). There is the PIA chip to which you POKE the values to switch memory blocks. The PIA does not have 128 registers, as one might think. There are sixteen copies of its 4 addresses in that memory area. For instance, the addresses 57216, 57284, 57288 and 57340 are equivalent to each other. Here's a small CBM-BASIC program by Wolfgang Lorenz which tests whether it is running on a real C-64 or on an emulator. It also contains a suggested method for emulators to allow other programs to detect them. This detection method is already implemented in the PC64 and C64S emulators; it would be nice if other emulators (A64, MAC64, C64ALIVE, X64) would adhere to it too. 100 rem ********* where am i? ********* 110 rem ------------------------------- 120 rem this is the recommended method 130 rem how to detect a c64 emulator, 140 rem e.g. for disabling fast loaders 150 rem 160 rem - the byte at $dfff changes 170 rem between $55 and $aa 180 rem - the byte at $dffe contains 190 rem the manufacturer code letter: 200 rem a = c64alive 210 rem f = frodo 220 rem p = personal c64 230 rem s = c64 software emulator 240 rem x = x64 250 rem / = power64 260 rem - the word at $dffc contains 270 rem the emulator version number, 280 rem e.g. $0120 for version 1.2 290 rem - the bytes from $dfa0 contain 300 rem a copyright string with 310 rem emulator name and version, 320 rem $0d, copyright and $00. 330 rem ------------------------------- 340 : 500 print 510 x=57343: rem $dfff 520 if peek(x)<>85 then if peek(x)<>85 then 1000 530 if peek(x)<>170 then 1000 540 if peek(x)<>85 then 1000 550 if peek(x)<>170 then 1000 560 m$=chr$(peek(57342)): rem $dffe 570 print "manufacturer = '"; m$; "' "; 580 if m$="a" then print "(c64alive)"; 590 if m$="f" then print "(frodo)"; 600 if m$="p" then print "(pc64)"; 610 if m$="s" then print "(c64s)"; 620 if m$="x" then print "(x64)"; 630 if m$="/" then print "(power64)"; 640 print 650 : 700 v=peek(57341)*256 + peek(57340): rem $dffd/$dffc 710 h$="0123456789abcdef" 720 for i=0 to 3 730 v$=mid$(h$,1+(v and 15),1)+v$ 740 v=int(v/16) 750 next 760 print "version = $";v$ 770 print 780 : 800 i=57248: rem $dfa0 810 x=peek(i) 820 if x=0 then print: end 830 print chr$(x); 840 i=i+1 850 goto 810 860 : 900 rem ------------------------------- 910 rem these are manufacturer-specific 920 rem workarounds, which should be 930 rem replaced with the official 940 rem emulator detection method 950 : 1000 if peek(60682)<>0 then 1100: rem $ed0a 1010 print "c64 software emulator" 1020 print "(c)1991-94 miha peternel" 1030 end 1040 : 1100 if peek(60736)<>0 then 1200: rem $ed40 1110 print "x64 (version 1 or 2)" 1120 print "(c)1993-94 j.sonninen/t.rantanen/j.valta" 1130 end 1140 : 1200 x=57087: rem $deff 1210 if peek(x)+peek(x)+peek(x)<>0 then 2000 1220 print "c64alive" 1230 print "(c)1993-94 f.littmann developments" 1240 end 1250 : 2000 print "this is an original c64 or c128" You can distinquish a real C128 from C64 by testing the VDC status register at $D600/$D601: If the value written to $D601 remains intact, its a C128 in either mode, otherwise a real C64. There is no way (or need) to tell C64 from C64c though. 7.4 Other sources of information. There are a number of WWW addresses that may be of interest... - The Commodore 64 WWW Server. (Has a few c64s and x64 documents) http://www.hut.fi/~msmakela/c64.html - WWW Personal Computing and Emulation Homepage (General emulator pages, not just Commodore) http://www.cs.umd.edu/users/fms/comp/ - Commodore emulation (The Commodore section from the link above) http://www.cs.umd.edu/users/fms/comp/Emulation/Commodore.html - X64 Emulator / Simulator For Unix (Offical site for x64) http://stekt.oulu.fi/~jopi/x64.html - Commodore 64 computing (Home of the comp.sys.cbm FAQ) http://www.msen.com/~brain - Seattle Labs (Marketers of C64S) http://www.seattlelab.com/c64s.htm - Frodo and ShapeShifter Homepage (Official site for the Frodo emulator) http://www.uni-mainz.de/~bauec002 - The Official PC64 Homepage http://ourworld.compuserve.com/homepages/pc64/ + - The Power64 Homepage + http://www.auto.tuwien.ac.at/~rlieger/Power64/Power64.html =========================================================================