UPD49ROM - An HP49G emulator ROM updater
10/15/15 (c) by Christoph Gieelink, c dot giesselink at gmx dot de


	************
	* UPD49ROM *
	************

A small program for updating a HP49G emulator ROM. An emulator ROM is a nibble
based dump of the 2MB flash chip. You can find an emulator ROM in the YorkeM
emulator package or in the HP49G SDK on http://www.hpcalc.org in the HP49
section.

It exists of 16 128KB banks:

Bank 0 (64KB)	Boot loader
Bank 0 (64KB)	User Flash / Firmware (since v1.19-5)
Bank 1
  -		Firmware
Bank 7
Bank 8
  -		User Flash
Bank 15

If you do an update with the .flash file of the complete operating system on an
original HP49G calculator, you replace the banks 1 to 7. The "Boot loader" in
the first half of Bank 0 and the "User Flash" area is normally untouched. Even
if the .flash file contain the "Boot loader" it's impossible to update this part
in the real calculator because this part is write protected. The emulator ROM
image hasn't a partial write protection so also the "Boot loader" part will be
updated. If you use an update file containing only a patch, then only the
affected blocks are replaced.

You need:

- a .flash file with the firmware (hp491xx.flash)
- an emulator ROM (ROM.49G) for updating (optional)
- an external boot loader file (VGER0.OBJ) for updating (optional)

Copy the .flash and if you have the target file (emulator ROM or external boot
loader file) into the directory with the UPD49ROM.EXE file. If you use a boot
loader file you may rename it to ROM.49G first. If the target file don't exist
the ROM image will be created with a default "Boot loader".

Start a Command Prompt while running Windows, and type:
	UPD49ROM <flash-update-file> ROM.49G

The program has two optional parameters: -p and -f.
	UPD49ROM [-f] [-p] <flash-update-file> ROM.49G

With the -p option you're able to pack the resulting emulator ROM image to half
of the original size. Be aware please, that not all emulators or emulator
versions accept a packed ROM image format.

Some emulator ROM's have broken block header information. If you are using a
.flash file with the complete operating system you can rewrite this information
by calling the update program with the option -f:
	UPD49ROM -f <flash-update-file> ROM.49G

This will update the ROM.49G file.

At the end of the update process the CRC (Cyclic redundancy check) of each bank
without the Boot loader is checked. If all CRC are valid, you get a

Verifying CRC ... ok

message, else a list with the bank number followed by a "G" for a good or a "B"
for a bad CRC of this bank.

Verifying CRC ... 0B 1G 2G 3G 4G 5G 6G 7G 8G 9G 10G 11G 12G 13G 14G 15G

The results of the CRC check have no influence on generating the emulator ROM,
it's for information only.


	***************
	* LEGAL STUFF *
	***************

UPD49ROM - An HP49G emulator ROM updater
Copyright (C) 2015 Christoph Gieelink

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.  See the GNU General Public License for more details.

You should have received a copy of the license with this program in the file
"COPYING". If not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
