This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

Isn't there a way to edit star amount

Isn't there a way to edit star amount
by on (#29070)
in the lost levels with a hex editor?

by on (#29082)
Are you asking if there's a way to increase the number of invincibility stars in a level using a hex editor?

If so, yeah, but you'll probably have to change a ton of other stuff too. You'll have to figure out how the game engine works, and you'll probably have to redesign levels to add stars to it. I don't know how the level engine works, so you'll have find out from someone else.

by on (#29086)
Well I meant the title stars but thanks.

by on (#29088)
Title stars?

by on (#29089)
You know the ones you need to play the A-D worlds.

by on (#29090)
Sorry, I still don't really know what you're talking about. Where are these stars on the screen?

by on (#29091)
Celius wrote:
Sorry, I still don't really know what you're talking about. Where are these stars on the screen?


If you beat the game once, get 1 star if you beat it again another star, if you... and so on.

by on (#29093)
Oh! Like when you beat it and then you can go to world *1-1? Then if you beat it again, you go to **1-1?

If that's the case, you don't want a standard hex editor for that. You'll want to figure out where to change that, and you'll want to change it in FCEUXD's hex editor, because it will edit the RAM, which is where the information should be. It won't be in the PRG ROM.

by on (#29095)
Per each star should be a value somewhere in the RAM that increases 1 up each star, starting at 00 I assume.

On Pocketheaven there was a patch that changed around the SMB2(j) pirate to work correctly, but it also allowed those world selections you're talking about.

by on (#29097)
Celius wrote:
It won't be in the PRG ROM.

How do you think stuff usually gets into RAM? Probably the game does this somewhere in ROM:

lda star_variable

If you change the ROM to:

lda #3

You'll have hardwired the stars to be 3.

by on (#29098)
There's probably a byte in RAM that holds the current star value, because it starts off at zero, and when you beat the game, it increases by one. You'd be better off just finding that byte in RAM and changing it to whatever you wanted. And besides, you wouldn't want to change the LDA StarVariable to immediate. That way, when you beat the game again, the star count will still be #3.

EDIT: If you find out whatever byte in RAM the star counter is, you can just stick an LDA (Whatever you want)/ STA StarVariable in the code.

by on (#29100)

by on (#29126)
In fact, if you go to:

http://sm2.beneficii.net

And download all the source files and use FDSINFO to get the CHR files, and then use ASM6 to assemble them, you'll get a game that starts off with 8 stars. Basically, for testing purposes, until the disassembly is completed, I have it set to have assemblies of the game start off with 8 stars. (Go to diskmain.asm and toward the bottom you will see where the byte gets set.)

Basically, the value is stored in a "file" on the disk called "SM2SAVE ". It overwrites the value stored under the label "NbrGamesWon" in file "SM2MAIN ".

Here is what the line in the disassembly source looks like:

.byte 8 ;just this one byte (indicating no games won)

Disregard the "indicating no games won" comment as this is for when the disassembly is completed (when it's completed, I will set it to 0, like it is in the actual game). This btw is the only difference from the original game in the disassembly, and it will be corrected once testing is finished.

The 8 in ".byte 8" indicates that 8 games were completed, which is sufficient to get to World A.

-------------------------------------

Also, if you have a hex editor, you can open up the game with that, and find where it says "SM2SAVE " and go to the 7th byte following that string. The value to change should be a 00, and it should be preceded immediately by a value 04 and should be followed by immediately by an FF or 00. This should also be at the very end of the game (in other words, the rest of the game should be all 00's or FF's). Change that to, say, 8 or whatever your preference.

by on (#29141)
I remembered that it was as simpler as changing one of the last few kilobytes in hexworkshop.

by on (#29142)
NottheCommonDose,

Yes, and just as a preventative measure, if the change doesn't seem to take effect, then you might want to make sure to move the emulator's SAV file for the game out, as the value in there would be being used to replace the value that you just modified.

by on (#29145)
beneficii wrote:
NottheCommonDose,

Yes, and just as a preventative measure, if the change doesn't seem to take effect, then you might want to make sure to move the emulator's SAV file for the game out, as the value in there would be being used to replace the value that you just modified.


I'm only doing this for the Mario 2 kaiser pirate which has a different titles screen along with the main ground colors switched and Mario's name being dummied out and replace with Rambo? (I'll have to check for spellling latter)

by on (#31045)
I found it! 0x0000CC3C now you can edit the amount of stars you have in the lost levels! It's the FDS version.