Jump to content


Photo

Feature Proposal: BCS Patch/Diff


  • Please log in to reply
4 replies to this topic

#1 FredSRichardson

FredSRichardson

    WeiDU Meddler

  • Member
  • 258 posts

Posted 16 August 2003 - 10:36 AM

I just wanted to see what people thought of the following idea.

I've been working on porting Sabre's Romance and Happy mod to WeiDU
and I've found many things a long the way. Some of the changes are
complex and some can't be easily implemented using
REPLACE_BCS_BLOCK.

So, I've implemented a feature for WeiDU that allows you to create and
apply patches. The patch files have the UNIX unified diff format. Here's
how it works.

You can create a patch by running:
% weidu-new.exe --bcmp-from AERI25.BCS --bcmp-to ./mysrc/AERI25.bcs
[weidu-new] WeiDU version 130
[C:/.../chitin.key] 182 BIFFs, 41793 resources
[C:/.../dialog.tlk] 75108 string entries
[C:/.../data/25Scripts.bif] 3935784 bytes, 969 files, 0 tilesets
// TP2 patch to turn AERI25.BCS into ./mysrc/AERI25.BCS.  For example using:
COPY_EXISTING ~AERI25.BCS~ ~override/AERI25.BCS~
        APPLY_BCS_PATCH ~./mysrc/AERI25.BCS.patch~
%

The file "./mysrc/AERI25.BCS.patch" is created as a result of running
this command. As noted in the output, you can apply the patch by putting
the following command to your *.TP2 file:
COPY_EXISTING ~AERI25.BCS~ ~override/AERI25.BCS~
        APPLY_BCS_PATCH ~./mysrc/AERI25.BCS.patch~

(you'd probably end up changing these paths and file names in
a real TP2 file, but you get the idea)

When the APPLY_BCS_PATCH command is run, it checks to see if any
chunks in the patch could not be applied. It then checks to see if
any of these rejected chunks have already been applied (say in a
previous patch) and a verbose warning is issued for the "already
applied" chunks. If there are any remaining rejected chunks which
have not already been applied, a verbose error message is issued and
the APPLY_BCS_PATCH fails.
I gotta get rid of this friggin idiotic signature...

#2 weimer

weimer
  • Member
  • 1569 posts

Posted 19 August 2003 - 04:12 PM

Are the unified diffs of the BCS form or the BAF form?

Anyway, if you send me the diffs to the WeiDU sources for this feature I'll incorporate it. Go Fred!

By the way, can I infer from your quoted % prompt that you're actually compiling/running WeiDU under unix? Or is that just cygwin/bash? :-)

#3 FredSRichardson

FredSRichardson

    WeiDU Meddler

  • Member
  • 258 posts

Posted 19 August 2003 - 05:26 PM

Hi Wes!

No, I'm using CygWin/Bash. I just need my environment to be as Linux-ish as possible in order to function properly :-) I recently started using MinGW (so I can create exportable exectuables). Someday I'll have to learn dos, but I have to say I really do like bash.

The diffs are of the BCS form, so you can apply the patch command while copying the existing BCS file. I'm going to try to make it so that you can create and apply a diff of any text format file (a little tricky with the CRLF translation business). I'm trying to work the kinks out now. libxdiff also supplies a binary diff ability that I no nothing about. It could be useful if it can be used to patch files that differ in regions that are far enough away from the area effected by the patch.

I sent you a patch a few days ago for the "BCS-patch" feature, but you should hold off on adding it. There are a still a few kinks I need to work out.

On a side note (and completely off topic), I've been trying to find good inexpensive compilers for CygWin. I made the (big) mistake of purchasing the "standard" MSVC compiler which disables all optimization (grrr). I didn't realize that you could download the command line version of this compiler for free (double grrr). At least I can tool around with the IDE a bit and learn me some windows developer-isms.

I did a lilttle more nosing around on compilers and found a very good benchmark page (http://www.willus.co...benchmark.shtml) and it looks like MinGW isn't too terrible (so long as you use the -O3 -ffast-math options -- I re-built ocaml with these). After that, the Intel compiler looks really good (well, in the benchmarks anyway) for a commercial compiler.
I gotta get rid of this friggin idiotic signature...

#4 FredSRichardson

FredSRichardson

    WeiDU Meddler

  • Member
  • 258 posts

Posted 22 August 2003 - 01:14 PM

Hi Wes,

I sent you a "new and improved" patch for this feature via e-mail. Let me know what you think.

I have a Romance/Happy package that uses the feature and is pretty much ready to go.

-Fred
I gotta get rid of this friggin idiotic signature...

#5 weimer

weimer
  • Member
  • 1569 posts

Posted 22 August 2003 - 03:16 PM

Fred's newest patch has been applied to WeiDU and can be found in v132. Further bulletins as events warrant. Thanks again, Fred!