C64S - Commodore 64 Software Emulator (C) 1991-1993 Miha Peternel Development news on October 1st, 1993 Unofficial Technical Information This is unofficial technical information on my C64 emulator. It is published to inform the people of the progress done and planned on the emulator. The facts described can be changed soon, but it will help me from a pile of questions I get every day, as my InterNet connection will be lost today. Check comp.sys.cbm and nic.funet.fi to find more news in the future. This document was written in urgency, so I might have forgotten to write down something. Expect more specific information with the next demo. WHAT'S THIS ? C64S is a software emulator of Commodore 64. My aim is to make a 100% emulation of C64. The demo requires 286 (or higher), a PC or 100% compatible with 640K of RAM and VGA. If you don't like the beeper noise, a Sound Blaster helps a lot. And if you have GUS or DAC, check the next demo version. THE FACTS: Emulator status: - 6510 CPU emulation 2 legal instructions are buggy in the demo, now fixed undocumented instructions will work in the final release - VIC emulation on a VGA (320*200*16 at the moment, X-mode in the near future), I'm developing a full screen mode with borders and more VIC features - SID emulation on a PC speaker or Sound Blaster (That sounds COOL!) now developing GUS and DAC support - C64 keyboard emulation with some replacements and some enhancements (PC cursor up is like C64 shift + cursor up, Ctrl-Alt-Del is normal reset, Ctrl-Alt-Ins is brutal reset - resets everything!) ESC will now become restore, CTRL-BREAK will exit user keyboard remapping for all joystick functions - 1541 disk drive emulation (uses original 1541 ROM and PC files for disk images, I have done software for serial transfer of whole C64 disks to PC) a new format with control bytes will be developed X1541 type of connection support soon - C64 tape emulation (uses PC files for images - 1 file for a tape with a header and directory, my magic software and simple connector allow me to read C64 Turbo Tape files directly from PC!) the TapeMaker is available for easy .T64 conversions - CIA timers work, but need major enhancements CAN I BE MORE SPECIFIC ? 6510 CPU Runs in real mode, 386/486 optimized versions only in the future - legal instruction set operates 100% (not in the demo 09A) - illegal instructions operate partially and need to be reprogrammed and optimized due to major enhancements in the emulator - $01 MMU works 100% - IRQ, NMI and RESET redirections ok - the cycles are not yet counted correctly (that's what I do now, so the rasters dependent on CPU speed will look OK) - speed limitation not yet implemented VIC The screen is updated 8 raster lines at a time to provide the highest speed but makes some effects look ugly. Line by line update is my priority at the moment. The screen refresh speed can be slowed down to increase emulation speed on slow machines. Implementation: - text modes - normal and multicolor - graphic modes - hires and multicolor - blank screen - sprites: normal, expanded, multicolor, more than 8 sprites just like on a real C64, sprite/sprite priority ok, sprite/background priority ok, sprite collision works 90% (it's a bug) - hardware soft scroll, allowing to move bad lines 8 raster lines down - shrunk screen - raster interrupts using $D011 and $D012 make possible to split screen, show more than 8 sprites, provide timing... - border sprites and expanded screen can't run on 320*200 (I must turn an X-mode on) New VIC routines are under construction. Full screen with more features !!! SID Sound is synthesized at 8 KHz (max C64 frequence is below 4 KHz). SB output is at 8 KHz, speaker output is doubled (16 KHz) to prevent base frequency noise. Anyway, the music sounds really cool, but you need a fast machine (386-40 or 486-33 MHz) to gain original speed. The GUS will do it's job at 30kHz with less processor utility and DAC will work just a bit faster than SB at 8kHz. Implementation: - all 3 channels - sampled original amplitudes (buggy in the 09A) - original envelope timings - volume control - pulse width modulation but: - no filters - no channel to channel connection yet - no channel 3 output registers (coming soon) CIA 1,2 Keyboard emulation is 100%. Cursor keys emulate joystick(s) - PC joystick routines are nearly done. Timer A works OK. Timer B is a question of time. Day-clock timer works 50%, because I still haven't program some control registers. CIA 2 is only partially emulated: it provides only VIC page selection and NMI flag. Further enhancements on the way. 1541 disk drive Emulator uses original VIC 1541 disk drive ROM, which allows to fully emulate disk drive operations. However, PC floppy units suck, so the disk contents is placed in a file containing original floppy image. C64 to PC goes via serial link (a whole disk at a time). In the registered version the emulator will allow multiple disk images and a nice selection screen. X1541.EXE handles single file transfers if you connect a 1541 to a LPT port. To copy a 1541 disk to a disk image that can be used in the emulator, use ZipCode on your C64 to archive the disk to multiple files, and zip2disk on the PC to extract the disk image from the files. These utilities can be found on ftp.funet.fi: - ZipCode is in /pub/cbm/archiving/c64/*zipcode* - zip2disk.c is a part of /pub/cbm/archiving/cbmconvert-0.9.2.tar.gz C64 tapes Same as disks, the tape files are placed in a PC file which contains a header and directory to allow multiple C64 files to be placed in one PC file. C64 tape to PC goes directly using a simple connector plugged in to the parallel or printer port. Multiple tape files are supported. Tape and file selection is done by a built-in menu. Registered version will include Tape Tools to manage C64 tapes on PC and Turbo Tape to read C64 tapes directly - a connector is really simple - this is the fastest way to transfer files. You can speed up your tape and PC Turbo will still be able to read it. The TapeMaker is published to make the .T64 creation easier. When a new tape format is be done, the TapeMaker will handle the conversions. TESTS: The list are old. They are here just to show that C64S works !! If you have transfered some programs, please send me a postcard with the list and estimated compatibility (will increase with new versions). Or E-mail you list to: Jeff Bryer (jbryer@darwin.mbb.sfu.ca) TESTED PROGRAMS: - Turbo Assembler, ok - Monitor 49152, 32768..., ok - BASIC, ok A FEW TESTED GAMES: - Cybernoid II, ok - Krakout I, II, ok - Out Run, ok - Boulder Dash, 99% - Spy vs. Spy, ok - Spy vs. Spy II, ok - Commando, 99% - Green Beret, ok - Dark Side, ok - lots and lots more - 90% out of 60 tested work ok **** A QUESTION FOR C64 GAME AUTHORS AND COPYRIGHT OWNERS: If there are any game authors outthere who think they have already made enough money by selling their games, why not making the old dusty stuff live again in freeware/shareware ? If so, a written permission would be necessary to spread the files over InterNet FTP sites. I heard some authors don't mind spreading it, but a written permission is necessary to avoid legal troubles. RELEASE: C64S09A.ARJ was only distributed by E-mail to the people that contacted me (if the connection was ok). However it found its way to the BBSes all over the world and I get lots of greetings and new ideas (thanx to all !). I was trying to keep up with answering the messages as soon as I could. The future demo release points might be at: - FTP site nic.funet.fi, Helsinki Finland (/pub/cbm maintained by Marko Makela) - BBS Southwest Music 519-734-6239, Montreal Canada (Scott Deslippe) FINAL 1.0 VERSION: The emulator (called C64S) has been under construction for more than 2.5 years now, the source is 200K 100% assembler. The final version will be 386+ only, though I also have a 286 version now ! It will be released as SHAREWARE ($20) allowing some nice goodies in the registered version: - Tape Tools (to handle C64 tape images on PC) - Turbo Tape (reads C64 tapes directly from your PC with a simple connector)... - CASM - 6510 assembler for DOS with conversion software for the emulator - 1541 connection Might be: - memory expansion - printer support The registered users will get all 1.X versions. If the 2.X versions will be done (for Windows NT or PowerPC), ultra-cheap upgrades will be possible. BACK TO THE FUTURE: At least a 0.99 pre-release will be launched in November as announced. I'm going back home now which means October and November will be very productive months. The main enhancements in sight for now: - line by line screen update to make the intros look better (under construcion) - CPU cycle counter (specific for NTSC and PAL, now done) - CIA enhancements - GUS and DAC support (under construction) - full screen graphics (under major construction) - keyboard remapping and a built in help keyboard map - PC analog joystick support - new setup screen fith config file - D64 selection, path change and more F9 options - maybe something else Even though I am already porting my program to the protected mode I may decide not to do so for the OS/2 and Windoze compatibility reasons. Check the next demo to find it out ! HELP ! Looking for 1541/1571 internal books ! I'll pay to get them, of course. SPECIAL THANX: - Marko Makela for sharing his wide knowledge with me - Mika Nieminen for X-mode and protected mode information - Jeff Gilmour (is it?) for GUS LowLevel Toolkit - ALL THE OTHERS for expressing their ideas helping me make improvements - TO YOU for your interest in my program CONTACTS: Internet E-mail: Miha_Peternel@f102.n380.z2.gnfido.fidonet.org My home address: Miha Peternel Pot v Bitnje 66 64000 Kranj Slovenia, Europe Phone/Fax/Modem: +386-64-311-959 ****CHANGED FROM +386- 4-311-959 !!! E-mail or Fax is preferred. If you are using fax, please call first a normal voice call for confirmation. If you want to call me personally you need to know the pronounciation of my name which is like German Micha or for the English readers try to say "Mi" like "me" and "ha" like in "hard". The "h" is pronounced like "ch" in "Bach". And the appropriate hours are 5-7 pm Central European Time !!! If you're a native English speaker, please respect the fact I'm not. BTW: I also speak some German but not enough for a real conversation.