Duck Hunt - MSX-Lightgun conversion patch
-----------------------------------------
v1.0 (c) 2016 by FRS, all rights reserved

The original game is great, but it uses the Sega Light Phaser directly
connected to the MSX without any adapter. When plugged this way, the Light
Phaser will obtain the ground for its entire circuit from a data pin of the PSG,
which is strongly not recommended. In the long run there's a high probability
to fry the PSG Port3/bit5. Imagine that for the MSX models that have the PSG
integrated into the chipset. With this bit fried, a lot of MSX devices won't
work anymore, like the mouse, touchpad, paddles and even the joymega.


This patch implements the following enhancements and fixes:

- Change the embedded Lightgun driver to the standard MSX lightgun. The
  Gunstick support was also dropped (not enough space in a 8KB ROM).
- The game now passes all MSX AcidTests
- The turbo will be enabled if the CHGCPU routine is present in the BIOS
- A better interrupt handler was implemented
- Both light guns can now start the game. When the 2nd light gun starts the
  game, the two player mode will be selected.

Note: You can still connect your Sega Light Phaser to the MSX, but now you
will have to do it the right way, by connecting it to the gunSMS adapter.
And you're now also able use the NES Zapper with the gunNES adapter.

You can find the schematics to build the light gun adapters in the following
link:
http://frs.badcoffee.info/hardware/lightgun_adapters.html

There's still a bug in the game that wasn't fixed: in two player mode, if both
players pull the trigger at the same time and player-1 misses his shot, the
player-2 sensor won't be checked and will miss his shot too.

==============================
How to apply the patch

First, make sure you have the last release of the original Spanish ROM,
which has the following checksum:

SHA1(DUCKHUNT.ROM)= a6145a658ac51d8f455ac60629ed2d118d50f1ad

This game was released as freeware and can be downloaded in the following link:
http://msxdev.msxblue.com/?page_id=75


You can use the following tools to verify the SHA1 checksum:
- Windows:
  -MD5 & SHA-1 Checksum Utility 1.1
  - HashTab
- Mac OS-X:
  - DropHash
  - HashTab
  - (or use the Linux solution below)
- Linux:
  - Just type on a shell: openssl dgst -sha1 MYGAME.ROM

==============================
Special Thanks

- OpenMSX team, for their excellent emulator and debugger
- MRC crew, for the place where MSX hobbysts can meet and exchange ideas
- Sjoerd Mastijn and Aprisobal, for the SjASMPlus assembler
- FiXato, for compiling many development tools I use on Mac OS-X

==============================
FAQ
---

Q: Will the patched game run on non-turbo machines?
A: Yes

Q: I applied the patch and the resulting ROM doesn't work! What is wrong?
A: You're probably trying to apply the patch on a ROM with the incorrect
   checksum.

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

1) This patch is gratis for non-commercial purposes, and the author retains
   its copyright. You only can run, make backup copies or distribute the patch
   while observing the non-commercial restriction.

2) You are only allowed distribute the patch files (online or on a removable
   media) under the following conditions:
   2.1) No commercial transaction of any kind is involved
   2.2) All the included files are distributed together inside the same
   compressed file.
   2.3) This README must be included unmodified inside the same compressed file.

3) If you want to use this patch for commercial purposes you MUST contact me
   first to negotiate the terms and conditions. Send an e-mail to
   sdsnatcheralpha@gmail.com to contact me.

4) You cannot distribute ROMs with this patch applied on them.

5) This patch 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 patch or the software patched with it.

6) USE THIS SOFTWARE SOLELY AT YOUR OWN RISK.


===========================================================================
                          Donations
---------------------------------------------------------------------------
 If you like the enhancements and fixes here presented and want to show your
 appreciation by donating any amount, or MSX hardware, it will be very welcome
 and will help future developments.
 Donations can be done via PayPal to sdsnatcheralpha@gmail.com, and for MSX
 hardware, try contacting me on this e-mail address too.

 Have a look at my wishlist in the following link:
 http://frs.badcoffee.info/wishlist.html

