sources/Desktop/codedrop.cpp
// get the requested data byte. 0..3
// this was only tested with cc65's output .lst files!

get the requested data byte. 0..3
this was only tested with cc65's output .lst files!
get the requested data byte . 0 .. 3 this was only tested with cc65 ' s output . lst files!
int CodeDrop::GetDataByte( const char * line, int which )
{
    int idx = 11 + (which *3);
    if( !line || (int)strlen( line ) < (idx+1) ) return -1;
    if( !byteIsHex( line[idx] )) return -2;
    if( !byteIsHex( line[idx+1] )) return -3;
    char buf[3];
    buf[0] = line[idx++];
    buf[1] = line[idx++];
    buf[2] = '\0';
    return strtol( buf, NULL, 16 );
}
int CodeDrop :: GetDataByte ( const char * line , int which ) { int idx = 11 + ( which * 3 ) ; if ( ! line || ( int ) strlen ( line ) < ( idx + 1 ) ) return -1 ; if ( ! byteIsHex ( line [ idx ] ) ) return -2 ; if ( ! byteIsHex ( line [ idx + 1 ] ) ) return -3 ; char buf [ 3 ] ; buf [ 0 ] = line [ idx ++ ] ; buf [ 1 ] = line [ idx ++ ] ; buf [ 2 ] = ' \0 ' ; return strtol ( buf , NULL , 16 ) ; }
get the requested data byte.
get the requested data byte .