Class: Apple2

Inherits:
HostSystem show all
Defined in:
lib/host_systems/Apple2.rb

Constant Summary collapse

HGR_BLACK =

color=0,4

PNG::Color::Black
HGR_GREEN =

color=1

PNG::Color.new(0x2F,0xB8,0x1F,0xFF)
HGR_VIOLET =

color=2

PNG::Color.new(0xC8,0x47,0xE4,0xFF)
HGR_WHITE =

color=3,7

PNG::Color::White
HGR_ORANGE =

color=5

PNG::Color.new(0xC7,0x70,0x28,0xFF)
HGR_BLUE =

color=6

PNG::Color.new(0x30,0x8F,0xE3,0xFF)
HGR_COLS =
40*7
HGR_ROWS =
8*8*3
@@symbols =
nil

Constants inherited from HostSystem

HostSystem::MAX_SCREENDUMP_LINES

Class Method Summary collapse

Methods inherited from HostSystem

all_host_systems, font_data, hex_dump, pixels_between_characters, possible_file_systems, s_to_ascii, to_screendump

Methods included from SubclassTracking

extended

Class Method Details

.default_background_colourObject



83
84
85
# File 'lib/host_systems/Apple2.rb', line 83

def self.default_background_colour
  PNG::Color::Black
end

.default_foreground_colourObject



79
80
81
# File 'lib/host_systems/Apple2.rb', line 79

def self.default_foreground_colour  
    PNG::Color::White
end

.default_screen_widthObject



63
64
65
# File 'lib/host_systems/Apple2.rb', line 63

def self.default_screen_width
  40
end

.disassemble(buffer, start_address = 0) ⇒ Object



45
46
47
48
# File 'lib/host_systems/Apple2.rb', line 45

def self.disassemble(buffer,start_address=0)
  require 'D65'
  D65.disassemble(buffer,start_address,symbols)
end

.font_data_filenameObject



50
51
52
# File 'lib/host_systems/Apple2.rb', line 50

def self.font_data_filename
File.dirname(__FILE__) +'/apple_2_font.bin'
end

.font_heightObject



75
76
77
# File 'lib/host_systems/Apple2.rb', line 75

def self.font_height
  8
end

.font_widthObject



71
72
73
# File 'lib/host_systems/Apple2.rb', line 71

def self.font_width
  7
end

.full_nameObject



12
13
14
# File 'lib/host_systems/Apple2.rb', line 12

def self.full_name
    "Apple ]["
end

.line_break_charsObject



54
55
56
# File 'lib/host_systems/Apple2.rb', line 54

def self.line_break_chars
  [0x0D,0x8D]
end

.max_screen_widthObject



67
68
69
# File 'lib/host_systems/Apple2.rb', line 67

def self.max_screen_width
  80
end

.screen_rowsObject



59
60
61
# File 'lib/host_systems/Apple2.rb', line 59

def self.screen_rows
  25
end

.start_trackObject

Apple 2 disks start at track 0



35
36
37
# File 'lib/host_systems/Apple2.rb', line 35

def self.start_track
    0
end

.symbolsObject



40
41
42
43
# File 'lib/host_systems/Apple2.rb', line 40

def self.symbols
  @@symbols=YAML::load(File.open(File.dirname(__FILE__)+"/a2_symbols.yaml")) if @@symbols.nil?
  @@symbols
end

.to_ascii(byte) ⇒ Object



30
31
32
# File 'lib/host_systems/Apple2.rb', line 30

def self.to_ascii(byte)
  (byte%128).chr
end