#!/sbin/sh
#
# Discreet Flame 4.0.2 dongle check removal
#
# Version history
# v002 Initial release
#
#
# Run in the Flame bin directory
#

# Change to Indy graphics mode. For some reason Discreet left in graphics functions an Indy/XZ mode in Flame 4.0.2, 
# though disabled. I guess this may be remnants of Flint for the Indy - though Flint 4 was only released for Indigo2.
# This might also enable Flame 4 to run on other graphics hardware. If you have a Onyx Reality Engine or previous high end 
# graphics, you can try to comment out this.

./patchfile flame_IRIX_5.3 0x7d0353 0xf0240b8c

# Skip RealityEngine check. Comment if you have a RealityEngine.

./patchfile flame_IRIX_5.3 0x0b60d8 0x14200040

# Remove DongleInit call, otherwise Flame will crash when trying to initialize the license Dongle

./patchfile flame_IRIX_5.3 0x0b8cf4 0x00000000

# Remove check for DongleSerial in ClockInit (if no DongleSerial port is set, normally Flame will not load)

./patchfile flame_IRIX_5.3 0x17b0dc 0x10000008

#  Remove DongleExpiryWarning call (no complaints about security file error or expired dongle)

./patchfile flame_IRIX_5.3 0x0b908c 0x00000000

# Remove periodic call to DongleCheck function (not required, but lets just save resources)

./patchfile flame_IRIX_5.3 0x0b19cc 0x00000000

# Remember not to set any dongle serial in default.cfg, as there is an additional check in the DongleCheckAutoSave function 
# if a dongle serial is set in default.cfg. The fact that the check in DongleCheckAutoSave is bypassed when no dongle serial
# is set, seems to indicate that the software allows you to bypass the dongle somehow. There is among other things a SecFileCheck
# function, so there may be some kind of security file/license which can bypass the dongle (or you need the file together with 
# some kind of dongle). I haven't checked further, and believe this patch is complete.


# Additional info for patch if you want use Discreet Stone-Wire Raid system.

# You could just setup Flame with a file-based framestore, but if you want, here is a patch for Stone - 
# possibly the old champro trick works even with this old version, though I didn't test it. Patch swr.o:

# 19C0 change 10400009 to 14400009 patch Stone lic check
# 1AA8 change 11200009 to 15200009 patch Stone lic check
# 1AD8 change 2401FFFF 1181000C to 24010004 1420000A patch Stone lic check
# 412C change 10400016 change to 14400016 patch check for STON+WIR label

# For a filebased framestore, it seems you need to make a new file "/usr/lib/discreet/libioSA.cfg", with the text "-1", 
# for some reason, or you will get "SharedArena" errors.
