     Atari Jaguar Encryption brought to you by:
      Glenn Bruner    &    Classic Gaming Expo
  (glenn_b18@yahoo.com)     (www.cgexpo.com)

1/27/01

             Encrypting Jaguar ROMs
      By: Glenn Bruner (glenn_b18@yahoo.com)


Enclosed in this Zip archive is the universal cartridge validation
for the Jaguar.  The file is called UNIV.BIN.

This validation code has been tested by me on various game
cartridges.  The following is the test procedure I did to verify
the code:


1.  I first loaded a game ROM image (with it's existing encryption)
onto an Alpine board and ran it with the original Jaguar boot ROM
and verified that it worked.

2.  Next I modified a single bit in the ROM image (somewhere beyond
memory location $802000) and re-ran the game.  Verified that
encryption failed.

3.  Next, I replaced the first 8k with the universal patch.  Re-ran
the game and verified it worked.


This testing was done on several Atari games (Dino Dudes, Ruiner
Pinball, White Men Can't Jump, Phase Zero, Kasumi Ninja, and Brutal
Sports Football).  Each worked without a hitch.  In fact, some of
the games that had long startup delays ended up starting a little
faster.

This patch resides in memory locations $800000 to $801FFF of the
Jaguar cartridge memory.  The total length is 8,192 ($2000 hex)
bytes.  The actual part of the patch is just 1,036 ($40C) bytes in
length.  The remaining part of the cartridge memory ($80040C to
$801FFF) is filled with $FF (255 decimal).

------------------------

How to combine a cartridge ROM image with UNIV.BIN (instructions
for use under DOS prompt in Windows 98 SE):

*NOTE:  Cartridge image file must be a binary image file that is
a binary dump starting at Jaguar memory location $802000.  The
binary image file doesn't necessarily have to be a complete 2MB
or 4MB image, but it will be helpful if you plan on eventually
making EPROM image files.  Be sure that you're working on copies
of the files and not the only copies you have.  This procedure
will not work for files that are .ABS, .COF, or .JAG files.  Those
files contain file size and loading information that doesn't
belong on a cartridge binary image.

1. Entire the DOS PROMPT program from the Windows 98 Start Menu
and change directory (or drive) to location where you have the
cartridge binary image and UNIV.BIN stored.

2. Use this copy command to append the cart image:

copy univ.bin/b + image.rom/b cart.rom/b

The /b's are necessary to tell DOS to do a binary append and
the '+' is necessary also.  Replace image.rom file name with the
name of the cartridge binary you're appending to the universal
patch.  Also, replace cart.rom with whatever filename/extension
that you plan on using for your final binary image.

The file size of the final appended file should now be 8,192
bytes bigger (i.e. if image.rom was 2,088,960 bytes, the
cart.rom file should be 2,097,152).

There is also a nice Windows based hex editor that will allow
you to copy and paste the binary information from UNIV.BIN to
the front of your cartridge ROM file.  The program is called
A.X.E. and can be found at http://www.kahei.com.  It's a free
shareware program.

-------------------
To use A.X.E.:

Note:  if the cartridge image file begins with a bunch of FF's
or a F6 hex byte, then there is some sort of header at the
beginning of the file.  You will want to replace this header
with the UNIV.BIN universal patch code.

If this is a blank header made by the ROMSPLIT.EXE program
(contains 8,192 or $2000 hex FF's) the actual game code should
be found starting at $2000 hex bytes into the image file.

If the first byte is $F6 and the following line of information
is found at offset location $400:

00000400:04 04 04 04 00 80 20 00 00 00 00 00

Then this image file already contains some sort of verification
code (sometimes mislabelled as encryption) on the front of it.
The universal patch can be used to replace this information if
it's verification code that is not working.

1. Open the cartridge image file in one window and open the
UNIV.BIN file in another window.

2. Click on the window for UNIV.BIN and click on the spot just
before the very first byte in the file.  Next, while holding
down the SHIFT key, click on the spot just after the very last
byte.  This will highlight the entire contents of the file.

3. Press CTRL+C or select COPY under the EDIT menu.

4. Click on the window for the cartridge image file.  Use
method 1 below for cartridge image without a verification
header or method 2 that has a verification header.


Method 1:  If this image does not contain the above mentioned
header file, then click on the spot just before the first byte
in the file.  You should have a blinking cursor right in front
of this byte.  Press CTRL+V or select PASTE under the edit
menu to copy in the universal patch.


Method 2:  If this image does have a $2000 hex byte header,
then click on the spot just before the first byte in the file.
Next, go the byte at offset location $2000 and while holding
down the SHIFT key, click on the spot just before the byte at
this location.  This should highlight all the bytes from
offset location $0000 to $1FFF.  Press CTRL+V or select PASTE
from the EDIT menu to replace this header with the universal
patch.

5. Chose SAVE AS under the file menu and save this new file
under a different name than the original file.


If you have any questions or need help with these directions,
feel free to contact me at: glenn_b18@yahoo.com

Enjoy,

Glenn Bruner
