-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
IFamicomDumperConnection.cs
92 lines (80 loc) · 3.65 KB
/
IFamicomDumperConnection.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
using com.clusterrr.Famicom.Containers;
using System;
using System.Collections.Generic;
namespace com.clusterrr.Famicom.DumperConnection
{
public interface IFamicomDumperConnection : IDisposable
{
/// <summary>
/// Simulate reset (M2 goes to Z-state for a second)
/// </summary>
void Reset();
/// <summary>
/// Read single byte from CPU (PRG) bus
/// </summary>
/// <param name="address">Address to read from</param>
/// <returns>Data from CPU (PRG) bus</returns>
byte ReadCpu(ushort address);
/// <summary>
/// Read data from CPU (PRG) bus
/// </summary>
/// <param name="address">Address to read from</param>
/// <param name="length">Number of bytes to read</param>
/// <returns>Data from CPU (PRG) bus</returns>
byte[] ReadCpu(ushort address, int length);
/// <summary>
/// Read single byte from PPU (CHR) bus
/// </summary>
/// <param name="address">Address to read from</param>
/// <returns>Data from PPU (CHR) bus</returns>
byte ReadPpu(ushort address);
/// <summary>
/// Read data from PPU (CHR) bus
/// </summary>
/// <param name="address">Address to read from</param>
/// <param name="length">Number of bytes to read</param>
/// <returns>Data from PPU (CHR) bus</returns>
byte[] ReadPpu(ushort address, int length);
/// <summary>
/// Write data to CPU (PRG) bus
/// </summary>
/// <param name="address">Address to write to</param>
/// <param name="data">Data to write, address will be incremented after each byte</param>
void WriteCpu(ushort address, params byte[] data);
/// <summary>
/// Write data to PPU (CHR) bus
/// </summary>
/// <param name="address">Address to write to</param>
/// <param name="data">Data to write, address will be incremented after each byte</param>
void WritePpu(ushort address, params byte[] data);
/// <summary>
/// Read Famicom Disk System blocks
/// </summary>
/// <param name="startBlock">First block number to read (zero-based)</param>
/// <param name="maxBlockCount">Maximum number of blocks to read</param>
/// <returns>Array of Famicom Disk System blocks</returns>
public (byte[] Data, bool CrcOk, bool EndOfHeadMeet)[] ReadFdsBlocks(byte startBlock = 0, byte maxBlockCount = byte.MaxValue);
/// <summary>
/// Write blocks to Famicom Disk System card
/// </summary>
/// <param name="blockNumbers">Block numbers to write (zero-based)</param>
/// <param name="blocks">Raw blocks data</param>
void WriteFdsBlocks(byte[] blockNumbers, byte[][] blocks);
/// <summary>
/// Write single block to Famicom Disk System card
/// </summary>
/// <param name="blockNumbers">Block number to write (zero-based)</param>
/// <param name="block">Raw block data</param>
void WriteFdsBlocks(byte blockNumber, byte[] block);
/// <summary>
/// Read raw mirroring values (CIRAM A10 pin states for different states of PPU A10 and A11)
/// </summary>
/// <returns>Values of CIRAM A10 pin for $2000-$23FF, $2400-$27FF, $2800-$2BFF and $2C00-$2FFF</returns>
bool[] GetMirroringRaw();
/// <summary>
/// Read decoded current mirroring mode
/// </summary>
/// <returns>Current mirroring</returns>
MirroringType GetMirroring();
}
}