Class: BinaryFile

Inherits:
DOSFile show all
Defined in:
lib/DOSFile.rb

Constant Summary

Constants inherited from DSKFile

DSKFile::APPLESOFT_TOKENS

Instance Attribute Summary

Attributes inherited from DOSFile

#contents, #filename, #locked

Attributes inherited from DSKFile

#contents, #filename

Instance Method Summary collapse

Methods inherited from DOSFile

#catalog_filename, catalog_filename, #initialize

Methods inherited from DSKFile

#==, #buffer_as_applesoft_file, #hex_dump, #initialize, #length_in_sectors, #to_ascii, #to_s

Constructor Details

This class inherits a constructor from DOSFile

Instance Method Details

#can_be_picture?Boolean

Returns:

  • (Boolean)


93
94
95
96
# File 'lib/DOSFile.rb', line 93

def can_be_picture?
	start_address=(@contents[0]+@contents[1]*256)
	HGR.can_be_hgr_screen?(contents_without_header,start_address)
end

#contents_without_headerObject



84
85
86
87
# File 'lib/DOSFile.rb', line 84

def contents_without_header
	file_length=contents[2]+contents[3]*256
	@contents[4..file_length+3]
end

#disassemblyObject



88
89
90
91
# File 'lib/DOSFile.rb', line 88

def disassembly
	start_address=(@contents[0]+@contents[1]*256)
	D65.disassemble(contents_without_header,start_address)
end

#file_extensionObject



80
81
82
# File 'lib/DOSFile.rb', line 80

def file_extension
	".bin"
end

#file_typeObject



72
73
74
# File 'lib/DOSFile.rb', line 72

def file_type
	"B"
end

#file_type_byteObject



76
77
78
# File 'lib/DOSFile.rb', line 76

def file_type_byte
	0x04
end

#to_png(pallete_mode = :amber) ⇒ Object



98
99
100
# File 'lib/DOSFile.rb', line 98

def to_png(pallete_mode=:amber)
	HGR.buffer_to_png(contents_without_header,pallete_mode)
end