#Tightrope/Slope Fix for new template

1 messages · Page 1 of 1 (latest)

wise oriole
#

tightropes and slopes cant co-exist, since using tightropes breaks slopes, theres a patch in the misc patches thread in NSMBHD, but this one required you to directly hex edit the arm9 and overlays, and it was for the old template

heres the link for the old one if it helps: https://nsmbhd.net/post/46569/

full dagger
#

ah yeah need ida for that I can do it

wise oriole
#

have ya made any progress yet or u havent had the chance to yet

thorn thunder
#

you could just do it the lazy way

#

add the offset mentioned in the post (0×11410) to the start of overlay 0 (0x20986e0)

#

and then

#
ncp_over(0x20a9af0,0)
static const u8 slopeTightRopeFix[] = {0x46, 0x60, 0xFD, 0x0A};
#

oops forgot the arm9 one

wise oriole
#

oop

thorn thunder
#

mero patched an sdk function wtf

#

why

#

not good

static shard
#

That explains it

thorn thunder
#

anyways, this might work, but I don't recommend it and i'm too lazy rn to fix it ```cpp
ncp_over(0x1ff9c10)
static const u8 slopeTightRopeFix2[] = {0x7F, 0x00, 0xC5, 0xE5, 0xE3, 0x9F, 0x02, 0xEA};

#

nope I fucked it up somehow lol

#

I'll look into this later

summer goblet
static shard
#

I thought I could just do this but I cant :c

thorn thunder
#

it's placing code in the unused region of arm9

#

and the overlay 0 patch is a branch to it

#

46 60 FD 0A is equal to beq #0x2001c10

#

and 7F 00 C5 E5 E3 9F 02 EA is ```asm
strb r0, [r5, #0x7f]
b #0x20a9ba8

#

so it should be equivalent to this ```c++
ncp_jump(0x20a9af0,0) // CollisionMgr::updatePlayerHorizontal
NTR_NAKED static void slopeTightRopeFix() {asm(R"(
bne 0x20a9af0 + 4 @ if PlatformMgr::update returns false, skip
strb r0, [r5, #0x7f] @ clear upper 8 bits of collisionResult
b 0x20a9ba8
)");}

#

very hacky btw, you probably shouldn't use it, even if it works

timber galleon
#

Does this mean that there's probably no straightforward way to port this to NCPatcher?

thorn thunder
#

no? this is it ported to ncpatcher

#

I'm just saying the code is ass

timber galleon
#

Ah, I thought you meant the code was buggy

thorn thunder
#

potentially

#

same thing as mero's version

timber galleon
#

Hmm, I see

#

.cpp right?

thorn thunder
#

yep

#

oh and #include <nsmb_nitro.hpp> at the top

wise oriole
#

gonna test it out mariothumbsup

timber galleon
thorn thunder
#

ye

wise oriole
#

remove the '<>' otherwise it doesnt compile lmao GoalSkull

#

unless its needed for some reason?

#

it works tysm!!!

#

could maybe put it in #1207793065524199455 since its been requested quite a bit apparently?

timber galleon
#

Or maybe upload it to the NSMB Central code hacks Github repo

wise oriole
#

that too yeah

thorn thunder
wise oriole
thorn thunder
#

🤨

timber galleon
#

That's weird, for me it was the opposite, it did not compile when I removed the <>

wise oriole
#

its probably cause i havent updated the reference yet lmao, i didnt do so cause it was broken at the time so i should probably do that sometime soon now that it's fixed

timber galleon
#

I have never ever updated it HappyFlower

thorn thunder
static shard
#

Nice

#

There has to be a better way of fixing this though

thorn thunder
#

yep, patching a CollisionMgr function will probably lead to unintended side effects

#

and idk about clearing the upper 8 bits of collisionResult, that's a lot of flags that probably shouldn't be changed

static shard
#

Yeah

#

Also, the code hack that fixes peach after killing Petey in a world that is not w5 does smth similar by patching an unused part of arm9 iirc, now that I know what’s going on I might finally be able to fix that bug