OpenCores
URL https://opencores.org/ocsvn/System09/System09/trunk

Subversion Repositories System09

[/] [System09/] [trunk/] [Tools/] [s19tovhd/] [S19toVHD.cpp] - Diff between revs 66 and 78

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 66 Rev 78
Line 191... Line 191...
 
 
/*
/*
* load motorola formatted file
* load motorola formatted file
*/
*/
 
 
void load_mot( char *fname_in )
bool load_mot( char *fname_in )
{
{
        FILE *fp_in;
        FILE *fp_in;
        int byte, addr, i;
        int byte, addr, i;
 
 
        fp_in = fopen( fname_in, "r" );
        fp_in = fopen( fname_in, "r" );
        if( !fp_in )
        if( !fp_in )
        {
        {
                printf( "\nCan't open %s", fname_in );
                printf( "\nCan't open %s", fname_in );
                return;
                return false;
        }
        }
 
 
        byte = 0;
        byte = 0;
        addr = 0;
        addr = 0;
 
 
Line 240... Line 240...
                        if( checksum != 0 )
                        if( checksum != 0 )
                                printf( "\nchecksum error - read check = %02x", byte );
                                printf( "\nchecksum error - read check = %02x", byte );
                }
                }
        }
        }
        fclose( fp_in );
        fclose( fp_in );
 
        return true;
}
}
 
 
 
 
 
 
 
 
Line 363... Line 364...
                return(-1);
                return(-1);
        }
        }
        printf("Reading Motorola S19 from file '%s'\n", argv[1]);
        printf("Reading Motorola S19 from file '%s'\n", argv[1]);
        printf("VHDL file name '%s'\n", argv[2]);
        printf("VHDL file name '%s'\n", argv[2]);
        printf("Base RAM/ROM entity name is '%s'\n", argv[3]);
        printf("Base RAM/ROM entity name is '%s'\n", argv[3]);
        load_mot( argv[1] );
        if (!load_mot( argv[1] )) {
 
                return(-1);
 
        }
        if( (fp_out = fopen( argv[2], "w" )) == NULL ) {
        if( (fp_out = fopen( argv[2], "w" )) == NULL ) {
                printf( "\nCan't open '%s' for write ", argv[2] );
                printf( "\nCan't open '%s' for write ", argv[2] );
                return(-1);
                return(-1);
        }
        }
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2022 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.