Views: 20,053,041 |
Home
| Forums
| Uploader
| Wiki
| Object databases
| IRC
Rules/FAQ | Memberlist | Calendar | Stats | Online users | Last posts | Search |
04-25-24 02:33 PM |
Guest: |
Main - Posts by dy |
dy |
| ||
Member Normal user Level: 12 Posts: 21/30 EXP: 7733 Next: 188 Since: 04-02-18 Last post: 2177 days ago Last view: 2168 days ago |
To change the starting character:
1. Open the ROM in a hex editor and go to offset 0x13DDC (for EUR ROM) 2. Change the "03" to the character of your choice (00: Mario, 01: Luigi, 02: Wario, 03: Yoshi) Makes the intro cutscene a little glitchy, but you're probably going to want to apply the Skip Intro patch anyway if you're changing starting characters. ____________________ - ASM resource for customising behaviour of player/objects/levels - NSMBe with direct overwrite feature |
dy |
| ||
Member Normal user Level: 12 Posts: 22/30 EXP: 7733 Next: 188 Since: 04-02-18 Last post: 2177 days ago Last view: 2168 days ago |
Fair enough. Look forward to seeing the end result. Limiting turning speed sounds good. Only other thing that jumps to mind is to think about what to do during star cutscenes (like when you step on star switch or the star disappears) - I anticipate it might feel jarring if everything just freezes suddenly without a star camera. Good luck! ____________________ - ASM resource for customising behaviour of player/objects/levels - NSMBe with direct overwrite feature |
dy |
| ||
Member Normal user Level: 12 Posts: 23/30 EXP: 7733 Next: 188 Since: 04-02-18 Last post: 2177 days ago Last view: 2168 days ago |
Good job.
Also, I'm a bit late to the party, but just found out for myself there's a way to narrow down which overlays to look in. arm9ovt.bin (you'll need NSMBe to extract it) tells the game where to load the various overlays, and it's also how NSMBe knows where to insert ASM hooks without being told the overlay offset. Overlays have overlapping memory addresses, so you'll still need to search a couple to confirm, but this should help quickly narrow down which overlays to look in. ____________________ - ASM resource for customising behaviour of player/objects/levels - NSMBe with direct overwrite feature |
dy |
| ||
Member Normal user Level: 12 Posts: 24/30 EXP: 7733 Next: 188 Since: 04-02-18 Last post: 2177 days ago Last view: 2168 days ago |
I've created a small tweak to NSMBe which allows you to directly overwrite code or data in the ROM/overlays (rather than inserting a branch to new code).
It's useful for:
The code gets compiled with correct relative branch opcodes and inserted directly at the address specified. This allows you to directly overwrite code as well as data without hex editing, and helps you keep everything in the same place and with the same syntax. How to Use Overwrites must be contained in ".s" files. They follow the NSMBe syntax but using the "ovr_" keyword. Here's an example:
ovr_02013DDC: @ change starting character
.byte 0x01 @ Luigi ovr_020FF176_ov_02: @ change character speeds .hword 0x1000 @ Yoshi ovr_02128D18_ov_51: @ change Ice Block vtable pointers .word 0x020B382C @ onGroundPounded: change to BrickBlock:onGroundPounded .word new_IceBlockExploded @ onHitByExplosion: change to new_IceBlockExploded .align @ return to 4 byte alignment for below instructions new_IceBlockExploded: @ do nothing and return because lazy example bx r14 Usage Notes
Download Executable: here Modified source files: here (based on the latest official NSMBe source code from github) Backup version of official NSMBe source code (unmodified): here ____________________ - ASM resource for customising behaviour of player/objects/levels - NSMBe with direct overwrite feature |
dy |
| ||
Member Normal user Level: 12 Posts: 25/30 EXP: 7733 Next: 188 Since: 04-02-18 Last post: 2177 days ago Last view: 2168 days ago |
Added above some ways to change the type of pause screen and text you get when exiting a level with a star in the above post. I've also realised that Black Brick Blocks share the same vtable and callbacks as orange Brick Blocks - the onAttacked callbacks checks the ActorID to determine what type of brick block it is and therefore whether it should break. The first post has been updated to reflect this.
Also, I've discovered that you can make Ice Blocks breakable by making the various onAttacked callbacks point to the corresponding callbacks for Brick Blocks instead (they normally point to dummy functions, so aren't breakable). Correct particle effects and everything!
To make them breakable: here To change which characters can break them, see "Brick Blocks / Black Brick Blocks: who can break" in the first post For replacing the vtable pointers, you can use my modified version of NSMBe (which allows you to directly overwrite code using the same syntax as when creating standard hooks). ____________________ - ASM resource for customising behaviour of player/objects/levels - NSMBe with direct overwrite feature |
dy |
| ||
Member Normal user Level: 12 Posts: 26/30 EXP: 7733 Next: 188 Since: 04-02-18 Last post: 2177 days ago Last view: 2168 days ago |
Above post has been updated with an improved version of the direct overwrite feature.
Changes in v1.1:
Download link in above post. ____________________ - ASM resource for customising behaviour of player/objects/levels - NSMBe with direct overwrite feature |
dy |
| ||
Member Normal user Level: 12 Posts: 27/30 EXP: 7733 Next: 188 Since: 04-02-18 Last post: 2177 days ago Last view: 2168 days ago |
Posted by Hiccup Yep, you're probably right. If you look at all the onKicked(), onPunched(), onGroundPounded(), etc functions for the Brick Block, you'll see that basically all they're doing is returning a pointer in r1 if the object should be broken. It gets that pointer by getting the address of the vtable for that object (the first four bytes at the object's address), adding 0x7C to that address, then getting the value from there. Looking at the commented out vtable structure in SM64DS_2.h, offset 0x7C would be the 31st function (InitResources being the 0th), which is the Kill() function. So looks like all it does is check whether the object should break, and if so, return the address of the object's Kill() function in r1. So yeah, they must have programmed IceBlock::Kill() to break with shards for if hit by Mega Mario. ____________________ - ASM resource for customising behaviour of player/objects/levels - NSMBe with direct overwrite feature |
dy |
| ||
Member Normal user Level: 12 Posts: 28/30 EXP: 7733 Next: 188 Since: 04-02-18 Last post: 2177 days ago Last view: 2168 days ago |
Thanks StarPants - good to see others doing ASM research as well!
There is a 4 halfword data table which sets out the speed multiplier for each character, which affects both walk and run speeds (I found it earlier today but had been planning to look into how it interacts with carry speed and swim speed as well before I posted). Unfortunately not in front of my PC now, but will try post tomorrow (just a heads up so other people don't spend time unnecessarily trying to find it as well - this one was tricky). UPDATE Heh, StarPants - you actually got really close to finding the data table for movement speed. If you look at 0x020BF30C (just a few lines above the address you found), you'll see it gets the player charID, then loads r2 with a value from 0x020FF170 (plus an offset depending on the charID). The function at 0x020BF30C gets called a lot, with a different multiplier in r1 depending on whether it's determining the speed for running, walking, crawling, etc. This isn't character dependent, so if a character has a faster walking speed, it will have a faster running speed. Anyway, without further ado...
See here (including ceiling hang and slippery slide) Despite what many game guides say, all characters have the exact same acceleration and deceleration (and no, Luigi does not have a faster top speed than Mario). Also, thanks to Skelux's "Increase Acceleration" additional patch for the memory address re ground acceleration. Player: carry speed Regular and heavy objects: here Player: swim speed See here Player: jump power See here (including back flip, side flip and long jump) I've also figured out how to change the player's attack knockback power and throwing power, but these are all hardcoded differently for different objects - will upload these once I've finished looking into the different objects. ____________________ - ASM resource for customising behaviour of player/objects/levels - NSMBe with direct overwrite feature |
dy |
| ||
Member Normal user Level: 12 Posts: 29/30 EXP: 7733 Next: 188 Since: 04-02-18 Last post: 2177 days ago Last view: 2168 days ago |
Posted by StarPants Oops, I meant a few lines above at 0x20BF30C (I'll fix my above post). Took me a while to work out too - I find that using F7 in no$gba debugger to step through line by line and look at what's happening to the registers after each line, can help make sense of things when I'm struggling. Essentially this is what it's doing: ldr r2, [r0, 0x8] // r2 = 4 bytes at address (r0 + 0x8) = charID (0:M, 1:L, 2:W, 3:Y)
ldr r0, =0x020FF170 // r0 = 0x020FF170 and r2, r2, 0xFF // r2 = r2 bitwise AND 0xFF (seems unnecessary?) mov r2, r2, lsl 0x1 // r2 *= r2 (left shift 1 bit is effectively x2) = charID x2 ldrh r2, [r0, r2] // r2 = 2 bytes at address (0x020FF170 + charID x2) After that it gets to some mathsy stuff which I didn't really follow either. But yeah, nop'ing at 0x020BF330 stops it dividing the top speed (by what, something like 2^12?) but without changing acceleration/deceleration. So yeah... (It looks even funnier in 3rd person btw, because it speeds up some of the animations as well.) Also FYI - you can change data values in no$gba debugger by changing the instruction to "dcd 0xXXXXXXXX" (took me a while to work out), so you can test things like changing the speed table values on the fly. Don't use "dcd" with ASMPatchTemplate / devkitARM though - use ".word", ".hword", or ".byte" instead. ____________________ - ASM resource for customising behaviour of player/objects/levels - NSMBe with direct overwrite feature |
dy |
| ||
Member Normal user Level: 12 Posts: 30/30 EXP: 7733 Next: 188 Since: 04-02-18 Last post: 2177 days ago Last view: 2168 days ago |
A new version of the modified NSMBe (with direct overwrite) has been uploaded, with an important bug fix.
Changes in v1.2:
Download link and updated example in this post. ____________________ - ASM resource for customising behaviour of player/objects/levels - NSMBe with direct overwrite feature |
Main - Posts by dy |
Page rendered in 0.043 seconds. (2048KB of memory used) MySQL - queries: 22, rows: 120/120, time: 0.008 seconds. Acmlmboard 2.064 (2018-07-20) © 2005-2008 Acmlm, Xkeeper, blackhole89 et al. |