MOD player for the Sega Genesis

Discussion in 'General Sega Discussion' started by nineko, Jan 3, 2009.

  1. nineko

    nineko

    I am the Holy Cat Tech Member
    I was reading this thread at project2612's forums and I found out that Toy Story supposedly supports MOD playback. Since the actual MOD used is available on the internet (as said in that thread), Oerg suggested me that the MOD data might actually be present in the ROM, so we looked for that and we found out that that's the case. Only a few bytes are different between the standalone MOD file and the data in the ROM. We then tried to put some other MODs in the ROM, and we found out that it works.
    So yeah, Toy Story contains a semi-functional 4-channels MOD player; it doesn't support all the MOD effects, and the quality isn't that awesome, but still, someone might attempt to disassemble this and use MOD songs in their hacks. They can sound better than smps, and they are smaller than PCM files. I think the load on the 68k is very high though, so this may be useful only for title screens or something.

    Now, on to the resources.
    Toy Story ROM from romnation.net
    Rename said ROM to "toy.bin" and get this nice utility I wrote to replace any MOD file into Toy Story's ROM (granted that said MOD's size is smaller than 93996 bytes). Also yes, lol filename, I didn't rename it kthx.
    Grab this gens savestate to go straight to the title screen since Toy Story has like 9001 splash screens. Just press start once to hear your replaced MOD.

    Have fun with this. Also, in before Oerg.
     
  2. By the way, for your interest, the original MOD from the game extracted is here.

    BTW: The MOD Player plays the MODs 1x too fast.

    That means on every F** command in the MOD, the value has to be increased by 1, because:

    Let's take a MOD with an F06 at the beginning. It plays too fast. Change the F06 to F07 and it will play just or almost like it was intended to be.
     
  3. Overlord

    Overlord

    ...did we just switch realities? Moderator
    17,471
    37
    28
    Berkshire, England
    Learning Cymraeg
    Nice work, guys. This could lead to some interesting stuff in Sonic hacks =P
     
  4. Tweaker

    Tweaker

    Misfit
    12,389
    0
    0
    Very cool! I recall being very impressed at the DAC-based playback in Toy Story, and it's awesome to know that it's more than possible to put your own custom music in there. This could be put to great use in demos, homebrew, and hacks alike. The first thing I'll do is try out that "Spring Yard Past" module I haveā€”that's bound to sound awesome.

    Fantastic work! :)
     
  5. nineko

    nineko

    I am the Holy Cat Tech Member
    Keep in mind that only 4-channels, 31-samples, ProTracker modules will work.

    Despite the .mod extension, some modules can't be played here. Namely, old 15-samples MODs won't work (but it's easy to fix them by adding 16 blank samples), just like non-4-channels MODs. I've yet to check compatibility with other MOD subformats, though most of them were pretty much compatible so there is some hope.
     
  6. Qjimbo

    Qjimbo

    Your friendly neighbourhood lemming. Oldbie
    Quite funny that this has been sitting there all this time, nice find!
     
  7. nineko

    nineko

    I am the Holy Cat Tech Member
    By the way, you all should thank Oerg if this thread exists -- I thought nobody was going to be interested into this, but he was so enthusiastic about it that I couldn't avoid to post what we've done :p

    edit:
    I just found this. I swear, Oerg and I didn't know about it when we were working on this :(
    Oh well.
     
  8. They are not as advanced as we are!



    ... lol

    EDIT: Fixed typing
     
  9. nineko

    nineko

    I am the Holy Cat Tech Member
    But can they type?
     
  10. Hoyl shit I mades a tpyo

    Fixed anyway
     
  11. ICEknight

    ICEknight

    Researcher Researcher
    Awesome. I had always wondered about that song in particular, and why did it sound more like a SNES game...

    Just wondering, is the same MOD being used for the PAL and NTSC versions?
     
  12. Almost. The NTSC one has a lower speed set because the NTSC 60HZ to 50Hz difference automatically makes it faster. The PAL one is the same, just without any speed command because the MOD Player is written for 50HZ and therefore does not need a speed compension.
     
  13. TmEE

    TmEE

    Master of OPL3-SA2/3 Tech Member
    1,726
    0
    16
    Estonia, Rapla City
    T-04YBSC-A !
    That MOD player needs to be extracted, and made into a 68K+Z80 player, so Z80 would do playback, which will give some free time on 68K side and greatly improve playback quality as there will not be any jitter, or at least not as much. It will still be too CPU heavy for use in some Sonic hack...
     
  14. Just a MOD player with UI for the genesis would be awesome :)
     
  15. ICEknight

    ICEknight

    Researcher Researcher
    Heh, just noticed that, going by the pattern numbers, it looks like that cool intro to the main music was done as an afterthought, even after the second track in the MOD had already been started.

    It's quite cool being able to tamper with these music files in their original format. Even the original instrument names are in there, in the MOD's comments. This reminds me a lot of the music in Amiga games.



    EDIT: Also, they didn't bother deleting a copy of pattern #0, at the very end.
     
  16. nineko

    nineko

    I am the Holy Cat Tech Member
    Well, that's not a big problem, as pattern 0 is stored only once, they just left that entry in the pattern table; in the XM format, the pattern table has a fixed length so that 0 wouldn't take any additional byte, I'm not very familiar with the MOD internals, but I guess that it's either like that, or it takes only one more byte. Another possibility is that they specified an incorrect song length in the header, so it's reading invalid data (0) after the end of the pattern table. But this is speculation.

    Either way, that 0 isn't a big waste in terms of filesize.
     
  17. TmEE

    TmEE

    Master of OPL3-SA2/3 Tech Member
    1,726
    0
    16
    Estonia, Rapla City
    T-04YBSC-A !
    That zero wastes 1 or 2 bytes of ROM, nothing more :)
     
  18. Qjimbo

    Qjimbo

    Your friendly neighbourhood lemming. Oldbie
    Bit of a necro topic bump, but I thought people may be interested to hear the developer themselves talking about this:

    http://www.youtube.com/watch?v=x3m3JrVImmU
     
  19. nineko

    nineko

    I am the Holy Cat Tech Member
    Yeah, I saw that video the other day and I immediately thought back at this discussion, too bad that this never proceeded further :(

    By the way, I really, really wish he could join this forum :(