yo! no more FLIPS?

master
Lucent 2023-10-11 12:24:19 +02:00
parent 7c262f4f64
commit eb93656ec0
4 changed files with 19 additions and 6 deletions

2
.gitignore vendored
View File

@ -1,5 +1,3 @@
__pycache__/**
*.gba
settings.json
flips/flips
flips/flips.exe

View File

@ -10,11 +10,13 @@ Considering the original repository states that the software is GPL-3.0 licensed
- [x] GUI
- [x] CRC verification
- [ ] Logic
- [ ] Patching
- [ ] Reconstructing missing parts of code
- [x] Patching
- [ ] Generating BPS patches
## Usage
Beware: stuff doesn't work as it should yet. Prerequisites are PySimpleGUI (and tkinter by proxy). A prerequisites file is going to be added in the future.
Beware: stuff doesn't work as it should yet. Prerequisites are PySimpleGUI (and tkinter by proxy) and python-bps-continued. A prerequisites file is available so you can `pip install -r requirements.txt` away.
Clone the repository, install prerequisites manually via pip or your favourite package manager, `python MFOR.py`. Choose your game options (hover over a given option to see a tooltip explaining it), then click Generate. A popup will ask you to open an unmodified copy of the original game. This is not provided with the randomizer for legal reasons.

View File

@ -13,6 +13,8 @@ import zlib
import math
import Fusion_Graph as Graph
from Fusion_Items import *
from bps.apply import apply_to_files
version = '0.11.6'
def ceiling(num, denom):
@ -4665,8 +4667,17 @@ def patch_game():
os.system('.\\armips\\armips.exe "Metroid Fusion Open Randomizer.asm" -root ".\\data\\asm" -sym ".\\temp.sym"')
os.replace('.\\data\\MFOR.gba', '.\\seeds\\{}.gba'.format(FileName))
else:
# FIXME: windows?
os.system(os.path.join('.', 'flips', 'flips') + ' --apply ' + os.path.join('.', 'data', 'MFOR.bps') + ' "' + BaseName + '" "'+ os.path.join('.', 'seeds', '{}.gba'.format(FileName)) + '"')
source = open(BaseName, 'rb')
target = open(os.path.join('.', 'seeds', '{}.gba'.format(FileName), 'wb')
patch = open(os.path.join('.', 'data', 'MFOR.bps'), 'rb')
try:
apply_to_files(patch, source, target)
except:
target.close()
os.unlink(os.path.join('.', 'seeds', '{}.gba'.format(FileName))
print('Error: failed to patch game with base patch!')
sys.exit(1)
checksum = fileHash(os.path.join('.', 'seeds', '{}.gba'.format(FileName)))
if checksum != 2455114263:
os.remove(os.path.join('.', 'seeds', '{}.gba'.format(FileName)))

2
requirements.txt 100644
View File

@ -0,0 +1,2 @@
PySimpleGUI==4.60.5
python-bps-continued==7