Beispiel #1
0
Plugin* create_plugin(const PluginParams& params)
{
    if (instance != NULL)
        return instance;

    unsigned short width, height, startaddr, initaddr;
    unsigned int oncolor = 0x606860, offcolor = 0xa0b0a0;

    if (lc3_params_read_ushort(params, "width", width) == false)
    {
        fprintf(stderr, "Width param (width) not given or in incorrect format: %s\n", lc3_params_get_value(params, "width").c_str());
        return NULL;
    }

    if (lc3_params_read_ushort(params, "height", height) == false)
    {
        fprintf(stderr, "Height param (height) not given or in incorrect format: %s\n", lc3_params_get_value(params, "height").c_str());
        return NULL;
    }

    if (lc3_params_read_ushort(params, "startaddr", startaddr) == false)
    {
        fprintf(stderr, "Start Address param (startaddr) not given or in incorrect format: %s\n", lc3_params_get_value(params, "startaddr").c_str());
        return NULL;
    }

    if (lc3_params_read_ushort(params, "initaddr", initaddr) == false)
    {
        fprintf(stderr, "Initial Address param (initaddr) not given or in incorrect format: %s\n", lc3_params_get_value(params, "initaddr").c_str());
        return NULL;
    }

    lc3_params_read_uint(params, "oncolor", oncolor);
    lc3_params_read_uint(params, "offcolor", offcolor);


    /*if (wxTheApp == NULL)
    {
        fprintf(stderr, "[ERROR] Using this plugin with the command line version of the simulator is not supported at this time\n");
        return NULL;
    }*/

    instance = new BWLCDPlugin(width, height, initaddr, startaddr, offcolor, oncolor);
    return instance;
}
Beispiel #2
0
Plugin* create_plugin(const PluginParams& params)
{
    if (instance != NULL)
        return instance;

    unsigned short address;
    if (lc3_params_read_ushort(params, "address", address) == false)
    {
        fprintf(stderr, "Address param (address) not given or in incorrect format: %s\n", lc3_params_get_value(params, "address").c_str());
        return NULL;
    }

    unsigned char vector = 0;
    lc3_params_read_uchar(params, "vector", vector);

    //instance = new TimerPlugin(address, vector != 0, vector);
    fprintf(stderr, "Warning this plugin needs to be implemented see Brandon");
    return NULL;
}