Thread: How To Incorporate input_byte In For Loop Query ?

  1. #31
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,651
    There may be two images in each of the .PNL files.
    How To Incorporate input_byte In For Loop Query ?-p51bd_outfile_0-png

    How To Incorporate input_byte In For Loop Query ?-p51bd_outfile_1-png

    How To Incorporate input_byte In For Loop Query ?-p51dd_outfile_0-png

    How To Incorporate input_byte In For Loop Query ?-p51dd_outfile_1-png
    The large ones are definitely 320 x 188.
    The small ones are 40-ish x 104.

    I don't know if they're anything real or not. The width is a bit small?
    It also looks like it might be something if it were de-skewed in some way.

    If you put the PNL files into a hex editor, you'll see two instances of the "FE FF" pair, which mark the end of a row, and then the end of the image.


    The code.
    Code:
    #include <stdio.h>
    #include <stdlib.h>
    #include <stdbool.h>
    #include <string.h>
    #include <limits.h>
    
    // Originally posted by john.c on
    // https://cboard.cprogramming.com/csharp-programming/181449-how-incorporate-input_byte-loop-query-post1307547.html#post1307547
    
    /**
    P51BD.002.bmp   
    Pixels start at offset 0x0436 with a run of 44(2C) bytes of 0x40
    40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
    40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
    40 40 40 40 40 40 40 40 40 40 40 40 11 14 14 14 
    14 14 2E 0B 00 00 05 06 06 06 06 06 06 05 0A 0E 
    2E 2E 0A 0A 0A 0A 07 07 05 07 07 07 07 07 07 07 
    40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
    40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 ... more!
    
    P51BD.PNL
    Data starts at offset 0x3ED
    FD 2B 40 
    44
    FD 04 14
    B8
    2C
    01
    14
    FD 05 06
    14
    28
    38
    B9
    2B
    1D
    14
    FD 06 07
    FD 9F 40
    
    P51DD.002.bmp
    Pixels start at offset 0x0436 with a run of 60(3E) bytes of 0x40
    40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
    40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40
    40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
    40 40 40 40 40 40 40 40 40 40 40 40 40 40 12 30
    30 30 30 12 0C 08 07 07 09 0A 0B 08 06 08 10 0E
    
    P51DD.PNL
    Data starts at offset 0x438
    FD 3D 40
    48
    C3
    48
    30
    20
    1D
    24
    28
    2C
    20
    18
    20
    40
    38
    2C
    48
    FD 9B 40
    48
    2C 
    38 
    40 
    20 
    18 
    20 
    2C 
    28 
    24 
    1D 
    20 
    30 
    48 
    C3 
    48 
    FD 3D 40
     */
    
    #define MAX_W   600
    #define MAX_H   300
    
    struct {
        char    output_buffer[MAX_H][MAX_W];
        int     row_length[MAX_H];
        int     bufsize;
        int     current_output_index;
        int     RLE_sumador;
        int     line_min_length;
        int     line_max_length;
        int     width_current;
        int     image_height;
    } info;
    
    void reset() {
        memset(info.output_buffer,0,sizeof(info.output_buffer));
        memset(info.row_length,0,sizeof(info.row_length));
        info.bufsize = 0;
        info.current_output_index++;
        info.RLE_sumador     = 0;
        info.line_min_length = INT_MAX;
        info.line_max_length = 0;
        info.width_current   = 0;
        info.image_height    = 0;
    }
    
    void Save() {
        char buff[20];
        sprintf(buff,"outfile_%d.pgm",info.current_output_index);
        FILE *fp = fopen(buff,"wb");
        fprintf(fp,"P5\n%d %d\n255\n",info.line_max_length,info.image_height);
        for(int r = 0 ; r < info.image_height ; r++ ) {
            fwrite(info.output_buffer[r],info.line_max_length,1,fp);
        }
        fclose(fp);
    }
     
    void Add(int byte) {
        if ( info.image_height < MAX_H && info.width_current < MAX_W ) {
            info.output_buffer[info.image_height][info.width_current++] = byte;
        }
    }
     
    int main(int argc, char *argv[]) {
        if ( argc < 2 ) return 1;
        FILE *fp = fopen(argv[1],"rb");
        int count = 0, n = 0;
        //int forced_image_width = 320;
        int b, b2;
        bool RLE_FC_swap = false;
        int prev_byte;
     
        for (int input_byte; (input_byte = fgetc(fp)) != EOF; ) {
            if (input_byte == 0xFF) {
                // Finish chunk
                fprintf(stderr, "line_min_length: %d\n", info.line_min_length);
                fprintf(stderr, "line_max_length: %d\n", info.line_max_length);
                if (prev_byte == 0xFE) {    // got an end of row marker before it
                    Save();
                }
                reset();
            } else if (input_byte == 0xFE) {
                // Next line
                if (info.width_current < info.line_min_length)
                    info.line_min_length = info.width_current;
                if (info.width_current > info.line_max_length)
                    info.line_max_length = info.width_current;
                //if (forced_image_width) {
                //    count = forced_image_width - info.width_current;
                //    if (count > 0)
                //        for (n = 0; n < count; n++)
                //            info.output_buffer[info.bufsize++] = 0;
                //}
                info.row_length[info.image_height] = info.width_current;
                info.image_height++;
                fprintf(stderr, "H=%d W=%d\n", info.image_height, info.width_current);
                info.width_current = 0;
      
            } else if (input_byte == 0xFD) {
                count = fgetc(fp) + 1;
                b = fgetc(fp);
                for (n = 0; n < count; n++)
                    Add(b);
            } else if (input_byte == 0xFC) {
                b = fgetc(fp) + 1;
                b2 = b + 1;
                count = fgetc(fp) + 1;
                RLE_FC_swap = false;
                for (n = 0; n < count; n++) {
                    Add(RLE_FC_swap ? b2 : b);
                    RLE_FC_swap = !RLE_FC_swap;
                }
            } else if (input_byte == 0xFB) {
                info.RLE_sumador = fgetc(fp);
            } else {
                b = input_byte >> 2;
                b += info.RLE_sumador;
                count = (input_byte & 3) + 1;
                for (n = 0; n < count; n++)
                    Add(b);
            }
            prev_byte = input_byte;
        }
        return 0;
    }
    
    
    # usage
    ./a.out P51DD.PNL
    ./a.out P51BD.PNL
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  2. #32
    Registered User
    Join Date
    Jan 2023
    Posts
    39
    Hi Salem,

    Do you run that Code you posted in Visual Studio ? if not what program are you using to run the Code ? Did john.c write that code from scratch ? Or has he adapted an existing code, and if so where on the internet is it ?

    Eddie

  3. #33
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,651
    For small programs like this, I just use any handy text editor and compile from the command line.

    I thought john.c derived his code from one of your earlier posts.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #34
    Registered User
    Join Date
    Jan 2023
    Posts
    39
    Yes I think your right Salem, I think John has derived it from the code I posted, it looks that way looking at the Code he has posted, how did you get the code to use those Files, I mean use the code on the Files I uploaded ?

  5. #35
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,651
    These are all the commands I typed.
    The .PNL files come from your ZIP files.
    Code:
    gcc -g decoder.c 
    ./a.out P51DD.PNL
    convert outfile_0.pgm P51DD_outfile_0.png
    convert outfile_1.pgm P51DD_outfile_1.png
    
    ./a.out P51BD.PNL
    convert outfile_0.pgm P51BD_outfile_0.png
    convert outfile_1.pgm P51BD_outfile_1.png
    convert is part of the imagemagik suite of graphical file manipulation programs.

    Code:
    int main(int argc, char *argv[]) {
        if ( argc < 2 ) return 1;
        FILE *fp = fopen(argv[1],"rb");
    This is how command line parameters are handled.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  6. #36
    Registered User
    Join Date
    Dec 2017
    Posts
    1,626
    The "adder" (sumador) thing doesn't make much sense. I don't see the point in offsetting the value. maybe the count, but even that's probably not that useful. I noticed a lot of 0xFA's being used (quite systematically) in the first images encoding in the PNLs, so that's probably a code, too (although there are no FAs in the PAC). Who knows what it does. What software is supposed to decode these? What game are they from?

    I scanned the given bmps byte values (starting at offset 0x436) and all values are from 0 to 64, inclusive. Given the way the palette is laid out, 64 is the same as 0 (both black). But, e.g., the image P51DD.002.bmp contains 6468 0 values and 20527 64 values (by far the most of any value). Perhaps 64 (0x40) is meant as a transparent value. I'm guessing the "windows" are that color. I've added bmp output below with the wacky palette so that 0x40 will be rendered as black.

    Your 0-inited grid idea is essentially the same as the "forced" idea, but more sensible. I'm pretty sure that all lines are supposed to decode to the same length and that they are not doing so in some instances is a problem in our (given) algorithm.

    Still getting a scrambled result on the PAC file. All of the lines should be 320. The first line decodes to 320, the second to 312. So 8 pixels are missing. The first 10 rows look like the following. Bracketed hex values are the file bytes. Count and value are in decimal. Height and width are shown after each [FE] along with the difference 320-width. Interestingly, there are no 64 values. The highest value used is 60 (in the entire image).
    Code:
    [FD]  47[2E] *  3[03]
    [FD] 110[6D] *  0[00]
    [39]   2     * 14
    [42]   3     * 16
    [39]   2     * 14
    [FD] 110[6D] *  0[00]
    [FD]  46[2D] *  3[03]
    [FE] ----------------    1   320  (   0)
    [FD]  43[2A] *  3[03]
    [04]   1     *  1
    [FD] 107[6A] *  7[07]
    [00]   1     *  0
    [39]   2     * 14
    [58]   1     * 22
    [02]   3     *  0
    [58]   1     * 22
    [39]   2     * 14
    [00]   1     *  0
    [FD] 107[6A] *  7[07]
    [04]   1     *  1
    [FD]  42[29] *  3[03]
    [FE] ----------------    2   312  (   8)
    [FD]  41[28] *  3[03]
    [02]   3     *  0
    [3B]   4     * 14
    [FD] 107[6A] *  0[00]
    [39]   2     * 14
    [58]   1     * 22
    [00]   1     *  0
    [A1]   2     * 40
    [98]   1     * 38
    [00]   1     *  0
    [58]   1     * 22
    [39]   2     * 14
    [FD] 107[6A] *  0[00]
    [3B]   4     * 14
    [02]   3     *  0
    [FD]  40[27] *  3[03]
    [FE] ----------------    3   320  (   0)
    [FD]  39[26] *  3[03]
    [01]   2     *  0
    [3A]   3     * 14
    [FD] 111[6E] *  0[00]
    [38]   1     * 14
    [58]   1     * 22
    [00]   1     *  0
    [A0]   1     * 40
    [9A]   3     * 38
    [F0]   1     * 60
    [00]   1     *  0
    [58]   1     * 22
    [38]   1     * 14
    [FD] 111[6E] *  0[00]
    [3A]   3     * 14
    [01]   2     *  0
    [FD]  38[25] *  3[03]
    [FE] ----------------    4   320  (   0)
    [FD]  37[24] *  3[03]
    [01]   2     *  0
    [39]   2     * 14
    [04]   1     *  1
    [FD] 110[6D] *  6[06]
    [58]   1     * 22
    [00]   1     *  0
    [A0]   1     * 40
    [99]   2     * 38
    [F1]   2     * 60
    [00]   1     *  0
    [58]   1     * 22
    [FD] 110[6D] *  6[06]
    [04]   1     *  1
    [39]   2     * 14
    [01]   2     *  0
    [FD]  36[23] *  3[03]
    [FE] ----------------    5   312  (   8)
    [FD]  35[22] *  3[03]
    [01]   2     *  0
    [39]   2     * 14
    [03]   4     *  0
    [32]   3     * 12
    [FD] 110[6D] *  7[07]
    [58]   1     * 22
    [00]   1     *  0
    [99]   2     * 38
    [F2]   3     * 60
    [00]   1     *  0
    [58]   1     * 22
    [FD] 110[6D] *  7[07]
    [32]   3     * 12
    [03]   4     *  0
    [39]   2     * 14
    [01]   2     *  0
    [FD]  34[21] *  3[03]
    [FE] ----------------    6   320  (   0)
    [FD]  33[20] *  3[03]
    [01]   2     *  0
    [39]   2     * 14
    [03]   4     *  0
    [31]   2     * 12
    [FD] 114[71] *  7[07]
    [58]   1     * 22
    [00]   1     *  0
    [F2]   3     * 60
    [00]   1     *  0
    [58]   1     * 22
    [FD] 114[71] *  7[07]
    [31]   2     * 12
    [03]   4     *  0
    [39]   2     * 14
    [01]   2     *  0
    [FD]  32[1F] *  3[03]
    [FE] ----------------    7   320  (   0)
    [FD]  32[1F] *  3[03]
    [01]   2     *  0
    [38]   1     * 14
    [04]   1     *  1
    [30]   1     * 12
    [3F]   4     * 15
    [FD]  10[09] *  4[04]
    [78]   1     * 30
    [27]   4     *  9
    [7A]   3     * 30
    [22]   3     *  8
    [78]   1     * 30
    [27]   4     *  9
    [78]   1     * 30
    [FD]  13[0C] *  4[04]
    [FD]  11[0A] *  0[00]
    [FD]  12[0B] *  4[04]
    [7B]   4     * 30
    [FD]  18[11] *  4[04]
    [78]   1     * 30
    [FD]  11[0A] *  4[04]
    [3B]   4     * 14
    [58]   1     * 22
    [02]   3     *  0
    [58]   1     * 22
    [3B]   4     * 14
    [FD]  10[09] *  4[04]
    [7A]   3     * 30
    [FD]   9[08] *  4[04]
    [78]   1     * 30
    [FD]  10[09] *  4[04]
    [78]   1     * 30
    [FD]  12[0B] *  4[04]
    [FD]  11[0A] *  0[00]
    [FD]  15[0E] *  4[04]
    [79]   2     * 30
    [FD]  11[0A] *  4[04]
    [78]   1     * 30
    [25]   2     *  9
    [78]   1     * 30
    [25]   2     *  9
    [7A]   3     * 30
    [22]   3     *  8
    [3F]   4     * 15
    [30]   1     * 12
    [04]   1     *  1
    [38]   1     * 14
    [01]   2     *  0
    [FD]  31[1E] *  3[03]
    [FE] ----------------    8   288  (  32)
    [FD]  31[1E] *  3[03]
    [00]   1     *  0
    [39]   2     * 14
    [03]   4     *  0
    [31]   2     * 12
    [3D]   2     * 15
    [22]   3     *  8
    [FD]  47[2E] *  3[03]
    [20]   1     *  8
    [FD]  10[09] *  0[00]
    [20]   1     *  8
    [FD]  46[2D] *  3[03]
    [22]   3     *  8
    [39]   2     * 14
    [5A]   3     * 22
    [39]   2     * 14
    [22]   3     *  8
    [FD]  46[2D] *  3[03]
    [20]   1     *  8
    [FD]  10[09] *  0[00]
    [20]   1     *  8
    [39]   2     * 14
    [FD]  45[2C] *  3[03]
    [22]   3     *  8
    [3D]   2     * 15
    [31]   2     * 12
    [03]   4     *  0
    [39]   2     * 14
    [00]   1     *  0
    [FD]  30[1D] *  3[03]
    [FE] ----------------    9   312  (   8)
    [FD]  30[1D] *  3[03]
    [00]   1     *  0
    [38]   1     * 14
    [04]   1     *  1
    [30]   1     * 12
    [3D]   2     * 15
    [21]   2     *  8
    [FD]  49[30] *  3[03]
    [20]   1     *  8
    [FD]  11[0A] *  0[00]
    [20]   1     *  8
    [FD]  49[30] *  3[03]
    [26]   3     *  9
    [FD]  49[30] *  3[03]
    [20]   1     *  8
    [FD]  11[0A] *  0[00]
    [20]   1     *  8
    [38]   1     * 14
    [FD]  48[2F] *  3[03]
    [21]   2     *  8
    [3D]   2     * 15
    [30]   1     * 12
    [04]   1     *  1
    [38]   1     * 14
    [00]   1     *  0
    [FD]  29[1C] *  3[03]
    [FE] ----------------   10   300  (  20)
    Code:
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <limits.h>
     
    #define MAX_W   600
    #define MAX_H   300
     
    typedef unsigned char Byte;
     
    struct Info {
        Byte    image[MAX_H][MAX_W];
        int     row_length[MAX_H];
        int     min_width, max_width;
        int     width, height;
        int     adder;
        int     output_file_index;
    } info;
     
    #define HEADER_SIZE     54
    #define PALETTE_ENTRIES 256
    #define PALETTE_SIZE    (PALETTE_ENTRIES * 4)   // 4 bytes per entry
    #define DATA_OFFSET     (HEADER_SIZE + PALETTE_SIZE)
     
    void Save() { 
        // Header format. "Negative" values indicate bytes filled in later
        // -1: filesize,  -2: width,  -3: height
        Byte header[HEADER_SIZE] = {
            0x42, 0x4D,   -1,   -1,   -1,   -1,    0,    0,
               0,    0, 0x36, 0x04,    0,    0, 0x28,    0,
               0,    0,   -2,   -2,   -2,   -2,   -3,   -3,
              -3,   -3, 0x01,    0, 0x08,    0,    0,    0,
               0,    0,    0,    0,    0,    0, 0x12, 0x0B,
               0,    0, 0x12, 0x0B
        };
     
        int pad = (4 - info.max_width % 4) % 4; // extra % 4 so 4 becomes 0
        int file_size = DATA_OFFSET + (info.max_width + pad) * info.height;
        Byte *output = malloc(file_size);
     
        memcpy(output, header, HEADER_SIZE);
        *(int*)(output + 0x2)  =  file_size;
        *(int*)(output + 0x12) =  info.max_width;
        *(int*)(output + 0x16) = -info.height;
     
        // palette of 0,4,8,...,252 repeated 4 times.
        // Only indices 0 to 64 are actually used (0 and 64 are both black).
        for (int pos = HEADER_SIZE, color = 0; color < PALETTE_ENTRIES; color++) {
            output[pos++] = color << 2;
            output[pos++] = color << 2;
            output[pos++] = color << 2;
            output[pos++] = 0;
        }
      
        for (int h = 0, pos = DATA_OFFSET; h < info.height; h++) {
            for (int w = 0; w < info.max_width; w++)
                output[pos++] = info.image[h][w];
            for (int p = 0; p < pad; p++)
                output[pos++] = 0;
        }
     
        char filename[100];
        sprintf(filename, "outfile_%d.bmp", info.output_file_index++);
        FILE *f = fopen(filename, "wb");
        fwrite(output, 1, file_size, f);
        fclose(f);
     
        free(output);
    }
     
    void reset() {
        int ofi = info.output_file_index;
        info = (struct Info){0};
        info.output_file_index = ofi;
    }
     
    void Add(int b) {
        if (info.height < MAX_H && info.width < MAX_W)
            info.image[info.height][info.width++] = b;
    }
      
    int main(int argc, char *argv[]) {
        if (argc < 2) {
            fprintf(stderr, "Usage: %s INPUT_FILE\n", argv[0]);
            exit(EXIT_FAILURE);
        }
     
        FILE *fp = fopen(argv[1], "rb");
        if (!fp) {
            perror(argv[1]);
            exit(EXIT_FAILURE);
        }
     
        for (int byte, prev; (byte = fgetc(fp)) != EOF; prev = byte) {
            //---------------------------------------------------------------
            if (byte == 0xFF) {
                // Finish chunk
                fprintf(stderr, "min_width: %d\n", info.min_width);
                fprintf(stderr, "max_width: %d\n", info.max_width);
                if (prev == 0xFE)    // got an end of row marker before it
                    Save();
                reset();
            //---------------------------------------------------------------
            } else if (byte == 0xFE) {
                // Next line
                if (info.width < info.min_width) info.min_width = info.width;
                if (info.width > info.max_width) info.max_width = info.width;
                info.row_length[info.height++] = info.width;
                //fprintf(stderr, "H=%d W=%d\n", info.height, info.width);
                info.width = 0;
            //---------------------------------------------------------------
            } else if (byte == 0xFD) {
                int count = fgetc(fp) + 1;
                int value = fgetc(fp);
                for (int n = 0; n < count; n++)
                    Add(value);
            //---------------------------------------------------------------
            } else if (byte == 0xFC) {
                int value = fgetc(fp);
                int count = fgetc(fp) + 1;
                for (int n = 0; n < count; n++)
                    Add(n % 2 == 0 ? value : value + 1);
            //---------------------------------------------------------------
            } else if (byte == 0xFB) {
                info.adder = fgetc(fp);
            //---------------------------------------------------------------
            } else {
                int value = (byte >> 2) + info.adder;
                int count = (byte & 3) + 1;
                for (int n = 0; n < count; n++)
                    Add(value);
            }
        }
        return 0;
    }
    Last edited by john.c; 01-15-2023 at 04:34 PM.
    A little inaccuracy saves tons of explanation. - H.H. Munro

  7. #37
    Registered User
    Join Date
    Jan 2023
    Posts
    39
    Hi john.c

    The .PNL Files are from A DOS game by Lucasarts called Secret Weapons Of The Luftwaffe, and the 110DASH.PAC File is from the Previous Game in the series called Their Finest Hour.
    Both WW2 Aircraft Combat Games.

    Can this Code, be run in Visual Studio. I tried compiling the previous Code, you posted, as a console application, but it said program does not contain a static 'Main''method suitable for an entry point. it compiled properly as a class library when I chose that option. so how do I run the .dll File in Visual Studio 2022 ? Are running this code in Visual Studio, how do I get the code to use the 110DASH.PAC File ?

    This is very impressive, what you have posted.

  8. #38
    Registered User
    Join Date
    Dec 2017
    Posts
    1,626
    You need to compile it as C code, not C# code.
    Then you probably should run it from the command line.
    A little inaccuracy saves tons of explanation. - H.H. Munro

  9. #39
    Registered User
    Join Date
    Jan 2023
    Posts
    39
    Hi john.c,

    I will try sorting that out shortly, I have attached two Hex Editing Tutorial zip Files, and one about specific Hex Value codes, from a website dedicated to the DOS game, Secret Weapons Of The Luftwaffe, where the two .PNL Files are from. I thought you might be interested. The TUTHEX8 File from The TUTHEX.zip File, talks about how the colouring works on the Planes for example.

    The website is at :-

    The SWOTL Web Site Index
    Attached Files Attached Files
    Last edited by eddywinch82; 01-15-2023 at 06:08 PM.

  10. #40
    Registered User
    Join Date
    Dec 2017
    Posts
    1,626
    In the previous code the reset() function should be:
    Code:
    void reset() {
        int ofi = info.output_file_index;
        info = (struct Info){0};
        info.min_width = INT_MAX;
        info.output_file_index = ofi;
    }
    Also, a call to reset() should be added before the for loop in main.
    Last edited by john.c; 01-15-2023 at 07:28 PM.
    A little inaccuracy saves tons of explanation. - H.H. Munro

  11. #41
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,651
    > The website is at :-
    And you couldn't have told us this a week ago?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  12. #42
    Registered User
    Join Date
    Dec 2017
    Posts
    1,626
    The linked zips don't contain any info about the rle scheme.
    A little inaccuracy saves tons of explanation. - H.H. Munro

  13. #43
    Registered User
    Join Date
    Jan 2023
    Posts
    39
    Hi john.c,

    I have successfully compiled your code as a C .exe File. From the command line in Visual Studio, the Folder the executable is in, what do I type next to the executable, mine is called BOB1940.EXE ? The File I would like to run the Code on is the P51DD.PNL File, which is in the same folder as the executable. Is there any useful information in those .zip Files for you ?

  14. #44
    Registered User
    Join Date
    Jan 2023
    Posts
    39
    Hi john.c,

    Did you get my previous post ?

    Eddie

  15. #45
    Registered User
    Join Date
    Dec 2017
    Posts
    1,626
    Assuming you compiled the C code to BOB1940.EXE (strange name), then presumably something like
    BOB1940 P51DD.PNL

    The zip files have no useful information.
    If you find any info on the run-length encoding (RLE) scheme, let me know.

    I cannot figure out how the RLE encoding for 110DASH.PAC works. Most lines seem to be missing pixels and I can't figure out how they should be added back in.
    If you could post a picture of what the image is supposed to look like that would be interesting but probably wouldn't help much.
    A little inaccuracy saves tons of explanation. - H.H. Munro

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. While Loop Query - code displayed
    By darren78 in forum C Programming
    Replies: 13
    Last Post: 02-17-2009, 10:44 AM
  2. first look incorporate assembly?
    By stabu in forum C Programming
    Replies: 8
    Last Post: 09-25-2008, 08:53 AM
  3. Loop Query
    By (TNT) in forum C# Programming
    Replies: 5
    Last Post: 02-13-2006, 06:16 PM
  4. How can I incorporate this code into a web page?
    By MisterRob in forum C Programming
    Replies: 6
    Last Post: 11-02-2005, 05:43 PM
  5. Best way to incorporate upgrades
    By Shadow12345 in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 09-26-2002, 07:41 AM

Tags for this Thread