Why the hell is there a hardcoded down in nesmaker?

drexegar

Member
I removed all input scripts, yet down changes the players state (jump state), does any body have a clue, because of this I can't get crouch to work right, and I don't know where the this down code to change state would be at.
 

MistSonata

Moderator
It would help if we had some more information, such as what module you're using, and what version of NESmaker you're using (if not the current one). In many cases, a video capture of exactly what's happening will help a lot too.

Though from what I can guess, the problem is probably coming from these lines in "ExtraControllReadCode.asm"

Code:
notInAir:
    LDA Object_h_speed_lo,x
    ORA Object_h_speed_hi,x
    BNE skipMainGameExtraInputControl
    ;;;; controller is not pressed
    ;;;; horizontal speed is zero.
    ;; check to see if in air, shooting, etc.
	 LDA gamepad
	AND #%00100000 ; if down is pressed
	BEQ notDucking
	 ChangeObjectState #$5, #$04
	 JMP skipMainGameExtraInputControl
notDucking:
    LDA gamepad
	AND #%11110000
	BNE skipMainGameExtraInputControl
    ChangeObjectState #$00, #$04

You could probably get away with commenting out this whole block of code (apart from the labels) and it'll be fine. IMPORTANT: Make sure you edit the right version of this asm file, there are three of them in the current version, and they each go to a different module.


As for WHY down is hardcoded into NESmaker, it's usually because the tool doesn't support that feature yet, and it's easier to just hardcode it in temporarily. At least I assume that's the case.
 

drexegar

Member
MistSonata said:
Though from what I can guess, the problem is probably coming from these lines in "ExtraControllReadCode.asm"

Code:
notInAir:
    LDA Object_h_speed_lo,x
    ORA Object_h_speed_hi,x
    BNE skipMainGameExtraInputControl
    ;;;; controller is not pressed
    ;;;; horizontal speed is zero.
    ;; check to see if in air, shooting, etc.
	 LDA gamepad
	AND #%00100000 ; if down is pressed
	BEQ notDucking
	 ChangeObjectState #$5, #$04
	 JMP skipMainGameExtraInputControl
notDucking:
    LDA gamepad
	AND #%11110000
	BNE skipMainGameExtraInputControl
    ChangeObjectState #$00, #$04

You could probably get away with commenting out this whole block of code (apart from the labels) and it'll be fine. IMPORTANT: Make sure you edit the right version of this asm file, there are three of them in the current version, and they each go to a different module.


As for WHY down is hardcoded into NESmaker, it's usually because the tool doesn't support that feature yet, and it's easier to just hardcode it in temporarily. At least I assume that's the case.

My apologies,
I'm using latest 4.1 nesmaker with patch, scrolling platform module.

Now looking at this code, I think it looks like the down code for when you jump down a one way platform? I may have to actually modify it instead of commenting out, thanks. ill play around with it.

UPDATE: all I did was switch ChangeObjectState #$5, #$04 into my animation with #$04, #00 and that made the crouching work at least.

Of course I also had to make a crouch code too.
Code:
    LDX player1_object
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;; this is for platform game.
    GetCurrentActionType player1_object
    CMP #$03 ;; attack
    BEQ ++
    AND #%00000001              ; Are we in the air ?
    BEQ ++

ChangeObjectState #$04, #$04
++
    RTS

Thanks guys for the help.
 
Top Bottom