ZappR Technical Information (2017-04-18) ======================================== ZPR (ZappR) is a fileformat mainly dedicated to ROM-hackers but could also be usefull for other things aswell. The fileformat itself is a text-file containing instructions (in cleartext) how to patch a file. The purpose of the fileformat is to aid ROM-hackers with their work. Most people probably use hex-editors for their modifications. This is usually effective but if you screw things up, it might be difficult to track down the problem. With ZPR you can see your modifications in cleartext and simply comment things out to see if the problem gets solved. You don't need to edit the file a Hex-editor, all editing is done in the ZPR-file using a simple text-editor. ZPR-files are currently not really meant for distribution (like .IPS-files) but more for ROM-hackers during development. IF you want to distribute a ZPR-patch, compile them with the ZappRToolkit to a ZPC (Compiled ZPR) which is a binary format much more suitable for distribution. To patch a binary with a .ZPC, use the "ZappR Toolkit". Notice: ZPR is currently in early alpha-state so bugs might, and probably are, present. Author ======= Feel free to contact me with ideas and feedback: Author: Morgan Johansson (morjoh@live.se) ZPR === ZPR is a clear-text fileformat that contains instructions (see below) for filepatching. Notice that the first row of a ZPR-file must contain the identificationtag "ZPR1". To patch a file with a ZPR, use "ZappR.exe". ZPR-files can be compiled (for easier distribution) to ZPC using the "ZappR Toolkit". ZPC === A .ZPC-file is a compiled .ZPR-file. A .ZPC comes with a 16-byte header which currently looks something like this: Header: dc.b "ZPRC" ;Identification dc.b 1 ;Version dc.b 0,0,0 ;For future usage dc.l CRC32 ;CRC32 is stored here. The file to be patched must match ;this CRC32-value. Leave empty to ignore CRC32-check. dc.l 0 ;Future usage After the header comes the actual data (see instructions below) Instructions ============= Here's a short summary of the instruction set. All parameters are 32-bit (unless stated otherwise) and in the ZPC they're stored in Motorola byte-order. Name Opcode Parameters Description AUTHOR 0xA4 "author" Author of patch COMMENT 0xAF "comment" Leave a comment COMMENT8* 0xB0 "comment" Same as above but comment is limited to 255 characters. COPY 0x06 ,, Copies data EOF 0xFF - End of patchdata. Always the last byte of the ZPC. FILL 0x04 #,, Fill an area with BLOB 0xA2 "file", Include data att INJECT 0x03 #,, Injects , times at , increasing size of data LOGO 0xB1 "filename" Includes a maximum 128x128 image (JPG or PNG) in the ZPC MATCH_CRC32 ---- Set in ZPC header at position 8 MOVE 0x07 #,,, with byte # NOP 0x00 - Does nothing. Skip to next instruction OUTPUTNAME 0xFD "filename" Default destination-filename POKE 0x01 #, Replaces byte at with . POKE8* 0x01 #, Same as above but uses an 8-bit instead of 32-bit. README 0xB2 "filename" Includes an UTF8 readme file in the ZPC. TITLE 0xA2 "title" Patch-title. VERSION 0xA5 "version" Version of your patch. Maximum length 255 characters. *) POKE/COMMENT are automatically optimized to POKE8/COMMENT8 by the compiler if possible. History ======= v1.0 2017-04-18 - First version