0 users browsing Hacking. | 3 bots  
    Main » Hacking » MSU1 for Super gameboy
    Pages: 1
    Posted on 19-12-18, 12:29
    Post: #1 of 7
    Since: 12-18-19

    Last post: 1793 days
    Last view: 1792 days
    Hi,

    I would like to add msu1 support for the favorite game of my youth, Final Fantasy adventure.

    The asm for the gb rom is relatively simple, I can mute it by
    ROM0: 119C E0 90 ld (FF00+90),a
    (this writes the track theme to HRAM FF90, so nop out will result in a mute)
    ROM0: 119E EA 9B D4 ld (D49B),a
    (this writes the track number into WRA1 D49B

    So, if I have the track number, I could very simply modify the SGB bios ram to run a msu code. The problem is: how do I get the byte at GB D49B to an arbitrary snes sgb ram?

    I found that the gb header is transferred by
    00bc11 lda $7000,y [017000] A:e500 X:0000 Y:0000
    00bc14 sta $0600,x [010600] A:e5f1 X:0000 Y:0000
    into snes ram (this reads gb rom data 0104-014f and transfers it into snes ram 0600-0650 region). But I have no idea how to modify the $7000 (if possible) to read from the offset D49B.


    Has anybody here maybe a solution how to achieve this goal? All is needed to transfer one byte from GB wram into snes wram...
    Posted on 19-12-18, 14:12

    Post: #26 of 40
    Since: 10-29-18

    Last post: 711 days
    Last view: 711 days
    I'm afraid that isn't possible at all, the MSU1 and the Super Game Boy device both use the same pin for audio mixing, as well as the Satellaview. That means neither one of them can be used simultaneously, unless you literally modify the MSU1 spec to virtually upgrade the SNES, given the fact the MSU1 was done to work within the video game specs.
    Posted on 19-12-18, 16:33 (revision 3)
    Post: #2 of 7
    Since: 12-18-19

    Last post: 1793 days
    Last view: 1792 days
    Much thanks Colines,

    it is working but the music is much too silent and I think buggy (sfx delayed sometimes). I sent you a mail with the link to the files to yann.costa...
    Posted on 19-12-18, 17:02

    Post: #27 of 40
    Since: 10-29-18

    Last post: 711 days
    Last view: 711 days
    This is really interesting. I theorize the problem lies on the volume mixing levels, since you're pretty much using 3 audio sources: the MSU1, the SGB, and the SPC700 itself.

    I suppose the code written in the emulator for ssuch task only takes 2 audio sources in consideration. By the way, which emulator are you using? I'm really surprised you were able to put together this situation when the MSU1 isn't supposed to.
    Posted on 19-12-18, 20:05 (revision 1)
    Post: #3 of 7
    Since: 12-18-19

    Last post: 1793 days
    Last view: 1792 days
    I use bsnes plus v4. The spc isn't used at all. I destroyed the complete spc700 Apu code and it didn't have any effect at all... So it's only sgb music output and msu...
    Posted on 19-12-18, 22:26 (revision 1)

    Post: #224 of 456
    Since: 10-29-18

    Last post: 44 days
    Last view: 1 day
    According to this schematic the APU, EXT and CART use separate lines though?

    My current setup: Super Famicom ("2/1/3" SNS-CPU-1CHIP-02) → SCART → OSSC → StarTech USB3HDCAP → AmaRecTV 3.10
    Posted on 19-12-18, 23:58

    Post: #4 of 4
    Since: 10-30-18

    Last post: 1799 days
    Last view: 1798 days
    Posted by NTI
    I'm afraid that isn't possible at all, the MSU1 and the Super Game Boy device both use the same pin for audio mixing, as well as the Satellaview. That means neither one of them can be used simultaneously, unless you literally modify the MSU1 spec to virtually upgrade the SNES, given the fact the MSU1 was done to work within the video game specs.


    This isn't true. The MSU-1 and SGB do use the same pins, the Satellaview does not. However, it's really irrelevant, since they're analog audio lines. There is no "contention" like a digital bus, the results just get averaged out, which in an analog context just mixes the input sounds together. This is the exact same way that the MSU-1 audio or SGB audio, or Satellaview audio gets mixed into the SPC audio. If they couldn't coexist simultaneously, none of those things would work at all.
    Posted on 19-12-19, 02:52
    Full mod

    Post: #374 of 443
    Since: 10-30-18

    Last post: 1101 days
    Last view: 172 days
    Copying information from the Discord chat, at some point (around v100, perhaps?) bsnes changed the way it mixed multiple audio streams, from straight averaging (which implies that each of N channels can have a maximum volume of 1/N of the "real" volume) to something a bit fancier, that doesn't decrease the volume so much. bsnes plus was forked before the audio mixing update, so the low volume of MSU-1 music might just be due to that. If you can get your demo working on a more modern version of bsnes or higan, that would be a better indication.

    The ending of the words is ALMSIVI.
    Posted on 19-12-19, 03:13 (revision 1)

    Post: #28 of 40
    Since: 10-29-18

    Last post: 711 days
    Last view: 711 days
    Thank you for shedding some light into the issue. Not going to oppose an Electrical Engineer!

    Though I'm still fairly certain, or have heard byuu/Kawa saying, the MSU1 wasn't originally conceived to work with any other device that also uses the same audio mixing pins on the cartridge connector or expansion port. But I refrain from pulling any more educated guesses out of thin air until I get more understanding about the subject.

    Edit: Eh, classic logical reasoning oversight, it's OR, not AND. xp
    Posted on 19-12-19, 03:17
    Should be asleep

    Post: #453 of 599
    Since: 10-29-18

    Last post: 195 days
    Last view: 6 hours
    Correct me if I'm wrong but wouldn't the cart connector's audio pins and the expansion port's audio pins be two separate pairs 🤔

    I mean, if the Satellaview goes into one and the SGB/MSU1 in the other... but don't take my word on that, I only know of the cart side of things!
    Posted on 19-12-19, 11:18
    Post: #4 of 7
    Since: 12-18-19

    Last post: 1793 days
    Last view: 1792 days
    Here it is an example:
    https://drive.google.com/open?id=1BHv15xCKzhzJQThABuNCPf7lxd3CAlhA


    - Apply ffa_mute.ips on final fantasy adventure (u) [b1].gb
    - Apply sgbBios.ips on Super Game Boy (World) (Rev 2).sfc
    - Rename Super Game Boy (World) (Rev 2).sfc into sgBios.sfc
    - Take a pcm of your choice and rename it into sgbBios-2.pcm
    - Put the files along with sgbBios.msu into a folder
    - run bsnes plus -> load special -> load super Game Boy Cartridge
    load the sgbBios as base cartridge and the final fantasy as Gameboy cartridge

    You should hear very silent the msu (if you don't try with another pcm (I used dkc_msu-2.pcm)

    For higan you may need a bml, haven't made one yet, so bsnes plus is the emulator of choice for now.
    Posted on 19-12-19, 17:04

    Post: #29 of 40
    Since: 10-29-18

    Last post: 711 days
    Last view: 711 days
    Manifest for higan v106:

    C:\Users\[name]\Emulation\Super Famicom\Super Game Boy 2 (Japan).sfc\manifest.bml
    board region=ntsc
    rom name=sgbBios.sfc size=0x80000
    map address=00-7d,80-ff:8000-ffff mask=0x8000
    map address=40-7d,c0-ff:0000-7fff mask=0x8000
    icd2 revision=1
    map address=00-3f,80-bf:6000-67ff,7000-7fff
    rom name=sgb2.boot.rom size=0x100
    msu1
    map address=00-3f,80-bf:2000-2007
    rom name=sgbBios.msu
    track number=0 name=sgbBios-0.pcm
    track number=1 name=sgbBios-1.pcm
    track number=2 name=sgbBios-2.pcm

    information
    region: NTSC
    title: Super Game Boy 2 (Japan)
    sha256: fc8a1836dfac4fe723937cc53b5ae49da5deb2137ee6910c6bb34d7a29abc940


    Also tested on bsnes v113.1, seems to be... Working fine? No lowered volume, sound effects play just fine and aside from the continous BGM (which I believe you did on purpose for the sake of testing), everything went smooth. I did a little comparison to an youtube playthrough, and I couldn't notice anything out of order, but I might be wrong.
    Posted on 19-12-19, 23:31
    Post: #5 of 7
    Since: 12-18-19

    Last post: 1793 days
    Last view: 1792 days
    Awesome Colines :D

    bsnes 113 works just fine!!! Incredible. Now I only need a way to get a gameboy wram into snes ram... do you have any ideas ^^

    I report to this bug to devinacker
    Posted on 19-12-23, 16:21
    Post: #6 of 7
    Since: 12-18-19

    Last post: 1793 days
    Last view: 1792 days
    For anybody wants to try it out, here's the patch file:

    It gives msu1 support for Final Fantasy Adventure, but buggy. So it is a proof that it works but not the final solution (screen flickering and maybe not all track changes are recognized):
    https://drive.google.com/open?id=1EDqWU8-obQqoOPlMiPVcgenxBcuf2eDZ

    If anybody knows how to implement data_snd to get it bug free, let us know ;)
    Posted on 19-12-25, 13:27 (revision 1)
    Post: #7 of 7
    Since: 12-18-19

    Last post: 1793 days
    Last view: 1792 days
    Just a short update, I fixed most bugs of my try patch for FFA (flickering, level-up interruption) and I think (hope) the game is now fully playable. There's only a short graphical glitch for a fraction of a second when the track is smuggled in vram (the most bottom-right tile).
    This patch may be revised if we find out more about data_snd (or another method), but I think (for now) this glitch is bearable and good to go for a complete PCM set, so I posted it in the dev section of zeldix:
    http://www.zeldix.net/t2034-final-fantasy-adventure-seiken-densetsu-1-for-super-gameboy#32897
    Redownload the patch in first post to have the flickering and other stuff fixed
    Pages: 1
      Main » Hacking » MSU1 for Super gameboy
      [Your ad here? Why not!]