BBC Model B Emulator Version 0.9. 12/1/98
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Written by D.C.Devenport.
Copyright (c) 1997. All rights reserved.
EMail : DDevenp666@aol.com
Snail : 40 High Street
        Belper
        Derbyshire
        DE56 1GF
        England


DISCLAIMER:
~~~~~~~~~~~

I will not be held responsible for any damage caused by the use/misuse of
this software. Use it at your own risk. Please DO NOT distribute it with ROMs.
Do not ask me for ROMs, or where to find them. I am sure you know how to
use a search engine, or a least know a man who can.
For some reason I find myself writing www.emulation.net, how bizarre!


RELEASE INFO:
~~~~~~~~~~~~~

All code written by me D.C.Devenport (DDevenp666@@aol.com) (c) 1998.
All rights reserved.
Except TWKUSER.C/H which is public domain written by Robert Schmidt
of Ztiff Zox Softwear, 1992-93. (I know software is spelt wrong and
so does he!).


The DOS Extender PMODE/W is Copyright (c) 1994-1997, Charles Scheffold
and Thomas Pytel. All rights reserved.


The executable archive should contain the following
(and only the following files):
    BBC.EXE     - The virtual BBC Model B machine.
    DCDDFS.ROM  - The filing system ROM.
    README.TXT  - This file
    CHANGES.TXT - History of releases
    M8          - this is the 'mode 8' program out of the AUG simply
    M8.INF        CHAIN"M8" 


This program is the 9th alpha release of an attempt to emulate the total
hardware of a BBC Model B by Acorn Computers. This program is FREEWARE, as
long as the archive is distributed un-altered, with only the above six files
in it. It must not be sold without the consent of the author (which you won't
get).

You will most probably find an up-to-date version and screen shots of this
program at :
My home page - http://members.aol.com/ddevenp666/index.htm
or
'The BBC Lives!' - http://www.nvg.unit.no/bbc/bbc.html, this site is worth
a visit anyway - especially if you want some games.


If you use this program, all I ask in return is that you send me an email
or postcard, and let me know what you think. 

This program is written in C using Watcom 10.6. There are a couple of ASM
portions (Putting mode 7 characters to the VGA card, and stuffing the
graphics mode screens to the VGA card).

According to Mark de Wager 28/7/97, this is 'by far the fastest BBC Emulator
I know'. :)

Have fun - Long may the beeb live on....

Cheers
Dave.


System Requirements:
~~~~~~~~~~~~~~~~~~~~

First you need two files (Don't ask me for them)
OS.ROM    - this is an image of the OS 1.2 ROM
BASIC.ROM - this is an image of the BASIC2 ROM
A 486 or better PC.

Additionally, if you have EXMON.ROM and/or DOCTOR.ROM in the same directory
as the emulator, they will also be loaded. (I suppose you could load other
ROMs by simply naming them DOCTOR.ROM and EXMON.ROM - do not use other DFS
ROMs, they won't work!

This program is has been compiled/optimised for a 486 processor.
It *may/should* run on a 386 - I have not used BSWAP in my assembler
routines.

On my crappy 486-100 it runs at approximately 110% BBC speed - this includes
totally redrawing the screen once every two VSYNC signals (this is normally
25 times each emulated 'second' - but the 6845 registers can be altered to
change the video refresh frequency. Note this is without the -scanlines
option, of the -sb option).

I have mostly rewritten the 6502 core emulation in ASM - but it hardly seems
worth finishing it now.


Hardware currently supported and emulated (correctly I hope) :)

    6502 processor - Some 'illegal' opcodes still missing (I haven't found
                     anything that uses them yet)
    6522 VIA's     - both System and User. Almost completely only the Shift
                     Register is not emulated
    ROM Paging     - both ROMs and 'sideways' RAM.
    ADC Controller - Although I haven't yet bothered transferring information
                     from the PC joystick port to the ADC registers.
    Sound          - Still a bit dodgy - I know not why :(
    6845 CTRC      - Almost entirely.
    Video ULA      - All the standard modes + mode '8' catered for.
    Serial ULA     - Just the cassette motor LED.
    Keyboard       - See below for keyboard mappings.
                     Most keyboard information was gleaned from disassembling
                     the OS ROM... It may be wrong.
                     LEDs Numlock=Casette Motor (LEDs disabled at the moment)
                          Capslock=CAPS lock    
                          Scrollock=SHIFT lock

Running
~~~~~~~

Simply type BBC and press enter - not too hard eh?

Command line options:

-scanlines
  You can turn on scanline drawing with this opition which allows split mode
  screens to appear correctly. Default disabled. Using this option will slow
  down emulation somewhat. Needed to make Rocket Raid work. Also if your
  'man'/ other sprites disappear in games try this option.
  This option is still a bit buggy.
-frameskip##
  ## is a value from 1 to 25 inclusive. Default value is 1.
  Normally VSYNC interrupts occur at 50Hz (50 times a 'BBC' second), every
  other interrupt is ignored. A value of 1 means redraw the screen 25 times a
  'BBC' second and a value of 25 means redraw the screen once a 'BBC' second. 
-sb
  Turn on sound blaster sound emulation.
-noclear
  Stops RAM clearance on break. Even if *fx200,3 etc is used.

WARNING: Do not use the -scanlines and -sb options together, they don't quite
work in tandem yet.

Games/Files to be loaded by the emulator currently need to be located within
the same directory as BBC.EXE.
Currently it only loads/saves files that are in Wouter Scholten's Archive
format (.INF) type files.


Known problems:
~~~~~~~~~~~~~~~

Dont use -scanlines and -sb together, they dont quite work in tandom yet.
Scanlines code may still be a bit buggy.
Filing system only allows Save/Load/*DISK/*DISC/*DIR/*RUN,
*CAT/*HELP/BPUT/BGET/OPEN etc are not implemented at this moment
After BREAK, you may need to type *DIR $ to get stuff to load again. Hard
resets at this time do not reset the current directory.

Aspect ratio not quite correct on MODE 7 (or graphics modes for that matter).
If you manage to 'tweak' a better aspected 240x250x256 please let me know.
(Also my 640x264 x 16 colours mode doesn't yet fill the screen vertically -
again let me know)
No cursor is yet displayed in graphics modes - I simply haven't bothered to
draw it yet.
Sound far from perfect.f

Emulation too slow?! - Mostly written the 6502 core in pure ASM. I will maybe
                       finish this and add it in the next release!!


To do
~~~~~
Add Better sound support
Add joystick support.
Slow down feature.


Keyboard mappings (different from PC)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Beeb    PC

BREAK   f12
f0-f9   f1-f10 (f0 is f10)
up      up
down    down 
left    left
right   right
- =     - 
^ ~     = 
3 #     3 
6 &     6
7 '     7
8 (     8
9 )     9
0       0
DEL     BACKSPACE
COPY    KEYPAD 0
; +     ;
: *     ' (right quote)
@       ` (left quote)
 _     #
SLOCK   NUM LOCK


Keypad 7 and 8 are CAPS/CTRL for zalaga left/right...
Keypad 4 and 5 are DEL/COPY for roadrunner

Also left ALT works for CTRL too! (remember to turn off ALT/CTRL+key
combinations in windows)
SCROLL LOCK - holding this down freezes the emulation, till released

Also F11 allows *LOADing, *SAVEing and also quitting the program.


Some of the games I have successfully ran 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

All the Scott Adams adventures
Alien 8
Arcade action - all 4 games
Arcadians
Atic atac
Aviator
Blagger
Blitzkreig
Castle Quest
Chess - acornsoft
Chess - program power
Chuckie Egg
Cybertron
Dave Devil Dennis
Dr Who and the mines of terror!
Elite - The BBC disk version is 'BEST GAME EVER'
Exile
Felix in the factory
Firebug
Fire Track
Frak!
Galaforce
Ghouls
Hopper
Hunchback
JCB digger
Jet-Pac
Killer Gorilla
KIX
Knight Lore
Labyrinth
Level 9 adventures (most of them)
Match Day
Maze
Mr. Ee
Mr Wimpy
Palace of Magic
Pengo
Pharoahs curse
Positron
Repton
Rocket Raid
Sentinel
Space Adventure
Spy Hunter
Starship Command
Stock car racer
Striker
Syncron
Thrust
Twin Kingdom Valley
Ultron
Warlords
Wizadore
Zalaga


WANTED :
~~~~~~~~

Exile - anybody want to send me the BBC 5 1/2" disc?
A job in the games industry - I know the odd machine inside out :)


THANKS TO :
~~~~~~~~~~~

Robert Schmidt for The BBC Lives!
Tom Seddon, his emulator convinced me it could be done - he also supplied
some information on the 6845. (Good luck with the Williams Emulator)
Nicola Salmoria for supplying the sound chip data sheet.
Charles Scheffold and Thomas Pytel for their DOS extender.
lance@123.co.nz (also Tom Seddon) for supplying a pyhsical frequency to OPL
value formula - not actually used in the end - samples were preferred, see
SOUND.TXT in the source release.
Everyone who has sent me encouragement - you know who you are.

Good luck to all the other BBC emulator authors who have been in touch -
persevere, you will get it up and running - especially that pesky keyboard!
