LoginLogin
Nintendo shutting down 3DS + Wii U online services, see our post

BGM variable glitch

Root / SmileBASIC Bug Reports / [.]

12Me21Created:
BGMPLAY "C$0"*X+"$0=1"*Y
Depending on the values of X and Y, this will either:
  • Work as expected
  • Throw a MML "Internal error"
  • Crash SB
I can't find any pattern, but it seems to only be affected by the amount of variable assignments/uses, not their position or anything else in the MML. (Tested in version 3.5.2)

I'm not too familiar with MML (and I don't have my 3ds rn), what do the commands in those strings do?

$0=1 assigns 1 to BGM variable 0 (accessible with BGMVAR(track,variable)) and C$0 is C with the length controlled by variable 0. I don't think the specific commands/variables/values used matters (something like, say, [C]$1 and $3=27 would probably work too)

It's the first part that causes that: C$0 multiplied with X If X is less than 5 it plays just fine but the channel is playing infinite silence when variable 0 is 0 or not set afaik.
Please don'tHey, 12. Why not testing it and bulging another battery? lol
X being 0 obviously doesn't do anything. X being between 5 and 19 will output Internal error. But when you get X to 20, it just crashes SB. Yes, version 3.6.0 is affected by this as well. SB will crash when X is higher or equal to 20 until you eventually hit the memory limit SB has. The maximum I got without the top menu loaded is 320461. The maximum I got with the top menu loaded is 312970.
Hmm...Does SmileBASIC have a bit more memory without having the top menu loaded?
EDIT: Forgot a part in post EDIT: Added stuff to post