Randomized CC Online [TheNinjaKingOW]
#1
This code randomizes what CC the game chooses online, you must be the host of the room to have this code work. The code uses a simple C0 randomizer that changes the byte value every frame. 

NTSC-U:
c2659d7c 00000003
3d808000 618c01b0
8b8c0000 9b9d003f
60000000 00000000
c0000000 00000004
3d808000 896c01b0
396b0001 280b0004
41a00008 39600000
996c01b0 4e800020

PAL:
c2661CB8 00000003
3d808000 618c01b0
8b8c0000 9b9d003f
60000000 00000000
c0000000 00000004
3d808000 896c01b0
396b0001 280b0004
41a00008 39600000
996c01b0 4e800020

NTSC-J:
c2661324 00000003
3d808000 618c01b0
8b8c0000 9b9d003f
60000000 00000000
c0000000 00000004
3d808000 896c01b0
396b0001 280b0004
41a00008 39600000
996c01b0 4e800020

NTSC-K: 
c264FFD0 00000003
3d808000 618c01b0
8b8c0000 9b9d003f
60000000 00000000
c0000000 00000004
3d808000 896c01b0
396b0001 280b0004
41a00008 39600000
996c01b0 4e800020

Special thanks to XeR, Vega, and Seeky for Basic help

Code:
lis r12, 0x8000 <--- Randomizer with applied values
lbz r11, 0x01b0 (r12)

addi r11, r11, 1

cmplwi r11, 0x04
blt+ dont_reset

li r11, 0x0

dont_reset:
stb r11, 0x01b0 (r12)
Code:
loc_0x0:
  lis r12, 0x8000      } <---- Adds address of randomizer into r12
  ori r12, r12, 0x1B0  }
  lbz r28, 0(r12) <----- Takes byte from r12 and sets it in r28
  stb r28, 63(r29) <---- Stores byte from r28 to 63 + r29
~MarioKartWii.com #1~
Reply
#2
I plan on rewriting XeR's code so I could remove him from the main creator portion and give him credit instead.
~MarioKartWii.com #1~
Reply
#3
80002348 is not part of the unused exception vector area.

You need to use the randomizer and store the value to any desired vector unused area.

Then write source using the C2 address (xers codes) to load said value and apply it to change the CC value.

Keep trying, you're getting close. You will eventually have a 'lightbulb' moment and realize this ASM stuff is actually simple.
Reply
#4
Ok, so I should use part of the unused exception vector instead of just using wherever XeR put the main address, that doesn't seem to hard for a re-write but, I then don't understand why XeR used 8000234B.
~MarioKartWii.com #1~
Reply
#5
Xers code doesn't use the vector area at all. You're overthinking this.
Reply
#6
(01-20-2021, 04:15 PM)Vega Wrote: Xers code doesn't use the vector area at all. You're overthinking this.
Well, I can say that it does get copied over for whatever reason. So, the game is coping over those values, but are also putting it into the vector. But, you are right that it doesn't code it self doesnt
~MarioKartWii.com #1~
Reply
#7
Xers code originally just mods the value of a register before that register value gets stores in memory (via the default instruction).

Get the randomizer to store to the unused vectors.

Rewrite xers codes to add instructions to load from the vectors and use that value to store via the default instruction
Reply
#8
Update: Fixed my code so it uses the Exception Vector (https://mkwii.com/showthread.php?tid=1106). Also added a special thanks to XeR (had the main address of the CC host byte), Vega (helped me understand why not using the vector could cause issues), and Seeky (clarified a lot of my problems and confusion with one sentance).
~MarioKartWii.com #1~
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)