mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-15 19:19:58 -04:00
The action prompt at the top right of the HUD draws the four face buttons as a diamond in the console's places: A right, B bottom, X top, Y left. Under pad_layout = xbox, playstation or auto the A action is the bottom button, yet the diamond kept A on the right, so the prompt pointed at the wrong button. At start the runtime now edits the prompt's layout in the shared interface archive for such a layout (the buttons, the dots and the lit crosses move, and the bubbles of X and Y flip) and serves the result from the profile folder; with nintendo, the default, nothing is changed. Every field is found and checked before anything is written, so a layout a mod changed is left as it is, and the archive is packed again with the game's own dictionary at the same unpacked size. One SARC reader and dictionary lookup now serve this, the camera pack and the menu's assets. When the layout changes, the menu's Restart counts the diamond. tests/action_prompt_check.py passes without game files and on the game's own archive (4 copies, 208 fields, 13 ms at start). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
25 lines
1.2 KiB
C
25 lines
1.2 KiB
C
// SARC archives and the zstd dictionaries of Pack/ZsDic.pack.zs (sarc.c).
|
|
#ifndef SARC_H
|
|
#define SARC_H
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
// The next member of the SARC p[0..n) from member *next on that is named `name` (any member when name is NULL): 1 with
|
|
// its start and size, *next moved past it; 0 when no such member is left; -1 when the archive is damaged (its header,
|
|
// or the found member's range).
|
|
int sarc_next(const uint8_t *p, size_t n, const char *name, unsigned *next, size_t *at, size_t *size);
|
|
|
|
// The first member named `name`: 1 with its start and size; 0 when there is none or the archive is damaged.
|
|
int sarc_member(const uint8_t *p, size_t n, const char *name, size_t *at, size_t *size);
|
|
|
|
// Pack/ZsDic.pack.zs's archive (z[0..zn), a frame compressed without a dictionary) unpacked: malloc'd, *n its size;
|
|
// NULL when it is not a zstd frame that says its size, or that size is over max.
|
|
uint8_t *zsdic_unpack(const void *z, size_t zn, size_t max, size_t *n);
|
|
|
|
// The dictionary with id `id` among the members of that archive (dics[0..n)): 1 with its start and size; 0 when none
|
|
// has it (and always for id 0, the id of a frame without a dictionary).
|
|
int zsdic_find(const uint8_t *dics, size_t n, unsigned id, size_t *at, size_t *size);
|
|
|
|
#endif
|