Button presses can be ignored by writing to the wJoyIgnore register which is indeed at address $cd6b, so from what I'm seeing I looks like you have already sorted this out.
Quote:
|
2. The player will eventually reach land and will stop, but the game still thinks he's surfing, i.e. 0xD700 is set to $02. If the player goes further inland, the game then realizes he's walking and goes back to normal. I want the player to stop surfing and begin walking as soon as he reaches land, without having a button being pressed. How do I do that?
|
If button presses are being simulated while surfing the collision checks are skipped. So while they're being simulated (bit 7 of wd730 is set), it will never be detected that the character has collided with land and should stop surfing. If I'm understanding you correctly, the step you take after reaching land is the first non-simulated button press so it gets caught
here, clearing bit 7 of wd730 allowing the game to notice the collision.
I'm not absolutely sure, but I don't think there's anywhere in the game where button presses are simulated while surfing, so unless I'm missing something it's probably safe to remove that check from CollisionCheckOnWater (plus that's probably just a fail safe to prevent scripted movements from freezing if a collision occurs). If you're not confident with this solution you could use some flag so that the check is skipped in the circumstances that you want (you could set the flag when your custom simulated movements starts for example, then reset it when you step on land).