I'm following this guide to get the RAW values from gameshark codes.
To avoid math errors i've made this little bash script to automate the conversion:
(this is part of a bigger script)
Now i'm trying to patch this code into "Mischief Makers (U) [!].z64":
the converted RAW codes are:
I've also found this alternative one in the PJ64 db:
Which is converted to:
I've tried patching both RAW codes, but none of them are working!
To avoid math errors i've made this little bash script to automate the conversion:
Code:
ADDR=${line:2:6}
HEXADDR="0x$ADDR"
# compute the correct offset according to the address range using bc
if [[ $HEXADDR -gt 0x246000 && $HEXADDR -lt 0x333000 ]]; then # check range 8x246000-333000
OFF=$( echo "ibase=16;obase=10; $ADDR-245000" | bc )
elif [[ $HEXADDR -gt 0x0EB180 && $HEXADDR -lt 0x0F083C ]]; then # check range 8x0EB180-0F083C
OFF=$( echo "ibase=16;obase=10; $ADDR+12EC80" | bc )
else
echo "$(basename $0): unsupported code: $line"
continue
fi
# read the value
V1=${line:9:2}
V2=${line:11:2}
echo "$line" | grep -E '^81'
if [ $? -eq 0 ]; then
# code type 81=write 2 bytes
echo "$(basename $0): patching code: $OFF:$V1"
ucon64 --nbak --poke=$OFF:$V1 "$OUTPUTROMFILE" > /dev/null
OFF=$( echo "ibase=16;obase=10; $OFF+1" | bc ) # increase offset by 1
echo "$(basename $0): patching code: $OFF:$V2"
ucon64 --nbak --poke=$OFF:$V2 "$OUTPUTROMFILE" > /dev/null
else
# code type 80=write 1 byte
ucon64 --nbak --poke=$OFF:$V2 "$OUTPUTROMFILE" > /dev/null
fi
Now i'm trying to patch this code into "Mischief Makers (U) [!].z64":
Code:
Infinite Health 812F8EC8 2400
Code:
B3EC8:24 B3EC9:00
Code:
Infinite Health 810ED0E0 03E8
Code:
21BD60:03 21BD61:E8

Comment