From d2acfe1c3e118751665285f25702ad74692451a3 Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Sat, 12 Nov 2022 06:31:07 +0000 Subject: [PATCH] Enable video capture and screenshots if disabled --- README.md | 4 +--- nton/main.py | 11 +++++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 91e072d..eaee286 100644 --- a/README.md +++ b/README.md @@ -62,10 +62,8 @@ Take a look at `nton build --help` for advanced usage like changing the Icon, Ti - [X] Rewrite as a Python script to heavily improve the user experience and code. - [X] Combine the Drive letter and Path arguments and manually split them when they need to be separate instead. - [X] Automate name and publisher by extracting from the extracted `control.nacp`. +- [X] Force enable video capture and screenshots in the extracted `control.nacp`. - [ ] Force disable save data allocation. Fixed in [v3.3.5 of Nro2NSP](https://github.com/Root-MtX/Nro2Nsp/releases/tag/3.3.5). -- [ ] Force enabling recording by editing the NROs extracted `control.nacp` at offset 0x3035 from 0 to 2 (forced). - Forced is a lot better than 1 (manual) as it allows the video to be saved. A way to enable screenshots should be done as well. - [SAK](https://github.com/dezem/SAK) has a way to do this. - [ ] Add support for direct RetroArch Game Forwarding. - [ ] Maybe a new GUI one day, and let you override the icons and such? diff --git a/nton/main.py b/nton/main.py index 9264a33..36071de 100644 --- a/nton/main.py +++ b/nton/main.py @@ -125,6 +125,17 @@ def build(path: Path, name: str | None, publisher: str | None, icon: Path | None log.debug("Got the Control partition") log.debug(base64.b64encode(control_file_data).decode()) + # enable video capture and screenshots if disabled + if control_file_data[0x3035] != 0x02: + # 0x00 = Disabled, 0x01 = Manual, 0x02 = Enabled + control_file_data[0x3035] = 0x02 + log.info("Enabled Video Capture") + if control_file_data[0x3034] != 0x00: + # 0x00 = Enabled, 0x01 = Disabled + control_file_data[0x3034] = 0x00 + log.info("Enabled Screenshots") + control_file.write_bytes(control_file_data) + if not name: # TODO: Assumes first region/language of the NROs title/name data is wanted # Is UTF8 or ANSI wanted here when decoding? UTF8 should be fine