Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/libsnes/bsnes/snes/cpu/dma/dma.hpp
2 views
1
struct {
2
//$420b
3
bool dma_enabled;
4
5
//$420c
6
bool hdma_enabled;
7
8
//$43x0
9
bool direction;
10
bool indirect;
11
bool unused;
12
bool reverse_transfer;
13
bool fixed_transfer;
14
uint3 transfer_mode;
15
16
//$43x1
17
uint8 dest_addr;
18
19
//$43x2-$43x3
20
uint16 source_addr;
21
22
//$43x4
23
uint8 source_bank;
24
25
//$43x5-$43x6
26
union {
27
uint16 transfer_size;
28
uint16 indirect_addr;
29
};
30
31
//$43x7
32
uint8 indirect_bank;
33
34
//$43x8-$43x9
35
uint16 hdma_addr;
36
37
//$43xa
38
uint8 line_counter;
39
40
//$43xb/$43xf
41
uint8 unknown;
42
43
//internal state
44
bool hdma_completed;
45
bool hdma_do_transfer;
46
} channel[8];
47
48
struct {
49
bool valid;
50
unsigned addr;
51
uint8 data;
52
} pipe;
53
54
void dma_add_clocks(unsigned clocks);
55
bool dma_transfer_valid(uint8 bbus, uint32 abus);
56
bool dma_addr_valid(uint32 abus);
57
uint8 dma_read(uint32 abus);
58
void dma_write(bool valid, unsigned addr = 0, uint8 data = 0);
59
void dma_transfer(bool direction, uint8 bbus, uint32 abus);
60
61
uint8 dma_bbus(unsigned i, unsigned channel);
62
uint32 dma_addr(unsigned i);
63
uint32 hdma_addr(unsigned i);
64
uint32 hdma_iaddr(unsigned i);
65
66
uint8 dma_enabled_channels();
67
bool hdma_active(unsigned i);
68
bool hdma_active_after(unsigned i);
69
uint8 hdma_enabled_channels();
70
uint8 hdma_active_channels();
71
72
void dma_run();
73
void hdma_update(unsigned i);
74
void hdma_run();
75
void hdma_init_reset();
76
void hdma_init();
77
78
void dma_power();
79
void dma_reset();
80
81