Language…
10 users online: Danik2343, DinoMom, Firstnamebutt, masl, Odinstafel, pnaha, qantuum,  Ringo, Saibot1997, Zavok - Guests: 230 - Bots: 342
Users: 64,795 (2,380 active)
Latest user: mathew

Peach float ASM problem

I'm thinking about creating a hack starring peach as my main character. I have all the GFX I need (thanks Ladida) and the overworld finished. But, I'm trying to make peach float like in SMB2, is there any way I can do this? And also, I tried to tweak the flutter jump patch in the patches section to make it so that peach doesn't float down and stays up in the air, as if glding. Am I taking a step in the right direction or am I doing something wrong. Currently, Peach stays in the air and never falls, here is the code:



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;Flutter Jump
;;By Scepile3
;;
;;Notes:
;;*I use the RAM Addresses $0660 (For Flutter Jump Indicator)
;;
;;*Whenever I add another bulk of asm, it freezes at the intro
;;If you know why, please inform me.
;;
;;Original code from:
;; LR Hook - Version 1.1
;; By Smallhacker
;;
;; Disables L/R and prepares them to be used for other stuff
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
org $34B64 ;;change this to free space in rom
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
macro RATS_start(id)
db "STAR"
dw RATS_Endcode-RATS_Startcode
dw RATS_Endcode-RATS_Startcode^#$FFFF
RATS_Startcode:
endmacro

macro RATS_end(id)
RATS_Endcode:
endmacro

lorom
header

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;Disable L/R scrolling
org $34B64
org $00CDF6
BRA lrSkip
org $00CE49
lrSkip:

;Hijack the status bar routine
org $008F49
JSL NewRoutine

org $34B64
%RATS_start(0)

NewRoutine:
LDA $77 ;Doesn't work if not in air, carrying things, swimming, on yoshi, or spin jumping
AND #$04
BNE Reset
LDA $1470
BNE Reset
LDA $148F
BNE Reset
LDA $140D
BNE Reset
LDA $75
BNE Reset
LDA $187A
BNE Reset
LDA $0660
BEQ Check
LDA $0660
CMP #$02
BEQ Stand
LDA #$05
STA $13E0
INC $0660
BRA Slow
Slow:
LDA $7D
CMP #$80
BCS Return
LDA #$00 ;Slows descent
STA $7D
BRA Return
Check:
LDA $16
CMP #$80
BNE Return
LDA #$01 ;Change to alter flutter jump's height
STA $7D
INC $0660
BRA Return
Stand:
LDA #$04
STA $13E0
DEC $0660
BRA Slow
Reset:
STZ $0660
BRA Return
Return:
LDA $0DBE
INC A
RTL

%RATS_end(0)




I don't know any ASM. I'm hoping someone could help me, which is why I posted it here. I posted it before in the Basic hacking section but no one replied, so, I thought that you guys might be able to solve my dilemma. I want to make it so that peach falls after floating in about a second or two. Isn't there a code that can make this possible? If so, please reply with what I need.

Thank you for reading!
- "The phrase "You Rock" is commonly associated with awesome people. Created in the late 1980's, it was originally a derogatory mark for someone who listened to rock. Now, It means that someone is awesome."
smwcentral iconwell, there is something you can do. Did you notcie the reason I used another unused RAM address inside the patch? It was to ensure that the flutterjump won't last forever. Before the lines:
LDA $0660
BEQ Check
and after these lines:
LDA $187A
BNE Reset
you want to put an unused RAM address into that to act as a timer. To check the address, you should use (!T being that unused RAM address):
LDA !T
CMP #$78
BCS Reset
INC !T
Also put this into Reset:
STZ !T
This piece of code works like this:
!T is checked for #$78, the number of frames that equal 2 seconds.
If it is 78 or more, it goes to reset. That removes the possibility that T is over 2 seconds. It increases !T once each frame. (60 frames = 1 second) If !T is over #$78, it STZ !T, which puts zero into !T.
You know, it would be cool if someone made a sword sprite(s) and released it to the public. That would help a lot of people........ Now that I think about it, that would be perfect for C3! (Not that I could program a sword sprite)
OH MY GOD!! You're amazing. But one problem... once I land I can't float anymore... If I jump and try to float, it woln't let me no more. I used the address:

0B44

as my free space. Is there something I could do to fix this?

- "The phrase "You Rock" is commonly associated with awesome people. Created in the late 1980's, it was originally a derogatory mark for someone who listened to rock. Now, It means that someone is awesome."
smwcentral iconEdit: Oh, whoops. I had a mistake. Put that peice of code after
LDA $0660
BEQ Check
and before:
LDA $0660
CMP #$02
BEQ Stand
I know other hackers that are waaaaayyyy better at hacking then me. I feel like a novice.
Well, did you use 0B44 anywhere else? If you have, then that's a problem.
You know, it would be cool if someone made a sword sprite(s) and released it to the public. That would help a lot of people........ Now that I think about it, that would be perfect for C3! (Not that I could program a sword sprite)
It still didn't work... You think there is something wrong with the code that I put?

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;Flutter Jump
;;By Scepile3
;;
;;Notes:
;;*I use the RAM Addresses $0660 (For Flutter Jump Indicator)
;;
;;*Whenever I add another bulk of asm, it freezes at the intro
;;If you know why, please inform me.
;;
;;Original code from:
;; LR Hook - Version 1.1
;; By Smallhacker
;;
;; Disables L/R and prepares them to be used for other stuff
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
org $34B64 ;;change this to free space in rom
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
macro RATS_start(id)
db "STAR"
dw RATS_Endcode<id>-RATS_Startcode<id>
dw RATS_Endcode<id>-RATS_Startcode<id>^#$FFFF
RATS_Startcode<id>:
endmacro

macro RATS_end(id)
RATS_Endcode<id>:
endmacro

lorom
header

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;Disable L/R scrolling
org $34B64
org $00CDF6
BRA lrSkip
org $00CE49
lrSkip:

;Hijack the status bar routine
org $008F49
JSL NewRoutine

org $34B64
%RATS_start(0)

NewRoutine:
LDA $77 ;Doesn't work if not in air, carrying things, swimming, on yoshi, or spin jumping
AND #$04
BNE Reset
LDA $1470
BNE Reset
LDA $148F
BNE Reset
LDA $140D
BNE Reset
LDA $75
BNE Reset
LDA $187A
BNE Reset
LDA $0660
BEQ Check
LDA $0B44
CMP #$78
BCS Reset
INC $0B44
LDA $0660
CMP #$02
BEQ Stand
LDA #$05
STA $13E0
INC $0660
BRA Slow
Slow:
LDA $7D
CMP #$80
BCS Return
LDA #$00 ;Slows descent
STA $7D
BRA Return
Check:
LDA $16
CMP #$80
BNE Return
LDA #$00 ;Change to alter flutter jump's height
STA $7D
INC $0660
BRA Return
Stand:
LDA #$04
STA $13E0
DEC $0660
BRA Slow
Reset:
STZ $0660
BRA Return
STZ $0B44
Return:
LDA $0DBE
INC A
RTL

%RATS_end(0)

- "The phrase "You Rock" is commonly associated with awesome people. Created in the late 1980's, it was originally a derogatory mark for someone who listened to rock. Now, It means that someone is awesome."
smwcentral iconI see your error. (in/directly caused by me) When BRA is used, it jumps to that piece of code, never going back. Put STZ $0B44 before BRA Return.
You know, it would be cool if someone made a sword sprite(s) and released it to the public. That would help a lot of people........ Now that I think about it, that would be perfect for C3! (Not that I could program a sword sprite)
Scepile, do you mind if I put your name in my credits document?
- "The phrase "You Rock" is commonly associated with awesome people. Created in the late 1980's, it was originally a derogatory mark for someone who listened to rock. Now, It means that someone is awesome."
smwcentral iconEdit: Also, if there is anything I can help you on, please don't hesitate to ask.
It doesn't matter, go ahead. I take it the problem is solved also.
You know, it would be cool if someone made a sword sprite(s) and released it to the public. That would help a lot of people........ Now that I think about it, that would be perfect for C3! (Not that I could program a sword sprite)
WAIT... Um... under which BRA Return do I put it under, there are 3
- "The phrase "You Rock" is commonly associated with awesome people. Created in the late 1980's, it was originally a derogatory mark for someone who listened to rock. Now, It means that someone is awesome."
smwcentral iconOh, you put it above the BRA Return that is under STZ $0660
You know, it would be cool if someone made a sword sprite(s) and released it to the public. That would help a lot of people........ Now that I think about it, that would be perfect for C3! (Not that I could program a sword sprite)