Skip to content

Commit

Permalink
added make-rom-vc and patch-vc
Browse files Browse the repository at this point in the history
  • Loading branch information
glankk committed Feb 22, 2018
1 parent 6f9bbd2 commit 4839e3c
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 18 deletions.
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ endef
define hooks_template =
HOOKS-$(1) = $$(DIR-$(1))/hooks.gsc
$$(HOOKS-$(1)) : $$(ELF-$(1))
AS="$$(AS)" CC="$$(CC)" NM="$$(NM)" READELF="$$(READELF)" CPPFLAGS="$$(CPPFLAGS)" $$(GENHOOKS) $$< > $$@
AS="$$(AS)" CC="$$(CC)" NM="$$(NM)" READELF="$$(READELF)" CPPFLAGS="$$(subst ",\",$$(CPPFLAGS))" $$(GENHOOKS) $$< > $$@
$(1)-hooks : $$(HOOKS-$(1))
clean-$(1)-hooks :
rm -f $$(HOOKS-$(1))
Expand Down
18 changes: 2 additions & 16 deletions patch/lua/make-patch-vc.lua
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
local arg = {...}
if #arg < 1 then
print("usage: `make-patch-vc <rom-file>`")
return
end
wiivc = true
local make = loadfile("patch/lua/make.lua")
for i = 1, #arg do
print("making patch for `" .. arg[i] .. "`")
local rom_info, rom, patched_rom = make(arg[i])
if rom_info ~= nil then
print("saving patch")
local rom_id = rom_info.game .. "-" .. rom_info.version .. "-" .. rom_info.region
gru.ups_create(rom, patched_rom):save("patch/ups/gz-" .. rom_id .. ".ups")
end
end
print("done")
local make_patch = loadfile("patch/lua/make-patch.lua")
return make_patch(...)
3 changes: 3 additions & 0 deletions patch/lua/make-rom-vc.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
wiivc = true
local make_rom = loadfile("patch/lua/make-rom.lua")
return make_rom(...)
3 changes: 3 additions & 0 deletions patch/lua/patch-vc.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
wiivc = true
local patch = loadfile("lua/patch.lua")
return patch(...)
2 changes: 1 addition & 1 deletion patch/lua/patch-wad.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ if #arg < 1 then
if line == nil or line == "" then return end
arg[1] = line
end
wiivc = true
local gzinject = os.getenv("GZINJECT")
if gzinject == nil or gzinject == "" then
gzinject = "gzinject"
end
wiivc = true
require("lua/rom_table")
local n = 0
for i = 1, #arg do
Expand Down
5 changes: 5 additions & 0 deletions patch/make-rom-vc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh
set -e

cd $(dirname $(readlink -f $0))/..
gru patch/lua/make-rom-vc.lua "$@"
7 changes: 7 additions & 0 deletions patch/make-rom-vc.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@echo off
setlocal
pushd .
%~d0
cd %~dp0/..
gru patch/lua/make-rom-vc.lua %*
popd
6 changes: 6 additions & 0 deletions patch/patch-vc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env sh
set -e

cd $(dirname $(readlink -f $0))
export PATH="$(readlink -f ./bin):$PATH"
gru lua/patch-vc.lua "$@"
8 changes: 8 additions & 0 deletions patch/patch-vc.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@echo off
setlocal
pushd .
%~d0
cd %~dp0
set PATH=./bin;%PATH%
gru lua/patch-vc.lua %*
popd

0 comments on commit 4839e3c

Please sign in to comment.