zemu 0.4.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/src/memory.c.erb DELETED
@@ -1,59 +0,0 @@
1
- #include "memory.h"
2
-
3
- <% memory.each do |mem| %>
4
- /* Initialization memory block "<%= mem.name %>" */
5
- <%= mem.readonly? ? "const " : "" %>zuint8 zemu_memory_block_<%= mem.name %>[0x<%= mem.size.to_s(16) %>] =
6
- {<% mem.contents.each_with_index do |b, i| %><%= (i % 16 == 0) ? "\n " : "" %><%= ("0x%02x, " % b) %><% end %>
7
- };
8
- <% end %>
9
-
10
- zuint8 zemu_memory_read(void * context, zuint16 address)
11
- {
12
- zuint32 address_32 = address;
13
- <% memory.each do |mem| %>
14
- if (address_32 >= 0x<%= mem.address.to_s(16) %> && address_32 < 0x<%= (mem.address + mem.size).to_s(16) %>)
15
- {
16
- return zemu_memory_block_<%= mem.name %>[address_32 - 0x<%= mem.address.to_s(16) %>];
17
- }
18
- <% end %>
19
- /* Unmapped memory has a value of 0. */
20
- return 0;
21
- }
22
-
23
- void zemu_memory_write(void * context, zuint16 address, zuint8 value)
24
- {
25
- zuint32 address_32 = address;
26
- <% memory.each do |mem| %>
27
- <% next if mem.readonly? %>
28
- if (address_32 >= 0x<%= mem.address.to_s(16) %> && address_32 < 0x<%= (mem.address + mem.size).to_s(16) %>)
29
- {
30
- zemu_memory_block_<%= mem.name %>[address_32 - 0x<%= mem.address.to_s(16) %>] = value;
31
- }
32
- <% end %>
33
- }
34
-
35
- zuint8 zemu_memory_peek(zuint16 address)
36
- {
37
- zuint32 address_32 = address;
38
- <% memory.each do |mem| %>
39
- if (address_32 >= 0x<%= mem.address.to_s(16) %> && address_32 < 0x<%= (mem.address + mem.size).to_s(16) %>)
40
- {
41
- return zemu_memory_block_<%= mem.name %>[address_32 - 0x<%= mem.address.to_s(16) %>];
42
- }
43
- <% end %>
44
- /* Unmapped memory has a value of 0. */
45
- return 0;
46
- }
47
-
48
- void zemu_memory_poke(zuint16 address, zuint8 value)
49
- {
50
- zuint32 address_32 = address;
51
- <% memory.each do |mem| %>
52
- <% next if mem.readonly? %>
53
- if (address_32 >= 0x<%= mem.address.to_s(16) %> && address_32 < 0x<%= (mem.address + mem.size).to_s(16) %>)
54
- {
55
- zemu_memory_block_<%= mem.name %>[address_32 - 0x<%= mem.address.to_s(16) %>] = value;
56
- return;
57
- }
58
- <% end %>
59
- }
data/src/memory.h.erb DELETED
@@ -1,11 +0,0 @@
1
- #include "emulation/CPU/Z80.h"
2
-
3
- #include <stdio.h>
4
-
5
- zuint8 zemu_memory_read(void * context, zuint16 address);
6
-
7
- void zemu_memory_write(void * context, zuint16 address, zuint8 value);
8
-
9
- zuint8 zemu_memory_peek(zuint16 address);
10
-
11
- void zemu_memory_poke(zuint16 address, zuint8 value);