What's wrong with GCC (sgdk)? Why it crashes 10% of runs?

SGDK only sub forum

Moderator: Stef

greatkreator
Very interested
Posts: 158
Joined: Sat May 12, 2012 7:37 pm
Location: Ukraine

What's wrong with GCC (sgdk)? Why it crashes 10% of runs?

Post by greatkreator » Mon Jul 16, 2012 7:14 am

What's wrong with GCC (sgdk)? Why it crashes about 10% of runs?
Maybe even 20% of runs but for sure 10%

1 [main] ? (1080) M:\segamd\sgdk\bin\make.exe: *** fatal error - M:\segamd\sgdk\bin\make.exe: *** couldn't allocate heap, Win32 error 0, base 0x850000, top 0x870000, reserve_size 126976, allocsize 131072, page_const 4096
13 [main] make 4632 fork: child -1 - died waiting for longjmp before initialization, retry 0, exit code 0x100, errno 11
make: vfork: Resource temporarily unavailable

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Mon Jul 16, 2012 7:59 am

I have the same problem and i have to admit i never tried to investigate it as anyway relaunching make will complete the compilation. It usually happen when i compile a lot of files, as the library...

greatkreator
Very interested
Posts: 158
Joined: Sat May 12, 2012 7:37 pm
Location: Ukraine

Post by greatkreator » Mon Jul 16, 2012 8:06 am

I wouldn't try to investigate it as well but I have 2 computers I am working on. One of them has 16gb ram and GCC crashes less frequently on it and another slow notebook with 2gb ram and GCC crashes almost 50% of runs (this notebook made me try to investigate what's wrong) because it is almost unusable to crash 50% of time.

By the way Stef isn't it possible to use newer versions of GCC?
Maybe it will work better.

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Mon Jul 16, 2012 8:18 am

greatkreator wrote:I wouldn't try to investigate it as well but I have 2 computers I am working on. One of them has 16gb ram and GCC crashes less frequently on it and another slow notebook with 2gb ram and GCC crashes almost 50% of runs (this notebook made me try to investigate what's wrong) because it is almost unusable to crash 50% of time.

By the way Stef isn't it possible to use newer versions of GCC?
Maybe it will work better.
Newer version gave me lot of troubles, there are really not done for old architecture as the 68k and so i generally experienced more bugs and worse level of optimization :-/

greatkreator
Very interested
Posts: 158
Joined: Sat May 12, 2012 7:37 pm
Location: Ukraine

Post by greatkreator » Mon Jul 16, 2012 8:33 am

I see.

Then we have to stay in the past forever.

P.S. Didn't you try to build on linux? Does it have the same problem?
I would move with pleasure on linux if it doesn't have such problems and has all the tools needed to build a game.

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Mon Jul 16, 2012 10:04 am

I guess a linux build would have less problems as "more native" but still newer versions of GCC will suffer of the bad optimized code matters and this is a big problem when it comes to genesis :p
You can try using GCC 3.4.6 on linux, i think it's quite easy to compile GCC on linux (compared to windows).

djcouchycouch
Very interested
Posts: 710
Joined: Sat Feb 18, 2012 2:44 am

Post by djcouchycouch » Mon Jul 16, 2012 10:41 am

That's strange, I don't recall ever getting that error. I'm running SGDK on Windows XP.

Doesn't gcc have any debugging modes?

greatkreator
Very interested
Posts: 158
Joined: Sat May 12, 2012 7:37 pm
Location: Ukraine

Post by greatkreator » Mon Jul 16, 2012 12:29 pm

It is very likely that the old gcc is more suitable for Windows XP than my Windows 7.

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Mon Jul 16, 2012 12:49 pm

Probably, i am also using windows seven.

greatkreator
Very interested
Posts: 158
Joined: Sat May 12, 2012 7:37 pm
Location: Ukraine

Post by greatkreator » Mon Jul 16, 2012 2:25 pm

By the way Stef did you notice that the latest sgdk 092 builds noticeably slower than the previous ones?

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Mon Jul 16, 2012 4:30 pm

I run the SDK in VirtualBox under Windows XP. It's never crashed once. At some point, I want to make some unix makefiles so I can use it in linux just the way it is in Windows. That means porting the helper apps... which means turning stuff like this

Code: Select all

program BinToS;

{$APPTYPE CONSOLE}

uses
  SysUtils, Classes;//, HttpApp;


function UnixPathToDosPath(path: string): string;
begin
   result:= StringReplace(path, '/', '\', [rfReplaceAll]);
end;

function rgb24_to_vdp_color(color: integer): integer;
var
   r, g, b: integer;
begin
   r:= color shr 16;
   g:= color shr 8;
   b:= color shr 0;

   // genesis only define on 3 bits (but shifted to 1 left)
   r:= (r shr 4) and $E;
   g:= (g shr 4) and $E;
   b:= (b shr 4) and $E;

   result:= (r shl 0) or (g shl 4) or (b shl 8);
end;

function delete_last(const s: string; del: integer): string;
var
   len: integer;
begin
   len := Length(s);
   result := Copy(s, 1, len - del);
end;



var
   bitmap: boolean;
   ii, jj: integer;
   data: cardinal;
   w, h: integer;
   len: integer;
   offset: integer;
   align: integer;
   sizealign: integer;
   formatint: integer;
   nullfill: integer;
   format: string;
   formatasm: string;
   ss: string;
   shortname: string;
   FileName: string;
   FileNameOut: string;
   FileInput: TFileStream;
   FileOutput: TStringList;
   MemInput: TMemoryStream;
   MemTmp: TMemoryStream;
begin
   // default
   bitmap := false;
   FileName := '';
   FileNameOut := '';
   format := 'u8 ';
   formatasm := 'b';
   formatint := 1;
   align := 4;
   sizealign := 1;
   nullfill := 0;

   // parse parmeters
   ii := 1;
   while (ii <= ParamCount) do
   begin
      if (ParamStr(ii) = '-u8') then begin
         format := 'u8 ';
         formatasm := 'b';
         formatint := 1;
      end else if (ParamStr(ii) = '-s8') then begin
         format := 's8 ';
         formatasm := 'b';
         formatint := 1;
      end else if (ParamStr(ii) = '-u16') then begin
         format := 'u16 ';
         formatasm := 'w';
         formatint := 2;
      end else if (ParamStr(ii) = '-s16') then begin
         format := 's16 ';
         formatasm := 'w';
         formatint := 2;
      end else if (ParamStr(ii) = '-u32') then begin
         format := 'u32 ';
         formatasm := 'l';
         formatint := 4;
      end else if (ParamStr(ii) = '-s32') then begin
         format := 's32 ';
         formatasm := 'l';
         formatint := 4;
      end else if (ParamStr(ii) = '-bmp') then begin
         bitmap := true;
         format := 'u16 ';
         formatasm := 'w';
         formatint := 2;
      end else if (ParamStr(ii) = '-align') then begin
         Inc(ii);
         align := StrToIntDef(ParamStr(ii), 4);
      end else if (ParamStr(ii) = '-sizealign') then begin
         Inc(ii);
         sizealign := StrToIntDef(ParamStr(ii), 1);
      end else if (ParamStr(ii) = '-nullfill') then begin
         Inc(ii);
         nullfill := StrToIntDef(ParamStr(ii), 0);
      end else if (FileName = '') then FileName:= UnixPathToDosPath(ParamStr(ii))
      else if (FileNameOut = '') then FileNameOut:= UnixPathToDosPath(ParamStr(ii));

      Inc(ii);
   end;

   if (FileNameOut = '') then FileNameOut := FileName;

   if (UpperCase(ExtractFileExt(FileName)) = '.BMP') then begin
      bitmap := true;
      format := 'u16 ';
      formatasm := 'w';
      formatint := 2;
      align := 16;
   end;

   if (not FileExists(FileName)) then MemInput := nil
   else begin
      MemInput := TMemoryStream.Create;
      FileInput := TFileStream.Create(FileName, fmOpenRead or fmShareDenyWrite);
      // we use a memory copy of the file
      try
         MemInput.CopyFrom(FileInput, 0);
         MemInput.Seek(0, soFromBeginning);
      finally
         FileInput.Free;
      end;
   end;

   FileOutput := TStringList.Create;
   try
      offset := 0;
      if (not Assigned(MemInput)) then len := 1
      else len := MemInput.Size;

      if (bitmap) then Dec(len, 118 - ((2 * 2) + (2 * 16)));

      // adjust size for word/long boundary
      len := (len + (formatint - 1)) and (not (formatint - 1));
      // size alignement needed ?
      if ((len and Pred(sizealign)) <> 0) then
         len := (len and (not Pred(sizealign))) + sizealign;

      shortname := ChangeFileExt(ExtractFileName(FileName), '');

      FileOutput.Add('.text');
      FileOutput.Add('');
      FileOutput.Add('    align ' + IntToStr(align));
      FileOutput.Add('');
      FileOutput.Add('    .globl  ' + shortname);
      FileOutput.Add(shortname + ':');

      if (Assigned(MemInput)) then
      begin
         if (bitmap) then
         begin
            MemInput.Seek(18, soFromBeginning);

            // get width
            MemInput.Read(w, 4);
            ss := '0x' + IntToHex(w, 4) + ', ';
            // get height
            MemInput.Read(h, 4);
            ss := ss + '0x' + IntToHex(h, 4);

            FileOutput.Add('    dc.' + formatasm + '  ' + ss);

            MemTmp := TMemoryStream.Create;
            try
               // reverse lines
               for ii := (h - 1) downto 0 do
               begin
                  MemInput.Seek(118 + ((ii * w) div 2), soFromBeginning);
                  for jj := 0 to ((w div 8) - 1) do
                  begin
                     MemInput.Read(data, 4);
                     // reverse high and low byte
                     data := ((data shr 24) and $000000FF) or
                             ((data shr 08) and $0000FF00) or
                             ((data shl 08) and $00FF0000) or
                             ((data shl 24) and $FF000000);
                     data := ((data shr 16) and $0000FFFF) or
                             ((data shl 16) and $FFFF0000);
                     MemTmp.Write(data, 4);
                  end;
               end;

               // erase old lines
               MemInput.Seek(118, soFromBeginning);
               for ii := 0 to (h - 1) do
               begin
                  MemTmp.Seek((ii * w) div 2, soFromBeginning);
                  MemInput.CopyFrom(MemTmp, w div 2);
               end;
            finally
               MemTmp.Free;
            end;

            // get palette
            ss := '    dc.' + formatasm + '  ';
            MemInput.Seek(54, soFromBeginning);
            for ii := 0 to 15 do
            begin
               // get color
               MemInput.Read(jj, 4);
               ss := ss + '0x' + IntToHex(rgb24_to_vdp_color(jj), 4) + ', ';
            end;

            FileOutput.Add(delete_last(ss, 2));
            offset := (2 * 2) + (2 * 16);
         end;

         data := 0;
         while (offset < len) do
         begin
            ss := '    dc.' + formatasm + '  ';
            for ii := 0 to ((16 div formatint) - 1)  do
            begin
               if (MemInput.Read(data, formatint) <> 0) then
                  ss := ss + '0x' + IntToHex(data, 2 * formatint) + ', '
               else
                  ss := ss + '0x' + IntToHex(nullfill, 2 * formatint) + ', ';
            end;

            Inc(offset, 16);
            FileOutput.Add(delete_last(ss, 2));
         end;
      end else FileOutput.Add('    dc.' + formatasm + '  0x00');

      FileOutput.SaveToFile(ChangeFileExt(FileNameOut, '.s'));

      FileOutput.Clear;

      ss := '_' + UpperCase(shortname) + '_H_';
      FileOutput.Add('#ifndef ' + ss);
      FileOutput.Add('#define ' + ss);
      FileOutput.Add('');
      FileOutput.Add('extern const ' + format + shortname + '[0x' + IntToHex(len div formatint, 4) + '];');
      FileOutput.Add('');
      FileOutput.Add('#endif // ' + ss);

      FileOutput.SaveToFile(ChangeFileExt(FileNameOut, '.h'));
   finally
      FileOutput.Free;
      MemInput.Free;
   end;
end.
into code like this

Code: Select all

#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <malloc.h>
#include <inttypes.h>


int vdpcolor(char r, char g, char b)
{
   // genesis only define on 3 bits (but shifted to 1 left)
    r = (r >> 4) & 0xE;
    g = (g >> 4) & 0xE;
    b = (b >> 4) & 0xE;

    return (r << 0) | (g << 4) | (b << 8);
}

int main(int argc, char **argv)
{
    int bitmap;
    int ii, jj;
    int w, h;
    int len;
    int total;
    int align;
    int sizealign;
    int formatint;
    int nullfill;
    char *format;
    char *formatasm;
    char *shortname;
    char *FileName;
    char *FileNameOut;
    FILE *FileInput;
    FILE *FileOutput;
    char temp[512];

    // default
    bitmap = 0;
    FileName = "";
    FileNameOut = "";
    format = "u8 ";
    formatasm = "b";
    formatint = 1;
    total = 0;
    align = 4;
    sizealign = 1;
    nullfill = 0;

    // parse parmeters
    for (ii=1; i<argc; i++)
    {
        if (!strcmp(argv[ii], "-u8"))
        {
            format = "u8 ";
            formatasm = "b";
            formatint = 1;
        }
        else if (!strcmp(argv[ii], "-s8"))
        {
            format = "s8 ";
            formatasm = "b";
            formatint = 1;
        }
        else if (!strcmp(argv[ii], "-u16"))
        {
            format = "u16 ";
            formatasm = "w";
            formatint = 2;
        }
        else if (!strcmp(argv[ii], "-s16"))
        {
            format = "s16 ";
            formatasm = "w";
            formatint = 2;
        }
        else if (!strcmp(argv[ii], "-u32"))
        {
            format = "u32 ";
            formatasm = "l";
            formatint = 4;
        }
        else if (!strcmp(argv[ii], "-s32"))
        {
            format = "s32 ";
            formatasm = "l";
            formatint = 4;
        }
        else if (!strcmp(argv[ii], "-bmp"))
        {
            bitmap = 1;
            format = "u16 ";
            formatasm = "w";
            formatint = 2;
        }
        else if (!strcmp(argv[ii], "-align"))
        {
            ii++;
            align = strtoimax(argv[ii], NULL, 0);
            if (!align) align = 4;
        }
        else if (!strcmp(argv[ii], "-sizealign"))
        {
            ii++;
            sizealign = strtoimax(argv[ii], NULL, 0);
            if (!sizealign) sizealign = 1;
        }
        else if (!strcmp(argv[ii], "-nullfill"))
        {
            ii++;
            nullfill = strtoimax(argv[ii], NULL, 0);
        }
        else if (!FileName[0]) FileName = argv[ii];
        else if (!FileNameOut[0]) FileNameOut = argv[ii];
    }

    if (!FileNameOut[0]) FileNameOut = FileName;

    if (!strcasecmp(FileName[strlen(FileName)-4], ".bmp"))
    {
        bitmap = 1;
        format = "u16 ";
        formatasm = "w";
        formatint = 2;
        align = 16;
    }

    FileInput = fopen(FileName, "rb");
    if (!FileInput)
    {
        printf("Couldn't open input file %s\n", FileName);
        return 1;
    }

    // make .s file
    strncpy(temp, FileNameOut, 512);
    temp[511] = 0;
    for (ii=strlen(temp)-1; i>0; i--)
        if (temp[ii] == '.')
            break;
    temp[ii] = 0; // remove extension
    shortname = strdup(temp);
    strcat(temp, ".s");
    FileOutput = fopen(temp, "w");
    if (!FileOutput)
    {
        fclose(FileInput);
        printf("Couldn't open output file %s\n", temp);
        return 1;
    }

    fprintf(FileOutput, "    .text\n\n");
    fprintf(FileOutput, "    .align  %d\n\n", align);
    fprintf(FileOutput, "    .global %s\n", shortname);
    fprintf(FileOutput, "%s:\n", shortname);

    if (bitmap)
    {
        char *mem;

        // process header
        fread(temp, 1, 0x36, FileInput); // read header
        w = (unsigned char)temp[18] | (temp[19]<<8); // only need two bytes, but is really four byte LE
        h = (unsigned char)temp[22] | (temp[23]<<8); // only need two bytes, but is really four byte LE

        fprintf(FileOutput, "    dc.w    %d, %d\n\n", w, h);
        total += 4;

        // process palette (assumes 16 color image)
        fread(temp, 4, 16, FileInput); // read palette
        fprintf(FileOutput, "    dc.w    0x%04X, 0x%04X, 0x%04X, 0x%04X\n", vdpcolor(temp[0], temp[1], temp[2]), vdpcolor(temp[4], temp[5], temp[6]), vdpcolor(temp[8], temp[9], temp[10]), vdpcolor(temp[12], temp[13], temp[14]));
        fprintf(FileOutput, "    dc.w    0x%04X, 0x%04X, 0x%04X, 0x%04X\n", vdpcolor(temp[16], temp[17], temp[18]), vdpcolor(temp[20], temp[21], temp[22]), vdpcolor(temp[24], temp[25], temp[26]), vdpcolor(temp[28], temp[29], temp[30]));
        fprintf(FileOutput, "    dc.w    0x%04X, 0x%04X, 0x%04X, 0x%04X\n", vdpcolor(temp[32], temp[33], temp[34]), vdpcolor(temp[36], temp[37], temp[38]), vdpcolor(temp[40], temp[41], temp[42]), vdpcolor(temp[44], temp[45], temp[46]));
        fprintf(FileOutput, "    dc.w    0x%04X, 0x%04X, 0x%04X, 0x%04X\n\n", vdpcolor(temp[48, temp[49], temp[50]), vdpcolor(temp[52], temp[53], temp[54]), vdpcolor(temp[56], temp[57], temp[58]), vdpcolor(temp[60], temp[61], temp[62]));

        // process bitmap data (assumes 16 color image)
        mem = malloc(w * h / 2);
        for (ii=0; ii<h; ii++)
            fread(&mem[(h-ii-1)*w/2], 1, w/2, FileInput); // fill from bitmap backwards (BMP is bottom up)

        while (1)
        {
            len = fread(temp, 1, 16, FileInput);
            len = (len + (formatint - 1)) & ~(formatint - 1); // align length for size of units
            fprintf(FileOutput, "    dc.%s    ", formatasm);
            for (ii=0; ii<(len/formatint); ii++)
            {
                if (ii)
                    fprintf(FileOutput, ",");
                fprintf(FileOutput, "0x"
                for (jj=0; jj<formatint; jj++)
                    fprintf(FileOutput, "%02X", temp[ii*formatint + jj]);
            }
            fprintf(FileOutput, "\n");
            total += len;
            if (len < 16)
                break;
            memset(temp, nullfill, sizeof(temp));
        }

        free(mem);

        fprintf(FileOutput, "\n");
        fclose(FileOutput);
        fclose(FileInput);
    }
    else
    {
        // non-BMP is dumped as straight data

        memset(temp, nullfill, sizeof(temp));
        while (1)
        {
            len = fread(temp, 1, 16, FileInput);
            len = (len + (formatint - 1)) & ~(formatint - 1); // align length for size of units
            if (len)
            {
                fprintf(FileOutput, "    dc.%s    ", formatasm);
                for (ii=0; ii<(len/formatint); ii++)
                {
                    if (ii)
                        fprintf(FileOutput, ",");
                    fprintf(FileOutput, "0x"
                    for (jj=0; jj<formatint; jj++)
                        fprintf(FileOutput, "%02X", temp[ii*formatint + jj]);
                }
                fprintf(FileOutput, "\n");
            }
            total += len;
            if (len < 16)
                break;
            memset(temp, nullfill, sizeof(temp));
        }
        fprintf(FileOutput, "\n");
        fclose(FileOutput);
        fclose(FileInput);
    }

    // now make .h file
    strcpy(temp, shortname);
    strcat(temp, ".h");
    FileOutput = fopen(temp, "w");
    if (!FileOutput)
    {
        printf("Couldn't open output file %s\n", temp);
        return 1;
    }

    for (ii=0; ii<strlen(shortname); ii++)
        temp[ii] = toupper(shortname[ii]);
    temp[ii+1] = 0;
    fprintf(FileOutput, "#ifndef _%s_H_\n", temp);
    fprintf(FileOutput, "#define _%s_H_\n\n", temp);
    fprintf(FileOutput, "extern const %s%s[%d];\n\n", format, shortname, total / formatint);
    fprintf(FileOutput, "#endif // _%s_H_\n", temp);

    fclose(FileOutput);
    return 0;
}
I still need to verify that the above turns out files that are compatible with the original, then on to the next.

powerofrecall
Very interested
Posts: 237
Joined: Fri Apr 17, 2009 7:35 pm
Location: USA

Post by powerofrecall » Fri Jul 20, 2012 4:27 pm

Not really germane to the discussion but those Delphi utilities will build in Lazarus free pascal with some changes related to paths (IIRC just changing the slashes). At least it does for me on ubuntu in a VM.

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Fri Jul 20, 2012 5:04 pm

powerofrecall wrote:Not really germane to the discussion but those Delphi utilities will build in Lazarus free pascal with some changes related to paths (IIRC just changing the slashes). At least it does for me on ubuntu in a VM.
Good point - I should install Lazarus and try that... it would be easier than rewriting them all by hand. :lol:

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Fri Jul 20, 2012 5:18 pm

Chilly Willy wrote:
powerofrecall wrote:Not really germane to the discussion but those Delphi utilities will build in Lazarus free pascal with some changes related to paths (IIRC just changing the slashes). At least it does for me on ubuntu in a VM.
Good point - I should install Lazarus and try that... it would be easier than rewriting them all by hand. :lol:
Don't worry, the source you posted is not lost, i will use it as i want to port all these small utilities to C language :)

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Fri Jul 20, 2012 6:38 pm

Stef wrote:
Chilly Willy wrote:
powerofrecall wrote:Not really germane to the discussion but those Delphi utilities will build in Lazarus free pascal with some changes related to paths (IIRC just changing the slashes). At least it does for me on ubuntu in a VM.
Good point - I should install Lazarus and try that... it would be easier than rewriting them all by hand. :lol:
Don't worry, the source you posted is not lost, i will use it as i want to port all these small utilities to C language :)
If you want them all in C, I'll keep on that. In the meantime, I found a weird bug in pascal... both Lazarus and Delphi.

I tried to compile bintoc with Lazarus, which worked fine. However, when I ran it on a bmp, I got this

Code: Select all

#include "genesis.h"

const u16 moon[0x0412] = {
	0x0040, 0x0040, 
	0x0000, 0x0EEE, 0x0442, 0x0000, 0x0420, 0x0A42, 0x0422, 0x0866, 0x0842, 0x0A64, 0x0C64, 0x0C86, 0x0CA8, 0x0ECC, 0x0EEE, 0x0EEE, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE04333, 
	0xE03343, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03433, 0xE04333, 0xE03333, 
	0xE03333, 0xE03334, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE04466, 
	0xE06443, 0xE03333, 0xE03343, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03334, 0xE03333, 0xE027BD, 0xE0DEEE, 
	0xE0EDDC, 0xE0B763, 0xE03333, 0xE03334, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE0347C, 0xE0EEEE, 0xE0EEEE, 
	0xE0DDCC, 0xE0CDDD, 0xE07633, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03334, 0xE07DED, 0xE0DEEE, 0xE0EEEE, 
	0xE0DCBB, 0xE0BBDD, 0xE0DDB6, 0xE03433, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03343, 0xE0347D, 0xE0EEEE, 0xE0EDEE, 0xE0EEED, 
	0xE0DDDC, 0xE0BBCE, 0xE0DDDD, 0xE07433, 0xE04333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE02DEE, 0xE0EEED, 0xE0EDEE, 0xE0EEED, 
	0xE0EEEE, 0xE0EEEE, 0xE0EDCC, 0xE0EC23, 0xE03343, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03347, 0xE0EEED, 0xE0DDCC, 0xE0CCDE, 0xE0EEDE, 
	0xE0EDEE, 0xE0DDDC, 0xE0CBBC, 0xE0DDDB, 0xE04333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE033BE, 0xE0ECCC, 0xE0DDDC, 0xE0CDEE, 0xE0EEDC, 
	0xE0CCCB, 0xE0CCCC, 0xE0BBCB, 0xE0CDEE, 0xE0B433, 0xE03433, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE04BED, 0xE0CCCD, 0xE0CDCC, 0xE0CDCC, 0xE0DDDC, 
	0xE0BBAB, 0xE0BCCC, 0xE0BBBB, 0xE0BDED, 0xE0EC43, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE07EDD, 0xE0CCCD, 0xE0CCCC, 0xE0BBAA, 0xE0BCCC, 
	0xE0BBAB, 0xE0BBBC, 0xE0CBBB, 0xE0BCDD, 0xE0DEB4, 0xE03343, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03337, 0xE0EDDC, 0xE0CDDD, 0xE0CDCB, 0xE0BCBB, 0xE0BABB, 
	0xE0BAAA, 0xE0BBBC, 0xE0CCBC, 0xE0CBCC, 0xE0DDEB, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE0336E, 0xE0EDCC, 0xE0CCDD, 0xE0DCBB, 0xE0BBBA, 0xE0BBBB, 
	0xE0ABAB, 0xE0BBDD, 0xE0DDDC, 0xE0CCDD, 0xE0CEDE, 0xE02343, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE033DE, 0xE0DCCC, 0xE0CDDD, 0xE0CBBB, 0xE0ABCB, 0xE0BBBA, 
	0xE0BBAA, 0xE0BBDE, 0xE0DEEE, 0xE0EDDD, 0xE0DEEE, 0xE0E434, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE037EE, 0xE0CCBC, 0xE0CDDD, 0xE0CBAB, 0xE0BBBB, 0xE0BBBA, 
	0xE0ABBB, 0xE0BBCD, 0xE0DDEE, 0xE0EEED, 0xE0CDEE, 0xE0EB33, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE04DED, 0xE0BCDD, 0xE0DCDC, 0xE0DBBB, 0xE0ABAA, 0xE0CCCA, 
	0xE0AABB, 0xE0BBBC, 0xE0DDDB, 0xE0CEDD, 0xE0DEEE, 0xE0EE23, 0xE04333, 0xE03333, 
	0xE03333, 0xE03333, 0xE07ECC, 0xE0BCDC, 0xE0CCCC, 0xE0BCBB, 0xE0AAAB, 0xE0CCCB, 
	0xE0BBBB, 0xE0CCDC, 0xE0CCDC, 0xE0CCCD, 0xE0EEEE, 0xE0EEB3, 0xE03343, 0xE03333, 
	0xE03333, 0xE03333, 0xE0CDCB, 0xE0CBCB, 0xE0BCBC, 0xE0CCCC, 0xE0BABB, 0xE0CBCD, 
	0xE0CCCC, 0xE0CEEC, 0xE0DEED, 0xE0BCCE, 0xE0EEEE, 0xE0EEE2, 0xE03333, 0xE03333, 
	0xE03333, 0xE03332, 0xE0DCAC, 0xE0BBBA, 0xE0BCBC, 0xE0CCCC, 0xE0CBBC, 0xE0CBCD, 
	0xE0DCDD, 0xE0EEEE, 0xE0EEEE, 0xE0DDDE, 0xE0DEEE, 0xE0EEE7, 0xE03343, 0xE03333, 
	0xE03333, 0xE03337, 0xE0BBBC, 0xE0CBBA, 0xE0BBBB, 0xE0CBBD, 0xE0CCBB, 0xE0BABD, 
	0xE0DEDE, 0xE0EEEE, 0xE0EEEE, 0xE0EEEE, 0xE0EEEE, 0xE0EEEC, 0xE04333, 0xE03333, 
	0xE03333, 0xE0333A, 0xE0CBBB, 0xE0AAAA, 0xE0AABB, 0xE0BCCD, 0xE0CCBA, 0xE0ABCD, 
	0xE0EEDE, 0xE0DEEE, 0xE0EEEE, 0xE0EEEE, 0xE0EEEE, 0xE0EEDD, 0xE06333, 0xE04333, 
	0xE03333, 0xE0334A, 0xE0BBBB, 0xE0A9AA, 0xE0AAAB, 0xE0CCBC, 0xE0DBBA, 0xE0BCCD, 
	0xE0EDED, 0xE0EEEE, 0xE0EEEE, 0xE0EEEE, 0xE0EEEE, 0xE0EEED, 0xE07343, 0xE03333, 
	0xE03333, 0xE0334B, 0xE0ABBB, 0xE0999A, 0xE0AAAB, 0xE0BBAB, 0xE0CBBC, 0xE0CDDD, 
	0xE0DEDE, 0xE0EDEE, 0xE0EEEE, 0xE0DEEE, 0xE0EDEE, 0xE0EEDE, 0xE0B333, 0xE03333, 
	0xE03333, 0xE0336A, 0xE0ABBA, 0xE0999A, 0xE0A9AB, 0xE0AABB, 0xE0CBAB, 0xE0CCCC, 
	0xE0DDED, 0xE0EEDE, 0xE0DDEE, 0xE0DEEE, 0xE0EEDE, 0xE0EEED, 0xE0B434, 0xE03333, 
	0xE03333, 0xE03349, 0xE09BB9, 0xE05999, 0xE09AAB, 0xE0AABB, 0xE0BBAB, 0xE0DCCC, 
	0xE0CDDD, 0xE0EDDE, 0xE0EEDE, 0xE0DEEE, 0xE0EDEE, 0xE0EEEE, 0xE0C433, 0xE03333, 
	0xE03333, 0xE03345, 0xE09BA5, 0xE09599, 0xE09AAA, 0xE0ABBB, 0xE0BBBA, 0xE0BBBB, 
	0xE0CDDD, 0xE0DDDD, 0xE0DDEE, 0xE0DEEE, 0xE0EDEE, 0xE0EEED, 0xE0D434, 0xE03333, 
	0xE03333, 0xE03348, 0xE05BA9, 0xE05999, 0xE09A9A, 0xE0ABBC, 0xE0BBB9, 0xE0ABCC, 
	0xE0DDDD, 0xE0DDDE, 0xE0DDEE, 0xE0EDEE, 0xE0DEED, 0xE0EEED, 0xE0D633, 0xE03333, 
	0xE03333, 0xE03348, 0xE059AA, 0xE05959, 0xE09AAA, 0xE0ABCB, 0xE0CCBA, 0xE0ABCC, 
	0xE0DDDC, 0xE0CDDE, 0xE0DDEE, 0xE0EDEE, 0xE0EEEE, 0xE0EEED, 0xE0E634, 0xE03333, 
	0xE03333, 0xE03338, 0xE089A9, 0xE05999, 0xE0999A, 0xE0ABBC, 0xE0CBBA, 0xE0BBCD, 
	0xE0CDCD, 0xE0DDDD, 0xE0DDDE, 0xE0EEEE, 0xE0EEED, 0xE0EDEE, 0xE0D633, 0xE03333, 
	0xE03333, 0xE03336, 0xE08559, 0xE09599, 0xE059AA, 0xE0ACCC, 0xE0CBAB, 0xE0BACD, 
	0xE0DCDC, 0xE0DCDC, 0xE0DEEE, 0xE0EEEE, 0xE0EEED, 0xE0EEDE, 0xE0E434, 0xE03333, 
	0xE03333, 0xE03334, 0xE08855, 0xE05599, 0xE09AAB, 0xE0BBCD, 0xE0CBAA, 0xE0BBCC, 
	0xE0BBCC, 0xE0CDDD, 0xE0DEEE, 0xE0EEEE, 0xE0EEDD, 0xE0DEEE, 0xE0D433, 0xE03333, 
	0xE03333, 0xE03333, 0xE08885, 0xE05595, 0xE0599B, 0xE0BCCC, 0xE0BCBC, 0xE0BCBA, 
	0xE0ABBB, 0xE0BDDD, 0xE0DDEE, 0xE0EEEE, 0xE0EDDE, 0xE0EDDE, 0xE0D343, 0xE03333, 
	0xE03333, 0xE03333, 0xE04888, 0xE05555, 0xE0999B, 0xE0BBCB, 0xE0BBCB, 0xE0BCBC, 
	0xE0BBAA, 0xE0BBCC, 0xE0DEEE, 0xE0EEEE, 0xE0EEED, 0xE0EDEE, 0xE0B334, 0xE03333, 
	0xE03333, 0xE03333, 0xE04688, 0xE05595, 0xE05559, 0xE0ABAB, 0xE0CBBA, 0xE0ACBC, 
	0xE0BCAB, 0xE0ABBB, 0xE0CEEE, 0xE0EEEE, 0xE0EEED, 0xE0DEDE, 0xE07333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03468, 0xE08595, 0xE09999, 0xE099AB, 0xE0AAAA, 0xE0AAAA, 
	0xE0BABA, 0xE0AAAB, 0xE0CEEE, 0xE0EEEE, 0xE0EEED, 0xE0EDEE, 0xE02333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03468, 0xE08995, 0xE05999, 0xE0AAAA, 0xE0AAAA, 0xE0AA9A, 
	0xE0AABA, 0xE0AAAB, 0xE0CEEE, 0xE0EEEE, 0xE0EEDE, 0xE0DEED, 0xE04333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03346, 0xE08555, 0xE08599, 0xE0BBA9, 0xE0A9AA, 0xE0A99A, 
	0xE0BAAB, 0xE0AAAB, 0xE0CDEE, 0xE0EEEE, 0xE0EEDE, 0xE0DEE7, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03336, 0xE06888, 0xE08589, 0xE0AB99, 0xE0999A, 0xE0BA9A, 
	0xE0CABB, 0xE0AABC, 0xE0CDEE, 0xE0EEEE, 0xE0EDDD, 0xE0DEE6, 0xE03433, 0xE03333, 
	0xE03333, 0xE03333, 0xE03334, 0xE04688, 0xE08855, 0xE05999, 0xE05599, 0xE0AA9A, 
	0xE0BBBB, 0xE0BBBD, 0xE0DDED, 0xE0EEEE, 0xE0DDDD, 0xE0DEB3, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE04668, 0xE08888, 0xE08555, 0xE05559, 0xE05595, 
	0xE0ABAA, 0xE0ABCC, 0xE0DDDD, 0xE0DDDE, 0xE0DEED, 0xE0EC63, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03466, 0xE06688, 0xE08888, 0xE05855, 0xE05599, 
	0xE0ABAA, 0xE0ABBB, 0xE0CCCD, 0xE0DDDD, 0xE0DDED, 0xE0C833, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03346, 0xE06888, 0xE08885, 0xE08555, 0xE09999, 
	0xE05A9A, 0xE0BAAB, 0xE0CCCC, 0xE0CCDC, 0xE0CDCC, 0xE07333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03334, 0xE04668, 0xE08888, 0xE08585, 0xE09AA5, 
	0xE05859, 0xE0BAAB, 0xE0BCCC, 0xE0BCCC, 0xE0CCCA, 0xE04333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE04666, 0xE08888, 0xE08885, 0xE09AA5, 
	0xE05559, 0xE0ABBB, 0xE0CBCB, 0xE0CBBC, 0xE0BB74, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03446, 0xE06668, 0xE08885, 0xE05995, 
	0xE05555, 0xE0AABB, 0xE0BBBB, 0xE0ABBB, 0xE0B963, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03344, 0xE04668, 0xE06885, 0xE059A9, 
	0xE095AA, 0xE0A99B, 0xE0AAA9, 0xE0AAB9, 0xE08433, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03334, 0xE04666, 0xE08885, 0xE08599, 
	0xE09AAA, 0xE099A9, 0xE09999, 0xE09986, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03346, 0xE08888, 0xE05559, 
	0xE09AA9, 0xE09955, 0xE09555, 0xE08843, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03334, 0xE04628, 0xE08885, 
	0xE05855, 0xE08888, 0xE08886, 0xE04333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03334, 0xE06888, 
	0xE08888, 0xE08886, 0xE04433, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03343, 
	0xE04343, 0xE04333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
	0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 0xE03333, 
};
Everything up through the palette was fine, but the body can't possibly be right - the values aren't even u16's! So I tried the Windows executable... same exact output. So I looked at the source closely...

Code: Select all

         while (offset < len) do begin
            ss:= '';
            for ii:= 0 to ((16 div formatint) - 1)  do begin
               if (MemInput.Read(jj, formatint) <> 0) then ss:= ss + '0x' + IntToHex(jj, 2 * formatint) + ', '
            end;

            Inc(offset, 16);
            FileOutput.Add(#9 + ss);
         end;
I had a hunch and did this

Code: Select all

         while (offset < len) do begin
            ss:= '';
            for ii:= 0 to ((16 div formatint) - 1)  do begin
               jj := 0;
               if (MemInput.Read(jj, formatint) <> 0) then ss:= ss + '0x' + IntToHex(jj, 2 * formatint) + ', '
            end;

            Inc(offset, 16);
            FileOutput.Add(#9 + ss);
         end;
and now I get this output

Code: Select all

#include "genesis.h"

const u16 moon[0x0412] = {
	0x0040, 0x0040, 
	0x0000, 0x0EEE, 0x0442, 0x0000, 0x0420, 0x0A42, 0x0422, 0x0866, 0x0842, 0x0A64, 0x0C64, 0x0C86, 0x0CA8, 0x0ECC, 0x0EEE, 0x0EEE, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x4333, 
	0x3343, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3433, 0x4333, 0x3333, 
	0x3333, 0x3334, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x4466, 
	0x6443, 0x3333, 0x3343, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3334, 0x3333, 0x27BD, 0xDEEE, 
	0xEDDC, 0xB763, 0x3333, 0x3334, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x347C, 0xEEEE, 0xEEEE, 
	0xDDCC, 0xCDDD, 0x7633, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3334, 0x7DED, 0xDEEE, 0xEEEE, 
	0xDCBB, 0xBBDD, 0xDDB6, 0x3433, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3343, 0x347D, 0xEEEE, 0xEDEE, 0xEEED, 
	0xDDDC, 0xBBCE, 0xDDDD, 0x7433, 0x4333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x2DEE, 0xEEED, 0xEDEE, 0xEEED, 
	0xEEEE, 0xEEEE, 0xEDCC, 0xEC23, 0x3343, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3347, 0xEEED, 0xDDCC, 0xCCDE, 0xEEDE, 
	0xEDEE, 0xDDDC, 0xCBBC, 0xDDDB, 0x4333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x33BE, 0xECCC, 0xDDDC, 0xCDEE, 0xEEDC, 
	0xCCCB, 0xCCCC, 0xBBCB, 0xCDEE, 0xB433, 0x3433, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x4BED, 0xCCCD, 0xCDCC, 0xCDCC, 0xDDDC, 
	0xBBAB, 0xBCCC, 0xBBBB, 0xBDED, 0xEC43, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x7EDD, 0xCCCD, 0xCCCC, 0xBBAA, 0xBCCC, 
	0xBBAB, 0xBBBC, 0xCBBB, 0xBCDD, 0xDEB4, 0x3343, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3337, 0xEDDC, 0xCDDD, 0xCDCB, 0xBCBB, 0xBABB, 
	0xBAAA, 0xBBBC, 0xCCBC, 0xCBCC, 0xDDEB, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x336E, 0xEDCC, 0xCCDD, 0xDCBB, 0xBBBA, 0xBBBB, 
	0xABAB, 0xBBDD, 0xDDDC, 0xCCDD, 0xCEDE, 0x2343, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x33DE, 0xDCCC, 0xCDDD, 0xCBBB, 0xABCB, 0xBBBA, 
	0xBBAA, 0xBBDE, 0xDEEE, 0xEDDD, 0xDEEE, 0xE434, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x37EE, 0xCCBC, 0xCDDD, 0xCBAB, 0xBBBB, 0xBBBA, 
	0xABBB, 0xBBCD, 0xDDEE, 0xEEED, 0xCDEE, 0xEB33, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x4DED, 0xBCDD, 0xDCDC, 0xDBBB, 0xABAA, 0xCCCA, 
	0xAABB, 0xBBBC, 0xDDDB, 0xCEDD, 0xDEEE, 0xEE23, 0x4333, 0x3333, 
	0x3333, 0x3333, 0x7ECC, 0xBCDC, 0xCCCC, 0xBCBB, 0xAAAB, 0xCCCB, 
	0xBBBB, 0xCCDC, 0xCCDC, 0xCCCD, 0xEEEE, 0xEEB3, 0x3343, 0x3333, 
	0x3333, 0x3333, 0xCDCB, 0xCBCB, 0xBCBC, 0xCCCC, 0xBABB, 0xCBCD, 
	0xCCCC, 0xCEEC, 0xDEED, 0xBCCE, 0xEEEE, 0xEEE2, 0x3333, 0x3333, 
	0x3333, 0x3332, 0xDCAC, 0xBBBA, 0xBCBC, 0xCCCC, 0xCBBC, 0xCBCD, 
	0xDCDD, 0xEEEE, 0xEEEE, 0xDDDE, 0xDEEE, 0xEEE7, 0x3343, 0x3333, 
	0x3333, 0x3337, 0xBBBC, 0xCBBA, 0xBBBB, 0xCBBD, 0xCCBB, 0xBABD, 
	0xDEDE, 0xEEEE, 0xEEEE, 0xEEEE, 0xEEEE, 0xEEEC, 0x4333, 0x3333, 
	0x3333, 0x333A, 0xCBBB, 0xAAAA, 0xAABB, 0xBCCD, 0xCCBA, 0xABCD, 
	0xEEDE, 0xDEEE, 0xEEEE, 0xEEEE, 0xEEEE, 0xEEDD, 0x6333, 0x4333, 
	0x3333, 0x334A, 0xBBBB, 0xA9AA, 0xAAAB, 0xCCBC, 0xDBBA, 0xBCCD, 
	0xEDED, 0xEEEE, 0xEEEE, 0xEEEE, 0xEEEE, 0xEEED, 0x7343, 0x3333, 
	0x3333, 0x334B, 0xABBB, 0x999A, 0xAAAB, 0xBBAB, 0xCBBC, 0xCDDD, 
	0xDEDE, 0xEDEE, 0xEEEE, 0xDEEE, 0xEDEE, 0xEEDE, 0xB333, 0x3333, 
	0x3333, 0x336A, 0xABBA, 0x999A, 0xA9AB, 0xAABB, 0xCBAB, 0xCCCC, 
	0xDDED, 0xEEDE, 0xDDEE, 0xDEEE, 0xEEDE, 0xEEED, 0xB434, 0x3333, 
	0x3333, 0x3349, 0x9BB9, 0x5999, 0x9AAB, 0xAABB, 0xBBAB, 0xDCCC, 
	0xCDDD, 0xEDDE, 0xEEDE, 0xDEEE, 0xEDEE, 0xEEEE, 0xC433, 0x3333, 
	0x3333, 0x3345, 0x9BA5, 0x9599, 0x9AAA, 0xABBB, 0xBBBA, 0xBBBB, 
	0xCDDD, 0xDDDD, 0xDDEE, 0xDEEE, 0xEDEE, 0xEEED, 0xD434, 0x3333, 
	0x3333, 0x3348, 0x5BA9, 0x5999, 0x9A9A, 0xABBC, 0xBBB9, 0xABCC, 
	0xDDDD, 0xDDDE, 0xDDEE, 0xEDEE, 0xDEED, 0xEEED, 0xD633, 0x3333, 
	0x3333, 0x3348, 0x59AA, 0x5959, 0x9AAA, 0xABCB, 0xCCBA, 0xABCC, 
	0xDDDC, 0xCDDE, 0xDDEE, 0xEDEE, 0xEEEE, 0xEEED, 0xE634, 0x3333, 
	0x3333, 0x3338, 0x89A9, 0x5999, 0x999A, 0xABBC, 0xCBBA, 0xBBCD, 
	0xCDCD, 0xDDDD, 0xDDDE, 0xEEEE, 0xEEED, 0xEDEE, 0xD633, 0x3333, 
	0x3333, 0x3336, 0x8559, 0x9599, 0x59AA, 0xACCC, 0xCBAB, 0xBACD, 
	0xDCDC, 0xDCDC, 0xDEEE, 0xEEEE, 0xEEED, 0xEEDE, 0xE434, 0x3333, 
	0x3333, 0x3334, 0x8855, 0x5599, 0x9AAB, 0xBBCD, 0xCBAA, 0xBBCC, 
	0xBBCC, 0xCDDD, 0xDEEE, 0xEEEE, 0xEEDD, 0xDEEE, 0xD433, 0x3333, 
	0x3333, 0x3333, 0x8885, 0x5595, 0x599B, 0xBCCC, 0xBCBC, 0xBCBA, 
	0xABBB, 0xBDDD, 0xDDEE, 0xEEEE, 0xEDDE, 0xEDDE, 0xD343, 0x3333, 
	0x3333, 0x3333, 0x4888, 0x5555, 0x999B, 0xBBCB, 0xBBCB, 0xBCBC, 
	0xBBAA, 0xBBCC, 0xDEEE, 0xEEEE, 0xEEED, 0xEDEE, 0xB334, 0x3333, 
	0x3333, 0x3333, 0x4688, 0x5595, 0x5559, 0xABAB, 0xCBBA, 0xACBC, 
	0xBCAB, 0xABBB, 0xCEEE, 0xEEEE, 0xEEED, 0xDEDE, 0x7333, 0x3333, 
	0x3333, 0x3333, 0x3468, 0x8595, 0x9999, 0x99AB, 0xAAAA, 0xAAAA, 
	0xBABA, 0xAAAB, 0xCEEE, 0xEEEE, 0xEEED, 0xEDEE, 0x2333, 0x3333, 
	0x3333, 0x3333, 0x3468, 0x8995, 0x5999, 0xAAAA, 0xAAAA, 0xAA9A, 
	0xAABA, 0xAAAB, 0xCEEE, 0xEEEE, 0xEEDE, 0xDEED, 0x4333, 0x3333, 
	0x3333, 0x3333, 0x3346, 0x8555, 0x8599, 0xBBA9, 0xA9AA, 0xA99A, 
	0xBAAB, 0xAAAB, 0xCDEE, 0xEEEE, 0xEEDE, 0xDEE7, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3336, 0x6888, 0x8589, 0xAB99, 0x999A, 0xBA9A, 
	0xCABB, 0xAABC, 0xCDEE, 0xEEEE, 0xEDDD, 0xDEE6, 0x3433, 0x3333, 
	0x3333, 0x3333, 0x3334, 0x4688, 0x8855, 0x5999, 0x5599, 0xAA9A, 
	0xBBBB, 0xBBBD, 0xDDED, 0xEEEE, 0xDDDD, 0xDEB3, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x4668, 0x8888, 0x8555, 0x5559, 0x5595, 
	0xABAA, 0xABCC, 0xDDDD, 0xDDDE, 0xDEED, 0xEC63, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3466, 0x6688, 0x8888, 0x5855, 0x5599, 
	0xABAA, 0xABBB, 0xCCCD, 0xDDDD, 0xDDED, 0xC833, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3346, 0x6888, 0x8885, 0x8555, 0x9999, 
	0x5A9A, 0xBAAB, 0xCCCC, 0xCCDC, 0xCDCC, 0x7333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3334, 0x4668, 0x8888, 0x8585, 0x9AA5, 
	0x5859, 0xBAAB, 0xBCCC, 0xBCCC, 0xCCCA, 0x4333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x4666, 0x8888, 0x8885, 0x9AA5, 
	0x5559, 0xABBB, 0xCBCB, 0xCBBC, 0xBB74, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3446, 0x6668, 0x8885, 0x5995, 
	0x5555, 0xAABB, 0xBBBB, 0xABBB, 0xB963, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3344, 0x4668, 0x6885, 0x59A9, 
	0x95AA, 0xA99B, 0xAAA9, 0xAAB9, 0x8433, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3334, 0x4666, 0x8885, 0x8599, 
	0x9AAA, 0x99A9, 0x9999, 0x9986, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3346, 0x8888, 0x5559, 
	0x9AA9, 0x9955, 0x9555, 0x8843, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3334, 0x4628, 0x8885, 
	0x5855, 0x8888, 0x8886, 0x4333, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3334, 0x6888, 
	0x8888, 0x8886, 0x4433, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3343, 
	0x4343, 0x4333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 
	0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 
};
What do ya know! Apparently MemInput.Read only writes over as many bytes as you tell it, leaving the rest alone. Combine that with IntToHex ignoring the length if there's more data and you get the wrong output seen at the top.

Post Reply