-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathIMapper.cs
95 lines (79 loc) · 3.38 KB
/
IMapper.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
93
94
95
using com.clusterrr.Famicom.Containers;
using com.clusterrr.Famicom.DumperConnection;
using System;
using System.Collections.Generic;
#nullable disable
namespace com.clusterrr.Famicom.Dumper
{
public interface IMapper
{
/// <summary>
/// Name of the mapper
/// </summary>
string Name { get; }
/// <summary>
/// Number of the mapper to spore in the iNES header (-1 if none)
/// </summary>
int Number { get => -1; }
/// <summary>
/// Number of submapper (0 if none)
/// </summary>
byte Submapper { get => 0; }
/// <summary>
/// Name of the mapper to store in UNIF container (null if none)
/// </summary>
string UnifName { get => null; }
/// <summary>
/// Default PRG size to dump (in bytes)
/// </summary>
int DefaultPrgSize { get; }
/// <summary>
/// Default CHR size to dump (in bytes)
/// </summary>
int DefaultChrSize { get => 0; }
/// <summary>
/// This method will be called to dump PRG
/// </summary>
/// <param name="dumper">FamicomDumperConnection object to access cartridge</param>
/// <param name="data">This list must be filled with dumped PRG data</param>
/// <param name="size">Size of PRG to dump requested by user (in bytes)</param>
void DumpPrg(IFamicomDumperConnection dumper, List<byte> data, int size = 0);
/// <summary>
/// This method will be called to dump CHR
/// </summary>
/// <param name="dumper">FamicomDumperConnection object to access cartridge</param>
/// <param name="data">This list must be filled with dumped CHR data</param>
/// <param name="size">Size of CHR to dump requested by user (in bytes)</param>
void DumpChr(IFamicomDumperConnection dumper, List<byte> data, int size = 0)
=> throw new NotSupportedException("This mapper doesn't have a CHR ROM");
/// <summary>
/// This method will be called to enable PRG RAM
/// </summary>
/// <param name="dumper"></param>
void EnablePrgRam(IFamicomDumperConnection dumper)
=> throw new NotImplementedException("PRG RAM is not supported by this mapper");
/// <summary>
/// This method must return mirroring type, it can call dumper.GetMirroring() if it's fixed
/// </summary>
/// <param name="dumper">FamicomDumperConnection object to access cartridge</param>
/// <returns>Mirroring type</returns>
MirroringType GetMirroring(IFamicomDumperConnection dumper) => dumper.GetMirroring();
/// <summary>
/// Default PRG RAM size, can be used with NES 2.0
/// </summary>
public int DefaultPrgRamSize { get => -1; }
/// <summary>
/// Default CHR RAM size, can be used with NES 2.0
/// </summary>
public int DefaultChrRamSize { get => -1; }
/// <summary>
/// Default PRG NVRAM size, can be used with NES 2.0
/// </summary>
public int DefaultPrgNvramSize { get => -1; }
/// <summary>
/// Default CHR NVRAM size, can be used with NES 2.0
/// </summary>
public int DefaultChrNvramSize { get => -1; }
}
}
#nullable restore