BBC Model B Emulator Version 0.7. 8/12/97
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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.


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

All code written by me D.C.Devenport (DDevenp666@@aol.com) (c) 1997.
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!).


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.
    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 6th 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 four 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 of this program at :
'The BBC Lives!' - www.nvg.unit.no/bbc/bbc.html

If you use this program, all I ask 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 - using a DFS ROM is NOT
RECOMMENDED - it will do very strange things).

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.).

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

The next release should include sound and joystick support.
It will also include a much needed SLOOOOOOW down feature to run at exact
speed. Look out for it around the end of the year...

I have also started to write an FS, using some routines by Wouter Scholten
(wouters@cistron.nl). 

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

    6502 processor - BCD may still be a bit dodgy (can anyone test this?)
                     Some 'illegal' opcodes still missing (I'm lazy)
    6522 VIA's     - both System and User.
    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          - All registers, although I have yet to pass this on to
                     the sound blaster/adlib ports/PC speaker! (expect a
                     sound release soon)
    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. 

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


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

No sound - if the game you are running plays sound, you will not hear it, but
the game may still pause while playing it.
Scanlines code a bit buggy.
Filing system you can only load at the moment.
     
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 don't draw it yet.
Double buffering not yet enabled - although the code to implement it exists.
This will be added to the graphics modes, but not MODE 7.

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


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...

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
Blagger
Blitzkreig
Castle Quest
Chess - acornsoft
Chess - program power
Chuckie Egg
Cybertron
Dave Devil Dennis
Dr Who and the mines of terror!
Felix in the factory
Firebug
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, Slight problem - you can only pick up the orb on the left - any ideas??
Twin Kingdom Valley
Ultron
Warlords
Wizadore
Zalaga

I might incorporate Tom Seddon's FS - if he is still willing for me to do so.
According to Tom, he is currently re-writing his FS, but "it should be dead
easy to integrate it with any emulator".


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.
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!


WANTED :
~~~~~~~~

Information on how Thrust checks to see if you can pick up the orb. You can
only pick it up on the left in my emulator - strange? Probably a dodgy flag
somewhere...
The correct formula for converting a physical sound frequency into the
values needed by the adlib OPL-2 registers.
Exile - anybody want to send me the BBC 5 1/2" disc?
Money! :)
