MSX BASIC - Default SOUND register values?

By chalky

Expert (69)

chalky's picture

27-01-2020, 10:26

I am programming some background music using MML in MSX-BASIC and need to switch between the PLAY and SOUND commands. After setting up the SOUND registers for an explosion, everything is borked when returning to PLAY.

I know that BEEP resets all the SOUND registers to their defaults but would prefer to do this programmatically if possible to avoid hearing a beep before the music restarts. I have found plenty of information on how to setup the SOUND registers 0-13 to create various effects - but none on what their default values are (setting them all to 0 does not work) and for some reason they are all write-only.

Can anyone please help?

Login or register to post comments

By chalky

Expert (69)

chalky's picture

27-01-2020, 13:36

Ok - setting register 7 to 56 (with registers 0-6 and 8-13 all set to zero) seems to work.

By gdx

Enlighted (6438)

gdx's picture

27-01-2020, 14:23

By chalky

Expert (69)

chalky's picture

27-01-2020, 14:48

I have no idea how I missed that - but thank you (particularly as I've just realised that only setting register 7 doesn't quite work correctly)! Smile

By thegeps

Paragon (1259)

thegeps's picture

27-01-2020, 23:53

DEFUSR=&H90:A=USR(0)

By chalky

Expert (69)

chalky's picture

28-01-2020, 10:06

Thanks thegeps. I had already adopted the DEFUSR method as simply setting th 13 registers did not work properly - so the BIOS routine must do something else as well. A welcome bonus is that I saved several bytes of RAM by doing so - which is becoming increasingly full as I near the end of the game's development. Writing anything significant in only 24k is certainly a challenge! Big smile

By thegeps

Paragon (1259)

thegeps's picture

28-01-2020, 11:27