The Great Metroid Construction Collaboration Hunt - Post your resources here!

Started by Zhs2, July 20, 2009, 07:55:03 PM

Previous topic - Next topic

Scyzer

Quote from: PHOSPHOTiDYL on May 06, 2017, 12:49:31 PM
So as nice as the save refills patch is, it breaks all compatibility with smile rf's plm save editor.

Silly @PHOSPHOTiDYL. As surprising as it may be, I can actually easily make adjustments for this sort of thing. If you link me to said patch which breaks RF save stations, I'll add in some code to make it work properly for the next update.

This goes for all you hackers. If there's a popular patch out there which isn't compatible with RF, please let me know!

PHOSPHOTiDYL

@Scyzer

Can you look into implementing whatever code you used for the message box editor,
into the tileset list??

There's native support for more or less than $1C messages with proper repointing,
however any tileset pointer modification will still only show $1C tilesets on the list.

I think old smile was reading from a set address, & your new code is doing something better.

This isn't the whole routine...
org $82DEF2
PEA $8F00
PLB : PLB
LDX $07BB ;//current roomstate pointer
LDA $0003,x ;//3 byte pointers
AND #$00FF ;//FC tilesets, FF music read
ASL A
TAY
LDX $E7A7,y ;//[points to pointers to tileset data]


PEA is bank#.
AND is $09 x $1C + $03 (tiletable+gfx+palette pointers x #tilesets + start of music pointers).
LDX is pointer table in bank.

Just the list feature is what I'm requesting though.
More or less tilesets to show up.

As for the save refills, it's on the old site...


PHOSPHOTiDYL

Item percentage patch.  :nod:

Credits to scyzer for most of this.
I didn't want to waste more time converting the energycache math to itempercent math.

So I used scyzer's math & hijacked the jump to the reserve display routine.

$C7 bytes bank $82.

Screenshot is 30/99 items collected.
You'll need the exact number of items.

Also it's just the math. Tile pointers at the bottom the asm.
It's 1 2 3 for the tiles to the right of the giant map box @ 1B0000.

[ M A P ] 1 2
[ M A P ] x 3



UPDATE:
Please add this code if not using scyzer's end game percentage patch.
Thank you quote58 for this one.

LOROM

!CollectedItems = $7ED86E

org $84889F
JSL COLLECTTANK
org $84F000
COLLECTTANK:
PHA
LDA !CollectedItems
INC A
STA !CollectedItems
PLA
JSL $80818E
RTL


EDIT:
Due to request, small ips patch with gfx for those three blank tiles.
Also, forgot !CollectedItems in the code.

Items is now white, like vanilla.
The percent sign is grey, it's changeable in the asm.
There is also an unused [/] tile for your other needs.

Will not be releasing new equipment, cause it's not vanilla.
Finally something hack exclusive.

UPDATE:
Adding asm for 100+ items.
It does not work on vanilla, & I don't even know if it'll work for you.
It's working for me, tested with 170 items. It's not 100% accurate.
Rounding down, sometimes losing a whole oneth decimal.
I assume collecting all the items will still show 100%.

I think it's better than tiles that aren't numbers showing up in place.
$BE bytes this time.

UPDATE:
Proper display of percentage @ 100% has been tested for 100+ items.
No idea why it isn't compatible with vanilla. Looking for the answer.
Is more accurate than I thought at first. Still not perfect, no chance in hell of fixing it.

UPDATE:
100+ is an even more inaccurate decimal with less than 100 items.
However, it is still better than showing map tiles in place of digits.

UPDATE:
Fixed it. $BD bytes.
It might not change the decimal from zero until at least 1% has been achieved.
It's very annoying for lets say 255 items. It works though.

Scyzer

@PHOSPHOTiDYL
New RF update is out. It has an updated function for reading tilesets from a ROM (rather than just a preset number of tilesets). It's a different table format to message boxes, so it needed to be handled differently anyway. RF will now check the ROM for the table of tileset pointers, and keeps adding tilesets until it hits an invalid pointer (<$8000 OR $FFFF), or if one of them points to invalid tileset data (it also checks each pointer for valid tileset pointers). It should work perfecty for the most part, and any tilesets it doesn't show would have been garbled in the game anyway.

Also don't worry about explaining code :P I can read ASM straight from a hex editor so I'm all good on that part.

PHOSPHOTiDYL

I though things clicked with that energycache.

Then I pulled this out of nowhere.

Equip screen game timer. Everything has been moved for you.
Changes pointers, tile placement, & adds a timer.
'Time' tiles are already @ 1B0000.



$8D bytes bank $82.

There's a fix for the lines from samus' wireframe posted somewhere else.

UPDATE:
I lied, now I don't know what I'm doing.

GameTimer: ;//[Free Space ($0050 bytes)]
LDA #$2C0C : STA $7E39F0 : STA $7E39F6 ;//tile to use for spacing
LDA $09E0 : LDX #$0000 : JSR TimerMath
LDA $09DE : LDX #$0006 : JSR TimerMath
LDA $09DC : LDX #$000C : JSR TimerMath : RTS

TimerMath:
STA $4204 : SEP #$20 : LDA #$0A : STA $4206
PHA : PLA : PHA : PLA
TimerDraw:
REP #$20 : LDA $4214 : CLC : ADC #$2C00 : STA $7E39EC,x ;//my digits start @ 00
INX : INX : LDA $4216 : CLC : ADC #$2C00 : STA $7E39EC,x : RTS ;//ADC #$0804 for vanilla

Quote58

Just fyi, your item percentage code doesn't work on a vanilla rom because you left out the hijack in scyzer's item totals code which increments 7ED86E for every upgrade acquired, which is the address used by the division routine of hers which you're using to calculate the digits to draw.
Also the timer is cool but iirc there's already code in the game to display a timer on the equip screen. It's also why the TIME gfx are in the rom but never used.

PHOSPHOTiDYL

Oh... I haven't touched a vanilla rom in months.
Thanks for pointing that out, I don't want to be posting broken code.

Is my timer okay?? I haven't slept in 30 hours & wrote it in 10 minutes.

Next is reservecache. 3 or 4 digits can't decide.

Quote58

I was asked to add a percentage counter onto the Game Timer so here's a version that includes both.
I cleaned up the math that scyzer used a bit so it's easier to read. I also used the hijack that she used for the ending totals patch to store a percentage total address.
That being said, keep in mind that by the nature of how she coded that, you will only see the correct percentage by playing the game and picking up the items. Quickmet will not reflect the correct percentage (that goes for that status screen patch as well, since he used the same stuff). I'll probably put up a version later that calculates the total the way the game normally does by cycling through the bits in the collected items/upgrades array, but I didn't feel like doing it right now.
Once again the patch has the gfx changed for the cut off top pixels, and the code just uses the normal tiles.
here's a picture:


edit: I used the wrong tile indexes when I changed the asm back from the custom tiles, the correct version is up now, my b
edit 2: Just noticed that the decimal place being drawn is actually the ones place, not the tens (ie. XX.01 was drawn as XX.1), just accidentally swapped the two values in one of the macros, it's fixed now.

Quote58

Quote from: PHOSPHOTiDYL on May 08, 2017, 09:28:18 PM
Oh... I haven't touched a vanilla rom in months.
Thanks for pointing that out, I don't want to be posting broken code.

Is my timer okay?? I haven't slept in 30 hours & wrote it in 10 minutes.

Next is reservecache. 3 or 4 digits can't decide.

For future reference you should always test your patch on a vanilla rom before you upload it so as to both not forget other code, and not leave in code that is no longer used but not removed (ie. if you rewrite code and now it's shorter, or uses a new hijack or something, then unless you remove the old code it could cause an issue for someone who has code in that location, if it's applied as a patch).

Timer looks fine from a glance, but the code is pretty messy, you should look into organising your code a little better. For example, to make it easier to see what scyzer's percent math does, I wrote it using macros for division that make it easier to follow (and easier to write for that matter).



PHOSPHOTiDYL

SM 3 digit reserve tank cache.

Tested on a vanilla rom as well.  :oh:



$74 bytes bank $82.

There's some notes in it to ensure easy customization on your end.
This is not tested past 8 reserves.

No credits necessary.

PHOSPHOTiDYL

Fake screw attack.

Probably useless for most, all checks for screw attack set for space jump.

Cpt.Glitch

Fusion Shinespark Control


Due to how less robust fusion's speedbooster is, you can restart your speedboost by moving onto the floor without extra code., rather than just bonking the floor like in the Zero Mission version.
[spoiler=Controls:]Up: Upward Spark
Left: Left Spark
Right: Right Spark
Right & Up/Down: Diagonal Rightward Spark Up or down
Left & Up/Down: Diagonal Leftward Spark Up or down [/spoiler]

https://youtu.be/_pVd4ifkS9E

PHOSPHOTiDYL

Here's something to get you into hacking, aka plz mod this. :^_^:

Pressing item cancel will clear 3 rows of 16 tiles between the reserve icon & the minimap.
Letting go of item cancel will use some pretty poor code to "restore" the vanilla hud.

Includes a small feature from vanilla.
If you've ever held item cancel & pressed item switch, you get the flashing one shot.
Well it's pretty cool, so now the selected item will flash.

Instructions where to place secondary hud code in the asm.
This will not be compatible with your hijack points.

If anyone can set a delay timer on the button check, plz post.
It doesn't look so well without one.

$143 bytes bank $80.

Aim lock gives me brain lock. Way to go, nintendo.


Shockwave_S08

Quote from: PHOSPHOTiDYL on May 08, 2017, 02:00:52 AM
Item percentage patch.

UPDATE:
Please add this code if not using scyzer's end game percentage patch.
Thank you quote58 for this one.

LOROM

!CollectedItems = $7ED86E

org $84889F
JSL COLLECTTANK
org $84F000
COLLECTTANK:
PHA
LDA !CollectedItems
INC A
STA !CollectedItems
PLA
JSL $80818E
RTL


For those newbies out there (like me), this code is meant to be put into a blank .txt file and saved as a .asm file for use with the normal Item Percentage .asm and .ips patches when applied to a vanilla ROM. Keep in mind that the counter always starts at 000.0%, no matter which point of the game you were in at the moment of patching, so it works best if you start a new game from the beginning.

PHOSPHOTiDYL

Quote from: Shockwave_S08 on May 13, 2017, 03:09:16 PM
Keep in mind that the counter always starts at 000.0%, no matter which point of the game you were in at the moment of patching, so it works best if you start a new game from the beginning.

Very useful information.  :oh:

PHOSPHOTiDYL

Skip intro saves work v.2.

Now you can skip the intro, have the correct area highlighted on the hex map,
all three save files will work properly, & the map won't be broken for new save files.

Tested on a vanilla rom, & whatever hack I'm working on.

Just make sure your out of area doors have bitflag 40 as they should.
Or you will load the game with a broken map.
It's not me this time. :grin:

No free space, as it overwrites the existing routine.

UPDATE:
This breaks all compatibility with hackmode, which is what it was originally made for.
You can not skip the intro & ceres, & use a difficulties patch together.
Will post the solution when I figure it out.

UPDATE:
Skipintrosaveswork v.3 hackmode.
You will notice how you can still change difficulties before your save file has any time saved.
There's six bytes unused in the routine. It doesn't look good, but the thing works.
V.3 hackmode is compatible with vanilla. V.2 is not compatible with hackmode.

UPDATE:
If using v.3 & not using hackmode, nop out the seven bytes for the lock difficulties part.
Then the six bytes that are free, you can use in the force start point.
Even if there is no save station plm, you can use a blank save station and trick the game into starting wherever.
LDA #$xxxx : STA regionnumber : LDA #$xxxx : STA saveinarea.
Room ID in the save editor is your start room, tweak the coordinates to your liking.


Mettyk25jigsaw

PHOSPHOTiDYL, the hex map is still not showing up as the correct color for me, however I have fixed it myself I believe, the only error in your patch was the STZ $079F should be STZ $079B instead, after testing it a reasonable amount, everything seems to work fine for me including the 3 saves at the same time skipping the intro, the hexagon map lights up as the correct area...Cheers...




PHOSPHOTiDYL

Filling a request. Very vanilla, much wow.

If you haven't changed the equipment tiles @ 1B0000,
or changed the equip screen palette from 1B7040 - 1B707F,
then this is for you.

Items on the equip screen will have a black box & white text if equipped.
They will have a black box & grey text if not equipped.
An orange orb if equipped & not highlighted, & a grey orb if unequipped & not highlighted.

It's just a repalette of the equipment tiles @ 1B0000, using the vanilla equip screen palette.

1B7048 02 for equipped.
1B7068 02 for unequipped.

PHOSPHOTiDYL

ATTENTION!!

Game timer equip screen hotfix.

I haven't seen those lines from the suit to the boxes in ages.
Patch to have them line up correctly.

In asm form. :mad:
Compare to the original patch to learn what tiles were 'swapped'.

PHOSPHOTiDYL

So........

If you've been fortunate enough to have stumbled upon black_falcon's itemfinder patch...
You'll know it doesn't work 100%.

It just needed a better hijack point. :whoa:
Also tweaked it a bit for two different tiles.

For every item in a room, there will be an orange tile.
If no items present, a grey one.

Details in the asm for tile placement.
There's a whole top row, idk what patches your using, just a default position.

Credit goes to black_falcon.



Or have it use one tile... (Obviously not the green one.)


$8C bytes bank $80.

Looking to detect screen scroll samus is in for hacks that use multiple rooms in one header.

UPDATE:
I encountered a small bug with the electrical outlet plms.
It says there's an item when no items are present.
Idk what the solution is yet...

Search the asm for CMP #$DF7D & change to CMP #$EED7. :lol:

UPDATE:
Wicked annoying bug with scyzer's map plm.
Add a CMP #$0000 after the LDA ($12) in LoopFinder, or make sure your map plm is the last plm in the room.
It's weird & ends routine for a byte when it needs to be a word.

Also ItemFinder, SEP #$20 : LDA #$XX : PHA : PLB : REP #$20.
XX is your custom plm bank. Seems like it needs to be lower than $C0.

PHOSPHOTiDYL

Start with map.

Idk I couldn't find a hex tweak so $18 bytes bank $82.
More code to interest you in making a hack.

moody blues

DirectScrollPLM

This patch will make you happy just a little bit. This is really handy to me!

After apply this patch to your ROM, you can use a scroll PLM in the same way as before.
In ordinary circumstances, the "High" and "Low" bytes are actually a pointer to data in bank $8F.
If the number of "High" is less than $30 in smile, you can specify the number directly.


Scroll PLM "High": which screen do you want to change. (00--2C)
Scroll PLM "Low": what number do you want to change to. (00,01,02)



Ex.(001.jpg): The second screen turns into green when samus touches the PLM.

Default: $848B63--$848B65 change 3bytes , $84EFE0--$84F003 use 35bytes

Please tell me if there are any problems with this patch.
(No credits necessary.)