Banner
Views: 236,507,107
Time: 2013-05-24 05:18:09 AM
5 users online: Marcus_1987, natnew, Pokeymeister80, shreerocks1324, SMW_Forever - Guests: 17 - Bots: 11Users: 22,875 (1,272 active)
Latest: ratchtet
Tip: Verify that your hack's IPS patch is functioning correctly before submitting it.
Needing help with an ASM hack. Seriously
Forum Index - SMW Hacking - General SMW Hacking Help - Needing help with an ASM hack. Seriously
Pages: « 1 »
Here's what's in my File Bin so far: ASM File

I'm going to be asking questions as I get to them.

First, I feel I'm going to need to make my own basic HP system to do this properly. So the first thing I'm going to try to hijack is the HurtMario routine. Since I don't want to check everything myself, but still need to harm the player, would this be a good place to Hi-Jack?
Originally posted by all.log
Code
CODE_00F5D5: A5 19 LDA RAM_MarioPowerUp ; \ If Mario is small, kill him CODE_00F5D7: F0 2D BEQ KillMario ; / CODE_00F5D9: C9 02 CMP.B #$02 ; \ Branch if not Caped Mario CODE_00F5DB: D0 16 BNE PowerDown ; / CODE_00F5DD: AD 07 14 LDA.W $1407 ; \ Branch if not soaring CODE_00F5E0: F0 11 BEQ PowerDown ; / CancelSoaring: A0 0F LDY.B #$0F ; \ Break Mario out of soaring CODE_00F5E4: 8C F9 1D STY.W $1DF9 ; | (Play sound effect) CODE_00F5E7: A9 01 LDA.B #$01 ; | (Set spin jump flag) CODE_00F5E9: 8D 0D 14 STA.W RAM_IsSpinJump ; | CODE_00F5EC: A9 30 LDA.B #$30 ; | (Set flashing timer) CODE_00F5EE: 8D 97 14 STA.W $1497 ; / CODE_00F5F1: 80 2F BRA CODE_00F622

I don't think I'll need all of that, will I? I'm not using the cape, so... Also, I'll remember to use a few of those codes up there so that rushing through sprites isn't an insta-kill...

To set the starting HP to say, 3, how would I set that on a new file?
Last edited on 2012-01-17 01:17:07 PM by sunwarrior25.
Oh hey, it's been 24 hours. Here's some questions that hopefully don't go unanswered. If this thread needs to be moved, could someone please? If I delete the file from the file bin, then upload a different version with the same name, I won't have to change the link, will I?

Also, if I wanted to change the player's tilemap based on a freeRAM value, would I have to make a seperate table for each value? Or a table of values for each tilemap?

How, out of curiousity, would I load an alternate GFX file (with the same tile setup as my custom GFX32), based on that same freeRAM value?

On the topic of graphics, how would one upload a tile from GFX32 to, say, the Fire Flower?

Where would be a good place to set the player's start/max HP?

If I'm going to use a sprite for, say, bunny ears or a shield, should I code that separately, or hard-code it to the patch?

Any answer to any of these questions would really be a big help.
The best place to hijack the Hurt/Kill routine is the addresses:

Code
org $F5D5 JML Hit org $F60A JML Death


To create a health system, you must use a freeRAM, obviously when hijacking the Hit/Death routine, you may want to check if RAM is #$01 for Small and one-hit kill.

About the questions:

If you want to change the player tilemap by freeRAM basis, search for this patch [Xkas] Separate Luigi Graphics v2.2.

With that, you can change the player tilemap anytime you want by changing the freeRAM

I think that GFX32 will only upload the player tilemap and the berries tilemap, you may want use ExAnimation.

Maybe you want to hijack the start game code to set the initial HP and use another freeRAM to set the max HP and save them into SRAM.

If you want to code the bunny ears or the shield, it's better and easy create the code separately from the patch and incsrc it, it's easier because you can customise the patch even more.
Last edited on 2012-01-17 05:14:32 PM by DiscoMan.
I need to organize my thoughts better before I respond.

• OK. I think I'll just check to see if the RAM I'm using for HP is, 00? Maybe 01? Before killing Mario. I don't really want to power down Mario with the style of powerups I'm using... I guess they're (going to be) more like Link's inventory items.

• Ok, I'll give that one a good look over, see how to do it and all that. If I use MarioExGFX.asm, will that allow me to still be using GFX32? Don't want GFX32 to just suddenly become useless and wasting space.

• I'm not quite experienced enough with ExAnimation, I mean, I figured it out for the tiles, but palette ExAnimation... Something about a Hex Editor, and a file, and putting things in backwards. I could, theoretically, use a dynamic sprite for the Item Box, and another for the player accessory that'll go with some of these... Items?

• Alright, it'll probably be easier to code for those without having to scroll through the patch every time, although... Do I incsrc the patch to them? Or the other way around?

• I tried opening a .srm file with notepad++, and even notepad... The moonspeak didn't tell me anything.

Off Topic:
I gotta stop posting soon, my posts are getting more to the large and wandering side of posting. I gotta be more awake! Darn those loud movies/conversations downstairs at 11:55 pm!

EDIT: Wait a minute. Is this site blacking out for the SOPA/PIPA thing? I might not be able to hear any answers if that's the case.
Last edited on 2012-01-17 07:13:05 PM by sunwarrior25.
• You can NOP this code:

Code
CODE_00F600: 64 19 STZ RAM_MarioPowerUp ; Mario status = Small


And Mario won't shrink when hit by a enemy.

•As stated by the readme, you'll load a ExGFX file, which means that original GFX32 will be overridden but it's per level basis, so GFX32 won't be lost.

•I think that dynamic sprites can't work correctly when in a item box, you can use a pause menu and create a table system, which means every item you've collected.

•If you want the items to be inserted together with the patch, you can incsrc it, if not, you can insert as a separate patch.

•Maybe you want to check the patch SRAM Expand and look the save/load game routines.
Alright, thanks. Now I've got a lot to look at before my next round of questions.
Originally posted by DiscoMan
•As stated by the readme, you'll load a ExGFX file, which means that original GFX32 will be overridden but it's per level basis, so GFX32 won't be lost.

Ok, but I can leave it there for some of the forms, right?

Quote
•I think that dynamic sprites can't work correctly when in a item box, you can use a pause menu and create a table system, which means every item you've collected.

Darn. I don't think I know enough yet to do a custom pause menu, but I had another thought. What if I used L & R to rotate the powerup in the box (it would display with palette 9), and then use SELECT to set it, having it display its correct colors and change the player's graphics and behavior, unless certain conditions aren't met (i.e. no ammo in slingshot)- In which case, the item would remain greyed out and play the "NO" sound.

Quote
•If you want the items to be inserted together with the patch, you can incsrc it, if not, you can insert as a separate patch.

I guess I might have to do it like that for the ones that use a sprite for gfx and added behavior. Also, should I use the original powerup value, but redirect the behavior tables/routines, or leave that value the same and use a freeRAM.

Quote
•Maybe you want to check the patch SRAM Expand and look the save/load game routines.

I found this in the ROM Map:
Originally posted by the ROM map
01FB5 | $00:9DB5 | 69 bytes | Subroutine (JSx)
The subroutine that checks if a saved game file is blank or not. When this subroutine returns, if Z = 0, the file is a new one.

Maybe I could use that to set the initial sRAM current/Max values? I'd have to reset the current values during death... Yeah, I think I'm getting the hang of thinking about this.

yczedit: why do people insist on using code tags for ROM map stuff
Last edited on 2012-01-23 02:27:50 PM by yoshicookiezeus.
• Well, you can leave the GFX file for other forms but I recommend you use the patch Separate Luigi Graphics v2.2

•In fact, you can work on RAM tables and load all the values using the VWF patch, using a pause patch to work together with VWF. It's a bit complicated because you'll use Layer 3 but I think that's not a problem.

•If you want to use the Powerup value, maybe you want to hijack this code:

Code
CODE_00D081: C9 03 CMP.B #$03 ;\ if mario not firey, return CODE_00D083: D0 28 BNE Return00D0AD ;/


Then you can work on a powerup table.

•Well, I think that you can use the SRAM patch to save the values or you can use this RAM:

$7E:1F2B3 bytesEmptyEmpty. Cleared at reset and titlescreen load. Unlike most empty addresses, this one is saved to and loaded from SRAM.
• I'll have to leave it where it is for now. I should get the skeletal and muscular structure of this patch running first. It's amazing. This shouldn't be that hard, and yet... I took a look, and found Mario's gfx DMA routine. If I could do something similar with the same file, or even a different one, I could no doubt put a powerup graphic in the status bar.

• I'll have to see how the original game pauses, so I can make two separate menus: Start and Select. I could then use the VWF patch for the frame/BG, and display the items with sprites (by hiding the level's sprites). Actually, if I hide the level's sprites, I could do what I mentioned above to get the rest of the sprite tiles... That'll be for later. I got to get the basics running first.

• I am not entirely sure how to use the table once it's set up. I'll have to get to that soon though. I've got a lot of hijacking to do. Found a tutorial... #w{:s}

• I think I'd better use the SRAM patch, as I get a lot more room to save things.

Also, here's my patch as it currently sits.
Last edited on 2012-01-20 05:00:10 PM by sunwarrior25.
I have rethought the patch a little. I'm wanting to use two players, so I'll leave the game's existing power-up related shenanigans alone. You can call me a coward if you want. I'll instead be using a whole lot of free/sRAM values to keep track of the following:

• Accessories: An item that grants a passive effect, or has an active effect that really shouldn't use the action button. (Why would you press the jump button, then the action button, for a double jump?).
•• Default: An empty slot with regular game play.
•• Bunny Ears: The reason I asked about changing the player's Max. Speeds/jump-heights during level run-time. This one will change the player's tileset (using the Sep. Luigi patch), and the player's max. speeds.
•• Snorkel: This one will also change the player's tileset. Adding a check to the air-meter for this should be easy.
•• Feather: This one uses the default tileset for the current player. Ye olde double-jump.

• Tools: Items that have to be activated with the action button, or have a passive effect that prevent other Tools from being used.
•• NOITEM: An empty slot with regular game play.
•• Slingshot: I have no clue, really. I know what I want to do, but not how... It will change the player's tileset, and fire a projectile in a certain direction when the action button is pressed. Perhaps I should code a custom sprite, and set its speeds based on which direction the player is facing, and whether or not they're pressing up?
•• Shield: I think I'll spawn a custom sprite when the player changes powerups, and when they enter a level at the start/through a door. The sprite itself would have to be coded to destroy projectile sprites on contact, and block other sprites and turn them around. Not sure how I'll force the player to constantly carry said sprite though.
•• Mirror: I was going to have this one get more and more fractured (graphically) as the player used it, but I think I should have it fracture all at once. It will teleport the player out of the current level, and become useless.
•• Sword: Perhaps I should have P1 have the sword, and P2 have the slingshot? This one will also change the player's tilemap. It's a sword, you swing it and stuff happens. Not sure how I'm going to do this one.

Am I trying to do too much? Should I really have thought to start this after coding a single sprite? Ugh... It's too late to turn back now. If I do, I won't come back to this.
Pages: « 1 »
Forum Index - SMW Hacking - General SMW Hacking Help - Needing help with an ASM hack. Seriously

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2013 - SMW Central
Legal Information - Link To Us


Total queries: 27

Menu