Ignore:
Timestamp:
Jun 18, 2008, 5:59:48 PM (7 years ago)
Author:
sam
Message:
  • Add meaningful error messages to img2oric.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • www/img2oric/img2oric.c

    r2394 r2449  
    99 *                 improve Floyd-Steinberg coefficient values
    1010 *   Jun 14, 2008: Win32 version
     11 *   Jun 18, 2008: add meaningful error messages
    1112 *
    1213 *  This program is free software. It comes without any warranty, to
     
    424425
    425426    if(argc < 2)
     427    {
     428        fprintf(stderr, "Error: missing argument.\n");
     429        fprintf(stderr, "Usage: img2oric <image>\n");
    426430        return 1;
     431    }
    427432
    428433#if defined _WIN32
     
    433438#endif
    434439    if(!tmp)
     440    {
     441        fprintf(stderr, "Error: could not load image %s.\n", argv[1]);
     442#if defined _WIN32
     443        fprintf(stderr, "Maybe try with an 8-bpp or 24-bpp BMP file?\n");
     444#endif
    435445        return 2;
     446    }
    436447
    437448    f = fopen(ORICFILE ".TAP", "w");
    438449    if(!f)
     450    {
     451        fprintf(stderr, "Error: could not open %s.TAP for writing.\n",
     452                        ORICFILE);
    439453        return 3;
     454    }
    440455    fwrite("\x16\x16\x16\x16\x24", 1, 5, f);
    441456    fwrite("\x00\xff\x80\x00\xbf\x3f\xa0\x00", 1, 8, f);
Note: See TracChangeset for help on using the changeset viewer.