Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
myk

DeHackEd text string length limitations

Recommended Posts

As we know in DeHackEd a text replacement is limited by the original, in chunks of 4 characters (0-3, 4-7, 8-11, 12-15, and so on). The DeHackEd documantation says:

Because each text string is a fixed length in the Doom exe file, you have only a slight lee-way in how long the edited text needs to be. The minimum and maximum length for the string you are editing are shown on the top line of the editing window, along with the current position of the character you're on. You will have a range of 4 characters that the new string must fit into. Typing beyond the maximum number of characters is not allowed, and stopping short of the minimum is also not allowed.

Is this because Greg Lewis found it convenient for the format of the patches, or due to potential issues or instability? I mean, strings exceeding the range shouldn't normally be possible because the new text just wouldn't fit, but would shorter ones using null bytes be harmless?

Share this post


Link to post
myk said:

but would shorter ones using null bytes be harmless?

Why not. Greg Lewis prob'ly wanted to stay safe. The source porters know the best, unless DosDoom decided elsewise.

Share this post


Link to post

As with the code pointer limitation it was just wrong. Since strings are 0-terminated they can easily be shorter.

Share this post


Link to post

I see no reason why shorter strings would not work (in a patched EXE), although Greg's parser may require or assume the limits he set, so editing a DEH files by hand may cause it to fail with DeHackEd (ports probably don't have that limitation).

Some DEH files use spaces on the end to work around that limitation.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×