RetroLinker
Linker for several 8-bit, 16-bit and 32-bit formats
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
Commodore::CommodoreFormat::BASICLine Class Reference
Inheritance diagram for Commodore::CommodoreFormat::BASICLine:
Linker::Format Linker::Contents

Public Types

enum  Token {
  END = 0x80 , FOR = 0x81 , NEXT = 0x82 , DATA = 0x83 ,
  INPUT_HASH = 0x84 , INPUT = 0x85 , DIM = 0x86 , READ = 0x87 ,
  LET = 0x88 , GOTO = 0x89 , RUN = 0x8A , IF = 0x8B ,
  RESTORE = 0x8C , GOSUB = 0x8D , RETURN = 0x8E , REM = 0x8F ,
  STOP = 0x90 , ON = 0x91 , WAIT = 0x92 , LOAD = 0x93 ,
  SAVE = 0x94 , VERIFY = 0x95 , DEF = 0x96 , POKE = 0x97 ,
  PRINT_HASH = 0x98 , PRINT = 0x99 , CONST = 0x9A , LIST = 0x9B ,
  CLR = 0x9C , CMD = 0x9D , SYS = 0x9E , OPEN = 0x9F ,
  CLOSE = 0xA0 , GET = 0xA1 , NEW = 0xA2 , TAB_PAREN = 0xA3 ,
  TO = 0xA4 , FN = 0xA5 , SPC_PAREN = 0xA6 , THEN = 0xA7 ,
  NOT = 0xA8 , STEP = 0xA9 , _PLUS = 0xAA , _MINUS = 0xAB ,
  _MULTIPLY = 0xAC , _DIVIDE = 0xAD , _POWER = 0xAE , AND = 0xAF ,
  OR = 0xB0 , _GREATER = 0xB1 , _EQUAL = 0xB2 , _LESS = 0xB3 ,
  SGN = 0xB4 , INT = 0xB5 , ABS = 0xB6 , USR = 0xB7 ,
  FRE = 0xB8 , POS = 0xB9 , SQR = 0xBA , RND = 0xBB ,
  LOG = 0xBC , EXP = 0xBD , COS = 0xBE , SIN = 0xBF ,
  TAN = 0xC0 , ATN = 0xC1 , PEEK = 0xC2 , LEN = 0xC3 ,
  STR_DOLLAR = 0xC4 , VAL = 0xC5 , ASC = 0xC6 , CHR_DOLLAR = 0xC7 ,
  LEFT_DOLLAR = 0xC8 , RIGHT_DOLLAR = 0xC9 , MID_DOLLAR = 0xCA , GO = 0xCB ,
  _PI = 0xFF
}
 

Public Member Functions

void AddToken (Token token)
 
void AddString (std::string text)
 
void AddDecimal (int value)
 
offset_t ImageSize () const override
 Retrieves the offset of the byte after the last one belonging to this format from the first one.
 
void ReadFile (const std::shared_ptr< Linker::Reader > &rd) override
 Loads file into memory.
 
offset_t WriteFile (const std::shared_ptr< Linker::Writer > &wr) const override
 Stores data in memory to file.
 
void CalculateValues ()
 
void Dump (Dumper::Dumper &dump) const override
 Display file contents in a nice manner.
 
void Dump (Dumper::Dumper &dump, std::optional< uint16_t > line_index, int display_flags) const
 
- Public Member Functions inherited from Linker::Format
 Format (offset_t file_offset=0)
 
virtual void Clear ()
 Resets all fields to their default values, deallocate memory.
 
virtual void SetFileOffset (offset_t new_offset)
 Attempts to alter the offset to the first byte of the format from the beginning of the file.
 
offset_t ImageSize () const override
 Retrieves the offset of the byte after the last one belonging to this format from the first one.
 
- Public Member Functions inherited from Linker::Contents
virtual std::shared_ptr< const Image > AsImage () const
 Retrieves a randomly accessible image.
 
std::shared_ptr< Image > AsImage ()
 Retrieves a randomly accessible image.
 

Public Attributes

uint16_t line_address = 0
 
uint16_t line_number = 0
 
uint16_t next_address = 0
 
std::vector< uint8_t > tokens
 
- Public Attributes inherited from Linker::Format
offset_t file_offset
 The offset of the first byte used by this format in the file it is stored in.
 

Member Function Documentation

◆ Dump()

void CommodoreFormat::BASICLine::Dump ( Dumper::Dumper &  dump) const
overridevirtual

Display file contents in a nice manner.

Reimplemented from Linker::Format.

◆ ImageSize()

size_t CommodoreFormat::BASICLine::ImageSize ( ) const
overridevirtual

Retrieves the offset of the byte after the last one belonging to this format from the first one.

Returns
The size of the image, or offset_t(-1) if it cannot be determined before writing to the file

Implements Linker::Contents.

◆ ReadFile()

void CommodoreFormat::BASICLine::ReadFile ( const std::shared_ptr< Linker::Reader > &  rd)
overridevirtual

Loads file into memory.

Implements Linker::Format.

◆ WriteFile()

offset_t CommodoreFormat::BASICLine::WriteFile ( const std::shared_ptr< Linker::Writer > &  wr) const
overridevirtual

Stores data in memory to file.

Implements Linker::Format.


The documentation for this class was generated from the following files: