Pastebin
API
tools
faq
paste
Login
Sign up
Please fix the following errors:
New Paste
Syntax Highlighting
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from Build import Patch, braindead import struct, os.path b = bytes.fromhex UL = lambda v: struct.pack(">L", v & 0xFFFFFFFF) UH = lambda v: struct.pack(">H", v & 0xFFFF) AH = lambda v: struct.pack(">H", ((v >> 16) | bool(v & 0x8000)) & 0xFFFF) name = os.path.splitext(os.path.basename(__file__))[0] path = lambda *args: os.path.join(os.path.dirname(__file__), *args) # Would be kinda nice to write up filetables for these to automate regional patches. source = path("007 - GoldenEye (USA).n64") filename = path(f"{name}.n64") # .: Patches :. # Patch dependency fields left unused. Assume all listed are interdependent. patches = [ Patch(name="Recycle Control Style Lock", ver = 1.0, desc = "Reuses 8002B558. This eliminates any problem with solo settings clobbering MP settings. Six flags per player remain unused.", patch =(# 01 -> 80040A84 Look Up/Down Reverse/Upright # 02 -> 80040AB4 Look Ahead Off/On # 7F0104A0: w/i reset MP options for selected scenario ('0', 0x44FD0, 8), # Dirty fixes to force lock value. ('d', 0x4551C, b("24080001")), # 7F0109EC ('d', 0x461E0, b("24180001")), # 7F0116B0 # Initialize to 0. # 7F00B9E8: initialize menu 05: file select screen ('d', 0x40525, b("03")), ('d', 0x4052C, b("AC60B558")), ('d', 0x40531, b("62")), ('d', 0x40535, b("60")), ), ), Patch(name="menu 11 interface: control style", ver = 1.0, desc = "Menu interface. Two-controller styles are removed.", patch =(# 7F013698 0x481C8 loop per player ('d', 0x481A6, UH(0x63)), ('d', 0x481C8, b("824E0000 11C0000A 02202025 0C0030EB 24054000 1040004C 3C048006 A2400000 8C843720 240500C7 0C002382 00003025 02202025 2405FFFE 0C00312D 03C03025 26540020 868A0002 004A8024 2401FFFF 10410002 A6800002 50400001 A6810002 2A01FFFF 14200004 02202025 0C0030EB 24050202 10400004 82620003 244CFFFF 318C0003 A26C0003 1E000004 02202025 0C0030EB 24050101 10400004 82620003 24480001 31080003 A2680003 02202025 2405FFFE 0C00314A 03C03025 868A0000 004A8024 2401FFFF 10410002 A6800000 50400001 A6810000 02202025 0C0030EB 24050C0C 2A01FFFF 14200007 240CFFFF 30410404 14200004 30410808 1E000002 240C0001 10200006 3C018003 00310823 8022B55B 004C6021 318C0003 A02CB55B 02202025 0C0030EB 3405B000 10400006 3C048006 A25E0000 8C843720 240500C7 0C002382 00003025")), # Close the pocket. 0xFC unused. ('d', 0x4840C, b('82')), ('d', 0x48425, b('73')), ('d', 0x4842A, UH(-0x5A)), ('s', 0x4840C, 0x481C8 + 0x148, 0xA4), ), ), Patch(name="menu 11 constructor: control style", ver = 1.0, desc = "Menu constructor. Requires the two string IDs are both EVEN numbers! An OR wouldn't work otherwise.", patch =(# Executed in order written. ('d', 0x4857A, UH(0x79)), ('d', 0x485A8, b('0FC04F22')), # Splits setting flags into registers. ('d', 0x48628, b('2631')), # p->DL is reusing V0, kinda dodgy to begin with. ('d', 0x48678, b('AE2DFFF8')), ('d', 0x486AC, b('AE2FFFFC')), ('d', 0x486B0, b("3C188007 00160880 0301C021 83099740 0015C843 34049D1D 03332821 AFA50074 15200004 02203825 0FC04F2D 26460028 00403825 3C0E8007 00160880 01C17021 81CF97BB 3C048003 2646003E 8FA50074 000FC080 00982021 0FC04F2D 9484B4F0 00403825 3C048004 00962023 80840A87 2646004E 8FA50074 0FC04F2D 34849D2E 00403825 3C048004 00962023 80840AB7 2646005D 8FA50074 0FC04F2D 34849D30 8FA800CC 26D60001 16C8FF96 00408825")), ('s', 0x4886C, 0x486B0 + 0xB0, 0x3C), # Utilize the freed space for some subfunctions. # *) 7F013C88 0x487B8 copy MP look settings to player registers (0x2C) ('d', 0x487B8, b('3C018003 8C22B558 3C030101 34630101 00020842 00431024 00231824 3C018004 AC220A84 03E00008 AC230AB4')), # *) 7F013CB4 0x487E4 V0 = p->DL; print textID A0 centered at (A1, A2) (0xC4) ('d', 0x487E4, b('27BDFFC8 AFBF0034 AFA70044 AFA60040 0FC30776 AFA5003C 3C018004 8C2A0EB4 AFA20038 27A4002C 27A50030 00403025 8C270EB8 AFA00014 0FC2BA63 AFAA0010 8FA5003C 8FA2002C 8FA60040 8FA30030 00021043 00C23023 00031843 00A32823 AFA5002C 0C001107 AFA60030 0C00110B AFA2001C AFA20020 0FC2B366 8FA40044 3C018004 8C2D0EB8 8C2C0EB4 240B00FF AFAB0018 00402025 27A5002C 27A60030 8FA70038 AFA00024 AFA00028 AFAD0010 0FC025D8 AFAC0014 8FBF0034 03E00008 27BD0038')), ), ), Patch(name="Look Settings in MP", ver = 1.0, desc = "Applies look-ahead and upright/reverse in MP matches.", patch =(# w/i MP conditional in 7F0793EC. ('d', 0xADF48, b('AFA20010 3C038008 8C6EA0B0 0FC04F22 ADC20430 00000000 00000000 0FC29374 8FA40010')), ), ), Patch(name="Reg getter/setter", ver = 1.0, desc = "Reduces a couple functions to add player# support to the set/get functions.", patch =(## Leaving out the setter for now. It complicates the solo watch menu unnecessarily and it's okay for solo to clobber the settings. ## # 7F0A4D74 0xD98A4 (reduced; 0x34) ## ('d', 0xD98A4, b('AFBFFFFC 0C002E7E 27BDFFE8 28410002 14200004 00000000 0FC29370 00000000 28410004 8FBF0014 27BD0018 03E00008 38220001')), ## # 7F0A4DAC 0xD98DC partial: V0[player] = A0 (0x14) ## ('d', 0x486B0, b('3C038008 8C63A0B8 00431023 03E00008 A0440003')), ## ('d', 0xD9978, b('0BC2936B 2422')), # player look up/down setter ## ('d', 0xD99A8, b('0BC2936B 2422')), # player look-ahead setter # 7F0A4DD4 0xD9904 (reduced; 0x48) ('d', 0xD9904, b('8C63A0B0 44842000 3C198005 AC642A58 468021A0 2402000A AC642A5C E4662A60 8F3984D0 57200001 2402000E 00440019 240B0001 00004012 00084823 AC692A64 03E00008 AC6B2A68')), # 7F0A4E24 0xD9954 partial: V0 = V0[player] (0x14) ('d', 0xD9954, b('3C038008 8C63A0B8 00431023 03E00008 90420003')), ('d', 0xD996C, b('0BC29389 24')), # player look up/down getter ('d', 0xD999C, b('0BC29389 24')), # player look-ahead getter ## # 7F0A9ABC: A single manual read in solo watch menu page 2... ## ('d', 0xDE5EC, b('81CE0A87')), ## # 7F0AB9FC: a few more in solo watch menu page 3... ## ('d', 0xE04D4, b('8102000B')), ## ('d', 0xE052C, b('8102000B')), ## ('d', 0xE05A0, b('8102000B')), ), ), ] file_replacements = ( # Filename f/ table, offset, data type, ..., bytes-like object or filename. ("LtitleE.rz", 0x8F5F20, 'bin', 'insert', 'LtitleZ.rz'), ) # .: Run Me :. def main(): braindead(name) input("Press Enter to quit.") if __name__ == '__main__': main()
Optional Paste Settings
Category:
None
Cryptocurrency
Cybersecurity
Fixit
Food
Gaming
Haiku
Help
History
Housing
Jokes
Legal
Money
Movies
Music
Pets
Photo
Science
Software
Source Code
Spirit
Sports
Travel
TV
Writing
Tags:
Syntax Highlighting:
None
Bash
C
C#
C++
CSS
HTML
JSON
Java
JavaScript
Lua
Markdown (PRO members only)
Objective C
PHP
Perl
Python
Ruby
Swift
4CS
6502 ACME Cross Assembler
6502 Kick Assembler
6502 TASM/64TASS
ABAP
AIMMS
ALGOL 68
APT Sources
ARM
ASM (NASM)
ASP
ActionScript
ActionScript 3
Ada
Apache Log
AppleScript
Arduino
Asymptote
AutoIt
Autohotkey
Avisynth
Awk
BASCOM AVR
BNF
BOO
Bash
Basic4GL
Batch
BibTeX
Blitz Basic
Blitz3D
BlitzMax
BrainFuck
C
C (WinAPI)
C Intermediate Language
C for Macs
C#
C++
C++ (WinAPI)
C++ (with Qt extensions)
C: Loadrunner
CAD DCL
CAD Lisp
CFDG
CMake
COBOL
CSS
Ceylon
ChaiScript
Chapel
Clojure
Clone C
Clone C++
CoffeeScript
ColdFusion
Cuesheet
D
DCL
DCPU-16
DCS
DIV
DOT
Dart
Delphi
Delphi Prism (Oxygene)
Diff
E
ECMAScript
EPC
Easytrieve
Eiffel
Email
Erlang
Euphoria
F#
FO Language
Falcon
Filemaker
Formula One
Fortran
FreeBasic
FreeSWITCH
GAMBAS
GDB
GDScript
Game Maker
Genero
Genie
GetText
Go
Godot GLSL
Groovy
GwBasic
HQ9 Plus
HTML
HTML 5
Haskell
Haxe
HicEst
IDL
INI file
INTERCAL
IO
ISPF Panel Definition
Icon
Inno Script
J
JCL
JSON
Java
Java 5
JavaScript
Julia
KSP (Kontakt Script)
KiXtart
Kotlin
LDIF
LLVM
LOL Code
LScript
Latex
Liberty BASIC
Linden Scripting
Lisp
Loco Basic
Logtalk
Lotus Formulas
Lotus Script
Lua
M68000 Assembler
MIX Assembler
MK-61/52
MPASM
MXML
MagikSF
Make
MapBasic
Markdown (PRO members only)
MatLab
Mercury
MetaPost
Modula 2
Modula 3
Motorola 68000 HiSoft Dev
MySQL
Nagios
NetRexx
Nginx
Nim
NullSoft Installer
OCaml
OCaml Brief
Oberon 2
Objeck Programming Langua
Objective C
Octave
Open Object Rexx
OpenBSD PACKET FILTER
OpenGL Shading
Openoffice BASIC
Oracle 11
Oracle 8
Oz
PARI/GP
PCRE
PHP
PHP Brief
PL/I
PL/SQL
POV-Ray
ParaSail
Pascal
Pawn
Per
Perl
Perl 6
Phix
Pic 16
Pike
Pixel Bender
PostScript
PostgreSQL
PowerBuilder
PowerShell
ProFTPd
Progress
Prolog
Properties
ProvideX
Puppet
PureBasic
PyCon
Python
Python for S60
QBasic
QML
R
RBScript
REBOL
REG
RPM Spec
Racket
Rails
Rexx
Robots
Roff Manpage
Ruby
Ruby Gnuplot
Rust
SAS
SCL
SPARK
SPARQL
SQF
SQL
SSH Config
Scala
Scheme
Scilab
SdlBasic
Smalltalk
Smarty
StandardML
StoneScript
SuperCollider
Swift
SystemVerilog
T-SQL
TCL
TeXgraph
Tera Term
TypeScript
TypoScript
UPC
Unicon
UnrealScript
Urbi
VB.NET
VBScript
VHDL
VIM
Vala
Vedit
VeriLog
Visual Pro Log
VisualBasic
VisualFoxPro
WHOIS
WhiteSpace
Winbatch
XBasic
XML
XPP
Xojo
Xorg Config
YAML
YARA
Z80 Assembler
ZXBasic
autoconf
jQuery
mIRC
newLISP
q/kdb+
thinBasic
Paste Expiration:
Never
Burn after read
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Exposure:
Public
Unlisted
Private
Folder:
(members only)
Password
NEW
Enabled
Disabled
Burn after read
NEW
Paste Name / Title:
Create New Paste
Hello
Guest
Sign Up
or
Login
Sign in with Facebook
Sign in with Twitter
Sign in with Google
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Public Pastes
Untitled
JSON | 1 hour ago | 45.87 KB
Free Crypto Method
JavaScript | 1 hour ago | 0.15 KB
Exploit
PHP | 1 hour ago | 0.39 KB
FREE ETHEREUM METHOD
CSS | 1 hour ago | 0.39 KB
Free Crypto Method
C++ | 1 hour ago | 0.39 KB
Free Crypto Method
Puppet | 1 hour ago | 0.39 KB
Free Crypto Method
Lua | 1 hour ago | 0.39 KB
Guide
CSS | 1 hour ago | 0.38 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!