 |
|
 |
|
| 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 2009-05-02 11:56:17 AM |
Link | Quote |
|
|
For custom blocks, the Y register holds the "acts like" value, meaning LDY $1493 will change what the block acts like. Just add a PHY before it and a PLY after the BCC #$FF (whatever that's supposed to mean... Perhaps you meant CMP #$FF?), and it should get rid the brown block spawning.
|
| Last edited on 2009-05-02 11:56:48 AM by yoshicookiezeus. |
|
| Posted on 2009-05-02 12:02:05 PM |
Link | Quote |
|
Well, that won't fix it - Part of the 'hit head' sound effect code replaces the Y register, so it acts like 125 instead of 25. Someone posted a way to permanently fix it recently, but I lost the link. However, setting the tile to act like 1E6 will work fine as far as I know.
BCC means "branch if the compared value is less than A" (or the other way around, but I'm pretty sure that's right). He's using it wrong, but that line seems unnecessary anyway, so just remove it.
|
| Last edited on 2009-05-02 12:03:59 PM by Azure. |
|
| Posted on 2009-05-02 12:03:57 PM |
Link | Quote |
|
Adding DEC $13C6 will prevent Mario from walking.
Your glitch can be fixed by using BMF's patch in the patches section. I forgot what it was called, though.
|
|
| Posted on 2009-05-02 12:03:58 PM |
Link | Quote |
|
I know what BCC means. However, as far as I know, it is used like "BCC [label]", and not like "BCC [value]", which is why BCC #$FF kind of makes me confused.
EDIT: And that code doesn't even play any sound effect.
|
| Last edited on 2009-05-02 12:08:15 PM by yoshicookiezeus. |
|
| Posted on 2009-05-02 12:35:56 PM |
Link | Quote |
|
|
Thanks, guys. The block working how it should now. =)
|
|
| Posted on 2009-05-02 10:23:31 PM |
Link | Quote |
|
Edit: I don't use the BCC #$(insert value here), so I forgot some... Edited to show correct info.
BCC with a value next to it does a relative jump by the number of bytes specified by the number next to it. For example:Code
LDA $1493
CMP #$FF
BCC #$02
LDA #$01
STA $1497;it would go here
RTS
This is a randomly generated code. It checks if level goal is set or not. If it is, It will make mario invincible for a frame. If not, it does nothing.
|
| Last edited on 2009-05-03 12:34:22 AM by scepile. |
|
| Posted on 2009-05-02 11:41:53 PM |
Link | Quote |
|
Originally posted by scepileCode
LDA $1493
CMP #$FF
BCC #$01
LDA #$01
STA $1497;it would go here
RTS
lolno
If the BCC executes, this code will run after it:
Code
ORA ($8D,x)
STA [$14],y
RTS
For correct behavior, use BCC #$04. It skips a number of bytes, not lines.
Edit: Oh wait, that won't even assemble properly. BCC $04 works, though.
|
| Last edited on 2009-05-03 09:55:11 AM by Alcaro. |
|
| Posted on 2009-05-03 09:47:32 AM |
Link | Quote |
|
Oh good, a Hex Help thread.
So I'm modifying the game to start with one life and 99 coins. I go to value 02025 and change it to 01, which was two lives. I changed it to 00, assuming that would be 1 life, which I was right. But:


Now stuff is messed up. How do I fix this, and also change the starting coin amount?
EDIT: Nevermind, I had it at 241 (F1) lives. How do you change the starting coins?
EDITx2: Nevermind again, I figured it out.
|
| Last edited on 2009-05-04 05:50:17 PM by RedboneBit. |
|
| Posted on 2009-05-03 01:55:36 PM |
Link | Quote |
|
Originally posted by ArtsyOriginally posted by ArtsyThanks, at least now I know that multiple midway points is possible. If anyone finds out how to do it, please tell me, I NEED it for my hack I'm making. Does anyone know how to yet? Also, I saw the layer two smash for spiked pillars said: "May Glitch." What could that possibly do?
Bumporz. I'm staring to wonder if multiple midway points in a long level is possible. Also, how do you change the firing frequency of bullet bill blasters? Some of them aren't doing a thing or are firing incorrectly.
|
|
| Posted on 2009-05-03 04:55:10 PM |
Link | Quote |
|
Originally posted by imameliaArtsy: I'm not that good at ASM, but from what I've heard, having more than one midway point would be possible, but require more complicated ASM than I know how to do. You could do what I plan to do: make every stage begin with a cutscene, then scatter blocks throughout the level that set a RAM address and change the screen exit settings for the cutscene.
Originally posted by ArtsyThanks, at least now I know that multiple midway points is possible. If anyone finds out how to do it, please tell me, I NEED it for my hack I'm making.
Multiple midway points in one level are possible, but not trivial. I want them in my SMW hack, but I would need to program them, if no hacker has yet programmed them.
SMW only remembers whether or not someone reached the midway point in each level on the world map. The problem is that multiple midway points would require an almost complete redesign of midway points in SMW. I would need to study the disassembly of the existing SMW code for midway points, and write new assembly code. Another complication is that SMW seems to save the midway status of each level. (This is why Mario starts midway if I open my *96 file and visit Vanilla Secret 2, Cheese Bridge Area or Forest of Illusion 1.) I have a problem if SMW saves that I reached the midway point but forgets which of the midway points.
Multiple midway points might work like so:- Keep the existing midway-gate object.
- Number the midway gates in each level as midway gate 1, midway gate 2, midway gate 3, ...
- Invent some way for midway gates to know their number, like how exit pipes know where to go.
- Use RAM to store the gate number and level number of the last reached midway gate. Forget about all midway gates except the last reached gate. Use separate RAM for Mario or Luigi.
- Hijack the code so that midway gates store those numbers when someone breaks their tape.
- Hijack the world-map-to-level code to send Mario or Luigi to the correct place if the player enters the level with the last reached midway gate. Allow each player to continue from the last reached midway gate of the other player. Ignore any midway information from the save file.
- Hijack the code that places midway gates in the level, so that gates at or before the last reached gate have no tape.
- Hijack the code that loads a save file, to also reset the RAM that stores the last reached midway gate.
This is actually far beyond my current skills! I would need to hijack SMW code at more than four unknown places; I cannot yet accomplish that. I think that multiple midway points are possible but I know not whether my design would work.
|
|
| Posted on 2009-05-04 12:24:53 PM |
Link | Quote |
|
Okay, I'm going to ask this here. I tried making my own thread, and PMing the maker of this sprite, but no help. Here's my problem:Originally posted by me in another postWell, acually two problems.
1, The boss will not throw hammers. I've checked and double check all of the of the values, and they should work. Here's what it's like in the file.
BONE_OR_HAMMER = $04 ; 06 = Boss throws bones 04 = boss throws hammers. These have different ways of moving- the bones move straight and the hammers move in a arch. You must remember hammers only work with certain (there are many) sprite GFX. Bones only work with castle sprite GFX.
HITPOINTS = $09 ; How much health the boss has
FINALSTAND = $02 ; How many hitpoints he is at when he activates a power (drop enemies on Mario or something here!)
FINALTYPE = $02 ; What to do for the final stand. 00 = Activate the POW, 01 = Switch the ON/OFF switch, 02 = Roar and throw a bunch of hammers
POWLENGTH = $28 ; How long a pow lasts. This is not in seconds- FF is a 16 second POW. (If you don't know hex, this just means it's okay to put a number under 99 here.
HAMMERFREQ = $03 ; hammer frequency. 00 = none, 01 = two per 4 seconds or so, 02 = 3 per four seconds or so
DIRECTION = $00 ; Initally $00 = facing left, $40 = facing right.
WALKING = $01 ; 00 = won't walk, 01 = will walk.
ENDOPTION = $00 ; When boss is beaten: 00 = end level, 01 = warp using the screen exit, like when you go through a door
Directly copy & pasted from the file.
2, when I try to use it, the GFX get garbled. The problem is, when facing right, the tiles flip, but that makes the custoff.
Like this:
Facing left:
1234
1234
5678
5678
Facing right:
2143
2143
6587
6587
when it should be
4321
4321
8765
8765
Oh, yeah, this is version 1.4, gotten from Maxx's website/blog/whatever.
How do I fix these problems?
Thnx.
Any help?
|
|
| Posted on 2009-05-04 05:49:45 PM |
Link | Quote |
|
A question regarding custom sprites - How would I draw a certain tile if some RAM address has a certain value? For example, I want to drew the 16x16 tile A0 if the RAM address $14AF is 01. I've tried looking into the birdo_smb2 sprite, because when it's hit, it draws a different tile, then after some time it comes back, but I have no idea what part I can find the code which does that.
EDIT: Nevermind, I found it out.
|
| Last edited on 2009-05-07 04:11:41 PM by Shinnok. |
|
| Posted on 2009-05-05 08:00:07 PM |
Link | Quote |
|
|
Is there a sprite clipping offset that will work properly for a rideable 16x32 sprite? None of the ones I've tried seem to work right.
|
|
| Posted on 2009-05-05 08:14:56 PM |
Link | Quote |
|
|
Try 30. It's the one mikeyk's Rideable Birdo has.
|
|
| Posted on 2009-05-05 08:39:14 PM |
Link | Quote |
|
Hm, well it interacts properly with everything but Mario now. I suspect I may have no idea what I'm doing!
EDIT:
The problem I'm having is that while Mario is riding it, he can walk out over the edge of the sprite as though it was a 32x32 (I'm using original Mega Mole from sprite tool as a base)
How is this behavior controlled?
|
| Last edited on 2009-05-06 06:25:35 AM by Doctor Sneeze. |
|
| Posted on 2009-05-07 08:35:32 AM |
Link | Quote |
|
Originally posted by meI am currently trying to create the SMB3 diagonal Thwomps, but I seem to have run into some trouble... For some reason, the falling state doesn't set the X speed properly... I believe that the problem is somewhere among the lines marked with red.
Code SPRITE_Y_SPEED = $AA
SPRITE_X_SPEED = $B6
SPRITE_STATE = $C2
SPRITE_Y_POS = $D8
ORIG_Y_POS = $151C
EXPRESSION = $1528
FREEZE_TIMER = $1540
SPR_OBJ_STATUS = $1588
H_OFFSCREEN = $15A0
V_OFFSCREEN = $186C
; definitions of bits (don't change these)
IS_ON_GROUND = $06
; sprite data
GRAVITY_Y = $04
MAX_Y_SPEED = $3E
RISE_SPEED_Y = $F0
GRAVITY_X = $FC
MAX_X_SPEED = $C2
RISE_SPEED_X = $10
TIME_TO_SHAKE = $18
SOUND_EFFECT = $09
TIME_ON_GROUND = $40
FALLING JSL $01802A ;apply speed
LDA SPRITE_Y_SPEED,x ;increase speed if below the max
CMP #MAX_Y_SPEED
BCS DONT_INC_Y_SPEED
ADC #GRAVITY_Y
STA SPRITE_Y_SPEED,x
DONT_INC_Y_SPEED LDA SPRITE_X_SPEED,x ;increase speed if below the max
CMP #MAX_X_SPEED
BCC DONT_INC_X_SPEED
ADC #GRAVITY_X
STA SPRITE_X_SPEED,x
DONT_INC_X_SPEED JSL $019138 ;interact with objects
LDA SPR_OBJ_STATUS,x ;return if not on the ground
AND #IS_ON_GROUND
BEQ RETURN1
JSR SUB_9A04 ; ?? speed related
LDA #TIME_TO_SHAKE ;shake ground
STA $1887
LDA #SOUND_EFFECT ;play sound effect
STA $1DFC
LDA #TIME_ON_GROUND ;set time to stay on ground
STA FREEZE_TIMER,x
INC SPRITE_STATE,x ;go to rising state
RETURN1 RTS
;some other code
SUB_9A04 LDA SPR_OBJ_STATUS,x
BMI THWOMP_1
LDA #$00
LDY $15B8,x
BEQ THWOMP_2
THWOMP_1 LDA #$18
THWOMP_2 STA SPRITE_Y_SPEED,x
STA SPRITE_X_SPEED,x
RTS
|
|
| Posted on 2009-05-08 02:19:34 PM |
Link | Quote |
|
This is a block I found in a patch, but is in ASM, for blocktool super deluxe. There is some way to use It in the normal blocktool?
Here is the block ASM:
;;Fast Energy Drain Block - for Metroid Health Patch - By ICB
JMP MarioBelow : JMP MarioAbove : JMP MarioSide : JMP SpriteV : JMP SpriteH : JMP MarioCape : JMP MarioFireBall
MarioAbove:
MarioBelow:
MarioSide:
LDA $14 ;Play Sound
AND #$03 ;Every
BNE stop ;few Frames
LDA #$06 ;to know
STA $1DFC ;you're in hot water!
stop:
LDA #$02 ;set hurt flag to custom
STA $0670
LDA #$01 ;set inc/dec RAM to 1 while touching
STA $1900
RTL
MarioCape:
SpriteV:
SpriteH:
MarioFireBall:
RTL
|
|
| Posted on 2009-05-08 02:42:38 PM |
Link | Quote |
|
Here's the code for Blocktool:
CodeLDA $14 ;Play Sound
AND #$03 ;Every
BNE stop ;few Frames
LDA #$06 ;to know
STA $1DFC ;you're in hot water!
stop:
LDA #$02 ;set hurt flag to custom
STA $0670
LDA #$01 ;set inc/dec RAM to 1 while touching
STA $1900
RTS
Howver, you have to convert it into a .bin file before inserting it. To do so, copy the code (quote my post to copy it properly) and paste it into a text file. Next, get trasm.exe (comes with Sprite Tool) and drag the text file over it. Now 3 files will be created, but you'll only need the .bin file, which can now be inserted.
Offsets: Above, below, sides 0, all others -1, whole page unchecked.
|
| Last edited on 2009-05-08 02:43:06 PM by WhiteYoshiEgg. |
|
| Posted on 2009-05-08 04:25:07 PM |
Link | Quote |
|
Originally posted by WhiteYoshiEggHere's the code for Blocktool:
CodeLDA $14 ;Play Sound
AND #$03 ;Every
BNE stop ;few Frames
LDA #$06 ;to know
STA $1DFC ;you're in hot water!
stop:
LDA #$02 ;set hurt flag to custom
STA $0670
LDA #$01 ;set inc/dec RAM to 1 while touching
STA $1900
RTS
Howver, you have to convert it into a .bin file before inserting it. To do so, copy the code (quote my post to copy it properly) and paste it into a text file. Next, get trasm.exe (comes with Sprite Tool) and drag the text file over it. Now 3 files will be created, but you'll only need the .bin file, which can now be inserted.
Offsets: Above, below, sides 0, all others -1, whole page unchecked.
Thanks you, I'll try It now.
|
|
| Posted on 2009-05-08 06:47:17 PM |
Link | Quote |
|
|
I'm trying to make a sprite that takes multiple hits to kill, but I'm having a little trouble with bypassing standard interactions. How do I make sure it doesn't die when hit with a thrown object?
|
|
|
|
|
|
|
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: 29
|
|
|
|