Language…
12 users online: Ahrion, ASSATAKKU, Dispace, drkrdnk, Fern4nDitto, Isikoro, Jcdenton, Neidave, OEO6, ollipc64, Retr0_Dave, wye - Guests: 78 - Bots: 148
Users: 56,985 (2,282 active)
Latest user: AzureDread

Music Volume Changer

SMW Blocks → Music Volume Changer

Submission Details

Name: Music Volume Changer
Author: AuraDee
Added:
Act As: Any
Includes GFX: No
Description: A block that, when interacted with, will allow the player to increase the background music's volume by pressing up, or decrease it by pressing down.

AddmusicK is needed to insert two included sound effects. This block will not work without them!
See the included readme for more details.
Tags: lorom music sa-1 spc700
Comments: 2 (jump to comments)
Rating:
0.0 (0 ratings)
No rating
Download 3.95 KiB | 298 downloads

Comments (2)

TheBiob Link
Code
Main: LDA $14 : AND #$01 : BEQ Return
would probably work to make it continuously go up/down
 Erik Link
I was gonna reject this but decided against it. The change is way too simple to justify a rejection, anyway.
The main problem would be that you use CMP instead of AND. While by itself it might not look too bad in a block like this, there are occasions where players leave, say, their Y key pressed while pressing up in the block, and it wouldn't work because of you comparing the exact button press of Up/Down. By using AND (or BIT) players could have other buttons pressed alongside those and the block can still do its intended job.
You also can move the Return: label to the second RTL, removing the last RTL to save a byte.
The code can be even more optimized, using X to hold the sound value while A does the button checks - here's how I'd do it.
Code
Main:
       LDX #!SFXUp
       LDA $15
       BIT #$08
       BNE Store
       AND #$04
       BEQ Return
       LDX #!SFXDown
Store:
       STX !SFXPort
Return:
       RTL


Anyways though, good job with it! Feels kinda weird that the volume does not constantly change volume if I hold the arrow, but whatever, and I couldn't figure out how to do that too anyway.