Posted on 03-26-15, 10:22 pm in full hack in progress New Super Holiday Bros
Death by cuteness

Karma: 6564
Posts: 258/598
Since: 05-01-13
Hmmm… for me it makes more sense to leave the Power Star in front of the Pendulum.

I mean Mario, as well as the enemies who stand on the support, do appear in front of the rod, not behind so it would be weird to have the Power Star behind the Pendulum but that's just me.
Posted on 04-18-15, 05:30 pm in Export a SPA to a BMP
Death by cuteness

Karma: 6564
Posts: 287/598
Since: 05-01-13
Phew, I found the solution!
But first I'm going to explain what is going on for everyone there.



Explanation:

I remarked that turning palette 14 to all black did blacken the sand texture, but turning it to all white was turning it into a sort of yellow.
After thinking for a while I finally connected the dots: Color Multiplication!
Long things short, Color Multiplication is one way to blend 2 colors together, that's basically how it works:
_the algorithm multiplies both red values together and divides the result by 255, and does the same to the green and blue values.
_the result will always be a color with a darker tone (unless you multiply it with white).

What does it means?
If you multiply one given color by the color white (FFFFFF), which is the highest value you can multiply a color with, the color won't change.
If you multiply one given color by the color black (000000), which is the lowest value you can multiply a color with, the color will be all black.
The only way to get a white with the multiplication method is to blend the white with itself.


Back to NSMB:
A yellowish color did I say?
Yep, more precisely this color: #F8D800 (R=248, G=216, B=0)
So, we recapitulate:
This sand uses texture 8 as a base, texture 14 for the palette, then blends the palette with color F8D800.



The fix:

F8D800 is 7F03 in RGB555.
By searching the spa file, we can see 3 instances of 7F03 beginning at an even address within the particles:
_one at offset 0×09AE (particle 19)
_one at offset 0×0AA2 (particle 20)
_one at offset 0×0F6A (particle 30)

Particle 19 is for the sand that comes out when MummiPokey goes in and out the ground.
Particle 20 is for the trailing sand when MummiPokey fires its sand-ball from the mouth.
Particle 30 is for the sand that appears when the projectile impacts something.

The fix is simple, we're going to change F8D800 into F8F8F8 (since this is the max value allowed by the NDS).
F8F8F8 is FF7F in RGB555 (but FFFF works too).
Just change 7F03 into FFFF at offsets 0×09AE, 0×0AA2 and 0×0F6A and you're good to go.



Wait… the color blending still applies!

F8F8F8 multiplied with itself gives approximately F1F1F1, thus in NDS will be rendered as F0F0F0.
Well, 240 is close enough to 255 for the difference in lighting to be hardly perceptible for the human's eye.
Posted on 04-18-15, 07:31 pm in Export a SPA to a BMP
Death by cuteness

Karma: 6564
Posts: 288/598
Since: 05-01-13
Hey no problem haha, this is what communities are supposed to be for.
And also, being acknowledged by you is certainly a nice bonus, thank you for that.
Posted on 04-23-15, 04:16 pm in Music and area overflow (rev. 1 by  MeroMero on 04-23-15, 04:19 pm)
Death by cuteness

Karma: 6564
Posts: 299/598
Since: 05-01-13
It is generally assumed that when you want to overflow (or underflow) to an area, you can't use the same theme without said theme reloading itself.

This is partly true, however there is a way to circumvent this:
_If the area you want to load is not part of the current level, you can still use the same theme from the area Mario just left without having the music to reload IF and only IF the area you want to over/under-flow to is the first area of its original level.


For example:
_if you underflow from Level 5-1 Area 1 to Level 1-2 Area 2, the Grassland theme will restart;
_but if you underflow from Level 5-1 Area 1 to Level 2-2 Area 1 then the Grassland theme will continue without reloading.


I just wanted to clear that common, albeit not totally incorrect, misconception.
Posted on 04-25-15, 07:21 pm in implemented Line Platform Tile Behaviours not in NSMBe
Death by cuteness

Karma: 6564
Posts: 307/598
Since: 05-01-13
08: 2×1 Bottom Left to Top Right (leftmost) 09: 2×1 Bottom Left to Top Right (rightmost) 0A: 2×1 Top Left to Bottom Right (leftmost) 0B: 2×1 Top Left to Bottom Right (rightmost) 0C: 1×2 Bottom Left to Top Right (topmost) 0D: 1×2 Bottom Left to Top Right (bottommost) 0E: 1×2 Top Left to Bottom Right (bottommost) 0F: 1×2 Top Left to Bottom Right (topmost) 10: 1×1 Circle 11: 2×2 Circle Top Left 12: 2×2 Circle Top Right 13: 2×2 Circle Bottom Left 14: 2×2 Circle Bottom Right 15: 4×4 Circle Top Left 16: 4×4 Circle Top Left (topmost rightmost) 17: 4×4 Circle Top Right (topmost leftmost) 18: 4×4 Circle Top Right 19: 4×4 Circle Top Left (bottommost leftmost) 1A: 4×4 Circle Top Right (bottommost rightmost) 1B: 4×4 Circle Bottom Left (topmost leftmost) 1C: 4×4 Circle Bottom Right (topmost rightmost) 1D: 4×4 Circle Bottom Left 1E: 4×4 Circle Bottom Left (bottommost rightmost) 1F: 4×4 Circle Bottom Right (bottommost leftmost) 20: 4×4 Circle Bottom Right
Posted on 04-26-15, 03:55 pm in Misc. patches thread
Death by cuteness

Karma: 6564
Posts: 309/598
Since: 05-01-13
It does actually, hitting Mega Goomba 9 times while mini will KO it.
Posted on 05-01-15, 11:09 am in The single levels thread!
Death by cuteness

Karma: 6564
Posts: 320/598
Since: 05-01-13
Posted by Hiccup
Nice.
I bet this was unintended though? Just a side-effect or glitch/oversight?

Continue reading you might be interested


Simulate an earthquake with the Auto-Scroll sprite:

Use this Sprite Data:
00 00 00 81 00 PP

PP can be anything between 00 and FF, as long as it matches the Auto-Scroll Path ID.

When setting up the Path node, remember that:
_you want 2 nodes to keep things simple (more are possible though);
_you don't want Mario to get close the Auto-Scroll Path, so you must block the way with an immovable object large enough (a wall in this case).


And those are the values to put on Node 0:

Maximum shifting:
The maximum shifting is an infinite sequence of consecutive events consisting of 1 frame where the screen shifts to the left (even) and then 1 frame where it shifts back to its original position (odd).
The maximum shifting (in pixels) is calculated with this formula:

math.floor(Value1/4096)

4095 and below will round down to 0, making the set-up useless.
65535 is the maximum value, but 65535 is 1 number shy of 65536, the latter of which would have yielded a maximum shifting of 16 pixels; as such 61140 will suffice since the maximum shifting allowed is 15 pixels.


Beginning frame:
The beginning frame is the frame where the quaking begins when you gain full control of Mario after entering an area.
Considering first frame as frame 0, the beginning frame formula is:

2×[math.ceiling(4096/Value3)-1]

A value of 4096 and above will make the quaking begin immediately.


Quaking:
The quaking is what allows the Sprite 218 to emulate an earthquake.
It dictates by how much pixels the screen will shift for a given frame F, until the quaking hits its maximum value.
Considering first frame as F=0, progressive shifting (in pixels) is calculated as follows:

math.floor[(Value3×[1+math.floor(F/2)])/4096]

If Value3×[1+math.floor(F/2)] >= Value1, then rounds down to Value1.
If Value3 >= Value1, then the quaking will hit full force as soon as it begins.
Posted on 05-03-15, 12:11 pm in Sprite database overhaul
Death by cuteness

Karma: 6564
Posts: 324/598
Since: 05-01-13
Posted by Arceus
I'm always astonished again how much work you invest in this board or hacking in general o.O That's amazing.


As they say: "The best time to do those changes was 20 years ago, but the second best time is now."

The DB overhaul is something that should have been done looooooong ago, but hey at least it's there now.

It just happens to be the week-end, so I said: "Why the hell not?"
And the rest is history.

Posted by Arceus
(But there will be some stupid guys which will crash the system again because they don't think about their actions )

It would be boring though if everyone was smarter than average… oh wait
Posted on 05-05-15, 01:10 pm in Sprite database overhaul (rev. 2 by  MeroMero on 05-05-15, 01:40 pm)
Death by cuteness

Karma: 6564
Posts: 332/598
Since: 05-01-13
Posted by skawo
Well, I don't know about those, but it makes actually using the editor far more annoying


Maybe it's only me but I would take logic at the cost of practicality rather than the opposite.
I'm not saying my logic is the best, but I like to think my logic as something that tries its best at fulfilling the role of the middle ground that gap the bridge between the casuals and the specialists, if that makes any sense.


____________________



Here, everyone, have one more formula:

Pendulum starting position formula:



With:
_N5 being the value in nybble 5 (from 0 to 15);
_N6 being the value in nybble 6 (from 0 to 15);
_N7 being the value in nybble 7 (from 0 to 15).

If you don't multiply by 45/8192 what you will get instead is the actual value used by the game.
Multiplying by 45/8192 will convert that value in degrees (called α in the image below).


The line where the rod would be vertical (or in other words the moment where the speed would be maximal) is chosen as the reference for the angles.


Modulo 360 can be omitted since the sine function takes into account degrees values above 360.


Let's call the expression inside the brackets X.
If X=0, then the pendulum is standing at equilibrium point and is performing a right swing.
If 0<X<90, then the pendulum is performing a right swing and is on the right side of the equilibrium point.
If X=90, then the pendulum has completed the right swing and is about to begin the left swing.
If 90<X<180, then the pendulum is performing a left swing and is on the right side of the equilibrium point.
If X=180, then the pendulum is standing at equilibrium point and is performing a left swing.
If 180<X<270, then the pendulum is performing a left swing and is on the left side of the equilibrium point.
If X=270, then the pendulum has completed the left swing and is about to begin the right swing.
If 270<X<360, then the pendulum is performing a right swing and is on the left side of the equilibrium point.


This formula, mostly due to rounding, is at its worst 99.9% accurate (and nope, I didn't pull that number out of my ass).
Posted on 01-31-16, 11:42 am in NSMB Worldmap Editor
Death by cuteness

Karma: 6564
Posts: 338/598
Since: 05-01-13
Some explaining on what level held the secret exit that would have led to World 6-Cannon:


Path transparency on custom model:


See this post for the download link:
http://nsmbhd.net/post/46124/

It does include the World 6-Cannon.
Posted on 02-04-16, 07:46 pm in v3.1 Super Mario Bros. - The New Worlds
Death by cuteness

Karma: 6564
Posts: 343/598
Since: 05-01-13
Things I noticed so far in this new revision:
_W2-Tower doesn't play the victory theme.
_W3-Castle is set to begin at entrance 1 rather than entrance 0.
_W3-Castle doesn't play the victory theme.
_Mario does the moonwalk when walking the path south of 4-1.
_W7-Castle doesn't play the boss theme.


Fixes proposed:
_You can change the bottom background of W2-Tower from 6 to 65.

_Change W3-Castle Entry Point from entrance 1 to entrance 0. (No really, MeroMero?)

_I can see in NSMBe that overlay 0 is already decompressed, that's good because for the next fix you'll need to go to offset 0×2F0BC in said overlay.
The list of 14 numbers you see there are the authorized backgrounds by the game that load the bosses and victory theme.
Change the first 2D into 0B, this will allow W3-Castle to function optimally, assuming you keep the current backgrounds for this level.
Then change 3E into 32, this will allow W7-Castle to function optimally, assuming you keep the current backgrounds for this level.

_Look there for the 4-1 path fix: http://nsmbhd.net/post/37709/
You might also see new ASM hacks that could pique your interest.

_You might want to export the Sky Tower tileset from slot 38 to slot 58, since the latter goes unused in your hack.
This would allow you to put a red door in that tileset.



That's all for now, enjoy your birthday.
Posted on 02-05-16, 07:35 pm in Misc. patches thread
Death by cuteness

Karma: 6564
Posts: 345/598
Since: 05-01-13
Posted by KingYoshi
Lol, that seems like my ripped NSMBWii Desert BG.


https://www.youtube.com/watch?v=Yj5LaZszQe0
And?
I already heard you the first time.

Posted by Mariomaster
Sereously, this is amazing

Just wondering how that works (especialy how you do it in the editor).

Posted by Thierry
I also wonder how it works in the editor, and if there is any downside to this (not being able to hide the pipe or something).


Hmm… about time I spill the beans.
What I did is that I repurposed the Sprite 93 (Arrow signboard), which benefits my hack since the arrow signs were implemented in the jyotyu tileset.
I also created a new folder, called zyajirusi, which contains for now 32 files:
_4 top pipes,
_4 bottom pipes,
_4 left pipes,
_4 right pipes,
_8 horizontal pipes,
_7 vertical pipes,
_and 1 pipe joint.

But I will upgrade the pipes by adding 1 file to bring the total to 33 files, and:
_exporting the pipe joint to file 33,
_replace the 4 duplicates horizontal pipes by 4 joint pipes (horizontal in front),
_replace the 3 duplicates vertical pipes and the duplicate pipe joint by 4 joint pipes (vertical in front).

On top of that Sprite 93 is really nice since it also have a parameter to scale down the textures (hence the mini-pipes with exclusive colors).

Since that sprite doesn't have a collision on its own, I have to make the tileset behavior corresponding to the pipes for each category 1 tileset where I plan to use the pipes.
Due to that limitation, those "pipes" are set to be unbreakable.

But there were 2 slight problems:
_the first is that actually the textures of Actor 77 are actually rendered at ×1.125² of their expected size.
This was easily rectified by changing a MOV R0,#0×900 (09 0C A0 E3) into MOV R0,#0×800 (08 0C A0 E3)
and a MOV R0,#0×1200 (12 0C A0 E3) into MOV R0,#0×1000 (10 0C A0 E3) in overlay 12.
_the second is that once you clear a level the majority of the sprites are destroyed, including Sprite 93 (Actor 77).
The game first assigns the value 0×107 to R2 (on EUR version at least), and then that value is changed into 1 or 0 for the Actors that shouldn't be destroyed.
What happens afterwards is that the value is ANDed with 0×100 and if the result is not equal to 0, then the sprite is destroyed.
So I fixed this by doing an ASM hack that reads a list of 326 bits, and if the bit corresponding to the Actor is 1, then the value 0×107 is changed into 0×1.
Since this ASM hack is read before the special cases, Actors that weren't destroyed to begin with won't get destroyed regardless of their bit value.
Posted on 02-09-16, 12:24 pm in v3.1 Super Mario Bros. - The New Worlds
Death by cuteness

Karma: 6564
Posts: 348/598
Since: 05-01-13
Other things that didn't click on me earlier:

2-3
The secret exit uses the normal end-of-level castle.




7-Ghost House
There's a mistake on the flagpole base.




5-Castle



Problem: when reaching this section, you can take advantage of the way NSMB spawns the sprites.

With that I mean that you can position yourself close enough to spawn the Spiked Ball while at the same time being far enough to not spawn the Expandable blocks.
This is the fix I propose (you don't need to change the sprite data of the Spiked Ball).



Either that or you can place invisible solid unbreakable tiles where the expandable blocks are located.



There's also a thing concerning the mountain tileset, look:



It seems that some of the objects are only loosely planted to the ground.
My advice would be to use this tile directly under:



Which is what you did for some decorations in 7-5 for example.
So this goes for the flagpole, the end-of-level castle, the bushes, the arrow signboards, pipes, and other things I might forget.




That way it looks like those objects really are solidly planted to the ground
Posted on 02-09-16, 11:56 pm in Misc. patches thread (rev. 1 by  MeroMero on 02-09-16, 11:57 pm)
Death by cuteness

Karma: 6564
Posts: 349/598
Since: 05-01-13
Pipes were upgraded yet again:

This time all 8 variations make an appearance (some pipes were missing in the last revision).
4 Colors.
1 Pipe Joint.
The possibility to reduce the size of any of the 33 objects.
Higher layer priority.

This upgrade should be the last as far as the pipes are concerned.
Posted on 02-11-16, 08:06 am in Misc. patches thread (rev. 1 by  MeroMero on 09-14-16, 02:07 pm)
Death by cuteness

Karma: 6564
Posts: 351/598
Since: 05-01-13

Try to play Level 8-6 and you'll see that when you get out of the chimney, the volcanic clouds (or any other animated background that would be there instead for that matter) are not animated.
To fix this:
_decompress arm9;
_go to offset 0×3C94E (US) or 0×2C2F6 (EU);
_change 02 02 into 03 01.

What you have to keep in mind is that:
_if you want to go to Area 2 from Area 1, you'll have to put 4 as the Area number.
_if you want to go to Area 1 from Area 2, you'll have to put 3 as the Area number.

This is because the 2 bytes mentioned earlier are actually the number of areas for Levels 8-5 and 8-6 respectively.
Once you change those 2 numbers, what happens is that the game expects to load the only Area of Level 8-6 from area number 164 (163 in US), but is still loaded from Area 163 (162 in US) due to that information staying as-is in overlay 8, thus the Area count begins from Area 1 Level 8-5 rather than Area 1 Level 8-6.
Posted on 02-13-16, 03:47 pm in New Actor discoveries (and extra info on old ones) (rev. 1 by  MeroMero on 02-14-16, 12:54 pm)
Death by cuteness

Karma: 6564
Posts: 357/598
Since: 05-01-13
Child Actors internal Data when spawned by Parent Actors:



Flame Chomp (Actor 108) when spawned by its spawner (Actor 107)
00 00 00 00 00 00


Flame (Actor 109) when spawned by Flame Chomp (Actor 108)
00 00 00 00 00 00


Cork (Actor 203) when spawned by Corked Pipe (Actor 204)
00 00 00 00 00 00


Pump (Actor 205) when spawned by Corked Pipe (Actor 204)
00 00 00 00 00 00


Mini Blooper (Actor 146) when spawned by Blooper Nanny (Actor 145)
00 00 00 00 0F F0
00 00 00 00 0F F1
00 00 00 00 0F F2
00 00 00 00 0F F3


Snowball (Actor 156) when spawned by Snow Spike (Actor 155)
00 00 00 00 00 00


Spiny (Actor 40) when spawned by Lakithunder (Actor 129)
00 00 00 00 90 01


Thunder (Actor 97) when spawned by Lakithunder (Actor 129)
00 00 00 00 00 00


Bowser Jr. (Actor 113) when spawned by Final Boss Controller (Actor 116)
00 00 01 00 00 00


Big Bowser (Actor 133) when spawned by Final Boss Controller (Actor 116)
02 00 00 00 00 01


Fireball (Actor 78) when spawned by Bowser (Actor 131)
00 00 00 00 00 00


Fireball (Actor 78) when spawned by Dry Bowser (Actor 132)
00 00 10 00 00 00


Fireball (Actor 78) when spawned by Big Bowser (Actor 133)
00 00 20 00 10 01

00 00 20 09 E0 03
00 00 20 08 B8 03
00 00 20 07 97 03
00 00 20 06 68 03
00 00 20 05 40 03

00 00 20 00 00 02
00 00 20 00 00 01
00 00 20 00 01 02
Posted on 02-15-16, 04:09 pm in The single levels thread!
Death by cuteness

Karma: 6564
Posts: 360/598
Since: 05-01-13

This level will be available in the next beta.
Posted on 02-17-16, 06:13 pm in Misc. patches thread
Death by cuteness

Karma: 6564
Posts: 362/598
Since: 05-01-13

1. Giant Springboard Pickup

2. Regular switch w/Bowser Battle

3. Pipe-enter-off-moving-sprite CLEAR

4. Snow effect restart in the same area CLEAR

5. Balloon Boo "Normal Boo" mode hitbox

6. Giant Swooper's Disappearing Hitbox

7. Shell Mario Roll on D-Pad Down only CLEAR

8. Mini Mario behaves correctly on low gravity mode*


*My psychic abilities told me that in about 3 days from the moment I post this, you would have thought about low G mode.

Link updated in the footer for anyone who wants to have a taste of the new mechanics of Shell Mario.
Posted on 02-19-16, 08:34 pm in Misc. patches thread (rev. 1 by  MeroMero on 02-19-16, 09:04 pm)
Death by cuteness

Karma: 6564
Posts: 365/598
Since: 05-01-13
Blue Shell improved: (US)

_Decompress arm9
_Paste this at offset 0×2800
90 6A 1B 02 7C 71 1B 02 50 B3 08 02 44 E3 12 02 00 40 2D E9 1C 60 1F E5 18 70 1F E5 00 70 97 E5 00 00 57 E3 04 70 A0 13 40 00 00 EA 00 80 BD E8 C0 00 2D E9 F5 FF FF EB 06 00 51 E1 05 00 00 BA 00 00 50 E3 06 00 A0 B1 00 00 60 B2 06 00 A0 A1 C0 00 BD E8 66 3A 04 EA C0 00 BD E8 66 3A 04 EA C0 00 2D E9 E9 FF FF EB 00 00 50 E3 06 00 A0 B1 00 00 60 B2 06 00 A0 A1 C0 00 BD E8 9D 3E 04 EA C0 00 2D E9 E1 FF FF EB 00 00 50 E3 06 00 A0 B1 00 00 60 B2 06 00 A0 A1 C0 00 BD E8 38 3F 04 EA C0 00 2D E9 D9 FF FF EB 06 00 50 E1 01 00 00 AA C0 00 BD E8 21 4D 04 EA C0 00 BD E8 C0 00 1F E5 00 00 D0 E5 80 00 10 E3 F9 FF FF 0A 11 4D 04 EA C0 00 2D E9 D8 60 1F E5 00 60 D6 E5 80 00 16 E3 00 00 A0 03 80 00 80 12 00 00 50 E3 01 00 00 1A C0 00 BD E8 F9 3A 04 EA C4 FF FF EB 04 71 1F E5 00 10 97 E5 04 20 97 E5 02 00 51 E1 01 10 A0 03 00 10 A0 13 00 00 52 E3 00 60 66 B2 00 00 51 E3 00 60 87 15 04 60 87 E5 C0 00 BD E8 FD 3A 04 EA A0 61 96 E5 00 00 56 E3 00 70 A0 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 48 61 1F E5 07 60 96 E7 B4 FF FF EA 00 00 00 00 00 00 00 00 80 00 12 E3 80 00 80 12 00 00 50 E3 4A 3B 04 0A 2F 3B 04 EA C0 00 2D E9 A4 FF FF EB 06 10 A0 E1 C0 00 BD E8 BB 3B 04 EA



_Decompress overlay 10
At offset 0×44EFC replace 0B0B51E3 with 93C5FBEA
At offset 0×46008 replace 000050E3 with 5CC1FBEA
At offset 0×46294 replace 000050E3 with C1C0FBEA
At offset 0×49A34 replace 0B0B50E3 with E1B2FBEA
At offset 0×451F8 replace 000050E3 with FCC4FBEA
At offset 0×4534C replace 000050E3 with CBC4FBEA
At offset 0×45594 replace 0B1BA0E3 with 3EC4FBEA


Whenever I can I will port the pipes fix too, you still originally asked for it so I can't help but try my best to import the code.
Posted on 03-10-16, 03:06 pm in Misc. patches thread (rev. 1 by  MeroMero on 03-10-16, 03:14 pm)
Death by cuteness

Karma: 6564
Posts: 384/598
Since: 05-01-13
Slopes and Tight Rope can coexist (v2)


_Decompress arm9

US
_Paste this at offset 0×1C10
7F 00 C5 E5 E3 9F 02 EA

EU
_Paste this at offset 0×23D8
73 00 C5 E5 45 E6 02 EA


_Decompress Overlay 0

US
_Go to offset 0×11410 and replace 2C00000A with 4660FD0A

EU
_Go to offset 0×10CC0 and replace 2C00000A with E419FD0A


 skawo, can you please test the code on Newer Super Mario Bros DS?
I think the ASM-Template is not the (only) culprit, actually I suspect overlay 10 to have a hand in this as well and I want to see if my theory holds water.