A try for Game Boy games into MSU-1 (Or MSU-GB) on VBA.

3 posters

Go down

A try for Game Boy games into MSU-1 (Or MSU-GB) on VBA. Empty A try for Game Boy games into MSU-1 (Or MSU-GB) on VBA.

Post by Brutapode89 Thu 8 Apr 2021 - 14:21

Hi guys. As I tested patched Game Boy games into MSU-1 on an emulator like VBA, there's not musics but I thought we could make sure that Game Boy games can got musics CD audio on VBA and other Game Boy emulators.

I try with Final Fantasy Adventure. There are these codes in its .asm:
Code:
define SGB_ROM_BANK = $10


architecture sm83

define romVersion = 4  // Final Fantasy Adventure (US): 1, Mystic Quest Germany: 2, Mystic Quest France: 3 , Mystic Quest Europe: 4

if !{defined MSU1BASE} {
    define MSU1BASE($1800)
}

macro ROMBANK(bank) {
    origin {bank} << 14
    base $4000
}

macro JUMP_TO_BANK(bank) {
    ld      a,{bank}
    ld      ($2100),a
    nop; nop; nop; nop; nop; nop; nop; nop; nop; nop
    ret
}

macro CALL_AND_RETURN_TO_BANK(address, bank) {
    nop; nop; nop; nop; nop; nop
    call    {address}
    ld      a,{bank}
    ld      ($2100),a
    nop; nop
}

origin ($000146)
db $03 //add super gameboy support

origin ($000147)
db $03  // mbc1+sram+battery

origin ($000148)
db $04  // rom size 512k

origin ($000149)
db $01  // rom size 2k

origin ($00014B)
db $33 //add super gameboy support

origin ($00014D)
if {romVersion} == 1 { // Final Fantasy USA
   db $5e //fix checksum
} else {            //Mystic Quest
   db $1d //fix checksum
}



origin ($00119D)
db $a0 //track change

origin ($0011A9)
db $a0 //track change

origin ($0011B5)
db $a0 //track change

if {romVersion} == 1 { // Final Fantasy USA
   origin ($003E7C)
}
if {romVersion} == 2 {            //Mystic Quest Ger
   origin ($003e87)  
}
if {romVersion} == 3 {            //Mystic Quest Fra
   origin ($003e87)  
}
if {romVersion} == 4 {            //Mystic Quest Eur
   origin ($003E7C)  
}
db $a0 //track change







//Special Tracks
// Town Theme
origin ($00340D0)
db $1f //unused town theme 04 -> 1f   


// Requiem Theme
if {romVersion} == 1 { // Final Fantasy USA
   origin ($003415e)
}
if {romVersion} == 2 {  //Mystic Quest German
   origin ($0034162)  
}    
if {romVersion} == 3 {  //Mystic Quest France
   origin ($003415c)  
}    
if {romVersion} == 4 {  //Mystic Quest Europe
   origin ($003415e)  
}
db $1d //unused life lost theme 17 -> 1d


   
// Town Theme after wake up at Inn
if {romVersion} == 1 { // Final Fantasy USA
   origin ($0037f17)
}
if {romVersion} == 2 {  //Mystic Quest German
   origin ($0037eb3)  
}    
if {romVersion} == 3 {  //Mystic Quest France
   origin ($0037ae8)  
}    
if {romVersion} == 4 {  //Mystic Quest Europe
   origin ($0037f17)  
}    
db $1f //unused town theme 04 -> 1f   

origin ($001FF7)
ld      a,{SGB_ROM_BANK}
ld      ($2100),a
call    InitHook

ROMBANK($02)
origin ($008EFB)
db $a0 //track change

ROMBANK($0F)
origin ($03C09E)
call    initTransfer
ret     //Conn: noise remove

//Track change
origin ($03C02E)
call trackChange
nop
nop

origin ($03FEC0)
//for track change
trackChange:
ld a,($ffa0)
ld b,a
ld a,($df75)
ret

initTransfer:
// free space in bank 0f
//Transfer source needs to be executed in gb wram since the track numbers dynamically change
//dfc0 seem to be good
        ld      a, $79
        ld      ($df70),a   //transfer command $79
      ld      a, $01
      ld      ($df80),a
//transfer snes destination address 7f0000
        ld      a, {MSU1BASE}
        ld      ($df71),a
        ld      a, {MSU1BASE}>>8
        ld      ($df72),a
        ld      a, {MSU1BASE}>>16
        ld      ($df73),a
//number of bytes to transfer (one byte)
        ld      a, $01
        ld      ($df74),a
//load theme number
        ld      a,($ffa0)
        ld      ($df75),a

//transfer code
        ld      hl, $df70
        call    SendTrackNumber_Bank0F
        ld      a, $00
        ld      ($ff90),a //mute
        ld      ($ff93),a
        or      a
        ret

origin ($03FFF0)
SendTrackNumber_Bank0F:
    JUMP_TO_BANK({SGB_ROM_BANK})


//=====================================
// Super GameBoy Support Bank
//=====================================
origin ($080000)
// dummy seek to pad rom to 512k

ROMBANK({SGB_ROM_BANK})
InitHook:
call    SGB.Init
ld      a,$00
ld      hl,$C000
ld      bc,$2000
ret

define USE_CUSTOM_PALETTE
define USE_EXPANDED_BORDER
define USE_CUSTOM_BORDER
define USE_CUSTOM_SGB_CODE
include "sgb/sgb.asm"

origin ($043FF0)
UploadMSU1Code_Bank10:
    CALL_AND_RETURN_TO_BANK(SGB.SendUploadCommand, $0F)

What must I do to make sure it's compatible with VBA and other Game Boy emulators without Super Game Boy?
Brutapode89
Brutapode89
Crystal Maiden
Crystal Maiden

Since : 2019-10-06

Back to top Go down

A try for Game Boy games into MSU-1 (Or MSU-GB) on VBA. Empty Re: A try for Game Boy games into MSU-1 (Or MSU-GB) on VBA.

Post by emuandco Wed 14 Apr 2021 - 11:35

Just as a SNES emulator only provides MSU audio if the emulator was modified for MSU support, same goes for any GB(A) emulator. So there is no need to modify anything on a real hardware working MSU patch, but on the emulator itself.
emuandco
emuandco

A try for Game Boy games into MSU-1 (Or MSU-GB) on VBA. Image213

Since : 2014-10-20

http://www.dreimer.de

Back to top Go down

A try for Game Boy games into MSU-1 (Or MSU-GB) on VBA. Empty Re: A try for Game Boy games into MSU-1 (Or MSU-GB) on VBA.

Post by Brutapode89 Wed 14 Apr 2021 - 12:41

emuandco wrote:Just as a SNES emulator only provides MSU audio if the emulator was modified for MSU support, same goes for any GB(A) emulator. So there is no need to modify anything on a real hardware working MSU patch, but on the emulator itself.

What? Have you already tried?

If yes, how can we do that?
Brutapode89
Brutapode89
Crystal Maiden
Crystal Maiden

Since : 2019-10-06

Back to top Go down

A try for Game Boy games into MSU-1 (Or MSU-GB) on VBA. Empty Re: A try for Game Boy games into MSU-1 (Or MSU-GB) on VBA.

Post by emuandco Wed 14 Apr 2021 - 12:58

No I did not. That post was the result of common emulation knowledge.
emuandco
emuandco

A try for Game Boy games into MSU-1 (Or MSU-GB) on VBA. Image213

Since : 2014-10-20

http://www.dreimer.de

Back to top Go down

A try for Game Boy games into MSU-1 (Or MSU-GB) on VBA. Empty Re: A try for Game Boy games into MSU-1 (Or MSU-GB) on VBA.

Post by Brutapode89 Wed 14 Apr 2021 - 13:09

Ah? And how can I modify an emulator like VBA?
Brutapode89
Brutapode89
Crystal Maiden
Crystal Maiden

Since : 2019-10-06

Back to top Go down

A try for Game Boy games into MSU-1 (Or MSU-GB) on VBA. Empty Re: A try for Game Boy games into MSU-1 (Or MSU-GB) on VBA.

Post by emuandco Wed 14 Apr 2021 - 13:15

Without any knowledge in emulation and how the SGB MSU works... You can't
emuandco
emuandco

A try for Game Boy games into MSU-1 (Or MSU-GB) on VBA. Image213

Since : 2014-10-20

http://www.dreimer.de

Back to top Go down

A try for Game Boy games into MSU-1 (Or MSU-GB) on VBA. Empty Re: A try for Game Boy games into MSU-1 (Or MSU-GB) on VBA.

Post by Brutapode89 Wed 14 Apr 2021 - 13:21

emuandco wrote:Without any knowledge in emulation and how the SGB MSU works... You can't

And don't you know do that?
Brutapode89
Brutapode89
Crystal Maiden
Crystal Maiden

Since : 2019-10-06

Back to top Go down

A try for Game Boy games into MSU-1 (Or MSU-GB) on VBA. Empty Re: A try for Game Boy games into MSU-1 (Or MSU-GB) on VBA.

Post by edale Wed 14 Apr 2021 - 13:43

MSU-1 specifically uses hardware capacity already present in the SNES. The GB has no inbuilt capacity to play cd quality audio.

A GB emulator would literally need to code in SNES emulation to have a chance of supporting MSU modded GB games.

edale

A try for Game Boy games into MSU-1 (Or MSU-GB) on VBA. Image110

Since : 2017-10-03

Back to top Go down

A try for Game Boy games into MSU-1 (Or MSU-GB) on VBA. Empty Re: A try for Game Boy games into MSU-1 (Or MSU-GB) on VBA.

Post by Brutapode89 Wed 14 Apr 2021 - 14:32

Or if not, can't we make sure Game Boy games can works with GB emulators by making a .cue file and a .bin file (Like sound pack) with the ROM but without Super Game Boy like for Megadrive games into MSU-MD?

It's why, we could modify the Final Fantasy Adventure .asm file.
Brutapode89
Brutapode89
Crystal Maiden
Crystal Maiden

Since : 2019-10-06

Back to top Go down

A try for Game Boy games into MSU-1 (Or MSU-GB) on VBA. Empty Re: A try for Game Boy games into MSU-1 (Or MSU-GB) on VBA.

Post by emuandco Wed 14 Apr 2021 - 19:30

This guy is a troll. Ignore mode activated
emuandco
emuandco

A try for Game Boy games into MSU-1 (Or MSU-GB) on VBA. Image213

Since : 2014-10-20

http://www.dreimer.de

Back to top Go down

A try for Game Boy games into MSU-1 (Or MSU-GB) on VBA. Empty Re: A try for Game Boy games into MSU-1 (Or MSU-GB) on VBA.

Post by Brutapode89 Wed 14 Apr 2021 - 22:12

Yes. Let's forget this idea.
Brutapode89
Brutapode89
Crystal Maiden
Crystal Maiden

Since : 2019-10-06

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum