GTMP3 - GTROM variant with MP3 sound expansion

The Membler Industries, Strangulation Games, and Strangulation Records forum.

Moderator: Moderators

Post Reply
User avatar
Memblers
Site Admin
Posts: 4044
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

GTMP3 - GTROM variant with MP3 sound expansion

Post by Memblers »

GTMP3 is now available, contact me or Beau (Sole Goose Productions) if you'd like to get a dev cart. Based on GTROM, one of the two LEDs was removed and replaced with an MP3 player. MP3 files are played from the microSD card. Unfortunately, the NES can't read data from the memory card, only the MP3 chip can.
GTMP3.jpg
The first release to use this this board is an album release by the metalcore band Zao.
https://www.facebook.com/ZAO.Official/p ... =3&theater
https://twitter.com/OfficialZao/status/ ... 5203338240

With how long I've been wanting to make an NES cart with expansion audio hardware, starting with Squeedo 15 years ago where I had a PIC18F running a 4 channel wavetable, then later experiments with PIC32MZ, and now more migrating towards FPGA stuff, it's a little embarrassing that I end up with my first expansion audio cart being 'simply' an MP3/WAV player. It can just sound like anything, but without the dynamic controls of a synthesizer obviously. But it's relatively cheap, practical, connects right up to one of GTROM's expansion outputs (normally are LEDs). The first production run has already been done, it was a smaller batch of 300 though. The price could get lower if we can get into making a larger quantity, don't know if that will be possible, but we'll see.

(as of Oct 29 2019) quantity pricing is $17 each, 512MB microSD included.

10-30-19 edit: updated document (PDF version is outdated):
https://docs.google.com/document/d/108L ... sp=sharing
Attachments
GTMP3.pdf
board documentation
(263.73 KiB) Downloaded 457 times
lidnariq
Posts: 11430
Joined: Sun Apr 13, 2008 11:12 am

Re: GTMP3 - GTROM variant with MP3 sound expansion

Post by lidnariq »

I don't think I see a 3V regulator. Does the MP3 player IC provide one for the SD card? or did you find an SD card that can safely operate off 5V?
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: GTMP3 - GTROM variant with MP3 sound expansion

Post by tepples »

That 1% clock variance and open-loop operation (without audio position feedback) might cause problems when syncing visuals, such as animation in cut scenes, to music. Don't expect anything like Dance Dance Revolution to be possible with this mapper.
calima
Posts: 1745
Joined: Tue Oct 06, 2015 10:16 am

Re: GTMP3 - GTROM variant with MP3 sound expansion

Post by calima »

So just checking, to actually hear it on a NES you need one of those thingies for the bottom expansion port right?
User avatar
Memblers
Site Admin
Posts: 4044
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Re: GTMP3 - GTROM variant with MP3 sound expansion

Post by Memblers »

lidnariq wrote:I don't think I see a 3V regulator. Does the MP3 player IC provide one for the SD card? or did you find an SD card that can safely operate off 5V?
Yeah, the MP3 IC includes a regulator. There's a lot of stuff in there! 16-bit MCU, DSP, DAC, regulator, oscillator, USB host interface (for USB drive), speaker amplifier, headphone out (what the cart uses, mixing the 2 channels together). It's a YX5200, and all the docs are in Chinese.
tepples wrote:That 1% clock variance and open-loop operation (without audio position feedback) might cause problems when syncing visuals, such as animation in cut scenes, to music. Don't expect anything like Dance Dance Revolution to be possible with this mapper.
The datasheet doesn't really say, but I suspect each one may have been calibrated to be nominal at room temperature. If that was true, I think the extreme ends of that variance would only happen at extreme ambient temperatures. We do know it's supposed to be accurate enough to work as a USB host, which I think is 0.5% (but it might calibrate itself from the USB device, that's possible). I didn't measure it, but one test I ran, triggering the same file on my PC had them out of sync by something like 150~250ms by the time it reached the end of an ~5 minute song. So yeah I agree, longer cut scenes would be problematic (unless it's about thunder and lightning effects, then it's all good :lol:), and stuff that requires absolutely perfect sync over a long period is simply impossible.
calima wrote:So just checking, to actually hear it on a NES you need one of those thingies for the bottom expansion port right?
Yeah, it uses the audio expansion jumper by INL. He has 2 models, one has a volume control pot (and switch to select fixed/variable), and a nice 3d-printed cover. The other is just simply a little board with resistor and 2 pins, it's pretty much cheap enough to include with every cart.
User avatar
Memblers
Site Admin
Posts: 4044
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Re: GTMP3 - GTROM variant with MP3 sound expansion

Post by Memblers »

There is an example program here:
https://github.com/Memblers/mp3player
I've attached it to the post if you want check it out (obviously with no audio). It's mapper #2, for testing purposes in 8bitworkshop.

I have written a guide about how to mass-import MP3 files into my "MI Media Player" program:
https://docs.google.com/document/d/1yGJ ... sp=sharing
Attachments
mp3player.c(79).rom.nes
(128.02 KiB) Downloaded 409 times
lidnariq
Posts: 11430
Joined: Sun Apr 13, 2008 11:12 am

Re: GTMP3 - GTROM variant with MP3 sound expansion

Post by lidnariq »

; 186.434 cycles/bit
Hm. The YX5200's data sheet is really insistent that one can change it to faster than 9600 baud, but having read through it now, no-where does it say how.

Kinda funny to come full circle from all of the earlier bit-banged asynchronous serial projects to using same to communicate to a peripheral on the cartridge.

Also funny that it seems to be interfacing to the SD card in SPI mode, not any of the wider faster licensing-required modes. ... er, I guess that makes it "obvious" instead of "funny" :/
zzo38
Posts: 1096
Joined: Mon Feb 07, 2011 12:46 pm

Re: GTMP3 - GTROM variant with MP3 sound expansion

Post by zzo38 »

I read the documentation for GTROM, and my suggestions are to have a variant as following:
  • Mapper register also mirrored at $1xxx and $3xxx (and don't care if it is a read or write). (This causes it to overlap RAM mirrors. There are advantages to overlapping the RAM mirrors in this way.)
  • No rewriting ROM.
  • Battery-backed CHR RAM (by "CHR RAM" I mean all RAM accessed through the PPU).
  • No MP3/WAV playback.
(The last item is already a variant; the other three are further variants. As far as I can tell, there is enough fields in the NES 2.0 header to specify these variants. As far as I know, a submapper bit is not necessary except for the first one, further elaborated below.)

You currently have three NAND gates of three inputs (two of which are used as NOT gates), and four NOR gates of two inputs each (one of which is unused). My proposal above means you do not need three input NAND gates. This means you can use a 74'00 instead of 74'10. You could implement one of the NOT gates using either NOR or NAND, so you have either one NAND gate and one NOR gate left over, or two NAND gates left over.

It could perhaps be wired (LED0 NOR PPUA13) to the A14 of the CHR RAM. If LED0 is high, then the previously unusable part of the CHR RAM is now usable. (This also allows sharing pattern table data with name table data, although I am not so sure how useful this is.)

(I don't know what use you might have for the remaining NAND gate. Possibly something to do with LED1?)
(Free Hero Mesh - FOSS puzzle game engine)
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: GTMP3 - GTROM variant with MP3 sound expansion

Post by tepples »

I can understand what some would see as an advantage of RacerMate Challenge-style battery-backed CHR RAM over self-flashable ROM: it's less likely to cause program loss in case of a severe program defect discovered only after everything has shipped.
zzo38 wrote: Fri Dec 27, 2019 10:38 am
  • Mapper register also mirrored at $1xxx and $3xxx (and don't care if it is a read or write). (This causes it to overlap RAM mirrors. There are advantages to overlapping the RAM mirrors in this way.)
Could you please explain to the rest of us the advantages of mirroring the mapper port within the CPU RAM or PPU I/O space? If you have already explained it, could you post a link so as to refresh our memory? I know the Sega Master System/Game Gear does something similar with its standard mapper.
zzo38
Posts: 1096
Joined: Mon Feb 07, 2011 12:46 pm

Re: GTMP3 - GTROM variant with MP3 sound expansion

Post by zzo38 »

tepples wrote: Fri Dec 27, 2019 4:30 pm I can understand what some would see as an advantage of RacerMate Challenge-style battery-backed CHR RAM over self-flashable ROM: it's less likely to cause program loss in case of a severe program defect discovered only after everything has shipped.
zzo38 wrote: Fri Dec 27, 2019 10:38 am
  • Mapper register also mirrored at $1xxx and $3xxx (and don't care if it is a read or write). (This causes it to overlap RAM mirrors. There are advantages to overlapping the RAM mirrors in this way.)
Could you please explain to the rest of us the advantages of mirroring the mapper port within the CPU RAM or PPU I/O space? If you have already explained it, could you post a link so as to refresh our memory? I know the Sega Master System/Game Gear does something similar with its standard mapper.
The mirror at $3xxx is probably not useful (it is merely a side-effect of the logic), but at $1xxx it allows you to save the value in RAM at the same time writing to the mapper port, which makes bankswitching faster and easier; you can also use read-modify-write instructions, or even just reads at that mirror to restore the bank value. In addition to this, it reduces the amount of logic requirement (even if you do not take advantage of this overlapping), freeing up some additional logic (as in the example I gave). (You can still use $5xxx and $7xxx too, which you can use if you do not want to access RAM at the same time.)

(I did not know about how Sega did it)
(Free Hero Mesh - FOSS puzzle game engine)
Post Reply