1
0
Fork 0
mirror of https://github.com/notwa/mm synced 2024-11-04 22:49:03 -08:00
This commit is contained in:
Connor Olding 2016-04-07 04:03:04 -07:00
parent 4c05e280c8
commit 85c02b8352
5 changed files with 16 additions and 21 deletions

10
.gitignore vendored
View file

@ -1,5 +1,9 @@
* - Copy*
cm oot save.lua
cm mm save.lua
__pycache__/*
*.7z
*.State
*.bin
*.exe
*.z64
__pycache__/*
cm mm save.lua
cm oot save.lua

2
patch/.gitignore vendored
View file

@ -1,5 +1,3 @@
*.z64
*.bin
patchme
lips
entrances.asm

View file

@ -37,16 +37,11 @@ comp() {
rm patchme/"$1"
}
#if ! [ -d "$extracted" ]; then
if [ $fast -eq 0 ] || [ ! -d patchme ]; then
[ -d patchme ] && rm -r patchme
(cd ..; ./z64dump.py -c "$rom")
mv ../"$sha1" patchme
fi
#if [ $fast -eq 0 ]; then
# [ -d patchme ] && rm -r patchme
# cp -r "$extracted" patchme
#fi
unc "$code"

View file

@ -256,7 +256,6 @@ def create_rom(d, compress=False):
if compressed:
pe = align(start_p + size_p)
ve = vs + int.from_bytes(data[4:8], 'big')
#ve = vs + len(Yaz0.decode(data))
else:
pe = 0
ve = vs + size_v

View file

@ -131,9 +131,6 @@ static int encodeYaz0(u8 *src, u8 *dst, int srcSize)
// write eight codes
if (validBitCount == 8) {
//fwrite(&currCodeByte, 1, 1, dstFile);
//fwrite(buf, 1, bufPos, dstFile);
dst[dstPos++] = currCodeByte;
for (int j = 0; j < bufPos; j++)
dst[dstPos++] = buf[j];
@ -145,9 +142,6 @@ static int encodeYaz0(u8 *src, u8 *dst, int srcSize)
}
if (validBitCount > 0) {
//fwrite(&currCodeByte, 1, 1, dstFile);
//fwrite(buf, 1, bufPos, dstFile);
dst[dstPos++] = currCodeByte;
for (int j = 0; j < bufPos; j++)
dst[dstPos++] = buf[j];
@ -175,7 +169,7 @@ void decompress(u8 *src, u8 *dst, int uncompressedSize)
validBitCount = 8;
}
if((currCodeByte & 0x80) != 0) {
if ((currCodeByte & 0x80) != 0) {
// straight copy
dst[dstPlace] = src[srcPlace];
dstPlace++;
@ -190,11 +184,12 @@ void decompress(u8 *src, u8 *dst, int uncompressedSize)
u32 copySource = dstPlace - (dist + 1);
u32 numBytes = byte1 >> 4;
if(numBytes == 0) {
if (numBytes == 0) {
numBytes = src[srcPlace] + 0x12;
srcPlace++;
} else
} else {
numBytes += 2;
}
// copy run
int i;
@ -211,12 +206,16 @@ void decompress(u8 *src, u8 *dst, int uncompressedSize)
}
}
int main(int argc, char *argv[])
{
for (int i = 1; i < argc; i++) {
FILE *f = fopen(argv[i], "rb");
if (f == NULL) {
perror(argv[1]);
exit(1);
}
fseek(f, 0, SEEK_END);
long size = ftell(f);
fseek(f, 0, SEEK_SET);