Isn't there a way to edit star amount

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

NotTheCommonDose
Posts: 523
Joined: Thu Jun 29, 2006 7:44 pm
Location: lolz!

Isn't there a way to edit star amount

Post by NotTheCommonDose »

in the lost levels with a hex editor?
Celius
Posts: 2159
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Post by Celius »

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.
NotTheCommonDose
Posts: 523
Joined: Thu Jun 29, 2006 7:44 pm
Location: lolz!

Post by NotTheCommonDose »

Well I meant the title stars but thanks.
Celius
Posts: 2159
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Post by Celius »

Title stars?
NotTheCommonDose
Posts: 523
Joined: Thu Jun 29, 2006 7:44 pm
Location: lolz!

Post by NotTheCommonDose »

You know the ones you need to play the A-D worlds.
Celius
Posts: 2159
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Post by Celius »

Sorry, I still don't really know what you're talking about. Where are these stars on the screen?
NotTheCommonDose
Posts: 523
Joined: Thu Jun 29, 2006 7:44 pm
Location: lolz!

Post by NotTheCommonDose »

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.
Celius
Posts: 2159
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Post by Celius »

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.
CKY-2K/Clay Man
Posts: 214
Joined: Sun Apr 01, 2007 2:10 pm

Post by CKY-2K/Clay Man »

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.
Image
Here to at least get an idea of how the NES works. I mean I know alot of the basic things, but this place'll help me grasp more how NES functions.
Major respect to NES developers.
User avatar
kyuusaku
Posts: 1665
Joined: Mon Sep 27, 2004 2:13 pm

Post by kyuusaku »

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.
Celius
Posts: 2159
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Post by Celius »

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.
User avatar
loopy
Posts: 403
Joined: Sun Sep 19, 2004 10:52 pm
Location: UT

Post by loopy »

Last edited by loopy on Wed Aug 20, 2008 11:33 am, edited 1 time in total.
User avatar
beneficii
Posts: 127
Joined: Tue Jul 12, 2005 4:37 pm

Post by beneficii »

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.
NotTheCommonDose
Posts: 523
Joined: Thu Jun 29, 2006 7:44 pm
Location: lolz!

Post by NotTheCommonDose »

I remembered that it was as simpler as changing one of the last few kilobytes in hexworkshop.
User avatar
beneficii
Posts: 127
Joined: Tue Jul 12, 2005 4:37 pm

Post by beneficii »

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.
Post Reply