80 |
$mem[$addr++] = $_ foreach @_; |
$mem[$addr++] = $_ foreach @_; |
81 |
} |
} |
82 |
|
|
83 |
|
=head2 write_chunk |
84 |
|
|
85 |
|
$emu->write_chunk( $address, $chunk_of_data ); |
86 |
|
|
87 |
|
=cut |
88 |
|
|
89 |
|
sub write_chunk { |
90 |
|
my ($self, $addr, $chunk) = @_; |
91 |
|
my $len = length($chunk); |
92 |
|
splice @mem, $addr, $len, unpack('C*', $chunk); |
93 |
|
} |
94 |
|
|
95 |
=head2 ram |
=head2 ram |
96 |
|
|
97 |
Read searies of bytes from memory without passing through MMU |
Read searies of bytes from memory without passing through MMU |
104 |
my $self = shift; |
my $self = shift; |
105 |
my ($from,$to) = @_; |
my ($from,$to) = @_; |
106 |
if ($from + $to) { |
if ($from + $to) { |
107 |
#printf "ram %04x - %04x\n", $from, $to; |
printf "ram %04x - %04x\n", $from, $to; |
108 |
return $mem[$from .. $to - 1]; |
return $mem[$from .. $to - 1]; |
109 |
} |
} |
110 |
|
printf "ram %04x\n", $from; |
111 |
return $mem[$from] if defined($from); |
return $mem[$from] if defined($from); |
112 |
confess "no from address"; |
confess "no from address"; |
113 |
} |
} |