diff options
Diffstat (limited to 'PE')
-rw-r--r-- | PE/pe-hack.lua | 58 |
1 files changed, 37 insertions, 21 deletions
diff --git a/PE/pe-hack.lua b/PE/pe-hack.lua index 0937a70..80bb494 100644 --- a/PE/pe-hack.lua +++ b/PE/pe-hack.lua @@ -1,24 +1,28 @@ -- Parasite Eve's french patch --- $Id: pe-hack.lua,v 1.9 2004-01-03 15:04:47 pixel Exp $ +-- $Id: pe-hack.lua,v 1.10 2004-01-26 15:31:55 pixel Exp $ function mainpatch() local dirent, slusdirent, pvd, root, is_cd1, is_cd2, slusname, fmvdir, systemcnfstring, inslus, slus, peimg, pesect, tim, startsect, slussect, fmvdirtree, xadirtree, falsesect, i, picts, pict - slusdirent = cdutil:findpath "/SLUS_006.62;1" or cdutil:findpath "/SLUS_006.68;1" or error "Not a Parasite Eve CD" +-- slusdirent = cdutil:findpath "/SLUS_006.62;1" or cdutil:findpath "/SLUS_006.68;1" or error "Not a US Parasite Eve CD" + slusdirent = cdutil:findpath "/SLUS_006.62;1" or cdutil:findpath "/SLUS_006.68;1" or error "Ce n'est pas un CD de Parasite Eve US" iso:foreword(cdutil) pvd = createpvd(cdutil) - print "Identifying CD..." +-- print "Identifying CD..." + print "Identification du CD..." if (slusdirent.id == "SLUS_006.62;1") then - print "CD is Parasite Eve CD1" +-- print "CD is Parasite Eve CD1" + print "CD1 de Parasite Eve" pvd.volid = "PE-FR-CD1" slusname = "PE-FR.CD1" fmvdir = "FMV1" is_cd1 = true is_cd2 = false else - print "CD is Parasite Eve CD2" +-- print "CD is Parasite Eve CD2" + print "CD2 de Parasite Eve" pvd.volid = "PE-FR-CD2" slusname = "PE-FR.CD2" fmvdir = "FMV2" @@ -34,15 +38,17 @@ function mainpatch() dirent = cdutil:findpath("/SYSTEM.CNF;1") iso:createfile(root, "SYSTEM.CNF", systemcnf, slusdirent) - print "Reading CD's slus file" - inslus = cdfile(cdutil, slusdirent) --- inslus = Input("PE-SLUS00662-patched-debug-room.exe") +-- print "Reading CD's slus file" + print "Lecture du fichier slus" +-- inslus = cdfile(cdutil, slusdirent) + inslus = Input("PE-SLUS00662-patched-debug-room.exe") slus = Buffer(true) slus:copyfrom(inslus) apply_hacks(slus_hacks, slus) slussect = iso:getdispsect() - print("Reserving space for SLUS file at sector " .. slussect) +-- print("Reserving space for SLUS file at sector " .. slussect) + print("Reservation d'espace pour le SLUS au sector " .. slussect) slus:seek(0) iso:createfile(root, slusname, slus, slusdirent):setbasicsxa() slus:seek(0) @@ -57,14 +63,17 @@ function mainpatch() tim = Buffer() peimg:copyto(tim, 0x23800) startsect = iso:createfile(root, "PE.TIM", tim, dirent).sector - print "Compiling IMG file" +-- print "Compiling IMG file" + print "Compilation du fichier IMG" do_img_file(slus, startsect, pesect) - print "Writing final main file" +-- print "Writing final main file" + print "Ecriture du fichier SLUS final" slus:seek(0) iso:putfile(slus, -1, slussect) - print "Copying FMV directory" +-- print "Copying FMV directory" + print "Copie du répertoire FMV..." dirent = cdutil:findpath("/" .. fmvdir) fmvdirtree = iso:createdir(root, fmvdir, 1, dirent) fmvdirtree:setbasicsxa() @@ -72,7 +81,8 @@ function mainpatch() iso:copydir(fmvdirtree, cdutil, dirent) if (is_cd2) then - print "Copying xastream directory" +-- print "Copying xastream directory" + print "Copie du répertoire xastream..." dirent = cdutil:findpath("/XASTREAM") xadirtree = iso:createdir(root, "XASTREAM", 1, dirent) xadirtree:setbasicsxa() @@ -80,7 +90,8 @@ function mainpatch() iso:copydir(xadirtree, cdutil, dirent) end - print "Finalizing CD" +-- print "Finalizing CD" + print "Finalisation du CD" iso:createfile(root, "README.TXT", Input("readme.txt")):setbasicsxa() iso:createfile(root, "DIVERS.HTM", Input("divers.htm")):setbasicsxa() picts = iso:createdir(root, "PICTS") @@ -100,7 +111,8 @@ end function do_img_file(slus, startsect, pesect) local i, j, sect1, tab1, sect2, tab2, sect3, tab3, sizes1, sizes2, sizes3, sect, file, file1, file2, file3, songsect, b1, b2, b3, b4, lastsect, s1, s2, s3, str = 0, 0, {}, {}, {}, {}, {}, {}, {}, {}, {} - print "Putting various files" +-- print "Putting various files" + print "Fichiers divers..." slus:seek(0x838da) for i = 1, 80, 1 do sect1[i] = slus:readU16() + pesect @@ -108,7 +120,6 @@ function do_img_file(slus, startsect, pesect) for i = 1, 79, 1 do if (files[i] ~= nil) then if (type(files[i]) == "string") then - print("Putting file " .. files[i] .. " instead"); file = Input(files[i]) else file = files[i](sect1[i], (sect1[i + 1] - sect1[i]) * 2048) @@ -118,12 +129,14 @@ function do_img_file(slus, startsect, pesect) end s1 = iso:putfile(file) tab1[i] = s1 - startsect - print("Putting file " .. i .. " from sector " .. sect1[i] .. " to sector " .. s1) +-- print("Putting file " .. i .. " from sector " .. sect1[i] .. " to sector " .. s1) + print("Ecriture du fichier " .. i .. "...") end tab1[80] = iso:getdispsect() - startsect songsect = tab1[80] - print "Putting musics" +-- print "Putting musics" + print "Les musiques" slus:seek(0x83980) for i = 1, 251, 1 do sect2[i] = slus:readU16() + sect1[80] @@ -137,12 +150,14 @@ function do_img_file(slus, startsect, pesect) s1 = iso:putfile(file) end tab2[i] = s1 - startsect - songsect - print("Putting music " .. i .. " from sector " .. sect2[i] .. " to sector " .. s1) +-- print("Putting music " .. i .. " from sector " .. sect2[i] .. " to sector " .. s1) + print("Ecriture de la musique " .. i .. "...") end tab2[251] = iso:getdispsect() - startsect - songsect - print "Putting rooms" +-- print "Putting rooms" + print "Les rooms" slus:seek(0x83b78) for i = 1, 438, 1 do sect3[i] = slus:readU32() + pesect @@ -184,7 +199,8 @@ function do_img_file(slus, startsect, pesect) end iso:putfile(file3) end - print("Putting room " .. i .. " from sector " .. sect3[i] .. " to sector " .. s1 + startsect) +-- print("Putting room " .. i .. " from sector " .. sect3[i] .. " to sector " .. s1 + startsect) + print("Ecriture de la room " .. i .. "...") tab3[i] = s1 sizes1[i] = s2 - s1 sizes2[i] = s3 - s2 |