







                   Ŀ
                             Ŀ 
                                                              
                        SHARP MZ-800 emulator description.     
                                  Version 1.5                 
                               
                   Ĵ
                         Copyright (c) 1992,3 Perex Soft       
                               All rights reserved.            
                   











   Contents:
   

   1. Hardware requirements
    1.1 Distribution disk

   2. SHARP Components emulation
    2.1 Screen
    2.2 Keyboard
    2.3 Printer
    2.4 Floppy disk drive
    2.5 RAM disk
    2.6 Programmable sound generator
    2.7 AMIGA music files

   3. Debugger
    3.1 Breakpoints
    3.2 Commands
    3.3 Special commands
    3.4 ZX Spectrum emulator cassette

   4. User's tips
   5. Programmer's tips
   6. Configuration file
   7. New instructions
   8. Cassette tape recorder
   9. Future versions


   1. Hardware requirements
   

   Minimal required PC configuration for emulator is follow:

        CPU          : 80386 (PC AT386)
        RAM          : 512kB
        Graphic card : VGA

   also at least one Floppy disk drive (capacity is not interesting).

   Recommended PC  configuration is follow:
        CPU          : 80386  or higher, 25MHz
        RAM          : 640kB
        Graphic card : VGA
        HD           : at least 1MB free space

   and floppy disk drive.


   1.1 Distribution disk
   

   On distribution disk you will find following files:

   SHARP.EXE       -SHARP emulator
   ROM.SHA         -modified SHARP's ROM
   CONFIG.SHA      -emulator configuration file
   CTIMNE.EXE      -viewer for CTIMNE.TXT file
   CTIMNE.TXT      -original user manual
   FROM.EXE        -program for CP/M disk formatting

   If is  option RAM disk in  CONFIG.SHA enabled then file  for 512kB RAM disk
   will  be created  on HD.  It's name  will be  RD.SHA. RD.SHA  file will  be
   created  in emulator  directory. (We   don't recommend  to enable  RAM disk
   option  in case  you are  running the  emulator from  floppydisk, but it is
   possible).  ROM.SHA and  CONFIG.SHA files  must be  in same  directory like
   emulator.


   2. SHARP Components emulation
   

   2.1 Screen
   

   Deviations  have been  found on  some types  of VGA  cards during  tests of
   extended video  RAM from "original"  BASIC and also  INTERKARATE+.
   In MZ700 mode is not solved this problem  up to now: On EGA or VGA card are
   characters displayed in 9 dots. Only some graphics characters are displayed
   in 8 dots. This is the reason of vertical lines on some pictures which have
   been converted to MZ700 mode. Problem will  be fixed when I get really good
   VGA card description. (If anybody has it, offer it to me please.)


   2.2 Keyboard
   

   No deviation  have been found. Some  keys have been moved  to another place
   because of keyboards differences. Moved keys are follow:

   Ŀ
    SHARP    PC            
   Ĵ
    ?        F10           
    ALPHA    ALT           
    GRAPH    `             
    Esc      Print Screen  
   


   Some of keys which are missing on SHARP's keyboard are used for emulator.

   Ŀ
    KEY            FUNCTION                                      
   Ĵ
    F6             Colors on/off                                 
    F7             Sound on/off                                  
    F8             Programmable sound generator emulation on/off 
    PgUp           Volume increase for AMIGA sound               
    PgDn           Volume decrease for AMIGA sound               
    Scroll Lock    Reset                                         
    Esc            Debugger                                      
   


   2.3 Printer
   

   Printer  is   emulated  trough  parallel   port,  which  is   specified  in
   configuration file. (See Chapter 6). No deviation have been found. There is
   not possibility  to emulate printer trough  serial port. In case  you don't
   want to emulate  printer set printer option to zero  (0). This is necessary
   for example for Bruce Lee game because  of wrong transfer of this game from
   Spectrum.


   2.4 Floppy disk drive
   

   Original SHARP FD controller can control up  to 4 drives. PC has usually no
   more than 2  drives. Second pair drives emulation is  done on first pair so
   by this way is possible (if you  have High Density Drives) to use 720kB and
   320kB disks in same time.

      Example: CP/M configuration  A: 720kB; B: 720kB
                                   C: 360kB; D: 360kB

      from the PC this looks like:
               A: 720kB or 320kB (if is in CP/M active A: or C:)
               B: 720kB or 320kB (if is in CP/M active B: or D:)

   Interesting note:
   Never use drives  A: and C: in CP/M  in same time (for example  during copy
   procedure)!!! Your  data can be lost!!!  Also for drives B:  and D: is same
   rule valid.

   If you have in  your PC two different FD (for example  A: 1.2MB and 1.44MB)
   you can change them by configuration file update.


   2.5 RAM disk
   

   RAM disk is emulated on PC's hard  disk. If emulation is enabled 512kB file
   is created during  first start of emulator. If is  no space on HD emulation
   will  not be  run !!!  RAM disk  is created  like backed-up.  This has been
   tested  under operation  system LEC  CP/M by  RDTEST and  Spectrum Debugger
   V1.1R.


   2.6 Programmable sound generator
   

   Emulation is not provided in full range  up to now. (Noise generator is not
   supported  at all.)  Sound emulation  can be  turned on/off  by the F8 key.
   Computer  with  minimum  20MHz  processor  frequency  is recommended. Sound
   emulation is  not possible during disk  reading (almost all PCs).   I don't
   recommend to use sound emulation with the programs which have more than one
   file on CP/M disk (BATMAN, LAST NINJA 2, etc.)


   2.7 AMIGA music files
   

   As background application is possible to  play music files from AMIGA (.MOD
   files, 4  channels). So emulator  has two new  instructions PLAY and  STOP.
   Better  explanation is  in the  chapter 7.  Combination of  AMIGA music and
   Programmable sound generator is not supported.


   3. Debugger
   

   Integrated  debugger  gives  you   possibility  to  stop  executed  program
   everywhere and  anytime. Debugger offers a  few services which help  you to
   convert programs from ZX Spectrum to SHARP.

   You can view the memory simply by using Up, Down, PgUp, PgDn keys.

   If you want to go to specified  address write it's value to status line and
   press Enter only. If address value is specified as a DEC value you must use
   'D' as number prefix  !!! HEX address value must start with  number - so if
   address starts with A,B,..F you must use 'O' as first character.

   In instructions view mode is possible to use simple assembler.
   Only write simple instruction like this:

              For example:    Ready: LD A,B


   3.1 Breakpoints
   

   You can set  breakpoint anywhere - also in ROM.  ROM, unfortunately, is not
   possible to modify. Breakpoint code is 6Dh - LD L,L instruction. Breakpoint
   is possible to set/reset by F2.

   If you want to stop program on current cursor position, press F4.

   Program tracing is possible by F8 key. Subroutines are not traced.


   3.2 Commands
   

   Leading character before the command must be '/'.

   Ŀ
    COMMAND       PARAMETERS             FUNCTION                         
   Ĵ
    C             ----                   Disassembler Instructions view   
                                         mode                             
   Ĵ
    D             ----                   Disassembler Bytes view mode     
   Ĵ
    W             ----                   Disassembler Words view mode     
   Ĵ
    L             ---- or <WHERE>        loads selected .MZF file to RAM. 
                                         If is not specified address      
                                         <WHERE> file will be loaded to   
                                         address specified in file's head.
   Ĵ
    S             ----                   saves the memory area as .MZF    
                                         file (necessary parameters will  
                                         be requested later).             
   Ĵ
    F             <FROM>,<WHAT>,<WHAT>.. finds specified byte string in   
                                         RAM from address <FROM>.         
                                         For example:                     
                                              /F1000,0cd,10,3d,_,10       
                                               - character '_' means some 
                                                 number                   
                                               - finds from address 1000h 
                                                 sequence 0CDh, 10h, 3Dh, 
                                                 ?, 10h                   
   Ĵ
    /             ----                   finds next sequence specified by 
                                         /F command                       
   Ĵ
    K             ----                   ASCII/ SHARP ASCII switch        
   Ĵ
    M             <FROM>,<WHERE>,<LEN>   moves memory area with length    
                                         <LEN> from address <FROM> to     
                                         address <WHERE>.                 
   Ĵ
    H             <FROM>,<LEN>,<WHAT>    fills memory area with length    
                                         <LEN> from address <FROM> by     
                                         byte <WHAT>                      
   Ĵ
    O             <WHERE>,<DOS FILE>     loads the dos file with name     
                                         <DOS FILE> to RAM from address   
                                         <WHERE>                          
   Ĵ
    Q             <WHERE>,<NUMBER>,<CAS> loads block with the number      
                                         <NUMBER> to the RAM from address 
                                         <WHERE> from the cassette with   
                                         name <CAS>. Explanation in       
                                         chapter 3.4.                     
   Ĵ
    V             <ADDRESS>              converts ZX Spectrum VRAM address
                                         to SHARP's VRAM address.         
   Ĵ
    RX            <PAGE>                 selects 64kB memory page on RAM  
                                         disk which will be used by       
                                         RR and RW commands               
   Ĵ
    RR            <FROM>,<TO>            loads RAM disk memory selected by
                                         <FROM>-<TO> to the RAM           
   Ĵ
    RW            <FROM>,<TO>            saves contents of RAM selected by
                                         <FROM>-<TO> to RAM disk.         
   

   Commands without '/' prefix:

   Ŀ
    B=<WHAT>,<WHAT>...    writes bytes specified by <WHAT>,<WHAT>...   
                          to RAM from actual cursor position.          
   Ĵ
    A=<STRING>            writes to RAM 'ASCII' string <STRING>.String 
                          will be stored as zero terminated.           
   Ĵ
    S=<STRING>            writes to RAM 'SHARP ASCII' string <STRING>. 
                          String will be stored as zero terminated.    
   

   In parameters where is byte or address required is possible to use +, -, *,
   and / operators. Also is possible to use register name (AF, BC, DE, HL, IX,
   IY, SP, PC,  A1, B1, D1, H1). If  you want to use register  name in address
   specification for disassembler set point use  the sequence 0+ as prefix. Is
   not possible to use parentheses  in the statements. Statement evaluation is
   always from right to left !!!

    Examples:       10+PC           ;sets the actual address to PC + 10h
                    /V4000+d18      ;converts address 4012h to 8016h


   3.3 Special commands
   

   Ŀ
    KEY      COMMAND                                          
   Ĵ
    F1       Partial emulator status                          
    F2       Breakpoint Set/Clear                             
    F4       Stops program on cursor position in debugger     
    F5       SHARP screen view                                
    F6       ZX Spectrum screen view                          
    F7       Executes one instruction                         
    F8       Executes one instruction. If is instruction CALL,
             emulator will break after subroutine executing.  
    F9       Start emulation                                  
    F10      Sets PC register to cursor position address      
   


   3.4 ZX Spectrum emulator cassette
   

   "Cassette"  means DOS  file with  extension .SPC.  In this  file are stored
   program  blocks  (head,  program  etc.).  This  file  type uses ZX Spectrum
   emulator developed by authors from Poland. If you  want to work with  these
   "cassettes" I will send you their description on your request.


   4. User's tips
   

   - there is  not possible to format  CP/M disks under emulator.  Disk can be
   formatted under DOS by FORM.EXE program.

   - DOS disks is not possible to use under CP/M because of their other format
   (CP/M SHARP only)  !!!. But is possible to  read them and write them by the
   XDOS program under CP/M.


   5. Programmer's tips
   

   - most of programs have been developed under emulator had  problem with the
   timing.  For this  reason is  best way  to finish  development directly  on
   SHARP.

   - Because  of easy  decode method  you must  to write  some instruction  in
   assembler as operation code - by B= command.

     For example instructions: RLD, RRD etc.


   6. Configuration file
   

   In configuration file you can set following parameters:
   Ŀ
    DRIVE=<X>        <X> - 0 disks A: and B: are normal                
                         - 1 disks A: and B: are swapped               
   Ĵ
    AMUSIC=<X>       <X> - 0 PSG emulation (Amiga music) is disabled.  
                           For slower PCs.                             
                         - 1 PSG emulation enabled                     
   Ĵ
    AFREQ=<X>        <X> - frequency for PSG emulation (from 16000 to  
                           23000). Best results are around 22000 - but 
                           it depends of computer speed - 22000 is     
                           good for PCs over 25MHz.                    
   Ĵ
    HRDWR=<X>        <X> - hardware specification for Amiga music or   
                           PSG emulation.                              
                           0 - PC speaker                              
                           1 - D/A converter on LPT1                   
                           2 - D/A converter on LPT2                   
   Ĵ
    RAMDRIVE=<X>     <X> - 0 - RAM Disk will not be emulated           
                           1 - RAM Disk will be emulated               
   Ĵ
    LPT=<X>          <X> - port for Printer emulation (1-4), If 0 is   
                           specified printer will be not emulated.     
   Ĵ
    VGACOL=<X>       <X> - standard is 0. If you will have trouble     
                           with colors, try 1.                         
   Ĵ
    S256=<X>         <X> - for classic CP/M disks 0, if disks are for  
                           example from BETA DISC CONTROL SYSTEM 3 so  
                           here must be 1.                             
   

   Standard configuration file (CONFIG.SHA):

   DRIVE=0
   AMUSIC=0
   AFREQ=16000
   HRDWR=0
   RAMDRIVE=0
   LPT=1
   VGACOL=0
   S256=0

   Parameters order  doesn't must to be  same but values must  be in specified
   range. Configuration file can be edited in any ASCII editor.


   7. New instructions
   

   Ŀ
    CODE   NAME           DESCRIPTION                                     
   Ĵ
    ED,FA  PLAY           DE register must point to music module name     
                          from Amiga. Name must to be in ASCII and        
                          terminated by zero. Music plays on background.  
                          CY=1 - error.                                   
   Ĵ
    ED,FB  STOP           Amiga music stop.                               
   Ĵ
    ED,FC  LOAD PRG       HL - where, BC - length. Loads file or it's     
                          part to RAM. This instruction can be used after 
                          LOAD HEAD or LOADS HEAD only. CY=1 - error (is  
                          possible to use this instruction for .MXF files 
                          only).                                          
   Ĵ
    ED,FD  WAIT           waits for key press                             
   Ĵ
    ED,FE  LOAD HEAD      HL - where, DE - filename pointer. Filename must
                          be in ASCII and zero terminated. Loads head of  
                          MZF file to RAM from address specified by HL.   
   Ĵ
    ED,FF  LOADS HEAD     HL - where. Loads head of MZF file to RAM.      
   


   8. Cassette tape
   

   SHARP cassette tape emulation is not  supported. If you press <C> (Cassette
   tape) in  main menu after  emulator restart you  will get the  list of .MZF
   files in actual  directory. You can move trough files  by cursor keys. File
   will be loaded to emulator after press <ENTER>. You can cancel operation by
   <Esc> key. MZF  file structure used by this emulator  is same like MZF file
   used under CP/M. By the XDOS program  is possible to convert CP/M MZF files
   to  DOS MZF  files or  execute them  directly from  CP/M disks. Multiblocks
   games must be of course patched.


   9. Future versions
   

   Emulator development is  totally stopped now. I don't  suppose that it will
   continue.  I don't  feel like  it and  I haven't  money for  it. If anybody
   skilled is  interesting in source code  of this emulator so  I will give it
   him/her  for  1000,-Kc  (~30,-  USD).  Please  note  that  this  value is
   symbolical  only.  I'm  not  sure  if  is  possible  to get somewhere 450kB
   assembler and Borland C++ 3.0 source code for this price.

   Epilogue ...

   I would  like  to  say  thanks  to  RDOS  SOFTWARE  and MICROCODE for their
   cooperation and support with necessary materials.

   Currently emulator has  about 450kB source code -  more in assembler (SHARP
   emulation) and rest is C source code (debugger etc.). If I want to estimate
   time spent by development so it is  perhaps 5 months. The time for study of
   PC hardware which emulator uses is not calculated. Some programmer's tricks
   I got from  VGA BIOS because  there were no  description in any  literature
   I got.
