Announcement

Collapse
No announcement yet.

Street Fighter 2 - new Z80 PCM sound driver project

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Street Fighter 2 - new Z80 PCM sound driver project

    Originally posted by Stef
    Hi folks,

    I guess everyone know this famous game and its reputation for having scratchy voices. One of my crazy future project i had in mind was to rewrite the Z80 PCM sound driver for this game to improve the voices rendering as the Megadrive is perfectly able of playing them well, it just requires good programming... something that Capcom never (wanted to) achieved on the Sega Megadrive hardware.

    I even fixed a bug in the driver ! Because of it the channel 2 can miss one sample from time to time, not very important but still it shows how developer was lazy about it. Also the code is definitely not optimized, of course it do not use buffering but even worse, it uses lazy and slow memory access for many thing and never take advantage of SP register.
    The loop is 749 cycles length (i do not count special case of new command) which mean the sample rate is about 4.8 Khz.
    That is really bad, one of the first driver i wrote (which was not using any buffering) was able to play 2 channels at 14 Khz.

    It took me about 3h to reverse engineer the driver, that was the easy part Now what i need to do is to mimic this driver but replacing it by something safe against DMA. I will use the same method i used in my bad apple demo. The idea is to buffer sample from ROM in Z80 ram during the active period and use them to read sample during DMA which should occurs in VBlank period. Problem is that SF2 is extending VBlank a bit and i don't know if DMA is effectly used before the VInt occurs. If that is the case i will have to "count" to find the correct period where i need to stop ROM accesses... Then i will need to patch some 68k code, i guess they disable Z80 during DMA which we should avoid for instance, same for IO access (but not as important).
    Source:
    http://www.sega-16.com/forum/showthr...driver-project

    Last version of patched
    http://www.sega-16.com/forum/showthr...186#post681186
    lee4 Does Not Accept Codes Requests !
    When lee4 asks a question it does not mean lee4 will look at your game
    *How to create and use SegaCD codes >click here<*
    >)

  • #2
    even on my clone system
    street fighter 2 special champion edition PCM audio patch
    sounds better than before and its almost good as snes version
    Last edited by lee4; 08-29-2014, 02:28:19 PM.
    lee4 Does Not Accept Codes Requests !
    When lee4 asks a question it does not mean lee4 will look at your game
    *How to create and use SegaCD codes >click here<*
    >)

    Comment


    • #3
      I've had my eye on that thread for some time now. Thanks for letting us know it's finished lee.

      Comment


      • #4
        Originally posted by 47iscool View Post
        I've had my eye on that thread for some time now. Thanks for letting us know it's finished lee.
        I dont think is finish yet
        Last edited by lee4; 08-30-2014, 12:20:27 PM.
        lee4 Does Not Accept Codes Requests !
        When lee4 asks a question it does not mean lee4 will look at your game
        *How to create and use SegaCD codes >click here<*
        >)

        Comment


        • #5
          Super Street Fighter 2 - new Z80 driver

          Originally posted by Stef
          Following what have been done with Street Fighter 2' (see here) i decided to have a look in Super Street Fighter 2 game. As they both suffer from terrible voices sound i suspected they used the same Z80 sound driver and indeed they are almost identical (not 100% but *very* close). So i just patched SSF2 the same way i did for SF2

          Here are the original samples for those interested :
          https://dl.dropboxusercontent.com/u/...sf2/sample.wav

          It's crazy to see they spent 700 KB just for PCM (3 times the amount used in SF2'), a big part is wasted in the stupid echo effect on dying
          Also this time they heavily filtered samples, it sounds less scratchy but also a lot more muffled and similar to how it sounds on the SNES version i guess.

          Something that surprised me is that they wasted lot of ROM space in storing data (GFX) in inefficient ways, with more compression they could definitely achieve to get the game fitting in 4 MB... also they used to fill unused areas by some "fake" data (repeated patterns + some random data) so you may think the rom does not contains any free parts even if it actually does I have no idea why they did that but that make things more complicated for me to relocate the driver...

          Anyway here is the rom, i have to admit i quickly patched it (removing useless bus req mainly and driver change of course) so i hope it's ok (tested it half a hour on real hardware) :

          Note the patched rom is based on the US version as the SF2' patch. Enjoy !
          Source:
          http://www.sega-16.com/forum/showthr...new-Z80-driver
          lee4 Does Not Accept Codes Requests !
          When lee4 asks a question it does not mean lee4 will look at your game
          *How to create and use SegaCD codes >click here<*
          >)

          Comment

          Working...
          X