• Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!

    You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!

Completed Dpad Left/Right in CSS toggle music ON/OFF (PAL)

tufferugli

Smash Rookie
Joined
Oct 14, 2018
Messages
15
hi all,
i would really like to control the volume of music from the css in this way

dpad left: sfx/music slider in the middle
dpad right: sfx/music slider all the way to the right (no music)

is this possible?

edit:
Punkline did it <3
 
Last edited:

Punkline

Dr. Frankenstack
Joined
May 15, 2015
Messages
423
This code lets player 1 toggle the music ON with dpad left, and OFF with dpad right. These states will remotely set the options menu setting accordingly, and settings will be saved to the memory card. The DOL Mod can be installed on all versions of Melee, and a PAL gecko code has been included below.

Dpad left/right toggles music on CSS:
Code:
-==-

Dpad left/right toggles music on CSS
[Punkline]
Revision ---- DOL Offset ---- Hex to Replace ---------- ASM Code -
NTSC 1.02 --- 0x802608E8 ---- 8803001A -> Branch
2C040000 40A20030 7F801120 40BF0010 39800000 3960007F 48000010 40BE0018 39800064 39600000 916D81E4 814D8840 998A1CC4 8803001A 00000000

PAL 1.00 --- 0x80261088 ---- 8803001A -> Branch
2C040000 40A20030 7F801120 40BF0010 39800000 3960007F 48000010 40BE0018 39800064 39600000 916D81FC 814D8858 998A1CCC 8803001A 00000000

NTSC 1.01 --- 0x8026014C ---- 8803001A -> Branch
2C040000 40A20030 7F801120 40BF0010 39800000 3960007F 48000010 40BE0018 39800064 39600000 916D81E4 814D8840 998A1CC4 8803001A 00000000

NTSC 1.00 --- 0x8025F5DC ---- 8803001A -> Branch
2C040000 40A20030 7F801120 40BF0010 39800000 3960007F 48000010 40BE0018 39800064 39600000 916D81E4 814D8840 998A1CBC 8803001A 00000000
#
Code:
-==-
!
ASM - Dpad left/right toggles music on CSS
[Punkline]
Revision ---- DOL Offset ---- Hex to Replace ---------- ASM Code -
NTSC 1.02 --- 0x802608E8 ---- 8803001A -> Branch

# compile option:
.set onlyPlayer1, 1
# if true, then only player 1 may toggle music
# if false, then all players can toggle music

# registers:
.set rPadID, 4
.set rPad,   28
.set bDPadRight, 30
.set bDPadLeft,  31

.ifne onlyPlayer1
  cmpwi rPadID, 0
  bne+ _return   # return if not player 1
.endif
# this .if block only compiles if the setting "onlyPlayer1" is TRUE

mtcrf 0b00000001, rPad
# dpad bools are now in cr7

_check_dleft:
bf+ bDPadLeft, _check_dright
  li r12, 0
  li r11, 0x7F
  b _store_music_settings
  # if dPadLeft,
  # then Music:SFX ratio is set to 0 (in range -100...100)
  # and Music volume is instantly set to 100

_check_dright:
bf+ bDPadRight, _return
  li r12, 100
  li r11, 0x00
  # if dPadRight,
  # then Music:SFX ratio is set to 100
  # and music volume is instantly muted

  _store_music_settings:
  stw r11, -0x7E1C(r13)  # 1.02
  ##stw r11, -0x7E04(r13)  # PAL
  ##stw r11, -0x7E1C(r13)  # 1.01
  ##stw r11, -0x7E1C(r13)  # 1.00

  lwz r10, -0x77C0(r13)  # 1.02
  ##lwz r10, -0x77A8(r13)  # PAL
  ##lwz r10, -0x77C0(r13)  # 1.01
  ##lwz r10, -0x77C0(r13)  # 1.00

  stb r12, 0x1CC4(r10)
  ##stb r12, 0x1CCC(r10)  # PAL
  ##stb r12, 0x1CC4(r10)  # 1.01
  ##stb r12, 0x1CBC(r10)  # 1.00
  # settings have been stored, and will persist for game runtime

_return:
lbz r0, 0x001A (r3)
.long 0



PAL 1.00 --- 0x80261088 ---- 8803001A -> Branch
.set onlyPlayer1, 1
.set rPadID, 4
.set rPad,   28
.set bDPadRight, 30
.set bDPadLeft,  31
.ifne onlyPlayer1
  cmpwi rPadID, 0
  bne+ _return
.endif
mtcrf 0b00000001, rPad
_check_dleft:
bf+ bDPadLeft, _check_dright
  li r12, 0
  li r11, 0x7F
  b _store_music_settings
_check_dright:
bf+ bDPadRight, _return
  li r12, 100
  li r11, 0x00

  _store_music_settings:
  ##stw r11, -0x7E1C(r13)  # 1.02
  stw r11, -0x7E04(r13)  # PAL
  ##stw r11, -0x7E1C(r13)  # 1.01
  ##stw r11, -0x7E1C(r13)  # 1.00

  ##lwz r10, -0x77C0(r13)  # 1.02
  lwz r10, -0x77A8(r13)  # PAL
  ##lwz r10, -0x77C0(r13)  # 1.01
  ##lwz r10, -0x77C0(r13)  # 1.00

  ##stb r12, 0x1CC4(r10)
  stb r12, 0x1CCC(r10)  # PAL
  ##stb r12, 0x1CC4(r10)  # 1.01
  ##stb r12, 0x1CBC(r10)  # 1.00

_return:
lbz r0, 0x001A (r3)
.long 0



NTSC 1.01 --- 0x8026014C ---- 8803001A -> Branch
.set onlyPlayer1, 1
.set rPadID, 4
.set rPad,   28
.set bDPadRight, 30
.set bDPadLeft,  31
.ifne onlyPlayer1
  cmpwi rPadID, 0
  bne+ _return
.endif
mtcrf 0b00000001, rPad
_check_dleft:
bf+ bDPadLeft, _check_dright
  li r12, 0
  li r11, 0x7F
  b _store_music_settings
_check_dright:
bf+ bDPadRight, _return
  li r12, 100
  li r11, 0x00

  _store_music_settings:
  ##stw r11, -0x7E1C(r13)  # 1.02
  ##stw r11, -0x7E04(r13)  # PAL
  stw r11, -0x7E1C(r13)  # 1.01
  ##stw r11, -0x7E1C(r13)  # 1.00

  ##lwz r10, -0x77C0(r13)  # 1.02
  ##lwz r10, -0x77A8(r13)  # PAL
  lwz r10, -0x77C0(r13)  # 1.01
  ##lwz r10, -0x77C0(r13)  # 1.00

  ##stb r12, 0x1CC4(r10)
  ##stb r12, 0x1CCC(r10)  # PAL
  stb r12, 0x1CC4(r10)  # 1.01
  ##stb r12, 0x1CBC(r10)  # 1.00

_return:
lbz r0, 0x001A (r3)
.long 0



NTSC 1.00 --- 0x8025F5DC ---- 8803001A -> Branch
.set onlyPlayer1, 1
.set rPadID, 4
.set rPad,   28
.set bDPadRight, 30
.set bDPadLeft,  31
.ifne onlyPlayer1
  cmpwi rPadID, 0
  bne+ _return
.endif
mtcrf 0b00000001, rPad
_check_dleft:
bf+ bDPadLeft, _check_dright
  li r12, 0
  li r11, 0x7F
  b _store_music_settings
_check_dright:
bf+ bDPadRight, _return
  li r12, 100
  li r11, 0x00

  _store_music_settings:
  ##stw r11, -0x7E1C(r13)  # 1.02
  ##stw r11, -0x7E04(r13)  # PAL
  ##stw r11, -0x7E1C(r13)  # 1.01
  stw r11, -0x7E1C(r13)  # 1.00

  ##lwz r10, -0x77C0(r13)  # 1.02
  ##lwz r10, -0x77A8(r13)  # PAL
  ##lwz r10, -0x77C0(r13)  # 1.01
  lwz r10, -0x77C0(r13)  # 1.00

  ##stb r12, 0x1CC4(r10)
  ##stb r12, 0x1CCC(r10)  # PAL
  ##stb r12, 0x1CC4(r10)  # 1.01
  stb r12, 0x1CBC(r10)  # 1.00

_return:
lbz r0, 0x001A (r3)
.long 0
Code:
$Dpad left/right toggles music on CSS -- NTSC 1.02[Punkline]
C22608E8 00000008
2C040000 40A20030
7F801120 40BF0010
39800000 3960007F
48000010 40BE0018
39800064 39600000
916D81E4 814D8840
998A1CC4 8803001A
60000000 00000000
Code:
$Dpad left/right toggles music on CSS -- PAL 1.00[Punkline]
C2261088 00000008
2C040000 40A20030
7F801120 40BF0010
39800000 3960007F
48000010 40BE0018
39800064 39600000
916D81FC 814D8858
998A1CCC 8803001A
60000000 00000000

---

To make this code work for ALL players, recompile the code with the parameter onlyPlayer1 set to "0".

Alternatively, you may simply delete the first 2 lines of the compiled code:
Code:
2C040000 40A20030
If you do this to the Gecko version of the code, make sure to update the size of the code in the C2 header from "8" to "7".
Code:
C2XXXXXX 00000008  ->  C2XXXXXX 00000007
 
Last edited:
Top Bottom