namespace Emux.GameBoy.Cartridge { /// /// Provides members for accessing an inserted GameBoy cartridge. /// public interface ICartridge : IGameBoyComponent { /// /// Gets the compressed Nintendo Logo bitmap used by the BIOS. /// byte[] NintendoLogo { get; } /// /// Gets the title of the game. /// string GameTitle { get; } /// /// Gets the publisher code of the cartridge. This property is used by newer cartridges only. /// byte[] NewPublisherCode { get; } /// /// Gets a value indicating whether the cartridge is designed specifically for GameBoy Color devices. /// GameBoyColorFlag GameBoyColorFlag { get; } /// /// Gets a value indicating whether Super GameBoy features are enabled or not by this cartridge. /// bool SuperGameBoyMode { get; } /// /// Gets the type of the cartridge, including the present memory bank controller (MBC), if any. /// CartridgeType CartridgeType { get; } /// /// Gets the size in bytes of all ROM data present in the cartridge. /// int RomSize { get; } /// /// Gets the size in bytes of external RAM present in the cartridge, if any. /// int ExternalRamSize { get; } /// /// Gets a value indicating the cartridge was produced for the Japanese market or not. /// bool IsJapanese { get; } /// /// Gets the publisher code of the cartridge. This property is used by older cartridges only. /// byte OldPublisherCode { get; } /// /// Gets the checksum of the cartridge header. /// byte HeaderChecksum { get; } /// /// Gets the global checksum of the cartrige. /// byte[] GlobalChecksum { get; } /// /// Reads a single byte from the cartrige at a given address. /// /// The address to read from. /// The byte at the given location. byte ReadByte(ushort address); /// /// Reads a block of bytes from the cartridge starting at a given address. /// /// The start address. /// The buffer to write the bytes to. /// The destinatino offset of the buffer to write to. /// The amount of bytes to read. void ReadBytes(ushort address, byte[] buffer, int bufferOffset, int length); /// /// Writes a byte to the cartridge. /// /// The address to write to. /// The value to write. void WriteByte(ushort address, byte value); } /// /// Provides members for accessing a fully accessible cartridge. /// public interface IFullyAccessibleCartridge : ICartridge { IExternalMemory ExternalMemory { get; } /// /// Reads a single byte from the raw data of the cartridge. /// /// The absolute address of the raw data. /// The byte at the given absolute address. byte ReadFromAbsoluteAddress(int address); /// /// Reads a block of bytes from the raw data of the cartridge. /// /// The start address. /// The buffer to write the bytes to. /// The destinatino offset of the buffer to write to. /// The amount of bytes to read. void ReadFromAbsoluteAddress(int address, byte[] buffer, int bufferOffset, int length); } }