summaryrefslogtreecommitdiff
path: root/PE/pe-hack.lua
diff options
context:
space:
mode:
authorpixel <pixel>2004-01-03 15:04:46 +0000
committerpixel <pixel>2004-01-03 15:04:46 +0000
commita422d1dcda810b2f129a9a5213f3f4b440be4bbc (patch)
treea0735a7f3c61f398fc13a45466ded187904bbe21 /PE/pe-hack.lua
parent24ae6e6865351db7d3a9e58340e5a2684912544f (diff)
Highly started work on mips disassembler + various little fixes.
Diffstat (limited to 'PE/pe-hack.lua')
-rw-r--r--PE/pe-hack.lua73
1 files changed, 54 insertions, 19 deletions
diff --git a/PE/pe-hack.lua b/PE/pe-hack.lua
index 6e5965a..0937a70 100644
--- a/PE/pe-hack.lua
+++ b/PE/pe-hack.lua
@@ -1,5 +1,5 @@
-- Parasite Eve's french patch
--- $Id: pe-hack.lua,v 1.8 2003-12-28 13:07:52 pixel Exp $
+-- $Id: pe-hack.lua,v 1.9 2004-01-03 15:04:47 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
@@ -14,7 +14,6 @@ function mainpatch()
print "CD is Parasite Eve CD1"
pvd.volid = "PE-FR-CD1"
slusname = "PE-FR.CD1"
--- slusname = "SLUS_006.62"
fmvdir = "FMV1"
is_cd1 = true
is_cd2 = false
@@ -22,7 +21,6 @@ function mainpatch()
print "CD is Parasite Eve CD2"
pvd.volid = "PE-FR-CD2"
slusname = "PE-FR.CD2"
--- slusname = "SLUS_006.68"
fmvdir = "FMV2"
is_cd1 = false
is_cd2 = true
@@ -34,7 +32,6 @@ function mainpatch()
systemcnf = Buffer()
systemcnf:write(systemcnfstring)
dirent = cdutil:findpath("/SYSTEM.CNF;1")
--- iso:createfile(root, "SYSTEM.CNF", cdfile(cdutil, dirent), dirent)
iso:createfile(root, "SYSTEM.CNF", systemcnf, slusdirent)
print "Reading CD's slus file"
@@ -62,7 +59,6 @@ function mainpatch()
startsect = iso:createfile(root, "PE.TIM", tim, dirent).sector
print "Compiling IMG file"
do_img_file(slus, startsect, pesect)
--- iso:createfile(root, "PE.IMG", peimg, dirent)
print "Writing final main file"
slus:seek(0)
@@ -227,6 +223,28 @@ function do_img_file(slus, startsect, pesect)
end
end
+function patch_menu(sector, size)
+ local menu, bmenu, i, v, o
+ menu = Input("menus.bin")
+ bmenu = Buffer(true)
+ bmenu:copyfrom(menu)
+
+ bmenu:seek(0x28)
+ o = bmenu:readU32()
+ bmenu:seek(0)
+ bmenu:wseek(0)
+
+ for i = 78, 144 do
+ v = slus_hacks[0x81ea1][i]
+ if (v == 0) then
+ break
+ end
+ bmenu[o + i - 1] = (v - 1) * 16
+ end
+
+ return bmenu
+end
+
function patch_map(sector, size)
local map, font, names, buff
@@ -375,7 +393,7 @@ end
files = {
[1] = "various.bin",
- [2] = "menus.bin",
+ [2] = patch_menu,
[10] = "font.tim",
[70] = "mainmenu.bin",
[72] = patch_map,
@@ -442,19 +460,36 @@ slus_hacks = {
-- Font width table
- [0x81ea1] = { 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6,
- 6, 8, 11, 14, 9, 8, 7, 8, 7, 7, 8, 9,
- 6, 7, 9, 8, 11, 9, 7, 8, 7, 9, 7, 7,
- 9, 9, 11, 7, 9, 7, 9, 4, 7, 6, 4, 4,
- 8, 8, 7, 7, 7, 7, 8, 9, 5, 4, 8, 5,
- 11, 9, 7, 8, 8, 7, 6, 5, 9, 9, 11, 7,
- 9, 6, 4, 4, 7, 7, 7, 7, 7, 7, 7, 7,
- 5, 5, 7, 7, 9, 9, 9, 7, 11, 11, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0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