MeroMero |
Posted on 06-04-16, 04:12 pm in Literally everything you need to know about Worldmap editing
|
Death by cuteness
Karma: 6589 Posts: 402/598 Since: 05-01-13 |
ray, Freeze I noticed an oversight in the documentation:
_in the Data-Node section you said: "0E02 DOES NOT BELONG TO THE POINTER WHEN CALCULATING IT." but actually it does belong, and rightfully so. If for example I wanted to put the path-data in your example at offset 0×19C0 in the arm9, I would need to replace 08 5C 0E 02 with C0 19 00 02. To calculate the pointer you need the RAM offset of the overlay (or arm9) you're using. For arm9, the RAM offset is 0×2000000. In the case of overlay 8, the RAM offset is 0×20CC2E0 (US version, for EU it is 0×20DE360). Now look at this: 08 5C 0E 02, if you read it in reverse instead, you'll read it as 02 0E 5C 08. This looks like an offset. Since the path-data is located in overlay 8, subtract the RAM offset of overlay 8 to 20E5C08. 0×20E5C08 - 0×20CC2E0 = 0×19928 In an hex editor, if you look at offset 0×19928 in overlay 8, you'll indeed see the path-data corresponding to the pointer. Now let's say I want to move the path-data located there to offset 0×19C0 in the arm9 (either to copy it as-is or to add more paths). To calculate what will be the new pointer, add the RAM offset of arm9 to 19C0. 0×19C0 + 0×2000000 = 0×20019C0 First things first, the result must be 8 hex numbers long, thus you must add as many non significant zeros as needed, 20019C0 must be written as 020019C0. Second, the result must be written in little-endian, thus 02 00 19 C0 (big-endian) must be written as C0 19 00 02 (little-endian). Now you can replace the old pointer (085C0E02) with the new one (C0190002). This will also clear a misunderstanding, technically all nodes are capable of holding a Path-Data size of 20 bytes (4 paths + End data) without having to sacrifice an already existing path-data. The only problem would be to repoint the Path-Data to a place in the RAM that goes unused. Such a place fortunately exists in NSMB, if you decompress the arm9, you can stuff a lot of things between offset 0×19C0 and offset 0×2FFF inclusive. If this place was theoretically to be filled exclusively with path-data, you would be able to define the path-data for up to 284 nodes, which would average 35 nodes per world, which is more than enough! |
MeroMero |
Posted on 06-18-16, 04:53 pm in Misc. patches thread
|
Death by cuteness
Karma: 6589 Posts: 412/598 Since: 05-01-13 |
Not content with my latest code, I decided to upgrade the mod so that you no longer have to use Sprite 231 (Water):
Wavy backgrounds: repl_020B181C_ov_00:
MOV R10, #0 @Assigns a value of 0 to R10
BX LR @Returns
repl_0215E9E8_ov_36:
STMFD SP!,{R1-R3,R12,LR} @Pushs R1, R2, R3, R12 and R14 in the stack
STR R0, [R4] @Stores the Level Actor
BL 0x20B163C @Calls the function that allows the backgrounds to move in a wavy fashion
LDMFD SP!,{R1-R3,R12,PC} @Pops R1, R2, R3, R12 and R15 from the stack For those who are not familiar with the ASM-Template: _In Notepad++, create a new file _Copy/paste the code above _Save the file with an extension .s (for example wavebg.s) _The file must be located in the Source folder of the ASM-template _In NSMBe, click 'Run make and insert' You can also read this thread that explain what is the ASM-template and how to use it: http://nsmbhd.net/thread/1281-how-asm-hacks-are-setup-tutorial/ If someone wants the code without having to use the ASM-Template, I can post it too. |
MeroMero |
Posted on 06-21-16, 11:08 pm in No freezing during power-up/-down animation hack (rev. 10 by MeroMero on 07-31-16, 12:42 pm)
|
Death by cuteness
Karma: 6589 Posts: 415/598 Since: 05-01-13 |
repl_0209DC30_ov_00:
BX LR @Prevent almost all Actors from freezing upon level completion
repl_0218EAB8_ov_76:
BX LR @Prevent Actor 210 (Carry-through-wall platform) from pausing the remaining actors
repl_0218E6F8_ov_76:
LDR R1, =0x20CA880
MOV R2, #0
STRB R2, [R1, #0x18] @Prevent the timer from pausing when Actor 210 is acting
ADD R1, R4, #0x500
BX LR
repl_0211FDDC_ov_0A:
MOV R1, #1
STRB R1, [R0] @Prevent particles from being frozen on power-change (on load)
MOV R1, #0x28
BX LR
repl_021207F4_ov_0A:
MOV R1, #1
STRB R1, [R0] @Prevent particles from being frozen on death
ADD SP, SP, #4
BX LR
repl_0211F904_ov_0A:
STMFD SP!, {LR}
BL .CheckLevelClear
LDMEQFD SP!, {PC} @If the level is cleared this patch will prevent a glitch when Mega
LDR R4, =0x203A784
LDR R4, [R4]
LDR R4, [R4, #0x2F8]
ADD R4, R4, #0x760
LDR R1, [R4, #0x4C]
CMP R1, #0 @Check if a power change is happening
ADDEQ PC, PC, #0x1C @If not return
LDR R1, [R4, #8]
CMP R1, #0x2000 @Check if Mario is above his Super height (Mega)
MOVGT R1, #0x2000
STRGT R1, [R4, #8] @If he is make him 'Super Mario' height instantly
MOVGT R1, #0
STRGT R1, [R4, #0x4C] @Prevent flagpole-stalling when Mega-Mario powers down (this one may be not needed)
ADDGT R4, R4, #0x400
STRGTB R1, [R4, #0x57] @Prevent flagpole-stalling when Mega-Mario powers down (this one is a must)
LDMFD SP!, {PC}
repl_0211F974_ov_0A:
STMFD SP!, {LR}
LDR R0, =0x203CF80
MOV R4, #1
STRB R4, [R0] @Prevent particles from being paused on power-change (afterwards)
BL .CheckLevelClear
LDMEQFD SP!, {PC}
LDR R4, =0x203A784
LDR R4, [R4]
LDR R4, [R4, #0x2F8]
ADD R4, R4, #0x760
MOV R1, #0
STR R1, [R4, #0x4C] @Drop power-change 2nd phase remaining frames to 0
ADD R4, R4, #0x400
STRB R1, [R4, #0x57] @Drop power-change 1st phase remaining frames to 0
LDMFD SP!, {PC}
repl_0211F92C_ov_0A:
repl_021207B8_ov_0A:
MOV R0, #0
BX LR
repl_0212C13C_ov_0B:
MOV R1, #0
BX LR
.CheckLevelClear:
STMFD SP!, {LR}
LDR R0, [R0]
LDR R4, =0x20CA2C0
LDR R4, [R4]
CMP R4, #0 @Check if level is not cleared (flag is 0x100 when the level is completed)
MOVEQ R0, #0 @If true then apply the no-freeze patch
LDMFD SP!, {PC} |
MeroMero |
Posted on 06-24-16, 08:12 pm in Misc. patches thread (rev. 2 by MeroMero on 06-27-16, 10:49 am)
|
Death by cuteness
Karma: 6589 Posts: 426/598 Since: 05-01-13 |
Pipe fix for ASM-Template:
nsub_021175B0_ov_0A:
MOV R12, LR @Center Mario upon entering a vertical pipe
MOV R2, R12
CMP R3, R12
BLT 0x21175C0
B 0x21175E4
repl_0211D0A4_ov_0A:
STMFD SP!, {R0,LR}
ADD R1, PC, #0x30
ADD LR, PC, #0
BX R1
LDR R1, [R5, #0x64]
ADD R1, R1, R0 @Begin level from pipe at Start or Midway
STR R1, [R5, #0x64]
LDMFD SP!, {R0,PC}
repl_021189F8_ov_0A:
STMFD SP!, {LR}
ADD R1, PC, #0x10
ADD LR, PC, #0
BX R1
LDR R1, [SP, #0x10]
ADD R1, R1, R0 @Load new area from pipe entrance
LDMFD SP!, {PC}
@relative function:
STMFD SP!, {LR}
LDR R0, =0x20CA8FE
LDRB R1, [R0] @Load current entrance (not always equal to Entrance ID) from placeholder entrance
MOV R0, #0x14
MUL R1, R0, R1
LDR R0, =0x208B144
LDR R0, [R0, #0x38]
ADD R0, R0, R1
LDRB R1, [R0, #0xE]
MOV R0, #0
CMP R1, #5 @Check if entrance is from left pipe
ADDEQ PC, PC, #0x20
CMP R1, #6 @Check if entrance is from right pipe
ADDEQ PC, PC, #0x18
CMP R1, #0x12 @Check if entrance is from left mini-pipe
ADDEQ PC, PC, #0x10
CMP R1, #0x13 @Check if entrance is from right mini-pipe
ADDEQ PC, PC, #8
CMP R1, #0x18 @Check if entrance is from left connected mini-pipe
ADDEQ PC, PC, #0
CMP R1, #0x19 @Check if entrance is from right connected mini-pipe
MOVEQ R0, #0x2000 @If one of the 6 conditions is true, elevate Mario by 1/8th of a tile
LDMFD SP!, {PC}
repl_0215E8E0_ov_36:
LDRB R1, [R0, #8]
LDR R2, =0x2085A30
LDRB R2, [R2]
CMP R2, #0xFF @Check if midway is set
LDRNEB R1, [R0, #9] @If yes then later overwrite Start entrance with Midway entrance
BX LR
repl_0201E998:
LDR R12, =0x208B090
LDRB R9, [R4, #0xF]
TST R9, #8 @Check if Connected Pipe flag is set
LDRNEB R9, [R4, #0xA] @If true then load Connected Pipe ID for this entrance
MOVEQ R9, #0 @Else force Connected Pipe ID checker to 0
STR R9, [R12] @Write Connected Pipe ID for easier Pipe ID checking (Mostly to write a Pipe ID of 0)
LDR R12, =0x20CA8FE
STRB R3, [R12] @Set placeholder entrance for easier entrance checking upon entry
LDRH R9, [R4]
BX LR
repl_0201E668:
LDR R3, =0x20CA8FE
STRB R2, [R3] @Set placeholder entrance for easier entrance checking upon exit
MOV R2, #0
BX LR
repl_02117308_ov_0A:
STMFD SP!, {R0,LR}
LDRH R0, [R7, #0xE]
AND R0, R0, #1
CMP R0, #1 @Check if the connected pipe exit is facing right or left
MOVEQ R0, #0x2000 @If true elevate Mario by 1/8th of a tile
ADDEQ R3, R3, R0
STR R3, [R6, #0x64]
CMP R4, #1
LDMFD SP!, {R0,PC}
nsub_0211761C_ov_0A:
ADD R2, R0, #0x700
LDRB R3, [R2, #0xB2]
CMP R3, #2 @Check if Mario goes inside a Pipe Cannon or World-Cannon
ADDEQ PC, PC, #0x64 @If true return
ADD R2, R2, #0x400
LDRB R2, [R2, #0xAD]
CMP R2, #1 @Check if Mario is not (completely) inside a pipe
ADDEQ PC, PC, #0xC @If true jump to main calculation
LDR R2, =0x208B090
LDRB R2, [R2]
CMP R2, #0 @Check if Connected Pipe ID is set
ADDNE PC, PC, #0x44 @If true return
LDR R2, =0x20CA8FE
LDRB R3, [R2] @Load current entrance from placeholder entrance
MOV R2, #0x14
MUL R3, R2, R3
LDR R2, =0x208B144
LDR R2, [R2, #0x38]
ADD R2, R2, R3
LDRB R3, [R2, #0xE]
LDRH R2, [R2, #2] @Get entrance vertical coordinate
CMP R3, #0x10 @Check if Mario is gunning for a Mini-Pipe
MOVGE R3, #0x10 @If true then add 16 to get bottom position
MOVLT R3, #0x20 @Else add 32
ADD R2, R2, R3 @Calculate Mario bottom vertical position
MOV R2, R2, LSL #0xC @Change the vertical value to the right format
RSB R2, R2, #0 @"
STR R2, [R0, #0x64] @Store Mario vertical position
MOV R3, #0x2000
STRH R3, [R0, #0x64] @Elevate further Mario by 1/8th of a tile
LDR R3, [R0, #0x930]
B 0x2117620 |
MeroMero |
Posted on 06-26-16, 05:45 pm in Misc. patches thread (rev. 3 by MeroMero on 06-26-16, 08:24 pm)
|
Death by cuteness
Karma: 6589 Posts: 431/598 Since: 05-01-13 |
Swooper fix for ASM-Template:
repl_0213C380_ov_1B:
LDR R0, [R4, #8]
LDR R12, [R4, #0x60]
TST R0, #0x100 @Check if Shifting flag is set
SUBEQ R12, R12, #0x8000 @If yes then shift Swooper 1/2 tile to the right
STR R12, [R4, #0x60]
STR R12, [R4, #0x70]
BX LR
repl_0213C39C_ov_1B:
MOV R1, #0x10000 @Dynamically change hitbox data for Big Swooper
STR R1, [R2, #8]
STR R1, [R2, #0xC]
MOV R1, #0
STR R1, [R2, #4]
MOV R1, R4
BX LR
repl_0213C1DC_ov_1B:
LDR R3, [SP, #0xC]
TST R4, #1 @Check if Big flag is set
ADDEQ PC, PC, #0x64 @If not R4=0 then return
LDRH R4, [R5, #0xC4]
CMP R4, #0x100 @Check if Swooper began its 2nd phase
ADDNE PC, PC, #0x58 @If not R4=0 then return
LDR R4, [R5, #0xD4]
ADD R4, R4, #0x1000
CMP R4, #0x1000 @Check if current Swooper frame is one of the 16 allowed frames
ADDCS PC, PC, #0x48 @If greater than or equal (unsigned) then R4=0 and return
LDR R4, [R5, #0xD0]
CMP R4, #0 @Check if Swooper goes right or left
LDR R4, [R5, #0x134] @Load Hitbox Horizontal Shifting value
SUBLT R4, R4, #0x800 @If it goes left subtract 2048
ADDGT R4, R4, #0x800 @If it goes right add 2048
ADDGE PC, PC, #0x10
RSB R4, R4, #0
CMP R4, #0x8000 @Check if H.H.S. is less than -32768
MOVGE R4, #0x8000 @If true cap at -32768
RSB R4, R4, #0
ADD PC, PC, #4
CMP R4, #0x8000 @Check if H.H.S. is more than 32768
MOVGE R4, #0x8000 @If true cap at 32768
STR R4, [R5, #0x134] @Store H.H.S.
LDR R4, [R5, #0x138] @Load Hitbox Vertical Shifting value
ADD R4, R4, #0x1000 @Add 4096
CMP R4, #0x10000 @Check if H.V.S. is more than 65536
MOVGE R4, #0x10000 @If true cap at 65536
STR R4, [R5, #0x138] @Store H.V.S.
MOV R4, #0
BX LR @Return Actor data: Nybble 9 (NEW): Shift 1/2 tile to the right if value is odd. Nybble 11: Double Swooper length, height and width if value is 1. 2. Regular switch w/Bowser Battle 5. Balloon Boo "Normal Boo" mode hitbox |
MeroMero |
Posted on 07-01-16, 05:22 pm in asm Title logo with 256 colors (rev. 4 by MeroMero on 07-01-16, 07:54 pm)
|
Death by cuteness
Karma: 6589 Posts: 443/598 Since: 05-01-13 |
Posted by skawo This is rather neat. Too bad it removes the copyright, though :l Code updated. Now you have enough tiles to cover the whole screen! |
MeroMero |
Posted on 07-07-16, 11:51 am in Misc. patches thread (rev. 2 by MeroMero on 07-15-16, 10:04 am)
|
Death by cuteness
Karma: 6589 Posts: 456/598 Since: 05-01-13 |
Bouncing Bricks fix for ASM-template:
repl_021857E4_ov_63:
MOV R11, #0x180 @Expansion speed coefficient (originally 0x400)
BX LR Posted by TruelyJohn64 Posted by Pedroalone Grounded fire piranha plants can't be killed with shells. How about trying to fix this one? You've pretty much covered the entire game at this rate. Now that the Bouncing Bricks fix was cleared from the queue, I can have a go on this one. Some other things worth looking at: _Mini-Mushroom can go into 1/2 tile wide gaps (already know where to go, just need to put it in ASM format) _Spinies and Buzzybeetles CAN'T go into 1/2 tile wide gaps (not tampered with yet) |
MeroMero |
Posted on 07-09-16, 12:37 pm in asm NSMBWii Jyotyu for "enemy" folder (rev. 5 by MeroMero on 07-28-16, 09:47 pm)
|
Death by cuteness
Karma: 6589 Posts: 459/598 Since: 05-01-13 |
Remember this: http://nsmbhd.net/post/49223/ ?
Plot twist: this was only the first part of the update! Now here is the second and final part of the update, which required ASM, hence why I didn't include it all in one go! Also the Blockhopper camouflage ASM Hack was merged with this one. The code also handles the Bouncing Bricks. Due to some files needing to be modified, just download the patch in this post, which includes this thread ASM-Hack! Enemy folder Jyotyu tiles: repl_0215B658_ov_36: @Used Block
repl_0215D0FC_ov_36:
repl_02185E04_ov_62:
repl_02186F0C_ov_62:
MOV R2, #0
LDR R1, =0x208B170
LDR R1, [R1]
CMP R1, #0
BXEQ LR
LDRB R1, [R1, #2]
CMP R1, #0x4B
MOVHI R1, #0
LDR R3, =0x20C93B8
LDRB R3, [R3, R1]
MOV R3, R3, LSL #5
LDR R1, =0x2129368
LDRH R1, [R1]
ADD R1, R1, R3
ADD R3, R0, #0x160
STRH R1, [R3]
BX LR
repl_0215B620_ov_36: @Flying Block
repl_0215B6C8_ov_36:
repl_02185DD4_ov_62: @Hanging Bouncing Block
repl_0218641C_ov_62:
repl_02186EDC_ov_62: @Hanging Block
repl_02187794_ov_62:
STMFD SP!, {R1-R2, LR}
LDR R0, =0x1052 @File ID 4309
BL .Hatena
LDMFD SP!, {R1-R2, PC}
repl_0215B5E0_ov_36: @Flying Block
repl_0215B6A4_ov_36:
repl_0215D04C_ov_36: @Red Flying Block
repl_0215D150_ov_36:
STMFD SP!, {R1-R2, LR}
LDR R0, =0x1056 @File ID 4313
BL .Hatena
LDMFD SP!, {R1-R2, PC}
repl_021856F0_ov_63: @Bouncing Bricks
repl_02185C74_ov_63:
STMFD SP!, {R1-R2, LR}
LDR R0, =0x105A
BL .Hatena
LDMFD SP!, {R1-R2, PC}
.Hatena:
STMFD SP!, {LR}
LDR R1, =0x208B170
LDR R1, [R1]
CMP R1, #0
LDMEQFD SP!, {PC}
LDRB R1, [R1, #2]
CMP R1, #0x4B
MOVHI R1, #0
LDR R2, =0x20C93B8
LDRB R2, [R2, R1]
ADD R0, R0, R2
LDMFD SP!, {PC}
repl_020BAA54_ov_00: @Blockhopper
STMFD SP!, {R1-R4}
LDR R2, =0x50E
BL .Camouflage
LDR R2, =0x511
BL .Camouflage
LDMFD SP!, {R1-R4, PC}
.Camouflage:
STMFD SP!, {LR}
LDR R1, =0x2087620
MOV R3, #0
.LoopCamouflage1:
LDRH R4, [R1]
CMP R4, R2
BEQ .SuccessLoopCamouflage1
SUB R1, R1, #0x18
ADD R3, R3, #1
CMP R3, #0x100
BCC .LoopCamouflage1
LDMFD SP!, {PC}
.SuccessLoopCamouflage1:
LDR R4, [R1, #0xC]
ADD R4, R4, #0x8A
MOV R1, R0, LSL #1
MOV R3, #0
.LoopCamouflage2:
AND R2, R3, #1
ADD R2, R2, R1
ADD R2, R2, #0x31
STRB R2, [R4], #0x10
ADD R3, R3, #1
CMP R3, #4
BCC .LoopCamouflage2
LDMFD SP!, {PC} |
MeroMero |
Posted on 07-15-16, 09:55 pm in Misc. patches thread (rev. 4 by MeroMero on 08-02-16, 02:29 pm)
|
Death by cuteness
Karma: 6589 Posts: 469/598 Since: 05-01-13 |
Posted by KingYoshi A hack that makes it possible to set the Snake Blocks to act like they do in NSMB2 (not waiting for Mario to move and repeating the path) would be cool Posted by hamza62240
I was also wondering, could you do something like make snake blocks slippery? Obligatory upgraded download link on this post! (Ice) Snake Blocks upgrade for ASM-template: repl_0218C560_ov_6D:
LDR R0, =0x5FC @Increase heap for Snake Blocks
BX LR
repl_0218A510_ov_6D:
LDR R3, [R4, #8] @Load Actor Data into R3
ANDS R3, R3, #1 @Check Nybble 11 Bit 0
LDREQ R1, =0x218C600 @If not set then Snake Blocks move on their own
LDMIA R1, {R1, R2}
BX LR
repl_02189A84_ov_6D:
LDR R1, [R4, #8] @Load Actor Data into R1
ANDS R1, R1, #2 @Check Nybble 11 Bit 1
LDRNE R0, =IceSnakeBlocks @If set then load the Ice Snake Blocks graphics
ADD R1, R3, #0x8000
BX LR
repl_02189AF8_ov_6D:
LDR R1, [R6, #8] @Load Actor Data into R1
ANDS R1, R1, #2 @Check Nybble 11 Bit 1
LDRNE R0, =IceSnakeBlocks @If set then load the Ice Snake Blocks graphics
ADD R1, R3, #0x8000
BX LR
repl_02189FE8_ov_6D:
MOV R6, #0xD @Get pointer for Snake Block jyotyu map16
LDR R3, [R4, #8] @Load Actor Data into R3
ANDS R3, R3, #2 @Check Nybble 11 Bit 1
MOVNE R6, #0x85 @If set then get pointer for Ice Snake Block jyotyu map16
BX LR
repl_0218B488_ov_6D:
repl_0218B4DC_ov_6D:
LDR R1, [R4, #8] @Load Actor Data into R1
ANDS R1, R1, #2 @Check Nybble 11 Bit 1
MOVNE R3, #0x85 @If set then get pointer for Ice Snake Block jyotyu map16
MOV R1, R12, LSL #4
BX LR
repl_0218A3B8_ov_6D: @First step to allow looping
AND R2, R1, #7
CMP R2, #5
MOVEQ R2, #0
BX LR
repl_02189CD8_ov_6D: @Second step to allow looping
ADD R2, R2, R3
CMP R1, #1
ADDEQ R12, R2, #1
STREQ R12, [R5, #0x5F4] @Store Snake Block head position on node 1
LDREQB R12, [R5, #0x3F4]
SUBEQ R12, R2, R12
STREQ R12, [R5, #0x5F8] @Store Snake Block tail position on node 1
BX LR
repl_0218B5C8_ov_6D: @Main function for looping
LDR R0, [R5, #8]
MOV R0, R0, LSR #0x1C
AND R0, R0, #7
CMP R0, #5 @Allow looping only if Nybble 4 value is 5 or 13 (0xD)
BNE .Return
LDR R0, [R5, #0x4D0]
LDR R4, [R5, #0x4D4]
CMP R4, R0
LDRHI R4, [R5, #0x5F4]
STRHI R4, [R5, #0x4D4]
LDR R0, [R5, #0x578]
LDR R4, [R5, #0x57C]
CMP R4, R0
LDRHI R4, [R5, #0x5F8]
STRHI R4, [R5, #0x57C]
.Return:
MOV R0, #1
LDMFD SP!, {R4, PC}
nsub_0218A410_ov_6D:
AND R1, R1, #3
CMP R1, #0
MOVEQ R1, #0x1000 @Default speed is still value 0
CMP R1, #1
MOVEQ R1, #0x800 @Half speed is still value 1
CMP R1, #2
MOVEQ R1, #0x400 @NEW: Quarter speed is value 2
CMP R1, #3
MOVEQ R1, #0x2000 @NEW: Double speed is value 3
CMP R1, #0x400 @Error handler: Check if speed has been set
MOVCC R1, #0x1000 @If not set to default speed
B 0x218A418
.data
.balign 4
IceSnakeBlocks:
.word 0x41F820F8
.word 0xFFFF1102 How to use the new parameters? _Nybble 11 = 0 > Normal Snake Blocks + move on their own _Nybble 11 = 1 > Normal Snake Blocks + Mario must trigger them _Nybble 11 = 2 > Ice Snake Blocks + move on their own _Nybble 11 = 3 > Ice Snake Blocks + Mario must trigger them Modulo 4 Also the Ice Snake Blocks are slippery! 2 conditions to use the looping: _First set nybble 4 to 5 or D. _Second when creating the Path for the (Ice) Snake Blocks, the penultimate node must be at the same place than node 0, and the last node must be at the same place than node 1. Nybble 5 (speed) has been improved: _0 > Default speed _1 > Half speed _2 > Quarter speed _3 > Double speed modulo 4 Works on a NDS. |
MeroMero |
Posted on 07-22-16, 07:28 pm in Level Previews (rev. 2 by MeroMero on 07-22-16, 07:32 pm)
|
Death by cuteness
Karma: 6589 Posts: 481/598 Since: 05-01-13 |
Awesome sauce, this is where you realize that Nintendo could have made an even better game if they bothered to put an additional effort, though I won't deny that for its time it was enjoyable.
|
MeroMero |
Posted on 08-01-16, 02:55 pm in Misc. patches thread (rev. 1 by MeroMero on 08-01-16, 02:59 pm)
|
Death by cuteness
Karma: 6589 Posts: 509/598 Since: 05-01-13 |
I hope you don't mind me improving the Red Ring code, skawo.
This incarnation doesn't need to add nor replace a file. It instead reads directly the value in nybble 11, multiplied by 4 and then the result is added to offset 0x7C from obj_e3_ring.nsbtp to get the right palette. Improved Red Ring colors (updated from Skawo's code): repl_02153110_ov_36:
LDRH R0, [R4, #0xC]
CMP R0, #0x97
BNE .Return
LDR R0, [R4, #8]
AND R0, R0, #3
ADD R0, R0, #1
LDR R1, =RedRingStack
STRB R0, [R1]
.Return:
ADD R0, R4, #0x3F4
BX LR
repl_02153124_ov_36:
MOV R0, #0
LDR R1, =RedRingStack
STRB R0, [R1]
LDR R1, =0x20391F8
BX LR
repl_0205A6E0:
LDR R4, =RedRingStack
LDRB R5, [R4]
CMP R5, #0
BEQ .Return2
SUB R2, R5, #1
MOV R5, #0
STRB R5, [R4]
.Return2:
ADD R0, R3, R2, LSL #2
BX LR
.data
.balign 1
RedRingStack:
.byte 0x0 How to use? Nybble 11: _0: blue, white & purple _1: red _2: green _3: red & green modulo 4 |
MeroMero |
Posted on 08-22-16, 03:47 pm in New Actor discoveries (and extra info on old ones) (rev. 1 by MeroMero on 08-22-16, 03:49 pm)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Death by cuteness
Karma: 6589 Posts: 550/598 Since: 05-01-13 |
Thanks to the nsmb ida database, I compiled the list of all Actors with their corresponding overlays, and thus by proxy their corresponding SpriteSet(s).
For the curious ones, this table is located at offset 0x3997C in the arm9. This was done to get the remaining actors ID that could be useful.
|
MeroMero |
Posted on 08-30-16, 03:37 pm in Misc. patches thread
|
Death by cuteness
Karma: 6589 Posts: 568/598 Since: 05-01-13 |
Choose which Actors to spare on Level completion:
repl_0209DF5C_ov_00:
STMFD SP!, {R0-R1, R5, LR}
STRB R3, [R4, #0x3E7]
MOV R0, R7, LSR #3
MOV R1, R0, LSL #3
SUB R1, R7, R1
MOV R5, #1
.Division:
CMP R1, #0
BEQ .ResultDivision
MOV R5, R5, LSL #1
SUB R1, R1, #1
B .Division
.ResultDivision:
LDR R1, =ActorSpare
LDRB R1, [R1, R0]
TST R1, R5
BEQ .Return
MOV R2, #1
.Return:
LDMFD SP!, {R0-R1, R5, PC}
.data
.balign 1
ActorSpare:
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00100000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000
.byte 0b00000000 This ASM hack is read before the special cases, so Actors that weren't destroyed to begin with won't get destroyed regardless of their bit value. Apart from that, you can choose which Actor you want to spare. If you copy the ASM Hack on Notepad++, you'll see that the first .byte will be located on line 26. To know which bit matches which Actor, you'll have to use a simple Euclidean division: Actor Number / 8, which will net you the quotient and the remainder. To get the line where will be located the bit you want to change, simply add 26 to the quotient. Now if you look at the data, you'll see that they are in binary format, thus you only have to take into account the part after 0b. To get the bit you want to set (bit=1), you have to count (beginning from 0) from right to left until you find the bit number that matches the remainder (which should be a number between 0 and 7 inclusive). For example let's say Actor 77 (Signboards) mustn't be destroyed upon level completion. Calculation: 77 / 8 = 9 with a remainder of 5. Then 26 + 9 = 35, so go to line 35. Since the remainder is 5, change bit 5 of line 35 to 1. so 0b00000000 becomes 0b00100000 on line 35. Notice that Actor 77 is already set to 1 in this ASM Hack, this is because it will be needed for the next ASM Hack of mine, which is already done, thus I only need to post the thread. |
MeroMero |
Posted on 09-04-16, 02:19 pm in New NSMB Editor Builds!
|
Death by cuteness
Karma: 6589 Posts: 576/598 Since: 05-01-13 |
Uploading those 3 files as a fail-safe, just in case:
SpriteData.cs SpriteEditor.cs spritedata.xml I made the level editor read the Actor's graphics AND data associated to each of the 326 sprites, the 3 files above are what I modified to achieve that. Now the only thing I have to do is make the Level Editor read the Actor Data as bits. |
MeroMero |
Posted on 09-05-16, 06:26 pm in New NSMB Editor Builds!
|
Death by cuteness
Karma: 6589 Posts: 579/598 Since: 05-01-13 |
Posted by MarioKart7z I mean, the NSMBe mod that MeroMero included with the signboard ASM hack No, it doesn't… but I was savvy enough to keep the needed lines of code (albeit commented out) just in case. Posted by Hiccup actor sets Uh oh… you know, turns out the thing might really well be Sprite Sets afterall… remember this: Posted by MeroMero at offset 0x2C9EA replace 0F 01 into 00 00. Well the 0F 01 is actually the Sprite Set settings for Sprite 93, the first byte is a number between 0 and F inclusive (for a total of 16 Sets) and the second number is the sub-set. If the sub-set is 0, then the code will consider the Sprite Set check as a success regardless of the Sprite Set settings. The basic idea is that I needed to set Sprite 93 sub-set to 0, and this is because otherwise Actor 77 just wouldn't load after I ported it to arm9 unless the corresponding overlay was also loaded. tl;dr the Sprite Set needs to match both the Sprite and its associated Actor, else the Actor will fail to load. Also, forgot to say that the pull request on github was obviously updated. |
MeroMero |
Posted on 09-14-16, 02:07 pm in Misc. patches thread (rev. 2 by MeroMero on 09-14-16, 06:53 pm)
|
Death by cuteness
Karma: 6589 Posts: 582/598 Since: 05-01-13 |
Water, Lava and Poison Water fix for ASM-Template:
Shift up Y-position on start: Horizontal scrolling added for Junglekusa: repl_021657A4_ov_36:
CMP R7, #0x118
LDREQ R12, [R5, #0x60]
STREQ R12, [R5, #0x444]
LDR R12, [R2]
BX LR
repl_02165888_ov_36:
CMP R7, #0x118
MOVNE R0, R0, LSL #8
BXNE LR
ANDS R1, R0, #0x8000
EORNE R0, R0, #0x8000
RSBNE R0, R0, #0
BX LR
nsub_0216479C_ov_36:
STMFD SP!, {R1}
LDRH R1, [R0, #0xC]
CMP R1, #0x118
BEQ .Return
ANDS R4, R4, #0x2000
MOVEQ R1, #0
STREQ R1, [R0, #0x444]
.Return:
ANDS R4, R4, #0x2000
LDMFD SP!, {R1}
B 0x21647A0
nsub_02164810_ov_36:
STRLT R2, [R0, #0x60]
LDRH R4, [R0, #0xC]
CMP R4, #0x118
STREQ R5, [R0, #0x60]
B 0x2164814
nsub_02164934_ov_36:
LDRH R1, [R5, #0xC]
CMP R1, #0x118
BEQ 0x2164940
CMP R0, #0
B 0x2164938
nsub_0216494C_ov_36:
LDRH R4, [R5, #0xC]
CMP R4, #0x118
LDREQ R2, [R5, #0x458]
SUBNE R1, R1, R3
ADD R1, R2, R1
STREQ R1, [R5, #0x45C]
STRNE R1, [R0, #0xC74]
B 0x2164958
nsub_0216511C_ov_36:
LDRH R1, [R0, #0xC]
CMP R1, #0x118
LDREQ R3, [R0, #0x60]
LDREQ R2, [R0, #0x45C]
ADDEQ R2, R3, R2
STREQ R2, [R0, #0x444]
LDR R3, [R0, #0x64]
B 0x2165120
@Water, Lava and Poison Water fix when going down:
repl_02165024_ov_36:
LDR R0, [R4, #8]
ANDS R0, R0, #0x80 @Check Liquid direction
ADDEQ R1, R1, R2 @If up add R2 to get final position
SUBNE R1, R1, R2 @If down subtract R2 to get final position
MOV R0, #0x1000
ADD LR, LR, #4
BX LR
@Shift up Liquid vertical position on start:
repl_02165798_ov_36:
MOV R6, R4, LSL #8
MOV R6, R6, LSR #0x1D @Keep only the 3 first bits of nybble 7
MOV R6, R6, LSL #0xD @Multiply by 8192
ADD R12, R12, R6 @Add to Sprite position to get the final vertical position on start
STR R12, [R5, #0x64]
LDR R6, =0x20CAE0C
BX LR Affects nybbles 9 and 10: X-Speed: _from 0 (0x00) to 127 (0x7F) X-Scrolling: _leave X-Speed as-is to make Junglekusa scroll to the left (default) _add +128 (+0x80) to X-Speed to make Junglekusa scroll to the Right As you can see nybbles 9 and 10 mimic nybbles 11 and 12 (save for the axis). As for the Y-position on start: nybbles 7-8 for all 4 Actors: _leave those nybbles as-is to leave the Y-position on start as-is (default) _add 32 (0x20) to those nybbles to increase the Y-position on start up to 1/8 block _add 64 (0x40) to those nybbles to increase the Y-position on start up to 1/4 block _add 96 (0x60) to those nybbles to increase the Y-position on start up to 3/8 block _add 128 (0x80) to those nybbles to increase the Y-position on start up to 1/2 block _add 160 (0xA0) to those nybbles to increase the Y-position on start up to 5/8 block _add 192 (0xC0) to those nybbles to increase the Y-position on start up to 3/4 block _add 224 (0xE0) to those nybbles to increase the Y-position on start up to 7/8 block Works on a NDS. Posted by MarioKart7z
Overlay 0 I meant arm9, I edited the post. |
MeroMero |
Posted on 07-21-18, 12:03 pm in devkitPro Error.
|
Death by cuteness
Karma: 6589 Posts: 598/598 Since: 05-01-13 |
Didn't think I would post in nsmbhd again but… I got hit with this issue too and I found how to fix it.
At line 69 in the Makefile, you should see ASFLAGS := -g $(ARCH) Then replace $(ARCH) with -march=armv5te -mtune=arm946e-s and BLX instructions will be taken into account again. |
MeroMero |
Posted on 05-20-13, 04:32 pm in 24 levels (beta 4) New Super Mario Bros For Super Players
|
Death by cuteness
Karma: 6589 Posts: 14/598 Since: 05-01-13 |
Small update :
I managed to restore the lost stalagmite bottom bg in slot 36 without breaking the bottom bg in slot 35 (probably was done before ?), so this is how the fg 36 and bg 36 look when mixed together. I wonder why Nintendo staff (purposedly or not) made it so the slot 36 use the d_2d_I_M_back_chika3_ncg and not the d_2d_I_M_back_chika2_ncg like it supposedly should ? |
MeroMero |
Posted on 06-02-13, 08:27 am in Some notes on background HDMA (Scrolling animations)
|
Death by cuteness
Karma: 6589 Posts: 16/598 Since: 05-01-13 |
Nice stuff here
Though Nintendo did fail on this one. Let me explain, there's a way to break completely the HDMA (as in it won't work anymore until the next hardware boot). How to do ? _First you should have 2 DSes; _then you should play MvsL mode; _you should select at least one course; _once the course is loaded you can quit and come back to the menu screen; _now go back in single player mode and select a course which have an animated background; and you'll see that the background is not animated anymore ! And, depending on the background, it will break the scrolling too, making said background completely static to the camera ! |
MeroMero |
Posted on 08-29-13, 07:56 pm in 24 levels (beta 4) New Super Mario Bros For Super Players (rev. 1 by MeroMero on 08-29-13, 07:59 pm)
|
Death by cuteness
Karma: 6589 Posts: 24/598 Since: 05-01-13 |
A little update
5-1 and 5-B are done, increasing the total of complete levels to 24 out of 80. A bonus, all major bosses will have their difficulty increased by a fair amount (except Dry Bowser, I couldn't think of something smart that doesn't seem like a recycled idea). |