Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 00300C10 # =============== S U B R O U T I N E =======================================
- .text:00300C10
- .text:00300C10
- .text:00300C10 _loadSaveSubsegmentUnknown: # CODE XREF: _loadSaveGame+120p
- .text:00300C10
- .text:00300C10 var_30 = -0x30
- .text:00300C10 var_28 = -0x28
- .text:00300C10 var_20 = -0x20
- .text:00300C10 var_18 = -0x18
- .text:00300C10 var_10 = -0x10
- .text:00300C10
- .text:00300C10 000 addiu $sp, -0x30
- .text:00300C14 030 sd $s1, 0x30+var_28($sp)
- .text:00300C18 030 sd $s0, 0x30+var_30($sp)
- .text:00300C1C 030 addiu $s1, $a0, 8
- .text:00300C20 030 sd $s3, 0x30+var_18($sp)
- .text:00300C24 030 sd $ra, 0x30+var_10($sp)
- .text:00300C28 030 sd $s2, 0x30+var_20($sp)
- .text:00300C2C 030 lw $a0, CTheScripts__pScriptSpace
- .text:00300C34 030 lw $s2, 0($s1) # __int32 s2 = *(__int32*)(*char*)a0 + 8
- .text:00300C38 030 addiu $s1, 4 # s1 = a0 + 12, pScriptSpace[0] is supposed to be equal to *(BYTE*)s1
- .text:00300C3C 030 lbu $v1, 0($a0) # char v1 = pScriptSpace[0];
- .text:00300C40 030 lbu $v0, 0($s1) # char s1 = *(char*)a0 + 0xC
- .text:00300C44 030 bnel $v1, $v0, SaveGameMismatch # branch if (v1 != v0)
- .text:00300C48 030 lui $a0, 0x3C
- .text:00300C4C 030 lbu $v1, a41m30m5mwarningWarningAnAttemptWasMadeToUseTheDe+0x54 # 0x6E ('n') value
- .text:00300C50 030 lbu $v0, 4($s1) # BYTE v0 = *(BYTE*)a0 + 16
- .text:00300C54 030 beq $v1, $v0, Process # branch if (v0 == 'n')
- .text:00300C58 030 lui $a0, 0x3C
- .text:00300C5C
- .text:00300C5C SaveGameMismatch: # CODE XREF: _loadSaveSubsegmentUnknown+34j
- .text:00300C5C 030 jal _ShowLoadingTextures
- .text:00300C60 030 addiu $a0, (aSaveGameM - 0x3C0000) # "\n======================================"...
- .text:00300C64 030 b return
- .text:00300C68 030 move $v0, $zero
- .text:00300C6C # ---------------------------------------------------------------------------
- .text:00300C6C
- .text:00300C6C Process: # CODE XREF: _loadSaveSubsegmentUnknown+44j
- .text:00300C6C 030 beqz $s2, returnTrue
- .text:00300C70 030 move $s0, $zero # s0 = 0
- .text:00300C74 030 li $s3, 0xFFFFFFFF # s3 = -1, index undefined
- .text:00300C78 Variables now:
- .text:00300C78 s0 = 0
- .text:00300C78 s3 = -1
- .text:00300C78 s1 = a0 + 12, pScriptSpace[0] is supposed to be equal to *(BYTE*)s1
- .text:00300C78 s2 = max offset of global variables, must have been loaded from save
- .text:00300C78
- .text:00300C78 loc_300C78: # CODE XREF: _loadSaveSubsegmentUnknown+BCj
- .text:00300C78 030 sltiu $v0, $s0, 8 # v0 = s0 < 8; example v0 = 4 < 8 = 1; v0 = 8 < 8 = 0;
- .text:00300C7C 030 bnez $v0, PutValueFromSave # v0 = &CTheScripts::pScriptSpace[s0]
- .text:00300C80 030 lw $v0, -0x7DFC($gp) # points to 0x3CF0F4 - CTheScripts::pScriptSpace
- .text:00300C84 Continue here only if s0 >= 8
- .text:00300C84 030 jal _getIndexOfVariableIDInSegmentOfSavedVariables # returned values with standard main.scm: (24) = 0, (28) = 1, (32) = 2...
- .text:00300C88 030 move $a0, $s0
- .text:00300C8C 030 beq $v0, $s3, PutZeroValue
- .text:00300C90 030 lw $v0, -0x7DFC($gp) # points to 0x3CF0F4 - CTheScripts::pScriptSpace
- .text:00300C94
- .text:00300C94 PutValueFromSave: # CODE XREF: _loadSaveSubsegmentUnknown+6Cj
- .text:00300C94 030 addu $v0, $s0 # v0 = &CTheScripts::pScriptSpace[s0]
- .text:00300C98 030 lwl $v1, 3($s1)
- .text:00300C9C 030 lwr $v1, 0($s1) # v1 = value from save
- .text:00300CA0 030 swl $v1, 3($v0)
- .text:00300CA4 030 b LoopContinue
- .text:00300CA8 030 swr $v1, 0($v0) # put value from save into MAIN.scm script space
- .text:00300CAC # ---------------------------------------------------------------------------
- .text:00300CAC
- .text:00300CAC PutZeroValue: # CODE XREF: _loadSaveSubsegmentUnknown+7Cj
- .text:00300CAC 030 lw $a0, CTheScripts__pScriptSpace
- .text:00300CB4 030 move $a1, $zero # value
- .text:00300CB8 030 li $a2, 4 # num
- .text:00300CBC 030 jal memset
- .text:00300CC0 030 addu $a0, $s0
- .text:00300CC4
- .text:00300CC4 LoopContinue: # CODE XREF: _loadSaveSubsegmentUnknown+94j
- .text:00300CC4 030 addiu $s0, 4
- .text:00300CC8 030 sltu $v0, $s0, $s2
- .text:00300CCC 030 bnez $v0, loc_300C78
- .text:00300CD0 030 addiu $s1, 4
- .text:00300CD4
- .text:00300CD4 returnTrue: # CODE XREF: _loadSaveSubsegmentUnknown:Processj
- .text:00300CD4 030 li $v0, 1
- .text:00300CD8
- .text:00300CD8 return: # CODE XREF: _loadSaveSubsegmentUnknown+54j
- .text:00300CD8 030 ld $s0, 0x30+var_30($sp)
- .text:00300CDC 030 ld $s1, 0x30+var_28($sp)
- .text:00300CE0 030 ld $s2, 0x30+var_20($sp)
- .text:00300CE4 030 ld $s3, 0x30+var_18($sp)
- .text:00300CE8 030 ld $ra, 0x30+var_10($sp)
- .text:00300CEC 030 jr $ra
- .text:00300CF0 030 addiu $sp, 0x30
- .text:00300CF0 # End of function _loadSaveSubsegmentUnknown
- .text:00300CF0
- .text:00300CF0 # ---------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement