Language…
4 users online: Firstnamebutt, sinseiga, tOaO, yv64n - Guests: 87 - Bots: 341
Users: 64,795 (2,381 active)
Latest user: mathew

Sign block help

Hi, I'm recently making a new hack, I'm using 1524's sign block that displays messages from other levels when pressing up. the thing is, it doesn't display messages above 24, and there's this not in the asm file: "if greater than 24, subtract #$DC", and I don't understand what does it mean.
I really need help about this.
Gotta aim fast.
It's how overworld numbers are stored. You can only assign messages to levels 0-24 and 101-13B but it's stored as a single two digit number. So for numbers 101 and above you subtract hex DC.

One example: level 105 would be 105-DC = 29.
Alcarobot has a command to convert between the two formats you can use. Just put 13bf <your level number> and press submit and it will give you the number you have to enter there.
OK, now I understand, thank you.
Gotta aim fast.
I have another problem, when I subtracted #$DC with using level 102, the game crashed,here's how I proceeded:

! Level = $102 - $DC.

What should I do?
Gotta aim fast.
Perhaps you're formatting it wrong? Asar (the program that inserts ASM into the ROM) doesn't like spaces in calculations. Maybe try this instead:

Code
!level = $102-#$DC


(no guarantee though, didn't test it)

If that also fails, you can still calculate it yourself and put it there ($26 in this case).


 


Originally posted by WhiteYoshiEgg
Code
!level = $102-#$DC


(no guarantee though, didn't test it)

If that also fails, you can still calculate it yourself and put it there ($26 in this case).

That won't work, as Asar will throw an error from the "#" character. You sould use this instead:

Code
!level = $102-$DC


That said, there is a small risk with doing assembler math like this. Asar may assume the result of this math is supposed to be a 16-bit number rather than 8-bit number, which can cause issues with certain commands. To be safe, find this line in the sign block:

Code
LDA #!level

and change it to this:

Code
LDA.b #!level

The ".b" after the opcode ensures that Asar interprets the length of the number correctly.

Professional frame-by-frame time wizard. YouTube - Twitter - SMW Glitch List - SMW Randomizer
Originally posted by Thomas
That won't work, as Asar will throw an error from the "#" character.

Oh right, yeah, messed that one up.