Class: C64Prg
- Inherits:
-
CbmFile
- Object
- NativeFileType
- CbmFile
- C64Prg
- Defined in:
- lib/native_file_types/c64/C64Prg.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from NativeFileType
#aux_code, #contents, #file_system_image, #file_type, #filename, #meta_data
Class Method Summary collapse
Instance Method Summary collapse
- #header_length ⇒ Object
-
#load_address ⇒ Object
PRG files have the load address stored in first two bytes of the file, in LO, HI order.
- #to_disassembly ⇒ Object
- #to_listing ⇒ Object
Methods inherited from CbmFile
Methods inherited from NativeFileType
#<=>, #==, all_native_file_types, best_fit, code_for_tests, compatability_score, #data_without_header, file_type_matches?, #full_filename, #initialize, is_valid_file_if, load_address, matching_score, native_file_types_possible_on_file_system, non_matching_score, #to_hex_dump, #to_info_dump, #type_description
Methods included from SubclassTracking
Constructor Details
This class inherits a constructor from NativeFileType
Class Method Details
.file_system_file_types ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/native_file_types/c64/C64Prg.rb', line 11 def self.file_system_file_types { CbmDos=>:prg, C64PrgSnapshot=>:prg } end |
Instance Method Details
#header_length ⇒ Object
19 20 21 |
# File 'lib/native_file_types/c64/C64Prg.rb', line 19 def header_length 2 end |
#load_address ⇒ Object
PRG files have the load address stored in first two bytes of the file, in LO, HI order
24 25 26 27 |
# File 'lib/native_file_types/c64/C64Prg.rb', line 24 def load_address return 0 if contents.length<2 contents[0]+contents[1]*256 end |
#to_disassembly ⇒ Object
32 33 34 35 36 |
# File 'lib/native_file_types/c64/C64Prg.rb', line 32 def to_disassembly return C64.disassemble(data_without_header,load_address) end |
#to_listing ⇒ Object
29 30 31 |
# File 'lib/native_file_types/c64/C64Prg.rb', line 29 def to_listing self.to_disassembly end |