                               Law of the West
                          English Translation Patch
                 by GAFF Translations (pluvius3 @ gmail.com)
                       v1.00 (Created August 27, 2020)
--------------------------------------------------------------------------------


*TABLE OF CONTENTS*
 -----------------

I.    VERSION HISTORY
II.   INTRODUCTION
III.  INSTRUCTIONS FOR USE
IV.   KNOWN BUGS
V.    CREDITS
VI.   TECHNICAL NOTES
VII.  ACKNOWLEDGEMENTS AND CLOSING WORDS


********************
I.  VERSION HISTORY
********************

v1.00 (08-27-20):  First release.


******************
II.  INTRODUCTION
******************

This is an English translation patch for Law of the West, published for the
Famicom in 1987 by Pony Canyon and developed by the prolific "ghostwriting"
studio Tose.  It is a port of the eponymous game published for the Commodore 64
in 1985 and the Apple ][ in 1986 by the American developer Accolade.  The
original game is a short, complex dialogue-driven adventure game in which the
protagonist is a sheriff of an Old West town who has to deal with its assorted
cast of residents and visitors--preferably without getting shot.  While the port
keeps the original's complicated dialogue trees (64 possible outcomes for each
of 11 NPCs), much of the scoring complexity (where you could get points for
handling situations and enforcing the law peacefully and lose them for needless
violence, among other things) has been lost.  As poor recompense, a number of
pointless and sometimes-irritating arcade elements have been added.  I honestly
can't recommend this port to anyone except to get an idea of whether or not
playing the original game would be worthwhile; even what scoring elements the
port has don't correspond well with the scoring in the original.

As with a number of my previous hacks, this patch was created for Psyklax's
translation project for early Famicom games.  As with the Mississippi Satsujin
Jiken patch specifically, this patch uses the original game's English script in
lieu of retranslating the essentially identical Japanese script.


***************************
III.  INSTRUCTIONS FOR USE
***************************

1.  Download and install Floating IPS or a similar BPS patcher if you haven't
    already.
	
2.  Get a copy of the Law of the West ROM.  No, I don't know where.  The correct
    ROM is identified by GoodNES 3.23b as the standard Japanese dump.
	
3.  Apply the desired patch to the ROM using the aforementioned BPS patcher.


****************
IV.  KNOWN BUGS
****************

None at this time.  This patch actually fixes some scripting bugs introduced by
the port where some dialogues that should have caused you to get shot did not,
and vice versa.

Please note that versions of FCEUX earlier than 2.2.3 do not support this patch.
It has been confirmed to work with the most recent versions of both Nestopia and
Mesen.  Hardware support for the patch is unknown at this time.


***********
V.  CREDITS
***********

Rob "Pluvius" Browning: Hacker, editor/tester
Alan Miller: Original script


********************
VI.  TECHNICAL NOTES
********************

As this game uses the same mapper as Outlanders, the difficulty of expanding it
was largely the same.  Where Law of the West stands out is in how it does its
text.  Due to the heavily branching nature of the dialogue, Law of the West uses
nonstandard pointers that mostly consist of pointers to other pointers
representing the four possible outcomes of any given dialogue instance.  This
necessitated writing a custom dumper for the text.  Surprisingly, once I
realized that I could use a stack implementation to write a recursive program,
I had a perfectly working solution for what I thought would be the hardest part
of the hack almost on my first try.  It was actually more difficult to get the
script from the original game; the C64 version uses a 5-bit FBLE and the text
is scattered all over the disk in a way which I never did figure out, while the
A][ version is obfuscated by the insane video output engineering that Steve
Wozniak implemented in that syatem.  I ended up having to copy-paste each line
of dialogue individually as it was outputted to the C64's video memory.

Outside of the above, the only other difficulty was changing Law of the West's
dakuten handling into a line break.  This port has a strange way of handling
text output; first, it prints the line of text without dakutens, then, on the
next frame, it prints the dakutens.  Because of this split between frames,
changing the subroutine to print a second line was tricky and represented most
of the time spent on hacking the game itself.  Beyond that and the expansion,
things were pretty simple; the game already contains a full English font that
just needed to be inserted into the appropriate place, very little text outside
of the main dialogue block needed translation, and the final testing only
required a couple of hours.


****************************************
VII.  ACKNOWLEDGEMENTS AND CLOSING WORDS
****************************************

Thanks to:

Tose, for developing this game.

Pony Canyon, for publishing this game.

Nintendo, for making the system this game runs on.

Psyklax, for working on translation hacks of early Famicom games and inspiring
me to do this one.

abw, for developing abcde, a script utility that made editing the main blocks of
text very much less tedious.

KingMike, for creating Nflate, the utility that automated the grunt work of
ROM expansion.

The developers of FCEUX, the very useful debugging emulator which the hacker
used for this entire project.

Romhacking.net, for hosting this hack and many others like it, as well as
providing useful hacking information.

The NESDev Wiki, the premier resource for NES hacking information.

And, of course, you for reading and playing.

Questions, comments, criticisms, and bug reports can be sent to
pluvius3 @ gmail.com (without the spaces obviously).  Please put "Law of the
West" or something similar in the subject line so I will know what the email is
about. If you alert me to a bug, I will fix it in a future update and give you
credit.

This work is licensed by GAFF Translations under the CC BY-NC 4.0 License.
(https://creativecommons.org/licenses/by-nc/4.0/)