News:

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

Main Menu

How does SMILE read PLM data??

Started by PHOSPHOTiDYL, September 04, 2016, 12:05:49 AM

Previous topic - Next topic

PHOSPHOTiDYL

Like say I just converted all the cre gfx plm's to ones that use gfx at $48000.
Energy tanks, missiles, supers, and p-bombs.
Fully tested, every pointer on point, works just as it should in game.
In smile however, it shows up as a standard plm, & I can't edit the value.
I tried with the existing plm's (ex. $EF7F), & another in free space.
Same results for all of them.
The asm that identifies which item is collected was repointed from [020968-020985], & the new plm data is in a new location, as both take up more space.
I noticed that rearranging plm's doesn't work either.
Say i swapped the underlined pointers of $EEEF (64 EE 89 E1) ice beam & $EEF3 (64 EE B7 E1) hi-jump boots.
All it does is change the bitflag value & type in smile's editor.
Pointing to the new data location does not allow it's values to be edited.
I can still change values via asm, so no problem here.
Just looking for some info, so such a patch would be less problematic for others...

Black Falcon

SMILE does not actually check if it's an item PLM. The ones you can edit are pretty much just hardcoded, same goes for the doorcap PLMs.
I know it's kinda dumb, but if you add custom items or repoint any of them, SMILE will still just read any value from a hardcoded location, regardless if it is actually a value or a pointer. If you want to edit them, you have to do it the old fashioned way using a hex editor.

squishy_ichigo

To add to what BF said, SMILE reads the PLM header, getting its two pointers, but beyond that it doesnt actually read the plm.
What you see in SMILE is actaully just it reading the PLM folder and seeing if there are any entries, so adding in a new entry is as simple as going into SMILE's PLM folder, and adding a image and txt file named after the header location.
Again though, as BF said, you won't have any ability to edit the actual code of the plm this way, but it will 'display properly' when you try and use said PLM.

Scyzer

SMILE 2.5 / Parlor:
Doors' 'Hits To Open' are hardcoded locations relative to the PLM header (21 bytes into the instructions). If you change a door's instructions, then Parlor cannot change 'Hits To Open'.
Items are found by searching for 8B DD 88 99 after the PLM's instructions, up to 50 bytes in. If it's found, it gets the next 7 bytes and uses those to fill in the options. Those bytes must be in the right order; if the byte order has changed, then they won't work.
I assume JX is the same unless JAM changed how they're read.

RF:
RF gets the PLM's instruction pointer, then searches up to 255 bytes in for specific instructions used by PLMs (one instruction that is only use by missiles, another by supers, one for upgrades, one for beams, etc). When it finds a match it'll get the values and show them in the editor. As long as you use the same instructions that increase pickups or set relevent bits, RF should detect custom PLMs.