Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Rune Factory 4 (Special)
- # Script to convert save files from RF4 to RF4S
- # Version 1
- #
- # Written by HenryEx
- #
- # script for QuickBMS http://quickbms.aluigi.org
- # See also: http://aluigi.altervista.org/bms/quickbms_crc_engine.txt
- set PAD long 0xE0
- set JANK long 0
- get NAME filename
- get FILESIZE asize
- if FILESIZE != 0x22400 # RF4 file
- print "Filesize incorrect! Is: %FILESIZE|h%! Should be: 0x22400. Exiting..."
- CleanExit
- endif
- get FILECRC long
- SavePos OFFSET
- xmath SIZE "FILESIZE - OFFSET - PAD"
- # check if the save is valid
- encryption CRC 0xEDB88320 "32 -1 -1 0 0 1"
- log MEMORY_FILE OFFSET SIZE
- set NEWCRC long QUICKBMS_CRC
- if FILECRC != NEWCRC
- print "CRC check failed! Script will only work on a valid save file! Exiting..."
- CleanExit
- endif
- encryption "" ""
- log MEMORY_FILE 0 0
- math SIZE + 0x80
- ################################
- # Assemble save file
- append # Append ON
- log MEMORY_FILE 0 0x1E5D9
- log MEMORY_FILE 0x1E55C 0x7D
- log MEMORY_FILE 0x1E5D9 0x50 # we lose a byte here, i hope it wasn't important
- log MEMORY_FILE 0x1E62A 0x20B6
- goto 0x2075C MEMORY_FILE
- put JANK long MEMORY_FILE # maybe this won't even horribly break eventually? let's just pray
- log MEMORY_FILE 0x206E0 0x1D20
- append # Append OFF
- encryption CRC 0xEDB88320 "32 -1 -1 0 0 1"
- log MEMORY_FILE2 OFFSET SIZE MEMORY_FILE
- encryption "" ""
- set NEWCRC long QUICKBMS_CRC
- goto 0 MEMORY_FILE
- put NEWCRC long MEMORY_FILE
- log "rf4_sXX.sav" 0 0x22480 MEMORY_FILE
- CleanExit
Add Comment
Please, Sign In to add comment