40 users online: 1UPdudes, acd13141,  Ahrion, Anas, anonimzwx, ASMagician Maks, bandicoot, chineesmw, cozyduck, Golden Yoshi, Guleyan112, h.carrell, Hammerer, HD_DankBaron, hendog30_, Lightning, lo fang 123, Meows', Mohamad20ZX, NerDose, Nitrogen,  patcdr, Phyll, racknae, Ragey, Ralshi02, RPG Hacker,  Sayuri, simon.caio, sio-kedelic, steelsburg, TheBourgyman, thi2pra1, Torchkas, Tripii, Tulip Time Scholarship Games, Ultima, wye, yoshifanatic, zAce08xZ - Guests: 198 - Bots: 175
Users: 64,316 (2,437 active)
Latest user: Svety7

SMW Memory Map

Displaying 1 out of 1 addresses.

View: moderated | waiting (15)


  • Pages:
  • 1
ROM Address Length Type Description Details
$009012 51 bytes Subroutine (JSR) 6-digit* HexToDec subroutine to write a player's score into status bar.

Call with Y = #$00, X as the position to write to on the status bar (standard is #$14), and $00-$03 as the score to write (in hexadecimal). Note that this routine does not remove leading 0s; that is handled at $008EDE and $008F0C.

Works like this: count how many subtractions by 10n (with n=5) without the difference going into the negatives; that number of subtractions is the digit for the 10ns place. Then repeat but with 10n-1. This is the "left-to-right" version of base conversion using repeated subtraction to emulate the 32-bit division by 10n.

*SMW displays the score as 7 digits, but the score is actually a 6-digit (decimal) number stored internally, the 7th digit "0" is a static tile not part of this number.
  • Pages:
  • 1