

                     The Minus/4 Emulator V1.6.2!
                   Copyright Mike Dailly 1996,97,98

                           With help from 
                             Tibor Biczo


			     E-Mail me on
		       mike@scotch.demon.co.uk


		  The latest relase can be found at
			www.scotch.demon.co.uk




			      DISCLAIMER


	 THE BORING BIT! THIS PRODUCT IS FREE. AND AS SUCH I
	 ACCEPT NO RESPONSIBILITY FOR ANY DAMAGE DONE BY THIS
	 PRODUCT. IF YOU USE IT, ITS YOUR FAULT. IF SOMETHING
	 HAPPENS COZ YOU USED IT, ITS YOUR FAULT. IF THE EARTH
	 EXPLODES WHILE YOU USE IT, IT'S YOUR FAULT. IF I HAVE
	 A BAD DAY COZ YOU USED IT. YOU GUESSED IT - ITS YOU'R
	 FAULT! ALL IN ALL - YOU USE IT AT YOUR OWN RISK!


	  --------------------------------------------------
	  | Please see the history.txt file for whats new. |
	  --------------------------------------------------




     What IS this thing I've just downloaded!
     ----------------------------------------

     Well, simply put - This is an emulator, that trys its best	to 
     emulate a Commodore Plus/4 On an IBM compatable PC. Theres loads
     of info and games available at ftp://ftp.funet.fi/pub/CBM/plus4
     if you want some more information, then drop by my homepage at
     http://www.scotch.demon.co.uk




     How do I use it!
     ----------------
     Well, the first thing you'll need to do, is get ROMS required to
     run it. These are "c16basic.rom" "c16kern.rom" and "c16char.rom"
     There is also the built in 3-plus-1 ROMS. 
    
     These are all available from ftp://ftp.funet.fi/pub/CBM/plus4 or 
     "http://www.scotch.demon.co.uk"

     The ROMS must be called "3plus1lo.rom" and "3plus1hi.rom" for Minus4
     to find them.

     NOTE: You will need a mouse driver loaded to access the menu
           inside the emulator. 




     Loading a Game
     --------------
     Theres a few ways to load games and other programs into minus/4,
     the simplest is a .PRG file.


     .PRG
     ----
     Once you have loaded the Plus/4 emulator, press F10 to get to the 
     loading menu. Once a game is Loaded, it will have to be "RUN", 
     so type "RUN" and thats all!


     .D64
     ----
     You can also load .PRG files from inside a .D64 disk image using
     the same method, pressing enter over a .D64 image will present
     you with a new directory of inside the disk, now simply select
     the file and press enter... then run it as usual.
     
     See the section on "Disk Simulation" for real floppy file loading.


     .TAP
     ----
     You can also load real tapes, this is a bit tricky. But, if you sample 
     a whole C16/Plus/4 tape, you can use F8 as the cassettes PLAY button. 
     You must sample the tape at 44100Khz, 8bit mono. Minus/4 also simulates 
     the cassette motor, allowing pauses when "FOUND ?????" is printed. 
     As with the real thing, run/stop will halt the load. Tape files are 
     named "*.TAP" and can be selected by pressing F10. There are a few 
     "tweeks" to help loading, using -1 to -5 allows the edge detection to 
     be tweeked in a similar manner to the tape head screw on the actual 
     data cassette. Once loaded, and running, you can "freeze" the 
     program using F9 (see below), or set a breakpoint and save from
     raw memeory the monitor.


	
     How do I quit!
     --------------
     To quit, press "ALT+BREAK" this should return you to dos.
     If your in windows...it probably wont! 
     Windows grabs the ALT key - try and exit through the monitor.





     Command Line Switches
     ---------------------
     -x    = Enable mode X. Use 360x240 mode. 20 pixels of border
             area are shown.

     -X    = Enable mode X 50Hz mode. As above, but on VBLANK syncing
             will run smoothly at Plus/4 speed. You'll need to disable
             sound for and timers for this to work correctly.

     -c    = ModeX copy mode 2. Theres 2 ways of copying data to the
             screen in modex, try the, both and select the best for
             you. If you don't notice an improvement or speed up,
             just ignore this option.

     -a    = Disable all audio. No sounds will be played

     -t    = Disable timer. Don't sync to Plus/4 speed. makes it go
             FULL rate! FLAT out
 
     -v    = Sync to monitors refresh rate. syncs to the vertical
             blank. Faster than a Plus/4 but will look very smooth.

     -d    = Start in the monitor. Don't boot the kernal.

     -s    = "DISABLE" Sample playing through a Sound blaster.

     -l    = Will disable the "loading bar" on DISK emulation

     -S    = Switch off symbol table in debugger

     -D <dir>  = Specify a root games directory

     -P <.prg> <runcmd> = AUTO run a program "minus4 -p game.prg run" 
                          will load and run a game.

     -L <.LST> = Source level debugging text file. (see below for
                 details).

     In Emulation Mode
     -----------------
     F6        - Toggle "scale screen" mode (320x200 only)
     F7        - Pop up options window
     F8        - Press PLAY on tape (when a .TAP file has been selected)
     F9        - "FREEZE" current game. saves as test.fre
                 exit and rename the file to whatever you want.
                 (a file requester will be added later)
     F10       - Load Game
     F11       - Monitor
     F12       - Reset
     Shift+F12 - Force reset to Basic 




     The Monitor
     -----------
     F1    - HELP
     Escape- return to full speed emulation
     F12   - reset Plus/4 (also exits monitor)
     F5    - View frame
             Space = render next scan line. Actually processes a
                     scan line of 6502.
	     Enter = process next FRAME.
             Escape= return to debugger.
     F6    - Save current view. type in a name.bmp then press
             enter. Remember DOS filenames!
             Also remember that it saves the CURRENT view. So, if
             you were view the display, and pressed space for a
             while, it will save 1/2 this and 1/2 the last frame!
     F9    - Trace FAST
     Enter - Trace SLOW
     M     - Dump memory
     B     - SET break point
     G     - set PC to address
     s     - Save memory
     S     - Save .PRG
     d     - disassemble to file
     Q     - Quit program (back to DOS)

     For more keys press "F1" (help) inside the monitor




     Joystick!
     ---------

     In the options window, you can enable/disable the joysticks and 
     calabrate a real joystick/joypad. Both use the cursor keys and 
     SPACE. A redefine option will be added later. 




     Sound
     -----
     Plus/4 sound is emulated via the AdLib or Soundblaster compatable
     sound card. You can disable audio with the "-a" command line and
     "-s" command line options.




     Disk Simulation
     ---------------
     Only device 8 is simulated. Theres a lot or restrictions just
     now, which should improve with time.

     Using the disk system:

	The "LOAD" commands now works, but before using it you must
	select a .D64 file to use! (this is VERY crude just now...)
	Select a .D64 file and load a file from the disk (the first
	one is usually the one loaded with Load"*",8 anyway) once
	this is done the disk system uses this file as the current
        device. 

        If you do NOT select a .D64 file first, then all disk access
        is based round the GAME directory. (see command line options)
        even the DIRECTORY command will take the harddisk's directory
        and create a "fake" plus/4 disk image...


	"SAVE"  Should work fine. Filename must be something like 
                "name.prg" so emulator will see it again.
	        Or try using the FREEZE (F9 in emulation mode) instead.

        "SEQ" files? Seem to be working... Signals #8 works.
     
        "USR" files? I have no idea... :-) I'll work on it...


     Hacks:
	In order to "help" load more games, the load vector is
        hardwired to the normal load routine. Why? Since almost ALL
	Plus/4 games and demos use turbo loaders, almost nothing
	worked. But, by hardwiring this vector many things now do.

	This isn't to say that its just a very botched disk system.
	I do intercept the disk commands via $FEF0 and attempt to 
	decode them. But most turbo loaders go direct to $01 and get
	the bits directly.. $01 doesn't work at all.

        Many multi-loads work, many don't. This will hopefully get
        better.. 





     FREEZE file format
     ------------------
	Address		2 bytes
        Version         2 bytes
        PC		4 bytes 
	Flags		4 bytes 
	A		4 bytes 
	X		4 bytes 
	Y		4 bytes 
	SP		4 bytes 
	RomsPaged	4 bytes
	Rom in/out	4 bytes 
	cTimer1		4 bytes
	Timer1		4 bytes 
	Timer1_LO	4 bytes
	cTimer2		4 bytes
	Timer2		4 bytes 
	Timer2_LO	4 bytes
	cTimer3		4 bytes
	Timer3		4 bytes 
	Timer3_LO	4 bytes
	Memory		$10000 (64k)

     For more details please look at 6502.c and disk.c
     Memory will be expanded at a later date when the 256k memory
     system is added.




     SOURCE LEVEL DEBUGGER V0.1
     --------------------------
     The output is the TASM assembler output. If you use that, you
     can use it directly. TAB stops are at 16 and 21 then every 5
     after that. That gives 16 character labels, and then
     "LDA  MORE..." comments are up to you to format...

     COLUMN
     0      7    12             25  ---> TEXT to display
     -----------------------------
     0108   208F 3E 22 2E    	rol	CharAddressH,x			; bitmap address
     |      |    |
     |      |    Opcode bytes
     |      |    |
     |      Hex Address
     |
     Line Number

     I will try to provide an example and a framework.




     Whats NEXT!
     -----------
     a WATCH window for variables in the source level debugger
     also being able to set breakpoints on LABELS

     Add a user interface! Its getter important one is added! 
     (half done)

     256K memory emulation. 
     
     One day I'll write the Cursor routine correctly! <g>

     I'd also love to map the PC's serial and parallel ports on to
     the Plus/4's User port!! That'd be really neat!

     I've gotten a hold of the OS96 from solder, so I may add a
     boot menu as well. If I get it working!
     (This DOES run just now! If you replace the C16Basic and
      C16Kern ROMS!!)

     PAL/NTSC switch! ($ff07 - bit 6, $40)

     Any suggestions are welcome!! Honest!! Really!! Send some!! 





			      Thanks To
			      ---------

     "Tibor Biczo" for the help in the real tricky stuff.
     "Marco Polo" for the CD full of really neat and helpful stuff!!!
     "SOLDER" for his fantastic SID card! and the help on OS/2
     "Kreuz" for all the helpfull info on his Homepage!
     "Luca/FIRE" for pointing out some WORKING non-standard opcode stuff
     "Karoly" of Delta Systems for beta testing!
     "Thomas Koenig" for his help in general.


     In fact, loads of ex-plus/4-scene guys, for being great in general!



     THATS ALL FOLKS!
     ----------------
     
     e-mail me if you have an idea or question, I'll try my best to answer.

     

		      --------------------------
		      | KEEP EMULATORS FREE!!! |
		      --------------------------




