MSX2newdrv
----------
- The original MSX2 BIOS is (c) 1985 by MSX Licensing Corporation
- Updated parts (c) 2020 by FRS

== Overview ==

This is an updated version of the MSX2 BIOS (v2.2) that includes the same high
performance drivers of the TRnewdrv, as well as many other improvements,
including a new driver for the V9938 light-pen interface that allows this
device to be connected to the joystick port-2 (requires a small hardware mod,
see the Joyport2_Lightpen_mod.png file).

The following parts of the BIOS were updated:

1) New optimized drivers for:

  - Mouse
  - Trackball
  - Touchpad
  - V9938 Light-pen on joystick port-2
  - Much faster GTPAD functions n+1 and n+2

2) Modernized function keys default text, to be more useful on a daily basis:

  - F1  = copy
  - F2  = files
  - F3  = goto
  - F4  = list
  - F5  = run+<ENTER>
  - F6  = color15,4,7   (color 15,4,4 on European version)
  - F7  = load"
  - F8  = _chdir("")
  - F9  = save"
  - F10 = <CLS>+run

3) SETSCREEN now also saves the current screen Hertz selection on the RTC

4) Added the missing P command to the BIOS GML routines (used by the command
   DRAW). This command paints a drawing with the current color, and has the
   following syntax:
  - P<boundady color>

5) New bootlogo code, with many improvements:

  - Much more compact than the original
  - The MSX logo raise speed is now adjusted when played on 50Hz, to match the
    same speed as NTSC machines
  - Honors the hertz and interlace/progressive mode settings saved on the RTC
  - New colors on the bootLogo. Now only the background color changes with
    the SET TITLE options, between red, green, blue and orange. No more
    hideous color schemes that nobody liked to use.   ;) 

== Detailed info ==

- The MSX-BASIC version number is updated to 2.2
- Touchpad
  - This driver is much faster than the original
  - It doesn't freeze when it's called and there'sa mouse is connected to the
    port, unlike the original driver.
- New mouse/trackball driver: it's also faster than the original, with many
  juicy features:
  - The mouse and trackball drivers are now independent. This results in much
    better performance. The main routine will detect the type of the device
    internally call the appropriate driver accordingly.
  - The driver now supports disconnect detection. It will both report the 
    disconnection to the client software, and will also keep the reported
    offsets at 0. This fixes the runaway mouse pointer issue that happened with
    the original mouse driver when no mouse was connected.
  - Added support for the Nyyrikki & Prodaton extended mouse protocol that
    has support for a mouse wheel. The GTPAD BIOS function was modified to
    return the extra information as follows:
    - Functions 12 and 16 will now return the following status:
      - bit0: button 3	; 0=pressed, 1=not pressed
      - bit1: button 4
      - bit2: button 5
      - bit3: reserved for future use. Might be random for now. Must be masked
        out from readings
      - bit4: button 1
      - bit5: button 2
      - bit6: 0=Mouse/trackball is disconnected. 1=It's connected.
      - bit7: 0=New mouse driver, 1=old mouse driver
    - Functions 15 and 19: mouse Z offset (usually the scroll wheel) 
  - The trackball driver now converts the angle of the ball rotation to a linear
    offset. This results in much better responsiveness. The original driver
    had such terrible resolution that the user was forced to spin the ball
    wildly to make it reach any point on the screen. Test it on Philips Video
    Graphics or Graph Saurus to see the difference.
  - New V9938 Light-Pen driver
    - Allows a Light-pen to be connected to the joystick port2. Requires a
      very simple mod to connect the interface to that port
    - Adds the CALL ADJUST command to the subROM, to initialize the Light-pen
      interface
    - Behaves like the V9938 light-pen driver present on Daewoo machines, but
      it's faster and also works on 60Hz. This allows development of light-pen
      software without requiring you to buy rare and expensive Daewoo machines
    - Enables the light-pen interrupts when CALL ADJUST is called, otherwise
      the light-pen doesn't work on 60Hz video frequency. You can disable the
      interrupts (this will limit it only to 50Hz usage) if you want to
      simulate the Daewoo interface
    - Allows the usage of two light-pens simultaneously (V9938 and Sanyo). The
      original driver present on Daewoo machines had a bug that caused this
      configuration to malfunction

== Usage ==

You have to burn a new EEPROM, Flash or UV-EPROM chip with the BIOS ROM files
contained in this ZIP package.

The ZIP package contains the following files:

a) README.TXT: this file

b) MSX2 BIOS+subROM in separate files, for Japanese machines
   - MSX2JP_mainbios-basic.rom
   - MSX2JP_subROM.rom
   If your machine combines the parts on a single ROM chip, you'll have to
   combine them in the same sequence to be able to burn to an EEPROM or
   UV-EPROM chip. I made a pre-packaged file for FS-A1 owners, see below.

c) MSX2 BIOS+subROM in separate files, for European machines
   - MSX2EU_mainbios-basic.rom
   - MSX2EU_subROM.rom
   If your machine combines the parts on a single ROM chip, you'll have to
   combine them in the same sequence to be able to burn to an EEPROM or
   UV-EPROM chip.

d) MSX2 BIOS + subROM + A1 Deskpac + MSX-BASIC Kun v2.1
   - FS-A1maskROMnew.rom
   This is merely a convenience for Panasonic FS-A1 owners. All parts are
   already combined into a single ROM ready to be burned on an 128KB EEPROM like
   the ST29EE010.

   The Deskpac is patched to only be activaded on boot if the following
   combination of keys are pressed:
   - SELECT+DEL to run the Deskpac
   - SELECT+ESC to start the Deskpac initializing the RTC with defaults

   If you don't want the built-in Deskpac, just burn the first 64KB part of the
   file to a W27C512 EEPROM, or 27C512 UV-EPROM. Sony HB-F1 / HB-F1 II owners
   can also use this trick.

== FAQ ==

Q: Can I use this BIOS in other MSX generations?
A: It's meant to be used on MSX2 computers only. It won't work on MSX1
   computers at all, and on MSX2+/TR computers you'll loose support for the
   new features of those machines. And the V9938 light-pen interface was
   removed from the V9958 VDP.

Q: I have a homebrew/modded MSX2 computer with the V9958 VDP. Will this BIOS
   work on my machine?
A: It will work just fine as long as your machine already works with the
   standard MSX2 BIOS. but you just won't be able to use the light-pen
   connected to the joystick port-2. But since you have the V9958 VDP, why
   don't you upgrade it to MSX2+ anyway?

Q: Does this BIOS work on absolutely any MSX2 model? 
A: Some very high-end MSX2 models have custom versions of the MSX2 BIOS, with
   specific drivers to support extra internal devices light digitizers,
   superimposers, HD64180 CPU,  etc. If you install this BIOS on such machines,
   these special devices might stop working since their custom drivers for
   them won't be present.
   IOW, it's recommended to use this BIOS on plain-vanilla MSX2 models that
   have no special devices inside. The majority of consumer machines fit in
   this category.

Q: Can I use the mentioned devices in MSX-BASIC?
A: Yes. Both GTPDL and GTPAD work normally on MSX-BASIC as PDL(x) and PAD(x)
   functions, as expected. This means that you can use any of the new features
   on MSX-BASIC too, including the light-pen.

Q: If I don't like this version of the BIOS, is it possible to uninstall it
   from my machine?
A: Yes, all you have to do is to remove the new EEPROM chip and reinstall the
   original ROM chip on the same socket.

Q: Where are the drivers loaded? Will they use any extra RAM from my MSX2?
A: The drivers are part of the MSX2 ROM. They'll not use any additional RAM. 

== Changelog ==
v2.2: Initial release

== Thanks and Credits ==

Without the valuable help of these friends, this project wouldn't ever be
possible:

- Werner Kai, for his quest to find me a Sony GB-6 trackball.
- Manuel Bilderbeek, for donating a Philips NMS-1150 touchpad.
- Erik Luppes, of www.msxinfo.net, for donating a rare Sanyo MLP-001 Lightpen.
- openMSX, team for this emulator and its debugger

===========================================================================
	                     License
                           Terms of use
---------------------------------------------------------------------------

1) This software is gratis for non-commercial purposes, and the author retains
   its copyright on the new parts that were added/replaced. The original MSX2
   BIOS is copyrighted by the MSX Licensing Association.

2) You are allowed distribute this software as part of a hardware, if
   the permission granted by Mr Nishi, on behalf of the MSX Licensing
   Corporation

3) This software is provided ‘as-is’, without any express or implied warranty.
   In no event will the author be held liable for any damages resulting from the
   use of this software.

4) USE THIS SOFTWARE SOLELY AT YOUR OWN RISK.

===========================================================================
                          Donations
---------------------------------------------------------------------------
 If you like this software and want to show your appreciation for the time
 invested making it, you can donate any amount, or MSX hardware, and it will
 be very welcome and will help future development.

 Donations can be done via PayPal to sdsnatcheralpha@gmail.com, and for MSX
 hardware, try contacting me on this e-mail address too.
 For a hardware wishlist, please check:
 http://frs.badcoffee.info/wishlist.html

