Close

MSX Music

A project log for MSX COMPATIBLE BOARDS FOR RC2014

Create a series of boards designed for the RC2014 bus to achieve MSX/MSX2 compatiblity

dean-nethertonDean Netherton 02/01/2022 at 23:500 Comments

I have finished and recently listed on Tindie, a new module - the YM2413 MSX-MUSIC module for RC2014.

This module is based on the YM2413 chip, which was incorporated into the MSX2 and MSX2+ standards.

My version of this module, fits into the standard RC2014 bus and includes its own embedded ROM image to provide BIOS and MSX-Basic extensions.

Here is a short video of the module in action: 

The sound quality, as captured on my phone, is not great - it sounds much better in person!


Some of the key design elements:

The YM2413

The heart of this module.  This chip generates the audio signals.  See the msx.org page for some details (https://www.msx.org/news/en/ym2413-application-manual-correction-and-cleanup) or the wikipage (https://en.wikipedia.org/wiki/Yamaha_YM2413)

Onboard ROM

The board uses the same ROM chip used on many RC2014 and other similar retro kits - the SST39SF040 512K ROM Nor Flash chip.  (it should also probably work just find with the smaller variants).

The ROM image only needs to contains a small 16K extension, for MSX-BIOS and MSX-BASIC, to enable programs to control the YM2413 sound chip.  Of course, there is nothing stopping any application software from directly controlling the YM2413 chip. 

As the onboard software only uses the first 16K of the chip, this leaves the rest available for future possibilities.  The ROM is mapped to slot 3-1, via the select signal from the MSX-MEMORY ROM/RAM module.

The ROM and logic are designed in such a way, that its possible to flash (write) to the chip using a software utility.  It does requires quite a bit of slot mapping trickery -- so I was very happy when I was able to successfully update the NOR flash using a MSX-DOS utility I wrote, MUFLASH.COM.

I also hope to add to my NEXTOR/MSX-DOS driver the ability to read and write to the spare space of the ROM as an extra storage drive.

Audio sub-circuit

The output signals of the YM2413, do need some further processing and amplification.  There are a few different designs that I found online ( mostly by hackers creating their own cartridges for MSX and some wiring up this chip to other micro-controllers such as Arduinos modules)

I settled on a single op-amp based design, to keep the circuit as simple as possible.  The sound quality it produces seems generally quite good - although it does have a tendency to pick up some stray interference - but when music and sound are playing, any background noise is no longer noticeable.

Most designs, using the MSX cartridges, power their op-amps using the +12/-12 rails - I found I could use a small charge-pump (TC7660) to generate a -5V from the +5V on the RC2014 bus and drive the op-amps with these voltages just fine.  The charge pump selected, oscillates at about 120Khz - and get the job done.

The board also has a header, to take in the audio signal from the MSX-GAME's YM2149 sound chip, mixing the 2 audio signals together.

Software

As the onboard ROM contains the MSX-BASIC extensions, small MSX-BASIC programs with MML embedded in them, operate the chip nicely, although I do find the code can be a little bit obtuse.  See the msx.org page (https://www.msx.org/wiki/PLAY)

I also download Laurens Holst's VGMPLAY.COM utility to play VGZ and VGM music files for the YM2413 chip.  

And of course, any games that use the chip will work just fine.

Bug

Nothing is ever perfect, and when I started trying to get the paging of the 512K ROM to work in the MSX Slots/paging system, I found I had goofed the addressing for the paging register.  This is the register that select a specific 16K page, that is then mapped into the Z80's address range ($4000 to $7FFF).  It was intended that writing to address $7FF7 would trigger the page selection register (as per the FMPAC cartridge design) - but due to my goof, I actually need to write to address $7DF7  (or $E000 for slot 3) to select the correct 16K page. 

This module is listed on my Tindie store at: https://www.tindie.com/products/dinotron/ym2413-msx-music-module-designed-for-rc2014/  

Although at the time of writing this blog entry, my store is currently paused accepting orders (expect for Australia), due to recent issues with international deliveries going missing - due to omicron/covid/post Christmas logistic issues.  My store will re-open for international order from Valentine's day 14th Feb.

Discussions