zemu 0.4.2 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zemu/debug.rb +35 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7ab3a65fd7f45896cac4297f3715d138a1753def97266f78dd1af1b30e0f012
|
4
|
+
data.tar.gz: 6d33e40e95a4add449616e6793b2817d2a9c5113f7fcc6fe0f7bf075d0d9dec2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4551b92671a66d326ec426cbfd240427d93d181ef000c47bda8505185f9ac865b51411bfc35222d097f79e810af9cb9337a50473c7ef80c5b0a63c7d98fa550f
|
7
|
+
data.tar.gz: aeb983650f57cbb5a7e76b6caffbf81a0ccef919133754fae2608d1a8b04708b329ae5d75e2f5606e8409808b8b456d26b776c28c0ee9a7c39f6f4c1b1ddf038
|
data/lib/zemu/debug.rb
CHANGED
@@ -5,22 +5,50 @@ module Zemu
|
|
5
5
|
# Loads a map file at the given path, and returns a hash of address => Symbol
|
6
6
|
# for the symbols defined within.
|
7
7
|
def self.load_map(path)
|
8
|
-
symbols =
|
8
|
+
symbols = []
|
9
9
|
|
10
10
|
File.open(path, "r") do |f|
|
11
11
|
f.each_line do |l|
|
12
12
|
s = Symbol.parse(l)
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
symbols << s
|
15
|
+
end
|
16
|
+
end
|
17
17
|
|
18
|
-
|
19
|
-
|
18
|
+
return Symbols.new(symbols)
|
19
|
+
end
|
20
|
+
|
21
|
+
# Contains a set of symbols.
|
22
|
+
# Allows for various lookup operations.
|
23
|
+
class Symbols
|
24
|
+
# Constructor.
|
25
|
+
def initialize(syms)
|
26
|
+
@syms = []
|
27
|
+
syms.each do |s|
|
28
|
+
@syms << s
|
20
29
|
end
|
21
30
|
end
|
22
31
|
|
23
|
-
|
32
|
+
# Access all symbols with a given address.
|
33
|
+
def [](address)
|
34
|
+
at_address = []
|
35
|
+
@syms.each do |s|
|
36
|
+
if s.address == address
|
37
|
+
at_address << s
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
return at_address.sort_by(&:label)
|
42
|
+
end
|
43
|
+
|
44
|
+
# Find a symbol with a given name.
|
45
|
+
def find_by_name(name)
|
46
|
+
@syms.each do |s|
|
47
|
+
return s if s.label == name
|
48
|
+
end
|
49
|
+
|
50
|
+
return nil
|
51
|
+
end
|
24
52
|
end
|
25
53
|
|
26
54
|
# Represents a symbol definition, of the form `label = address`.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zemu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jay Valentine
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-11-
|
11
|
+
date: 2021-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |2
|
14
14
|
Zemu is a gem which allows the user to configure a Z80-based system
|