Enable picking up mushroom with magic powder in inventory

Go down

Enable picking up mushroom with magic powder in inventory Empty Enable picking up mushroom with magic powder in inventory

Post by qwertymodo Wed 27 Apr 2016 - 19:12

This is another PW bugfix, but could be useful elsewhere if anybody ever had a reason to allow the player to pick up a mushroom when they already have the magic powder.

Original code:
Code:
$09/8716 AF 44 F3 7E LDA $7EF344[$7E:F344]   A:0D00 X:0000 Y:0007 P:envMXdiZc
$09/871A C9 02       CMP #$02                A:0D00 X:0000 Y:0007 P:envMXdiZc
$09/871C F0 06       BEQ $06    [$8724]      A:0D00 X:0000 Y:0007 P:envMXdiZc
$09/871E A9 01       LDA #$01                A:0D00 X:0000 Y:0007 P:envMXdiZc
$09/8720 87 00       STA [$00]  [$78:0000]   A:0D00 X:0000 Y:0007 P:envMXdiZc
$09/8722 80 2B       BRA $2B    [$874F]      A:0D00 X:0000 Y:0007 P:envMXdiZc
$09/8724 A2 01       LDX #$01                A:0D00 X:0000 Y:0007 P:envMXdiZc
$09/8726 C0 24       CPY #$24                A:0D00 X:0000 Y:0007 P:envMXdiZc
$09/8728 F0 17       BEQ $17    [$8741]      A:0D00 X:0000 Y:0007 P:envMXdiZc

Just NOP out the BEQ $06 at $09871C

Code:
org $09871C
    nop
    nop

Or, if you're the manual hex-editing type:
Code:
0x04871C
F0 06 -> EA EA
qwertymodo
qwertymodo

Enable picking up mushroom with magic powder in inventory Image212

Since : 2014-10-21

Back to top Go down

Enable picking up mushroom with magic powder in inventory Empty Re: Enable picking up mushroom with magic powder in inventory

Post by qwertymodo Thu 7 Jul 2016 - 19:31

Here's another part to add.  This fixes the way the witch in the potion shop handles giving you the magic powder in the following manner:

-You must first give the mushroom to the brewing witch before the magic powder is available (no change, just confirming that this is still the case)
-If you lose the magic powder, a new one will be available at the witches hut, but only so long as the mushroom/powder slot is empty
-If you pick up a second mushroom, you cannot get the powder again until you have gotten rid of the second mushroom
-If you pick up a second mushroom, you cannot give it to the witch to get rid of it if you have the quake medallion (this is PW-specific, so you don't lose the second mushroom).

Code:
seek($04F000)
witch_mushroom_check:
    lda $7EF349
    beq +
    lda #$00
    rtl
+;  lda $7EF344
    rtl


seek($05E462)
    jsl witch_mushroom_check


seek($05F542)
    cmp #$01
    db $10 // beq -> bpl

The witch_mushroom_check subroutine controls the brewing witch outside, whether she will accept the mushroom from you or not. The last section at $05F542 modifies the behavior inside the shop and whether or not the powder is available.
qwertymodo
qwertymodo

Enable picking up mushroom with magic powder in inventory Image212

Since : 2014-10-21

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum