Dynablaster

From ModdingWiki
Jump to navigation Jump to search
Dynablaster
Dynablaster.png
There is no image of a modified version of this game — upload one!
Levels?X mark.svg Not editable
Tiles?X mark.svg Not editable
Sprites?X mark.svg Not editable
Fullscreen?X mark.svg Not editable
Sound?X mark.svg Not editable
Music?X mark.svg Not editable
Text?X mark.svg Not editable
Story/cutscenes?X mark.svg Not editable
UI/menus?X mark.svg Not editable
Demos?Unknown

File formats

The IMG files in the GFX directory are sprite sheets in LBM Format with most having a corrupt header.

The following C# program will create corrected copies of them as .LBM files:

using System.Buffers.Binary;
using System.Text;

var paths = Directory.GetFiles(Environment.CurrentDirectory, "*.img");

foreach (var path in paths)
{
    using var src = File.OpenRead(path);
    using var tgt = File.Create(Path.ChangeExtension(path, ".lbm"));

    src.CopyTo(tgt);

    tgt.Position = default;

    using var writer = new BinaryWriter(tgt, Encoding.Default, true);

    var length = (int)src.Length - 8;

    if (BitConverter.IsLittleEndian)
    {
        length = BinaryPrimitives.ReverseEndianness(length);
    }

    writer.Write(Encoding.ASCII.GetBytes("FORM"));
    writer.Write(length);
    writer.Write(Encoding.ASCII.GetBytes("ILBM"));
    writer.Write(Encoding.ASCII.GetBytes("BMHD"));
}