***********************
* Skip Results Screen *
***********************
Skip Results Screen (v1.02) [Dan Salvato]
041b15cc 38800000
- good, simple
- doesn't work in Special Modes
inject @ 1a5b00 - addi r27,r4,0
- works for Vs. and Special Game Modes
- r27,r28 available
CODE_START:
#check for extra chars that freeze game at results screen
lis r28,0x8045
ori r28,r28,0x21f8 # 0xe90 from 80453084 - P1 slot type
li r30,0
CHAR_CHECK_LOOP:
lwzu r27,0xe90(r28) # load slot type
cmpwi r27,3
beq- LAST_PLAYER_CHECK
addi r30,r30,1 # increment active players
lwz r27,-0x4(r28) # load external char ID
cmpwi r27,0x1a # master hand or another extra char?
bge- SKIP
LAST_PLAYER_CHECK:
lis r27,0x8045
ori r27,r27,0x7958 # P6 slot type ID
cmpw r27,r28 # gone through all six players?
bne- CHAR_CHECK_LOOP
cmpwi r30,5 # 5 or more active players?
bge- SKIP
DEBUG_FLAG:
#lis r28,0x8040
#lwz r28,-0x5C2C(r28)# load skip results screen debug flag (3fa3d4)
#cmpwi r28,0 # is skip results screen off?
#beq- DEFAULT
SKIP:
#Do not add stars if not in Stock Mode
#check if in Stock Mode
lis r31,0x8046
ori r31,r31,0xb6a0
lbz r27,0x24c8(r31)
rlwinm r27,r27,27,29,31
subfic r27,r27,1
cntlzw r27,r27
rlwinm r31,r27,27,5,31
cmpwi r31,0 # r30=0=no, 1=yes
beq- SKIP_FINAL
li r31,0xff # register flag for no ragequit star, 0xff means not a ragequit
lis r27,0x8045
lwz r28,0x2c6c(r27) # load current camera type
cmpwi r28,1 # is current camera type pause (ragequit)?
bne- SKIP_STARS
lbz r31,0x2f2d(r27) # load player who paused
addi r31,r31,1 # get to this code's player increment type (1-index)
cmpwi r31,0x5
blt- SKIP_STARS
li r31,0xff
SKIP_STARS:
#modify stars as games won
#4D6730 = kO star count (1 byte per player)
#804D65A8 = placements during/after match (1 byte per player)
li r27,0 # initialize player counter
PLACEMENT_LOOP:
addi r27,r27,1 # increment player counter
cmpwi r27,5 # gone through all four players?
beq- SKIP_FINAL
lis r28,0x804d
ori r28,r28,0x65a7 # player placements address minus 1
lbzx r28,r28,r27
cmpwi r28,0 # is placement 0 = first place?
bne- PLACEMENT_LOOP
cmpw r27,r31 # did this player ragequit?
beq- PLACEMENT_LOOP
mulli r30,r27,0xe90
lis r28,0x8045
ori r28,r28,0x21f8 # 0xe90 from 80453088 = P1 type
lwzx r28,r28,r30
cmpwi r28,3 # is player not in game?
beq- PLACEMENT_LOOP
ADD_STARS:
lis r28,0x804d
ori r28,r28,0x672f # load KO stars address minus 1
lbzx r30,r28,r27 # load KO stars for this player
cmpwi r30,0xff # 255 stars already?
beq- PLACEMENT_LOOP
addi r30,r30,1 # add 1 to star count
stbx r30,r28,r27 # store new star count
b PLACEMENT_LOOP
SKIP_FINAL:
li r27,0 # CSS ID instead of Results Screen (0x4)
b END
DEFAULT:
#li r27,4 # default code line, Results Screen ID, use this line and not the next if using a Debug Menu flag
li r27,0 # new default code line, always skip results and load CSS ID
END: