News:

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

Main Menu

[MZM] adding clipdata to provide abilities

Started by biospark, July 13, 2014, 03:00:44 AM

Previous topic - Next topic

biospark

Recently I have been learning ASM and fooling around with the 2D Metroid games. I'm trying to add clipdata that provides an ability. In other words, I want it to behave exactly as the missile tank clipdata would, except it gives you a new ability instead of missiles. However, I'm not sure of the best way to add custom clipdata, or how to correctly point it to the "get ability" routine. How would I go about this?

Metaquarius

I think what you are trying to accomplish is beyond the scope of nearly everyone here. Not so long ago, I was also asking how clipdata works and the answer was :
Quote from: P.JBoy on April 02, 2014, 04:18:41 PM
If there's something you need to know, I can probably help out, but really you're better off figuring out how to figure stuff out yourself. That said, always feel free to pop into IRC and catch my attention
If PJBoy ever decides to give you a hand, please, let us know about your findings ! :^_^:

biospark

#2
Well, I managed to make a missile expansion give me the long beam upgrade. However, I need to write some custom asm in the blank part of the rom. How do I branch the code to go there? When I try it on no$gba, it says parameter fail, so I'm guessing it's too far away.

I think looking at that old clipdata patch for this game might help. Should just be a matter of branching to the code I write based off of the clipdata. Easier said than done I guess.

edit: Seems like the best way is to load the address to one of the registers, then move that value to r15. Now to try writing asm.

Hawntah

:whoa: A MZM hacker!

Quote from: biospark on July 13, 2014, 04:07:47 PM
Well, I managed to make a missile expansion give me the long beam upgrade.
Sorry for my noobness, but would you mind explaining how you did that? How did you find the right place in the code to edit? Did you just change the values stored at 300153C and 300153D to give yourself long beam or did you somehow jump to the actual "collected long beam" routine?

P.JBoy

If it's of any assistance, there's this: 'A patch made by Trunaur68 and extended by uNsane, it adds 8! new types of new clipdata: 98 is a low gravity, 99 is a high gravity, 9A treadmill right, 9B treadmill left, 9C is quicksand, 9D is direction invert, 9E is shinespark accelerator, 9F is shinespark decelerator'
...

biospark

Yes, that's exactly the patch I was referring to in my above post. However, I think this approach might be a bit too difficult.

Basically I'm trying to make an item randomizer. My main reason for wanting clipdata was so I could have things like "hidden long beam" etc. However, I can still use the sprites, I just have to shrink their hitboxes and put them behind shootable blocks.

So my next question is, how are sprites stored graphically? Also, how can I separate the parts of a sprite (ie change the whole chozo statue to just the ability)?

P.JBoy

Sprites are stored as LZ77 compressed graphics, in the enemy RAM, there's a pointer to the compressed graphics currently being displayed. All these ability items give the item using their own specific code, there's no common 'give item x routine'. I would probably say it's easier to make new clipdata to give items than to modify item graphics and shrink their hitboxes (also handled in AI routines). Just ORing the necessary values to that 300153C area of RAM is enough with new clipdata
...

biospark

Where does it store the parts of a sprite though? I feel like it should be possible to remove the other parts. There's a section for it on Double Helix, but it's grayed out.

P.JBoy

I'm not sure what you mean; which section of Double Helix?
...

biospark

No, in the ROM. I figured it's possible to hex some of the parts out.