An open API service indexing awesome lists of open source software.

https://github.com/hertzdevil/mm5sound

C++ translation of the Mega Man 5 sound engine
https://github.com/hertzdevil/mm5sound

chiptune megaman reverse-engineering

Last synced: 7 months ago
JSON representation

C++ translation of the Mega Man 5 sound engine

Awesome Lists containing this project

README

          

# mm5sound

This repository is an attempt to translate an ancient 6502 assembly sound driver from Mega Man 5 into modern C++, so that I could use this to teach people a thing or two. Will it succeed!?

The source code does not have to be capable of producing / compiling data in the original form at all, but ROM addresses will be placed near relevant constructs for reference. **This cannot be used to compile music for Mega Man 5**, use [MGCInts](http://github.com/HertzDevil/MGCInts) instead (once I extend the `mm3` engine support).

### Testing

Assuming `Megaman V (U) [!].nes` is available as `mm5.nes` in the same directory, this produces a register write log which can be directly diffed against log files generated by NSFPlay:

```
$ make
$ ./mm5test > output.log
```

ROM images will no longer be required once there is a music data representation within C++.

To check the correctness of the sound driver:

- Log **all 76** songs from the Mega Man 5 NSF (containing all sound effects, this does not use the 24-song music-only version) from NSFPlay using `LOG_CPU=1 LOG_CPU_FILE=nsf_write.log`, so that each song is played for at least 3 minutes.
- Run `logs/splitter.lua` from the root directory, which prepares individual logs for each song. The original log can be removed.
- Run `logs/verify.lua`.

### Roadmap

- [x] Finish all code (manually)
- [x] Verify all music and sound effects are correct
- [ ] Music data classes (best make them entirely `constexpr` for extra challenge)
- [ ] Auxiliary classes that make it look more like "good" C++ ~~and less like FamiTracker~~
- [ ] Remove the NES memory model
- [ ] Add documentation and pictures
- [ ] Fully annotated disassembly

### License

MIT License.