Banner
Views: 240,609,291
Time: 2013-06-19 06:51:48 PM
28 users online: o algorithmshark, Archie, Azurik, Dipalon, EddyCartoon, Egadd, FireLeafGreen200, Henix Aurorus, o HuFlungDu, Jayfeather, Koopster, leod, Luca, Lui37, ManuMaster654, mario and luigi, NEX and GBX, o PatPatPat, RaindropDry, o ShadowPhoenix, o sleepy, Smasherx74, Sokobansolver, Spinjumper, tatanga, THY, o TRS, o Zildjian - Guests: 22 - Bots: 23Users: 23,083 (1,325 active)
Latest: Mastergamerlive
Tip: Read all of the tips by looking here.
Removing "unneccesary" code from a patch (pastebin link included)
Forum Index - SMW Hacking - General SMW Hacking Help - ASM & Related Topics - Removing "unneccesary" code from a patch (pastebin link included)
Pages: « 1 »
Link to Pastebin

What I want to do

I want to remove the whole "per level" concept and simply add an extra palette for Luigi and Mario for their "feather" Status. If I remove the other "unnecessary" code it be much better.

Thanks in advance.

(ErsanEdit: fixed URL)
Last edited on 2012-03-20 05:36:26 AM by Ersanio.
Istead of using per level setting, you could use a free RAM setting but instead of using this patch I recommend the use of this patch.
Would someone mind explaining me imamelia's patch?

1)24bit Pointer = what exactly? How, for example, can I change Mario's pants from blue to let's say black? (Yes i know, two palette files are needed

2) $7E:0D9C 1 byte Empty Empty. Cleared on reset and titlescreen load.

Using above as a flag, which resets itself while reseting, could this work as a flag? If yes, could I easily EOR $FF it ?

And finally, what's about Luigi?
You use the RAM "!RAM_PlayerPalPtr = $7FA034" to point the 24-bit address to where the palette is located in your ROM. (You must do this way: LDA #$00 STA $7FA034 : LDA #$80 STA $7FA034+$01 : LDA #$06 STA $7FA034+$02 or load address $068000)

Second, you can use this flag but if you want to load Luigi, just hijack some point in your ROM and then check the flag and point the RAM to load the address you want.
Originally posted by DiscoMan
You use the RAM "!RAM_PlayerPalPtr = $7FA034" to point the 24-bit address to where the palette is located in your ROM. (You must do this way: LDA #$00 STA $7FA034 : LDA #$80 STA $7FA034+$01 : LDA #$06 STA $7FA034+$02 or load address $068000)


I still don't understand how to do that... I'm sorry. As an example, let's say I want to turn the pants in a blackish color

Quote

Second, you can use this flag but if you want to load Luigi, just hijack some point in your ROM and then check the flag and point the RAM to load the address you want.


Couldn't I already include that in this patch? I could make a simple BNE Luigi or something like that. However I can't test that because I still don't understand how to do it sigh...
Well to use the patch, you must set the 24-bit address to RAM, it's hard to explain but I created this code, I hope it helps you:

Code
LDA #$01
STA !RAM_PalUpdateFlag

LDA #$15
STA !RAM_PlayerPalPtr

LDA #$80
STA !RAM_PlayerPalPtr+01

LDA #$30
STA !RAM_PlayerPalPtr+02


If you look properly, you'll see that I'm loading the palette located in $30:8015, you should create a "patch" containing the palette you want, like:

Code
HEADER
LOROM

org $308015
Palette:
dw $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000


It'll make Mario completely BLACK but it's just a example, also to use different colors, just compare and branch to a different code, loading the palette at a different location like comparing if the player is Luigi and then loading a different code that points to a another 24-bit palette.
Originally posted by DiscoMan
Well to use the patch, you must set the 24-bit address to RAM, it's hard to explain but I created this code, I hope it helps you:

Code
LDA #$01
STA !RAM_PalUpdateFlag

LDA #$15
STA !RAM_PlayerPalPtr

LDA #$80
STA !RAM_PlayerPalPtr+01

LDA #$30
STA !RAM_PlayerPalPtr+02


If you look properly, you'll see that I'm loading the palette located in $30:8015, you should create a "patch" containing the palette you want, like:

...What? You LDA and STA them into some defines with added+0z (z=different number) Despite wondering what exactly the +1 etc. means, why are you saying that you loading the palette located in $30:8015 ... ROM or RAM?

In case upper code from you have to be included by meh, I'm wondering what's with the code written in the patch already.

Code
HEADER
LOROM

org $308015
Palette:
dw $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000


It'll make Mario completely BLACK but it's just a example, also to use different colors, just compare and branch to a different code, loading the palette at a different location like comparing if the player is Luigi and then loading a different code that points to a another 24-bit palette.</div></div>

Uhm, does every $000 represent each color after the "brown" color? (from the shoes of Mario, you know :P)

I still can't understand why does the creator of the patch uses weird labels combined with a lack of good readme. If the creator has done mentioned thing, I wouldn't have to ask.
Yeah, it's a bit complicated but you must know that: $00-6F is ROM, $70 is SRAM and $7E-$7F is RAM, so $30:8015 is RAM.

You use LDA and STA to load where is the palette in ROM (or RAM if you want), you need to point the location (low, mid and high byte) in "RAM_PalUpdateFlag", also the "+$01" means that you're loading something at some place (Eg. $0660) but instead of loading THAT RAM, you're loading the next value (Eg. $0661) and so on...

The "dw" code I've included, is a simple example to tell that if I save any palette at this location and use the code I've pasted here (you must use LevelASM or create a patch to use the example code), you'll load that code.

The "0000" actually is the black color instead of brown, you must check the SNES RBG value to use this "patch".
Sheesh, I can't seem to get it working, for gods sake
(In fact I'm not even sure if I'm doing this right).


Originally posted by Discoman

The "0000" actually is the black color instead of brown, you must check the SNES RBG value to use this "patch".


What I asked was (Following is an example)
dw $0001,$0002,$0003,$0004,$0005,$0006,$0007,$0008,$0009,$000A

which is what color on the palette from Mario. Could you help me out?

I also have a patch which runs every frame, I think I could incoporate the
Code
LDA #$01 
STA !RAM_PalUpdateFlag 
LDA #$15 
STA !RAM_PlayerPalPtr 
LDA #$80 
STA !RAM_PlayerPalPtr+01 
LDA #$30 
STA !RAM_PlayerPalPtr+02


And for I still don't understand why does I have to load different values and store them in the location where my "palette for cape mario" is.

And please, in case you answer this Discoman, answer this seperatly:


Do I need three different patches, including the playerpaletteupdate.asm? One for "creating" the patch itself, the playerpaletteupdate.asm itself and finally the

"LDA STA bullshit which still doesn't make sense because it has random defines which doesn't make sense alone" patch, right?
Because latter causes problems.
Originally posted by Shog
What I asked was (Following is an example)
dw $0001,$0002,$0003,$0004,$0005,$0006,$0007,$0008,$0009,$000A

which is what color on the palette from Mario. Could you help me out?


Well, you could check the palette window in LM and check Palette 8 - Colors - 6 to F.

Originally posted by Shog
Do I need three different patches, including the playerpaletteupdate.asm? One for "creating" the patch itself, the playerpaletteupdate.asm itself and finally the

"LDA STA bullshit which still doesn't make sense because it has random defines which doesn't make sense alone" patch, right?
Because latter causes problems.


First, obviously you need to patch the "playerpaletteupdate.asm" to use the patch, also the LDA STA "bullshit" you can do a patch for it or you can use LevelASM, it's much easier use LevelASM than create a patch for it.

The label is a bit difficult to "mess around" but once you get it working, the results can be incredible useful, because instead of wasting a lot of space with tables, you can just point a single palette and you choose if you want it to run or not.
Although I still can't getting it working (Asar reports an error, saying something along the line of an "if" command. I don't understand how to use it, is there any document for it)

1.I patch the playerupdatepallete patch by imamelia first
2.I patch the playerpallete table (dw $0001) for Mario and Luigi (note that I have no idea in which way Luigi could be incoporated here)
3.The LDA STA Patch , which I still don't understand what it's supposed to do.

Is this the right order?
Originally posted by Shog
Although I still can't getting it working (Asar reports an error, saying something along the line of an "if" command. I don't understand how to use it, is there any document for it)

1.I patch the playerupdatepallete patch by imamelia first
2.I patch the playerpallete table (dw $0001) for Mario and Luigi (note that I have no idea in which way Luigi could be incoporated here)
3.The LDA STA Patch , which I still don't understand what it's supposed to do.

Is this the right order?


For the first thing, you're doing right, for the second thing, you can put more than one table (which can be Luigi or something you want) but for the third thing I think you don't get yet.

"STA !RAM_PalUpdateFlag" - This flag will activate the custom palette uploading, LDA #$00 to deactivate it or LDA #$01 to activate it.

"STA !RAM_PlayerPalPtr" - You'll load the (low, mid and high) byte of where your palette is located (in my example $30:8015), you just need to mess around 'til you get it work.

Also, I don't recommend Asar to patch it, use xkas to patch it.
Pages: « 1 »
Forum Index - SMW Hacking - General SMW Hacking Help - ASM & Related Topics - Removing "unneccesary" code from a patch (pastebin link included)

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: 29

Menu