Miscellaneous ASM Patches
#1
Share SM64 ASM patches here. If you'd like to include lengthy code in your posts please use [spoiler] tags. Armips code is preferred.
David liked this post
Reply
#2
ceiling invis walls fix

scale the game down/up (can be used to make giant levels without looking very off)
Reply
#3
I made the checkpoints into star coins. There are a bunch of NOPs at the end because Nintendo sucks at optimizing.
wenis
y-you too.
Reply
#4
code hook thing for armips

for compressed ROM (8mb one)



for extended rom (uncompressed)
what is wet and dry at the same time?


no its not his ass
its wet dry world

Reply
#5
Always have "Exit Course" option available in the pause menu
Reply
#6
plays music when Mario has 0 HP for armips

it stores a byte in 0x80373e80 but you can look at the code and change the location
run this once at start up
run this every frame
what is wet and dry at the same time?


no its not his ass
its wet dry world

Reply
#7
I converted a couple of Kaze's patches to armips earlier and thought they might be useful to others. I also fixed his collision optimization patch so that it doesn't rely on extended boundaries.
Other conversions may be added here later.
Reply
#8
disable hardcoded camera positions (apart from the level specific camera setting and the geo layout camera thing)


3baa0: beq r0, r0, ... this fixes the camera in DDD area 2.
3c2dc: beq r0, r0, ... this fixes hardcoded cam in area 2 in SSL
3b6c8: BEQ R0, R0, $0003B7EC fixes cam in BoB, WDW and THI
3d2bc: BEQ R0, R0, $0003D344 fixes cam in BBH, Inside castle and RR
3d9ac: BEQ R0, R0, $0003D9F8 fixes cam in BoB and WF
3e250: beq r0, r0, ... fixes cam in WDW
3e29c: beq r0, r0, $003E320 fixes cam in THI
3f800: BEQ R0, R0, $0003F81C fixes cam in SSL
3f874: BEQ R0, R0, $0003F8A4 fixes cam in SSL and Inside castle
3fc50: BEQ R0, R0, $0003FC94
42720: BEQ R0, R0, $0004284C foxes cam in CCM, SSL, SML, THI and TTM
46540: BEQ R0, R0, $00046644 fixes cam in ssl, ttc and lll
47328:BEQ R0, R0, $000473E0 fixes cam in BBH and inside castle
488a4: BEQ R0, R0, $00048910 fixes cam in inside castle and secret aquarium
4a218: BEQ R0, R0, $0004A5FC fixes cam in WDW, THI, TTC, DDD, WF, BBH, SSL, BoB
52c74: BEQ R0, R0, $00053024 fixes cam in LLL, DDD, WF, metal cap, TTM, CCM, aquarium
Reply
#9
here i've revisited my code hooker and changed it into something much more better

code
what is wet and dry at the same time?


no its not his ass
its wet dry world

Reply
#10
Here's a patch for testing the setsound function
https://github.com/shygoo/misc/blob/mast...ndtest.asm

[Image: 5d36fbf1224b1ce00a3be53fb1cc723c.png]

Code:
DPAD left, right -> select digit
DPAD up, down    -> edit digit
L                -> play sound
R -> toggle setsound/setmusic testing

Edit: updated to include music testing
Reply
#11
(03-27-2018, 11:32 PM)bacon_consumes_all Wrote: I made the checkpoints into star coins. There are a bunch of NOPs at the end because Nintendo sucks at optimizing.
wenis

Could you please make this into a .pff file?
Reply
#12
(10-06-2018, 05:25 PM)Super Watermelon 64 Wrote:
(03-27-2018, 11:32 PM)bacon_consumes_all Wrote: I made the checkpoints into star coins. There are a bunch of NOPs at the end because Nintendo sucks at optimizing.
wenis

Could you please make this into a .pff file?

1. It's called .ppf, not .pff
2. You can easily assemble this code with Armips GUI, you can find it here: https://github.com/DavidSM64/SimpleArmipsGui/releases 
All you have to do is load the rom and code, and press assemble.
Currently Making:
Super Mario Adrift - A mini hack of Super Mario 64 which I am making with the SM64 ROM Manager. Four 7 star levels are planned, and it will feature an improved camera, expanded soundbank, and at least 28 stars.
Reply
#13
Code:
// Increases max draw distance by making the far value from the geo layout 0xA command an unsigned value.  
// The max value you can use is 0xFF9C, since a higher value seems to create a weird visual glitch on console.

.orga 0x36D2C // RAM address 0x8027BD2C
lhu t1, 0x22(t7)

I've also included a tweak version of this patch as an attachment to this post.


Attached Files
.zip   IncreaseMaxDrawDistanceTweak.zip (Size: 352 bytes / Downloads: 102)
aglab2 liked this post
Reply
#14
81287aa4 1000 - freeze cam in pause screen

fix donut platforms:
313468, 313480, - nop
313570 - beq r0, r0

grap steep ledges
.orga 0x1A758
B 0x1A770
And that's why I'm giving away 2 Iphone - X's. Subscribe to my Youtube Channel and turn on notifications to enter!
Reply
#15
activate the yellow cap switch + have functional yellow box.

you'll have to import a different display list to the geo layout to have it be a different color

I changed it to use the moat draining eeprom byte as the save flag for it so pressing the switch will drain the moat in a vanilla rom


Attached Files
.txt   activate yellow cap.txt (Size: 584 bytes / Downloads: 100)
Reply
#16
Code:
811765b8 0c09
811765ba ea2c
811765bc 0000
811765be 0000
8127a8b0 27bd
8127a8b2 ffe8
8127a8b4 afbf
8127a8b6 0014
8127a8b8 3c08
8127a8ba 8034
8127a8bc 850a
8127a8be afa0
8127a8c0 8519
8127a8c2 b226
8127a8c4 1159
8127a8c6 0011
8127a8c8 314d
8127a8ca 0020
8127a8cc 15a0
8127a8ce 000c
8127a8d0 8509
8127a8d2 b22a
8127a8d4 314b
8127a8d6 c000
8127a8d8 1160
8127a8da 000c
8127a8dc 314f
8127a8de 4000
8127a8e0 15e0
8127a8e2 0002
8127a8e4 252c
8127a8e6 ffff
8127a8e8 252c
8127a8ea 0001
8127a8ec 0581
8127a8ee 0002
8127a8f0 a50a
8127a8f2 b226
8127a8f4 340c
8127a8f6 0045
8127a8f8 1000
8127a8fa 0004
8127a8fc a50c
8127a8fe b22a
8127a900 0120
8127a902 2825
8127a904 0c0c
8127a906 8151
8127a908 0000
8127a90a 2025
8127a90c 3c08
8127a90e 8034
8127a910 850a
8127a912 afa0
8127a914 1540
8127a916 0002
8127a918 3405
8127a91a 0030
8127a91c a500
8127a91e b226
8127a920 3c06
8127a922 8033
8127a924 34c6
8127a926 8388
8127a928 0c0b
8127a92a 58b6
8127a92c 8507
8127a92e b22a
8127a930 8fbf
8127a932 0014
8127a934 03e0
8127a936 0008
8127a938 27bd
8127a93a 0018
gs code that allows you to preview any music track in file select or the demo screen. A to go up a track, B to go down a track. L to play the music. Sound will die if you switch between two tracks that the game doesn't like
asm version attached


Attached Files
.txt   jukeboxcode.txt (Size: 766 bytes / Downloads: 49)
Reply
#17
fixes slopes, see video

https://www.youtube.com/watch?v=NbO67Mq7fTU

edit: original version only worked without ext boundaries, I have since made a new version for ext boundaries but I am not sure that all editor/rom manager versions use the same offset, so if it doesn't work you will have to go into your rom with debugger and look around 80381710 in ram. You will want to set the offset for the second .orga in the ext boundaries to match the line after the two add.s commands that appear in a row.


Attached Files
.txt   slope fix ext boundries.txt (Size: 692 bytes / Downloads: 45)
.txt   slope fix.txt (Size: 698 bytes / Downloads: 30)
Reply




Users browsing this thread: 1 Guest(s)