tourze/nes-mmc
最新稳定版本:0.0.1
Composer 安装命令:
composer require tourze/nes-mmc
包简介
MMC模块 (Memory Mapper Controller)
README 文档
README
This package provides an implementation of NES Memory Mapper Controller (MMC) for NES emulators, handling different types of mapper chips.
Features
- Support for multiple mapper types
- Unified mapper interface
- CPU and PPU address space mapping
- Bank switching support
- Different name table mirroring modes support
- IRQ interrupt generation
Installation
Install via Composer:
composer require tourze/nes-mmc
Usage
Basic Usage
use Tourze\NES\Cartridge\Memory\PrgRom; use Tourze\NES\Cartridge\Memory\ChrRom; use Tourze\NES\MMC\MapperFactory; use Tourze\NES\MMC\MirroringMode; // Create ROM data $prgRom = new PrgRom($prgRomData); $chrRom = new ChrRom($chrRomData); // Create mapper instance - using mapper #0 (NROM) $mapper = MapperFactory::create(0, $prgRom, $chrRom); // CPU read $data = $mapper->cpuRead(0x8000); // CPU write $mapper->cpuWrite(0x6000, 0x42); // PPU read $patternData = $mapper->ppuRead(0x0000); // Change mirroring mode $mapper->setMirroringMode(MirroringMode::VERTICAL);
Register Custom Mapper
use Tourze\NES\MMC\Registry\MapperRegistry; use MyApp\Mappers\CustomMapper; // Register custom mapper MapperRegistry::register(123, CustomMapper::class); // Use custom mapper $mapper = MapperFactory::create(123, $prgRom, $chrRom);
Supported Mappers
Currently supported mappers:
- Mapper #0 (NROM) - The most basic mapper without bank switching, used for games like Super Mario Bros
- More mappers coming soon...
License
This project is licensed under the MIT License. See the LICENSE file for details.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-05-24