split Episode3::DataIndex into multiple structures

This commit is contained in:
Martin Michelsen
2023-08-13 23:12:27 -07:00
parent 7e55719983
commit 87118049ab
36 changed files with 416 additions and 328 deletions
+21 -13
View File
@@ -3,9 +3,10 @@
# The returned value has the format SSGGRRVV, where:
# S = 33 (which represents PSO GC)
# G = game (4F (O) = Episodes 1&2, 53 (S) = Episode 3)
# G = game (4F (O) = Ep1&2, 53 (S) = Ep3)
# R = region (45 (E), 4A (J), or 50 (P))
# V = minor version | 30 (30 = 1.00, 31 = 1.01, 32 = 1.02, etc.)
# V = minor version | 30 (30 = 1.00, 31 = 1.01, 32 = 1.02, etc.), or 54 for
# Trial Edition
# This results in a 4-character ASCII-printable version code which encodes all
# of the above information. This value is called specific_version in the places
# where it's used by the server.
@@ -19,16 +20,23 @@ reloc0:
start:
lis r3, 0x8000
lwz r4, [r3]
lbz r5, [r3 + 7]
li r3, -1
rlwinm r0, r4, 16, 16, 31
cmplwi r0, 0x4750
bnelr
lis r3, 0x3300
rlwimi r3, r4, 8, 8, 23
rlwimi r3, r5, 0, 24, 31
ori r3, r3, 0x0030
# For Trial Editions, set the V field to 54; for other versions, set it to
# 0x30 | disc_version
rlwinm r0, r4, 8, 24, 31
cmplwi r0, 0x47 # Check if high byte of game ID is 'G'
beq not_trial
cmplwi r0, 0x44 # Check if high byte of game ID is 'D'
beq is_trial
li r3, 0
blr
is_trial:
li r3, 0x0054
b end_trial_check
not_trial:
lbz r3, [r3 + 7]
ori r3, r3, 0x0030
end_trial_check:
oris r3, r3, 0x3300 # Set high byte ('3')
rlwimi r3, r4, 8, 8, 23 # Set middle two bytes to last to bytes of game ID
blr