News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

Requesting help with a few things..

Started by PHOSPHOTiDYL, July 09, 2016, 01:58:12 PM

Previous topic - Next topic

PHOSPHOTiDYL

So first of all, I'm trying to add another item. I've created my room, set all plm pointers to appropriate free space, made sure the door was properly connected, placed a missile expansion, set the plm variable to 0051 on a vanilla rom, and it doesn't work. I tried this on a half sized energy tank and it doesn't work. Full energy tanks are fine, super missiles and power bombs work, beam items and whatnot. I also tried this using the unused room in norfair with no luck. Which brings me to my next problem...

I've added the wall jump boots to the game. I have it set up properly, however the game freezes when i shoot the orb. I tried a few different plm variables, all unused, and no luck. The boots work when I replace another item with them, just no new plm variables. This bring me to my third problem of getting the boots to show up on the subscreen.

I've been learning some asm but the furthest
I've gotten is moving all the other item cursors, or getting space jump to display twice? I've been going at this nonstop for a couple weeks so any form of help would be appreciated. I've been studying the long beam and black falcon's status slot placement guide.

I've also noticed that when you don't have the spring ball, pressing down from bombs will skip over screw attack and go to hi jump boots. I'll keep studying...

Smiley

Quote from: PHOSPHOTiDYL on July 09, 2016, 01:58:12 PM
I've created my room, set all plm pointers to appropriate free space, made sure the door was properly connected, placed a missile expansion, set the plm variable to 0051 on a vanilla rom, and it doesn't work.
"It doesn't work" can mean a gazillion different things. Does the room crash when you try to enter it? Does the game crash when you pick the item up? What exactly happens?
And what do you mean by "the plm variable"? The high/low values or something else?

PHOSPHOTiDYL

The high/low for the main plm variables. The room will crash when I try a missile expansion, or a split energy tank. An energy tank with an expansion value of 64 works, not 32. By "works" I mean I can sucessfully pickup the item, in chozo ball, shot block, and open forms.

I've tried setting the plm set pointer to free space first, then setting the plms in the room to 1. Also, I've tried copying an existing item plm in a hex editor, pasting to the new plm set pointer, and adjusting its values there.

The room will "work" with the wall jump boots, as in I can leave and re-enter with no problems, until i shoot open the chozo ball, in which case it freezes on the 4th animation frame from the cre tiles, before the item gfx show up.

All other expansions, being suit upgrades, super missiles, power bombs, x-ray, and grapple beam have been set to a value of 0051, displayed the item get message, and showed up on the hud or equipment screen. I could leave the room, re-enter, the item would not be there anymore, and I could continue running around shooting things.

All of this was tested in smile rf 3.0.80 & smile jx 2.83, starting in the new room, or entering from the room it was connected to. All door pointers, level data, and enemy related pointers were put in free space for any connected room I tried this on. I avoided using rooms with the scrolling sky, or any existing item plms in them. There were no errors in smile with my level entries or mdb entries when saving either rooms. Doors were properly aligned, no data was being overwritten.

I've done this multiple times with unheadered vanilla roms, using the mod manual, carefully reading it over, making sure I didn't miss anything. Any ideas??

PHOSPHOTiDYL

Also, any data that got repointed was placed in the appropriate banks, according to the mod manual.

Mettyk25jigsaw

The only things I can think of at the moment are, did you repoint the items in the 'same' bank, probably bank $8F (unless you have used a plm repoint bank patch), I have noticed you put the 'I have placed the data in the appropriate banks' (plural)...There can be only one...

Secondly, have you placed an ending value of something like '00 00' at end of data? If there is "FF FF' there, it will tell the game to load more PLM's and thence forth since it's an invalid PLM, You will have troubles...Although I think the room would not load at all...idk...

Also, are you sure it's not a problem with the missile pick up data itself in bank $84? Possibly it has been messed up...Try putting something else in there, like High jump boots or something...(Just to test that is)...

Good luck...

Quote58

Quote from: PHOSPHOTiDYL on July 09, 2016, 01:58:12 PM
This bring me to my third problem of getting the boots to show up on the subscreen.

I've been learning some asm but the furthest
I've gotten is moving all the other item cursors, or getting space jump to display twice? I've been going at this nonstop for a couple weeks so any form of help would be appreciated. I've been studying the long beam and black falcon's status slot placement guide.

I've also noticed that when you don't have the spring ball, pressing down from bombs will skip over screw attack and go to hi jump boots. I'll keep studying...

The others talked about your plm problems, so I guess I'll talk about the status screen because I know an unfortunate amount about it (as in fully documented, rewritten a couple of times, and manipulated a lot).

First off, it's cool that you noticed the glitch of moving from bombs to hi jump boots, that's actually just a bit of bad programming from nintendo (oh what a surprise):
[from kej's status screen documentation]
CPX #$000A   ;  BUG, should be C. Can't access Screw Attack without Spring Ball or Boots

So ya essentially they either miscounted or added screw attack into Misc later, but either way they're one line short in the original. Easy fix though.

Now, that black falcon doc is great, and was actually useful just now because I couldn't find where I had written down the pointer to the cursor locations, so that was useful.
His document has the locations for the cursor x/y, and the location to index the base tilemap for the status screen, but it doesn't include the pointer to the tile data for the items.
That would be this:
org $82BF32 ;gfx
DW $08FF, $08D8, $08D9, $08DA, $08E7 ;charge
DW $08FF, $08DB, $08DC, $08D4, $08D4 ;ice
DW $08FF, $08DD, $08DE, $08DF, $08D4 ;wave
DW $08FF, $08E8, $08E9, $08EA, $08EB ;spazer
DW $08FF, $08EC, $08ED, $08EE, $08EF ;plasma
DW $08FF, $0900, $0901, $0902, $0903, $0904, $0905, $08D4, $08D4 ;varia
DW $08FF, $08D0, $08D1, $08D2, $08D3, $0903, $0904, $0905, $08D4 ;gravity
DW $08FF, $0920, $0921, $0922, $0923, $0917, $0918, $090F, $091F ;morph
DW $08FF, $08D5, $08D6, $08D7, $08D4, $08D4, $08D4, $08D4, $08D4 ;bombs
DW $08FF, $0910, $0911, $0912, $0913, $0914, $0915, $0916, $08D4, $0000 ;springball
DW $08FF, $08E0, $08E1, $08E2, $08E3, $08E4, $08E5, $08E6, $08D4 ;screw attack
DW $08FF, $0930, $0931, $0932, $0933, $0934, $0935, $0936, $08D4 ;hijump
DW $08FF, $08F0, $08F1, $08F2, $08F3, $08F4, $08F5, $08D4, $08D4 ;space jump
DW $08FF, $0924, $0925, $0926, $0927, $0928, $0929, $092A, $092B ;speed booster


the 0000 after springball is supposed to be there and is probably for indexing purposes.

Now, here's the real question. How exactly are you adding the walljump boots? Because depending on how you add them, you'll have to do different things to make it show up on the status screen. For example, let's imagine that you wanted to add a 100% new item to the game. That means you'll be using a new item bit, probably one of the unused ones in $09A2/4. This mean's you'll need to:
-repoint cursor location table
-repoint gfx table
-repoint tilemap location table
-rewrite a bit of code so the game recognizes your new item bit
-change the base tilemap for the subscreen so that it expands the group you want it placed in (that part's really easy because literally 2 nights ago I wrote a program that'll make the tilemap look however you want (to an extent))
-other stuff I'm forgetting about

When I rewrote the status screen originally, I did all of this stuff so that I could add/remove items easily, however the subscreen was still so bloody obtuse that I decided not to go that route and instead I starting writing a whole new status screen system. However I haven't finished that yet, so for now we have to work within the constraints of nintendo's code.

Now, if you instead say, bundled springball with hijump, and replaced springball's entry with walljump boots, that'd be pretty easy and I'm pretty sure at least 1 hack did exactly that.






PHOSPHOTiDYL

Quote from: Mettyk25jigsaw on July 09, 2016, 04:49:18 PM
The only things I can think of at the moment are, did you repoint the items in the 'same' bank, probably bank $8F (unless you have used a plm repoint bank patch), I have noticed you put the 'I have placed the data in the appropriate banks' (plural)...There can be only one...

Secondly, have you placed an ending value of something like '00 00' at end of data? If there is "FF FF' there, it will tell the game to load more PLM's and thence forth since it's an invalid PLM, You will have troubles...Although I think the room would not load at all...idk...

Also, are you sure it's not a problem with the missile pick up data itself in bank $84? Possibly it has been messed up...Try putting something else in there, like High jump boots or something...(Just to test that is)...

Good luck...

Doors and plms in bank $8F. The other data would be for enemies, if they existed in previous rooms. However, I just tried again using room 7B3E1 again. This time I only repointed the plms to 7E9A0, the same free space I have been using. Missiles in open form with a high/low of 0051 still freeze the game as soon as the room loads. Say I use a beam upgrade instead. I can sucessfully collect that item.

I have 2 shot block missile expansions set up right now, with main values of 0051 and 0052. Both can be collected while in chozo ball and shot block forms. The first missile expansion I pickup gives me 15 missiles, when expansion values have been set to 5. This is just testing in smile though. I'm guessing since the first missile expansion in game is related to the zebes awakening event.

The data looks like this.
83 EF 08 0B 51 00 2F EF 02 09 52 00 00 00

I guess the workaround would be using hidden missiles for additional pickups, and altering existing pickups. Good enough for now.

PHOSPHOTiDYL

Quote from: Quote58 on July 09, 2016, 07:48:52 PM
First off, it's cool that you noticed the glitch of moving from bombs to hi jump boots, that's actually just a bit of bad programming from nintendo (oh what a surprise):
[from kej's status screen documentation]
CPX #$000A   ;  BUG, should be C. Can't access Screw Attack without Spring Ball or Boots

So ya essentially they either miscounted or added screw attack into Misc later, but either way they're one line short in the original. Easy fix though.

Easy fix lol. Used asm to keep in spirit with things.

PHOSPHOTiDYL

Quote from: Quote58 on July 09, 2016, 07:48:52 PM
Now, here's the real question. How exactly are you adding the walljump boots? Because depending on how you add them, you'll have to do different things to make it show up on the status screen. For example, let's imagine that you wanted to add a 100% new item to the game. That means you'll be using a new item bit, probably one of the unused ones in $09A2/4. This mean's you'll need to:
-repoint cursor location table
-repoint gfx table
-repoint tilemap location table
-rewrite a bit of code so the game recognizes your new item bit
-change the base tilemap for the subscreen so that it expands the group you want it placed in (that part's really easy because literally 2 nights ago I wrote a program that'll make the tilemap look however you want (to an extent))
-other stuff I'm forgetting about

I applied JAM's wall jump patch. Smile recognizes it as a new item, and I've sucessfully replaced an existing missile expansion. I shoot open the chozo ball, it shows its boot gfx I added, I collect it, wall jump message displayed, I can now wall jump. Item bitflag would be 0400. I have the base tilemap set up on the equipment screen. Nothing fancy, it's right under speed booster.

Thanks for the info though. I didn't think to repoint the cursors. I'll keep trying.

Mettyk25jigsaw

Ok, one more thing I can think of, are you using headered rom, check to see if rom file size ends with a '3' if so it is a header...If you are just copying over the data to free space and just changing the high and low only and in a hex editor which I am guessing you are doing, and then repointing the Plm pointer...Since you've said you repointed it to 7E9A0, try putting E7A0 instead if rom is a header. Why? A header works a little different to a non-header, you must subtract $200 bytes from the PC Address when converting it to SNES Address. (And vice versa)...
   If this is was the problem and you don't like having to add/subtract $200 bytes all the time, you can get rid of the header and then do it the same way you were doing it (presuming this was the problem, idk)...Just go to rom tab inside smile and select remove header and 'without' saving room under rom tab, just exit smile and then reopen smile. Rom header should be removed now...

PHOSPHOTiDYL

Quote from: Mettyk25jigsaw on July 10, 2016, 08:48:08 AM
Ok, one more thing I can think of, are you using headered rom, check to see if rom file size ends with a '3' if so it is a header...If you are just copying over the data to free space and just changing the high and low only and in a hex editor which I am guessing you are doing, and then repointing the Plm pointer...Since you've said you repointed it to 7E9A0, try putting E7A0 instead if rom is a header. Why? A header works a little different to a non-header, you must subtract $200 bytes from the PC Address when converting it to SNES Address. (And vice versa)...
   If this is was the problem and you don't like having to add/subtract $200 bytes all the time, you can get rid of the header and then do it the same way you were doing it (presuming this was the problem, idk)...Just go to rom tab inside smile and select remove header and 'without' saving room under rom tab, just exit smile and then reopen smile. Rom header should be removed now...

Unheadered rom. I've tried changing the high/low in hex, and via smile. I've found that with the 2 working hidden missile expansions, if I change the high/low of one of them to the next value in line, aka 0053, save the room and test, the game crashes. Then when I change the value back to 0051 or 0052, the game crashes. I can no longer get a working item in the room, whether I delete the plm values in hex, or set the plm slider to 0, save room, then add the same plm. I end up tossing the rom. Door and scroll plms are not having any issues using any unused variables...

Mettyk25jigsaw

Are you possibly trying to put items in ceres or debug, as items don't work properly in these worlds. However it will if you use JAM's ceres/debug patch though and then you can fully use these 2 areas/worlds.
    In addition to what I have said, maybe it is a program version bug idk, if you like, try using or updating to a different version perhaps. Changing the low shouldn't really do anything bad other than maybe repeating a used low value, henceforth making the other shared item low disappear as though it didn't exist...
   As for the high, unless you have JAM's supermap patch I am not sure what would happen if you used a value other than, 00 or 01 (both usable) along with 80/81 for item returning. As for the Super map patch, you can use highs from 00 to 07 or from 80 to 87 (returning). As the s.map patch allows you to use 4 times more entries, than without it...
  So if changing the low is causing some problems and what I have suggested still don't work. Then I would be stumped I think as to what else it could be...But I would be willing to at least give it more thought and see if I can come up with anything.
  However, b4 posting this, I thought of one more thing. You have 2 Plm's in room right? Maybe the other item is offscreen and is not within the x and y radius...


Scyzer

This was probably caused by an issue with RF, which I unfortunately didn't know about until recently. If you tried to change the expansion value of certain PLMs, it would write the code to the wrong location. A sign of this is that when you reloaded the PLM, it still had the old expansion value.

RF 0.84 fixed this issue, but the errors will still remain in the ROM. I added a tool in the debug menu which will make RF scan through the ROM to find any errors it caused. Instructions on getting to the debug menu are in the update log, and can also be found in Grime's SM Mod Manual.
If there are errors, RF will pop up a message box with PC addresses for each. You just need to open your current ROM, and a backup, in a hex editor. Go to each location and copy 2 bytes over to the broken ROM. The first of these 2 bytes should ALWAYS be either AC or DF.
Once all the errors are cleared, it should work fine. Keep in mind though that this tool will ONLY detect errors that RF caused when changing the expansion value. If PLM code was corrupted by anything else, it won't find the problem.