sources/Desktop/codedrop.cpp
// load in a CA65/CC65 "list" file.  This ONLY is confirmed to work
// with the current software.  No idea if it works with other stuff
// perhaps it can be adapted to others later.

load in a CA65/CC65 "list" file.  This ONLY is confirmed to work
with the current software.  No idea if it works with other stuff
perhaps it can be adapted to others later.
load in a CA65 / CC65 " list " file . This ONLY is confirmed to work with the current software . No idea if it works with other stuff perhaps it can be adapted to others later .
int CodeDrop::ParseCC65LstFile( QString filepath )
{
    this->loadedBytes = 0;
    this->loadedAddr = -1;
    QFile inputFile( filepath );
    if (inputFile.open(QIODevice::ReadOnly))
    {
       QTextStream in(&inputFile);
       while (!in.atEnd())
       {
          QString line = in.readLine();
          const char * d = line.toLatin1().data();
          int addr = this->GetLineAddress( d );
          if( addr >= 0 ) {
              if( this->loadedAddr < 0 ) {
                  this->loadedAddr = addr;
              }
              int b0, b1, b2, b3;
              b0 = this->GetDataByte( d, 0 );
              b1 = this->GetDataByte( d, 1 );
              b2 = this->GetDataByte( d, 2 );
              b3 = this->GetDataByte( d, 3 );
              if( b0 >= 0 ) { write6502( addr++, b0 ); this->loadedBytes++; }
              if( b1 >= 0 ) { write6502( addr++, b1 ); this->loadedBytes++; }
              if( b2 >= 0 ) { write6502( addr++, b2 ); this->loadedBytes++; }
              if( b3 >= 0 ) { write6502( addr++, b3 ); this->loadedBytes++; }
          }
       }
       inputFile.close();
    }
    return this->loadedBytes;
}
int CodeDrop :: ParseCC65LstFile ( QString filepath ) { this -> loadedBytes = 0 ; this -> loadedAddr = -1 ; QFile inputFile ( filepath ) ; if ( inputFile . open ( QIODevice :: ReadOnly ) ) { QTextStream in ( & inputFile ) ; while ( ! in . atEnd ( ) ) { QString line = in . readLine ( ) ; const char * d = line . toLatin1 ( ) . data ( ) ; int addr = this -> GetLineAddress ( d ) ; if ( addr >= 0 ) { if ( this -> loadedAddr < 0 ) { this -> loadedAddr = addr ; } int b0 , b1 , b2 , b3 ; b0 = this -> GetDataByte ( d , 0 ) ; b1 = this -> GetDataByte ( d , 1 ) ; b2 = this -> GetDataByte ( d , 2 ) ; b3 = this -> GetDataByte ( d , 3 ) ; if ( b0 >= 0 ) { write6502 ( addr ++ , b0 ) ; this -> loadedBytes ++ ; } if ( b1 >= 0 ) { write6502 ( addr ++ , b1 ) ; this -> loadedBytes ++ ; } if ( b2 >= 0 ) { write6502 ( addr ++ , b2 ) ; this -> loadedBytes ++ ; } if ( b3 >= 0 ) { write6502 ( addr ++ , b3 ) ; this -> loadedBytes ++ ; } } } inputFile . close ( ) ; } return this -> loadedBytes ; }
load in a CA65/CC65 "list" file.
load in a CA65 / CC65 " list " file .
// open up a CC65 ASM List file
 // set the bookmark
