* Add i2c read support to lua
* Add i2c write support to lua
With memory permissions before write
* Adjust i2c write
* Fix inverted id check, better permissions
* Change write to not return anything on success
* Add some documentation for lua i2c
* Change write length from 1024 to 64
* Add whitelist for i2c writing
* Move i2c module into preload
* Add registers and bitmasks for mcu
Add documentation to lua-doc
* Fix missing column divider in lua-doc
* Add ~= 0 then to lua example
* Add some more registers
* Add cart_id2 to gamecart.h
This prepares changes to fix private header dumps.
The name ID2 matches Lotus3 (see Switchbrew) since it's evident Lotus3 is just a continuation of the 3DS cart controller
* Add Cart_GetID2() to protocol.h
This prepares changes to fix private header dumps.
The name ID2 matches Lotus3 (see Switchbrew) since it's evident Lotus3 is just a continuation of the 3DS cart controller.
* gc protocol: Add support to get ID2
This renames the unknowna0_cmd to its proper name and the A0_Response to CartID2, matching Lotus3 terminology.
* Store ID2 in private header at +0x44
The ID2 contains important information that in particular determines the cryptographic keys used. It is impossible to decrypt a dump of cart<->controller communications without knowing the ID2 or trying all possible keys.
This behavior matches Gateway. I suppose that it was presumed that Gateway would always store zeroes there because regular cartridges on retail would always report zero and then everybody just copied this false assumption.
* fix build (gamecart.c): memset->memcpy
* fix build (protocol.c): Fix dupe definition of Cart_GetID()
* Add gyro model detection
* Add gyro detection to sysinfo
* Add gyro model as lua global
* Normalize line endings to LF
* Add documentation, add var to gm9 script, change model to start at 1
* Scripting: Normalize output of FormatBytes
* lua: Add flag to use locale when formatting bytes
Co-Authored-By: ihaveahax <ian@ianburgwin.net>
---------
Co-authored-by: ihaveahax <ian@ianburgwin.net>
* lua-doc: Fix fs.find_all documentation
It returns an array, not a string. Also document return information.
* lua-doc: Remove TODO for fs.verify_with_sha_file
No reason to add fs.read_file errors here as that function gets
pcall-ed. If it fails, nil gets returned.
* lua-doc: Consistently refer to tables/arrays as tables
That's what they're called within Lua all the time.
* lua-doc: fix incorrect references to util module
string.find has pattern matching by default, so it was incorrectly
reading "r+" when the mode was supposed to be "r". So this disables the
pattern matching and does a plain substring search.
This option is confusing because despite it saying "will completely
remove CFW", it is not sufficient to actually fully remove custom
firmware. It doesn't, and can't, detect everything like region changes,
modified system titles, and other things that could brick a stock
console.
There have been numerous cases of bricked consoles because someone saw
this, thinking it would do everything needed to restore a console back
to an unmodified state, and getting a bricked console that needs a
flashcart purchase to fix.
(There is also a issue where, even if everything else was in order, it
can still brick a console due to a bad SD card. For some reason it
copies the FIRM to the SD card, where it can potentially get corrupted
if a counterfeit card was used.)
A proper uninstall guide is required, and we have one here:
https://3ds.hacks.guide/uninstall-cfw