 |
|
 |
|
| Official Hex/ASM/Etc. Help Thread |
|
Forum Index - SMW Hacking - General SMW Hacking Help - ASM & Related Topics - Official Hex/ASM/Etc. Help Thread |
|
|
|
|
| Posted on 2012-01-16 07:46:48 PM |
Link | Quote |
|
You can't convert, you can actally save a value stored in RAM to SRAM, like this:
You'll load RAM $58 and save the value in SRAM $700080.
EDIT: LEVEL UP!
|
| Last edited on 2012-01-16 07:52:23 PM by DiscoMan. |
|
| Posted on 2012-01-16 08:23:32 PM |
Link | Quote |
|
I'm guessing the next part is guessing what's used and what isn't.
Either way, thanks.
|
|
| Posted on 2012-01-16 10:07:29 PM |
Link | Quote |
|
IIRC, you can use SRAM addresses from $700800 onwards. You'll have 131,072 bytes of free SRAM if you expand your ROM's SRAM size to 128kb (which can easily be done by changing PC [x81D8] to 07).
It may be worth noting that most if not all SRAM addresses are initialized to $55 by default, not 00.
|
|
| Posted on 2012-01-16 10:27:52 PM |
Link | Quote |
|
Originally posted by IceguyIIRC, you can use SRAM addresses from $700800 onwards. You'll have 131,072 bytes of free SRAM if you expand your ROM's SRAM size to 128kb (which can easily be done by changing PC [x81D8] to 07).
It may be worth noting that most if not all SRAM addresses are initialized to $55 by default, not 00.
Well, you can use the SRAM for saving things by using a patch called SRAM Expand, you can choose which RAM will be saved and what's the size of the SRAM.
And by the way, RAM is initialized to $55 and SRAM is initialized to $60 not $55.
|
| Last edited on 2012-01-16 10:31:08 PM by DiscoMan. |
|
| Posted on 2012-01-16 11:38:32 PM |
Link | Quote |
|
|
Except in the later versions of bsnes (I think 0.80 and newer, but it might be 0.82 or something), where regular RAM is initialized to random values...and I don't know what SRAM is initialized to, but it is presumably random as well.
|
|
| Posted on 2012-01-17 06:34:54 AM |
Link | Quote |
|
Ok, so when I go to use the sRAM, I have it set the sRAM I'm using to whatever value I'm going to use as "locked" when the player starts a new save file, and then have it save that sRAM to the "unlocked" value whenever the player unlocks that item, right? Ok. I think I understand this a little better. Thanks guys.
EDIT: Different question. Didn't want to double post.
Is CODE_00F5D5: A5 19 LDA RAM_MarioPowerUp ; \ If Mario is small, kill him a good place to hijack for a HP patch?
|
| Last edited on 2012-01-17 01:20:51 PM by sunwarrior25. |
|
| Posted on 2012-01-19 12:41:10 AM |
Link | Quote |
|
I'm trying to implement the Koopaling fixes described here (http://smwc.hostzi.com/SMWiki/wiki/Koopalings.html) via a hex editor (0xED on Mac).
I set 0x1DF6E to [84 CC A4] and 0x1DF73 to [B3 B3 B2]. I think so anyway, I don't see the "0x" part anywhere.
But for "Lemmy's palette can be changed from yellow to green. In the range of addresses 1D42E-1D49C, the lower digit of each byte that ends change in 5 must be changed to B, while leaving the higher one as it was. To make Wendy use a pink palette instead of the red one, in the range of addresses 1D4B8-1D526, each byte with a low digit of 9 must be replaced with F."... I'm not sure what a lower digit is. What I ended up doing was change all the 05 in that range (for Lemmy, for example) to 0B. Broke a few things when I tried to test it.
Can someone either guide me in the right direction, or be super nice and create a patch with these changes already implemented?
Thanks,
|
|
| Posted on 2012-01-20 06:37:34 PM |
Link | Quote |
|
Is this right so far?
Code;====================================================================
; Basic Behavior Select
; A table of basic behaviors based on a freeRAM value
; Normal, Slingshot, Bunny Ears, Feather, Snorkel, Mirror
;====================================================================
PowerUpHPatch:
LDX $19
CMP #$03
BCS BehavHPatch
RTL
BehavHPatch:
LDX $19
DEX #$03
org $D2BD
db SJumpHPatch,x
org $D2BE
db WJumpHPatch,x
org $D2C5
db RJumpHPatch,x
RTL
;TABLE FORMAT
;Normal, Slingshot, Bunneh, Feather, Shield, Snorkel, Mirror, NoItem
SJumpHPatch:
db $80,$80,$80,$80,$80,$80,$80,$80 ; This row is for maximum jump height while standing
WJumpHPatch:
db $80,$80,$80,$80,$80,$80,$80,$80 ; while walking.
RJumpHPatch:
db $80,$80,$80,$80,$80,$80,$80,$80 ; while running.
FJumpHPatch:
db $80,$80,$80,$80,$80,$80,$80,$80 ; while running really fast.
AccLWHPatch:
db $80,$80,$80,$80,$80,$80,$80,$80 ; Mario acceleration while walking left
AccLRHPatch:
db $80,$80,$80,$80,$80,$80,$80,$80 ; while running left. Added to walking left
AccRWHPatch:
db $80,$80,$80,$80,$80,$80,$80,$80 ; while walking right.
AccRRHPatch:
db $80,$80,$80,$80,$80,$80,$80,$80 ; while running right. added to walking right.
|
|
| Posted on 2012-01-20 07:37:07 PM |
Link | Quote |
|
|
Yeah... there are countless errors there. First of all, there is not even an org $xxxxxx where your code will be placed, DEX #$03 does not exist, db is completely static (it won't change at run time), and doing org $xxxx like that won't work since it's static as well.
|
| Last edited on 2012-01-20 07:37:34 PM by MarioEdit. |
|
| Posted on 2012-01-21 12:31:52 PM |
Link | Quote |
|
Originally posted by MarioEditYeah... there are countless errors there. First of all, there is not even an org $xxxxxx where your code will be placed, The org !freespace is further up in the file. I just decided not to include it in the quote.
QuoteDEX #$03 does not exist, I should just DEX DEX DEX instead, right?
Quotedb is completely static (it won't change at run time), and doing org $xxxx like that won't work since it's static as well.
Wow, that is... haha. Good to know that won't work. Looks like I'm going to have to find some other way to change the player's behavior at runtime.
|
|
| Posted on 2012-01-27 11:13:36 AM |
Link | Quote |
|
I'm pretty sure this has been asked numerous times, but how exactly do I draw tiles to the status bar? I was planning on using a loop to do it in comparison to freeRAM.
...
I was planning on doing it this way so I wouldn't have to use super huge tables or anything.
|
|
| Posted on 2012-01-27 11:14:42 AM |
Link | Quote |
|

Have fun.
|
|
| Posted on 2012-01-28 11:45:56 PM |
Link | Quote |
|
|
Where I can get button addresses? I can find them at all.
|
|
| Posted on 2012-01-28 11:53:37 PM |
Link | Quote |
|
Check these addresses:
| $7E:0015 | 1 byte | I/O | Controller data 1. Format: byetUDLR.
b = A or B; y = X or Y; e = select; t = Start; U = up; D = down; L = left, R = right. |
| $7E:0016 | 1 byte | I/O | Controller data 1, first frame only. Format: byetUDLR.
b = B only; y = X or Y; e = select; t = Start; U = up; D = down; L = left, R = right. |
| $7E:0017 | 1 byte | I/O | Controller data 2. Format: axlr----.
a = A; x = X; l = L; r = R, - = null/unused. |
| $7E:0018 | 1 byte | I/O | Controller data 2, first frame only. Format: axlr----.
a = A; x = X; l = L; r = R, - = null/unused. |
|
|
| Posted on 2012-01-29 12:11:13 AM |
Link | Quote |
|
|
I meant $ values of these.
|
|
| Posted on 2012-01-29 02:40:30 AM |
Link | Quote |
|
Originally posted by Luigi370I meant $ values of these.
It's basic binary, but here's the values:
|
|
| Posted on 2012-01-31 08:36:15 AM |
Link | Quote |
|
Hello,
I have 2 noob questions...
1. how can I spawn (in a block) a "bounce block sprite" (at the position of the block)?
2. how can I spawn a "score sprite" (like the "1UP")?
I have found soe things in the ROM Map but that doesn't help me
I hope you can help me
|
|
| Posted on 2012-02-01 02:29:23 PM |
Link | Quote |
|
1. Look Here., it's routine is ripped of SMB3 block.
2.Code LDA $D8 ;\
PHA ;/
LDA $98 ;\
STA $D8 ;/
LDA $E4 ;\
PHA ;/
LDA $9A ;\
STA $E4 ;/
LDA $14D4 ;\
PHA ;/
LDA $99 ;\
STA $14D4 ;/
LDA $14E0 ;\
PHA ; \
LDA $9B ; | Make 1-up sprite (the text) appear.
STA $14E0 ; /
LDA #$08 ;/
PHX ;\
LDX #$00 ;/
JSL $82ACE5 ;\
PLX ;/
PLA ;\
STA $14E0 ;/
PLA ;\
STA $14D4 ;/
PLA ;\
STA $E4 ;/
PLA ;\
STA $D8 ;/
RTL
|
|
| Posted on 2012-02-02 04:33:42 AM |
Link | Quote |
|
Two questions:
-What would I have to do to get the game to save upon entering specific levels of my choosing (LevelASM?)
-Is there a way to notify the player of how much Yoshi Coins they have collected in a specific level?
|
|
| Posted on 2012-02-02 01:56:10 PM |
Link | Quote |
|
Originally posted by shrine-Is there a way to notify the player of how much Yoshi Coins they have collected in a specific level?
You could attempt to save the number to a location on the status bar. To do this, use this code:
Where $XXXX is the status bar address. Possible values are:
|
|
|
|
|
|
|
Forum Index - SMW Hacking - General SMW Hacking Help - ASM & Related Topics - Official Hex/ASM/Etc. Help Thread |
|
|
 |
|
 |
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 UsTotal queries: 27
|
|
|
|